/* ==========================================================================
   Vraie ou fausse ? : feuille de style
   Même direction que Patelin : signalétique routière × papiers officiels,
   scène de nuit, un seul accent (rouge panneau). Les jetons sont repris
   tels quels de ../css/app.css.

   Formes : boutons en pilule, panneaux 16 px, fiche 14 px, panneaux routiers en cqw.
   Couches (z-index) : bar 20 · vignette 40 · fx 45 · sheets 60 · toasts 70.
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg: oklch(0.165 0.014 262);
  --bg-elev: oklch(0.205 0.016 262);
  --bg-elev-2: oklch(0.245 0.018 262);
  --line: oklch(0.33 0.016 262);
  --line-soft: oklch(0.27 0.015 262);
  --ink: oklch(0.965 0.005 95);
  --ink-2: oklch(0.82 0.012 262);
  --ink-3: oklch(0.66 0.016 262);

  --signal: oklch(0.555 0.205 27);
  --signal-hi: oklch(0.625 0.205 28);
  --signal-lo: oklch(0.47 0.18 27);
  --on-signal: oklch(0.99 0.003 95);

  --paper: oklch(0.975 0.006 250);
  --sign-white: oklch(0.985 0.002 95);
  --sign-ink: oklch(0.2 0.01 260);
  --plate-blue: oklch(0.42 0.16 262);
  --stamp-blue: oklch(0.43 0.14 262);
  --gold: oklch(0.86 0.14 92);

  --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-ui: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --r-panel: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --gutter: 16px;
  --bar-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(120% 70% at 50% 18%, oklch(0.215 0.03 262), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--ink);
  font: 400 16px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
body.is-playing { overflow: hidden; overscroll-behavior: none; }
img, svg, canvas { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p, dl, dd, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ico { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.skip {
  position: fixed; left: 12px; top: -60px; z-index: 80;
  background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 999px;
  text-decoration: none; font-weight: 600;
}
.skip:focus { top: 12px; }
.noscript { color: var(--ink-2); }
main, main:focus, main:focus-visible { outline: none; }

/* ---------------------------------------------------------------- panneau (logo) */
.sign {
  display: inline-grid;
  background: var(--sign-white);
  border-radius: 0.34em;
  padding: 0.14em;
  color: var(--sign-ink);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.4) inset, 0 6px 18px -8px rgb(0 0 0 / 0.55);
}
.sign__in {
  display: grid; place-items: center;
  border: 0.16em solid var(--signal);
  border-radius: 0.22em;
  padding: 0.18em 0.55em 0.12em;
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  line-height: 0.95; letter-spacing: 0.02em;
}
.sign--brand { font-size: 16px; }

/* ---------------------------------------------------------------- barre du haut */
.app { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.bar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px;
  height: calc(var(--bar-h) + var(--safe-t));
  padding: var(--safe-t) var(--gutter) 0;
  isolation: isolate;
}
.bar::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in oklch, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  border-bottom: 1px solid color-mix(in oklch, var(--line-soft) 60%, transparent);
}
.brand { display: inline-flex; text-decoration: none; border-radius: 8px; }
.brand .sign { transition: transform 0.2s var(--ease); }
.brand:hover .sign { transform: translateY(-1px) rotate(-1.5deg); }
.bar__mode {
  justify-self: end;
  font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.03em; color: var(--ink-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bar__mode b { color: var(--ink); font-weight: 600; }
.iconbtn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 999px;
  border: 1px solid var(--line-soft); background: var(--bg-elev); color: var(--ink-2);
  -webkit-tap-highlight-color: transparent;
}
.iconbtn:hover { color: var(--ink); background: var(--bg-elev-2); }
.iconbtn .ico { width: 20px; height: 20px; }

/* ---------------------------------------------------------------- boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  border: 1px solid transparent; background: var(--bg-elev-2); color: var(--ink);
  font-weight: 600; font-size: 15px; letter-spacing: 0.005em; white-space: nowrap;
  text-decoration: none;
  transition: transform 0.18s var(--ease), background-color 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active:not(:disabled) { transform: translateY(1px) scale(0.985); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn .ico { width: 20px; height: 20px; }
.btn--primary {
  background: var(--signal); color: var(--on-signal);
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.22) inset, 0 10px 28px -12px color-mix(in srgb, var(--signal) 80%, black);
}
.btn--primary:hover:not(:disabled) { background: var(--signal-hi); }
.btn--quiet { background: var(--bg-elev); border-color: var(--line-soft); }
.btn--quiet:hover:not(:disabled) { background: var(--bg-elev-2); border-color: var(--line); }
.btn--ghost { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn--ghost:hover:not(:disabled) { border-color: var(--ink-3); color: var(--ink); }
.btn--xl { min-height: 58px; padding: 0 26px; font-size: 17px; }
.btn--lg { min-height: 52px; padding: 0 22px; font-size: 16px; }
.btn--block { width: 100%; }
.btn__aside { font-family: var(--font-mono); font-weight: 500; font-size: 0.82em; opacity: 0.8; }

/* ---------------------------------------------------------------- écrans */
.screen { width: 100%; }
.screen.is-in { animation: screen-in 0.45s var(--ease) both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- la route et le panneau */
.road {
  position: relative; isolation: isolate;
  display: grid; place-items: center; align-content: center;
  min-height: 0;
  overflow: hidden;
  /* le panneau tient en largeur et en hauteur (fiche et boutons prennent environ 430 px) */
  --sign-w: min(84vw, 400px, calc((100dvh - 430px) * 1.15));
}
.road::after { /* chaussée : un sol à peine plus clair, la nuit */
  content: ""; position: absolute; left: -10%; right: -10%; bottom: 0; height: 26%; z-index: -2;
  background: linear-gradient(180deg, transparent, oklch(0.2 0.012 262 / 0.9) 70%);
  border-top: 1px solid oklch(0.3 0.015 262 / 0.5);
  -webkit-mask: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  mask: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  pointer-events: none;
}
.road__glow {
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse closest-side at 50% 44%, oklch(0.93 0.05 85 / 0.17), oklch(0.93 0.05 85 / 0.05) 55%, transparent 92%);
  pointer-events: none;
}
.road::before { /* les poteaux se perdent dans la nuit */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 22%; z-index: 2;
  background: linear-gradient(180deg, transparent, var(--bg) 92%);
  pointer-events: none;
}
.post-group {
  position: relative;
  display: grid; justify-items: center;
  width: var(--sign-w);
  will-change: transform;
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none;
  cursor: grab;
}
.post-group:active { cursor: grabbing; }
.road--demo .post-group { cursor: default; }
.ring {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  border: 3px solid var(--sign-white); border-radius: 18px;
  opacity: 0; visibility: hidden; pointer-events: none;
}
.roadsign {
  container-type: inline-size;
  position: relative; z-index: 1;
  width: 100%;
  background:
    linear-gradient(170deg, rgb(255 255 255 / 0.6), transparent 42%),
    var(--sign-white);
  border-radius: 3.4cqw;
  padding: 2.3cqw;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.7),
    inset 0 -0.6cqw 0 oklch(0.88 0.005 95),
    0 0 0 1px rgb(0 0 0 / 0.12),
    0 34px 60px -26px rgb(0 0 0 / 0.85);
}
.roadsign__plate {
  display: grid; place-items: center;
  min-height: 30cqw;
  padding: 3.4cqw 4cqw 3cqw;
  border: 2.7cqw solid var(--signal);
  border-radius: 2.1cqw;
  text-align: center;
}
.roadsign__name {
  display: block;
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: var(--fs, 13cqw); line-height: 0.93; letter-spacing: 0.012em;
  color: var(--sign-ink);
  overflow-wrap: anywhere;
}
.roadsign__name span { display: block; }
/* barre rouge du panneau de sortie d'agglomération : la commune n'existe pas */
.roadsign__bar {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  width: var(--bar-l, 90%); height: 4.2cqw;
  translate: -50% -50%; rotate: var(--bar-a, -18deg);
  pointer-events: none;
}
.roadsign__bar::before {
  content: ""; position: absolute; inset: 0;
  background: var(--signal); border-radius: 0.9cqw;
  box-shadow: 0 0.3cqw 0.8cqw rgb(0 0 0 / 0.2);
  transform: scaleX(var(--bar-k, 0)); transform-origin: 0 50%;
}
.roadsign__posts {
  position: absolute; z-index: 0; left: 0; right: 0; top: 40%; height: 100vh;
  pointer-events: none;
  -webkit-mask: linear-gradient(180deg, #000 0, #000 22%, transparent 60%);
  mask: linear-gradient(180deg, #000 0, #000 22%, transparent 60%);
}
.roadsign__posts::before, .roadsign__posts::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 3.4%;
  background: linear-gradient(90deg, oklch(0.36 0.01 262), oklch(0.6 0.01 262) 35%, oklch(0.44 0.01 262) 70%, oklch(0.3 0.01 262));
  border-radius: 2px;
}
.roadsign__posts::before { left: 21%; }
.roadsign__posts::after { right: 21%; }

/* panonceau : le département, accroché sous le panneau quand la commune existe */
.panonceau {
  container-type: inline-size;
  position: relative; z-index: 1;
  width: 62%; margin-top: 2.2%;
  visibility: hidden;
  background: var(--sign-white);
  border-radius: 2.6cqw;
  padding: 1.8cqw;
  box-shadow: 0 0 0 1px rgb(0 0 0 / 0.12), 0 18px 30px -18px rgb(0 0 0 / 0.8);
  transform-origin: 50% 0;
}
.panonceau__in {
  display: flex; align-items: center; justify-content: center; gap: 3.5cqw;
  min-height: 16cqw;
  border: 1.6cqw solid var(--signal); border-radius: 1.6cqw;
  padding: 1.6cqw 3cqw 1.2cqw;
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: var(--pfs, 10cqw); line-height: 0.95; letter-spacing: 0.02em; color: var(--sign-ink);
  text-align: center;
}
.panonceau__in b {
  flex: none;
  padding: 1.2cqw 2.6cqw 0.8cqw; border-radius: 1.4cqw;
  background: var(--plate-blue); color: white; font-size: 0.86em;
}

.road__hint {
  position: absolute; top: 9%; z-index: 4;
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: 22px; letter-spacing: 0.06em; line-height: 1;
  padding: 8px 14px 6px; border-radius: 10px;
  box-shadow: 0 12px 26px -12px rgb(0 0 0 / 0.8);
  opacity: 0; visibility: hidden; pointer-events: none;
}
.road__hint--l { left: 4px; background: var(--signal); color: var(--on-signal); transform: rotate(-6deg); }
.road__hint--r { right: 4px; background: var(--sign-white); color: var(--sign-ink); box-shadow: inset 0 0 0 3px var(--signal), 0 12px 26px -12px rgb(0 0 0 / 0.8); transform: rotate(6deg); }

.timer {
  position: absolute; left: 50%; bottom: 10px; z-index: 3;
  translate: -50% 0;
  display: flex; align-items: center; gap: 8px;
  width: min(62%, 240px);
  color: var(--signal-hi);
  transition: color 0.3s, opacity 0.3s;
}
.timer .ico { width: 16px; height: 16px; }
.timer__track { position: relative; flex: 1; height: 3px; border-radius: 3px; background: oklch(0.32 0.015 262); overflow: hidden; }
.timer__track i { position: absolute; inset: 0; background: currentColor; border-radius: inherit; transform-origin: 0 50%; }
.timer.is-out { color: var(--ink-3); opacity: 0.6; }
.timer.is-off { opacity: 0; }

.float {
  position: absolute; left: 0; right: 0; top: 6%; z-index: 4;
  width: fit-content; margin-inline: auto;
  display: flex; align-items: center; gap: 8px;
  padding: 4px 16px 2px; border-radius: 999px;
  background: oklch(0.26 0.018 262 / 0.92); border: 1px solid var(--line);
  box-shadow: 0 12px 28px -12px rgb(0 0 0 / 0.8);
  font-family: var(--font-display); font-weight: 800; font-size: 30px; letter-spacing: 0.02em; line-height: 1.1;
  color: var(--ink);
  opacity: 0; visibility: hidden; pointer-events: none; white-space: nowrap;
}
.float.is-miss { background: var(--signal); border-color: var(--signal-hi); color: var(--on-signal); }
.float small {
  font-size: 15px; font-family: var(--font-ui); font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: var(--gold); color: oklch(0.25 0.05 75); text-shadow: none;
}

/* ---------------------------------------------------------------- partie */
.play {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 10px;
  height: calc(100dvh - var(--bar-h) - var(--safe-t));
  width: 100%; max-width: 560px; margin: 0 auto;
  padding: 6px var(--gutter) calc(var(--safe-b) + 14px);
}
.hud { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 30px; }
.pips { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; flex: 1; max-width: 300px; }
.pip {
  height: 9px; border-radius: 2.5px;
  background: oklch(0.28 0.015 262);
  box-shadow: inset 0 0 0 1px oklch(0.34 0.015 262);
  transition: background-color 0.25s, box-shadow 0.25s;
}
.pip.is-current { background: oklch(0.42 0.015 262); box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.pip.is-ok { background: var(--signal); box-shadow: inset 0 0 0 1px var(--signal-hi); }
.pip.is-ko { background: var(--sign-white); box-shadow: none; opacity: 0.85; }
.score { font-family: var(--font-mono); font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.score__n { display: inline-block; font-weight: 600; color: var(--ink); min-width: 2.5ch; text-align: right; }
.score__u { color: var(--ink-3); font-size: 12px; }

/* fiche communale : papier guilloché, teinté par la région à la révélation */
@property --paper-c { syntax: "<number>"; inherits: true; initial-value: 0.006; }
.fiche {
  --h: 262;
  --paper-c: 0.006;
  --frame: oklch(0.56 0.105 var(--h));
  position: relative; overflow: hidden;
  display: grid; gap: 8px;
  padding: 11px 14px 12px;
  border-radius: 14px;
  color: oklch(0.24 0.02 262);
  background:
    repeating-radial-gradient(circle at -8% -30%, transparent 0 9px, color-mix(in oklch, var(--frame) 10%, transparent) 9px 10px),
    repeating-radial-gradient(circle at 108% 130%, transparent 0 9px, color-mix(in oklch, var(--frame) 10%, transparent) 9px 10px),
    oklch(0.972 var(--paper-c) var(--h));
  box-shadow:
    inset 0 0 0 1px color-mix(in oklch, var(--frame) 30%, transparent),
    inset 0 0 0 5px oklch(0.972 var(--paper-c) var(--h)),
    inset 0 0 0 6px color-mix(in oklch, var(--frame) 22%, transparent),
    0 22px 40px -26px rgb(0 0 0 / 0.9);
  transition: --paper-c 0.4s;
}
.fiche.is-real { --paper-c: 0.022; }
.fiche.is-fake { --h: 262; --frame: oklch(0.55 0.02 262); }
.fiche__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fiche__kicker {
  font-family: var(--font-display); font-weight: 700; font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase;
  color: oklch(0.45 0.02 262);
}
.fiche__kicker span { font-family: var(--font-mono); font-weight: 500; letter-spacing: 0.02em; margin-left: 4px; }
.fiche__plate {
  display: inline-grid; place-items: center; min-width: 34px; height: 22px; padding: 2px 7px 0;
  border-radius: 4px; background: oklch(0.86 0.01 262); color: oklch(0.45 0.02 262);
  font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1;
  box-shadow: 0 0 0 1px oklch(0.3 0.02 262 / 0.25);
}
.fiche.is-real .fiche__plate { background: var(--plate-blue); color: white; }
.fiche__body { display: grid; grid-template-columns: minmax(0, 1fr) 86px; gap: 12px; align-items: center; }
.fiche__fields { display: grid; gap: 7px; }
.fiche__fields div { display: grid; gap: 1px; min-width: 0; }
.fiche__fields dt {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: oklch(0.5 0.02 262);
}
.fiche__fields dd {
  font-family: var(--font-mono); font-weight: 500; font-size: 15px; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums;
  min-height: 1.25em;
}
.redact {
  display: inline-block; vertical-align: -2px;
  width: var(--w, 9em); max-width: 100%; height: 0.95em; border-radius: 2px;
  background: oklch(0.3 0.015 262 / 0.82);
  color: transparent; overflow: hidden;
}
.fiche__map { width: 86px; height: 80px; overflow: visible; }
.fiche__map .m-fr { fill: oklch(0.93 0.012 262); stroke: oklch(0.55 0.03 262 / 0.6); stroke-width: 5; stroke-linejoin: round; }
.fiche.is-real .fiche__map .m-fr { fill: oklch(0.88 0.05 var(--h)); stroke: var(--frame); }
/* point de la commune : au-dessus du tampon pour rester lisible */
.fiche__pin {
  position: absolute; z-index: 4;
  width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 2.5px white, 0 2px 6px rgb(0 0 0 / 0.35);
  visibility: hidden; pointer-events: none;
}
.fiche__pin i { position: absolute; inset: -2px; border-radius: 50%; border: 2px solid var(--signal); opacity: 0; }
.fiche__map .m-q { font-family: var(--font-display); font-weight: 800; font-size: 300px; fill: oklch(0.55 0.02 262 / 0.35); }
.fiche__fact {
  display: grid; align-content: start; gap: 4px;
  min-height: calc(3 * 1.35em + 12px);
  font-size: 13.5px; line-height: 1.35; color: oklch(0.32 0.02 262);
  padding-top: 8px; border-top: 1px solid color-mix(in oklch, var(--frame) 22%, transparent);
  text-wrap: pretty;
}
.fiche__fact b { color: oklch(0.2 0.02 262); font-weight: 600; }
.fiche__line { display: block; }
.fiche__hint { display: block; color: oklch(0.48 0.02 262); font-size: 12.5px; }
.fiche__link {
  display: inline-flex; align-items: center; gap: 5px; width: fit-content;
  font-weight: 600; font-size: 13.5px; color: var(--signal-lo);
  text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--signal) 45%, transparent); text-underline-offset: 3px;
}
.fiche__link:hover { color: var(--signal); text-decoration-color: currentColor; }
.fiche__link .ico { width: 14px; height: 14px; }
.fiche__tag {
  display: inline-flex; align-items: center; gap: 6px; margin-right: 6px;
  padding: 1px 8px 0; border-radius: 999px; vertical-align: 1px;
  font-family: var(--font-display); font-weight: 700; font-size: 12.5px; letter-spacing: 0.06em; text-transform: uppercase;
  background: color-mix(in oklch, var(--tc, var(--frame)) 22%, white); color: oklch(0.36 0.08 var(--th, 262));
  box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--tc, var(--frame)) 55%, transparent);
}
.fiche__tag i { width: 6px; height: 6px; transform: rotate(45deg); background: currentColor; border-radius: 1px; }

/* tampon */
.stamp {
  position: absolute; right: 14px; top: 34px; z-index: 3;
  display: grid; place-items: center; text-align: center;
  min-width: 112px; padding: 9px 12px 7px;
  border: 3px solid currentColor; border-radius: 8px;
  box-shadow: inset 0 0 0 2px transparent, inset 0 0 0 3.5px currentColor;
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: 21px; line-height: 0.92; letter-spacing: 0.06em;
  color: var(--stamp-blue);
  background: transparent;
  transform: rotate(-11deg);
  mix-blend-mode: multiply;
  opacity: 0; visibility: hidden;
  pointer-events: none;
}
.stamp small { display: block; margin-top: 3px; font-size: 10.5px; letter-spacing: 0.12em; font-weight: 700; }
.stamp.is-fake { color: var(--signal); }

/* réponses : deux panneaux, dont un barré */
.dock { display: grid; min-height: 64px; }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.answer {
  position: relative;
  display: grid; place-items: center;
  min-height: 64px; padding: 5px;
  border: 0; border-radius: 12px;
  background: var(--sign-white);
  color: var(--sign-ink);
  box-shadow: inset 0 -3px 0 oklch(0.86 0.005 95), 0 0 0 1px rgb(0 0 0 / 0.2), 0 14px 26px -16px rgb(0 0 0 / 0.9);
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease), opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.answer:hover:not(:disabled) { transform: translateY(-2px); }
.answer:active:not(:disabled) { transform: translateY(1px) scale(0.975); box-shadow: inset 0 -1px 0 oklch(0.86 0.005 95), 0 0 0 1px rgb(0 0 0 / 0.2); }
.answer:disabled { cursor: default; }
.answer__sign {
  position: relative;
  display: grid; place-items: center;
  width: 100%; height: 100%; min-height: 54px;
  border: 3px solid var(--signal); border-radius: 8px;
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(18px, 5.4vw, 23px); line-height: 1; letter-spacing: 0.03em;
  padding: 3px 8px 0;
  overflow: hidden;
}
.answer__sign > span { position: relative; z-index: 1; text-shadow: 0 0 2px var(--sign-white), 0 0 3px var(--sign-white), 0 0 5px var(--sign-white); }
.answer__sign i {
  position: absolute; left: 5%; right: 5%; top: 50%; height: 3px; border-radius: 2px; margin-top: -1.5px;
  background: var(--signal); rotate: -13deg;
}
.answer kbd {
  position: absolute; bottom: -22px; left: 50%; translate: -50% 0;
  display: none;
  font-family: var(--font-mono); font-size: 11px; color: var(--ink-3);
  padding: 0 6px; border: 1px solid var(--line); border-radius: 5px;
}
.answer.is-picked { box-shadow: 0 0 0 3px var(--ink), 0 14px 26px -16px rgb(0 0 0 / 0.9); }
.answers.is-locked .answer:not(.is-picked) { opacity: 0.4; }

.next { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.next .btn { width: 100%; min-height: 64px; font-size: 17px; border-radius: 14px; }

.vignette {
  position: fixed; inset: 0; z-index: 40; pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 45%, oklch(0.5 0.2 27 / 0.55) 100%);
  opacity: 0;
}
.fx { position: fixed; inset: 0; z-index: 45; width: 100%; height: 100%; pointer-events: none; }

/* ---------------------------------------------------------------- accueil */
.home {
  display: grid;
  grid-template-areas: "stage" "copy" "actions" "stats" "rule" "bridge";
  gap: 18px;
  max-width: 1120px; margin: 0 auto;
  padding: 8px var(--gutter) calc(var(--safe-b) + 32px);
}
.home__stage { grid-area: stage; }
.road--demo { height: clamp(190px, 31vh, 300px); --sign-w: min(74vw, 330px); }
.road--demo .roadsign__posts { top: 45%; }
.road__caption {
  position: absolute; left: 0; right: 0; bottom: 12px; z-index: 4; width: fit-content; margin-inline: auto;
  padding: 4px 12px; border-radius: 999px;
  background: oklch(0.21 0.016 262 / 0.94); border: 1px solid var(--line-soft);
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.03em; color: var(--ink-2);
  white-space: nowrap; text-align: center;
}
.road__caption:empty { display: none; }
.road__caption b { color: var(--ink); font-weight: 600; }
.road__caption .is-fake { color: var(--signal-hi); }
.home__copy { grid-area: copy; display: grid; gap: 10px; }
.home__title {
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(44px, 13vw, 64px); line-height: 0.92; letter-spacing: 0.005em;
}
.home__sub { color: var(--ink-2); font-size: 16px; max-width: 44ch; text-wrap: pretty; }
.home__actions { grid-area: actions; display: grid; gap: 10px; }
.home__actions .btn { width: 100%; }
.home__daily-note { text-align: center; font-size: 13.5px; color: var(--ink-3); margin-top: -2px; }
.home__daily-note b { color: var(--ink-2); font-family: var(--font-mono); font-weight: 500; }

.home .stats { grid-area: stats; }
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border-block: 1px solid var(--line-soft);
}
.stats div { display: grid; gap: 2px; padding: 12px 4px; text-align: center; }
.stats div + div { border-left: 1px solid var(--line-soft); }
.stats dt { font-size: 12px; color: var(--ink-3); letter-spacing: 0.02em; }
.stats dd { font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.stats dd small { font-family: var(--font-ui); font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 2px; }

.home__rule { grid-area: rule; font-size: 14px; color: var(--ink-2); text-align: center; text-wrap: balance; }
.home__rule .ico { display: inline-block; vertical-align: -3px; width: 17px; height: 17px; margin-right: 4px; color: var(--gold); }

.home .bridge { grid-area: bridge; }
.bridge {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px;
  padding: 16px; border-radius: var(--r-panel);
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--signal) 22%, transparent), transparent 60%),
    var(--bg-elev);
  border: 1px solid color-mix(in srgb, var(--signal) 45%, var(--line-soft));
  text-decoration: none;
  transition: transform 0.2s var(--ease), border-color 0.2s;
}
.bridge:hover { transform: translateY(-2px); border-color: var(--signal); }
.bridge__text { display: grid; gap: 3px; }
.bridge__text b { font-size: 16px; font-weight: 650; line-height: 1.25; }
.bridge__text span { font-size: 13.5px; color: var(--ink-2); line-height: 1.4; }
.bridge__go { width: 22px; height: 22px; color: var(--signal-hi); }
.bridge__cards { position: relative; width: 46px; height: 60px; }
.bridge__cards i {
  position: absolute; inset: 0; border-radius: 5px;
  background:
    linear-gradient(var(--sign-white), var(--sign-white)) 50% 30% / 72% 18% no-repeat,
    linear-gradient(var(--signal), var(--signal)) 50% 30% / 80% 24% no-repeat,
    linear-gradient(160deg, oklch(0.66 0.1 var(--hh)), oklch(0.5 0.1 var(--hh)));
  box-shadow: 0 6px 14px -6px rgb(0 0 0 / 0.7), inset 0 0 0 1px rgb(255 255 255 / 0.15);
}
.bridge__cards i:nth-child(1) { --hh: 245; rotate: -12deg; translate: -6px 2px; }
.bridge__cards i:nth-child(2) { --hh: 145; rotate: 2deg; }
.bridge__cards i:nth-child(3) { --hh: 35; rotate: 14deg; translate: 7px 3px; }
.bridge--hero { padding: 18px; }
.bridge--hero .bridge__text b { font-size: 17px; }

/* ---------------------------------------------------------------- fin de partie */
.end .wrap { width: 100%; max-width: 560px; margin: 0 auto; padding: 14px var(--gutter) calc(var(--safe-b) + 40px); display: grid; gap: 22px; }
.result { display: grid; justify-items: center; gap: 6px; text-align: center; padding-top: 6px; }
.result__kicker { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0.04em; color: var(--ink-3); }
.result__score {
  display: flex; align-items: baseline; gap: 4px;
  font-family: var(--font-display); font-weight: 800; line-height: 0.85;
  font-size: clamp(96px, 30vw, 132px); letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
}
.result__score small { font-size: 0.38em; color: var(--ink-3); font-weight: 700; }
.result__title {
  margin-top: 6px;
  font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(30px, 9vw, 40px); line-height: 0.95; letter-spacing: 0.02em;
}
.result__title .sign { font-size: inherit; }
.result__title .sign__in { padding: 0.16em 0.5em 0.08em; }
.result__quip { color: var(--ink-2); font-size: 15px; max-width: 36ch; text-wrap: balance; }

.grid10 { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; width: min(100%, 360px); margin: 4px auto 0; }
.grid10 i {
  position: relative; aspect-ratio: 1; border-radius: 4px;
  background: var(--signal); box-shadow: inset 0 0 0 1px var(--signal-hi);
}
.grid10 i.is-ko { background: var(--sign-white); box-shadow: none; }
.grid10 i.is-fast::after {
  content: ""; position: absolute; left: 50%; bottom: -8px; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: var(--gold);
}

.figures { display: grid; grid-template-columns: repeat(3, 1fr); border-block: 1px solid var(--line-soft); }
.figures div { display: grid; gap: 2px; padding: 12px 4px; text-align: center; }
.figures div + div { border-left: 1px solid var(--line-soft); }
.figures dt { font-size: 12px; color: var(--ink-3); }
.figures dd { font-family: var(--font-display); font-weight: 700; font-size: 28px; line-height: 1; font-variant-numeric: tabular-nums; }
.figures dd small { font-family: var(--font-ui); font-size: 13px; font-weight: 500; color: var(--ink-3); margin-left: 2px; }

/* Pavés gagnés pour la collection Patelin */
.reward {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 14px 14px 14px 16px; border-radius: var(--r-panel);
  background: var(--bg-elev); border: 1px solid var(--line-soft);
}
.reward.is-win {
  border-color: oklch(0.8 0.09 85 / 0.45);
  background:
    repeating-radial-gradient(circle at 100% 0%, transparent 0 12px, oklch(0.8 0.09 85 / 0.07) 12px 13px),
    linear-gradient(160deg, oklch(0.27 0.04 262), oklch(0.2 0.03 262));
  box-shadow: 0 18px 40px -24px oklch(0.86 0.12 90 / 0.5);
}
.reward__ico {
  display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px;
  background: linear-gradient(160deg, oklch(0.62 0.03 75), oklch(0.45 0.025 70));
  color: oklch(0.96 0.02 85); box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.25), 0 8px 18px -8px rgb(0 0 0 / 0.7);
}
.reward__ico.is-off { background: var(--bg-elev-2); color: var(--ink-3); box-shadow: none; }
.reward__pave { width: 32px; height: 32px; }
.reward__text { display: grid; gap: 1px; min-width: 0; }
.reward__line { display: flex; align-items: baseline; gap: 8px; }
.reward__line.is-small { font-weight: 600; font-size: 15.5px; }
.reward__n { font-family: var(--font-display); font-weight: 800; font-size: 38px; line-height: 0.95; color: oklch(0.9 0.1 90); font-variant-numeric: tabular-nums; display: inline-block; }
.reward__u { font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--ink); }
.reward__sub { font-size: 13.5px; color: var(--ink-2); }
.reward__meta { margin-top: 3px; font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.reward__go { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--signal-hi); }
.reward__go:hover { background: var(--bg-elev-2); }
.reward__go .ico { width: 20px; height: 20px; }

.sharebox { display: grid; gap: 12px; padding: 16px; border-radius: var(--r-panel); background: var(--bg-elev); border: 1px solid var(--line-soft); }
.sharebox__title { font-size: 15px; font-weight: 600; }
.sharebox__text {
  margin: 0; padding: 12px 14px; border-radius: 12px;
  background: var(--bg); border: 1px dashed var(--line);
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.55; color: var(--ink-2);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.sharebox__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sharebox__row .btn { width: 100%; padding: 0 14px; }

.recap { display: grid; gap: 10px; }
.recap__title { font-size: 15px; font-weight: 600; color: var(--ink-2); }
.recap__list { display: grid; gap: 6px; }
.rrow {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px; background: var(--bg-elev); border: 1px solid var(--line-soft);
  text-decoration: none;
}
a.rrow:hover { border-color: var(--line); background: var(--bg-elev-2); }
.rrow__mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; }
.rrow__mark.is-ok { background: var(--signal); color: var(--on-signal); }
.rrow__mark.is-ko { background: var(--sign-white); color: var(--sign-ink); }
.rrow__mark .ico { width: 16px; height: 16px; }
.rrow__name {
  font-family: var(--font-display); font-weight: 700; font-size: 18px; line-height: 1.05; text-transform: uppercase; letter-spacing: 0.01em;
  overflow-wrap: anywhere;
}
.rrow__name s { text-decoration: line-through; text-decoration-color: var(--signal); text-decoration-thickness: 2px; }
.rrow__name small { display: block; margin-top: 3px; font-family: var(--font-ui); font-weight: 500; font-size: 12.5px; text-transform: none; letter-spacing: 0; color: var(--ink-3); }
.rrow__truth { font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.rrow__truth.is-fake { color: var(--signal-hi); }
.rrow__truth .ico { width: 14px; height: 14px; color: var(--ink-3); }

.again { display: grid; gap: 10px; }
.again__note { text-align: center; font-size: 14px; color: var(--ink-3); }
.again__note b { color: var(--ink); font-family: var(--font-mono); font-weight: 500; }

/* ---------------------------------------------------------------- feuilles et toasts */
.sheets { position: relative; z-index: 60; }
.sheet { position: fixed; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-items: end; justify-items: center; }
.sheet__backdrop { position: absolute; inset: 0; background: oklch(0.08 0.01 262 / 0.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.sheet__panel {
  position: relative; width: 100%; max-width: 480px; max-height: 92dvh; overflow-y: auto;
  padding: 18px var(--gutter) calc(var(--safe-b) + 20px);
  border-radius: 22px 22px 0 0; background: var(--bg-elev); border: 1px solid var(--line-soft); border-bottom: 0;
  box-shadow: 0 -20px 60px -20px rgb(0 0 0 / 0.6);
  overscroll-behavior: contain;
  display: grid; gap: 14px;
}
.sheet__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet__title { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1.05; }
.sheet__actions { display: grid; gap: 10px; }
.share-preview { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--line-soft); background: var(--bg); }
.fineprint { font-size: 13px; color: var(--ink-3); text-align: center; }
@media (min-width: 640px) {
  .sheet { align-items: center; }
  .sheet__panel { border-radius: 22px; border-bottom: 1px solid var(--line-soft); padding-bottom: 24px; }
}
.toasts {
  position: fixed; z-index: 70; left: 50%; top: calc(var(--safe-t) + 12px); transform: translateX(-50%);
  display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none;
}
.toast {
  padding: 12px 16px; border-radius: 14px; background: oklch(0.26 0.018 262); border: 1px solid var(--line);
  box-shadow: 0 12px 30px -12px rgb(0 0 0 / 0.6); font-size: 14.5px; text-align: center;
  animation: toast-in 0.35s var(--ease) both;
}
.toast.is-out { animation: toast-out 0.3s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-10px); } }

/* ---------------------------------------------------------------- écrans moyens et grands */
@media (max-height: 700px) {
  .fiche { gap: 6px; padding: 9px 12px 10px; }
  .fiche__map { width: 72px; height: 66px; }
  .fiche__body { grid-template-columns: minmax(0, 1fr) 72px; }
  .fiche__fact { font-size: 13px; }
  .stamp { top: 36px; font-size: 19px; min-width: 100px; }
}
@media (hover: hover) and (pointer: fine) {
  .answer kbd { display: inline-block; }
  .play { padding-bottom: calc(var(--safe-b) + 36px); }
}
@media (min-width: 900px) {
  :root { --gutter: 32px; --bar-h: 64px; }
  .sign--brand { font-size: 18px; }
  .bar__mode { justify-self: center; font-size: 13.5px; }
  .home {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    grid-template-areas: "copy stage" "actions stage" "stats stage" "rule bridge";
    column-gap: 64px; row-gap: 22px; align-items: start;
    padding-top: clamp(28px, 7vh, 72px);
  }
  .home__stage { align-self: center; }
  .road--demo { height: 440px; --sign-w: 440px; }
  .home__copy { align-self: end; }
  .home__title { font-size: clamp(64px, 6vw, 88px); }
  .home__sub { font-size: 17px; }
  .home__actions { grid-template-columns: 1fr 1fr; }
  .home__daily-note { grid-column: 1 / -1; grid-row: 2; text-align: left; }
  .home__rule { justify-content: flex-start; text-align: left; }
  .play { gap: 14px; }
  .road { --sign-w: min(440px, 100%, calc((100dvh - 450px) * 1.1)); }
}

/* ---------------------------------------------------------------- mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
