/* =========================================================
   Think Fast — direction « Night Pop » (typographique, aplats de couleur)
   ========================================================= */
:root {
  --bg: #111015; --s1: #1B1A20; --s2: #25232B; --line: rgba(255, 255, 255, .1); --line2: rgba(255, 255, 255, .18);
  --text: #F6F4F8; --muted: #ABA6B5; --ink: #111015; --ink2: rgba(17, 16, 21, .86);
  --cyan: #2AB4F5; --coral: #FF5A4E; --gold: #F5C451; --ok: #3DDC97; --bad: #FF5A5F;
  --pack: #4C8DFF;
  --disp: "Unbounded", "Arial Black", sans-serif; --body: "Lexend Deca", system-ui, sans-serif;
  --memos: 56px; --r: 999px; --rb: 32px;
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font: 400 16px/1.45 var(--body); padding-top: var(--memos); overflow-x: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 20px; height: 20px; flex: none; }
.gold { color: var(--gold); }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 4px; background: var(--pack); flex: none; }

/* ---------- Entête memos simulée ---------- */
.memos-bar { position: fixed; inset: 0 0 auto 0; height: var(--memos); z-index: 50; display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 18px; background: #FFFFFF; color: #1B1F24; border-bottom: 1px solid #E3E6EA; font: 600 16px var(--body); }
.memos-x { width: 44px; height: 44px; border: 0; border-radius: 12px; background: none; color: #1B1F24; display: grid; place-items: center; }
.memos-right { display: flex; align-items: center; gap: 2px; }
/* Bouton son de l'en-tête : fixe, donc accessible sur tous les écrans (partie et duel compris) */
.snd-btn { width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: inherit; opacity: .7; display: grid; place-items: center; cursor: pointer; transition: opacity .15s, background .15s; }
.snd-btn:hover, .snd-btn:focus-visible, .snd-menu.open .snd-btn { opacity: 1; background: rgba(127, 127, 127, .16); }
.snd-btn > span { display: grid; place-items: center; }
.snd-btn .ic { width: 20px; height: 20px; }
.snd-menu .menu { font-family: var(--body); font-weight: 400; }


/* ---------- Structure ---------- */
.app { position: relative; min-height: calc(100dvh - var(--memos)); }
.screen { position: relative; min-height: calc(100dvh - var(--memos)); padding: 0 16px 28px; animation: screenIn .5s var(--ease); }
@keyframes screenIn { from { opacity: 0; transform: translateY(14px); } }
.topbar { position: sticky; top: var(--memos); z-index: 12; display: flex; align-items: center; gap: 10px; min-height: 66px; margin: 0 -16px; padding: 10px 16px; background: var(--bg); }
.topbar-title { flex: 1; min-width: 0; margin: 0; font: 800 20px/1.1 var(--disp); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score .topbar-title { font: 500 14px/1.2 var(--body); color: var(--muted); }
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.hud-spacer { width: 44px; flex: none; }

/* ---------- Boutons ---------- */
.icon-btn { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 0; background: var(--s2); color: var(--text); transition: transform .15s var(--ease), background .2s; }
.icon-btn:hover { background: #312E38; }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.ghost { background: transparent; color: var(--ink); }
.icon-btn.ghost:hover { background: rgba(17, 16, 21, .12); }
.pill-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: var(--r); border: 0; background: var(--s2); font-weight: 500; font-size: 14px; white-space: nowrap; }
.pill-btn .ic { width: 18px; height: 18px; color: var(--gold); }
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 56px; padding: 0 28px; border: 0; border-radius: var(--r); background: var(--cyan); color: var(--ink); font: 800 17px/1 var(--disp); letter-spacing: -.01em; transition: transform .2s var(--spring), filter .2s; }
.btn-primary:hover { transform: translateY(-2px) rotate(-1deg); filter: brightness(1.05); }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { background: var(--s2); color: var(--muted); cursor: not-allowed; transform: none; }
.btn-xl { min-height: 64px; padding: 0 34px; font-size: 20px; }
.btn-xl .ic { width: 22px; height: 22px; }
.btn-dark { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 24px; border: 0; border-radius: var(--r); background: var(--ink); color: var(--text); font: 700 16px/1 var(--disp); }
.btn-dark:hover { background: #24222A; }
.btn-dark:disabled { opacity: .4; }
.btn-outline { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px; border-radius: var(--r); border: 2px solid var(--line2); background: transparent; color: var(--text); font-weight: 600; text-decoration: none; }
.btn-outline:hover { border-color: var(--text); }
.btn-text { min-height: 44px; padding: 0 12px; border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 4px; font-size: 15px; }
.btn-text:hover { color: var(--text); }
.chip { min-height: 44px; padding: 0 18px; border-radius: var(--r); border: 0; background: var(--s1); color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--ink); }
.step-k { margin: 26px 0 10px; font: 700 12px/1 var(--body); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

/* ---------- Bulle de Léo (carte claire, sans contour) ---------- */
.bubble { position: relative; max-width: 520px; padding: 12px 18px; border-radius: 22px; background: var(--text); color: var(--ink); box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .7); }
.bubble p { margin: 0; font-size: 15px; line-height: 1.4; font-weight: 500; }
.bubble-who { display: block; font: 800 11px/1 var(--disp); letter-spacing: .1em; text-transform: uppercase; color: #0A6C9A; margin-bottom: 5px; }
.bubble.talk { animation: bubIn .45s var(--spring); }
@keyframes bubIn { from { transform: translateY(10px) scale(.94); opacity: 0; } }

/* =========================================================
   1. INTRO
   ========================================================= */
.intro { display: flex; flex-direction: column; padding-top: 10px; overflow: hidden; }
.marquee { margin: 0 -16px 8px; display: grid; gap: 6px; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.mq-row { display: flex; width: max-content; gap: 28px; animation: mq 60s linear infinite; }
.mq-row.rev { animation-direction: reverse; animation-duration: 70s; }
@keyframes mq { to { transform: translateX(-50%); } }
.mq-item { display: inline-flex; gap: 10px; align-items: baseline; white-space: nowrap; font-size: 13px; }
.mq-q { color: #8E899A; }
.mq-a { font: 700 13px/1 var(--disp); }
.intro-stage { display: flex; flex-direction: column; gap: 14px; }
.poster { position: relative; height: 300px; }
.poster-block { position: absolute; left: 0; right: 0; bottom: 0; height: 64%; border-radius: var(--rb); background: var(--cyan); overflow: visible; }
.poster-block .leo-cut { position: absolute; right: 2%; bottom: 0; height: 156%; width: auto; z-index: 2; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .35)); border-radius: 0 0 var(--rb) 0; }
.logo { position: absolute; inset: 0; margin: 0; pointer-events: none; font: 900 66px/.82 var(--disp); letter-spacing: -.045em; text-transform: uppercase; }
.logo .l1 { position: absolute; left: 2px; top: 8px; z-index: 1; color: var(--text); }
.logo .l2 { position: absolute; left: 14px; bottom: 22px; z-index: 3; color: var(--ink); }
.logo .ast { display: inline-block; color: var(--text); margin-right: .02em; animation: spinA 6s var(--ease) infinite; }
@keyframes spinA { 0%, 70% { transform: rotate(0); } 85% { transform: rotate(180deg) scale(1.15); } 100% { transform: rotate(180deg); } }
.leo-swap { animation: leoIn .4s var(--spring); }
@keyframes leoIn { from { transform: translateY(8px) scale(.97); opacity: .5; } }
.intro-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ghost-field { display: flex; flex-direction: column; gap: 4px; padding: 12px 18px; border-radius: 20px; background: var(--s1); }
.gf-q { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gf-a { display: flex; align-items: center; font: 700 22px/1.1 var(--disp); color: var(--text); min-height: 26px; }
.gf-a.ok { color: var(--ok); }
.caret { display: inline-block; width: 3px; height: 22px; margin-left: 3px; background: var(--cyan); animation: car 1s steps(2, start) infinite; }
@keyframes car { 50% { opacity: 0; } }
.intro-actions { display: flex; flex-direction: column; align-items: stretch; gap: 2px; }
.intro-stats { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
.intro-stats > div { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; border-radius: 20px; background: var(--s1); min-width: 0; }
.intro-stats .k { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.intro-stats .is-rec b { font: 800 26px/1 var(--disp); color: var(--gold); white-space: nowrap; }
.intro-stats .is-last b { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; min-width: 0; }
.intro-stats .is-last b span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.intro-promise { margin: 0; font-size: 15px; color: var(--muted); text-align: center; }
.intro-promise b { font-family: var(--disp); color: var(--text); }
body[data-profile="new"] .only-back, body[data-profile="back"] .only-new { display: none; }

/* =========================================================
   2. PAQUETS
   ========================================================= */
.packs-layout { display: grid; gap: 8px; }
.packs-main, .packs-side { min-width: 0; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 4px -16px 12px; padding: 0 16px; }
.chips::-webkit-scrollbar { display: none; }
.random { position: relative; width: 100%; display: flex; align-items: center; gap: 14px; min-height: 84px; padding: 0 20px 0 0; margin-bottom: 12px; border: 0; border-radius: 26px; background: var(--s1); text-align: left; overflow: hidden; }
.rd-big { width: 84px; align-self: stretch; display: grid; place-items: center; background: var(--cyan); color: var(--ink); font: 900 46px/1 var(--disp); flex: none; }
body.spinning .rd-big { animation: rdSpin .5s linear infinite; }
@keyframes rdSpin { to { transform: rotateY(360deg); } }
.rd-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rd-txt b { font: 800 17px/1.1 var(--disp); }
.rd-txt span { font-size: 13px; color: var(--muted); }
.rd-go { color: var(--cyan); }
.pack-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pack { position: relative; min-width: 0; min-height: 190px; display: flex; flex-direction: column; padding: 14px 14px 12px; border-radius: 26px; background: var(--c); color: var(--ink); cursor: pointer; overflow: hidden; transition: transform .25s var(--spring); isolation: isolate; }
.pack:hover { transform: translateY(-3px) rotate(-.6deg); }
.pk-deco { position: absolute; right: -18px; bottom: -22px; z-index: -1; color: rgba(17, 16, 21, .14); }
.pk-deco .ic { width: 110px; height: 110px; stroke-width: 1.6; }
.pk-top { display: flex; align-items: center; justify-content: space-between; margin: -6px -8px 6px 0; }
.pk-lv { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink2); }
.pk-t { margin: 0; font: 800 15.5px/1.12 var(--disp); letter-spacing: -.02em; overflow-wrap: anywhere; }
.pk-s { margin: 5px 0 10px; font-size: 12.5px; line-height: 1.3; color: var(--ink2); font-weight: 500; }
.pk-meta { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; font-weight: 600; }
.pk-rec { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: var(--r); background: var(--ink); color: var(--gold); font-weight: 700; }
.pk-rec .ic { width: 13px; height: 13px; }
.pk-mastery { height: 5px; margin-top: 10px; border-radius: 5px; background: rgba(17, 16, 21, .18); overflow: hidden; }
.pk-mastery i { display: block; height: 100%; background: var(--ink); border-radius: 5px; }
.pk-ml { margin: 5px 0 0; font-size: 11px; font-weight: 600; color: var(--ink2); }
.pack.selected { box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--text); }
.pack.selected::after { content: ""; position: absolute; right: 12px; bottom: 12px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23F6F4F8' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/15px no-repeat; }
.pack.spin-hit { transform: scale(1.04) rotate(-1.5deg); box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--cyan); z-index: 2; }
body.spinning .pack:not(.spin-hit) { filter: saturate(.3) brightness(.6); }

.has-menu { position: relative; }
.menu { display: none; position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 230px; padding: 6px; border-radius: 18px; background: var(--s1); color: var(--text); box-shadow: 0 20px 50px rgba(0, 0, 0, .6); }
.has-menu.open .menu { display: block; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px; background: none; text-align: left; font-size: 14px; color: var(--text); }
.menu button:hover { background: var(--s2); }
.menu button[aria-pressed="false"] { color: var(--muted); }
.menu .ic { width: 18px; height: 18px; color: var(--muted); }

.side-leo { display: none; }
.formats { display: grid; gap: 8px; }
.format { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px 18px; border: 0; border-radius: 22px; background: var(--s1); text-align: left; transition: background .2s, transform .2s var(--spring); }
.format[aria-pressed="true"] { background: var(--cyan); color: var(--ink); }
.f-name { display: flex; align-items: center; gap: 8px; font: 800 19px/1.1 var(--disp); letter-spacing: -.02em; }
.f-desc { font-size: 13.5px; line-height: 1.35; color: var(--muted); }
.format[aria-pressed="true"] .f-desc { color: var(--ink2); }
.f-desc em { font-style: normal; font-weight: 700; color: var(--gold); white-space: nowrap; }
.format .if-locked { display: none; }
.format.locked .if-locked { display: inline; }
.format.locked .if-unlocked { display: none; }
.format.locked { background: transparent; border: 2px dashed var(--line2); cursor: help; }
.format.locked .f-name { color: var(--muted); }
.f-lock .ic { width: 16px; height: 16px; }
.format.defi[aria-pressed="true"] { background: var(--coral); }
.format.defi[aria-pressed="true"] .f-desc em { color: var(--ink); }
.durs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.durs button { display: flex; align-items: baseline; justify-content: center; gap: 4px; min-height: 72px; border: 0; border-radius: 22px; background: var(--s1); }
.durs b { font: 900 30px/1 var(--disp); }
.durs span { font-size: 13px; color: var(--muted); }
.durs button[aria-pressed="true"] { background: var(--text); color: var(--ink); }
.durs button[aria-pressed="true"] span { color: var(--ink2); }
.launch { position: sticky; bottom: 0; z-index: 8; display: flex; align-items: center; gap: 12px; margin: 22px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, rgba(17, 16, 21, 0), var(--bg) 28%); }
.launch-sel { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.launch-sel .sw { width: 14px; height: 40px; border-radius: 6px; }
.ls-txt { min-width: 0; display: flex; flex-direction: column; }
.ls-txt > b { font: 700 14px/1.2 var(--disp); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ls-txt > span { font-size: 12.5px; color: var(--muted); }
.btn-launch { min-width: 132px; }

/* =========================================================
   3. QUESTION
   ========================================================= */
.game { display: flex; flex-direction: column; }
.hud { position: sticky; top: var(--memos); z-index: 12; display: flex; align-items: center; gap: 12px; margin: 0 -16px; padding: 10px 16px; background: var(--bg); }
.hud-time { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.hud-time .num { font: 800 26px/1 var(--disp); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.timebar { display: block; height: 5px; border-radius: 5px; background: var(--s2); overflow: hidden; }
.timebar i { display: block; height: 100%; width: calc(var(--p, 1) * 100%); background: var(--cyan); border-radius: 5px; transition: width .1s linear; }
body.final10 .hud-time .num { color: var(--bad); animation: tick 1s var(--spring) infinite; transform-origin: left center; }
body.final10 .timebar i { background: var(--bad); }
@keyframes tick { 0% { transform: scale(1.12); } 30%, 100% { transform: scale(1); } }
.hud-score { position: relative; display: flex; flex-direction: row-reverse; align-items: baseline; gap: 6px; }
.hud-score .num { font: 900 34px/1 var(--disp); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.hud-score .k { font-size: 13px; color: var(--muted); }
.num.bump { animation: bump .45s var(--spring); }
@keyframes bump { 40% { transform: scale(1.3); } }
.fly { position: absolute; right: 0; top: 100%; pointer-events: none; z-index: 20; }
.fly-pts { position: absolute; right: 0; top: 0; font: 900 44px/1 var(--disp); color: var(--ok); letter-spacing: -.03em; animation: flyUp 1s var(--ease) forwards; white-space: nowrap; }
.fly-pts.frozen { animation: none; transform: translateY(8px); }
@keyframes flyUp { 0% { transform: translateY(200px) scale(.6); opacity: 0; } 25% { opacity: 1; } 70% { transform: translateY(8px) scale(1.15); opacity: 1; } 100% { transform: translateY(-4px) scale(.9); opacity: 0; } }

.game-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 6px; }
.g-left { display: none; }
.g-main { min-width: 0; display: flex; flex-direction: column; }
.block { position: relative; min-height: 210px; display: flex; flex-direction: column; padding: 18px 20px 26px; border-radius: var(--rb); background: var(--pack); color: var(--ink); overflow: hidden; isolation: isolate; transition: background .35s var(--ease); }
.block-top { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; min-height: 30px; }
.meta { font-size: 12.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink2); }
.streak-chip { margin-left: auto; display: inline-flex; align-items: baseline; padding: 6px 12px; border-radius: var(--r); background: var(--ink); color: var(--text); font: 800 15px/1 var(--disp); }
body:not([data-streak="warm"]):not([data-streak="hot"]) .streak-chip { opacity: 0; }
body[data-streak="hot"] .streak-chip { background: var(--text); color: var(--ink); animation: bump .5s var(--spring); }
.x2 { display: none; padding: 6px 12px; border-radius: var(--r); background: var(--ink); color: var(--bad); font: 800 13px/1 var(--disp); }
body.final10 .x2 { display: inline-block; }
.question { margin: 0; font: 700 clamp(23px, 6.6vw, 46px)/1.12 var(--disp); letter-spacing: -.03em; text-wrap: balance; overflow-wrap: anywhere; }
.q-in { animation: qIn .45s var(--ease); }
@keyframes qIn { from { opacity: 0; transform: translateY(20px); clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.block-leo { display: none; }
.countdown { position: absolute; right: -10px; bottom: -40px; z-index: -1; font: 900 260px/.8 var(--disp); color: rgba(17, 16, 21, .14); letter-spacing: -.06em; display: none; }
body.final10 .countdown { display: block; }
.countdown.beat { animation: beat 1s var(--ease); }
@keyframes beat { from { transform: scale(1.18); color: rgba(17, 16, 21, .28); } }
body.final10 .block { animation: blockPulse 1s ease-in-out infinite; }
@keyframes blockPulse { 50% { box-shadow: 0 0 0 4px var(--bad); } }
body.fx-correct .block { animation: blockPop .45s var(--spring); }
@keyframes blockPop { 40% { transform: scale(1.02) rotate(-.6deg); } }
.reveal { display: none; }
body[data-state="reveal"] .block { background: var(--text); }
body[data-state="reveal"] .question, body[data-state="reveal"] .block-top { display: none; }
body[data-state="reveal"] .reveal { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; animation: qIn .45s var(--ease); }
.rv-q { margin: 0 0 6px; font-size: 14px; font-weight: 500; color: #4A4654; }
.rv-k { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: #4A4654; }
.rv-answer { margin: 0; font: 900 clamp(38px, 12vw, 84px)/.95 var(--disp); letter-spacing: -.045em; overflow-wrap: anywhere; }
.rv-alts { margin: 6px 0 12px; font-size: 13px; color: #4A4654; }

.game-bubble { margin: -18px 14px 0 auto; z-index: 3; max-width: calc(100% - 28px); opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; min-height: 0; }
.game-bubble.talk { opacity: 1; transform: none; }
.answer { margin: 14px 0 0; }
.field { position: relative; display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 22px; border-radius: var(--r); background: var(--text); color: var(--ink); box-shadow: 0 0 0 0 transparent; transition: box-shadow .2s; }
.field:focus-within { box-shadow: 0 0 0 4px rgba(42, 180, 245, .45); }
.field input { flex: 1; min-width: 0; height: 54px; border: 0; background: none; outline: none; color: var(--ink); font: 600 20px var(--body); }
.field input::placeholder { color: #6E6979; font-weight: 400; }
.field input:disabled { opacity: .5; }
.go { width: 54px; height: 54px; flex: none; border: 0; border-radius: 50%; background: var(--ink); color: var(--text); display: grid; place-items: center; }
body[data-state="wrong"] .field { box-shadow: 0 0 0 4px var(--bad); }
body.fx-correct .field { box-shadow: 0 0 0 4px var(--ok); }
.shake { animation: shake .42s cubic-bezier(.36, .07, .19, .97); }
.shake-frozen { transform: translateX(-4px) rotate(-.4deg); }
@keyframes shake { 15%, 85% { transform: translateX(-3px); } 30%, 70% { transform: translateX(7px) rotate(.6deg); } 45% { transform: translateX(-9px) rotate(-.6deg); } 60% { transform: translateX(9px); } }
.under { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; }
.typed { display: none; }
.claim { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--r); background: var(--ok); color: var(--ink); font-weight: 700; font-size: 14px; }
.claim .ic { width: 16px; height: 16px; }
.hint { flex-basis: 100%; margin: 0; text-align: center; font: 700 15px/1.3 var(--disp); color: var(--gold); }
.pass { position: relative; min-height: 44px; min-width: 170px; padding: 0 22px; border: 0; border-radius: var(--r); background: var(--s1); color: var(--muted); overflow: hidden; isolation: isolate; font-weight: 600; }
.pass-fill { position: absolute; inset: 0; z-index: -1; transform-origin: left; transform: scaleX(var(--p, 0)); background: var(--s2); transition: transform .1s linear; }
.pass.ready { background: var(--s2); color: var(--text); }
.pass.ready .pass-fill { background: transparent; }
.pass:disabled { cursor: default; }
body[data-state="reveal"] .answer, body[data-state="reveal"] .under { visibility: hidden; }

.history { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; animation: qIn .3s var(--ease); }
.h-a { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.h.is-ok .h-a::before { content: "✓ "; color: var(--ok); }
.h.is-pass .h-a { color: var(--muted); }
.h-t { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }

/* =========================================================
   4. SCORE
   ========================================================= */
.confetti { position: fixed; inset: var(--memos) 0 0 0; width: 100%; height: calc(100% - var(--memos)); z-index: 40; pointer-events: none; }
.score-layout { display: grid; gap: 18px; }
.score-poster { position: relative; min-height: 360px; padding: 22px 20px 0; border-radius: var(--rb); background: var(--pack); color: var(--ink); overflow: hidden; isolation: isolate; display: flex; flex-direction: column; align-items: flex-start; }
body[data-state="record"] .score-poster { background: var(--gold); }
.record-badge { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 8px 14px; border-radius: var(--r); background: var(--ink); color: var(--gold); font: 800 13px/1 var(--disp); letter-spacing: .06em; text-transform: uppercase; animation: pop .6s var(--spring); }
.record-badge .ic { width: 15px; height: 15px; fill: currentColor; }
@keyframes pop { from { transform: scale(.5) rotate(-6deg); opacity: 0; } }
.verdict { margin: 0; font: 800 22px/1.05 var(--disp); letter-spacing: -.02em; max-width: 60%; }
.big-score { position: relative; z-index: 1; margin: 6px 0 0; display: flex; align-items: baseline; gap: 6px; font: 900 118px/.82 var(--disp); letter-spacing: -.07em; font-variant-numeric: tabular-nums; }
.big-score small { font-size: 20px; letter-spacing: 0; font-weight: 800; }
.score-leo { position: absolute; right: -16px; bottom: 0; height: 250px; width: auto; z-index: 0; }
.score-bubble { position: relative; z-index: 2; margin: auto 0 16px; max-width: 64%; }
.score-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.compare { margin: 0; font-size: 15px; color: var(--muted); }
.score-actions { display: flex; flex-direction: column; gap: 8px; }
.defi-next { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 0 20px; border: 0; border-radius: var(--r); background: var(--coral); color: var(--ink); font: 800 15px/1.1 var(--disp); text-align: left; animation: pop .6s var(--spring) .6s backwards; }
.defi-next .ic { margin-left: auto; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); animation: car 1.2s steps(2, start) infinite; flex: none; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats > div { padding: 14px 12px; border-radius: 22px; background: var(--s1); }
.stats b { display: block; font: 900 34px/1 var(--disp); letter-spacing: -.04em; }
.stats span { font-size: 12.5px; color: var(--muted); }
.share { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 22px; background: var(--s1); }
.dots { display: flex; flex-wrap: wrap; gap: 6px; }
.dot { display: inline-block; width: 16px; height: 16px; border-radius: 6px; }
.dot.is-fast { background: var(--cyan); }
.dot.is-slow { background: rgba(42, 180, 245, .38); }
.dot.is-pass { background: transparent; box-shadow: inset 0 0 0 2px #6E6979; }
.share-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dots-legend { flex: 1; min-width: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12px; color: var(--muted); }
.dots-legend .dot { width: 11px; height: 11px; border-radius: 4px; margin-right: -6px; }
.review .step-k { margin-top: 4px; }
.review ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 12px 16px; border-radius: 18px; background: var(--s1); }
.rv-q { font-size: 13px; color: var(--muted); }
.rv .rv-q { margin: 0; color: var(--muted); }
.rv-a { grid-column: 1; font: 700 16px/1.2 var(--disp); letter-spacing: -.02em; }
.rv-st { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: var(--r); background: var(--s2); color: var(--muted); }
.rv.is-pass .rv-st { background: rgba(255, 90, 78, .16); color: #FF9D94; }
.review-empty { color: var(--muted); font-size: 14px; }
.signup { display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 22px; background: var(--s1); border-left: 6px solid var(--cyan); }
.signup p { margin: 0; font-size: 14px; color: var(--muted); }
.signup b { color: var(--text); }
.signup .btn-outline { align-self: flex-start; min-height: 46px; }

/* =========================================================
   5. JE TE DÉFIE (rupture : aplat corail plein écran)
   ========================================================= */
.screen.defi { background: var(--coral); color: var(--ink); overflow: hidden; margin: 0; padding-top: 18px; animation: flood .6s var(--ease); }
@keyframes flood { from { clip-path: circle(0 at 50% 30%); } to { clip-path: circle(150% at 50% 30%); } }
.defi-flood { position: absolute; inset: 0; background: repeating-linear-gradient(-12deg, rgba(17, 16, 21, .05) 0 24px, transparent 24px 48px); pointer-events: none; }
.defi-layout { position: relative; display: grid; justify-items: start; }
.defi-title { position: relative; z-index: 1; margin: 0; display: flex; flex-direction: column; font: 900 74px/.84 var(--disp); letter-spacing: -.06em; text-transform: uppercase; }
.defi-title span:last-child { padding-left: .3em; }
.defi-leo { position: relative; z-index: 2; justify-self: end; width: min(330px, 84vw); height: auto; margin: -70px -16px 0 0; animation: leoBurst .7s var(--spring) .2s backwards; }
@keyframes leoBurst { from { transform: translateX(60px) scale(.9); opacity: 0; } }
.defi-copy { position: relative; z-index: 3; margin-top: -40px; display: flex; flex-direction: column; gap: 14px; width: 100%; }
.defi-small { margin: 0; padding: 12px 16px; border-radius: 20px; background: var(--ink); color: var(--text); font-size: 15px; font-weight: 500; align-self: flex-start; max-width: 340px; }
.unlock-card { padding: 18px; border-radius: 24px; background: var(--text); color: var(--ink); animation: pop .5s var(--spring) .8s backwards; }
.uc-k { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #9C2A20; }
.uc-t { margin: 4px 0 6px; font: 900 22px/1.05 var(--disp); letter-spacing: -.03em; }
.uc-d { margin: 0; font-size: 14px; line-height: 1.45; color: #3A3642; }
.screen.defi .btn-dark { align-self: stretch; }

/* =========================================================
   6. DUEL
   ========================================================= */
.duel { display: flex; flex-direction: column; }
.vs { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr 1fr; border-radius: 20px; overflow: hidden; }
.vs-side { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 12px; color: var(--ink); }
.vs-side.you { background: var(--cyan); }
.vs-side.leo { background: var(--coral); }
.vs-side .k { font: 800 12px/1 var(--disp); letter-spacing: .08em; text-transform: uppercase; }
.vs-side .num { font: 900 28px/1 var(--disp); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.vs-side .fly { right: auto; left: 40%; }
.hud-time.small { flex: 0 0 64px; }
.hud-time.small .num { font-size: 20px; }
.duel-layout { display: grid; gap: 14px; padding-top: 8px; }
.duel-leo-block { position: relative; height: 176px; border-radius: var(--rb); background: var(--coral); overflow: hidden; isolation: isolate; }
.duel-leo-block > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; z-index: -1; }
.duel-leo-block::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 40%, rgba(17, 16, 21, .75)); }
.gauge { position: absolute; left: 14px; right: 14px; bottom: 12px; display: flex; align-items: center; gap: 10px; }
.g-k { font-size: 12px; font-weight: 700; color: var(--text); white-space: nowrap; }
.g-bar { flex: 1; height: 10px; border-radius: 10px; background: rgba(246, 244, 248, .25); overflow: hidden; }
.g-bar i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); border-radius: 10px; background: var(--coral); transition: width .1s linear; }
.cut { position: absolute; left: 10px; right: 10px; top: 10px; z-index: 3; padding: 10px 14px 12px; border-radius: 16px; background: var(--ink); color: var(--text); font: 700 13px/1.25 var(--disp); overflow: hidden; animation: pop .25s var(--spring); }
.cut i { position: absolute; left: 0; bottom: 0; height: 4px; width: calc(var(--p, 1) * 100%); background: var(--coral); }
.duel-bubble { position: absolute; left: 10px; right: 10px; top: 10px; z-index: 2; opacity: 0; transition: opacity .2s; padding: 10px 14px; }
.duel-bubble.talk { opacity: 1; }
body[data-state="leobuzz"] .duel-bubble { opacity: 0; }
.duel-play { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.duel-play .question { color: var(--text); font-size: clamp(21px, 6vw, 40px); }
.duel-play .answer { margin-top: 10px; }
.lock-msg { display: none; margin: 10px 0 0; text-align: center; font-weight: 700; color: #FF9D94; }
body[data-screen="duel"][data-state="locked"] .lock-msg { display: block; }
body[data-screen="duel"][data-state="locked"] .field { box-shadow: 0 0 0 4px var(--coral); }
body[data-screen="duel"][data-state="leobuzz"] .duel-leo-block { animation: blockPulse .6s ease-in-out infinite; }

/* =========================================================
   7. RÉSULTAT DU DUEL
   ========================================================= */
.ds-layout { display: grid; gap: 16px; }
.ds-poster { position: relative; height: 300px; border-radius: var(--rb); background: var(--cyan); color: var(--ink); overflow: hidden; }
body[data-state="win"] .ds-poster { background: var(--gold); }
body[data-state="lose"] .ds-poster { background: var(--coral); }
.ds-title { position: relative; z-index: 1; margin: 0; padding: 20px 20px 0; font: 900 52px/.9 var(--disp); letter-spacing: -.06em; text-transform: uppercase; }
.ds-leo { position: absolute; right: -10px; bottom: 0; height: 240px; width: auto; z-index: 2; }
.ds-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ds-sub { margin: 0; font: 700 18px/1.2 var(--disp); }
.ds-vs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ds-vs > .you, .ds-vs > .leo { display: flex; flex-direction: column; padding: 14px 16px; border-radius: 22px; color: var(--ink); }
.ds-vs > .you { background: var(--cyan); }
.ds-vs > .leo { background: var(--coral); }
.ds-vs span { font: 800 12px/1 var(--disp); letter-spacing: .1em; text-transform: uppercase; }
.ds-vs b { font: 900 46px/1 var(--disp); letter-spacing: -.05em; }
.ds-bar { grid-column: 1 / -1; height: 10px; border-radius: 10px; background: var(--coral); overflow: hidden; }
.ds-bar i { display: block; height: 100%; width: calc(var(--p, .5) * 100%); background: var(--cyan); }

/* =========================================================
   8. PALMARÈS
   ========================================================= */
.wall-wrap { max-width: 900px; margin: 0 auto; }
.wall-title { margin: 6px 0 8px; font: 900 34px/1 var(--disp); letter-spacing: -.04em; }
.wall-count { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.wall-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.seg { display: inline-grid; grid-auto-flow: column; gap: 4px; padding: 4px; border-radius: var(--r); background: var(--s1); max-width: 100%; }
.seg button { min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--r); background: none; color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--ink); }
.wall { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.wall-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto 44px; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.w-rank { font: 900 18px/1 var(--disp); color: var(--muted); letter-spacing: -.03em; }
.wall-row.has .w-rank { color: var(--text); }
.w-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.w-t { font: 700 14.5px/1.15 var(--disp); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-bar { height: 12px; border-radius: 12px; background: var(--s1); overflow: hidden; }
.w-bar i { display: block; height: 100%; width: var(--w, 0%); border-radius: 12px; background: var(--c); transition: width .7s var(--ease); }
.w-sub { font-size: 12px; color: var(--muted); }
.w-best { font: 900 26px/1 var(--disp); letter-spacing: -.04em; text-align: right; white-space: nowrap; }
.w-best small { font-size: 12px; margin-left: 3px; letter-spacing: 0; color: var(--muted); }
.w-best .muted { font: 500 12px var(--body); letter-spacing: 0; }
.wall-row.has .w-best { color: var(--gold); }
.wall-row:not(.has) .w-t { color: var(--muted); }
.wall-row.top .w-rank { color: var(--gold); }
.wall-row.top .w-t::after { content: " · record absolu"; font: 600 11px var(--body); color: var(--gold); letter-spacing: 0; }
.w-play { background: var(--s1); }

/* =========================================================
   AIDE
   ========================================================= */
.help { position: fixed; inset: var(--memos) 0 0 0; z-index: 60; display: grid; place-items: end center; padding: 12px; background: rgba(8, 8, 11, .7); backdrop-filter: blur(4px); animation: screenIn .3s var(--ease); }
.help-card { position: relative; width: 100%; max-width: 820px; display: grid; grid-template-columns: minmax(0, 1fr) 130px; grid-template-areas: "idx leo" "body body"; padding: 20px 20px 18px; border-radius: 30px; background: var(--cyan); color: var(--ink); overflow: hidden; }
.help-skip { position: absolute; right: 8px; top: 8px; z-index: 3; min-height: 44px; padding: 0 14px; border: 0; border-radius: var(--r); background: rgba(17, 16, 21, .12); color: var(--ink); font-weight: 600; font-size: 14px; }
.help-idx { grid-area: idx; margin: 0; align-self: end; font: 900 64px/.85 var(--disp); letter-spacing: -.06em; }
.help-leo { grid-area: leo; width: 150px; height: auto; margin: 10px -20px -10px -10px; align-self: end; }
.help-body { grid-area: body; min-width: 0; padding-top: 12px; border-top: 2px solid rgba(17, 16, 21, .2); }
.help-title { margin: 0 0 8px; font: 900 24px/1.05 var(--disp); letter-spacing: -.03em; }
.help-text { margin: 0; font-size: 15px; line-height: 1.5; font-weight: 500; }
.help-nav { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.help-dots { flex: 1; display: flex; gap: 6px; }
.help-dots i { width: 9px; height: 9px; border-radius: 9px; background: rgba(17, 16, 21, .25); transition: width .3s var(--spring); }
.help-dots i.on { width: 30px; background: var(--ink); }
.help .icon-btn { background: rgba(17, 16, 21, .12); color: var(--ink); }

/* =========================================================
   BUREAU (≥ 1024 px)
   ========================================================= */
@media (min-width: 1024px) {
  .screen { padding: 0 48px 36px; }
  .topbar { margin: 0 -48px; padding: 14px 48px; }
  .topbar-title { font-size: 28px; }
  .score .topbar-title { font-size: 15px; }

  .intro { padding-top: 18px; min-height: calc(100dvh - var(--memos)); }
  .marquee { margin: 0 -48px 18px; gap: 10px; }
  .mq-item, .mq-a { font-size: 15px; }
  .intro-stage { flex-direction: row; align-items: stretch; gap: 48px; max-width: 1340px; width: 100%; margin: 0 auto; flex: 1; }
  .poster { flex: 1.25; height: auto; min-height: 640px; }
  .poster-block { height: 62%; }
  .poster-block .leo-cut { height: 150%; right: 4%; }
  .logo { font-size: 150px; }
  .logo .l1 { left: 0; top: 0; }
  .logo .l2 { left: 32px; bottom: 36px; }
  .intro-side { flex: 1; justify-content: center; gap: 16px; max-width: 480px; }
  .ghost-field { padding: 18px 22px; }
  .gf-a { font-size: 30px; min-height: 36px; }
  .caret { height: 30px; }
  .intro-actions { flex-direction: row; align-items: center; gap: 10px; }
  .intro-promise { text-align: left; }

  .packs-layout { grid-template-columns: minmax(0, 1fr) 400px; gap: 40px; max-width: 1360px; margin: 0 auto; }
  .pack-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .pack { min-height: 220px; padding: 18px 18px 14px; }
  .pk-t { font-size: 18px; }
  .chips { margin: 4px 0 14px; padding: 0; }
  .packs-side { position: sticky; top: calc(var(--memos) + 80px); align-self: start; }
  .side-leo { display: flex; align-items: flex-end; height: 170px; margin-bottom: -6px; position: relative; }
  .side-leo img { height: 190px; width: auto; margin-left: -12px; align-self: flex-end; }
  .side-leo .bubble { position: absolute; left: 130px; right: 0; bottom: 34px; }
  .packs-side .step-k:first-of-type { margin-top: 10px; }
  .launch { position: static; margin: 22px 0 0; padding: 0; background: none; }

  .hud { margin: 0 -48px; padding: 14px 48px; gap: 24px; }
  .hud-time { max-width: 640px; margin: 0 auto; flex-direction: row; align-items: center; gap: 18px; }
  .hud-time .num { font-size: 34px; }
  .hud-time .timebar { flex: 1; height: 8px; }
  .hud-score .num { font-size: 46px; }
  .game-layout { grid-template-columns: 300px minmax(0, 1fr); gap: 48px; max-width: 1340px; width: 100%; margin: 0 auto; padding-top: 18px; align-items: start; }
  .g-left { display: flex; flex-direction: column; gap: 20px; position: sticky; top: calc(var(--memos) + 100px); }
  .g-pack { display: flex; align-items: center; gap: 10px; margin: 0; font: 700 15px/1.2 var(--disp); }
  .g-mode { margin-left: auto; font: 500 12px var(--body); color: var(--muted); }
  .streak-big { display: flex; align-items: baseline; flex-wrap: wrap; font: 900 140px/.8 var(--disp); letter-spacing: -.08em; color: var(--text); }
  .streak-big .x { font-size: .5em; color: var(--muted); margin-right: 4px; }
  .streak-big small { flex-basis: 100%; margin-top: 10px; font: 600 13px var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
  body[data-streak="hot"] .streak-big { color: var(--pack); }
  .ghostbox { display: flex; align-items: baseline; justify-content: space-between; padding: 14px 18px; border-radius: 20px; background: var(--s1); }
  .ghostbox .k { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
  .ghostbox b { font: 900 26px/1 var(--disp); letter-spacing: -.03em; }
  .streak-chip { display: none; }
  .block { min-height: 420px; padding: 30px 36px 40px; border-radius: 40px; }
  .question { font-size: 50px; max-width: 64%; }
  .block-leo { display: block; position: absolute; right: -10px; bottom: 0; height: 104%; width: auto; z-index: 1; }
  body[data-state="reveal"] .block-leo { opacity: 0; }
  .countdown { font-size: 460px; left: 26px; right: auto; bottom: -70px; }
  .rv-answer { font-size: 104px; }
  .game-bubble { margin: -38px 24% 0 auto; max-width: 420px; }
  .field input { height: 62px; font-size: 22px; }
  .go { width: 62px; height: 62px; }
  .answer { max-width: 820px; }
  .under { justify-content: flex-start; max-width: 820px; }

  .score-layout { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; max-width: 1340px; margin: 0 auto; align-items: start; }
  .score-poster { min-height: 640px; padding: 36px 40px 0; border-radius: 44px; position: sticky; top: calc(var(--memos) + 80px); }
  .verdict { font-size: 34px; }
  .big-score { font-size: 230px; }
  .big-score small { font-size: 30px; }
  .score-leo { height: 470px; right: -20px; }
  .score-bubble { max-width: 46%; margin-bottom: 36px; }
  .score-actions { flex-direction: row; }
  .score-actions .btn-xl { flex: 1; }

  .screen.defi { padding: 30px 48px; }
  .defi-layout { grid-template-columns: 1.1fr 1fr; grid-template-rows: auto 1fr; max-width: 1340px; margin: 0 auto; column-gap: 20px; }
  .defi-title { grid-column: 1; font-size: 150px; }
  .defi-leo { grid-column: 2; grid-row: 1 / span 2; width: 560px; margin: 0; align-self: end; }
  .defi-copy { grid-column: 1; margin-top: 30px; max-width: 560px; }
  .screen.defi .btn-dark { align-self: flex-start; }

  .vs { flex: 0 1 720px; margin: 0 auto; }
  .vs-side { padding: 10px 22px; }
  .vs-side .num { font-size: 46px; }
  .vs-side .k { font-size: 16px; }
  .hud-time.small { flex: 0 0 160px; margin: 0; }
  .hud-time.small .num { font-size: 28px; }
  .duel-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; max-width: 1340px; margin: 0 auto; width: 100%; padding-top: 22px; align-items: start; }
  .duel-leo-block { height: 560px; border-radius: 44px; }
  .duel-play { padding-top: 80px; }

  .ds-layout { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; max-width: 1340px; margin: 0 auto; align-items: center; }
  .ds-poster { height: 640px; border-radius: 44px; }
  .ds-title { font-size: 112px; padding: 40px; }
  .ds-leo { height: 520px; }
  .ds-vs b { font-size: 64px; }
  .ds-side .score-actions { flex-direction: row; }

  .wall-title { font-size: 64px; }
  .wall-row { grid-template-columns: 52px minmax(0, 1fr) 150px 44px; gap: 20px; padding: 16px 0; }
  .w-rank { font-size: 26px; }
  .w-t { font-size: 18px; }
  .w-bar { height: 16px; }
  .w-best { font-size: 38px; }

  .help { place-items: center; }
  .help-card { grid-template-columns: minmax(0, 1fr) 280px; grid-template-areas: "idx leo" "body leo"; padding: 40px 44px 36px; border-radius: 44px; }
  .help-idx { font-size: 120px; }
  .help-leo { width: 320px; margin: -10px -44px -36px 0; }
  .help-body { padding-top: 18px; }
  .help-title { font-size: 34px; }
  .help-text { font-size: 18px; }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .mq-row { animation: none; }
}
body.shot .mq-row { animation: none; }

/* ---------- Passe 2 (après captures) ---------- */
/* Unbounded et Lexend n'ont pas l'espace fine insécable (U+202F) : repli sur une police système qui l'a. */
:root { --disp: "Unbounded", system-ui, "Segoe UI", sans-serif; --body: "Lexend Deca", system-ui, "Segoe UI", sans-serif; }
/* Affiche de l'intro : titre blanc en haut, Léo à droite dans l'aplat cyan, accroche à gauche */
.poster { height: 330px; }
.logo { font-size: 54px; }
.logo .l1, .logo .l2 { z-index: 3; color: var(--text); }
.logo .l1 { left: 0; top: 4px; }
.logo .l2 { left: 0; top: 52px; bottom: auto; }
.logo .ast { color: var(--cyan); }
.poster-block { height: 60%; }
.poster-block .leo-cut { right: -18px; height: 150%; }
.poster-tag { position: absolute; left: 18px; bottom: 18px; z-index: 3; margin: 0; max-width: 46%; font: 800 15px/1.18 var(--disp); letter-spacing: -.02em; color: var(--ink); }
/* Cartes-paquets : coupure de mots propre */
.pk-t { font-size: 14px; overflow-wrap: normal; hyphens: auto; -webkit-hyphens: auto; }
/* +10 : à gauche du score, sans masquer la série */
.hud-score .fly { right: 100%; top: 50%; }
.fly-pts { right: 8px; top: -22px; }
.fly-pts.frozen { transform: none; }
/* Score mobile : chiffre au-dessus de Léo */
.big-score { font-size: 100px; }
.score-leo { height: 215px; right: -26px; }
.score-poster { min-height: 380px; }
/* Je te défie */
.defi-title { font-size: 60px; letter-spacing: -.035em; word-spacing: .08em; line-height: .9; }
/* Palmarès mobile : titres sur deux lignes, record plus compact */
.w-t { white-space: normal; }
.w-best { font-size: 22px; }
@media (min-width: 1024px) {
  .poster { min-height: 660px; }
  .logo { font-size: 128px; }
  .logo .l2 { top: 112px; }
  .poster-block { height: 64%; }
  .poster-block .leo-cut { right: 0; height: 132%; }
  .poster-tag { left: 36px; bottom: 36px; font-size: 30px; max-width: 42%; }
  .big-score { font-size: 230px; }
  .score-leo { height: 470px; right: -20px; }
  .score-poster { min-height: 640px; }
  .defi-title { font-size: 132px; }
  .w-t { white-space: nowrap; }
  .w-best { font-size: 38px; }
}
@media (max-width: 599px) { .packs .topbar-title { font-size: 16px; } }
@media (max-width: 380px) { .packs .topbar-title { display: none; } .packs .topbar-actions { margin-left: auto; } }

/* ---------- Passe 3 (images définitives de Léo) ---------- */
/* Défi : le titre reste entier, Léo passe dessous sans l'avaler */
.defi-title { z-index: 3; line-height: 1; }
.defi-leo { width: min(270px, 70vw); margin: -6px -16px 0 0; }
.defi-copy { margin-top: -54px; }
/* Duel : visage + main au-dessus du buzzer */
.duel-leo-block { height: 200px; }
.duel-leo-block > img { object-position: 50% 30%; }
/* Score bureau : Léo sous le chiffre géant */
@media (min-width: 1024px) {
  .defi-title { font-size: 128px; line-height: .98; }
  .defi-leo { width: 540px; margin: 0; }
  .defi-copy { margin-top: 30px; }
  .duel-leo-block > img { object-position: 50% 46%; }
  .score-leo { height: 360px; right: -10px; }
}
.defi-title { word-spacing: .2em; }
.duel-leo-block > img { object-position: 50% 22%; }
.duel-bubble { top: auto; bottom: 38px; }
@media (min-width: 1024px) {
  .duel-leo-block { height: 600px; }
  .duel-leo-block > img { object-position: 50% 55%; }
  .duel-bubble { bottom: 46px; }
}
/* Accroche de l'intro : jamais sous Léo */
.poster-tag { z-index: 4; max-width: 42%; }
@media (min-width: 1024px) { .br-m { display: none; } }
@media (max-width: 1023px) { .poster-tag { font-size: 13px; left: 14px; } }

/* ---------- Passe 4 (24/11 : retours de Ghislain) ---------- */
/* Chrono autour de la pilule de saisie (repris de Flow) ; le temps reste affiché en haut. */
.field .ring { position: absolute; inset: -10px; width: calc(100% + 20px); height: calc(100% + 20px); overflow: visible; pointer-events: none; z-index: 0; }
.ring path { fill: none; stroke-width: 5; stroke-linecap: round; }
.ring-track { stroke: rgba(246, 244, 248, .1); }
.ring-time { stroke: var(--cyan); stroke-dasharray: var(--p, 1) 2; filter: drop-shadow(0 0 6px rgba(42, 180, 245, .55)); transition: stroke .25s; }
body.final10 .ring-time { stroke: var(--bad); filter: drop-shadow(0 0 7px rgba(255, 90, 95, .7)); }
body.fx-correct .ring-time { stroke: var(--ok); }
.field input, .field .go { position: relative; z-index: 1; }
.answer { margin-top: 22px; padding: 0 2px; }
.hud-time { justify-content: center; }
@media (min-width: 1024px) { .hud-time { max-width: none; flex: 1; justify-content: center; } .hud-time .num { font-size: 40px; } }
body.hype .streak-chip, body.hype .streak-big { text-shadow: 0 0 22px rgba(245, 196, 81, .55); }

/* Réglages audio : interrupteurs dans le menu */
.menu .tg { margin-left: auto; width: 34px; height: 20px; border-radius: 20px; background: var(--s2); position: relative; flex: none; transition: background .2s; }
.menu .tg::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .2s var(--spring), background .2s; }
.menu [aria-pressed="true"] .tg { background: var(--cyan); }
.menu [aria-pressed="true"] .tg::after { transform: translateX(14px); background: var(--ink); }
.menu { min-width: 250px; }

/* Duel : vidéos de Léo au buzzer, superposées, une seule visible */
.leo-vids { position: absolute; inset: 0; z-index: -1; }
.leo-vids .lv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; opacity: 0; transition: opacity .18s linear; background: transparent; }
.leo-vids .lv.on { opacity: 1; }
@media (min-width: 1024px) { .leo-vids .lv { object-position: 50% 50%; } }
body[data-screen="duel"][data-state="passed-buzz"] .duel-leo-block { animation: blockPulse .6s ease-in-out infinite; }
/* Duel : passer */
.duel-under { justify-content: center; margin-top: 14px; }
@media (min-width: 1024px) { .duel-under { justify-content: flex-start; } }
.passed-msg { display: none; margin: 10px 0 0; text-align: center; font-weight: 700; color: var(--muted); }
body[data-screen="duel"][data-state="passed"] .passed-msg, body[data-screen="duel"][data-state="passed-buzz"] .passed-msg { display: block; }
body[data-screen="duel"][data-state="passed"] .field, body[data-screen="duel"][data-state="passed-buzz"] .field, body[data-screen="duel"][data-state="bothpass"] .field { opacity: .45; }
.duel-reveal { display: none; margin: 14px 0 0; padding: 14px 20px; border-radius: 22px; background: var(--text); color: var(--ink); animation: qIn .4s var(--ease); }
.duel-reveal .rv-k { display: block; margin-bottom: 4px; }
.duel-reveal b { font: 900 clamp(28px, 8vw, 54px)/1 var(--disp); letter-spacing: -.04em; overflow-wrap: anywhere; }
body[data-screen="duel"][data-state="bothpass"] .duel-reveal { display: block; }
body[data-screen="duel"][data-state="bothpass"] .duel-under, body[data-screen="duel"][data-state="passed"] .duel-under, body[data-screen="duel"][data-state="passed-buzz"] .duel-under { visibility: hidden; }

/* Carte « Défi Léo » non choisie : texte lisible sur la surface sombre ; choisie : encre sur corail */
.format.defi:not(.locked):not([aria-pressed="true"]) { box-shadow: inset 0 0 0 2px rgba(255, 90, 78, .55); }
.format.defi:not(.locked):not([aria-pressed="true"]) .f-name { color: var(--text); }
.format.defi:not(.locked):not([aria-pressed="true"]) .f-desc { color: var(--muted); }
.format.defi:not(.locked):not([aria-pressed="true"]) .f-desc em { color: #FF9D94; }
.format.defi[aria-pressed="true"] .f-desc { color: var(--ink); }

/* Léo : images v2 à silhouette entière (Alya, 24/11), plus de fondu sur les bords.
   Les humeurs n'ont plus toutes la même largeur (851 à 1 385 px pour 1 150 de haut) :
   on dimensionne par la hauteur pour que Léo garde la même taille d'une humeur à l'autre. */
.help-leo { width: auto; height: 190px; }
@media (min-width: 1024px) { .help-leo { width: auto; height: 420px; } }
/* Accueil : Léo entier est plus large (bras gauche complet) et descend jusqu'au bas de l'aplat sur
   presque toute sa largeur. L'accroche monte donc en haut à gauche de l'aplat, à hauteur de la poitrine,
   où la silhouette ne commence qu'à 14 % de sa largeur. Si l'aplat est trop étroit pour loger les deux,
   accroche et Léo rétrécissent ensemble : --s vaut la hauteur de l'aplat, ou moins si la largeur manque
   (règles mesurées sur la silhouette de leo-accueil : écart accroche/Léo de 10 à 40 px de 360 à 1 920 px). */
.poster-block { container-type: size; --s: min(100cqh, (100cqw - 10px) / 1.94); }
.poster-tag { top: calc(var(--s) * .07); left: calc(var(--s) * .07); bottom: auto; font-size: calc(var(--s) * .0657); max-width: none; }
.poster-block .leo-cut { right: 0; height: calc(var(--s) * 1.5); border-radius: 0; }
@media (min-width: 1024px) {
  .poster-block { --s: min(100cqh, max(28cqw + 42cqh, (100cqw - 16px) / 1.84)); }
  .poster-tag { top: calc(var(--s) * .08); left: calc(var(--s) * .085); font-size: calc(var(--s) * .0709); }
  .poster-tag .br-m { display: inline; }
  .poster-block .leo-cut { right: 0; height: calc(var(--s) * 1.32); }
}
/* Accueil, bureau : Léo respire doucement (en attendant la boucle vidéo d'Alya) */
@media (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
  .poster-block .leo-cut, .poster-block .leo-cut.leo-swap { transform-origin: 55% 100%; animation: leoIdle 5.2s ease-in-out infinite; }
  @keyframes leoIdle { 0%, 100% { transform: translateY(0) rotate(0) scale(1); } 35% { transform: translateY(-4px) rotate(-.45deg) scale(1.006); } 70% { transform: translateY(-1px) rotate(.25deg) scale(1.002); } }
}
body.shot .poster-block .leo-cut { animation: none; }
/* Accueil, bureau : boucle vidéo de Léo au repos (Alya, VP9 avec alpha, même cadre que leo-accueil).
   Chargée seulement sur bureau, hors Safari (pas d'alpha VP9) et hors mouvement réduit ; l'image fixe
   reste dessous et reprend la main dès que Léo change d'humeur ou si la vidéo ne démarre pas. */
.leo-idle { display: none; }
@media (min-width: 1024px) {
  .poster-block.idle-ok .leo-cut { animation: none; }
  .poster-block.idle-on .leo-idle { display: block; position: absolute; right: 0; bottom: 0; z-index: 2; height: calc(var(--s) * 1.32); width: auto; aspect-ratio: 1177 / 1150; object-fit: contain; object-position: 100% 100%; background: transparent; pointer-events: none; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .35)); }
  .poster-block.idle-on .leo-cut { visibility: hidden; }
}

/* ---------- Passe 5 (24/11 : retours de Ghislain) ---------- */
/* Historique : une réponse longue (« Saint-Vincent-et-les-Grenadines ») élargissait la ligne jusqu'à sa
   largeur min-content, et le temps passait sous la carte question. La piste de grille et la ligne
   peuvent désormais rétrécir : la réponse s'abrège, le temps reste visible. */
.history { grid-template-columns: minmax(0, 1fr); }
.h { min-width: 0; }
/* Page des paquets, bureau : l'image de Léo (190 px) dépassait de 20 px au-dessus de son cadre (170 px) et
   passait sous la barre du haut, collante et opaque : le haut de la tête était rogné. Le cadre prend
   désormais toute la hauteur de l'image, qui commence 8 px sous la barre. */
@media (min-width: 1024px) { .side-leo { height: 190px; } }
/* Duel : la vidéo entrante passe au-dessus (fondu), la sortante reste opaque dessous ; fond noir dès
   qu'une vidéo joue, l'image fixe de Léo ne se voit que si les vidéos ne s'affichent pas. */
.leo-vids.live { background: #000; }
.leo-vids .lv.top { z-index: 1; }
