/* ==========================================================================
   Pronostic 2027 — feuille de style
   Direction : papier chaud et encre (Aesop, Muji), précision des filets
   (Linear), typographie éditoriale (Pentagram), une question par écran
   (Duolingo), révélations animées (Apple), micro-interactions (Framer).
   ========================================================================== */

:root {
  --paper: #f4f1ea;
  --paper-2: #ece8de;
  --card: #fbfaf6;
  --ink: #16150f;
  --ink-2: #3a3832;
  --muted: #68645b;
  --line: #dcd6c9;
  --line-2: #c9c2b2;
  --accent: #17309a;
  --accent-ink: #ffffff;
  --accent-soft: rgba(23, 48, 154, 0.08);
  --blue: #17309a;
  --red: #7a1e2e;
  --red-soft: rgba(122, 30, 46, 0.08);
  --paper-3: #fbfaf6;
  --good: #1a7a43;
  --warn: #b5541c;
  --shadow: 0 1px 0 rgba(22, 21, 15, 0.04), 0 8px 24px -12px rgba(22, 21, 15, 0.18);
  --radius: 14px;
  --radius-sm: 9px;
  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12110e;
    --paper-2: #1a1915;
    --card: #1c1b17;
    --ink: #f1ede4;
    --ink-2: #d6d1c5;
    --muted: #9a958a;
    --line: #2e2c26;
    --line-2: #3d3a33;
    --accent: #7d97ff;
    --accent-ink: #0d0c0a;
    --accent-soft: rgba(125, 151, 255, 0.12);
    --blue: #7d97ff;
    --red: #e0788a;
    --red-soft: rgba(224, 120, 138, 0.12);
    --paper-3: #f1ede4;
    --good: #4cc27f;
    --warn: #e08a52;
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #12110e;
  --paper-2: #1a1915;
  --card: #1c1b17;
  --ink: #f1ede4;
  --ink-2: #d6d1c5;
  --muted: #9a958a;
  --line: #2e2c26;
  --line-2: #3d3a33;
  --accent: #7d97ff;
  --accent-ink: #0d0c0a;
  --accent-soft: rgba(125, 151, 255, 0.12);
  --blue: #7d97ff;
  --red: #e0788a;
  --red-soft: rgba(224, 120, 138, 0.12);
  --paper-3: #f1ede4;
  --good: #4cc27f;
  --warn: #e08a52;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 10px 30px -14px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.num { font-variant-numeric: lining-nums proportional-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ------------------------------------------------------------------ Shell */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.topbar.scrolled { border-bottom-color: var(--line); }

.wordmark {
  display: inline-flex; align-items: baseline; gap: 6px;
  text-decoration: none;
  font-family: var(--sans); font-weight: 700; letter-spacing: -0.02em;
  font-size: 17px;
}
.wordmark .yr {
  font-family: var(--serif); font-style: italic; font-weight: 500;
  font-size: 19px; color: var(--accent);
}

.topbar nav { display: flex; align-items: center; gap: 4px; }
.navlink {
  font-size: 14px; color: var(--muted); text-decoration: none;
  padding: 6px 10px; border-radius: 8px;
  transition: color .2s, background .2s;
}
.navlink:hover { color: var(--ink); background: var(--paper-2); }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--card);
  transition: transform .2s var(--spring), border-color .2s;
}
.icon-btn:hover { border-color: var(--line-2); }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 18px; height: 18px; }

main { width: 100%; max-width: 1120px; margin: 0 auto; }

.screen { display: none; }
.screen.active { display: block; animation: screen-in .5s var(--ease) both; }
.screen.leaving-back { animation: none; }
@keyframes screen-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .screen.active { animation: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ------------------------------------------------------------------ Accueil */

.hero {
  padding: 40px 16px 24px;
  max-width: 760px; margin: 0 auto;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: .02em;
  color: var(--ink-2);
  padding: 6px 12px 6px 8px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
}
.eyebrow .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(44px, 11vw, 92px);
  line-height: .98;
  letter-spacing: -0.025em;
  margin: 22px 0 18px;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero h1 .line { display: block; overflow: hidden; padding: .14em 0 .06em; margin: -.14em 0 -.06em; }
.hero h1 .line > span {
  display: inline-block;
  transform: translateY(105%);
  animation: rise .9s var(--ease) forwards;
}
.hero h1 .line:nth-child(2) > span { animation-delay: .08s; }
.hero h1 .line:nth-child(3) > span { animation-delay: .16s; }
@keyframes rise { to { transform: none; } }

.lede {
  font-size: 18px; line-height: 1.55; color: var(--ink-2);
  max-width: 34ch; margin: 0 0 28px;
  opacity: 0; animation: fade .8s .35s var(--ease) forwards;
}
@keyframes fade { to { opacity: 1; } }

.hero-cta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px;
  opacity: 0; animation: fade .8s .5s var(--ease) forwards;
}
.cta-note { font-size: 14px; color: var(--muted); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px;
  border-radius: 14px; border: 1px solid transparent;
  font-weight: 600; font-size: 16px; letter-spacing: -0.01em;
  text-decoration: none;
  transition: transform .25s var(--spring), background .2s, box-shadow .2s, opacity .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--ink); color: var(--paper);
  box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 6px 18px -8px rgba(22,21,15,.5);
}
.btn-primary:hover { background: color-mix(in srgb, var(--ink) 88%, var(--accent)); }
.btn-primary .arrow { transition: transform .25s var(--spring); }
.btn-primary:hover .arrow { transform: translateX(3px); }
.btn-primary[aria-disabled="true"] { opacity: .45; }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: var(--paper-2); }
.btn-small { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 11px; }

.countdown {
  margin: 44px 16px 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr);
  border-top: 1px solid var(--line);
  max-width: 760px;
}
@media (min-width: 792px) { .countdown { margin-left: auto; margin-right: auto; } }
.countdown > div { padding: 18px 0 4px; }
.countdown > div + div { padding-left: 18px; border-left: 1px solid var(--line); }
.countdown dt { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.countdown dd { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: -0.03em; }
.countdown dd small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 4px; }

.how {
  max-width: 760px; margin: 56px auto 0; padding: 0 16px;
}
.section-label {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em;
  color: var(--muted); margin: 0 0 16px;
}
.how ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.how li {
  background: var(--card); padding: 18px 18px 18px 16px;
  display: grid; grid-template-columns: 34px 1fr; gap: 4px 12px; align-items: baseline;
}
.how .n { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--accent); grid-column: 1; grid-row: 1 / span 2; line-height: 1.1; }
.how strong { font-weight: 600; letter-spacing: -0.01em; grid-column: 2; grid-row: 1; }
.how li > span:not(.n) { color: var(--muted); font-size: 15px; grid-column: 2; grid-row: 2; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

.trust {
  max-width: 760px; margin: 40px auto 0; padding: 0 16px 8px;
  display: grid; gap: 10px;
  font-size: 14px; color: var(--muted);
}
.trust p { margin: 0; display: flex; gap: 10px; align-items: flex-start; }
.trust svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--ink-2); }

footer.site {
  max-width: 760px; margin: 56px auto 0; padding: 22px 16px 40px;
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between;
}
footer.site a { color: var(--muted); }

/* ------------------------------------------------------------------ Parcours */

.flow {
  max-width: 640px; margin: 0 auto;
  padding: 8px 16px 140px;
}
.progress {
  position: sticky; top: 64px; z-index: 10;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0 14px;
  background: linear-gradient(var(--paper) 70%, transparent);
}
.progress-track {
  flex: 1; height: 8px; border-radius: 99px; background: var(--paper-2);
  border: 1px solid var(--line); overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0; border-radius: inherit; background: var(--accent);
  transition: width .6s var(--spring);
}
.progress-count { font-size: 13px; color: var(--muted); min-width: 34px; text-align: right; }
.back-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--card);
  transition: transform .2s var(--spring);
}
.back-btn:active { transform: scale(.92); }
.back-btn svg { width: 16px; height: 16px; }

.step-kicker { font-size: 13px; font-weight: 600; color: var(--accent); margin: 14px 0 6px; letter-spacing: .01em; }
.step-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(30px, 7.4vw, 44px); line-height: 1.06; letter-spacing: -0.02em;
  margin: 0 0 10px;
}
.step-help { color: var(--ink-2); margin: 0 0 22px; font-size: 16px; max-width: 46ch; }

.options { display: grid; gap: 10px; }
.option {
  position: relative;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  padding: 16px 16px; border-radius: var(--radius);
  background: var(--card); border: 1.5px solid var(--line);
  box-shadow: 0 2px 0 var(--line);
  transition: transform .25s var(--spring), border-color .2s, box-shadow .2s, background .2s;
  -webkit-tap-highlight-color: transparent;
}
.option:hover { border-color: var(--line-2); }
.option:active { transform: translateY(2px); box-shadow: 0 0 0 var(--line); }
.option[aria-checked="true"] {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 55%, transparent);
}
.option .t { font-weight: 600; letter-spacing: -0.01em; }
.option .d { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; font-weight: 400; }
.option .check {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--line-2);
  display: grid; place-items: center;
  transition: background .2s, border-color .2s, transform .3s var(--spring);
}
.option .check svg { width: 14px; height: 14px; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .3s var(--spring); color: var(--accent-ink); }
.option[aria-checked="true"] .check { background: var(--accent); border-color: var(--accent); transform: scale(1.06); }
.option[aria-checked="true"] .check svg { opacity: 1; transform: none; }

.subq { margin-top: 28px; }
.subq h3 { font-size: 15px; font-weight: 600; margin: 0 0 12px; letter-spacing: -0.01em; }

/* Candidats : grille de pastilles */
.cand-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 560px) { .cand-grid { grid-template-columns: repeat(3, 1fr); } }
.cand-tile {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 14px; border-radius: var(--radius);
  background: var(--card); border: 1.5px solid var(--line);
  box-shadow: 0 2px 0 var(--line);
  text-align: left; min-height: 118px;
  transition: transform .25s var(--spring), border-color .2s, opacity .25s, filter .25s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}
.cand-tile:active { transform: translateY(2px); box-shadow: 0 0 0 var(--line); }
.cand-tile[aria-pressed="false"] { opacity: .5; filter: grayscale(1); }
.cand-tile[aria-pressed="true"] { border-color: var(--line-2); }
.cand-tile[disabled] { cursor: not-allowed; }
.cand-tile .name { font-weight: 600; font-size: 15px; line-height: 1.2; letter-spacing: -0.01em; }
.cand-tile .party { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.cand-tile .state {
  position: absolute; top: 12px; right: 12px;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  padding: 3px 7px; border-radius: 99px;
  background: var(--paper-2); color: var(--muted);
}
.cand-tile[aria-pressed="true"] .state { background: var(--ink); color: var(--paper); }
.cand-tile .lock-note { font-size: 12px; color: var(--muted); }

.avatar {
  --c: #777;
  flex: none;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--c);
  color: #fff; font-weight: 700; font-size: 14px; letter-spacing: -0.02em;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.avatar.sm { width: 30px; height: 30px; font-size: 11.5px; }
.avatar.lg { width: 56px; height: 56px; font-size: 19px; }

/* Curseurs */
.slider-wrap { padding: 20px 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); }
.big-value {
  font-size: 64px; font-weight: 600; letter-spacing: -0.045em; line-height: 1;
  margin: 0 0 4px;
}
.big-value small { font-size: 26px; color: var(--muted); font-weight: 500; letter-spacing: -0.02em; }
.big-sub { color: var(--muted); font-size: 14px; margin: 0 0 18px; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 30px; background: transparent; margin: 0;
  --fill: 50%;
  --track: var(--accent);
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; border-radius: 99px;
  background: linear-gradient(to right, var(--track) var(--fill), var(--paper-2) var(--fill));
  border: 1px solid var(--line);
}
input[type="range"]::-moz-range-track {
  height: 6px; border-radius: 99px; background: var(--paper-2); border: 1px solid var(--line);
}
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--track); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--card); border: 1.5px solid var(--line-2);
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
  margin-top: -10px;
  transition: transform .2s var(--spring);
}
input[type="range"]::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--card); border: 1.5px solid var(--line-2);
  box-shadow: 0 2px 6px rgba(0,0,0,.18);
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.18); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft), 0 2px 6px rgba(0,0,0,.18); border-color: var(--accent); }

.scale-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* Premier tour */
.total-bar {
  position: sticky; top: 118px; z-index: 9;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; margin: 0 0 12px;
  border-radius: 12px; background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow);
  font-size: 14px;
}
.total-bar .ok { color: var(--good); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.stack {
  display: flex; height: 10px; border-radius: 99px; overflow: hidden; flex: 1; max-width: 220px;
  background: var(--paper-2);
}
.stack > i { display: block; height: 100%; transition: width .35s var(--ease); }

.rows { display: grid; gap: 8px; }
.row {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 4px 12px; align-items: center;
  padding: 12px 12px 8px 12px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--line);
  transition: border-color .2s, transform .35s var(--ease);
}
.row.locked { border-style: dashed; }
.row .who { min-width: 0; }
.row .who b { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .who span { font-size: 12px; color: var(--muted); }
.row .val { display: flex; align-items: center; gap: 4px; }
.row .val output { font-size: 20px; font-weight: 600; letter-spacing: -0.03em; min-width: 62px; text-align: right; }
.row input[type="range"] { grid-column: 1 / -1; }
.lock {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: transparent;
  display: grid; place-items: center; color: var(--muted);
  transition: background .2s, color .2s, transform .2s var(--spring);
}
.lock:hover { background: var(--paper-2); color: var(--ink); }
.lock[aria-pressed="true"] { color: var(--ink); background: var(--paper-2); border-color: var(--line); }
.lock:active { transform: scale(.9); }
.lock svg { width: 15px; height: 15px; }
.rank-badge { font-size: 11px; font-weight: 700; color: var(--accent); margin-left: 6px; }

.hint {
  display: flex; gap: 10px; align-items: flex-start;
  margin: 14px 0 0; padding: 12px 14px; border-radius: 12px;
  background: var(--paper-2); color: var(--ink-2); font-size: 14px;
}
.hint svg { flex: none; width: 16px; height: 16px; margin-top: 3px; }

/* Second tour */
.duel {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px;
  padding: 18px 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line);
  margin-bottom: 14px;
}
.duel .side { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.duel .side b { font-weight: 600; font-size: 15px; line-height: 1.2; }
.duel .vs { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 20px; }
.duel-bar {
  grid-column: 1 / -1; display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--paper-2);
  position: relative; margin-top: 6px;
}
.duel-bar i { display: block; height: 100%; transition: width .45s var(--ease); }
.duel-bar::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1.5px; background: var(--ink); opacity: .5; }
.duel-nums { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 22px; font-weight: 600; letter-spacing: -0.03em; }

.transfer {
  padding: 14px 14px 10px; border-radius: 12px; background: var(--card); border: 1px solid var(--line);
}
.transfer + .transfer { margin-top: 8px; }
.transfer-head { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; margin-bottom: 10px; }
.transfer-head b { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.transfer-head > div > span { font-size: 12px; color: var(--muted); display: block; }
.transfer-head .share { font-size: 14px; color: var(--muted); }
.split {
  display: flex; height: 26px; border-radius: 8px; overflow: hidden; background: var(--paper-2);
  font-size: 12px; font-weight: 600; color: #fff;
}
.split i { display: flex; align-items: center; justify-content: center; font-style: normal; transition: width .3s var(--ease); white-space: nowrap; overflow: hidden; }
.split i.abst { color: var(--muted); background: repeating-linear-gradient(135deg, var(--paper-2) 0 6px, var(--line) 6px 7px); }
.ctrl { display: grid; grid-template-columns: 1fr; gap: 2px; margin-top: 8px; }
.ctrl label { font-size: 12.5px; color: var(--muted); display: flex; justify-content: space-between; }
.ctrl label output { color: var(--ink-2); font-weight: 600; }

.more-btn {
  width: 100%; margin-top: 10px; min-height: 44px; border-radius: 12px;
  border: 1px dashed var(--line-2); background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 600;
}

/* Barre d'action fixe en bas (mobile) */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--paper) 30%);
  display: none;
}
.dock.show { display: block; }
.dock-inner { max-width: 640px; margin: 0 auto; display: flex; gap: 10px; }
.dock .btn { flex: 1; }

/* ------------------------------------------------------------------ Résultat */

.result { max-width: 760px; margin: 0 auto; padding: 18px 16px 60px; }
.result-kicker { font-size: 13px; color: var(--muted); margin: 6px 0 10px; }
.result h2 {
  font-family: var(--serif); font-weight: 400; letter-spacing: -0.025em;
  font-size: clamp(36px, 9vw, 64px); line-height: 1.02; margin: 0 0 22px;
}
.result h2 em { font-style: italic; }

.final {
  border-radius: 20px; background: var(--card); border: 1px solid var(--line);
  padding: 22px 18px 18px; box-shadow: var(--shadow);
}
.final-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.final-side { display: flex; flex-direction: column; gap: 6px; }
.final-side.r { align-items: flex-end; text-align: right; }
.final-side .pct { font-size: clamp(46px, 13vw, 84px); font-weight: 600; letter-spacing: -0.05em; line-height: .95; }
.final-side .pct small { font-size: .42em; color: var(--muted); letter-spacing: -0.02em; font-weight: 500; }
.final-side .nm { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.final-side.r .nm { flex-direction: row-reverse; }
.final-side .winner-tag {
  align-self: flex-start;
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 99px; background: var(--ink); color: var(--paper);
  opacity: 0; transform: scale(.6); transition: opacity .3s, transform .5s var(--spring);
}
.final-side.r .winner-tag { align-self: flex-end; }
.final-side.won .winner-tag { opacity: 1; transform: none; }
.final-bar { position: relative; display: flex; height: 16px; border-radius: 99px; overflow: hidden; margin: 18px 0 10px; background: var(--paper-2); }
.final-bar i { display: block; height: 100%; width: 50%; transition: width 1.6s var(--ease); }
.final-bar::after { content: ""; position: absolute; left: 50%; top: -4px; bottom: -4px; width: 2px; background: var(--ink); }
.final-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); gap: 12px; flex-wrap: wrap; }

.blocks { display: grid; gap: 12px; margin-top: 12px; }
@media (min-width: 720px) { .blocks { grid-template-columns: 1fr 1fr; } }
.block { border-radius: 16px; background: var(--card); border: 1px solid var(--line); padding: 18px; }
.block h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin: 0 0 14px; }
.bars { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; font-size: 14px; }
.bar-row .lbl { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bar-row .lbl span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .v { font-weight: 600; }
.bar-row .track { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--paper-2); overflow: hidden; }
.bar-row .track i { display: block; height: 100%; width: 0; border-radius: inherit; transition: width 1.1s var(--ease); }
.bar-row.out .lbl, .bar-row.out .v { color: var(--muted); }
.cut { border-top: 1px dashed var(--line-2); margin: 4px 0; position: relative; }
.cut span { position: absolute; right: 0; top: -9px; background: var(--card); padding-left: 6px; font-size: 11px; color: var(--muted); }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.facts > div { background: var(--card); padding: 12px; }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { margin: 2px 0 0; font-weight: 600; font-size: 18px; letter-spacing: -0.02em; }

.share-row { display: grid; gap: 10px; margin-top: 18px; }
@media (min-width: 560px) { .share-row { grid-template-columns: 1fr 1fr; } }

.crowd .empty { color: var(--muted); font-size: 14px; margin: 0; }
.crowd .disclaimer { font-size: 12px; color: var(--muted); margin: 12px 0 0; display: flex; gap: 8px; }
.crowd .disclaimer svg { flex: none; width: 14px; height: 14px; margin-top: 2px; }

.again { text-align: center; margin-top: 26px; }
.linklike { background: none; border: 0; padding: 6px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }

.shared-banner {
  display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  font-size: 14px; margin-bottom: 16px;
}

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0;
  padding: 11px 16px; border-radius: 12px; background: var(--ink); color: var(--paper);
  font-size: 14px; font-weight: 500; box-shadow: var(--shadow);
  transition: opacity .25s, transform .4s var(--spring); pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Confettis discrets : simples traits */
.burst { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.burst i {
  position: absolute; width: 3px; height: 14px; border-radius: 2px; top: -20px;
  animation: drop 1.6s var(--ease) forwards;
}
@keyframes drop {
  to { transform: translateY(105vh) rotate(var(--r)); opacity: .2; }
}

/* ------------------------------------------------------------------ Méthode */

.doc { max-width: 680px; margin: 0 auto; padding: 24px 16px 40px; }
.doc h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(38px, 9vw, 60px); letter-spacing: -0.025em; line-height: 1.02; margin: 12px 0 18px; }
.doc h2 { font-size: 20px; letter-spacing: -0.02em; margin: 38px 0 10px; }
.doc p, .doc li { color: var(--ink-2); font-size: 16px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 10px 0; }
.doc th, .doc td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.doc td.num { text-align: right; }
.doc .src { font-size: 13px; color: var(--muted); word-break: break-word; }
.doc .callout { padding: 14px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); margin: 16px 0; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Emplacements publicitaires réservés (désactivés en V1) */
.ad-rail { display: none; }

/* ==========================================================================
   V2 — portraits, primaire, spectre, podium, graphique, fiches, dépouillement
   ========================================================================== */

::selection { background: color-mix(in srgb, var(--red) 30%, transparent); }
.mark-red { position: relative; white-space: nowrap; }
.mark-red::after {
  content: ""; position: absolute; left: -2%; right: -2%; bottom: .06em; height: .12em;
  background: var(--red); border-radius: 99px; transform-origin: left; transform: scaleX(0);
  animation: underline .7s .75s var(--ease) forwards;
}
@keyframes underline { to { transform: scaleX(1); } }
.eyebrow .dot { background: var(--red); }

/* Portraits noir et blanc */
.face {
  --c: var(--line-2);
  position: relative; flex: none; display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  background: var(--paper-2); color: var(--ink-2);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.face img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.06) brightness(1.03); display: block; }
.face .ini { font-weight: 700; font-size: 13px; letter-spacing: -0.02em; color: var(--muted); }
.face.ring { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--c); }
.face.xs { width: 22px; height: 22px; margin-right: 6px; vertical-align: -6px; }
.face.xs .ini { font-size: 8px; }
.face.sm { width: 32px; height: 32px; }
.face.sm .ini { font-size: 11px; }
.face.md { width: 48px; height: 48px; }
.face.lg { width: 60px; height: 60px; }
.face.xl { width: 84px; height: 84px; }
.face.hero { width: 168px; height: 168px; }
.face.hero.ring { box-shadow: 0 0 0 4px var(--paper), 0 0 0 8px var(--c); }

.hero-faces { display: flex; flex-wrap: wrap; row-gap: 6px; margin: 0 0 26px; padding-left: 8px; opacity: 0; animation: fade .8s .55s var(--ease) forwards; }
.hero-faces > span { margin-left: -8px; animation: pop .6s calc(.6s + var(--i) * 40ms) var(--spring) both; }
.hero-faces .face { box-shadow: 0 0 0 2px var(--paper); }
@keyframes pop { from { transform: translateY(10px) scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
.hero .cta-note { margin: 14px 0 0; }
.silence { margin-top: 18px; padding: 14px 16px; border-radius: 12px; background: var(--card); border: 1px solid var(--red); font-weight: 600; }

/* Primaire */
.options.two { grid-template-columns: 1fr 1fr; }
@media (max-width: 420px) { .options.two { grid-template-columns: 1fr; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 5px 14px 5px 5px;
  border-radius: 99px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: 15px;
  transition: border-color .2s, background .2s, transform .25s var(--spring);
}
.chip:active { transform: scale(.96); }
.chip[aria-pressed="false"] .face { filter: opacity(.55); }
.chip[aria-pressed="false"] { color: var(--muted); }
.chip[aria-pressed="true"] { border-color: var(--blue); background: var(--accent-soft); }
.options.faces { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.option.face-opt { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 18px 12px 14px; gap: 8px; }
.option.face-opt .check { position: absolute; top: 10px; right: 10px; }
.option.face-opt .d { margin: 0; }

/* Spectre et grille des candidats */
.spectrum { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); margin: -6px 0 12px; text-transform: uppercase; letter-spacing: .08em; }
.spectrum i { flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #16244a, #1c66d6, #4fb3de, #f0a000, #d2457a, #c8372d); opacity: .6; }
.cand-grid { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .cand-grid { grid-template-columns: repeat(3, 1fr); } }
.cand-grid .cand-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  padding: 16px 10px 14px; min-height: 0; border-radius: var(--radius);
  background: var(--card); border: 1.5px solid var(--line); box-shadow: 0 2px 0 var(--line);
  opacity: 1; filter: none; transition: border-color .2s, transform .25s var(--spring), box-shadow .2s;
}
.cand-tile .tile-hit { position: absolute; inset: 0; border: 0; background: transparent; border-radius: inherit; z-index: 1; }
.cand-tile:active { transform: translateY(2px); box-shadow: none; }
.cand-tile[data-on="true"] { border-color: var(--line-2); }
.cand-tile[data-on="false"] { border-style: dashed; box-shadow: none; }
.cand-tile[data-on="false"] .face { opacity: .45; }
.cand-tile[data-on="false"] .name { color: var(--muted); }
.cand-tile[data-lock] { opacity: .75; }
.cand-tile .face { margin-top: 4px; }
.cand-tile .name { font-weight: 600; font-size: 15px; line-height: 1.2; }
.cand-tile .party { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.cand-tile .state { position: static; order: -1; align-self: flex-start; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; background: var(--paper-2); color: var(--muted); }
.cand-tile[data-on="true"] .state { background: var(--ink); color: var(--paper); }
.info-btn {
  position: absolute; top: 6px; right: 6px; z-index: 2; width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center; border: 0; background: transparent; color: var(--muted);
}
.info-btn:hover { background: var(--paper-2); color: var(--ink); }
.info-btn svg { width: 18px; height: 18px; }
.more-btn { display: flex; align-items: center; justify-content: center; gap: 8px; }
.more-btn svg { width: 16px; height: 16px; transition: transform .25s var(--ease); }
.more-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.others { margin-top: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.other-row { display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.other-main { text-align: left; border: 0; background: none; padding: 4px 0; min-width: 0; }
.other-main b { display: block; font-weight: 600; font-size: 15px; }
.other-main span { display: block; font-size: 12.5px; color: var(--muted); }
.switch { width: 46px; height: 28px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--paper-2); padding: 2px; position: relative; transition: background .2s; }
.switch i { display: block; width: 22px; height: 22px; border-radius: 50%; background: var(--card); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .3s var(--spring); }
.switch[aria-checked="true"] { background: var(--blue); border-color: var(--blue); }
.switch[aria-checked="true"] i { transform: translateX(18px); }
.src-note { font-size: 12px; color: var(--muted); margin: 0; padding: 10px 12px; }

/* Participation : repères */
.ticks { position: relative; height: 18px; margin-top: 2px; }
.ticks span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.ticks span::before { content: ""; position: absolute; left: 50%; top: -9px; width: 1px; height: 7px; background: var(--line-2); }

/* Graphique */
.chart-card { margin: 0 0 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.chart-card summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-weight: 600; font-size: 14px; }
.chart-card summary::-webkit-details-marker { display: none; }
.chart-card summary svg { width: 16px; height: 16px; transform: rotate(-90deg); transition: transform .25s var(--ease); }
.chart-card[open] summary svg { transform: none; }
#chartHost { padding: 0 6px; }
.chart { width: 100%; height: auto; display: block; font-family: var(--sans); }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .mark { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 4; opacity: .5; }
.chart .mark.soft { stroke: var(--red); opacity: .7; }
.chart .ax { font-size: 10.5px; fill: var(--muted); }
.chart .ax.strong { fill: var(--ink-2); font-weight: 600; }
.chart .lbl { font-size: 11px; font-weight: 700; }
.chart-note { font-size: 12px; color: var(--muted); margin: 0; padding: 4px 14px 12px; }
.spark { display: block; width: 160px; height: 40px; margin-top: 6px; }

/* Podium */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; align-items: end; gap: 8px; margin: 4px 0 14px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; animation: pop .5s var(--spring) both; }
.pod.empty .face { opacity: .35; border: 1.5px dashed var(--line-2); background: transparent; box-shadow: none; }
.pod-name { font-weight: 600; font-size: 14px; }
.pod-val { font-size: 13px; color: var(--muted); }
.step-block { width: 100%; display: grid; place-items: center; border-radius: 10px 10px 4px 4px; background: var(--paper-2); border: 1px solid var(--line); font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--muted); }
.p1 .step-block { height: 64px; background: var(--ink); color: var(--paper); border-color: var(--ink); }
.p1:not(.empty) .step-block { box-shadow: inset 0 -4px 0 var(--red); }
.p2 .step-block { height: 46px; }
.p3 .step-block { height: 32px; }

/* Lignes du premier tour */
.rows .row { grid-template-columns: 26px 32px 1fr auto; padding: 12px 12px 6px; transition: border-color .2s, opacity .25s, background .25s, transform .5s var(--spring); }
.rows .row input[type="range"] { grid-column: 1 / -1; }
.rank { font-family: var(--serif); font-style: italic; font-size: 22px; color: var(--muted); text-align: center; }
.row.qualif .rank { color: var(--blue); }
.row.pending { opacity: .5; }
.row.pending output { color: var(--muted); }
.row.active { border-color: var(--blue); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); opacity: 1; }
.row .who .nm { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.row .who .nm b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 15px; }
.row .who .sub { display: block; font-size: 12px; color: var(--muted); }
.row .q { color: var(--blue); font-weight: 600; }
.row .you { color: var(--red); font-weight: 700; }
.row.locked input[type="range"] { opacity: .4; }
.row.locked output { color: var(--muted); }
.lock { width: 36px; height: 36px; border: 1px solid var(--line); }
.tour1-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; }
.total-bar { top: 112px; }

/* Curseurs : piste bicolore et poignée plus grande */
input[type="range"] { height: 40px; }
input[type="range"]::-webkit-slider-runnable-track { background: linear-gradient(to right, var(--track) var(--fill), var(--track2, var(--paper-2)) var(--fill)); }
input[type="range"]::-moz-range-track { background: var(--track2, var(--paper-2)); }
input[type="range"]::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -12px; }
input[type="range"]::-moz-range-thumb { width: 28px; height: 28px; }
input[type="range"]:focus-visible::-moz-range-thumb { border-color: var(--accent); box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--accent); }
input[type="range"]:focus-visible::-webkit-slider-thumb { border-color: var(--accent); box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--accent); }
input[type="range"]:disabled { cursor: not-allowed; }
.ends { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }

/* Second tour sans résultat */
.duel { grid-template-columns: 1fr auto 1fr; }
.transfer-head > div > span { font-size: 12px; color: var(--muted); display: block; }

/* Dépouillement */
.count { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 20px 0; }
.count-k { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--red); margin: 0; }
.count-pct { font-size: clamp(64px, 20vw, 120px); font-weight: 600; letter-spacing: -0.05em; line-height: .9; margin: 0; }
.count-pct small { font-size: 18px; letter-spacing: 0; font-weight: 500; color: var(--muted); }
.count-bar { height: 8px; border-radius: 99px; background: var(--paper-2); overflow: hidden; border: 1px solid var(--line); }
.count-bar i { display: block; height: 100%; width: 0; background: var(--ink); }
.count-rows { display: grid; gap: 10px; margin-top: 8px; }
.count-row { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.cr-main b { display: block; font-weight: 600; }
.cr-votes { font-size: 13px; color: var(--muted); }
.cr-pct { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; }
.count .linklike { align-self: center; }

.reveal-hero { text-align: center; padding-top: 10px; }
.reveal-hero.in .hero-face { animation: heroIn .9s var(--spring) both; }
.reveal-hero.in h2, .reveal-hero.in .hero-k { animation: fadeUp .7s .25s var(--ease) both; }
.reveal-hero.in .final, .reveal-hero.in .share-row { animation: fadeUp .7s .45s var(--ease) both; }
@keyframes heroIn { from { transform: scale(.6); opacity: 0; filter: blur(6px); } to { transform: none; opacity: 1; filter: none; } }
@keyframes fadeUp { from { transform: translateY(18px); opacity: 0; } to { transform: none; opacity: 1; } }
.hero-face { display: flex; justify-content: center; margin: 8px 0 18px; }
.hero-k { font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.reveal-hero h2 { text-align: center; }
.final { text-align: left; }
.final-side .face { margin-bottom: 4px; }
.final-side.r .face { align-self: flex-end; }
.final-side .winner-tag { opacity: 1; transform: none; background: var(--red); color: #fff; }
.details { margin-top: 18px; }
.details .block { margin-top: 12px; }
.details .reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.details .reveal.in { opacity: 1; transform: none; }
.bar-row .v small { font-size: 11px; font-weight: 600; margin-left: 4px; }
.bar-row .v small.up { color: var(--good); }
.bar-row .v small.down { color: var(--red); }
.note { font-size: 12.5px; color: var(--muted); margin: 12px 0 0; display: flex; gap: 8px; }
.note svg { flex: none; width: 14px; height: 14px; margin-top: 2px; }
.muted { color: var(--muted); }
.tr-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tr-table th, .tr-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.tr-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.tr-table .num { text-align: right; }
.legal { font-size: 12.5px; color: var(--muted); margin: 18px 0 0; }
.burst i { width: 4px; height: 16px; }

/* Volet fiche */
.sheet { width: min(560px, 100vw); max-height: 88vh; margin: auto auto 0; padding: 0; border: 0; border-radius: 22px 22px 0 0; background: var(--card); color: var(--ink); box-shadow: 0 -10px 40px rgba(0,0,0,.25); }
@media (min-width: 700px) { .sheet { margin: auto; border-radius: 22px; } }
.sheet::backdrop { background: rgba(10,10,8,.45); backdrop-filter: blur(3px); }
.sheet[open] { animation: sheetIn .45s var(--spring); }
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-close { position: sticky; top: 10px; float: right; margin: 10px 10px 0 0; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); font-size: 22px; line-height: 1; z-index: 2; }
.sheet-body { padding: 22px 20px 26px; }
.sheet-more { margin: 18px 0 0; font-weight: 600; }
.fiche-head { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.fiche-party { margin: 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.fiche-name { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.05; letter-spacing: -0.02em; margin: 2px 0 0; }
.fiche-bio { font-size: 16px; color: var(--ink-2); margin: 0 0 14px; }
.fiche-facts { display: grid; gap: 1px; margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.fiche-facts > div { background: var(--card); padding: 12px 14px; }
.fiche-facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.fiche-facts dd { margin: 0; font-size: 15px; }
.fiche-facts .big { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; }
.fiche-facts .links { display: flex; flex-wrap: wrap; gap: 8px; }
.fiche-facts .links a { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 14px; }
.credit { font-size: 11.5px; color: var(--muted); margin: 12px 0 0; }

/* Page candidats */
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .gallery { grid-template-columns: repeat(4, 1fr); } }
.g-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-decoration: none; text-align: center; transition: transform .25s var(--spring), border-color .2s; }
.g-card:hover { transform: translateY(-2px); border-color: var(--line-2); }
.g-card b { font-weight: 600; }
.g-card span { font-size: 12.5px; color: var(--muted); }
.g-list { list-style: none; padding: 0; margin: 10px 0 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.g-list a { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); text-decoration: none; }
.g-list b { display: block; font-weight: 600; font-size: 15px; }
.g-list span { display: block; font-size: 12.5px; color: var(--muted); }
.back-link { display: inline-block; margin: 10px 0 0; font-weight: 600; text-decoration: none; color: var(--muted); }

.progress.hidden { visibility: hidden; height: 12px; padding: 0; }
.back-btn, .icon-btn { width: 40px; height: 40px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-iteration-count: 1 !important; animation-delay: 0s !important; scroll-behavior: auto !important; }
  .eyebrow .dot { animation: none; }
  .reveal, .details .reveal { opacity: 1; transform: none; }
}

[hidden] { display: none !important; }
.tr-table td .muted { white-space: nowrap; font-size: 12px; }
.facts dd small { display: block; font-size: 12px; font-weight: 500; letter-spacing: 0; margin-top: 2px; }
.fiche .fiche-name { font-family: var(--serif); font-weight: 400; font-size: 34px; line-height: 1.05; letter-spacing: -0.02em; margin: 2px 0 0; }
.doc .fiche { margin-top: 14px; }


/* ==========================================================================
   V3 — bordeaux, aiguille, graphique intégré, fiches colorées, illustration
   ========================================================================== */
.wordmark .yr { color: var(--red); }
.hero h1 em { color: var(--red); }
.mark-red::after { background: var(--blue); }
.step-kicker, .section-label, .count-k { color: var(--red); }
.progress-fill { background: var(--red); }
.rank { color: var(--red); opacity: .55; }
.row.qualif .rank { color: var(--red); opacity: 1; }
.row .q { color: var(--red); }
.how .n { color: var(--red); }
.p1 .step-block { background: var(--red); border-color: var(--red); color: #fff; box-shadow: none; }
.total-bar .ok { color: var(--red); }
.btn-express { background: var(--red); color: #fff; box-shadow: 0 6px 18px -8px rgba(122, 30, 46, .6); }
.btn-express:hover { filter: brightness(1.08); }
.option[aria-checked="true"] .check { background: var(--red); border-color: var(--red); }
.option[aria-checked="true"] { border-color: var(--red); background: var(--red-soft); box-shadow: 0 2px 0 color-mix(in srgb, var(--red) 55%, transparent); }
.chip[aria-pressed="true"] { border-color: var(--red); background: var(--red-soft); }
footer.site { border-top: 2px solid var(--red); }
.topbar.scrolled { border-bottom-color: color-mix(in srgb, var(--red) 35%, var(--line)); }

/* Hero avec illustration */
.hero-grid { display: grid; gap: 8px; }
.hero-art { width: 100%; max-width: 420px; justify-self: center; margin: 4px 0 10px; color: var(--ink); opacity: 0; animation: fade 1.2s .4s var(--ease) forwards; }
.hero-art svg { width: 100%; height: auto; display: block; }
@media (min-width: 900px) {
  .hero { max-width: 1080px; }
  .hero-grid { grid-template-columns: 1.1fr .9fr; align-items: center; gap: 40px; }
  .hero-art { max-width: 460px; margin: 0; }
}

/* Candidats (étape 2) : couleur du candidat */
.cand-grid .cand-tile[data-on="true"] { border-color: color-mix(in srgb, var(--cc) 55%, var(--line)); box-shadow: 0 2px 0 color-mix(in srgb, var(--cc) 45%, var(--line)); }
.cand-tile[data-on="true"] .state { background: var(--cc); color: #fff; }
.cand-tile.joke { background: radial-gradient(circle at 30% 20%, rgba(123, 77, 255, .14), transparent 60%), var(--card); }

/* Premier tour : saisie au clavier */
.row .val { gap: 2px; }
.numin {
  width: 66px; height: 40px; padding: 0 6px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper);
  font-size: 20px; font-weight: 600; letter-spacing: -0.03em; text-align: right; -moz-appearance: textfield;
}
.numin::-webkit-outer-spin-button, .numin::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.numin:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.numin:disabled { opacity: .5; }
.row .pc { font-size: 15px; color: var(--muted); margin-right: 6px; }
.row.pending .numin { background: transparent; }
.row.active { border-color: var(--red); background: var(--red-soft); box-shadow: 0 0 0 3px var(--red-soft); }

/* Graphique intégré dans la liste */
.rows .chart-card { margin: 4px 0 2px; padding: 10px 6px 4px; animation: fadeUp .45s var(--ease); }
.chart-title { margin: 0 8px 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.chart-title b { font-weight: 700; }

/* Reports : étiquettes toujours visibles */
.split { position: relative; overflow: visible; }
.split i:first-child { border-radius: 8px 0 0 8px; }
.split i:nth-child(3) { border-radius: 0 8px 8px 0; }
.split .sl { position: absolute; top: 50%; transform: translateY(-50%); font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; pointer-events: none; }
.split .sl[data-l="a"] { left: 8px; }
.split .sl[data-l="b"] { right: 8px; }
.split .sl[data-l="n"] { transform: translate(-50%, -50%); color: var(--ink-2); text-shadow: none; }
.split .sl.narrow { color: var(--ink); text-shadow: none; background: var(--card); padding: 1px 5px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.split .sl[data-l="a"].narrow { left: -2px; }
.split .sl[data-l="b"].narrow { right: -2px; }

/* Aiguille du dépouillement */
.count { gap: 12px; }
.needle-faces { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.needle-faces .vs { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 20px; }
.needle-nums { display: flex; justify-content: space-between; font-size: clamp(40px, 13vw, 72px); font-weight: 600; letter-spacing: -0.05em; line-height: 1; }
.needle-names { display: flex; justify-content: space-between; font-weight: 600; color: var(--muted); margin-top: -4px; }
.gauge { position: relative; display: flex; height: 22px; border-radius: 99px; overflow: visible; background: var(--paper-2); margin: 10px 0 4px; }
.gauge i { display: block; height: 100%; }
.gauge .ga { border-radius: 99px 0 0 99px; width: 50%; }
.gauge .gb { border-radius: 0 99px 99px 0; width: 50%; }
.gauge .mid { position: absolute; left: 50%; top: -8px; bottom: -8px; width: 2px; background: var(--ink); opacity: .35; }
.needle { position: absolute; left: 50%; top: -14px; bottom: -14px; width: 4px; margin-left: -2px; border-radius: 4px; background: var(--red); box-shadow: 0 0 0 3px var(--paper); }
.needle::before { content: ""; position: absolute; top: -8px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px var(--paper); }
.count-sub { color: var(--muted); font-size: 14px; margin: 6px 0 0; text-align: center; }

/* Révélation plus lente */
.reveal-hero.in .hero-face { animation-duration: 1.3s; }
.reveal-hero.in h2, .reveal-hero.in .hero-k { animation: fadeUp 1s .6s var(--ease) both; }
.reveal-hero.in .final { animation: fadeUp 1s 1.1s var(--ease) both; }
.reveal-hero.in .share-row { animation: fadeUp 1s 1.6s var(--ease) both; }
.details .reveal { transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); transform: translateY(40px); }
.burst i { animation-duration: 2.4s; }

/* Fiches aux couleurs du candidat */
.fiche { --cc: var(--ink); }
.fiche-hero {
  display: flex; align-items: center; gap: 16px; padding: 18px; margin: 0 0 16px; border-radius: 18px; color: #fff;
  background: linear-gradient(135deg, var(--cc), color-mix(in srgb, var(--cc) 70%, #000));
}
.fiche-hero .face.ring { box-shadow: 0 0 0 3px rgba(255,255,255,.9); }
.fiche-hero .fiche-party { color: rgba(255,255,255,.85); }
.fiche .fiche-hero .fiche-name { color: #fff; }
.fiche-poll { margin: 6px 0 0; font-size: 14px; color: rgba(255,255,255,.9); }
.fiche-poll b { font-size: 18px; }
.fiche-sec { padding: 14px 0; border-top: 1px solid var(--line); }
.fiche-sec h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--cc); margin: 0 0 10px; font-weight: 700; }
.fiche-text { margin: 0; color: var(--ink-2); }
.measures { list-style: none; margin: 0; padding: 0; counter-reset: m; display: grid; gap: 8px; }
.measures li { counter-increment: m; position: relative; padding: 10px 12px 10px 46px; border-radius: 12px; background: color-mix(in srgb, var(--cc) 8%, var(--card)); border: 1px solid color-mix(in srgb, var(--cc) 22%, var(--line)); }
.measures li::before { content: counter(m); position: absolute; left: 12px; top: 8px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--cc); color: #fff; font-weight: 700; font-size: 13px; }
.prog-link { font-weight: 600; color: var(--cc); }
.fiche .links { display: flex; flex-wrap: wrap; gap: 8px; }
.fiche .links a { padding: 7px 11px; border-radius: 9px; border: 1.5px solid var(--cc); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.fiche .spark { width: 100%; max-width: 360px; height: 60px; }

/* Page candidats : spectre chronologique */
.timeline { position: relative; margin: 18px -16px 26px; padding: 0 16px 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tl-track { position: relative; display: flex; gap: 6px; min-width: 760px; padding: 26px 0 0; }
.tl-line { position: absolute; left: 30px; right: 30px; top: 58px; height: 4px; border-radius: 4px; }
.tl-item { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; text-align: center; }
.tl-item .face { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--c); }
.tl-item span { font-size: 12px; font-weight: 600; line-height: 1.15; }
.tl-ends { display: flex; justify-content: space-between; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); min-width: 760px; margin-top: 8px; }
.gallery .g-card { border-top: 4px solid var(--cc); }
.gallery .g-card .measure-peek { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }
.durif-card { display: flex; align-items: center; gap: 14px; margin-top: 18px; padding: 16px; border-radius: 16px; text-decoration: none; color: #fff; background: radial-gradient(circle at 80% 20%, #7b4dff, transparent 55%), radial-gradient(circle at 10% 90%, #ff4dd8, transparent 50%), #0b0820; }
.durif-card b { font-family: var(--serif); font-size: 22px; font-weight: 400; }
.durif-card span { display: block; font-size: 13px; opacity: .8; }
.face img { position: absolute; inset: 0; }
.step-title:focus { outline: none; }

/* V4 */
.option[aria-checked="true"] { border-color: var(--blue); background: var(--accent-soft); box-shadow: 0 2px 0 color-mix(in srgb, var(--blue) 55%, transparent); }
.option[aria-checked="true"] .check { background: var(--blue); border-color: var(--blue); }
.chip[aria-pressed="true"] { border-color: var(--blue); background: var(--accent-soft); }
.switch[aria-checked="true"] { background: var(--blue); border-color: var(--blue); }
.split .sl { text-shadow: none; }
.tl-line { background: var(--line-2); }
.gallery .g-card { border-top: 1px solid var(--line); }
.gauge .mid { display: none; }
.needle, .needle::before { box-shadow: none; }
.final-bar::after, .duel-bar::after { display: none; }
.face.hero.ring { box-shadow: 0 0 0 5px var(--paper), 0 0 0 9px var(--c), 0 0 60px 14px color-mix(in srgb, var(--c) 55%, transparent), 0 0 140px 40px color-mix(in srgb, var(--c) 25%, transparent); }
.hero-face { margin: 30px 0 34px; }
/* Illustration : sans cadre, fondue derrière le texte */
.hero { position: relative; }
.hero-art { -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent), linear-gradient(to left, #000 60%, transparent); -webkit-mask-composite: source-in; mask-image: linear-gradient(to bottom, #000 55%, transparent), linear-gradient(to left, #000 60%, transparent); mask-composite: intersect; }
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-text { position: relative; z-index: 1; max-width: 560px; }
  .hero-art { position: absolute; right: -40px; top: 0; width: 640px; max-width: none; z-index: 0; opacity: .9; }
}
/* V5 : bleu principal, résultat sans carte, double auréole */
.progress-fill, .p1 .step-block { background: var(--blue); border-color: var(--blue); }
.row.active { border-color: var(--blue); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.row.qualif .rank, .row .q, .total-bar .ok { color: var(--blue); }
.numin:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--accent-soft); }
.final { background: none; border: 0; box-shadow: none; padding: 8px 0 0; }
.hero-face { position: relative; width: 168px; height: 168px; margin: 70px auto 30px; }
.hero-face::before, .hero-face::after { content: ""; position: absolute; left: 50%; border-radius: 50%; border: 3px solid var(--c, var(--blue)); transform: translateX(-50%); }
.hero-face::before { width: 200px; height: 200px; top: -40px; opacity: .9; }
.hero-face::after { width: 236px; height: 236px; top: -74px; opacity: .45; }
.face.hero.ring { box-shadow: 0 0 60px 10px color-mix(in srgb, var(--c) 40%, transparent); }
.hero-art svg { transform: perspective(900px) rotateX(24deg); transform-origin: 50% 100%; }

/* V6 : bleu principal, rouge en touches ; double cercle */
.wordmark .yr, .hero h1 em { color: var(--blue); }
.mark-red::after { background: var(--red); }
.btn-express { background: var(--blue); box-shadow: 0 6px 18px -8px rgba(23, 48, 154, .6); }
.hero-face { position: relative; width: 168px; height: 168px; margin: 100px auto 30px; z-index: 0; }
.hero-face::after { display: none; }
.hero-face::before { width: 168px; height: 168px; top: -84px; border-width: 4px; opacity: 1; z-index: -1; }
.face.hero.ring { box-shadow: 0 0 0 5px var(--paper); position: relative; z-index: 1; }
.hero-art svg { transform: none; }
.rows .chart-card { animation: none; }
.rows .chart-card.pop { animation: fadeUp .4s var(--ease); }

/* V7 : auréole un peu plus grande et plus basse ; jauge sans aiguille */
.hero-face::before { width: 190px; height: 190px; top: -66px; }
.gauge { height: 26px; }
.gauge .ga, .gauge .gb { transition: none; }
