/* LodyGames — feuille de style unique du portail (docs/DESIGN.md). Mobile d'abord (360 px). */

/* ── Jetons de design ──────────────────────────────────────────────────────────────────────── */
:root {
  color-scheme: dark;
  --bg: #0f1020; --bg-2: #171833; --card: #1a1b33; --line: #3a3b5c;
  --fg: #f4f4ff; --muted: #c9c9e3; --accent: #ffb703; --on-accent: #111111;
  --ok: #7ee2a8; --warn: #ffd166; --err: #ff8fa3; --danger: #ff6b81;
  --dig: #f4a261; --factflip: #7cc6fe; --lodyland: #7ee2a8;
  --radius: 12px; --radius-sm: 8px;
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --max: 64rem; --max-text: 40rem;
}

/* ── Base ──────────────────────────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; color: var(--fg); font: 16px/1.5 var(--font);
  background: radial-gradient(60rem 30rem at 85% -10%, #ffb7031f, transparent 60%),
              radial-gradient(40rem 24rem at -10% 20%, #f4a26114, transparent 60%), var(--bg); }
h1, h2, h3 { line-height: 1.2; }
h1 { color: var(--accent); font-size: clamp(1.75rem, 6vw, 2.75rem); margin: 0 0 var(--s3); }
h2 { font-size: 1.4rem; margin: var(--s6) 0 var(--s4); }
a { color: var(--accent); text-underline-offset: .15em; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: var(--max-text); margin: 0 auto; padding: var(--s5) var(--s4) var(--s7); }
.wrap h1:focus, main:focus, h2[tabindex]:focus { outline: none; }
.lead { font-size: 1.125rem; color: var(--muted); margin: 0 0 var(--s4); }
.hint { color: var(--muted); margin: 0; font-size: .9rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: var(--s2); background: var(--accent); color: var(--on-accent);
  padding: var(--s3) var(--s4); z-index: 10; }
.skip:focus { left: var(--s2); }

/* ── En-tête et pied ───────────────────────────────────────────────────────────────────────── */
.top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--s2);
  padding: var(--s2) var(--s4); max-width: var(--max-text); margin: 0 auto; }
.brand { font-weight: 800; font-size: 1.25rem; text-decoration: none; min-height: 44px;
  display: inline-flex; align-items: center; gap: var(--s2); }
.brand-mark { width: 1.5rem; height: 1.5rem; border-radius: 50% 50% 50% 8px; background: var(--accent);
  box-shadow: .35rem .35rem 0 -.1rem var(--dig); }
.top-nav { display: flex; gap: var(--s2); flex-wrap: wrap; }
.foot { padding-top: 0; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
.foot p { margin: var(--s4) 0 var(--s2); }
.foot-links, .pill-list { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.foot-links a, .pill-list a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s3);
  border: 1px solid var(--line); border-radius: 999px; text-decoration: none; }
.pill-list a[aria-current="page"] { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* ── Boutons ───────────────────────────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px;
  padding: var(--s2) var(--s4); font: inherit; font-weight: 600; border-radius: var(--radius-sm);
  border: 2px solid var(--accent); background: var(--accent); color: var(--on-accent); cursor: pointer;
  text-decoration: none; text-align: center; transition: transform .15s ease, background-color .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: #ffb7031a; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: var(--on-accent); }
.btn.small { padding: var(--s1) var(--s3); }
.btn:disabled { opacity: .6; cursor: wait; }
.actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-top: var(--s3); }

/* ── Cartes ────────────────────────────────────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s4); margin: 0 0 var(--s4); }
.card h2 { margin: 0 0 var(--s3); font-size: 1.25rem; }
.card.danger { border-color: var(--danger); }

/* ── Accueil ───────────────────────────────────────────────────────────────────────────────── */
.hero { padding: var(--s5) 0 var(--s2); }
.kicker { color: var(--dig); font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  font-size: .85rem; margin: 0 0 var(--s2); }
.game-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s4); }
.game-card { --tone: var(--accent); position: relative; display: grid; gap: var(--s2); padding: var(--s4);
  background: linear-gradient(160deg, var(--bg-2), var(--card)); border: 1px solid var(--line);
  border-top: 4px solid var(--tone); border-radius: var(--radius); }
.game-card h3 { margin: 0; font-size: 1.35rem; }
.game-card h3 a { color: var(--fg); text-decoration: none; }
.game-card h3 a:hover { text-decoration: underline; }
.game-card p { margin: 0; color: var(--muted); }
.emblem { color: var(--tone); width: 3.5rem; height: 3.5rem; }
.theme-dig { --tone: var(--dig); }
.theme-factflip { --tone: var(--factflip); }
.theme-lodyland { --tone: var(--lodyland); }
.soon { display: inline-flex; align-items: center; min-height: 44px; margin: 0; color: var(--muted); font-style: italic; }
.account-zone { margin-top: var(--s6); }
.account-zone .hint { margin-top: var(--s3); }

/* ── Fiche de jeu ──────────────────────────────────────────────────────────────────────────── */
.crumb { margin: 0 0 var(--s3); }
.crumb a { display: inline-flex; align-items: center; min-height: 44px; }
.game-page { --tone: var(--accent); }
.game-head { display: flex; gap: var(--s4); align-items: center; padding-bottom: var(--s3);
  border-bottom: 4px solid var(--tone); margin-bottom: var(--s4); }
.game-head h1 { color: var(--tone); margin: 0; }
.game-head .lead { margin: 0; }
.game-head .emblem { width: 4.5rem; height: 4.5rem; flex: none; }
.game-page .card { margin-top: var(--s5); }

/* ── Formulaires et « Mon compte » ─────────────────────────────────────────────────────────── */
form { display: grid; gap: var(--s2); margin-top: var(--s3); }
label { font-weight: 600; }
input, select { min-height: 44px; width: 100%; padding: var(--s2) var(--s3); font: inherit; color: var(--fg);
  background: var(--bg); border: 1px solid var(--muted); border-radius: var(--radius-sm); }
.msg:empty, .status:empty { display: none; }
.msg, .status { margin: var(--s1) 0 0; }
[data-kind="ok"] { color: var(--ok); }
[data-kind="error"] { color: var(--err); }
[data-kind="warn"] { color: var(--warn); }
.badge { font-size: .85rem; border: 1px solid currentColor; border-radius: 999px; padding: 0 var(--s2); white-space: nowrap; }
.facts { margin: 0 0 var(--s3); display: grid; gap: var(--s2); }
.facts div { display: grid; gap: .1rem; }
.facts dt { color: var(--muted); font-size: .9rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.credits { margin: 0 0 var(--s2); font-size: 1.1rem; }
.credits-value { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.games { list-style: none; padding: 0; margin: var(--s3) 0 0; display: grid; gap: var(--s3); }
.game { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--s3); display: grid; gap: var(--s2); }
.game-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2); }
.game h3, .game h4, .game p { margin: 0; }
.game h4 { font-size: .95rem; color: var(--muted); }
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--s2); }
.chips li { border: 1px solid currentColor; border-radius: 999px; padding: .1rem var(--s2); font-size: .9rem; overflow-wrap: anywhere; }
.game .link { display: inline-flex; align-items: center; min-height: 44px; }
.sessions { list-style: none; padding: 0; margin: 0 0 var(--s3); display: grid; gap: var(--s2); }
.sessions li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2);
  padding: var(--s2) 0; border-bottom: 1px solid var(--line); }

/* ── Points de rupture ─────────────────────────────────────────────────────────────────────── */
@media (min-width: 40rem) {
  .facts div { grid-template-columns: 10rem 1fr; }
  .game-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 64rem) {
  .page-home .top, .page-home .wrap { max-width: var(--max); }
  .page-home .hero, .page-home .account-zone { max-width: var(--max-text); }
  .game-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ── Mouvement réduit ──────────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .btn:hover { transform: none; }
}
