/*
 * Homepage — Nos jeux du moment.
 *
 * Cette composition est volontairement limitée à .games-section.
 * Le catalogue /jeux/ conserve ses propres règles dans games.css.
 */

.games-section {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.games-section::before {
  position: absolute;
  z-index: -1;
  top: 12%;
  right: -12%;
  width: min(52vw, 760px);
  aspect-ratio: 1;
  border-radius: 50%;
  content: "";
  pointer-events: none;
  background: radial-gradient(circle, rgba(107, 34, 227, .11), transparent 67%);
}

.games-section .section-intro-row {
  margin-bottom: 26px;
}

.games-section .game-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1.18fr) repeat(2, minmax(230px, .91fr));
  grid-auto-flow: row dense;
  grid-auto-rows: 255px;
  gap: 16px;
}

.games-section .game-card {
  position: relative;
  min-height: 0;
  transition: transform .3s ease, filter .3s ease;
}

.games-section .game-card:first-child {
  grid-row: span 2;
}

.games-section .game-card:first-child .game-card__visual {
  height: 245px;
  aspect-ratio: auto;
}

.games-section .game-card:first-child .game-card__content {
  min-height: 0;
  padding: 24px 26px 26px;
}

.games-section .game-card:first-child h3 {
  margin: 13px 0 10px;
  font-size: clamp(1.65rem, 2.2vw, 2.15rem);
}

.games-section .game-card:first-child p {
  margin: 0 0 20px;
  font-size: .84rem;
  line-height: 1.62;
}

.games-section .game-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
}

.games-section .game-card__meta li {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  color: color-mix(in srgb, var(--game-accent), #f2efff 72%);
  background: color-mix(in srgb, var(--game-accent), transparent 91%);
  font-size: .58rem;
  letter-spacing: .025em;
  line-height: 1.2;
}

.games-section .game-card__meta .icon {
  width: 11px;
  height: 11px;
  flex: 0 0 auto;
}

.games-section .game-card:not(:first-child) .game-card__visual {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
}

.games-section .game-card:not(:first-child) .game-card__visual::after {
  background:
    linear-gradient(180deg, transparent 0 24%, rgba(3, 5, 22, .18) 42%, rgba(3, 5, 22, .68) 66%, rgba(3, 5, 22, .98) 86%),
    linear-gradient(180deg, transparent 0 34%, color-mix(in srgb, var(--game-accent), transparent 86%) 100%);
}

.games-section .game-card:not(:first-child) .game-card__content {
  position: relative;
  z-index: 1;
  min-height: 255px;
  justify-content: flex-end;
  padding: 20px;
  background: linear-gradient(180deg, transparent 36%, rgba(3, 5, 22, .2) 52%, rgba(3, 5, 22, .94) 100%);
}

.games-section .game-card:not(:first-child) .game-card__index {
  text-shadow: 0 0 10px color-mix(in srgb, var(--game-accent), transparent 28%);
}

.games-section .game-card:not(:first-child) h3 {
  margin: 8px 0 13px;
  font-size: clamp(1.15rem, 1.55vw, 1.45rem);
  text-shadow: 0 3px 18px rgba(0, 0, 0, .9);
}

.games-section .game-card:not(:first-child) .game-card__meta,
.games-section .game-card:not(:first-child) p {
  display: none;
}

.games-section .game-card .button--game {
  --az-cut: 6px;
  --az-border-start: #7845f2;
  --az-border-end: #b32ad9;
  min-height: 46px;
  padding-inline: 11px 14px;
  font-family: var(--az-font-display);
  font-size: .67rem;
  font-weight: 600;
}

.games-section .game-card .button--game::before {
  background:
    radial-gradient(circle at 9% 50%, color-mix(in srgb, var(--game-accent), transparent 78%), transparent 34%),
    rgba(6, 7, 28, .9);
}

.games-section .game-card .button--game .button--game__service {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  color: color-mix(in srgb, var(--game-accent), #fff 34%);
  border-right: 1px solid color-mix(in srgb, var(--game-accent), transparent 74%);
  text-align: center;
  place-items: center;
}

.games-section .button--game__service .icon,
.games-section .button--game__service .social-icon {
  width: 15px;
  height: 15px;
}

.games-section .game-card .button--game .button--game__label {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (hover: hover) {
  .games-section .game-card:hover {
    transform: translateY(-4px);
    filter: brightness(1.06);
  }
}

@media (max-width: 1180px) {
  .games-section .game-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
  }

  .games-section .game-card:first-child {
    display: grid;
    min-height: 330px;
    grid-column: 1 / -1;
    grid-row: auto;
    grid-template-columns: minmax(0, 1.08fr) minmax(300px, .92fr);
  }

  .games-section .game-card:first-child .game-card__visual {
    height: 100%;
  }

  .games-section .game-card:first-child .game-card__content {
    justify-content: center;
  }

  .games-section .game-card:not(:first-child) .game-card__content {
    min-height: 265px;
  }
}

@media (max-width: 760px) {
  .games-section .game-card:first-child {
    grid-template-columns: minmax(0, 1fr);
  }

  .games-section .game-card:first-child .game-card__visual {
    height: 230px;
  }
}

@media (max-width: 640px) {
  .games-section .section-intro-row {
    margin-bottom: 20px;
  }

  .games-section .game-grid {
    display: grid;
    grid-auto-columns: min(84vw, 322px);
    grid-auto-flow: column;
    grid-auto-rows: auto;
    grid-template-columns: none;
    gap: 14px;
    overflow-x: auto;
    padding: 2px 2px 15px;
    scroll-padding-inline: 2px;
    scroll-snap-type: x mandatory;
  }

  .games-section .game-card,
  .games-section .game-card:first-child {
    display: flex;
    min-height: 440px;
    grid-column: auto;
    grid-row: auto;
    flex-direction: column;
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .games-section .game-card:first-child .game-card__visual,
  .games-section .game-card:not(:first-child) .game-card__visual {
    position: relative;
    inset: auto;
    height: auto;
    aspect-ratio: 460 / 215;
  }

  .games-section .game-card:not(:first-child) .game-card__visual::after {
    background: linear-gradient(180deg, transparent 48%, rgba(4, 6, 23, .75));
  }

  .games-section .game-card:first-child .game-card__content,
  .games-section .game-card:not(:first-child) .game-card__content {
    min-height: 0;
    flex: 1;
    justify-content: flex-start;
    padding: 20px;
    background: transparent;
  }

  .games-section .game-card:first-child h3,
  .games-section .game-card:not(:first-child) h3 {
    margin: 11px 0 10px;
    font-size: 1.35rem;
  }

  .games-section .game-card .game-card__meta {
    display: flex;
    margin-bottom: 12px;
  }

  .games-section .game-card .game-card__meta li:nth-child(n + 3) {
    display: none;
  }

  .games-section .game-card:first-child p,
  .games-section .game-card:not(:first-child) p {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 16px;
    font-size: .76rem;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .games-section .game-card .button--game {
    margin-top: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .games-section .game-card {
    transition: none;
  }
}
