:root {
  --bg: #050b0e;
  --panel: #0d1b22;
  --line: #1b3038;
  --text: #eef6f0;
  --muted: #8fb39a;
  --accent: #9ff59a;
  --accent-dark: #3d9a3a;
  --gold: #ffd86b;
  --gold-dark: #b98a1e;
  --display: 'Luckiest Guy', 'Nunito', system-ui, sans-serif;
  --body: 'Nunito', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* l attribut hidden gagne toujours, même sur .btn (display: inline-block) */
html { scroll-behavior: smooth; }
body.lock { overflow: hidden; overscroll-behavior: none; }   /* partie en cours : la page ne défile pas (le canvas gère touch-action) */
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-weight: 600; }
a { color: var(--accent); }
img { max-width: 100%; }

/* ---------- Typo display (titres façon lettrage) ---------- */
.display { font-family: var(--display); font-weight: 400; text-transform: uppercase; letter-spacing: .01em; line-height: .95; }
.display em { font-style: normal; color: var(--gold); }
h2.display { font-size: clamp(38px, 7vw, 76px); margin: 0 0 24px; text-align: center; }
.label { display: inline-block; justify-self: center; padding: 6px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); color: var(--accent); font-family: var(--display); font-size: 14px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px; }
.lead { font-size: clamp(16px, 2vw, 20px); color: var(--muted); margin: 0; }
.lead.center { text-align: center; margin: -8px 0 20px; }

/* ---------- Boutons capsule 3D ---------- */
.btn { cursor: pointer; text-decoration: none; display: inline-block; border: 0; border-radius: 999px; padding: 14px 26px; font-family: var(--display); font-size: 18px; letter-spacing: .03em; text-transform: uppercase; color: #05100a; background: var(--accent); box-shadow: 0 5px 0 var(--accent-dark); transition: transform .08s, box-shadow .08s; }
.btn.green { background: var(--accent); box-shadow: 0 5px 0 var(--accent-dark); }
.btn.gold { background: var(--gold); box-shadow: 0 5px 0 var(--gold-dark); }
.btn.secondary { background: var(--panel); color: var(--text); border: 2px solid var(--line); box-shadow: 0 5px 0 #000; }
.btn.small { padding: 10px 18px; font-size: 15px; box-shadow: 0 4px 0 var(--gold-dark); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--accent-dark); }
.btn:disabled { opacity: .5; cursor: wait; }

/* ---------- Nav capsule ---------- */
.nav { position: sticky; top: 12px; z-index: 50; margin: 12px auto 0; width: min(96%, 1100px); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px 8px 18px; border-radius: 999px; background: rgba(8, 19, 26, .85); backdrop-filter: blur(10px); border: 1px solid var(--line); }
.nav .brand { font-family: var(--display); font-size: 22px; color: var(--text); text-decoration: none; }
.nav .brand span { color: var(--accent); }
.nav .menu { display: flex; gap: 4px; }
.nav .menu a { font-family: var(--display); font-size: 15px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); text-decoration: none; padding: 8px 14px; border-radius: 999px; }
.nav .menu a:hover { color: var(--text); background: rgba(255,255,255,.06); }
@media (max-width: 700px) { .nav .menu { display: none; } .nav { padding-left: 14px; } }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr 1.1fr; align-items: center; gap: 24px; width: min(100%, 1100px); margin: 0 auto; padding: 60px 16px 40px; min-height: 560px; }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(60% 60% at 30% 70%, rgba(159,245,154,.16), transparent 70%), radial-gradient(40% 40% at 80% 20%, rgba(255,216,107,.10), transparent 70%); pointer-events: none; }
.hero-art { position: relative; height: 460px; }
.hero-art .mama { position: absolute; left: 50%; bottom: 0; width: min(420px, 90%); --tx: -50%; filter: drop-shadow(0 20px 30px rgba(0,0,0,.6)); animation: bob 4s ease-in-out infinite; }
.hero-art .kid { position: absolute; width: 96px; filter: drop-shadow(0 8px 12px rgba(0,0,0,.5)); animation: bob 3s ease-in-out infinite; }
.hero-art .k1 { left: 4%; bottom: 30px; animation-delay: -.6s; }
.hero-art .k2 { right: 6%; bottom: 20px; animation-delay: -1.4s; }
.hero-art .k3 { left: 12%; top: 40px; width: 80px; animation-delay: -2.1s; }
.hero-art .k4 { right: 10%; top: 20px; width: 84px; animation-delay: -.3s; }
@keyframes bob { 0%, 100% { transform: translate(var(--tx, 0), 0); } 50% { transform: translate(var(--tx, 0), -10px); } }
.hero-text { position: relative; display: grid; gap: 18px; justify-items: start; }
.hero-text h1 { font-size: clamp(48px, 8vw, 96px); margin: 0; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.tagline { margin: 0; color: var(--gold); font-weight: 800; font-size: 16px; }
.prelaunch { display: grid; gap: 10px; justify-items: start; }
@media (max-width: 860px) { .prelaunch { justify-items: center; } }
.countdown { display: flex; gap: 10px; }
.countdown div { display: grid; justify-items: center; min-width: 74px; padding: 10px 8px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.countdown b { font-family: var(--display); font-size: 34px; line-height: 1; color: var(--accent); }
.countdown small { color: var(--muted); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; margin-top: 4px; }
.pill.soon { color: var(--muted); border-color: var(--line); }
.ca { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; font-size: 13px; font-family: var(--body); }
.ca .ca-label { color: var(--accent); font-family: var(--display); letter-spacing: .06em; }
.ca code { font-family: ui-monospace, Menlo, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 52vw; }
.ca.soon code { color: var(--muted); }
.ca.copied { border-color: var(--accent); }
.links { margin: 0; font-size: 13px; color: var(--muted); }
.links a { color: var(--muted); }
.links a:hover { color: var(--accent); }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 24px; min-height: 0; text-align: center; }
  .hero-art { height: 300px; order: 2; }
  .hero-art .mama { width: min(280px, 80%); }
  .hero-art .kid { width: 64px; }
  .hero-art .k3, .hero-art .k4 { width: 56px; top: 10px; }
  .hero-text { justify-items: center; }
  .hero-cta { justify-content: center; }
}

/* ---------- Sections ---------- */
main { max-width: 1100px; margin: 0 auto; padding: 16px; display: grid; gap: 96px; }
main > section { display: grid; justify-items: center; }
@media (max-width: 700px) { main { gap: 64px; } }

/* Leaderboard */
.global { margin: 0; color: var(--accent); font-weight: 800; font-size: 15px; }
.global b { font-family: var(--display); font-size: 22px; letter-spacing: .02em; }
.board { list-style: none; margin: 0; padding: 0; width: min(100%, 640px); display: grid; gap: 8px; }
.board li { display: grid; grid-template-columns: 44px 44px 1fr auto; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.board li.top { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(255,216,107,.25); }
.board .rk { font-family: var(--display); font-size: 22px; color: var(--muted); text-align: center; }
.board li.top .rk { color: var(--gold); }
.board .av { width: 44px; height: 44px; border-radius: 50%; background: var(--line); object-fit: cover; display: grid; place-items: center; font-size: 22px; }
.board .who { min-width: 0; display: grid; }
.board .who b { font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board .who a { color: inherit; text-decoration: none; }
.board .who a:hover { color: var(--accent); }
.board .who small { color: var(--muted); font-size: 12px; }
.board .sc { font-family: var(--display); font-size: 22px; color: var(--accent); }
.board .empty { justify-content: center; color: var(--muted); display: flex; }
.identity { margin: 10px 0 4px; }
.identity #id-anon { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.identity input { width: min(100%, 220px); padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-family: var(--body); font-weight: 700; font-size: 16px; }   /* 16px mini : sous ce seuil, iOS Safari zoome la page au focus et ne revient pas */
.identity input:focus { outline: 2px solid var(--accent); }
.identity #id-me { color: var(--accent); font-weight: 800; margin: 4px 0; }
.identity #id-me .edit { color: var(--muted); font-weight: 600; font-size: 13px; margin-left: 6px; }
.join-status { margin: 8px 0 0; padding: 10px 14px; border-radius: 12px; font-weight: 700; font-size: 14px; }
.join-status.ok { background: rgba(159,245,154,.12); border: 1px solid rgba(159,245,154,.45); color: var(--accent); }
.join-status.ko { background: rgba(255,77,109,.12); border: 1px solid rgba(255,77,109,.45); color: #ff8fa3; }
.join-status a { color: var(--gold); }
.identity #id-me img { width: 22px; height: 22px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }
.btn.small.secondary { box-shadow: 0 4px 0 #000; }

/* Tokenomics */
.bignum { text-align: center; margin: 0 0 28px; display: grid; gap: 6px; }
.bignum span { font-size: clamp(44px, 9vw, 110px); color: var(--accent); line-height: 1; text-shadow: 0 6px 0 rgba(0,0,0,.5); }
.bignum small { font-family: var(--body); font-weight: 800; font-size: 15px; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; }
.badges { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.badge { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center; padding: 18px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); }
.badge .ic { grid-row: 1 / 3; font-size: 30px; }
.badge b { font-family: var(--display); font-weight: 400; font-size: 20px; letter-spacing: .02em; text-transform: uppercase; }
.badge small { color: var(--muted); font-size: 13.5px; line-height: 1.35; }

/* Story : vidéo verticale 9:16, jamais plus haute que l'écran */
.video { width: min(100%, calc(85vh * 9 / 16), 480px); aspect-ratio: 9/16; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; display: grid; place-items: center; color: var(--muted); box-shadow: 0 30px 60px rgba(0,0,0,.5); }
.video iframe, .video video { width: 100%; height: 100%; border: 0; object-fit: cover; background: #000; }

/* ---------- Jeu ---------- */
/* Mobile : pleine largeur. Desktop : ~92 % de la hauteur de la fenêtre (ratio 2:3). */
.game-frame { position: relative; width: min(100%, calc(92vh * 2 / 3)); aspect-ratio: 2/3; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); background: #000; user-select: none; box-shadow: 0 30px 60px rgba(0,0,0,.55); }
.game-frame.playing { touch-action: none; }   /* le doigt pilote Mama, pas le scroll — seulement en partie */
/* Mobile : plein écran pendant la partie, bande de 48 px en haut pour la croix */
.game-frame.fullscreen { position: fixed; inset: 0; width: 100vw; height: 100dvh; aspect-ratio: auto; border: 0; border-radius: 0; z-index: 100; display: grid; place-items: center; padding: calc(48px + env(safe-area-inset-top)) 0 env(safe-area-inset-bottom); box-shadow: none; }
.game-frame.fullscreen canvas { width: min(100%, calc((100dvh - 48px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) * 2 / 3)); height: auto; aspect-ratio: 2 / 3; }
.quit { position: absolute; right: 10px; top: calc(6px + env(safe-area-inset-top)); z-index: 3; width: 38px; height: 38px; padding: 0; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.45); color: #fff; font: 700 18px/1 system-ui, sans-serif; cursor: pointer; display: none; align-items: center; justify-content: center; }
.game-frame.active .quit { display: flex; }   /* visible dès Play, mobile comme desktop, jusqu'au ✕ */
.game-frame.fullscreen .mute { bottom: calc(34px + env(safe-area-inset-bottom)); }
.game-frame.fullscreen .pill { bottom: calc(34px + env(safe-area-inset-bottom)); }
canvas { display: block; width: 100%; height: 100%; }
.mute { position: absolute; right: 10px; bottom: 34px; z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.45); color: #fff; font-size: 18px; cursor: pointer; }
.pill { position: absolute; left: 10px; bottom: 34px; z-index: 2; padding: 6px 12px; border-radius: 999px; background: rgba(0,0,0,.45); border: 1px solid rgba(255,216,107,.5); color: var(--gold); font-family: var(--display); font-size: 12px; letter-spacing: .05em; text-decoration: none; }
.hint { color: var(--muted); font-size: 14px; text-align: center; margin: 14px 0 0; }

.overlay { position: absolute; inset: 0; display: block; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; background: rgba(0,0,0,.62); backdrop-filter: blur(3px); text-align: center; }
.overlay > div { min-height: 100%; display: grid; align-content: center; justify-items: center; padding: 20px; }
.overlay[hidden] { display: none; }
.overlay h2 { margin: 0 0 8px; font-size: clamp(26px, 7vw, 40px); text-align: center; }
.overlay p { margin: 4px 0; color: var(--muted); font-size: 15px; }
.overlay .big { font-size: clamp(52px, 14vw, 72px); color: var(--accent); margin: 4px 0; text-shadow: 0 5px 0 rgba(0,0,0,.6); }
.overlay .spread { color: var(--accent); font-size: 13px; font-weight: 700; margin: 8px 0 0; }
.game-frame.fullscreen .overlay > div { padding: 12px 16px 24px; }
.howto { display: flex; gap: 10px; justify-content: center; margin: 10px 0 14px; }
.how { display: grid; justify-items: center; gap: 6px; width: 96px; padding: 10px 6px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid var(--line); font-family: var(--display); font-size: 13px; letter-spacing: .04em; line-height: 1.15; }
.how img { width: 54px; height: 54px; object-fit: contain; }
.how small { font-family: var(--body); font-weight: 700; font-size: 11px; color: var(--muted); }
.how.ok span { color: var(--accent); } .how.bad span { color: #ff6b8a; } .how.call span { color: var(--gold); }
.how.bad img { filter: drop-shadow(0 0 6px #ff2e88); }
.overlay .daily { color: var(--muted); font-size: 14px; }
.overlay .daily.done { color: var(--gold); font-weight: 800; }
.overlay .rank { color: var(--gold); font-family: var(--display); font-size: 24px; letter-spacing: .03em; }
.overlay .challenge { color: #ff9f43; font-weight: 800; }
.overlay .row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.overlay .btn { font-size: 16px; padding: 12px 20px; }

/* ---------- Lore ---------- */
.lore { width: 100%; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.lore .card { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); transition: transform .15s; }
.lore .card:hover { transform: translateY(-3px); }
.lore .card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lore .card.locked img { filter: brightness(.15) grayscale(1); }
.lore .card span { position: absolute; left: 10px; bottom: 8px; font-family: var(--display); font-size: 13px; letter-spacing: .04em; text-shadow: 0 2px 4px #000; }
.lore .card.locked span { color: var(--muted); }

/* ---------- Footer ---------- */
footer { text-align: center; color: var(--muted); font-size: 13px; padding: 60px 16px 40px; }
footer p { margin: 6px auto; }
footer .foot-brand { font-size: 32px; color: var(--text); margin-bottom: 12px; }
footer .disclaimer { max-width: 720px; font-size: 12px; line-height: 1.5; opacity: .75; }

/* Pendant une partie (jusqu au ✕), la nav collante s efface pour ne pas passer devant le jeu */
body.ingame .nav { opacity: 0; pointer-events: none; transition: opacity .2s; }
