/* Los Intercambios — un voyage de révision « par avion ».
   Encre de nuit, papier crème, timbres colorés. */
:root {
  --ink: #0d0f2b;
  --ink-2: #151941;
  --ink-3: #1f2459;
  --line: rgba(255, 255, 255, 0.1);
  --paper: #fff6e6;
  --paper-2: #f3e3c4;
  --paper-3: #e8d3ab;
  --pink: #191934;
  --pink-soft: rgba(25, 25, 52, 0.62);
  --text: #f7f3ea;
  --muted: rgba(247, 243, 234, 0.62);
  --rojo: #e8473a;
  --azul: #2f6bff;
  --amarillo: #f5b700;
  --verde: #12a36b;
  --ok: #16c47f;
  --ok-d: #0a8d58;
  --ko: #ef4444;
  --ko-d: #b42323;
  --orange: #ff7a00;
  --radius: 22px;
  --font: "Bricolage Grotesque", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-optical-sizing: auto;
  font-size: 17px;
  line-height: 1.45;
  color: var(--text);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
.sky {
  position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none;
  background: radial-gradient(120% 80% at 50% -10%, #23286b 0%, var(--ink) 60%);
}
.sky i {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.45;
  animation: drift 26s ease-in-out infinite alternate;
}
.sky i:nth-child(1) { width: 46vmax; height: 46vmax; left: -14vmax; top: -10vmax; background: #e8473a; opacity: 0.28; }
.sky i:nth-child(2) { width: 50vmax; height: 50vmax; right: -18vmax; bottom: -16vmax; background: #2f6bff; opacity: 0.32; animation-duration: 32s; }
.sky i:nth-child(3) { width: 26vmax; height: 26vmax; right: 6vmax; top: 18vmax; background: #f5b700; opacity: 0.12; animation-duration: 22s; }
@keyframes drift { to { transform: translate(6vmax, 4vmax) scale(1.12); } }
.sky::after {
  content: ""; position: absolute; inset: 0; opacity: 0.08;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
input { font: inherit; }
:focus-visible { outline: 3px solid var(--amarillo); outline-offset: 3px; border-radius: 8px; }
b, strong { font-weight: 750; }

.airmail { height: 8px; background: repeating-linear-gradient(135deg, var(--rojo) 0 14px, var(--paper) 14px 22px, var(--azul) 22px 36px, var(--paper) 36px 44px); }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
main#view { min-height: calc(100dvh - 8px); display: flex; flex-direction: column; }

/* ───────── barre du haut ───────── */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; letter-spacing: -0.02em; line-height: 1.1; }
.brand small { display: block; font-weight: 600; font-size: 12px; color: var(--muted); letter-spacing: 0.02em; }
.brand-stamp { width: 40px; height: 40px; display: grid; place-items: center; background: var(--rojo); border-radius: 6px; border: 4px dotted var(--ink); transform: rotate(-6deg); font-size: 18px; flex: none; }
.stats { display: flex; gap: 6px; align-items: center; }
.stat { white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; padding: 6px 11px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); font-weight: 750; font-size: 15px; font-variant-numeric: tabular-nums; }
.stat.flame { color: #ffb347; }
.iconbtn { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); transition: transform 0.15s var(--ease), background 0.2s; flex: none; }
.iconbtn:hover { background: rgba(255, 255, 255, 0.12); }
.iconbtn:active { transform: scale(0.92); }

/* ───────── boutons ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 15px 22px; border-radius: 16px;
  font-weight: 800; font-size: 18px; letter-spacing: -0.01em; background: var(--ink-3); border: 1px solid var(--line);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35); transition: transform 0.12s var(--ease), box-shadow 0.12s, background 0.2s, opacity 0.2s; user-select: none;
}
.btn:hover { background: #283071; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }
.btn:disabled { opacity: 0.38; pointer-events: none; }
.btn.primary { background: var(--amarillo); color: var(--pink); border-color: transparent; box-shadow: 0 5px 0 #a87e00, 0 14px 30px rgba(245, 183, 0, 0.22); }
.btn.primary:hover { background: #ffc420; }
.btn.primary:active { box-shadow: 0 1px 0 #a87e00; transform: translateY(4px); }
.btn.green { background: var(--ok); color: #fff; border-color: transparent; box-shadow: 0 5px 0 var(--ok-d); }
.btn.red { background: var(--ko); color: #fff; border-color: transparent; box-shadow: 0 5px 0 var(--ko-d); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { background: rgba(255, 255, 255, 0.06); }
.btn.block { width: 100%; }
.btn.lg { padding: 18px 24px; font-size: 20px; }

/* ───────── papier ───────── */
.paper { background: var(--paper); color: var(--pink); border-radius: var(--radius); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset, 0 24px 60px rgba(0, 0, 0, 0.35); position: relative; }

/* ───────── accueil ───────── */
.hero { padding: 20px; overflow: hidden; margin-top: 4px; }
.hero::before { content: ""; position: absolute; inset: 9px; border: 2px dashed rgba(25, 25, 52, 0.14); border-radius: 15px; pointer-events: none; }
.hero-top { display: flex; gap: 16px; align-items: center; justify-content: space-between; position: relative; }
.hero .kicker { font-size: 13px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--rojo); }
.hero h1 { margin: 2px 0 4px; font-size: clamp(30px, 8.6vw, 46px); line-height: 0.98; letter-spacing: -0.04em; }
.hero .when { font-weight: 650; color: var(--pink-soft); }
.count { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; position: relative; }
.count div { background: var(--pink); color: var(--paper); border-radius: 12px; padding: 7px 4px; text-align: center; }
.count b { display: block; font-size: 24px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.count span { font-size: 11px; font-weight: 700; opacity: 0.7; text-transform: uppercase; letter-spacing: 0.06em; }
.ring { width: 96px; height: 96px; position: relative; flex: none; }
.ring svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.ring .lbl { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1; }
.ring .lbl b { font-size: 24px; }
.ring .lbl span { font-size: 11px; font-weight: 800; color: var(--pink-soft); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 4px; }
.hero .btn { margin-top: 16px; position: relative; }
.hero .btn small { font-weight: 650; opacity: 0.75; font-size: 14px; }

.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.mode {
  text-align: left; padding: 14px; border-radius: 18px; background: rgba(21, 25, 65, 0.75); border: 1px solid var(--line); backdrop-filter: blur(8px);
  display: grid; gap: 2px; transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s; position: relative; overflow: hidden;
}
.mode:hover { transform: translateY(-3px); border-color: rgba(255, 255, 255, 0.24); }
.mode:active { transform: scale(0.97); }
.mode .ic { font-size: 26px; margin-bottom: 4px; }
.mode b { font-size: 17px; }
.mode small { color: var(--muted); font-weight: 600; font-size: 13.5px; }
.mode .badge { position: absolute; right: 10px; top: 10px; background: var(--rojo); color: #fff; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 999px; }

.section-h { display: flex; align-items: baseline; justify-content: space-between; margin: 30px 2px 6px; }
.section-h h2 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.section-h span { color: var(--muted); font-weight: 650; font-size: 14px; }

/* carte du voyage */
.map { position: relative; padding: 18px 0 40px; }
.map svg.route { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.stop { position: relative; display: flex; flex-direction: column; align-items: center; width: 150px; margin: 0 auto 26px; transform: translateX(var(--x, 0)); }
.stop .st {
  width: 84px; height: 84px; display: grid; place-items: center; font-size: 36px; border-radius: 10px; position: relative;
  background: var(--paper-2); border: 7px dotted var(--ink); transition: transform 0.25s var(--spring); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}
.stop .st .emo { filter: grayscale(0.6); opacity: 0.85; transition: filter 0.3s; }
.stop.done .st { background: var(--c); }
.stop.done .st .emo { filter: none; opacity: 1; }
.stop.done .st::after {
  content: "✓"; position: absolute; right: -14px; bottom: -12px; width: 30px; height: 30px; border-radius: 50%; background: var(--paper); color: var(--c);
  display: grid; place-items: center; font-size: 16px; font-weight: 900; border: 3px solid var(--c);
}
.stop.next .st { background: var(--paper); animation: bob 2.4s ease-in-out infinite; box-shadow: 0 0 0 6px rgba(245, 183, 0, 0.35), 0 16px 34px rgba(0, 0, 0, 0.4); }
.stop.next .st .emo { filter: none; opacity: 1; }
.stop:hover .st { transform: rotate(-5deg) scale(1.06); }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-6px) rotate(3deg); } }
.stop .nm { margin-top: 10px; text-align: center; line-height: 1.15; }
.stop .nm b { display: block; font-size: 16px; }
.stop .nm span { font-size: 13px; color: var(--muted); font-weight: 650; }
.stop .stars { font-size: 14px; letter-spacing: 1px; margin-top: 2px; }
.stop .new { position: absolute; top: -10px; left: -14px; background: var(--rojo); color: #fff; font-size: 11px; font-weight: 900; padding: 3px 7px; border-radius: 6px; transform: rotate(-10deg); letter-spacing: 0.04em; z-index: 1; }
.plane { position: absolute; left: 0; top: 0; font-size: 34px; pointer-events: none; z-index: 2; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.4)); offset-rotate: auto 45deg; }
.plane.idle { animation: hover 3s ease-in-out infinite; }
@keyframes hover { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }

.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 10px 0 34px; }

/* ───────── feuille du bas (module, quitter…) ───────── */
.scrim { position: fixed; inset: 0; background: rgba(5, 6, 20, 0.6); z-index: 30; animation: fade 0.25s ease both; backdrop-filter: blur(3px); }
.sheet {
  position: fixed; left: 50%; bottom: 0; width: min(560px, 100%); transform: translateX(-50%); z-index: 31; padding: 22px 18px calc(18px + var(--safe-b));
  border-radius: 26px 26px 0 0; animation: sheetUp 0.42s var(--ease) both;
}
@keyframes sheetUp { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.sheet.closing { animation: sheetDown 0.25s ease-in both; }
@keyframes sheetDown { to { transform: translate(-50%, 110%); } }
.sheet .grab { width: 44px; height: 5px; border-radius: 9px; background: rgba(25, 25, 52, 0.2); margin: -8px auto 14px; }
.modhead { display: flex; gap: 14px; align-items: center; }
.modhead .st { width: 66px; height: 66px; display: grid; place-items: center; font-size: 30px; border-radius: 8px; background: var(--c); border: 6px dotted var(--paper); flex: none; }
.modhead h3 { margin: 0; font-size: 24px; letter-spacing: -0.02em; line-height: 1.1; }
.modhead p { margin: 2px 0 0; color: var(--pink-soft); font-weight: 600; }
.sheet .actions { display: grid; gap: 10px; margin-top: 18px; }
.sheet .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.sheet .meta span { background: rgba(25, 25, 52, 0.07); padding: 5px 11px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.sheet .btn:not(.primary):not(.green):not(.red) { background: var(--pink); color: var(--paper); box-shadow: 0 4px 0 #000; }

/* ───────── en-tête des écrans de jeu ───────── */
.gamebar { display: flex; align-items: center; gap: 12px; padding: 16px 0 10px; }
.progress { flex: 1; height: 14px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; position: relative; }
.progress i { position: absolute; inset: 0; transform-origin: left; transform: scaleX(var(--p, 0)); background: linear-gradient(90deg, var(--amarillo), #ffd75e); border-radius: 999px; transition: transform 0.6s var(--ease); }
.progress i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 3px; height: 4px; border-radius: 9px; background: rgba(255, 255, 255, 0.45); }
.combo { display: inline-flex; align-items: center; gap: 4px; font-weight: 900; color: #ffb347; font-variant-numeric: tabular-nums; min-width: 46px; justify-content: flex-end; }
.combo.hot { animation: flick 0.6s ease-in-out infinite alternate; }
@keyframes flick { to { transform: scale(1.12) rotate(-4deg); text-shadow: 0 0 18px rgba(255, 140, 0, 0.8); } }
.timerpill { font-weight: 800; font-variant-numeric: tabular-nums; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.08); }

/* ───────── leçon ───────── */
.lesson-head { display: flex; align-items: center; gap: 12px; padding: 14px 0 6px; }
.lesson-head .st { width: 48px; height: 48px; border-radius: 6px; background: var(--c); border: 5px dotted var(--ink); display: grid; place-items: center; font-size: 22px; flex: none; }
.lesson-head h1 { margin: 0; font-size: 21px; letter-spacing: -0.02em; line-height: 1.1; }
.lesson-head p { margin: 0; color: var(--muted); font-size: 14px; font-weight: 650; }
.dots { display: flex; gap: 6px; justify-content: center; padding: 8px 0 12px; }
.dots i { width: 8px; height: 8px; border-radius: 9px; background: rgba(255, 255, 255, 0.2); transition: all 0.35s var(--ease); }
.dots i.on { width: 28px; background: var(--amarillo); }
.dots i.seen { background: rgba(255, 255, 255, 0.5); }
.cardzone { flex: 1; position: relative; touch-action: pan-y; }
.lcard { padding: 22px 18px 20px; }
.lcard .lt { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.lcard .lt .e { font-size: 34px; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 16px; background: var(--paper-2); flex: none; }
.lcard .lt h2 { margin: 0; font-size: 26px; letter-spacing: -0.03em; line-height: 1.05; }
.lcard .lt small { display: block; color: var(--pink-soft); font-weight: 700; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }
.lcard p { margin: 10px 0; }
.lnav { display: flex; gap: 10px; padding: 26px 0 calc(18px + var(--safe-b)); position: sticky; bottom: 0; background: linear-gradient(transparent, var(--ink) 38%); z-index: 3; }
.lnav .btn:first-child { flex: 0 0 auto; }
.lnav .btn:last-child { flex: 1; }
.swipehint { text-align: center; color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 10px; }

/* contenus pédagogiques */
mark { background: #ffe0bf; color: #c2410c; border-radius: 4px; padding: 0 2px; font-weight: 800; }
i.end { font-style: normal; color: var(--azul); font-weight: 800; }
.say { width: 34px; height: 34px; border-radius: 50%; background: var(--pink); color: var(--paper); display: inline-grid; place-items: center; font-size: 15px; flex: none; transition: transform 0.15s var(--spring); }
.say:active, .say.talking { transform: scale(1.15); background: var(--azul); }
.ex { display: flex; gap: 10px; align-items: flex-start; background: #fff; border-radius: 14px; padding: 10px 12px; margin: 10px 0; box-shadow: 0 2px 0 var(--paper-3); }
.ex .es { display: block; font-weight: 800; font-size: 17.5px; }
.ex .fr { display: block; color: var(--pink-soft); font-size: 14.5px; font-weight: 550; }
.tbl { overflow-x: auto; margin: 10px 0; border-radius: 14px; background: #fff; box-shadow: 0 2px 0 var(--paper-3); }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--pink-soft); padding: 9px 12px 6px; background: var(--paper-2); }
td { padding: 8px 12px; border-top: 1px solid rgba(25, 25, 52, 0.07); font-weight: 600; }
td:first-child { font-weight: 800; }
.conj { background: #fff; border-radius: 16px; margin: 12px 0; overflow: hidden; box-shadow: 0 2px 0 var(--paper-3); }
.conj-h { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--pink); color: var(--paper); }
.conj-h b { font-size: 19px; }
.conj-h span { opacity: 0.7; font-weight: 600; font-size: 14px; }
.conj-h .say { background: var(--paper); color: var(--pink); width: 30px; height: 30px; }
.conj-g { display: grid; grid-template-columns: 1fr 1fr; }
.cr { padding: 8px 12px; display: flex; flex-direction: column; border-top: 1px solid rgba(25, 25, 52, 0.07); }
.cr:nth-child(odd) { border-right: 1px solid rgba(25, 25, 52, 0.07); }
.cr span { font-size: 12px; color: var(--pink-soft); font-weight: 700; }
.cr b { font-size: 18px; }
.trap { background: #ffe9e6; border-radius: 14px; padding: 12px 14px; margin: 12px 0; border-left: 5px solid var(--rojo); }
.trap b { color: var(--ko-d); }
.trap ul { margin: 6px 0 0; padding-left: 18px; }
.trap li { margin: 3px 0; font-weight: 600; font-size: 15.5px; }
.keep { background: #fff3c4; border-radius: 14px; padding: 12px 14px; margin: 12px 0; border-left: 5px solid var(--amarillo); }
.keep b { color: #8a6200; }
.keep p { margin: 4px 0 0; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.chips span { background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 750; font-size: 15px; box-shadow: 0 2px 0 var(--paper-3); }
.steps { margin: 10px 0; padding-left: 0; list-style: none; counter-reset: s; display: grid; gap: 8px; }
.steps li { counter-increment: s; display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.steps li::before { content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--pink); color: var(--paper); display: grid; place-items: center; font-weight: 800; font-size: 14px; margin-top: 1px; }
.steps.big li { font-size: 17px; background: #fff; padding: 10px 12px; border-radius: 14px; box-shadow: 0 2px 0 var(--paper-3); }
.g { color: var(--verde); } .p { color: #c0287a; } .o { color: var(--orange); }
.small { font-size: 14.5px; color: var(--pink-soft); }
.boot { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 12px 0; }
.boot .b { background: #fff; border-radius: 12px; padding: 8px 12px; font-size: 13px; color: var(--pink-soft); font-weight: 700; border: 2px dashed rgba(25, 25, 52, 0.12); }
.boot .b b { font-size: 19px; color: var(--pink); }
.boot .b.on { background: #ffe0bf; border: 2px solid #ffb877; }
.boot .b.on:nth-child(1) { border-radius: 12px 12px 4px 12px; }
.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 12px; }
.vs > div { border-radius: 16px; padding: 12px; color: #fff; }
.vs b { font-size: 26px; display: block; letter-spacing: -0.02em; }
.vs small { font-weight: 700; opacity: 0.9; }
.vs ul { margin: 8px 0 0; padding-left: 18px; font-weight: 650; font-size: 15px; }
.vs-a { background: linear-gradient(160deg, #e83f8c, #b5226a); }
.vs-b { background: linear-gradient(160deg, #12a36b, #0a7049); }
.anatomy { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.anatomy span { background: #fff; border-radius: 12px; padding: 8px 10px; text-align: center; box-shadow: 0 2px 0 var(--paper-3); flex: 1 1 auto; }
.anatomy b { display: block; font-size: 19px; }
.anatomy small { font-size: 11.5px; color: var(--pink-soft); font-weight: 700; }
.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; }
.pairs div { background: #fff; border-radius: 12px; padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 4px; font-weight: 800; font-size: 14.5px; box-shadow: 0 2px 0 var(--paper-3); }
.pairs i { color: var(--orange); font-style: normal; }
.families { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.families div { background: #fff; border-radius: 14px; padding: 10px; font-size: 14px; font-weight: 600; color: var(--pink-soft); box-shadow: 0 2px 0 var(--paper-3); }
.families b { display: block; color: var(--pink); font-size: 15.5px; margin-bottom: 2px; }
.doc { background: #fff; border-radius: 14px; padding: 12px 14px; margin: 10px 0; box-shadow: 0 2px 0 var(--paper-3); }
.doc p { margin: 4px 0 0; font-size: 15.5px; }
.people { display: grid; gap: 8px; margin: 10px 0; }
.people div { background: #fff; border-radius: 14px; padding: 10px 12px; box-shadow: 0 2px 0 var(--paper-3); }
.people small { display: block; color: var(--pink-soft); font-weight: 700; }
.people p { margin: 4px 0 0; font-size: 15px; }
.model { background: #fff; border-radius: 14px; padding: 14px; line-height: 1.7; font-weight: 600; box-shadow: 0 2px 0 var(--paper-3); }
.model u { text-decoration-color: var(--azul); text-decoration-thickness: 3px; text-underline-offset: 3px; }
.btn-say-all { width: auto; border-radius: 999px; padding: 8px 14px; margin-top: 10px; font-weight: 800; font-size: 15px; height: auto; }

/* ───────── question ───────── */
.qcard { padding: 22px 18px; text-align: center; margin-top: 6px; }
.qcard .cat { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 800; color: var(--pink-soft); text-transform: uppercase; letter-spacing: 0.08em; }
.qcard h2 { margin: 8px 0 0; font-size: clamp(22px, 5.8vw, 30px); line-height: 1.15; letter-spacing: -0.02em; text-wrap: balance; }
.qcard .hint { margin-top: 8px; color: var(--pink-soft); font-weight: 650; }
.qbody { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 16px 0 calc(20px + var(--safe-b)); }

.opts { display: grid; gap: 10px; }
.opt {
  display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; border-radius: 18px; background: var(--ink-2); border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.4); font-weight: 750; font-size: 18.5px; transition: transform 0.14s var(--ease), box-shadow 0.14s, border-color 0.2s, background 0.25s, opacity 0.3s;
  animation: rise 0.4s var(--ease) both; position: relative;
}
.opt:nth-child(2) { animation-delay: 0.05s; } .opt:nth-child(3) { animation-delay: 0.1s; } .opt:nth-child(4) { animation-delay: 0.15s; }
.opt:hover { border-color: rgba(255, 255, 255, 0.3); }
.opt:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.4); }
.opt .k { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; font-size: 15px; flex: none; background: var(--kc); color: #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); }
.opt:nth-child(1) { --kc: var(--rojo); } .opt:nth-child(2) { --kc: var(--azul); } .opt:nth-child(3) { --kc: #d99a00; } .opt:nth-child(4) { --kc: var(--verde); }
.opt.ok { background: var(--ok); border-color: #7ff0bf; box-shadow: 0 4px 0 var(--ok-d); color: #fff; animation: pulseok 0.5s var(--spring); }
.opt.ko { background: var(--ko); border-color: #ff9a9a; box-shadow: 0 4px 0 var(--ko-d); color: #fff; animation: shake 0.45s; }
.opt.fade { opacity: 0.35; }
.opts.locked .opt { pointer-events: none; }
@keyframes pulseok { 0% { transform: scale(1); } 40% { transform: scale(1.04); } 100% { transform: scale(1); } }
.tfgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1; max-height: 260px; }
.tfgrid .opt { flex-direction: column; justify-content: center; font-size: 24px; gap: 8px; }
.tfgrid .opt .k { width: 54px; height: 54px; font-size: 28px; border-radius: 50%; }
.tfgrid .opt:nth-child(1) { --kc: var(--verde); } .tfgrid .opt:nth-child(2) { --kc: var(--rojo); }

.typein { width: 100%; padding: 18px 16px; border-radius: 18px; border: 3px solid transparent; background: var(--paper); color: var(--pink); font-size: 26px; font-weight: 800; text-align: center; box-shadow: 0 4px 0 var(--paper-3); }
.typein:focus { outline: none; border-color: var(--amarillo); }
.typein.ok { border-color: var(--ok); background: #e7fff3; }
.typein.ko { border-color: var(--ko); background: #fff0f0; animation: shake 0.45s; }
.keys { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.keys button { padding: 11px 0; border-radius: 12px; background: var(--ink-3); font-weight: 800; font-size: 19px; border: 1px solid var(--line); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.35); }
.keys button:active { transform: translateY(2px); box-shadow: none; background: var(--azul); }

.built { min-height: 116px; border-radius: 18px; padding: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; background: rgba(255, 255, 255, 0.05); border: 2px dashed rgba(255, 255, 255, 0.22); }
.built .ph { margin: auto; color: var(--muted); font-weight: 650; }
.pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding: 6px 0; }
.tok { padding: 11px 15px; border-radius: 14px; background: var(--paper); color: var(--pink); font-weight: 800; font-size: 18px; box-shadow: 0 4px 0 var(--paper-3); transition: transform 0.12s var(--ease); animation: pop 0.35s var(--spring) both; }
.tok:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--paper-3); }
.tok.ghost { visibility: hidden; }
.built .tok { background: #fff; }
.built.ok { border-color: var(--ok); background: rgba(22, 196, 127, 0.12); }
.built.ko { border-color: var(--ko); background: rgba(239, 68, 68, 0.12); animation: shake 0.45s; }
.spacer { flex: 1; }

/* feuille de correction */
.fb {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 18px 16px calc(16px + var(--safe-b)); animation: sheetUp2 0.4s var(--ease) both;
  border-radius: 24px 24px 0 0; box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.4);
}
@keyframes sheetUp2 { from { transform: translateY(100%); } to { transform: none; } }
.fb .in { max-width: 728px; margin: 0 auto; display: grid; gap: 10px; }
.fb.ok { background: #d9fbe9; color: #064e32; }
.fb.accent { background: #fff1c7; color: #5c3d00; }
.fb.ko { background: #ffe1df; color: #6b1010; }
.fb h3 { margin: 0; font-size: 24px; display: flex; align-items: center; gap: 10px; letter-spacing: -0.02em; }
.fb h3 .ic { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 20px; animation: pop 0.45s var(--spring) both; }
.fb.ok .ic { background: var(--ok); } .fb.accent .ic { background: #d99a00; } .fb.ko .ic { background: var(--ko); }
.fb .ans { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.fb .ans b { font-size: 19px; }
.fb .ans .say { background: currentColor; }
.fb .ans .say span { filter: invert(1); }
.fb .why { margin: 0; font-weight: 600; opacity: 0.92; }
.fb .xp { margin-left: auto; font-weight: 900; font-size: 18px; }
.fb .btn.green, .fb .btn.red, .fb .btn.primary { margin-top: 4px; }

/* ───────── résultats ───────── */
.results { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 20px 0 30px; gap: 16px; }
.results h1 { margin: 0; font-size: clamp(36px, 10vw, 54px); letter-spacing: -0.04em; line-height: 1; }
.results .sub { color: var(--muted); font-weight: 650; margin-top: -6px; }
.bigstars { display: flex; gap: 8px; align-items: flex-end; height: 84px; }
.bigstars span { font-size: 58px; filter: grayscale(1) brightness(0.45); opacity: 0.6; transform: scale(0.6); transition: all 0.5s var(--spring); }
.bigstars span:nth-child(2) { font-size: 74px; }
.bigstars span.on { filter: drop-shadow(0 6px 14px rgba(245, 183, 0, 0.6)); opacity: 1; transform: scale(1); }
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.kpi { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 16px; padding: 12px 6px; }
.kpi b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12.5px; color: var(--muted); font-weight: 750; text-transform: uppercase; letter-spacing: 0.05em; }
.passport { width: 100%; padding: 18px; display: flex; align-items: center; gap: 16px; text-align: left; overflow: hidden; min-height: 132px; }
.passport .lines { flex: 1; }
.passport .lines b { display: block; font-size: 19px; }
.passport .lines span { color: var(--pink-soft); font-weight: 650; font-size: 14.5px; }
.slam { width: 104px; height: 104px; border-radius: 50%; border: 5px double var(--c); color: var(--c); display: grid; place-items: center; text-align: center; font-weight: 900; font-size: 11px; letter-spacing: 0.08em; line-height: 1.2; flex: none; transform: rotate(-12deg); background: color-mix(in srgb, var(--c) 8%, transparent); animation: slam 0.55s 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.25) both; }
.slam .e { font-size: 30px; display: block; letter-spacing: 0; }
@keyframes slam { 0% { transform: scale(3) rotate(-30deg); opacity: 0; } 60% { transform: scale(0.92) rotate(-10deg); opacity: 1; } 100% { transform: scale(1) rotate(-12deg); opacity: 1; } }
.review { width: 100%; text-align: left; display: grid; gap: 8px; }
.review h3 { margin: 6px 2px 2px; font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.rv { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.rv .q { font-weight: 700; }
.rv .a { color: #7ff0bf; font-weight: 800; margin-top: 2px; }
.rv .y { color: #ff9a9a; font-weight: 700; font-size: 14.5px; text-decoration: line-through; }
.rv .w { color: var(--muted); font-size: 14.5px; margin-top: 4px; font-weight: 550; }
.res-actions { display: grid; gap: 10px; width: 100%; margin-top: 6px; }

.gauge { width: 190px; height: 190px; position: relative; }
.gauge svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.gauge .lbl { position: absolute; inset: 0; display: grid; place-content: center; line-height: 1; }
.gauge b { font-size: 60px; letter-spacing: -0.04em; }
.gauge span { color: var(--muted); font-weight: 800; font-size: 18px; }
.bars { width: 100%; display: grid; gap: 8px; text-align: left; }
.barrow { text-align: left; width: 100%; display: grid; grid-template-columns: 30px 1fr 46px; align-items: center; gap: 10px; font-weight: 700; font-size: 14.5px; }
.barrow .tr { height: 12px; border-radius: 9px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.barrow .tr i { display: block; height: 100%; border-radius: 9px; background: var(--c); transform-origin: left; transform: scaleX(0); transition: transform 1s var(--ease); }
.barrow .lbl2 { grid-column: 2 / 4; text-align: left; font-size: 13px; color: var(--muted); margin-top: -6px; }

/* éclair */
.flashscore { font-size: 64px; font-weight: 900; letter-spacing: -0.04em; text-align: center; line-height: 1; font-variant-numeric: tabular-nums; }
.flashbar { height: 10px; border-radius: 9px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.flashbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--rojo), var(--amarillo)); transform-origin: left; }

/* fiche */
.fiche { padding-bottom: 40px; }
.fiche .paper { padding: 18px; margin: 12px 0; }
.fiche h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -0.02em; display: flex; gap: 10px; align-items: center; }
.sticky-head { position: sticky; top: 0; z-index: 5; margin: 0 -16px; padding: 14px 16px 10px; background: rgba(13, 15, 43, 0.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }

/* bulles de félicitations, étincelles, xp flottant */
.cheer { position: fixed; left: 50%; top: 38%; z-index: 25; pointer-events: none; font-size: clamp(42px, 12vw, 72px); font-weight: 900; letter-spacing: -0.04em; color: var(--amarillo); text-shadow: 0 6px 0 #a87e00, 0 20px 40px rgba(0, 0, 0, 0.5); animation: cheer 1.2s var(--ease) both; white-space: nowrap; }
@keyframes cheer { 0% { transform: translate(-50%, 20px) scale(0.4) rotate(-8deg); opacity: 0; } 25% { transform: translate(-50%, 0) scale(1.1) rotate(-4deg); opacity: 1; } 70% { transform: translate(-50%, -10px) scale(1) rotate(-4deg); opacity: 1; } 100% { transform: translate(-50%, -60px) scale(0.9) rotate(-4deg); opacity: 0; } }
.spark { position: fixed; z-index: 26; width: 9px; height: 9px; border-radius: 3px; pointer-events: none; animation: spark 0.75s var(--ease) forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(0.3); opacity: 0; } }
.floatxp { position: fixed; z-index: 26; pointer-events: none; font-weight: 900; color: var(--amarillo); font-size: 22px; animation: floatxp 1s var(--ease) forwards; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }
@keyframes floatxp { from { transform: translate(-50%, 0); opacity: 1; } to { transform: translate(-50%, -70px); opacity: 0; } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; }

.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); z-index: 60; background: var(--paper); color: var(--pink); padding: 12px 18px; border-radius: 14px; font-weight: 750; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45); animation: rise 0.35s var(--ease); max-width: calc(100vw - 32px); text-align: center; }

/* animations génériques */
@keyframes pop { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes rise { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
.rise { animation: rise 0.5s var(--ease) both; }
.pop { animation: pop 0.5s var(--spring) both; }
.d1 { animation-delay: 0.06s; } .d2 { animation-delay: 0.12s; } .d3 { animation-delay: 0.18s; } .d4 { animation-delay: 0.24s; } .d5 { animation-delay: 0.3s; }

/* transitions de page (View Transitions API) */
::view-transition-old(root) { animation: 0.22s ease both vtOut; }
::view-transition-new(root) { animation: 0.38s var(--ease) both vtIn; }
@keyframes vtOut { to { opacity: 0; transform: scale(0.985); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(14px); } }
::view-transition-group(*) { animation-duration: 0.45s; animation-timing-function: var(--ease); }

@media (max-width: 380px) { .brand small { display: none; } .stat { padding: 6px 9px; } }
@media (min-width: 640px) {
  .modes { grid-template-columns: repeat(4, 1fr); }
  .opts.two { grid-template-columns: 1fr 1fr; }
  .stop { width: 170px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* icône haut-parleur dessinée (plus lisible que l'emoji) */
.say:not(.btn-say-all) { font-size: 0; }
.say:not(.btn-say-all)::before {
  content: ""; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 9v6h4l5 4V5L8 9H4z'/><path d='M16 8.5a4.5 4.5 0 0 1 0 7' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/><path d='M18.5 6a8 8 0 0 1 0 12' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 9v6h4l5 4V5L8 9H4z'/><path d='M16 8.5a4.5 4.5 0 0 1 0 7' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/><path d='M18.5 6a8 8 0 0 1 0 12' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'/></svg>") center / contain no-repeat;
}
.fb .ans .say { background: rgba(0, 0, 0, 0.75); color: #fff; }
.rv .say { width: 28px; height: 28px; background: var(--paper); color: var(--pink); vertical-align: middle; }
@media (max-width: 480px) {
  th { padding: 8px 8px 5px; font-size: 11px; }
  td { padding: 7px 8px; font-size: 14px; }
}
.opt.fade { animation: none; opacity: 0.32; transform: scale(0.98); }

/* très petits écrans (iPhone SE, fenêtres étroites) */
@media (max-width: 360px) {
  .wrap { padding: 0 12px; }
  .brand > div:last-child { display: none; }
  .hero { padding: 16px; }
  .hero h1 { font-size: 30px; }
  .ring { width: 78px; height: 78px; }
  .ring .lbl b { font-size: 19px; }
  .ring .lbl span { font-size: 9px; }
  .count { gap: 5px; }
  .count b { font-size: 20px; }
  .count span { font-size: 9px; }
  .hero .btn { font-size: 17px; padding: 15px 14px; }
  .mode { padding: 12px; }
}
