/* Zinzomètre : feuille de style unique. Mobile d'abord, animations partout,
   tout est coupé proprement sous prefers-reduced-motion. */
:root {
  --bg: #150a26;
  --bg2: #221039;
  --ink: #fff7ec;
  --muted: #c3b3e3;
  --dim: #b3a3d9;
  --line: rgba(255, 255, 255, 0.12);
  --card: rgba(255, 255, 255, 0.055);
  --lime: #c6ff3d;
  --lime-d: #7fae12;
  --pink: #ff3d7f;
  --pink-d: #b81d53;
  --cyan: #29b8ff;
  --cyan-d: #1370a8;
  --yellow: #ffe14d;
  --accent: #c6ff3d;
  --radius: 22px;
  --f-display: "Bricolage Grotesque", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --f-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Arabic", "Noto Sans Devanagari", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 700 16px/1.45 var(--f-body);
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 10px; }

/* ---------- Fond animé ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: radial-gradient(120% 80% at 50% 0%, var(--bg2), var(--bg) 70%); }
.blob { position: absolute; width: 75vmax; height: 75vmax; border-radius: 50%; opacity: .36; transition: background 1.2s ease; will-change: transform; }
.b1 { background: radial-gradient(closest-side, var(--pink) 25%, transparent); top: -30vmax; inset-inline-start: -20vmax; animation: drift1 18s ease-in-out infinite alternate; }
.b2 { background: radial-gradient(closest-side, var(--cyan) 25%, transparent); bottom: -36vmax; inset-inline-end: -20vmax; animation: drift2 22s ease-in-out infinite alternate; }
.b3 { background: var(--accent); -webkit-mask-image: radial-gradient(closest-side, #000 25%, transparent); mask-image: radial-gradient(closest-side, #000 25%, transparent); top: 30%; inset-inline-start: 25%; width: 50vmax; height: 50vmax; opacity: .18; animation: drift3 16s ease-in-out infinite alternate; }
.grain { position: absolute; inset: 0; opacity: .07; background-image: radial-gradient(rgba(255,255,255,.7) 1px, transparent 1px); background-size: 3px 3px; }
@keyframes drift1 { to { transform: translate(18vw, 14vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-16vw, -12vh) scale(1.1); } }
@keyframes drift3 { to { transform: translate(-12vw, 10vh) scale(.85); } }

/* ---------- Écrans ---------- */
#app { max-width: 1040px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left)); }
.screen { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
.screen.enter { animation: screenIn .5s cubic-bezier(.2, .9, .3, 1.15) both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(26px) scale(.98); } }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: max(14px, env(safe-area-inset-top)); min-height: 58px; }
.home .topbar { justify-content: flex-end; }

.icon-btn { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; transition: transform .15s; }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 22px; height: 22px; }
.txt-btn { background: none; border: 0; color: var(--muted); font-weight: 800; padding: 10px 6px; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: rgba(255,255,255,.2); }
.txt-btn:hover { color: var(--ink); }

/* ---------- Boutons ---------- */
.btn {
  --b: var(--lime); --bd: var(--lime-d); --t: #1a0b2e;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 12px 28px; border: 0; border-radius: 18px;
  background: var(--b); color: var(--t); font: 800 1.08rem/1.15 var(--f-display); letter-spacing: .01em;
  box-shadow: 0 6px 0 var(--bd), 0 14px 30px rgba(0,0,0,.35);
  transition: transform .12s ease, box-shadow .12s ease, filter .2s;
  text-align: center;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-2px); box-shadow: 0 8px 0 var(--bd), 0 18px 34px rgba(0,0,0,.38); }
.btn:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--bd), 0 6px 14px rgba(0,0,0,.3); }
.btn[disabled] { filter: grayscale(.6) brightness(.8); pointer-events: none; }
.btn-alt { --b: #2d1a4d; --bd: #150a26; --t: var(--ink); border: 2px solid rgba(255,255,255,.14); }
.btn-xl { min-height: 68px; font-size: 1.35rem; padding: 14px 40px; border-radius: 22px; }
.btn-sm { min-height: 50px; padding: 10px 20px; font-size: 1rem; }
.btn-xl.pulse { animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }

/* ---------- Accueil ---------- */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 6px 0 24px; }
.mini-gauge { width: min(210px, 52vw); height: auto; margin-bottom: 4px; filter: drop-shadow(0 10px 30px rgba(0,0,0,.4)); }
.mini-needle { transform-origin: 100px 100px; animation: swing 3.4s cubic-bezier(.5, 0, .5, 1) infinite; }
@keyframes swing {
  0% { transform: rotate(-70deg); } 22% { transform: rotate(55deg); } 30% { transform: rotate(40deg); }
  38% { transform: rotate(62deg); } 60% { transform: rotate(-30deg); } 70% { transform: rotate(-12deg); }
  80% { transform: rotate(-78deg); } 100% { transform: rotate(-70deg); }
}
.logo {
  margin: 4px 0 6px; font: 800 clamp(2.6rem, 11vw, 5.4rem)/1 var(--f-display); letter-spacing: -.02em;
  background: linear-gradient(95deg, var(--yellow), var(--lime) 35%, var(--cyan) 70%, var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 0 rgba(0,0,0,.35));
  white-space: nowrap; max-width: 100%;
}
.logo .ch { display: inline-block; animation: wave 2.8s ease-in-out infinite; animation-delay: calc(var(--i) * 70ms); background: inherit; -webkit-background-clip: text; background-clip: text; }
.logo.whole { animation: wobble 3s ease-in-out infinite; }
@keyframes wave { 0%, 60%, 100% { transform: translateY(0) rotate(0); } 20% { transform: translateY(-12px) rotate(-4deg); } 40% { transform: translateY(2px) rotate(2deg); } }
@keyframes wobble { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg) scale(1.03); } }
.age { display: inline-block; margin: 2px 0 4px; padding: 3px 12px 5px; border-radius: 99px; border: 2px solid var(--pink); color: var(--pink); font: 800 .9rem/1 var(--f-display); letter-spacing: .04em; transform: rotate(-3deg); }
.tagline { margin: 6px 0 4px; font: 800 clamp(1.1rem, 4.2vw, 1.45rem)/1.25 var(--f-display); max-width: 30ch; }
.intro { margin: 4px 0 22px; color: var(--muted); max-width: 44ch; }
.games-count { display: inline-flex; align-items: center; gap: 8px; margin: 18px 0 0; color: var(--muted); font-weight: 800; font-size: .95rem; min-height: 1.4em; font-variant-numeric: tabular-nums; }
.games-count .live { width: 9px; height: 9px; border-radius: 50%; background: #3dff9a; box-shadow: 0 0 0 0 rgba(61,255,154,.6); animation: live 1.8s ease-out infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 9px rgba(61,255,154,0); } 100% { box-shadow: 0 0 0 0 rgba(61,255,154,0); } }

.cats-block { text-align: center; padding: 8px 0 18px; }
.h-small { margin: 0 0 6px; font: 800 1.15rem/1.2 var(--f-display); }
.hint { margin: 0 0 12px; color: var(--muted); font-size: .92rem; font-weight: 700; }
.hint.center { text-align: center; }
.hint.warn { color: var(--yellow); }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.chip {
  --c: var(--lime);
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px 9px 11px; border-radius: 999px;
  border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 18%, transparent); color: var(--ink); font-weight: 800; font-size: .95rem;
  transition: transform .15s, opacity .2s, background .2s;
}
.chip svg { width: 19px; height: 19px; color: var(--c); flex: none; }
.chip:active { transform: scale(.93); }
.chip.off { opacity: .6; background: transparent; border-style: dashed; text-decoration: line-through; text-decoration-thickness: 2px; }
.chip.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.12) rotate(-3deg); } }
#btn-lb { align-self: center; margin: 4px 0 26px; }
.foot { margin-top: auto; padding: 18px 0 26px; text-align: center; border-top: 1px solid var(--line); }
.lang-pick { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 800; }
.lang-pick select { background: #2a1646; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; font-weight: 800; }
.disclaimer { color: var(--dim); font-size: .82rem; font-weight: 700; max-width: 60ch; margin: 14px auto 0; text-align: center; }

/* ---------- Partie ---------- */
.game-top { display: flex; align-items: center; gap: 12px; padding-top: max(12px, env(safe-area-inset-top)); min-height: 60px; }
.progress { flex: 1; height: 12px; border-radius: 99px; background: rgba(255,255,255,.1); overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--lime), var(--accent)); transition: width .5s cubic-bezier(.3, 1.4, .5, 1), background .6s; }
.prog-num { font: 800 .95rem/1 var(--f-display); color: var(--muted); min-width: 3.4em; text-align: center; font-variant-numeric: tabular-nums; }
.ch-banner { align-self: center; margin: 2px 0 0; padding: 5px 14px; border-radius: 99px; background: rgba(255,225,77,.14); color: var(--yellow); font-weight: 800; font-size: .88rem; }
.q-head { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 0 14px; text-align: center; }
.cat-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px 6px 10px; border-radius: 99px; background: var(--accent); color: #1a0b2e; font: 800 .9rem/1.1 var(--f-display); text-transform: uppercase; letter-spacing: .06em; }
.cat-pill svg { width: 18px; height: 18px; }
.wyr { margin: 0; font: 800 clamp(1.7rem, 6.5vw, 2.6rem)/1.05 var(--f-display); letter-spacing: -.01em; text-shadow: 0 4px 0 rgba(0,0,0,.3); }
.q-head.q-in .cat-pill { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1) both; }
.q-head.q-in .wyr { animation: pop .5s .05s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes pop { from { opacity: 0; transform: scale(.6) rotate(-4deg); } }

.duel { position: relative; flex: 1; display: flex; flex-direction: column; gap: 16px; min-height: 340px; max-height: 620px; }
.opt {
  --o: var(--pink); --od: var(--pink-d);
  position: relative; flex: 1; min-height: 140px; overflow: hidden; isolation: isolate;
  display: flex; align-items: center; justify-content: center; padding: 22px 22px;
  border: 0; border-radius: 26px; color: #fff; text-align: center;
  background: radial-gradient(130% 120% at 20% 10%, color-mix(in srgb, var(--o) 92%, #fff 8%), var(--o) 55%, color-mix(in srgb, var(--o) 70%, #000 30%));
  background-color: var(--o);
  box-shadow: 0 8px 0 var(--od), 0 20px 40px rgba(0,0,0,.35);
  transition: transform .2s cubic-bezier(.2, 1.4, .4, 1), box-shadow .2s, opacity .3s, filter .3s;
}
.opt-b { --o: var(--cyan); --od: var(--cyan-d); color: #1a0b2e; }
.opt-b .opt-text { text-shadow: 0 1px 0 rgba(255,255,255,.25); }
.opt-text { position: relative; z-index: 2; font: 800 clamp(1.25rem, 5.2vw, 1.85rem)/1.18 var(--f-display); text-wrap: balance; text-shadow: 0 2px 0 rgba(0,0,0,.18); max-width: 22ch; }
.opt-fill { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; z-index: 1; background: rgba(255,255,255,.2); transition: width 1s cubic-bezier(.2, .9, .3, 1); }
.opt-pct { position: absolute; z-index: 2; inset-inline-end: 16px; bottom: 10px; font: 800 1.9rem/1 var(--f-display); opacity: 0; transform: translateY(8px); transition: opacity .3s, transform .3s; font-variant-numeric: tabular-nums; }
.opt-key { position: absolute; z-index: 2; inset-inline-start: 14px; top: 12px; width: 26px; height: 26px; border-radius: 8px; display: none; place-items: center; font: 800 .85rem/1 var(--f-display); background: rgba(0,0,0,.18); }
@media (hover: hover) and (pointer: fine) {
  .opt-key { display: grid; }
  .opt:not([disabled]):hover { transform: translateY(-4px) rotate(-.6deg); box-shadow: 0 12px 0 var(--od), 0 26px 44px rgba(0,0,0,.4); }
  .opt-b:not([disabled]):hover { transform: translateY(-4px) rotate(.6deg); }
}
.opt:not([disabled]):active { transform: translateY(6px) scale(.985); box-shadow: 0 2px 0 var(--od), 0 8px 18px rgba(0,0,0,.3); }
.opt[disabled] { cursor: default; }
.duel.revealed .opt-pct { opacity: 1; transform: none; }
.duel.revealed .opt.other { opacity: .62; filter: saturate(.7); transform: scale(.97); }
.duel.revealed .opt.chosen { transform: scale(1.02); box-shadow: 0 8px 0 var(--od), 0 0 0 4px #fff, 0 22px 48px rgba(0,0,0,.45); }
.opt.chosen::after { content: ""; position: absolute; z-index: 3; top: 12px; inset-inline-end: 14px; width: 30px; height: 30px; border-radius: 50%; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%231a0b2e' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/70% no-repeat; animation: pop .35s cubic-bezier(.2, 1.8, .4, 1) both; }

.or-badge {
  position: absolute; z-index: 5; left: 50%; top: 50%; width: 66px; height: 66px; margin: -33px 0 0 -33px;
  display: grid; place-items: center; border-radius: 50%; background: var(--yellow); color: #1a0b2e;
  font: 800 1.2rem/1 var(--f-display); box-shadow: 0 5px 0 #b89a10, 0 10px 24px rgba(0,0,0,.4); transform: rotate(-8deg);
  pointer-events: none;
}
.or-badge span { max-width: 58px; overflow: hidden; text-align: center; }
.duel.q-in .or-badge { animation: orPop .55s .12s cubic-bezier(.2, 1.8, .4, 1) both; }
@keyframes orPop { from { transform: scale(0) rotate(-120deg); } }
.duel.q-in .opt-a { animation: inA .5s cubic-bezier(.2, 1.2, .35, 1) both; }
.duel.q-in .opt-b { animation: inB .5s .06s cubic-bezier(.2, 1.2, .35, 1) both; }
@keyframes inA { from { opacity: 0; transform: translateY(-40px) rotate(-3deg) scale(.9); } }
@keyframes inB { from { opacity: 0; transform: translateY(40px) rotate(3deg) scale(.9); } }
.duel.q-out .opt { animation: outDown .32s ease-in both; }
.duel.q-out .opt.chosen { animation: outUp .36s ease-in both; }
.duel.q-out .or-badge { animation: orOut .25s ease-in both; }
@keyframes outDown { to { opacity: 0; transform: translateY(30px) scale(.9); } }
@keyframes outUp { to { opacity: 0; transform: translateY(-50px) scale(1.06) rotate(-2deg); } }
@keyframes orOut { to { transform: scale(0) rotate(90deg); } }

.reaction { min-height: 3.2em; margin: 14px 0 4px; text-align: center; font: 800 1.12rem/1.3 var(--f-display); color: var(--yellow); }
.reaction.show { animation: pop .4s cubic-bezier(.2, 1.6, .4, 1) both; }
.reaction small { display: block; font: 700 .85rem/1.4 var(--f-body); color: var(--dim); margin-top: 4px; }
.keys-hint { display: none; text-align: center; color: var(--dim); font-size: .85rem; margin: 0 0 18px; }
@media (hover: hover) and (pointer: fine) { .keys-hint { display: block; } }

@media (min-width: 760px) {
  .duel { flex-direction: row; gap: 26px; max-height: 440px; min-height: 360px; }
  .opt { padding: 30px; }
  .opt-text { font-size: clamp(1.4rem, 2.6vw, 2rem); }
  .or-badge { width: 76px; height: 76px; margin: -38px 0 0 -38px; font-size: 1.35rem; }
  @keyframes inA { from { opacity: 0; transform: translateX(-60px) rotate(-4deg) scale(.9); } }
  @keyframes inB { from { opacity: 0; transform: translateX(60px) rotate(4deg) scale(.9); } }
}
@media (max-height: 620px) {
  .game-top { min-height: 52px; }
  .q-head { padding: 4px 0 8px; gap: 6px; }
  .wyr { font-size: 1.45rem; }
  .duel { min-height: 0; }
  .opt { min-height: 96px; padding: 14px 18px; }
  .reaction { min-height: 2.9em; margin-top: 8px; }
}
@media (orientation: landscape) and (max-height: 500px) {
  .q-head { flex-direction: row; justify-content: center; flex-wrap: wrap; column-gap: 12px; }
  .wyr { font-size: 1.25rem; }
  .duel { flex-direction: row; gap: 18px; }
  .opt-text { font-size: clamp(1.05rem, 2.4vw, 1.4rem); }
}

/* ---------- Résultat ---------- */
.result { align-items: center; text-align: center; padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
.result > * { width: 100%; max-width: 580px; }
.kicker { margin: 4px 0 0; color: var(--muted); font: 800 .95rem/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .12em; }
.gauge-wrap { margin: 6px auto 0; max-width: 380px; }
.gauge-wrap.shake { animation: shake .5s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px) rotate(-1deg); } 40%, 60% { transform: translateX(7px) rotate(1deg); } }
.gauge { width: 100%; height: auto; direction: ltr; overflow: visible; filter: drop-shadow(0 12px 30px rgba(0,0,0,.45)); }
.gauge .tick { stroke: rgba(21,10,38,.55); stroke-width: 2; }
.gauge .g-end { fill: var(--muted); font: 800 11px var(--f-display); text-transform: uppercase; letter-spacing: .08em; }
.score-line { display: flex; flex-direction: column; align-items: center; margin-top: -6px; }
.score-num { font: 800 clamp(4.2rem, 19vw, 6.4rem)/.95 var(--f-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; text-shadow: 0 6px 0 rgba(0,0,0,.35); }
.score-lbl { color: var(--muted); font: 800 1.05rem/1.2 var(--f-display); }
.level-title { margin: 18px auto 4px; font: 800 clamp(1.7rem, 7vw, 2.4rem)/1.05 var(--f-display); color: var(--accent); text-shadow: 0 4px 0 rgba(0,0,0,.35); max-width: 20ch; }
.level-title.stamp { animation: stamp .6s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes stamp { 0% { opacity: 0; transform: scale(2.6) rotate(-14deg); } 60% { opacity: 1; transform: scale(.92) rotate(-2deg); } 100% { transform: scale(1) rotate(-2deg); } }
.level-desc { margin: 8px auto 6px; color: var(--ink); font-weight: 700; max-width: 42ch; }
.percentile { margin: 10px auto 18px; display: inline-block; width: auto; padding: 7px 16px; border-radius: 99px; background: rgba(255,255,255,.08); color: var(--yellow); font-weight: 800; }
.percentile:empty { display: none; }
.fade-up { animation: fadeUp .5s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } }
.actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 6px 0 12px; }
.actions .btn { flex: 1 1 220px; }

.card { margin: 14px 0; padding: 20px 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-align: start; }
.card .h-small { text-align: center; margin-bottom: 14px; }
.hl-cards { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 14px 0 0; }
@media (min-width: 560px) { .hl-cards { grid-template-columns: 1fr 1fr; } }
.hl { margin: 0; text-align: center; border-color: color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); }
.hl .hl-kicker { font: 800 .8rem/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.hl .hl-cat { display: inline-flex; align-items: center; gap: 8px; margin: 8px 0 2px; font: 800 1.3rem/1.1 var(--f-display); color: var(--c); }
.hl .hl-cat svg { width: 24px; height: 24px; }
.hl .hl-pct { font: 800 2rem/1 var(--f-display); margin: 4px 0 6px; }
.hl .hl-line { margin: 0; font-weight: 700; color: var(--ink); }

.bars { display: grid; gap: 12px; }
.bar-row { display: grid; grid-template-columns: 26px minmax(0, 7.5em) 1fr 3.4em; align-items: center; gap: 10px; }
.bar-row svg { width: 22px; height: 22px; color: var(--c); }
.bar-name { font-weight: 800; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 14px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--c); transition: width 1.1s cubic-bezier(.2, .9, .3, 1); }
.bar-pct { text-align: end; font: 800 .95rem/1 var(--f-display); font-variant-numeric: tabular-nums; }
@media (max-width: 480px) {
  .bar-row { grid-template-columns: 22px minmax(0, 1fr) auto; row-gap: 6px; }
  .bar-track { grid-column: 1 / -1; order: 3; }
}

.facts .fact { padding: 12px 0; border-top: 1px solid var(--line); }
.facts .fact:first-of-type { border-top: 0; padding-top: 0; }
.fact-k { color: var(--muted); font: 800 .8rem/1.2 var(--f-display); text-transform: uppercase; letter-spacing: .08em; }
.fact-v { font: 800 1.12rem/1.3 var(--f-display); margin-top: 4px; }
.fact-s { color: var(--muted); font-size: .9rem; margin-top: 2px; }

.compare { text-align: center; border-color: rgba(255,225,77,.4); background: rgba(255,225,77,.07); }
.cmp-duo { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 6px 0 14px; }
.cmp-side .cmp-n { font-weight: 800; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-side .cmp-s { font: 800 2.1rem/1 var(--f-display); }
.cmp-vs { font: 800 1rem/1 var(--f-display); color: var(--yellow); }
.cmp-compat { font: 800 3rem/1 var(--f-display); color: var(--yellow); }
.cmp-line { font-weight: 800; margin: 6px 0 14px; }
.cmp-diff { text-align: start; display: grid; gap: 10px; margin-top: 8px; }
.cmp-d { padding: 12px 14px; border-radius: 16px; background: rgba(0,0,0,.2); }
.cmp-d .who { display: flex; gap: 8px; align-items: baseline; margin: 3px 0; }
.cmp-d .tag { flex: none; font: 800 .72rem/1.3 var(--f-display); text-transform: uppercase; letter-spacing: .06em; padding: 2px 8px; border-radius: 99px; background: var(--pink); color: #1a0b2e; max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-d .tag.them { background: var(--cyan); color: #06243a; }

.publish { text-align: center; }
.pub-form { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.pub-form input { flex: 1 1 180px; max-width: 280px; min-height: 50px; padding: 10px 16px; border-radius: 16px; border: 2px solid var(--line); background: rgba(0,0,0,.25); font-weight: 800; }
.pub-form input:focus { border-color: var(--lime); outline: none; }
.pub-msg { min-height: 1.4em; margin: 10px 0 0; font-weight: 800; color: var(--yellow); }
.pub-msg.ok { color: var(--lime); }

/* ---------- Superpositions ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; overscroll-behavior: contain; display: grid; place-items: center; padding: 16px; background: rgba(10, 4, 20, .72); backdrop-filter: blur(6px); animation: fadeIn .25s ease both; }
@keyframes fadeIn { from { opacity: 0; } }
.panel { position: relative; overscroll-behavior: contain; width: 100%; max-width: 520px; max-height: min(88dvh, 760px); overflow: auto; padding: 26px 20px 22px; border-radius: 26px; background: #22113b; border: 1px solid var(--line); box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: panelIn .4s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes panelIn { from { opacity: 0; transform: translateY(30px) scale(.95); } }
.panel-close { position: absolute; top: 10px; inset-inline-end: 12px; }
.panel-title { margin: 0 0 16px; padding-inline-end: 70px; font: 800 1.6rem/1.1 var(--f-display); }
.tabs { display: flex; gap: 6px; padding: 5px; border-radius: 16px; background: rgba(0,0,0,.25); margin-bottom: 14px; }
.tab { flex: 1; min-width: 0; overflow-wrap: anywhere; hyphens: auto; line-height: 1.2; padding: 10px 6px; border: 0; border-radius: 12px; background: none; font-weight: 800; font-size: .92rem; color: var(--muted); }
.tab.on { background: var(--lime); color: #1a0b2e; }
.lb-list { list-style: none; margin: 0; padding: 0; display: grid; align-content: start; gap: 6px; min-height: 120px; }
.lb-row { display: grid; grid-template-columns: 2.6em 1fr auto auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.04); animation: fadeUp .35s both; animation-delay: calc(var(--i, 0) * 25ms); }
.lb-row.me { background: rgba(198,255,61,.16); outline: 2px solid var(--lime); }
.lb-rank { font: 800 1rem/1 var(--f-display); color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-row:nth-child(1) .lb-rank { color: #ffd23f; } .lb-row:nth-child(2) .lb-rank { color: #d9d9e6; } .lb-row:nth-child(3) .lb-rank { color: #e0a070; }
.lb-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-name small { color: var(--dim); font-weight: 700; margin-inline-start: 6px; }
.lb-cc { font: 800 .72rem/1 var(--f-display); padding: 4px 6px; border-radius: 6px; background: rgba(255,255,255,.1); color: var(--muted); }
.lb-s { font: 800 1.05rem/1 var(--f-display); font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: end; }
.lb-bar { grid-column: 2 / -1; height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.lb-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #ff3d6e, #ffd23f, #3dff9a); background-size: 300px 100%; }
.lb-empty { color: var(--muted); text-align: center; padding: 30px 10px; font-weight: 800; }
.lb-more { display: block; margin: 12px auto 0; }

.share-preview { display: block; width: 46%; max-width: 200px; margin: 0 auto 16px; border-radius: 14px; box-shadow: 0 16px 40px rgba(0,0,0,.5); }
.share-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 10px; }
.share-btn span { min-width: 0; overflow-wrap: anywhere; hyphens: auto; }
.share-btn { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.06); font-weight: 800; text-decoration: none; color: var(--ink); transition: transform .12s, background .2s; }
.share-btn:hover { background: rgba(255,255,255,.12); transform: translateY(-2px); }
.share-btn svg { width: 22px; height: 22px; flex: none; }

.challenge { text-align: center; }
.challenge .panel-title { padding: 0; font-size: 1.9rem; }
.ch-score { font: 800 1.25rem/1.3 var(--f-display); color: var(--yellow); margin: 0 0 8px; }
.challenge .btn { width: 100%; margin-top: 12px; }

.toast { position: fixed; z-index: 80; left: 50%; bottom: max(22px, env(safe-area-inset-bottom)); transform: translate(-50%, 120px); padding: 12px 20px; border-radius: 16px; background: var(--ink); color: #1a0b2e; font-weight: 800; box-shadow: 0 16px 40px rgba(0,0,0,.45); transition: transform .35s cubic-bezier(.2, 1.4, .4, 1); max-width: calc(100vw - 32px); text-align: center; }
.toast.show { transform: translate(-50%, 0); }
#confetti { position: fixed; inset: 0; z-index: 60; pointer-events: none; width: 100%; height: 100%; }

.boot { position: fixed; inset: 0; display: none; place-items: center; }
.booting .boot { display: grid; grid-auto-flow: column; gap: 10px; place-content: center; }
.boot span { width: 16px; height: 16px; border-radius: 50%; background: var(--lime); animation: bounce 1s ease-in-out infinite; }
.boot span:nth-child(2) { background: var(--pink); animation-delay: .12s; } .boot span:nth-child(3) { background: var(--cyan); animation-delay: .24s; }
@keyframes bounce { 50% { transform: translateY(-16px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .blob { animation: none; }
}

/* ---------- Partage, accessibilité, replis ---------- */
.share-box { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 6px 0 12px; }
.share-box .actions { margin: 0; width: 100%; }
.share-name { width: 100%; max-width: 320px; min-height: 48px; padding: 10px 16px; border-radius: 16px; border: 2px solid var(--line); background: rgba(0,0,0,.25); font-weight: 800; text-align: center; }
.share-name:focus { border-color: var(--lime); outline: none; }
.share-more { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
.share-box .hint { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[tabindex="-1"]:focus { outline: none; }
@supports not (color: color-mix(in srgb, red, blue)) {
  .chip { background: var(--card); }
  .hl { border-color: var(--c); background: var(--card); }
}
