/* L'habit ne fait pas le moine — feuille de style
   Identité : l'hémicycle. Un fond gris-bleu de carte d'électeur, une encre bleu nuit,
   et un spectre de cinq couleurs, du rouge profond au bleu nuit, qui porte tout le jeu. */

:root {
  color-scheme: light;
  --ground: #E7EAF1;
  --surface: #F7F8FB;
  --surface-2: #EEF1F6;
  --ink: #161B2E;
  --ink-soft: #3C4660;
  --muted: #6B7590;
  --line: #C6CDDA;
  --line-strong: #9AA4B8;
  --shadow: #161B2E;
  --p1: #A3122D;
  --p2: #DE5A7B;
  --p3: #D79A2B;
  --p4: #2F63C4;
  --p5: #1D2B5E;
  --ok: #2E7D4F;
  --warn: #B9741A;
  --bad: #B3261E;
  --focus: #2F63C4;
  --radius: 4px;
  --font-display: "Bricolage Grotesque", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #10131C;
    --surface: #181C28;
    --surface-2: #1F2434;
    --ink: #EDEFF5;
    --ink-soft: #C3C9D8;
    --muted: #8E97AD;
    --line: #2C3345;
    --line-strong: #46506A;
    --shadow: #05070D;
    --p1: #D23B57;
    --p2: #F07A98;
    --p3: #E8B04A;
    --p4: #5A8AE6;
    --p5: #5168C2;
    --ok: #5BB582;
    --warn: #E0A04A;
    --bad: #E0574D;
    --focus: #8FB0F5;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #10131C;
  --surface: #181C28;
  --surface-2: #1F2434;
  --ink: #EDEFF5;
  --ink-soft: #C3C9D8;
  --muted: #8E97AD;
  --line: #2C3345;
  --line-strong: #46506A;
  --shadow: #05070D;
  --p1: #D23B57;
  --p2: #F07A98;
  --p3: #E8B04A;
  --p4: #5A8AE6;
  --p5: #5168C2;
  --ok: #5BB582;
  --warn: #E0A04A;
  --bad: #E0574D;
  --focus: #8FB0F5;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
  padding-inline: clamp(16px, 4vw, 48px);
  padding-block: 0 48px;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.05; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
.eyebrow {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- masthead */
.masthead {
  max-width: 1180px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "brand score" "tag nav";
  column-gap: 32px;
  row-gap: 6px;
  align-items: end;
  padding-block: 28px 22px;
  border-bottom: 2px solid var(--ink);
}
.brand {
  grid-area: brand;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.7rem, 4.4vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 0.95;
  text-decoration: none;
}
.brand em { font-style: normal; font-weight: 300; }
.tagline { grid-area: tag; color: var(--ink-soft); max-width: 60ch; font-style: italic; }
.masthead nav { grid-area: nav; display: flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end; font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; }
.masthead nav a { text-decoration: none; border-bottom: 2px solid transparent; }
.masthead nav a:hover, .masthead nav a[aria-current="page"] { border-bottom-color: var(--ink); }
.scoreboard {
  grid-area: score;
  display: flex;
  gap: 0;
  border: 1.5px solid var(--ink);
  background: var(--surface);
  box-shadow: 4px 4px 0 var(--shadow);
}
.scoreboard > div { padding: 8px 14px; min-width: 86px; border-right: 1.5px solid var(--ink); }
.scoreboard > div:last-child { border-right: 0; }
.scoreboard .eyebrow { display: block; }
.scoreboard .val { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; line-height: 1.1; }

/* ---------------------------------------------------------------- stage */
main { max-width: 1180px; margin: 0 auto; }
.stage {
  display: grid;
  grid-template-columns: minmax(280px, 440px) 1fr;
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  padding-block: 36px 24px;
}
.dossier {
  margin: 0;
  background: var(--surface);
  border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 var(--shadow);
  padding: 14px;
  display: grid;
  gap: 10px;
}
.dossier-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.chip {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border: 1.5px solid var(--line-strong);
  color: var(--ink-soft);
  background: var(--surface-2);
  white-space: nowrap;
}
.portrait {
  position: relative;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  background: var(--surface-2);
  overflow: hidden;
  border: 1px solid var(--line);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; object-position: top center; filter: saturate(0.92); transition: opacity .25s ease; }
.portrait img.loading { opacity: 0; }
.portrait .ribbon {
  position: absolute; left: -36px; bottom: 26px;
  transform: rotate(-32deg);
  background: var(--ink); color: var(--ground);
  font-family: var(--font-display); font-weight: 700; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase;
  padding: 5px 48px;
  pointer-events: none;
}
.dossier figcaption { font-size: 0.86rem; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

.ask { display: grid; gap: 18px; }
.question { font-size: clamp(1.6rem, 3.2vw, 2.4rem); font-weight: 700; }
.question small { display: block; font-family: var(--font-body); font-weight: 400; font-size: 1.05rem; color: var(--ink-soft); margin-top: 8px; font-style: italic; }

.hemicycle { width: 100%; max-width: 640px; margin-inline: auto; }
.hemicycle svg { width: 100%; height: auto; display: block; overflow: visible; }
.seat { cursor: pointer; transition: transform .18s ease, filter .18s ease; transform-box: fill-box; transform-origin: center; }
.seat path { stroke: var(--ground); stroke-width: 4; }
.seat:hover, .seat:focus-visible { filter: brightness(1.08); transform: translateY(-4px); }
.seat:focus-visible { outline: none; }
.seat:focus-visible path { stroke: var(--ink); stroke-width: 3; }
.seat text { font-family: var(--font-display); font-weight: 700; fill: #fff; pointer-events: none; text-anchor: middle; }
.seat .lbl-small { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; opacity: .9; }
.seat .lbl { font-size: 17px; }
.hemicycle .legend-arc { fill: none; stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 5; }
.hemicycle .tribune { fill: var(--surface-2); stroke: var(--ink); stroke-width: 2; }
.hemicycle .tribune-txt { font-family: var(--font-display); font-weight: 800; font-size: 15px; letter-spacing: 0.18em; fill: var(--ink); text-anchor: middle; }
.hemicycle.answered .seat { cursor: default; pointer-events: none; }
.hemicycle.answered .seat:not(.is-truth):not(.is-guess) { opacity: .28; }
.hemicycle .seat.is-truth path { stroke: var(--ink); stroke-width: 4; }
.hemicycle .seat.is-guess path { stroke-dasharray: 10 6; stroke: var(--ink); stroke-width: 3; }

.keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.key {
  border: 1.5px solid var(--ink);
  background: var(--surface);
  padding: 10px 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.1;
  display: grid;
  gap: 4px;
  justify-items: center;
  box-shadow: 3px 3px 0 var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.key:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow); }
.key:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }
.key[disabled] { opacity: .45; cursor: default; transform: none; }
.key .k { font-size: 0.7rem; color: var(--muted); font-weight: 600; letter-spacing: 0.1em; }
.key .dot { width: 10px; height: 10px; border-radius: 50%; }
.hint { color: var(--muted); font-size: 0.9rem; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.segmented { display: inline-flex; border: 1.5px solid var(--ink); background: var(--surface); }
.segmented button { border: 0; background: transparent; padding: 6px 12px; font-family: var(--font-display); font-weight: 600; font-size: 0.88rem; border-right: 1.5px solid var(--ink); }
.segmented button:last-child { border-right: 0; }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
.linkish { background: none; border: 0; padding: 0; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; color: var(--ink-soft); font-size: 0.95rem; }
.linkish:hover { text-decoration-color: currentColor; }

/* ---------------------------------------------------------------- reveal */
.reveal {
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  padding-block: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  background: linear-gradient(0deg, var(--surface) 0%, var(--surface) 100%);
  margin-inline: calc(-1 * clamp(16px, 4vw, 48px));
  padding-inline: clamp(16px, 4vw, 48px);
}
.reveal[hidden] { display: none; }
.verdict-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.stamp {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 14px;
  border: 3px solid currentColor;
  transform: rotate(-4deg);
  line-height: 1;
}
.stamp.exact { color: var(--ok); }
.stamp.presque { color: var(--warn); }
.stamp.rate { color: var(--bad); }
.points { font-family: var(--font-display); font-weight: 700; color: var(--ink-soft); }
.identity { display: grid; gap: 10px; margin-top: 18px; }
.identity h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); font-weight: 800; letter-spacing: -0.02em; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 0.9rem;
  color: #fff; padding: 5px 12px; border-radius: 999px; width: fit-content;
}
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px 18px; margin-top: 8px; }
.facts div { border-top: 1px solid var(--line); padding-top: 6px; }
.facts .eyebrow { display: block; margin-bottom: 2px; }
.nuance { color: var(--ink-soft); font-style: italic; }
.spectrum { margin-top: 18px; }
.spectrum .bar { display: grid; grid-template-columns: repeat(5, 1fr); height: 14px; border: 1.5px solid var(--ink); }
.spectrum .bar span { display: block; }
.spectrum .marks { position: relative; height: 34px; }
.spectrum .mark {
  position: absolute; top: 4px; transform: translateX(-50%);
  font-family: var(--font-display); font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  white-space: nowrap;
}
.spectrum .mark::before { content: ""; display: block; width: 0; height: 0; margin: 0 auto 2px; border: 6px solid transparent; border-bottom-color: currentColor; border-top: 0; }
.spectrum .mark.truth { color: var(--ink); }
.spectrum .mark.guess { color: var(--muted); top: 20px; }
.spectrum .mark.guess::before { display: none; }
.aside { display: grid; gap: 18px; align-content: start; }
.quip {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  font-weight: 600;
  line-height: 1.2;
  border-left: 4px solid var(--ink);
  padding-left: 16px;
}
.saviez { background: var(--surface-2); border: 1px solid var(--line); padding: 16px 18px; display: grid; gap: 8px; }
.saviez .src { font-size: 0.86rem; color: var(--muted); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.btn {
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--ground);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 12px 22px;
  box-shadow: 4px 4px 0 var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--shadow); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }
.btn.ghost { background: var(--surface); color: var(--ink); }
.fiche { font-size: 0.95rem; }

/* ---------------------------------------------------------------- texte / pages */
.prose { max-width: 68ch; display: grid; gap: 16px; }
.prose h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 800; margin-top: 12px; }
.prose h3 { font-size: 1.2rem; font-weight: 700; margin-top: 6px; }
.prose ul, .prose ol { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.prose .src { font-size: 0.9rem; color: var(--muted); }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); padding-block: 36px; }
.stats-panel { display: grid; gap: 14px; align-content: start; background: var(--surface); border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--shadow); padding: 20px; }
.stats-panel h2 { font-size: 1.4rem; font-weight: 800; }
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stats-grid div { border-top: 1px solid var(--line); padding-top: 6px; }
.stats-grid .eyebrow { display: block; margin-bottom: 2px; }
.stats-grid .val { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; line-height: 1; }
.bias { font-style: italic; color: var(--ink-soft); }
.legend { display: grid; gap: 6px; font-size: 0.95rem; }
.legend div { display: flex; align-items: center; gap: 10px; }
.legend i { width: 14px; height: 14px; display: inline-block; border: 1px solid var(--ink); }

footer {
  max-width: 1180px; margin: 40px auto 0;
  border-top: 1px solid var(--line-strong);
  padding-top: 18px;
  display: flex; flex-wrap: wrap; gap: 10px 28px;
  justify-content: space-between;
  color: var(--muted); font-size: 0.9rem;
}
footer nav { display: flex; gap: 18px; flex-wrap: wrap; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: var(--ground);
  font-family: var(--font-display); font-weight: 600;
  padding: 10px 16px; border-radius: 3px;
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.toast.show { opacity: 1; }
.loading-note { color: var(--muted); font-style: italic; padding-block: 24px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .masthead { grid-template-columns: 1fr; grid-template-areas: "brand" "tag" "score" "nav"; align-items: start; }
  .masthead nav { justify-content: flex-start; }
  .scoreboard { width: fit-content; }
  .stage, .reveal, .two-col { grid-template-columns: 1fr; }
  .dossier { max-width: 440px; }
  .keys { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .key { font-size: 0.72rem; padding: 8px 4px; }
}
@media (max-width: 480px) {
  .seat .lbl { font-size: 15px; }
  .seat .lbl-small { font-size: 11px; }
  .scoreboard > div { min-width: 70px; padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
