/* Секция «ПОПУЛЯРНОЕ» — стиль онлайн-казино (1game.su) */

.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.12);
  background: linear-gradient(165deg, #0c1a3a 0%, #070d1a 45%, #030508 100%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.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;
  position: static;
}

.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;
  }
}

.gg-popular__grid {
  order: 2;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  justify-items: center;
}

.gg-popular__card {
  width: 100%;
  max-width: 200px;
  min-height: 280px;
  height: auto;
  box-sizing: border-box;
  padding: 12px 10px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, #151c2e 0%, #0d111c 100%);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.42), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.gg-popular__card:hover {
  transform: translateY(-3px);
  border-color: rgba(212, 175, 55, 0.35);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(212, 175, 55, 0.15);
}

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

.gg-popular__thumb {
  flex: 1 1 auto;
  width: 100%;
  min-height: 200px;
  aspect-ratio: 1 / 1;
  margin: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  overflow: hidden;
  background: #0a0f18;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  box-sizing: border-box;
}

.gg-popular__thumb img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center center;
}

.gg-popular__fallback {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  padding: 8px;
  line-height: 1.3;
}

.gg-popular__name {
  flex: 0 0 auto;
  width: 100%;
  margin-top: auto;
  padding-top: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.92);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

@media (max-width: 1399px) {
  .gg-popular__grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 1199px) {
  .gg-popular__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
  }
}

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

  .gg-popular__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .gg-popular__card {
    max-width: none;
    min-height: 260px;
    height: auto;
    padding: 12px 10px 10px;
  }
}

@media (max-width: 767px) {
  .gg-popular__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .gg-popular__card {
    min-height: 240px;
    height: auto;
  }

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

@media (max-width: 399px) {
  .gg-popular__card {
    min-height: 220px;
    height: auto;
    padding: 10px 8px 8px;
  }

  .gg-popular__thumb {
    min-height: 160px;
  }

  .gg-popular__name {
    font-size: 10px;
  }
}
