/* Page centrale des jeux : neutre, sombre, bleu clair. Indépendante du thème des jeux (chaque jeu garde le sien). */
:root {
  --bg: #0c111c; --bg2: #121a29; --card: #161f31; --card2: #1c2740; --line: #26334f; --text: #edf3fc; --muted: #93a4c0; --dim: #6a7b98;
  --accent: #6ccbff; --accent-d: #2f9fe0; --accent-ink: #062033; --ok: #6fe0a8; --warn: #ffcf6b;
  --font: 'Sora', system-ui, sans-serif; --display: 'Baloo 2', 'Sora', system-ui, sans-serif; --pop: cubic-bezier(.2, 1.5, .4, 1); --r: 22px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { background: var(--bg); color-scheme: dark; }
body { margin: 0; min-height: 100vh; color: var(--text); font-family: var(--font); font-size: clamp(14px, .55vw + 9px, 18px); line-height: 1.5;
  background: radial-gradient(70em 36em at 78% -12em, rgba(108, 203, 255, .16), transparent 70%), radial-gradient(50em 30em at -8% 30em, rgba(108, 203, 255, .07), transparent 70%), var(--bg);
  padding: 0 clamp(16px, 4vw, 56px) 3em; }
main, .bar, .foot { max-width: 1320px; margin-inline: auto; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 10px; }

/* barre du haut */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1em 2em; flex-wrap: wrap; padding: 1.3em 0 1.1em; }
.brand { display: flex; align-items: center; gap: .55em; font-family: var(--display); font-weight: 800; font-size: 1.45em; line-height: 1; color: var(--text); text-decoration: none; }
.logo { display: inline-grid; grid-template-columns: 1fr 1fr; gap: .09em; width: .9em; height: .9em; transform: rotate(-6deg); }
.logo i { border-radius: .2em; background: #ef7b63; } .logo i:nth-child(2) { background: #5cb8d6; } .logo i:nth-child(3) { background: #f2c14e; } .logo i:nth-child(4) { background: #8fc46a; }
.join { display: flex; align-items: center; gap: .6em; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .35em .4em .35em 1.1em; }
.join label { color: var(--muted); font-weight: 600; font-size: .9em; }
.join input { width: 10.5em; background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: .5em 1em; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.join input::placeholder { color: var(--dim); letter-spacing: .04em; }
.join button { background: var(--accent); color: var(--accent-ink); font-weight: 700; border-radius: 999px; padding: .5em 1.15em; transition: transform .12s, background .15s; }
.join button:hover { background: #8bd7ff; } .join button:active { transform: scale(.96); }
.join .err { flex-basis: 100%; margin: 0 0 .2em; color: var(--warn); font-size: .85em; }

/* fiche du jeu choisi */
/* la fiche reste collée en haut de l'écran pendant qu'on fait défiler les rangées dessous */
html { overflow-x: clip; }
.slot { position: relative; }
@media (min-width: 861px) and (min-height: 640px) and (hover: hover) {
  .slot { position: sticky; top: 14px; z-index: 20; }
  .slot::before { content: ''; position: absolute; inset: -14px -14px 0; background: var(--bg); }
  .slot::after { content: ''; position: absolute; left: -14px; right: -14px; top: 100%; height: 26px; background: linear-gradient(var(--bg), transparent); pointer-events: none; }
}
.feature { position: relative; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); height: clamp(300px, min(34vw, 46vh), 480px); background: var(--card); border: 1px solid var(--line); border-radius: calc(var(--r) + 6px); overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .4); }
.feature-media { position: relative; background: var(--bg2); overflow: hidden; }
.feature-media img, .feature-media video, .feature-media .big-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .9s ease; }
.feature-media img { width: 108%; max-width: none; }
.feature-media .on { opacity: 1; }
/* chaque capture glisse pendant ses 3 secondes et continue pendant le fondu vers la suivante ; une sur deux part dans l'autre sens */
.feature-media img.run { animation: pan 4s linear both; } .feature-media img.run:nth-of-type(even) { animation-direction: reverse; }
@keyframes pan { from { transform: translateX(0); } to { transform: translateX(-7.4%); } }
.feature-media .big-poster svg { width: 100%; height: 100%; display: block; }
.feature-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 62%, var(--card) 100%), linear-gradient(0deg, rgba(12, 17, 28, .35), transparent 30%); pointer-events: none; }
.feature-body { position: relative; padding: clamp(1.2em, 2.6vw, 2.6em); display: flex; flex-direction: column; justify-content: center; gap: .7em; min-width: 0; }
.kicker { margin: 0; color: var(--gc, var(--accent)); font-weight: 700; font-size: .8em; letter-spacing: .14em; text-transform: uppercase; }
.feature h1 { margin: 0; font-family: var(--display); font-weight: 800; font-size: clamp(2em, min(4.2vw, 6.4vh), 4em); line-height: .98; letter-spacing: -.01em; }
.lead { margin: 0; color: var(--muted); font-size: 1.06em; max-width: 30em; }
.facts { list-style: none; margin: .2em 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .45em; }
.facts li { background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: .22em .85em; font-size: .82em; font-weight: 600; color: #c8d5ea; }
.actions { display: flex; align-items: center; gap: 1em; margin-top: .5em; flex-wrap: wrap; }
.play { background: var(--accent); color: var(--accent-ink); font-family: var(--display); font-weight: 800; font-size: 1.35em; padding: .35em 1.5em .3em; border-radius: 999px; box-shadow: 0 .22em 0 var(--accent-d), 0 .8em 1.6em rgba(108, 203, 255, .28); transition: transform .12s var(--pop), box-shadow .12s, background .15s; }
.play:hover:not(:disabled) { background: #8bd7ff; transform: translateY(-2px); } .play:active:not(:disabled) { transform: translateY(.14em); box-shadow: 0 .08em 0 var(--accent-d); }
.play:disabled { background: var(--card2); color: var(--muted); box-shadow: none; cursor: default; border: 1px solid var(--line); }
.hint { color: var(--dim); font-size: .85em; }
.thumbs { position: absolute; left: 1.1em; bottom: 1.1em; z-index: 2; display: flex; gap: .55em; }
.thumbs button { position: relative; box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.thumbs button.vid::after { content: ''; position: absolute; left: 50%; top: 50%; translate: -35% -50%; border-left: 1em solid #fff; border-block: .62em solid transparent; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .7)); }
.thumbs button { width: 6.4em; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; border: 2px solid transparent; opacity: .8; transition: opacity .15s, border-color .15s, transform .15s var(--pop); }
.thumbs button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbs button:hover, .thumbs button.on { opacity: 1; } .thumbs button.on { border-color: var(--accent); } .thumbs button:hover { transform: translateY(-2px); }

/* fiche venue par-dessus la page (carte cliquée alors que la fiche du haut n'est plus à l'écran) */
.veil { position: fixed; inset: 0; z-index: 39; background: rgba(5, 8, 14, .74); backdrop-filter: blur(5px); animation: fadeIn .2s both; }
.feature.float { position: fixed; z-index: 40; left: 50%; top: 50%; width: min(1180px, 94vw); transform: translate(-50%, -50%); animation: floatIn .28s var(--pop) both; box-shadow: 0 40px 120px rgba(0, 0, 0, .7); }
@keyframes floatIn { from { transform: translate(-50%, -46%) scale(.94); opacity: 0; } }
.close { position: absolute; right: .8em; top: .8em; z-index: 4; width: 2.5em; height: 2.5em; border-radius: 50%; display: grid; place-items: center; background: rgba(12, 17, 28, .8); border: 1px solid var(--line); color: var(--text); }
.close svg { width: 1.1em; height: 1.1em; } .close:hover { background: var(--accent); color: var(--accent-ink); }

/* grille des jeux : même gabarit pour tous */
.sec { color: var(--text); font-family: var(--display); font-size: 1.45em; letter-spacing: 0; text-transform: none; line-height: 1.15; margin: 1.7em 0 .35em; }
.sec small { display: block; margin-top: .25em; color: var(--dim); font-family: var(--font); font-weight: 400; font-size: .6em; }
.pitch { margin: 0 0 1.2em; color: var(--muted); font-size: 1.05em; max-width: 58em; } .pitch b { color: var(--text); font-weight: 700; }
.rail { position: relative; margin-inline: -8px; }
.row { display: flex; gap: 18px; overflow-x: auto; padding: 12px 8px 22px; scroll-snap-type: x proximity; scroll-padding-inline: 8px; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.row::-webkit-scrollbar { display: none; }
.rail.more .row { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.nav { position: absolute; top: calc(50% - 2.6em); z-index: 3; width: 2.9em; height: 2.9em; border-radius: 50%; display: grid; place-items: center; background: rgba(22, 31, 49, .92); border: 1px solid var(--line); color: var(--text); box-shadow: 0 8px 22px rgba(0, 0, 0, .5); transition: transform .12s, background .15s; }
.nav svg { width: 1.3em; height: 1.3em; } .nav:hover { background: var(--accent); color: var(--accent-ink); transform: scale(1.08); } .nav.prev { left: -.6em; } .nav.next { right: -.6em; }
@media (hover: none) { .nav { display: none; } }
.game { flex: 0 0 clamp(210px, 21vw, 290px); scroll-snap-align: start; position: relative; display: flex; flex-direction: column; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: transform .18s var(--pop), border-color .15s, box-shadow .18s; animation: rise .5s var(--pop) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.game:hover, .game:focus-visible, .game.on { transform: translateY(-5px); border-color: color-mix(in srgb, var(--gc) 65%, var(--line)); box-shadow: 0 18px 40px rgba(0, 0, 0, .45), 0 0 0 1px color-mix(in srgb, var(--gc) 35%, transparent); }
.game .poster { position: relative; aspect-ratio: 16 / 10; display: block; overflow: hidden; background: var(--bg2); }
.game .poster svg, .game .poster img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
.game .poster img { opacity: 0; transition: opacity .3s; }
.game:hover .poster img, .game:focus-visible .poster img { opacity: 1; }
.game .emblem { transform-box: fill-box; transform-origin: 50% 70%; transition: transform .35s var(--pop); }
.game:hover .emblem, .game.on .emblem { transform: scale(1.1) rotate(-5deg); }
.game .body { padding: .75em 1em .95em; display: grid; gap: .1em; }
.game .t { font-family: var(--display); font-weight: 800; font-size: 1.3em; line-height: 1.15; }
.game .d { color: var(--muted); font-size: .82em; }
.game .tag { position: absolute; left: .7em; top: .7em; background: rgba(12, 17, 28, .78); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .12); color: var(--text); font-size: .72em; font-weight: 700; border-radius: 999px; padding: .15em .8em; }
.game .tag.play { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.game .tag.beta { background: #ffc857; color: #2a1d00; border-color: transparent; }
.game.off .poster { filter: saturate(.5) brightness(.8); } .game.off .t { color: #c3cfe3; }
.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 2.6em; }
.how article { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 1.2em 1.4em 1.3em; }
.how h3 { margin: 0 0 .4em; font-family: var(--display); font-weight: 800; font-size: 1.25em; line-height: 1.2; } .how p { margin: 0; color: var(--muted); font-size: .95em; }
.how article:last-child { border-style: dashed; background: transparent; }
.foot { margin-top: 3em; color: var(--dim); font-size: .85em; text-align: center; }

/* animation d'ouverture : la couleur du jeu envahit l'écran, l'emblème rebondit, le titre se pose lettre à lettre */
.open { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: .6em; overflow: hidden; color: #fff; background: var(--obg2, var(--accent-d)); clip-path: circle(0 at var(--ox, 50%) var(--oy, 50%)); }
.open.run { animation: openWipe .55s cubic-bezier(.6, 0, .2, 1) forwards; }
@keyframes openWipe { to { clip-path: circle(150vmax at var(--ox, 50%) var(--oy, 50%)); } }
.open-burst { position: absolute; inset: -40vmax; background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .13) 0 9deg, transparent 9deg 18deg); opacity: 0; }
.open.run .open-burst { animation: burstSpin 2.4s linear forwards, fadeIn .5s .3s forwards; }
@keyframes burstSpin { to { transform: rotate(40deg); } } @keyframes fadeIn { to { opacity: 1; } }
.open-emblem { width: min(34vmin, 15em); aspect-ratio: 1; position: relative; transform: scale(0); filter: drop-shadow(0 .5em 0 rgba(20, 14, 10, .25)); }
.open-emblem svg { width: 100%; height: 100%; overflow: visible; }
.open.run .open-emblem { animation: emblemIn .7s .32s var(--pop) forwards, emblemBob .9s 1.05s ease-in-out infinite alternate; }
@keyframes emblemIn { 0% { transform: scale(0) rotate(-25deg); } 100% { transform: scale(1) rotate(0); } } @keyframes emblemBob { to { transform: scale(1.05) translateY(-.25em); } }
.open-title { position: relative; font-family: var(--display); font-weight: 800; font-size: clamp(2.6em, 9vw, 6em); line-height: 1; text-shadow: 0 .07em 0 rgba(20, 14, 10, .3); display: flex; }
.open-title span { display: inline-block; transform: translateY(.6em) scale(.4); opacity: 0; white-space: pre; }
.open.run .open-title span { animation: letterIn .45s var(--pop) forwards; animation-delay: calc(.75s + var(--k) * 55ms); }
@keyframes letterIn { to { transform: none; opacity: 1; } }
.open-sub { position: relative; font-weight: 600; font-size: 1.05em; opacity: 0; } .open.run .open-sub { animation: fadeIn .4s 1.5s forwards; }
.open.out { transition: opacity .28s; opacity: 0; }

@media (max-width: 860px) {
  .feature { grid-template-columns: 1fr; height: auto; } .thumbs { position: static; padding: 0 1.2em 1.2em; } .feature-media { aspect-ratio: 16 / 9; } .feature-body { min-height: 19em; justify-content: flex-start; }
  .feature-media::after { background: linear-gradient(0deg, var(--card) 0, transparent 45%); }
  .bar { flex-direction: column; align-items: stretch; } .join { border-radius: 20px; } .join input { flex: 1; width: auto; min-width: 0; }
  .feature.float { max-height: 92vh; overflow-y: auto; } .feature.float .feature-body { min-height: 0; }
  .game { flex-basis: min(64vw, 260px); } .row { gap: 12px; } .how { grid-template-columns: 1fr; } .thumbs button { width: 5em; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01s !important; transition-duration: .01s !important; } }
