@import url('https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css');

/* ==========================================================================
   Games slider block
   ========================================================================== */
.games-slider {
  max-width: 100%;
  margin-top: var(--space-h2-text);
  margin-inline: auto;
  padding-bottom: 0.5rem;
}

/* Progressive-enhancement fallback: a horizontally scrollable row before
   Swiper.js finishes loading (or if it never does — e.g. blocked CDN).
   Swiper applies its own flex/transform layout to .swiper-wrapper once
   initialised, which naturally takes over from these base rules. */
.games-slider .swiper-wrapper {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  overflow-x: auto;
}

.games-slider__slide {
  flex: 0 0 auto;
  width: var(--game-card-width);
  height: auto;
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.75rem;
  background-color: var(--color-surface);
  border-radius: var(--radius-card);
}

.game-card__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: calc(var(--radius-card) - 0.5rem);
  object-fit: cover;
}

.game-card__name {
  margin-top: 0;
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  color: var(--color-text-primary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-card__play {
  padding-block: 0.625rem;
  font-size: 0.75rem;
}

.games-slider__nav {
  color: var(--color-heading-gold);
}

.games-slider__nav::after {
  font-size: 1.1rem;
}

@media (max-width: 767.98px) {
  .games-slider__nav {
    display: none;
  }

  /* Visible, styled horizontal scrollbar directly under the game cards,
     so touch users get a clear affordance that the row scrolls. */
  .games-slider .swiper-wrapper {
    padding-bottom: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: var(--color-heading-gold) var(--color-surface);
  }

  .games-slider .swiper-wrapper::-webkit-scrollbar {
    height: 6px;
  }

  .games-slider .swiper-wrapper::-webkit-scrollbar-track {
    background: var(--color-surface);
    border-radius: var(--radius-pill);
  }

  .games-slider .swiper-wrapper::-webkit-scrollbar-thumb {
    background-color: var(--color-heading-gold);
    border-radius: var(--radius-pill);
  }
}
