/* 1game.su — native cover proportions + dense column packing (no empty holes) */

/* ── Popular section shell ── */
.gg-popular {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  margin: 20px 0 28px;
  padding: 28px 20px 24px;
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.14);
  background: linear-gradient(165deg, #0c1a3a 0%, #070d1a 45%, #030508 100%);
}

.gg-popular__head {
  order: 1;
  flex: 0 0 auto;
  width: 100%;
  margin: 0 0 20px;
  padding: 0 4px;
  text-align: left;
  font-size: 0 !important;
  line-height: 0 !important;
  color: transparent !important;
  user-select: none;
  min-height: 1.2em;
  display: block !important;
  visibility: visible !important;
}

.gg-popular__head::after {
  content: "ПОПУЛЯРНОЕ";
  display: block;
  width: 100%;
  font-size: clamp(22px, 3.2vw, 32px);
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
  text-align: left;
  background: linear-gradient(
    105deg,
    #8b6914 0%,
    #d4af37 18%,
    #ffe566 42%,
    #fff4c2 50%,
    #ffe566 58%,
    #d4af37 82%,
    #8b6914 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(212, 175, 55, 0.35));
  animation: gg-popular-gold-shine 4s linear infinite;
}

@keyframes gg-popular-gold-shine {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

/* ── Dense packing: columns fill holes under short tiles ── */
.gg-popular__grid,
.gg-games__grid {
  order: 2;
  width: 100%;
  display: block !important;
  grid-template-columns: none !important;
  column-count: 6;
  column-gap: 14px;
  align-items: unset !important;
}

.gg-popular__grid .gg-popular__card,
.gg-games__grid .gg-game {
  display: inline-block;
  width: 100%;
  max-width: none;
  margin: 0 0 14px;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  page-break-inside: avoid;
  vertical-align: top;
}

/* ── Beat Angular scoped styles in .gg-popular ── */
.gg-popular .gg-popular__card {
  padding: 0 0 10px !important;
  margin: 0 0 14px !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.gg-popular .gg-popular__thumb {
  aspect-ratio: unset !important;
  overflow: visible !important;
  background: transparent !important;
  display: block !important;
  align-items: unset !important;
  justify-content: unset !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.gg-popular .gg-popular__thumb img,
.gg-popular .gg-popular__thumb img[_ngcontent] {
  width: 100% !important;
  height: auto !important;
  max-height: none !important;
  object-fit: unset !important;
  object-position: center top !important;
  border-radius: 12px !important;
  border: 2px solid rgba(212, 175, 55, 0.28) !important;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.42) !important;
  background: #0a0e18 !important;
}

.gg-popular .gg-popular__card:hover .gg-popular__thumb img {
  transform: translateY(-3px) !important;
  border-color: rgba(243, 201, 79, 0.62) !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(243, 201, 79, 0.15) !important;
}

.gg-popular .gg-popular__name {
  margin-top: 8px !important;
  font-size: 11px !important;
  color: rgba(255, 255, 255, 0.92) !important;
  white-space: normal !important;
  text-overflow: unset !important;
  overflow: hidden !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  min-height: 2.6em !important;
  text-align: center !important;
}

.gg-popular .gg-popular__card:hover .gg-popular__name {
  color: #f3d77f !important;
}

.gg-popular .gg-popular__head {
  margin-bottom: 20px !important;
  font-size: 0 !important;
  line-height: 0 !important;
  color: transparent !important;
}

/* ── Card = title only; cover is the image itself ── */
.gg-popular__card,
.gg-game {
  width: 100%;
  max-width: 200px;
  box-sizing: border-box;
  padding: 0 0 10px;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
}

.gg-popular__card:focus-visible,
.gg-game:focus-visible {
  outline: 2px solid rgba(255, 215, 0, 0.75);
  outline-offset: 3px;
  border-radius: 12px;
}

/* ── Cover sleeve: wrapper hugs image, native proportions ── */
.gg-popular__thumb,
.gg-game__img {
  position: relative;
  flex: 0 0 auto;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  overflow: visible;
  aspect-ratio: unset;
  box-shadow: none;
}

/* Обложка — рамка только на картинке, без внешней коробки */
.gg-popular__thumb img,
.gg-popular .gg-popular__thumb img,
.gg-popular__thumb img[_ngcontent],
.gg-game__img img,
.gg-game__img img[_ngcontent] {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: none !important;
  object-fit: unset !important;
  object-position: center top !important;
  margin: 0 auto;
  border-radius: 12px;
  border: 2px solid rgba(212, 175, 55, 0.28);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.42);
  background: #0a0e18;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.gg-popular__card:hover .gg-popular__thumb img,
.gg-game:hover .gg-game__img img {
  transform: translateY(-3px);
  border-color: rgba(243, 201, 79, 0.62);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(243, 201, 79, 0.15);
}

.gg-popular__fallback,
.gg-game__img-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 12px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.3;
  border-radius: 12px;
  border: 2px solid rgba(212, 175, 55, 0.2);
  background: #12182a;
}

/* ── Typography ── */
.gg-popular__name,
.gg-game__name {
  flex: 0 0 auto;
  width: 100%;
  margin-top: 8px;
  padding: 0 2px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.92);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  white-space: normal;
  word-break: break-word;
  min-height: 2.6em;
  text-align: center;
  text-transform: capitalize;
}

.gg-popular__card:hover .gg-popular__name,
.gg-game:hover .gg-game__name {
  color: #f3d77f;
}

.gg-game__provider,
.gg-game__sub {
  margin-top: 3px;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.gg-game__meta {
  flex: 0 0 auto;
  min-height: 0;
  padding-top: 2px;
}

/* ── Popular badge on cover ── */
.gg-popular__thumb::before,
.gg-game[data-popular="1"] .gg-game__img::before {
  content: "ПОПУЛЯРНОЕ";
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
  color: #2b1a00;
  background: #f1b31d;
  border-radius: 999px;
  padding: 4px 7px;
  pointer-events: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

@keyframes gg-popular-rotate-in {
  from {
    opacity: 0.35;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.gg-popular__card {
  animation: gg-popular-rotate-in 0.45s ease both;
}

/* ── Responsive column counts ── */
@media (max-width: 1399px) {
  .gg-popular__grid,
  .gg-games__grid {
    column-count: 5;
  }
}

@media (max-width: 1199px) {
  .gg-popular__grid,
  .gg-games__grid {
    column-count: 4;
    column-gap: 12px;
  }

  .gg-popular__grid .gg-popular__card,
  .gg-games__grid .gg-game {
    margin-bottom: 12px;
  }

  .gg-popular .gg-popular__card {
    margin-bottom: 12px !important;
  }
}

@media (max-width: 991px) {
  .gg-popular {
    padding: 22px 14px 18px;
    border-radius: 16px;
  }

  .gg-popular__grid,
  .gg-games__grid {
    column-count: 3;
    column-gap: 10px;
  }

  .gg-popular__grid .gg-popular__card,
  .gg-games__grid .gg-game {
    margin-bottom: 10px;
  }

  .gg-popular .gg-popular__card {
    margin-bottom: 10px !important;
  }
}

@media (max-width: 767px) {
  .gg-popular__grid,
  .gg-games__grid {
    column-count: 2;
    column-gap: 10px;
  }

  .gg-popular__head::after {
    letter-spacing: 0.1em;
  }

  .gg-popular__thumb img,
  .gg-game__img img {
    border-radius: 10px;
  }

  .gg-popular .gg-popular__thumb img,
  .gg-popular .gg-popular__thumb img[_ngcontent] {
    border-radius: 10px !important;
  }

  .gg-popular__thumb::before,
  .gg-game[data-popular="1"] .gg-game__img::before {
    font-size: 7px;
    padding: 3px 5px;
    top: 6px;
    left: 6px;
  }
}

@media (max-width: 399px) {
  .gg-popular__name,
  .gg-game__name {
    font-size: 10px;
    min-height: 2.4em;
  }
}
