/* ==========================================================================
   Section: Game Selection Carousel (ВЫБЕРИ СВОЮ ИГРУ)
   ========================================================================== */

:root {
  --games-card-width: 10.625rem;   /* ~170px — макет desktop */
  --games-card-gap: 1.125rem;    /* ~18px */
  --games-card-radius: 0.375rem;
}

/* Shared section heading */
.section-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 1.5vw, 0.875rem);
  margin-bottom: var(--space-section-gap);
}

.section-heading__ornament {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  max-width: 10rem;
}

.section-heading__line {
  flex: 1;
  height: 2px;
  min-width: 2rem;
  background: linear-gradient(90deg, transparent, rgba(212, 168, 83, 0.7), transparent);
  opacity: 1;
}

.section-heading__gem {
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  background: none;
  transform: none;
  box-shadow: none;
  flex-shrink: 0;
  font-size: 0.875rem;
  line-height: 1;
  color: var(--color-gold);
  text-shadow: 0 0 10px rgba(212, 168, 83, 0.55);
}

.section-heading__gem::before {
  content: '❖';
}

.section-heading__title {
  font-size: clamp(1rem, 2.5vw, var(--font-size-2xl));
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-gold-light);
  white-space: nowrap;
  text-align: center;
  text-shadow: 0 0 20px rgba(212, 168, 83, 0.2);
}

/* Games section heading */
.games__heading-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
}

.games__top-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.875rem;
  border-radius: var(--radius-full);
  font-size: clamp(0.625rem, 1.2vw, 0.6875rem);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-gold-light);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.45), rgba(88, 28, 135, 0.55));
  border: 1px solid rgba(212, 168, 83, 0.55);
  box-shadow:
    0 0 14px rgba(124, 58, 237, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Games section */
.games {
  padding-top: 0;
  padding-bottom: var(--space-section);
  background: transparent;
}

.games__carousel {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(0.625rem, 1.5vw, 1rem);
}

/* Arrows */
.games__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  border: 1px solid rgba(147, 51, 234, 0.55);
  background: rgba(88, 28, 135, 0.35);
  color: var(--color-accent-light);
  box-shadow:
    0 0 18px rgba(124, 58, 237, 0.3),
    inset 0 0 12px rgba(124, 58, 237, 0.12);
  transition:
    background var(--transition-base),
    border-color var(--transition-base),
    transform var(--transition-base),
    box-shadow var(--transition-base);
}

.games__arrow svg {
  width: 1.125rem;
  height: 1.125rem;
}

.games__arrow:hover {
  background: rgba(124, 58, 237, 0.45);
  border-color: var(--color-accent-light);
  transform: scale(1.06);
  box-shadow:
    0 0 24px rgba(124, 58, 237, 0.45),
    inset 0 0 12px rgba(124, 58, 237, 0.18);
}

.games__arrow:active {
  transform: scale(0.98);
}

/* Track */
.games__track {
  display: flex;
  gap: var(--games-card-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  padding-block: 0.625rem;
  scrollbar-width: none;
}

.games__track::-webkit-scrollbar {
  display: none;
}

/* Card — размеры по макету: ~170×280px */
.games__card {
  position: relative;
  flex: 0 0 var(--games-card-width);
  width: var(--games-card-width);
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  border-radius: var(--games-card-radius);
  overflow: hidden;
  background: rgba(8, 8, 22, 0.9);
  border: 1px solid rgba(212, 168, 83, 0.55);
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.35),
    0 0 14px rgba(212, 168, 83, 0.08);
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.games__card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    160deg,
    rgba(240, 198, 116, 0.85) 0%,
    rgba(212, 168, 83, 0.45) 35%,
    rgba(124, 58, 237, 0.25) 65%,
    rgba(212, 168, 83, 0.7) 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

.games__card:hover {
  transform: translateY(-4px);
  border-color: rgba(240, 198, 116, 0.75);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(212, 168, 83, 0.18),
    0 0 20px rgba(124, 58, 237, 0.2);
}

.games__card--more {
  border-style: dashed;
  border-color: rgba(147, 51, 234, 0.45);
}

.games__card--more:hover {
  border-color: rgba(147, 51, 234, 0.7);
}


.games__card-art {
  aspect-ratio: 3 / 4;
  width: 100%;
  min-height: 14.125rem;
  position: relative;
  overflow: hidden;
  background: rgba(8, 8, 22, 0.9);
}

/* Единый цветовой оверлей для стилизации под тему сайта */
.games__card-art::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(88, 28, 135, 0.05) 0%,
    rgba(8, 12, 26, 0.1) 50%,
    rgba(8, 12, 26, 0.55) 100%
  );
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 1;
}

/* Image styles and character centering */
.games__card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  filter: saturate(0.9) contrast(1.05) brightness(0.95);
  transition: filter var(--transition-base), transform var(--transition-base);
}

.games__card:hover .games__card-img {
  filter: saturate(1) contrast(1.1) brightness(1);
  transform: scale(1.03);
}

/* Tiles Survive — персонаж слева, сдвигаем вправо */
.games__card-img[src*="TilesSurvive"] {
  object-position: 22% center;
}

/* Last Asylum — персонаж слева, сдвигаем вправо */
.games__card-img[src*="LastAsylum"] {
  object-position: 18% center;
}

/* PUBG — персонаж по центру, оставляем */
.games__card-img[src*="pubg"] {
  object-position: center 30%;
}

/* Fortnite — лого по центру */
.games__card-img[src*="Fortnite"] {
  object-position: center center;
}

/* Royal Match — король по центру */
.games__card-img[src*="RoyalMatch"] {
  object-position: center 25%;
}

/* Roblox — лого по центру */
.games__card-img[src*="roblox"] {
  object-position: center center;
}

/* Highrise — HR по центру */
.games__card-img[src*="Highrise"] {
  object-position: center center;
}

.games__card-art--more {
  background:
    linear-gradient(180deg, transparent 35%, rgba(8, 12, 26, 0.9) 100%),
    linear-gradient(145deg, #0f0525 0%, #1e0a3d 40%, #2d1065 70%, #4c1d95 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.games__card-more-icon {
  width: 4rem;
  height: 4rem;
  color: var(--color-accent-light);
  opacity: 0.7;
  filter: drop-shadow(0 0 12px rgba(124, 58, 237, 0.4));
}

.games__card-footer {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 1;
  padding: 2.75rem 0.5rem 0.625rem;
  background: linear-gradient(180deg, transparent, rgba(8, 12, 26, 0.98));
}

.games__card-title {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.125rem;
  padding: 0.375rem 0.375rem;
  border: 1px solid rgba(212, 168, 83, 0.65);
  border-radius: 0.1875rem;
  font-size: 0.6875rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
  color: var(--color-text-primary);
  line-height: 1.25;
  background: rgba(8, 8, 22, 0.85);
  box-shadow:
    inset 0 0 0 1px rgba(240, 198, 116, 0.15),
    0 0 10px rgba(212, 168, 83, 0.12);
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
  :root {
    --games-card-width: 9.75rem;
    --games-card-gap: 1rem;
  }
}

/* Desktop wide — точные пропорции макета */
@media (min-width: 1200px) {
  :root {
    --games-card-width: 10.625rem;
    --games-card-gap: 1.125rem;
  }

  .games__card-art {
    min-height: 14.125rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --games-card-width: clamp(8.75rem, 38vw, 10rem);
    --games-card-gap: 0.875rem;
  }

  .games {
    padding-bottom: var(--space-section);
  }

  .section-heading__ornament {
    max-width: 3rem;
  }

  .section-heading__title {
    white-space: normal;
    max-width: 12rem;
    line-height: 1.25;
  }

  .games__carousel {
    grid-template-columns: 1fr;
    gap: var(--space-md);
  }

  .games__arrow {
    display: none;
  }

  .games__track {
    padding-inline: 0.25rem;
    scroll-padding-inline: 0.25rem;
  }

  .games__card-art {
    min-height: auto;
  }

  .games__card-title {
    font-size: clamp(0.5625rem, 2.8vw, 0.6875rem);
    height: 1.875rem;
  }
}

@media (max-width: 480px) {
  .section-heading {
    gap: 0.5rem;
  }

  .section-heading__ornament {
    max-width: 2rem;
  }

  :root {
    --games-card-width: clamp(8.25rem, 42vw, 9.5rem);
  }
}
