/* L'habit ne fait pas le moine — feuille de style, refonte du 25/10/2026.
   Une colonne, le portrait en héros, l'hémicycle comme console de vote.
   Identité : le spectre à cinq couleurs, du rouge profond au bleu nuit ; des gris bleutés
   (le fond des photos officielles) ; Bricolage Grotesque pour les titres, Public Sans pour le reste. */

:root {
  color-scheme: light;
  --ground: #EEF0F5;
  --surface: #FFFFFF;
  --surface-2: #F5F6FA;
  --ink: #141A2B;
  --ink-soft: #3B4459;
  --muted: #6A7389;
  --line: #DCE0EA;
  --line-strong: #B9C0D1;
  --accent: #2D4A8A;
  --p1: #A3122D; --p2: #DE5A7B; --p3: #D79A2B; --p4: #2F63C4; --p5: #1D2B5E;
  --ok: #2E7D4F; --warn: #B9741A; --bad: #B3261E;
  --focus: #2F63C4;
  --r: 14px;
  --shadow: 0 1px 2px rgb(20 26 43 / .06), 0 8px 24px -12px rgb(20 26 43 / .18);
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Public Sans", "Segoe UI", Roboto, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #0F1320; --surface: #171C2B; --surface-2: #1E2435;
    --ink: #ECEFF6; --ink-soft: #C2C8D8; --muted: #8F98B0;
    --line: #2A3146; --line-strong: #434C66; --accent: #8FB0F5;
    --p1: #D23B57; --p2: #F07A98; --p3: #E8B04A; --p4: #5A8AE6; --p5: #5168C2;
    --ok: #5BB582; --warn: #E0A04A; --bad: #E0574D; --focus: #8FB0F5;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 10px 30px -12px rgb(0 0 0 / .6);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0F1320; --surface: #171C2B; --surface-2: #1E2435;
  --ink: #ECEFF6; --ink-soft: #C2C8D8; --muted: #8F98B0;
  --line: #2A3146; --line-strong: #434C66; --accent: #8FB0F5;
  --p1: #D23B57; --p2: #F07A98; --p3: #E8B04A; --p4: #5A8AE6; --p5: #5168C2;
  --ok: #5BB582; --warn: #E0A04A; --bad: #E0574D; --focus: #8FB0F5;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 10px 30px -12px rgb(0 0 0 / .6);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--body); font-size: 1rem; line-height: 1.55;
  padding-inline: clamp(16px, 4vw, 32px); padding-block: 0 40px; 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: 2px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; text-wrap: balance; margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
.eyebrow, .k { font-family: var(--display); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.88rem; line-height: 1.5; }
.sep { color: var(--line-strong); }

/* ---------------------------------------------------------------- barre du haut */
.topbar {
  max-width: 1040px; margin: 0 auto;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding-block: 16px 14px; border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; margin-right: auto; }
.brand em { font-style: normal; font-weight: 400; color: var(--ink-soft); }
.brand-mark { width: 34px; height: auto; flex: none; }
.scoreboard { display: flex; gap: 6px; flex-wrap: wrap; }
.scoreboard[hidden] { display: none; }
.chip {
  display: inline-flex; align-items: baseline; gap: 7px;
  padding: 5px 11px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  font-size: 0.92rem; line-height: 1.2;
}
.chip b { font-family: var(--display); font-weight: 700; }
.chip .k { font-size: 0.64rem; }
.chip.who { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.chip.who b { display: inline-block; max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.pages { display: flex; gap: 16px; font-size: 0.9rem; color: var(--ink-soft); }
.pages a { text-decoration: none; }
.pages a:hover, .pages a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

/* ---------------------------------------------------------------- colonne */
.wrap { max-width: 720px; margin: 0 auto; display: grid; gap: 22px; padding-top: 26px; }
.card, .porte, .stage, .reveal, .more { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.porte[hidden], .stage[hidden], .reveal[hidden] { display: none; }

/* ---------------------------------------------------------------- porte */
.porte { padding: clamp(24px, 5vw, 44px); display: grid; gap: 16px; }
.porte h1 { font-size: clamp(1.7rem, 4.2vw, 2.5rem); font-weight: 800; }
.lede { color: var(--ink-soft); font-size: 1.05rem; max-width: 58ch; }
#compte-form { display: grid; gap: 10px; margin-top: 8px; padding: 18px; background: var(--surface-2); border-radius: 10px; }
#compte-form label { font-family: var(--display); font-weight: 600; font-size: 0.9rem; }
.pseudo-row { display: flex; gap: 8px; }
.pseudo-row input {
  flex: 1; min-width: 0; font: inherit; font-family: var(--display); font-weight: 700; font-size: 1.25rem;
  padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink);
}
.pseudo-row input:focus { outline: none; border-color: var(--focus); }
.fine { font-size: 0.82rem; }

/* ---------------------------------------------------------------- boutons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-family: var(--display); font-weight: 700; font-size: 0.95rem; padding: 9px 16px; border-radius: 10px;
  transition: transform .1s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.btn.primary:hover { opacity: .92; }
.btn.big { font-size: 1.05rem; padding: 13px 22px; }
.btn.ghost { background: transparent; }
.linkish { background: none; border: 0; padding: 0; color: var(--ink-soft); font-size: 0.9rem; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.linkish:hover { text-decoration-color: currentColor; color: var(--ink); }
.segmented { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px; background: var(--surface); }
.segmented button { border: 0; background: transparent; padding: 4px 12px; border-radius: 999px; font-family: var(--display); font-weight: 600; font-size: 0.82rem; color: var(--ink-soft); }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--ground); }
.segmented.quiet { border-color: var(--line); }
.segmented.quiet button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }

/* ---------------------------------------------------------------- plateau */
.stage { padding: clamp(16px, 3.5vw, 28px); display: grid; gap: 16px; justify-items: center; }
.stage-head { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stage-head .eyebrow b { color: var(--ink); }
.portrait { margin: 0; width: min(100%, 340px); display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.portrait img {
  width: 100%; min-width: 0; height: auto; aspect-ratio: 1 / 1; object-fit: cover; object-position: top center;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); transition: opacity .25s ease;
}
.portrait img.loading { opacity: 0; }
.portrait figcaption { font-size: 0.8rem; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.crowd { font-size: 0.95rem; color: var(--ink-soft); text-align: center; max-width: 48ch; }
.crowd[hidden] { display: none; }
.crowd b { font-family: var(--display); font-size: 1.15rem; color: var(--ink); }
.question { font-size: clamp(1.4rem, 3.4vw, 1.9rem); font-weight: 800; text-align: center; margin-top: 4px; }
.question-sub { color: var(--muted); text-align: center; font-size: 0.92rem; max-width: 52ch; margin-top: -8px; }
.mode-desc[hidden] { display: none; }

.hemicycle { width: 100%; max-width: 560px; }
.hemicycle svg { width: 100%; height: auto; display: block; overflow: visible; }
.seat { cursor: pointer; transition: transform .15s ease, filter .15s ease; transform-box: fill-box; transform-origin: center; }
.seat path { stroke: var(--surface); 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(--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(--line-strong); stroke-width: 1.5; }
.hemicycle .tribune-txt { font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: 0.16em; fill: var(--ink-soft); text-anchor: middle; }
.hemicycle.answered .seat { cursor: default; pointer-events: none; }
.hemicycle.answered .seat:not(.is-truth):not(.is-guess) { opacity: .25; }
.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 { width: 100%; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.keys.n3 { grid-template-columns: repeat(3, 1fr); }
.key {
  border: 1px solid var(--line); background: var(--surface-2); padding: 9px 6px; border-radius: 10px;
  font-family: var(--display); font-weight: 700; font-size: 0.85rem; line-height: 1.1;
  display: grid; gap: 4px; justify-items: center; transition: border-color .12s ease, transform .1s ease;
}
.key:hover { border-color: var(--ink); }
.key:active { transform: translateY(1px); }
.key[disabled] { opacity: .45; cursor: default; }
.key .k { font-size: 0.62rem; }
.key .dot { width: 10px; height: 10px; border-radius: 50%; }
.toolbar { width: 100%; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; padding-top: 6px; border-top: 1px solid var(--line); }
#loading { width: 100%; text-align: center; }

/* ---------------------------------------------------------------- révélation */
.reveal { padding: clamp(18px, 3.5vw, 28px); display: grid; gap: 12px; }
.verdict-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.stamp {
  font-family: var(--display); font-weight: 800; font-size: 1.25rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 4px 12px; border: 2px solid currentColor; border-radius: 6px; transform: rotate(-3deg); line-height: 1;
}
.stamp.exact { color: var(--ok); } .stamp.presque { color: var(--warn); } .stamp.rate { color: var(--bad); }
.points { font-family: var(--display); font-weight: 600; color: var(--ink-soft); }
.reveal h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); font-weight: 800; }
.pill { display: inline-flex; align-items: center; font-family: var(--display); font-weight: 700; font-size: 0.85rem; color: #fff; padding: 4px 12px; border-radius: 999px; width: fit-content; }
.spectrum { margin-top: 4px; }
.spectrum .bar { display: grid; grid-template-columns: repeat(5, 1fr); height: 10px; border-radius: 999px; overflow: hidden; }
.spectrum .bar span { display: block; }
.spectrum .marks { position: relative; height: 36px; }
.spectrum .mark { position: absolute; top: 4px; transform: translateX(-50%); font-family: var(--display); font-size: 0.7rem; 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; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 16px; }
.facts div { border-top: 1px solid var(--line); padding-top: 6px; font-size: 0.95rem; }
.facts .eyebrow { display: block; margin-bottom: 2px; }
.nuance { color: var(--ink-soft); font-style: italic; }
.fiche { font-size: 0.92rem; }
.quip { font-family: var(--display); font-size: clamp(1.15rem, 2.4vw, 1.45rem); font-weight: 600; line-height: 1.25; border-left: 3px solid var(--ink); padding-left: 14px; margin-top: 6px; }
.saviez { background: var(--surface-2); border-radius: 10px; padding: 14px 16px; display: grid; gap: 6px; font-size: 0.95rem; }
.saviez .src { font-size: 0.82rem; color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding-top: 4px; }

/* ---------------------------------------------------------------- onglets */
.more { padding: 0 clamp(16px, 3.5vw, 28px) clamp(18px, 3.5vw, 26px); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 calc(-1 * clamp(16px, 3.5vw, 28px)); padding: 0 clamp(12px, 3vw, 20px); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 14px 12px 12px; font-family: var(--display); font-weight: 600; font-size: 0.95rem; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.tab-panel { display: grid; gap: 14px; padding: 20px 2px 0; }
.tab-panel[hidden] { display: none; }
.tab-panel h2 { font-size: 1.3rem; font-weight: 800; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.board { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.board th, .board td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.board td[colspan] { white-space: normal; }
.board th { font-family: var(--display); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.board td.num, .board th:not(:nth-child(2)) { text-align: right; }
.board td:nth-child(2) { width: 100%; font-weight: 600; }
.board tr:last-child td { border-bottom: 0; }
.board tr.moi td { background: var(--surface-2); font-weight: 700; }
.moi { font-style: italic; color: var(--ink-soft); }
.c-scores { display: grid; gap: 12px; }
.c-mode { display: grid; gap: 6px; }
.c-titre { color: var(--ink); }
.c-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.c-grid div { display: grid; gap: 2px; background: var(--surface-2); border-radius: 8px; padding: 8px 10px; }
.c-grid b { font-family: var(--display); font-size: 1.15rem; line-height: 1.1; }
.stats-block { display: grid; gap: 12px; padding-top: 10px; border-top: 1px solid var(--line); margin-top: 6px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stats-grid div { display: grid; gap: 2px; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }
.stats-grid b { font-family: var(--display); font-weight: 800; font-size: 1.5rem; line-height: 1; }
.bias { font-style: italic; color: var(--ink-soft); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.9rem; }
.legend div { display: flex; align-items: center; gap: 7px; }
.legend i { width: 12px; height: 12px; display: inline-block; border-radius: 3px; }
.prose p { max-width: 68ch; color: var(--ink-soft); }
.prose h2 { color: var(--ink); }

/* ---------------------------------------------------------------- pages secondaires */
.page { max-width: 720px; margin: 0 auto; padding-top: 26px; display: grid; gap: 22px; }
.page .prose { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: clamp(20px, 4vw, 36px); display: grid; gap: 14px; }
.page .prose h2 { font-size: 1.5rem; font-weight: 800; margin-top: 6px; }
.page .prose h3 { font-size: 1.1rem; font-weight: 700; }
.page .prose ul, .page .prose ol { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; color: var(--ink-soft); }
.page .prose .src { font-size: 0.88rem; color: var(--muted); }
.page .prose .legend-list { display: grid; gap: 6px; }
.page .prose .legend-list div { display: flex; align-items: center; gap: 10px; }
.page .prose .legend-list i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.page aside { display: grid; gap: 10px; padding: 18px 20px; background: var(--surface-2); border-radius: 10px; font-size: 0.95rem; }
.page aside h2 { font-size: 1.1rem; }

/* ---------------------------------------------------------------- pied, toast */
.foot { max-width: 1040px; margin: 36px auto 0; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; color: var(--muted); font-size: 0.85rem; }
.foot nav { display: flex; gap: 16px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--ground); font-family: var(--display); font-weight: 600; padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: opacity .2s ease; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 640px) {
  .topbar { gap: 10px; }
  .pages { order: 3; width: 100%; }
  .scoreboard { order: 2; width: 100%; }
  .stats-grid, .c-grid { grid-template-columns: repeat(2, 1fr); }
  .keys { gap: 6px; }
  .key { font-size: 0.74rem; padding: 8px 4px; }
  .seat .lbl { font-size: 15px; }
  .seat .lbl-small { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
