/* Combien ça coûte ?
   Banknote paper ground, ink type (Manrope for numbers and headings, Atkinson
   Hyperlegible Next for reading), one bold idea: the log track is banded in the
   tints of the euro banknotes (5 € grey → 500 € purple), one note per decade.
   Ink = your guess. Price-tag orange = the real amount. */

:root {
  color-scheme: light dark;
  --ground: #f2f3ee;
  --surface: #ffffff;
  --surface-2: #e8eae3;
  --ink: #1d2230;
  --ink-2: #4b5264;
  --ink-3: #7b8292;
  --line: #d8dbd2;
  --edge: #c3c7bc;          /* pressable bottom edge of light buttons */
  --btn: #1d2230;           /* primary button */
  --btn-ink: #ffffff;
  --btn-edge: #05070c;
  --truth: #e8590c;         /* the real amount */
  --truth-soft: rgba(232, 89, 12, 0.14);
  --player: #1d2230;        /* your guess */
  --player-ring: #ffffff;

  /* Euro banknote tints, one per decade */
  --note-0: #cfd1cc;  /* 5 € */
  --note-1: #f1b3ab;  /* 10 € */
  --note-2: #abc6ee;  /* 20 € */
  --note-3: #f6c58f;  /* 50 € */
  --note-4: #b1dbbb;  /* 100 € */
  --note-5: #eedb86;  /* 200 € */
  --note-6: #cfbde6;  /* 500 € */
  --note-7: #a9d8d3;  /* expert: beyond the notes */

  /* Semantic verdicts (separate from the accent) */
  --t-mille: #13854a;
  --t-proche: #2f9e5b;
  --t-ordre: #b68b00;
  --t-presque: #d9730d;
  --t-rate: #c7372f;

  --display: "Manrope", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible Next", "Atkinson Hyperlegible", "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --gutter: clamp(16px, 4vw, 28px);
  --r-card: 20px;
  --r-ctl: 14px;
  --focus: #2f63d0;
  --shine: rgba(238, 200, 90, 0.55); /* light ray on the Détails button */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #15171d;
    --surface: #1f222b;
    --surface-2: #2a2e39;
    --ink: #eeefe9;
    --ink-2: #b9bdc8;
    --ink-3: #8a8f9c;
    --line: #333845;
    --edge: #0c0d11;
    --btn: #eeefe9;
    --btn-ink: #15171d;
    --btn-edge: #9da1ab;
    --truth: #ff7b36;
    --truth-soft: rgba(255, 123, 54, 0.16);
    --player: #eeefe9;
    --player-ring: #15171d;
    --note-0: #45474b;
    --note-1: #6a3a36;
    --note-2: #334b70;
    --note-3: #6e4a26;
    --note-4: #2f5a3b;
    --note-5: #635826;
    --note-6: #4d3e66;
    --note-7: #265652;
    --t-mille: #4fd18a;
    --t-proche: #6fcf8f;
    --t-ordre: #e4c04a;
    --t-presque: #f39a4a;
    --t-rate: #f07166;
    --focus: #7aa2f7;
    --shine: rgba(255, 236, 170, 0.28);
  }
}
:root[data-theme="dark"] {
  --ground: #15171d;
  --surface: #1f222b;
  --surface-2: #2a2e39;
  --ink: #eeefe9;
  --ink-2: #b9bdc8;
  --ink-3: #8a8f9c;
  --line: #333845;
  --edge: #0c0d11;
  --btn: #eeefe9;
  --btn-ink: #15171d;
  --btn-edge: #9da1ab;
  --truth: #ff7b36;
  --truth-soft: rgba(255, 123, 54, 0.16);
  --player: #eeefe9;
  --player-ring: #15171d;
  --note-0: #45474b;
  --note-1: #6a3a36;
  --note-2: #334b70;
  --note-3: #6e4a26;
  --note-4: #2f5a3b;
  --note-5: #635826;
  --note-6: #4d3e66;
  --note-7: #265652;
  --t-mille: #4fd18a;
  --t-proche: #6fcf8f;
  --t-ordre: #e4c04a;
  --t-presque: #f39a4a;
  --t-rate: #f07166;
  --focus: #7aa2f7;
  --shine: rgba(255, 236, 170, 0.28);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-variant-numeric: tabular-nums;
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font: 16px/1.5 var(--body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 10px; }

/* ——— Top bar ——— */
.topbar {
  position: relative; z-index: 20;
  display: flex; align-items: center; gap: 14px;
  max-width: 760px; margin: 0 auto;
  padding: calc(10px + var(--safe-top)) var(--gutter) 10px;
  background: var(--ground);
}
.brand {
  display: flex; align-items: center; padding: 6px 0; margin-right: auto;
  background: none; border: 0; cursor: pointer; min-width: 0;
}
.brand-name { font: 800 18px/1 var(--display); letter-spacing: -0.01em; white-space: nowrap; }
/* Home already shows the title big: the bar shrinks to the sound button,
   floating top right next to the eyebrow instead of taking its own row. */
body:has(#screen-home:not([hidden])) .topbar { position: absolute; inset: 0 0 auto; background: none; pointer-events: none; }
body:has(#screen-home:not([hidden])) .brand { display: none; }
body:has(#screen-home:not([hidden])) .icon-btn { margin-left: auto; pointer-events: auto; }
.hud { display: flex; align-items: center; gap: 14px; font-variant-numeric: tabular-nums; }
.hud-progress { display: flex; gap: 4px; }
.hud-progress i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--line);
}
.hud-progress i.current { background: var(--ink); box-shadow: 0 0 0 2px var(--ground), 0 0 0 3.5px var(--ink); }
.hud-progress i[data-tier="mille"] { background: var(--t-mille); }
.hud-progress i[data-tier="proche"] { background: var(--t-proche); }
.hud-progress i[data-tier="ordre"] { background: var(--t-ordre); }
.hud-progress i[data-tier="presque"] { background: var(--t-presque); }
.hud-progress i[data-tier="rate"] { background: var(--t-rate); }
.hud-score { font: 700 17px/1 var(--display); white-space: nowrap; }
#hud-score { display: inline-block; }
#hud-score.bump { animation: score-bump 0.7s cubic-bezier(0.3, 1.8, 0.5, 1); }
@keyframes score-bump { 25% { transform: scale(1.35) translateY(-2px); color: var(--t-mille); } }
.hud-streak {
  padding: 4px 9px; border-radius: 999px; font: 700 13px/1 var(--display);
  background: var(--truth); color: #fff; white-space: nowrap;
  animation: pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}
@keyframes pop { from { transform: scale(0.6); } }
.icon-btn {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--line); cursor: pointer; color: var(--ink-2);
}
.icon-btn:hover { color: var(--ink); }
/* Way out of a game: kept quiet, the brand name does the same on wide screens. */
.quit-btn { width: 36px; height: 36px; background: none; border-color: transparent; }
.quit-btn:hover { border-color: var(--line); }
/* While the data loads, the home stays blank: a player who owes today's
   challenge is sent straight into it, without a flash of the home first. */
body.booting #app { visibility: hidden; }
.icon-sound .waves { display: none; }
.icon-btn.on .icon-sound .waves { display: inline; }
.icon-btn.on .icon-sound .mute { display: none; }
.icon-btn.on { color: var(--ink); }
@media (max-width: 460px) {
  .topbar:has(.hud:not([hidden])) .brand-name { display: none; }
  .hud { margin-right: auto; gap: 10px; }
  .hud-progress { gap: 3px; }
  .hud-progress i { width: 7px; height: 7px; }
}

main { position: relative; }
.screen {
  width: 100%; max-width: 760px; margin: 0 auto;
  padding: 4px var(--gutter) calc(32px + var(--safe-bottom));
}

/* ——— Buttons: chunky and pressable ——— */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px; border-radius: var(--r-ctl);
  border: 0; font: 700 17px/1 var(--display); letter-spacing: 0.005em; cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s, opacity 0.2s;
}
.btn-primary { background: var(--btn); color: var(--btn-ink); box-shadow: 0 4px 0 var(--btn-edge); }
.btn-primary:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 0 0 var(--btn-edge); }
.btn-primary:disabled { opacity: 0.28; cursor: not-allowed; }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 3px 0 var(--edge); }
.btn-ghost:active { transform: translateY(3px); box-shadow: 0 0 0 var(--edge); }
.btn-xl { min-height: 54px; font-size: 18px; width: 100%; }
@media (hover: hover) {
  .btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 5px 0 var(--btn-edge); }
  .btn-ghost:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--edge); }
}
/* "Je valide" wakes up with a little hop once the gauge has been touched. */
#validate:not(:disabled) { animation: ready 0.4s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes ready { from { transform: scale(0.94); } }

.card {
  background: var(--surface);
  border-radius: var(--r-card);
  padding: clamp(18px, 4.5vw, 26px);
  box-shadow: 0 1px 0 var(--line), 0 0 0 1px var(--line);
}
.eyebrow {
  margin: 0; color: var(--ink-2); font: 600 13px/1.2 var(--body);
  letter-spacing: 0.08em; text-transform: uppercase;
}

/* ——— Accueil ——— */
.home { display: flex; flex-direction: column; gap: 20px; padding-top: calc(20px + var(--safe-top)); max-width: 560px; }
.home-title {
  margin: -6px 0 0; font: 800 clamp(52px, 15vw, 104px)/0.92 var(--display); letter-spacing: -0.03em;
}
.home-lede { margin: 0; color: var(--ink-2); font-size: 18px; max-width: 33em; }
.home-lede b { color: var(--ink); font-weight: 700; }
.home-scale { margin: 6px 0 0; }
.home-bands { position: relative; display: flex; height: 28px; border-radius: 8px; overflow: visible; }
.home-bands i { flex: 1; }
.home-bands i:first-child { border-radius: 8px 0 0 8px; }
.home-bands i:nth-child(7) { border-radius: 0 8px 8px 0; }
.home-bands i:nth-child(1) { background: var(--note-0); }
.home-bands i:nth-child(2) { background: var(--note-1); }
.home-bands i:nth-child(3) { background: var(--note-2); }
.home-bands i:nth-child(4) { background: var(--note-3); }
.home-bands i:nth-child(5) { background: var(--note-4); }
.home-bands i:nth-child(6) { background: var(--note-5); }
.home-bands i:nth-child(7) { background: var(--note-6); }
.home-pin {
  position: absolute; left: 61%; top: -8px; bottom: -8px; width: 4px; margin-left: -2px;
  border-radius: 2px; background: var(--truth);
  animation: seek 5s ease-in-out infinite;
}
@keyframes seek { 0%, 100% { left: 61%; } 30% { left: 24%; } 60% { left: 82%; } }
.home-scale figcaption {
  display: flex; justify-content: space-between; margin-top: 8px;
  font: 700 13px/1 var(--display); color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.home-actions { display: flex; flex-direction: column; gap: 16px; }
.home-actions .btn-xl { max-width: 340px; }
.switch { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--ink-2); cursor: pointer; }
.switch b { color: var(--ink); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-ui {
  flex: none; width: 46px; height: 28px; border-radius: 999px; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line); position: relative; transition: background 0.2s;
}
.switch-ui::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.2s;
}
.switch input:checked + .switch-ui { background: var(--truth); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { outline: 3px solid var(--focus); outline-offset: 2px; }
.home-stats { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; }
.home-stats div { display: flex; flex-direction: column-reverse; }
.home-stats dt { color: var(--ink-3); font-size: 13px; }
.home-stats dd { margin: 0; font: 800 24px/1.1 var(--display); font-variant-numeric: tabular-nums; }
/* Daily challenge: the headline of the home screen when there is one. */
.daily { display: flex; flex-direction: column; gap: 12px; border-top: 5px solid var(--truth); }
.daily .btn-xl { max-width: 340px; }
.daily-kicker {
  margin: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline;
  font: 600 13px/1.2 var(--body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2);
}
.daily-kicker span:first-child { color: var(--truth); font-weight: 800; }
.daily-title { margin: 0; font: 800 clamp(20px, 5vw, 24px)/1.2 var(--display); letter-spacing: -0.01em; }
.daily-done { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.daily-result { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.daily-result b { font: 800 28px/1 var(--display); font-variant-numeric: tabular-nums; }
.daily-result span { font-size: 22px; letter-spacing: 2px; }
.daily-next { margin: 0; color: var(--ink-2); }
.preview-banner {
  margin: 0; padding: 10px 14px; border-radius: var(--r-ctl);
  background: var(--truth-soft); color: var(--ink); font-weight: 600;
}
.kbd-hint { color: var(--ink-2); font-size: 14px; border-top: 1px solid var(--line); padding-top: 12px; margin: 0; }
.error { color: var(--t-rate); font-weight: 600; }

/* ——— Question ——— */
.question-card {
  transform: translate3d(var(--px, 0), var(--py, 0), 0);
  transition: transform 0.5s ease-out, opacity 0.3s;
}
.question-card.enter { animation: card-in 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes card-in { from { opacity: 0; transform: translateY(10px); } }
.question-card.dim { opacity: 0.5; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.chip {
  padding: 5px 10px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2);
  font: 600 12.5px/1 var(--body); letter-spacing: 0.06em; text-transform: uppercase;
}
.chip-planned { background: var(--truth-soft); color: var(--truth); }
.chip-abandoned { background: color-mix(in srgb, var(--t-rate) 14%, transparent); color: var(--t-rate); }
.q-year { margin-left: auto;  color: var(--ink-3); font: 700 14px/1 var(--display); font-variant-numeric: tabular-nums; }
.q-title { margin: 0 0 6px; font: 800 clamp(22px, 5.6vw, 28px)/1.15 var(--display); letter-spacing: -0.015em; }
.q-desc { margin: 0 0 12px; color: var(--ink-2); font-size: 15.5px; line-height: 1.45; max-width: 60ch; }
.q-question { margin: 0; font: 600 clamp(19px, 4.8vw, 22px)/1.3 var(--body); }
/* **…** in a question: the unit the amount is expressed in (par bénéficiaire, au total…). */
.q-question strong { font-weight: 800; color: var(--truth); }
/* During the reveal the card keeps title + question; the description makes room
   for the amount and the verdict (it is repeated in the details card anyway). */
.stage.revealed .q-desc, .stage.revealed .card-meta { display: none; }
.stage.revealed .question-card { padding-block: 14px; }
.stage.revealed .q-title { margin: 0 0 4px; font-size: 18px; }
.stage.revealed .q-question { font-size: 15.5px; font-weight: 500; color: var(--ink-2); }

/* ——— Reveal ——— */
.reveal-panel { display: none; padding: 2px 4px 0; }
.reveal-panel.shown { display: block; animation: rise-in 0.3s ease-out; }
.reveal-panel.fade { animation: fade-in 0.4s ease-out; }
@keyframes rise-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes fade-in { from { opacity: 0; } }
.reveal-intro { margin: 0; color: var(--ink-2); font-size: 15px; }
.reveal-counter {
  margin: 0; color: var(--truth); font: 800 clamp(32px, 9.5vw, 56px)/1.05 var(--display); letter-spacing: -0.02em; display: flex;
}
.reveal-counter .roll-strip { transition-duration: 0.1s; }
.reveal-short { margin: 0; color: var(--ink-2); font: 700 16px/1.4 var(--display); opacity: 0; transition: opacity 0.3s; }
.reveal-short.shown { opacity: 1; }
.verdict {
  --tc: var(--ink-3);
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  margin-top: 12px; padding: 12px 14px; border-radius: var(--r-ctl);
  background: var(--surface); box-shadow: inset 0 0 0 2px var(--tc);
  opacity: 0; transform: translateY(6px); transition: opacity 0.25s, transform 0.25s;
  position: relative; overflow: hidden;
}
.verdict.shown { opacity: 1; transform: none; }
.verdict[data-tier="mille"] { --tc: var(--t-mille); }
.verdict[data-tier="proche"] { --tc: var(--t-proche); }
.verdict[data-tier="ordre"] { --tc: var(--t-ordre); }
.verdict[data-tier="presque"] { --tc: var(--t-presque); }
.verdict[data-tier="rate"] { --tc: var(--t-rate); }
.verdict-label { font: 800 21px/1.15 var(--display); color: var(--tc); }
.verdict-ratio { color: var(--ink-2); font-size: 15px; font-weight: 600; }
.verdict-points {
  margin-left: auto; font: 800 22px/1 var(--display); font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: baseline; gap: 6px;
}
.verdict-points small { font: 700 12px var(--body); color: var(--truth); }
.verdict.shimmer { animation: bump 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); }
.verdict.shown.wobble { animation: wobble 0.55s cubic-bezier(0.3, 1.4, 0.5, 1); }
@keyframes wobble { 20% { transform: rotate(-2.5deg) scale(1.02); } 45% { transform: rotate(2deg); } 70% { transform: rotate(-1deg); } }
@keyframes bump { 40% { transform: scale(1.03); } }

/* ——— Play area: question on top, gauge right below ———
   The question area has a fixed minimum height, sized to fit the longest question
   in the dataset, so the gauge sits at the same place for every question. Nothing
   here depends on the viewport height: scrolling (and mobile toolbars collapsing)
   cannot move anything. */
/* Room above the question card for its 1px outline (a box-shadow, drawn outside)
   and the parallax, which lifts it up to 3px: the opaque top bar would crop it. */
#screen-game { padding-top: 6px; padding-bottom: calc(8px + var(--safe-bottom)); }
.play { display: flex; flex-direction: column; gap: 12px; }
.stage { display: flex; flex-direction: column; gap: 12px; min-height: 280px; }
@media (max-width: 480px) { .stage { min-height: 300px; } }
.dock {
  flex: none;
  padding: 10px clamp(12px, 3vw, 20px) 12px;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgba(20, 24, 36, 0.05);
}
.actions { margin-top: 8px; min-height: 54px; display: flex; gap: 10px; }
.actions > .btn-xl { flex: 1 1 auto; width: auto; white-space: nowrap; padding-inline: 14px; }
.btn-details {
  flex: none; min-height: 54px; padding: 0 14px; gap: 6px; font-size: 15px; color: var(--ink);
}
/* Once the amount has landed: a light ray sweeps across "Détails", then the
   arrow bounces down towards the explanation card. */
.btn-details { position: relative; overflow: hidden; }
.btn-details::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 60%; pointer-events: none;
  background: linear-gradient(105deg, transparent 20%, var(--shine) 50%, transparent 80%);
  transform: translateX(-120%);
}
.btn-details.nudge::after { animation: shine 0.9s ease-in-out 0.7s; }
@keyframes shine { to { transform: translateX(260%); } }
/* Two bounces down, again every 7 s, until the player scrolls to the details. */
.btn-details.nudge svg { animation: bounce-down 7s 1.3s infinite; }
@keyframes bounce-down {
  0%, 7% { transform: translateY(0); animation-timing-function: cubic-bezier(0.5, 0, 1, 0.6); }
  3.5%, 10.5% { transform: translateY(7px); animation-timing-function: cubic-bezier(0, 0.4, 0.5, 1); }
  14%, 100% { transform: translateY(0); }
}
.skip-hint { flex: 1; }
.skip-hint { margin: 0; align-self: center; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ——— Gauge ——— */
.gauge { overflow-x: clip; user-select: none; -webkit-user-select: none; }
.gauge-top { position: relative; text-align: center; height: 86px; display: flex; flex-direction: column; align-items: center; }
.readout {
  display: inline-flex; align-items: center; border: 0; background: none; cursor: text;
  padding: 0 8px; border-radius: 12px; color: var(--player);
  font: 800 clamp(40px, 11vw, 60px)/1.08 var(--display); letter-spacing: -0.03em;
  transition: opacity 0.2s;
}
.readout:hover .readout-edit { opacity: 1; }
.readout:disabled { cursor: default; }
.readout-edit {
  position: absolute; top: 4px; right: 0;
  font: 600 13px/1 var(--body); letter-spacing: 0; padding: 5px 8px; border-radius: 8px;
  background: var(--surface-2); color: var(--ink-2); opacity: 0.8;
}
.readout-edit { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; border-radius: 50%; font-size: 15px; }
.readout:disabled .readout-edit { display: none; }
.gauge.untouched .readout { color: var(--ink-3); }
.readout-input {
  width: min(100%, 340px); text-align: center; padding: 8px 12px; border-radius: var(--r-ctl);
  font: 800 clamp(32px, 9vw, 48px)/1.2 var(--display); color: var(--ink);
  background: var(--surface-2); border: 2px solid var(--ink);
}
.readout-input::placeholder { color: var(--ink-3); font-weight: 600; }
.readout-input:focus { outline: none; }
.readout-input.invalid { border-color: var(--t-rate); animation: shake 0.35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
.hint { margin: 0; color: var(--ink-2); font-size: 14.5px; font-weight: 600; }
.live-compare { margin: 2px 0 0; color: var(--ink-3); font-size: 14px; min-height: 1.5em; }

/* Rolling digits */
.rolling { display: inline-flex; white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }
.roll, .roll-char { display: inline-block; height: 1.08em; line-height: 1.08em; vertical-align: top; }
.roll { overflow: hidden; width: 1ch; text-align: center; }
.roll-char { white-space: pre; }
.roll-strip { display: flex; flex-direction: column; transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.25, 1); }
.roll-digit { display: block; height: 1.08em; }

/* Track */
.track { position: relative; padding: 40px 0 2px; touch-action: none; cursor: pointer; border-radius: 12px; }
.track:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
/* Once validated the gauge is display-only: let vertical swipes scroll the page. */
.gauge.locked .track { cursor: default; touch-action: auto; }
.lane { position: relative; height: 44px; margin: 0 22px; }
.rail {
  position: absolute; left: 0; right: 0; top: 50%; height: 22px; transform: translateY(-50%);
  border-radius: 7px; overflow: hidden; background: var(--surface-2);
}
.notes { position: absolute; inset: 0; }
.note { position: absolute; top: 0; bottom: 0; }
.note[data-note="0"] { background: var(--note-0); }
.note[data-note="1"] { background: var(--note-1); }
.note[data-note="2"] { background: var(--note-2); }
.note[data-note="3"] { background: var(--note-3); }
.note[data-note="4"] { background: var(--note-4); }
.note[data-note="5"] { background: var(--note-5); }
.note[data-note="6"] { background: var(--note-6); }
.note[data-note="7"] { background: var(--note-7); }
.fill { display: none; }
.rungs { position: absolute; inset: 0; pointer-events: none; }
.rung {
  position: absolute; top: 50%; width: 1px; height: 8px; transform: translate(-50%, -50%);
  background: var(--ink); opacity: 0.18;
}
.rung.major { height: 30px; width: 2px; opacity: 0.35; }
.ticks { position: relative; height: 18px; margin: 4px 22px 0; }
.tick {
  position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap;
  font: 700 12px/1 var(--display); color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.tick:first-child { transform: translateX(-22px); }
.tick:last-child { transform: translateX(calc(-100% + 22px)); }
/* Narrow screens: every other label, counted from the top end so both ends stay labelled. */
@media (max-width: 480px) { .tick.odd { display: none; } }

.thumb {
  position: absolute; top: 50%; left: 50%; width: 44px; height: 44px; border-radius: 50%;
  transform: translate(-50%, -50%); pointer-events: none; z-index: 4;
  background: var(--player); box-shadow: 0 0 0 4px var(--player-ring), 0 3px 0 4px var(--edge);
  transition: transform 0.15s;
}
.thumb::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 4px; height: 18px; border-radius: 2px;
  background: var(--player-ring);
}
.gauge.dragging .thumb { transform: translate(-50%, -50%) scale(1.1); box-shadow: 0 0 0 4px var(--player-ring), 0 3px 0 4px var(--edge), 0 0 0 12px var(--truth-soft); }
.readout-num.hop-up { animation: hop-up 0.28s cubic-bezier(0.3, 1.6, 0.5, 1); }
.readout-num.hop-down { animation: hop-down 0.28s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes hop-up { 40% { transform: translateY(-5px) scale(1.06); } }
@keyframes hop-down { 40% { transform: translateY(4px) scale(0.96); } }
.gauge.untouched .thumb { animation: nudge 2.6s ease-in-out infinite; }
@keyframes nudge { 0%, 70%, 100% { margin-left: 0; } 80% { margin-left: -5px; } 90% { margin-left: 5px; } }
.thumb.stamped { animation: stamp 0.3s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes stamp { from { transform: translate(-50%, -50%) scale(1.35); } }
.gauge.locked .thumb { width: 28px; height: 28px; transition: width 0.25s, height 0.25s; }
.gauge.locked .thumb::after { height: 10px; width: 3px; }

.marker.truth {
  position: absolute; top: 50%; width: 4px; height: 46px; margin-left: -2px; transform: translateY(-50%);
  border-radius: 2px; background: var(--truth); z-index: 5;
}
.marker.truth::before {
  content: "€"; position: absolute; left: 50%; top: -24px; transform: translateX(-50%);
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: var(--truth); color: #fff; font: 800 15px/1 var(--display);
}
.marker.truth.landed { animation: land 0.4s cubic-bezier(0.3, 1.8, 0.5, 1); }
@keyframes land { from { transform: translateY(-50%) scaleY(1.5); } }
.band {
  position: absolute; top: 50%; height: 30px; transform: translateY(-50%); border-radius: 6px;
  background: var(--truth-soft); box-shadow: inset 0 0 0 2px var(--truth);
}
.gap {
  --tc: var(--ink-3);
  position: absolute; top: 50%; height: 6px; transform: translateY(-50%); border-radius: 3px;
  background: var(--tc); animation: fade-in 0.3s ease-out;
}
.gap[data-tier="mille"] { --tc: var(--t-mille); }
.gap[data-tier="proche"] { --tc: var(--t-proche); }
.gap[data-tier="ordre"] { --tc: var(--t-ordre); }
.gap[data-tier="presque"] { --tc: var(--t-presque); }
.gap[data-tier="rate"] { --tc: var(--t-rate); }

/* Landmark pins: projects already revealed */
.pins { position: absolute; inset: 0; pointer-events: none; transition: opacity 0.3s; }
.gauge.locked .pin-label { display: none; }
.gauge.locked .pin { height: 6px; opacity: 0.6; }
.pin { position: absolute; bottom: calc(50% + 11px); width: 0; height: 12px; border-left: 1.5px solid var(--ink-3); }
.pin.row1 { height: 30px; }
.pin-label {
  position: absolute; bottom: 100%; left: 0; max-width: 132px; visibility: hidden;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 600 10.5px/1.35 var(--body); color: var(--ink-2);
  padding: 1px 5px; background: var(--surface); border-radius: 4px; box-shadow: 0 0 0 1px var(--line);
}

/* ——— Learn card ——— */
.learn-card { margin-top: 14px; display: flex; flex-direction: column; gap: 16px; scroll-margin-top: 16px; }
.learn-card > .btn-xl { margin-top: 4px; }
.learn-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.badge {
  padding: 5px 10px; border-radius: 8px; font: 700 12.5px/1 var(--body); letter-spacing: 0.02em;
  color: var(--t-mille); box-shadow: inset 0 0 0 1.5px var(--t-mille);
}
.badge[data-conf="medium"] { color: var(--t-presque); box-shadow: inset 0 0 0 1.5px var(--t-presque); }
.learn-year { color: var(--ink-3); font-size: 14px; }
.learn-scope { margin: 0; font-size: 16px; max-width: 62ch; }
.overrun { padding: 14px; border-radius: var(--r-ctl); background: var(--surface-2); }
.overrun-title { margin: 0 0 8px; font: 600 12.5px/1 var(--body); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }
.bar-row { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; margin: 8px 0; font-size: 14px; }
.bar-name { color: var(--ink-2); font-weight: 600; }
.bar { height: 14px; border-radius: 4px; background: var(--surface); overflow: hidden; }
.bar-fill { display: block; height: 100%; width: 0; }
.bar-fill.planned { background: var(--ink-3); }
.bar-fill.actual { background: var(--truth); }
.bar-val { font: 700 15px/1 var(--display); white-space: nowrap; font-variant-numeric: tabular-nums; }
.overrun-factor { margin: 8px 0 0; font: 800 18px/1.3 var(--display); color: var(--truth); }
.compare { padding: 14px; border-radius: var(--r-ctl); background: var(--surface-2); }
.compare-line { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.compare-kicker { font: 600 12.5px/1.2 var(--body); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }
.compare-value { font-size: 17px; }
.compare-value b { font: 800 24px/1.2 var(--display); letter-spacing: -0.01em; }
.ref-note { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-3); }
.ref-note a { color: var(--ink-2); }
.quote { margin: 0; }
.quote p { margin: 0 0 6px; font: italic 400 17px/1.5 var(--body); max-width: 62ch; quotes: "« " " »"; }
.quote p::before { content: open-quote; font: 800 1.1em/1 var(--display); color: var(--truth); font-style: normal; }
.quote p::after { content: close-quote; font: 800 1.1em/1 var(--display); color: var(--truth); font-style: normal; }
.quote cite { font-style: normal; font-size: 13.5px; color: var(--ink-3); }
.source-link { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; text-underline-offset: 3px; }

/* ——— Bilan ——— */
.end { display: flex; flex-direction: column; gap: 16px; padding-top: 8px; }
.end-score {
  margin: 0; font: 800 clamp(64px, 18vw, 112px)/0.95 var(--display); letter-spacing: -0.04em; font-variant-numeric: tabular-nums;
}
.end-score small { font-size: 0.3em; letter-spacing: 0; color: var(--ink-2); }
.end-best { margin: -4px 0 4px; color: var(--ink-2); font-weight: 600; }
.end-best.record { color: var(--t-mille); }
.calib-title { margin: 0 0 6px; font: 800 clamp(23px, 6vw, 30px)/1.15 var(--display); letter-spacing: -0.015em; }
.calib-sub { margin: 0 0 18px; color: var(--ink-2); max-width: 60ch; }
.calib-axis { position: relative; height: 58px; margin: 0 16px; }
.axis-line { position: absolute; left: 0; right: 0; top: 17px; height: 2px; background: var(--line); }
.axis-zero { position: absolute; top: 4px; width: 2px; height: 28px; margin-left: -1px; background: var(--ink-3); }
.axis-lab { position: absolute; top: 40px; transform: translateX(-50%); font: 700 12px/1 var(--display); color: var(--ink-3); white-space: nowrap; }
.axis-dot {
  --tc: var(--ink-3);
  position: absolute; top: 12px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%;
  background: var(--tc); box-shadow: 0 0 0 2px var(--surface);
}
.axis-dot[data-tier="mille"] { --tc: var(--t-mille); }
.axis-dot[data-tier="proche"] { --tc: var(--t-proche); }
.axis-dot[data-tier="ordre"] { --tc: var(--t-ordre); }
.axis-dot[data-tier="presque"] { --tc: var(--t-presque); }
.axis-dot[data-tier="rate"] { --tc: var(--t-rate); }
.axis-dot.past { top: 14px; width: 8px; height: 8px; margin-left: -4px; opacity: 0.35; box-shadow: none; }
.axis-mean { position: absolute; top: 0; width: 4px; height: 36px; margin-left: -2px; border-radius: 2px; background: var(--ink); }
.axis-mean::after {
  content: "vous"; position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  font: 700 11px/1 var(--display); color: var(--ink);
}
.calib-axis { margin-top: 26px; }
.recap h3 { margin: 0 0 6px; font: 800 20px/1.2 var(--display); }
.recap-list { list-style: none; margin: 0; padding: 0; }
.recap-list li { --tc: var(--ink-3); display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.recap-list li:first-child { border-top: 0; }
.recap-list li[data-tier="mille"] { --tc: var(--t-mille); }
.recap-list li[data-tier="proche"] { --tc: var(--t-proche); }
.recap-list li[data-tier="ordre"] { --tc: var(--t-ordre); }
.recap-list li[data-tier="presque"] { --tc: var(--t-presque); }
.recap-list li[data-tier="rate"] { --tc: var(--t-rate); }
.recap-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--tc); }
.recap-main { min-width: 0; display: flex; flex-direction: column; }
.recap-title { font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recap-values { font-size: 13.5px; color: var(--ink-3); }
.recap-values i { font-style: normal; font-weight: 700; font-family: var(--display); }
.recap-values .guess { color: var(--ink); }
.recap-values .truth { color: var(--truth); }
.recap-pts { font: 800 17px/1 var(--display); font-variant-numeric: tabular-nums; }
.end-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.end-actions .btn-xl { flex: 1 1 200px; width: auto; }
.end-actions .btn-share { flex-grow: 2; }
.end-emojis { margin: -6px 0 0; display: flex; gap: 6px; font-size: 30px; line-height: 1; }
.end-emojis span { display: inline-block; animation: emoji-pop 0.45s cubic-bezier(0.3, 1.8, 0.5, 1) backwards; }
@keyframes emoji-pop { from { transform: scale(0) rotate(-25deg); opacity: 0; } }
.calib-kicker { margin: 0 0 6px; font: 600 12.5px/1.2 var(--body); color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.08em; }

/* ——— Toast & confetti ——— */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + var(--safe-bottom)); z-index: 50;
  transform: translateX(-50%); padding: 12px 18px; border-radius: 12px;
  background: var(--btn); color: var(--btn-ink); font-weight: 700;
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { animation: toast 0.25s ease-out; }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 8px); } }
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }
.fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 41; }
.wash {
  position: fixed; inset: 0; pointer-events: none; z-index: 39; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 45%, var(--wash) 130%);
}

/* Phones: compact question card. Width-based only: a height-based query would
   flip while the browser toolbars collapse on scroll and make the layout jump. */
@media (max-width: 480px) {
  .question-card { padding: 16px 18px; }
  .q-title { font-size: 20px; }
  .q-desc { font-size: 14.5px; margin-bottom: 8px; line-height: 1.4; }
  .card-meta { margin-bottom: 6px; }
  .q-question { font-size: 17.5px; }
  .stage.revealed .q-title { font-size: 17px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal-panel.fade { animation: fade-in 0.3s ease-out !important; }
  .question-card { transform: none; }
}
