/* Kalpi — feuille de style.
 * Concept : le bureau de vote. Le sol bleu-gris de l'isoloir, les bulletins (פתקים) en papier blanc
 * avec leurs grosses lettres, l'enveloppe bleue pour les actions, le bandeau « מבזק » jaune/rouge des
 * soirées électorales. Le thème sombre = le plateau TV du soir de l'élection. */
:root {
  --ground: #e8edf6;
  --ground-2: #dde4f1;
  --paper: #ffffff;
  --paper-2: #f5f7fc;
  --ink: #0e1830;
  --ink-soft: #4b5775;
  --ink-faint: #7d89a6;
  --line: #ccd5e6;
  --envelope: #2453c9;
  --envelope-ink: #ffffff;
  --envelope-soft: #dfe7fb;
  --flash: #ffcf1a;
  --flash-ink: #1b1400;
  --alert: #d3261c;
  --alert-bg: #d3261c;
  --good: #0f7a55;
  --bad: #c2321f;
  --shadow: 0 1px 0 rgba(14, 24, 48, .06), 0 6px 18px -10px rgba(14, 24, 48, .35);
  --radius: 10px;
  --font-display: "Karantina", "Secular One", "Arial Narrow", Impact, sans-serif;
  --font-body: "Rubik", "Heebo", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-press: "Frank Ruhl Libre", "David Libre", Georgia, "Times New Roman", serif;
  --bloc-coalition: #1f4fd1;
  --bloc-opposition: #0b8a7a;
  --bloc-arab: #8a4bd1;
  --bloc-other: #8a93a6;
  /* bandeaux « plateau » (kicker calendrier, haut de la fiche de fin) : sombres dans les deux thèmes */
  --studio: #0e1830;
  --studio-ink: #ffffff;
  /* groupe WhatsApp */
  --wa-bg: #e6ddd4;
  --wa-bubble: #ffffff;
  --wa-bubble-me: #d9fdd3;
  --wa-ink: #111b21;
  --wa-who: #c2185b;
  --wa-meta: #667781;
  --wa-meta-me: #667781;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground: #08102a;
    --ground-2: #0d1736;
    --paper: #121d40;
    --paper-2: #18244d;
    --ink: #e9eeff;
    --ink-soft: #a9b6da;
    --ink-faint: #7584ad;
    --line: #26345f;
    --envelope: #5f8bff;
    --envelope-ink: #071030;
    --envelope-soft: #1b2a5c;
    --flash: #ffd23a;
    --flash-ink: #1b1400;
    --alert: #ff5a4f;
    --alert-bg: #d93a2f;
    --good: #3fd19a;
    --bad: #ff7a66;
    --shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 8px 24px -12px rgba(0, 0, 0, .7);
    --bloc-coalition: #6e98ff;
    --bloc-opposition: #34c6b2;
    --bloc-arab: #b48cff;
    --bloc-other: #8f9bbd;
    --studio: #0a1433;
    --studio-ink: #eef3ff;
    --wa-bg: #0b141a;
    --wa-bubble: #202c33;
    --wa-bubble-me: #005c4b;
    --wa-ink: #e9edef;
    --wa-who: #ff7eb3;
    --wa-meta: #8696a0;
    --wa-meta-me: #9fc4bb;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ground: #08102a;
  --ground-2: #0d1736;
  --paper: #121d40;
  --paper-2: #18244d;
  --ink: #e9eeff;
  --ink-soft: #a9b6da;
  --ink-faint: #7584ad;
  --line: #26345f;
  --envelope: #5f8bff;
  --envelope-ink: #071030;
  --envelope-soft: #1b2a5c;
  --flash: #ffd23a;
  --flash-ink: #1b1400;
  --alert: #ff5a4f;
  --alert-bg: #d93a2f;
  --good: #3fd19a;
  --bad: #ff7a66;
  --shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 8px 24px -12px rgba(0, 0, 0, .7);
  --bloc-coalition: #6e98ff;
  --bloc-opposition: #34c6b2;
  --bloc-arab: #b48cff;
  --bloc-other: #8f9bbd;
  --studio: #0a1433;
  --studio-ink: #eef3ff;
  --wa-bg: #0b141a;
  --wa-bubble: #202c33;
  --wa-bubble-me: #005c4b;
  --wa-ink: #e9edef;
  --wa-who: #ff7eb3;
  --wa-meta: #8696a0;
  --wa-meta-me: #9fc4bb;
  color-scheme: dark;
}

/* Polices par langue. Le français garde exactement sa pile ; l'hébreu (langue par défaut, <html lang="he">)
 * a la sienne : Karantina (affiche condensée, pendant hébreu d'Anton), Rubik (texte), Frank Ruhl Libre (presse).
 * Les mèmes « macro » sont en Anton majuscule en français ; Anton n'a pas d'hébreu, d'où --font-meme. */
:root {
  --font-meme: "Anton", Impact, "Karantina", "Arial Narrow", sans-serif;
}
:root:lang(he) {
  --font-display: "Karantina", "Secular One", "Arial Hebrew", "Arial Narrow", Impact, sans-serif;
  --font-body: "Rubik", "Heebo", "Arial Hebrew", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-press: "Frank Ruhl Libre", "David Libre", "Times New Roman", serif;
  --font-meme: "Karantina", "Secular One", "Arial Hebrew", Impact, sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--flash); outline-offset: 2px; }
[hidden] { display: none !important; }
.he { font-family: var(--font-display); direction: rtl; unicode-bidi: isolate; }
.he-body { direction: rtl; unicode-bidi: isolate; }
.num { font-variant-numeric: tabular-nums; }

#app {
  max-width: 560px;
  margin: 0 auto;
  padding-block: 12px 96px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ───── Barre du haut ───── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-block: 4px;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  background: none;
  border: 0;
  padding: 0;
}
.brand .he { font-size: 34px; line-height: 1; font-weight: 700; color: var(--envelope); }
.brand .lat { font-family: var(--font-display); font-size: 26px; letter-spacing: .14em; font-weight: 700; }
/* Police de secours plus large (Google Fonts bloqué ou lent) : les boutons passent à la ligne plutôt que d'élargir la page. */
.topbar { flex-wrap: wrap; row-gap: 6px; }
.topbar > div { margin-inline-start: auto; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}
.chip.flash { background: var(--flash); color: var(--flash-ink); border-color: transparent; }
.iconbtn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  display: inline-grid;
  place-items: center;
  font-size: 18px;
  padding: 0;
}

/* ───── Boutons ───── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .02em;
  background: var(--envelope);
  color: var(--envelope-ink);
  text-decoration: none;
  transition: transform .12s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.ghost { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
.btn.flash { background: var(--flash); color: var(--flash-ink); }
.btn.small { padding: 8px 14px; font-size: 14px; min-height: 40px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: none; }

/* ───── Accueil ───── */
.hero {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.hero-art {
  position: relative;
  height: 230px;
  background:
    repeating-linear-gradient(90deg, transparent 0 46px, rgba(36, 83, 201, .07) 46px 47px),
    linear-gradient(180deg, var(--envelope-soft), var(--paper));
  display: grid;
  place-items: center;
  overflow: hidden;
}
.ballotbox {
  position: relative;
  width: 168px;
  height: 120px;
  margin-top: 70px;
}
.ballotbox .box {
  position: absolute;
  inset: 0;
  background: var(--envelope);
  border-radius: 6px 6px 10px 10px;
  box-shadow: inset 0 -14px 0 rgba(0, 0, 0, .14);
  display: grid;
  place-items: center;
}
.ballotbox .box span {
  font-family: var(--font-display);
  color: var(--envelope-ink);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: .05em;
  margin-top: 18px;
}
.ballotbox .slot {
  position: absolute;
  top: 12px;
  left: 40px;
  right: 40px;
  height: 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .45);
  background: color-mix(in srgb, var(--envelope), #000 45%);   /* opaque : le bulletin disparaît sous la fente */
  z-index: 2;
}
/* Le bulletin tombe dans une fenêtre qui s'arrête au milieu de la fente : passé la fente, il n'est plus visible. */
.ballotbox .drop {
  position: absolute;
  left: 0;
  right: 0;
  top: -90px;
  height: 106px;
  overflow: hidden;
  z-index: 1;
}
.ballotbox .slip {
  position: absolute;
  left: 50%;
  top: 4px;
  width: 64px;
  height: 92px;
  margin-left: -32px;
  background: #fff;
  color: #0e1830;
  border: 1px solid #c9d1e3;
  border-radius: 3px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .15);
  animation: slipdrop 3.6s cubic-bezier(.6, 0, .35, 1) infinite;
}
@keyframes slipdrop {
  0% { transform: translateY(-12px) rotate(-4deg); opacity: 0; }
  10%, 22% { transform: translateY(0) rotate(-4deg); opacity: 1; }
  60%, 100% { transform: translateY(110px) rotate(0); opacity: 1; }
}
.hero-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 46px;
  line-height: .95;
  letter-spacing: .01em;
  text-wrap: balance;
}
.hero p { margin: 0; color: var(--ink-soft); }
.countdown {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 2px 0;
}
.section-title h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1;
}
.section-title small { color: var(--ink-faint); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 420px) { .grid3 { grid-template-columns: minmax(0, 1fr); } }
.tile {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  text-align: start;
}
.tile .t-icon { font-size: 22px; }
.tile .t-title { font-weight: 700; font-size: 14px; line-height: 1.25; }
.tile .t-sub { font-size: 12px; color: var(--ink-soft); }
.tile.done { opacity: .6; }
.tile button.tile, button.tile { cursor: pointer; }
.progress { height: 6px; background: var(--ground-2); border-radius: 3px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--envelope); }
.menu-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 600;
  text-align: start;
}
.menu-item .mi-icon { font-size: 20px; }
.menu-item small { display: block; font-weight: 400; color: var(--ink-faint); font-size: 12px; }
.disclaimer { font-size: 12px; color: var(--ink-faint); text-align: center; line-height: 1.5; padding-inline: 8px; }

/* ───── Création ───── */
.stepper { display: flex; justify-content: center; gap: 6px; }
.stepper i { width: 8px; height: 8px; border-radius: 4px; background: var(--line); transition: width .2s; }
.stepper i.on { width: 24px; background: var(--envelope); }
.stepper i.done { background: var(--envelope); opacity: .5; }
.step-head { text-align: center; display: flex; flex-direction: column; gap: 4px; }
.step-head h2 { margin: 0; font-family: var(--font-display); font-size: 40px; line-height: 1; }
.step-head p { margin: 0; color: var(--ink-soft); }
.navrow { display: flex; justify-content: space-between; gap: 10px; }

.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: start;
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  transition: border-color .12s, transform .12s;
}
.option:hover { border-color: var(--envelope); }
.option.sel { border-color: var(--envelope); box-shadow: 0 0 0 3px var(--envelope-soft); }
.option .o-title { font-weight: 700; font-size: 17px; }
.option .o-text { color: var(--ink-soft); font-size: 14.5px; }
/* Slogan hébreu sous un slogan français : aligné comme la carte, pas selon son propre sens. */
.option .he-body { text-align: match-parent; text-align: -webkit-match-parent; }
.option .o-stats { font-size: 13px; font-weight: 600; color: var(--envelope); }
.option .o-stats .neg { color: var(--bad); }

/* Bulletins de vote (choix du parti) */
.slips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 520px) { .slips { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.slip {
  position: relative;
  background: #fff;
  color: #0e1830;
  border: 1px solid #c9d1e3;
  border-radius: 4px;
  padding: 12px 10px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  box-shadow: 0 2px 0 rgba(14, 24, 48, .05), 0 10px 18px -14px rgba(14, 24, 48, .5);
  transition: transform .15s ease, box-shadow .15s;
  min-width: 0;
}
.slip:hover { transform: translateY(-2px) rotate(-.6deg); }
.slip.sel { outline: 3px solid var(--envelope); outline-offset: 2px; }
.slip .letters {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 50px;
  line-height: .9;
  direction: rtl;
  min-height: 46px;
}
.slip .s-he { font-family: var(--font-press); font-weight: 700; font-size: 15px; direction: rtl; line-height: 1.2; }
.slip .s-name { font-weight: 700; font-size: 13px; line-height: 1.2; }
.slip .s-lead { font-size: 12px; color: #4b5775; line-height: 1.25; }
.slip .s-meta { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 2px; }
.slip .s-meta span { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: #eef2fa; color: #24314f; font-weight: 600; }
.slip .stripe { position: absolute; left: 0; right: 0; top: 0; height: 5px; border-radius: 4px 4px 0 0; }
.stars { color: #9a7400; letter-spacing: 1px; font-size: 12px; }
/* Mode clin d'œil : le rayon des listes cultes, sous les vraies listes en course. */
.wink-head { margin: 22px 0 10px; padding-top: 14px; border-top: 2px dashed var(--line); }
.wink-head h3 { margin: 0 0 4px; font-family: var(--font-display); font-size: 30px; line-height: 1; letter-spacing: .02em; }
.wink-head p { margin: 0; font-size: 14px; color: var(--ink-soft); line-height: 1.4; }
.slip.wink { background: repeating-linear-gradient(-45deg, #fff, #fff 10px, #fffbea 10px, #fffbea 20px); }
.slip.wink .stars { color: #7a5b00; letter-spacing: 0; font-weight: 600; }

/* ───── QG de campagne ───── */
.hq-head {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow);
}
.mini-slip {
  width: 58px;
  height: 74px;
  background: #fff;
  color: #0e1830;
  border: 1px solid #c9d1e3;
  border-radius: 3px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 26px;
  direction: rtl;
  position: relative;
  overflow: hidden;
}
.mini-slip .stripe { position: absolute; top: 0; left: 0; right: 0; height: 5px; }
.hq-id { min-width: 0; }
.hq-id .p-name { font-weight: 700; font-size: 17px; line-height: 1.2; }
.hq-id .p-he { display: inline-block; font-weight: 500; color: var(--ink-soft); }
.hq-id .p-sub { font-size: 13px; color: var(--ink-soft); line-height: 1.3; }
.seats-big { text-align: end; }
.seats-big > b { font-family: var(--font-display); font-size: 54px; line-height: .8; display: block; }
.seats-big small { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.seats-big .seuil { display: inline-block; margin-top: 4px; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; color: var(--bad); background: rgba(211, 38, 28, .12); }
.delta-up { color: var(--good); font-weight: 700; }
.delta-down { color: var(--bad); font-weight: 700; }
.timeline-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.week-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; flex: 1; min-width: 140px; }
.week-track i { height: 6px; border-radius: 3px; background: var(--line); }
.week-track i.done { background: var(--envelope); }
.week-track i.now { background: var(--flash); }

.gauges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 420px) { .gauges { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gauge {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.gauge .g-top { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.gauge .g-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gauge .g-val { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.gauge .bar { height: 6px; border-radius: 3px; background: var(--ground-2); overflow: hidden; }
.gauge .bar i { display: block; height: 100%; border-radius: 3px; background: var(--envelope); transition: width .5s ease; }
.gauge.low .bar i { background: var(--alert); }
.gauge.pulse { animation: pulse .6s ease; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 var(--flash); } 100% { box-shadow: 0 0 0 10px transparent; } }

/* Carte de décision */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: cardin .35s ease both;
}
@keyframes cardin { from { transform: translateY(8px); opacity: .4; } to { transform: none; opacity: 1; } }
.card-kicker {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: var(--envelope);
  color: var(--envelope-ink);
}
.card-kicker.event { background: var(--alert-bg); color: #fff; }
.card-kicker.calendar { background: var(--studio); color: var(--studio-ink); }
.card-kicker.flash { background: var(--flash); color: var(--flash-ink); }
.card-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card-title { margin: 0; font-family: var(--font-display); font-size: 34px; line-height: 1; text-wrap: balance; }
.card-art { font-size: 44px; line-height: 1; }
.card-text { margin: 0; color: var(--ink); font-size: 15.5px; }
.card-text em { color: var(--ink-soft); }
.quote {
  margin: 0;
  padding: 10px 14px;
  border-inline-start: 4px solid var(--flash);
  background: var(--paper-2);
  border-start-end-radius: 8px;
  border-end-end-radius: 8px;
  font-family: var(--font-press);
  font-size: 16px;
}
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  text-align: start;
  background: var(--paper-2);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color .12s, background .12s, transform .1s;
}
.choice:hover:not([disabled]) { border-color: var(--envelope); background: var(--envelope-soft); }
.choice:active:not([disabled]) { transform: scale(.99); }
.choice .c-label { font-weight: 700; font-size: 15.5px; }
.choice .c-hint { font-size: 13px; color: var(--ink-soft); }
.choice .c-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--ground-2); color: var(--ink-soft); white-space: nowrap; }
.tag.cost { background: var(--envelope-soft); color: var(--envelope); }
.tag.risk { background: rgba(211, 38, 28, .12); color: var(--bad); }
.tag.seg { background: rgba(15, 122, 85, .12); color: var(--good); }
.choice[disabled] { opacity: .5; cursor: not-allowed; }

.outcome { display: flex; flex-direction: column; gap: 10px; }
.outcome .o-verdict { font-family: var(--font-display); font-size: 28px; line-height: 1; }
.outcome .o-verdict.good { color: var(--good); }
.outcome .o-verdict.bad { color: var(--bad); }
.effects { display: flex; flex-wrap: wrap; gap: 6px; }
.eff { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--ground-2); font-variant-numeric: tabular-nums; }
.eff.up { color: var(--good); background: rgba(15, 122, 85, .12); }
.eff.down { color: var(--bad); background: rgba(211, 38, 28, .1); }

/* Bandeau « מבזק » */
.ticker {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: stretch;
  background: var(--flash);
  color: var(--flash-ink);
  font-weight: 600;
  font-size: 14px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  overflow: hidden;
}
.ticker .t-label {
  flex: none;
  background: var(--alert);
  color: #fff;
  font-family: var(--font-display);
  font-size: 22px;
  padding: 4px 12px 2px;
  direction: rtl;
  display: flex;
  align-items: center;
}
.ticker .t-run { flex: 1; overflow: hidden; display: flex; align-items: center; }
.ticker .t-run span { display: inline-block; white-space: nowrap; padding-inline-start: 100%; animation: tick 38s linear infinite; }
@keyframes tick { to { transform: translateX(-100%); } }

/* Onglets */
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto;
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.tab.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.panel h3 { margin: 0; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }

/* Sondage façon plateau TV */
.tv {
  background: #0a1433;
  color: #eef3ff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid #1d2b5c;
}
.tv-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(90deg, #12245e, #0a1433);
  border-bottom: 2px solid var(--flash);
}
.tv-head .channel {
  font-family: var(--font-display);
  font-size: 26px;
  line-height: 1;
  letter-spacing: .03em;
}
.tv-head .live { background: #e5251b; color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 3px; letter-spacing: .1em; }
.tv-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.bars { display: flex; flex-direction: column; gap: 5px; }
.barrow { display: grid; grid-template-columns: minmax(0, 9.2em) minmax(0, 1fr) 2.2em; gap: 8px; align-items: center; font-size: 13.5px; }
.barrow .b-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barrow .b-track { height: 16px; background: rgba(255, 255, 255, .07); border-radius: 3px; overflow: hidden; position: relative; }
.barrow .b-fill { height: 100%; border-radius: 3px; transition: width .8s cubic-bezier(.2, .8, .2, 1); }
.barrow .b-val { text-align: end; font-weight: 700; font-variant-numeric: tabular-nums; }
.barrow.me .b-name { color: var(--flash); font-weight: 700; }
.barrow.out { opacity: .5; }
.barrow.out .b-val { font-size: 11px; }
/* son propre parti sous le seuil reste lisible : seule la barre s'efface */
.barrow.out.me { opacity: 1; }
.barrow.out.me .b-fill { opacity: .5; }
.blocbar { display: flex; height: 22px; border-radius: 4px; overflow: hidden; position: relative; margin-top: 6px; }
.blocbar span { display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; min-width: 0; overflow: hidden; }
.blocbar .mark61 { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--flash); inset-inline-start: calc(61 / 120 * 100%); }
.bloclegend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: #c4cff0; }
.bloclegend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 5px; vertical-align: -1px; }
.tv-foot { font-size: 11.5px; color: #8e9cc8; padding: 0 14px 12px; }

/* Groupe WhatsApp */
.wa {
  background: var(--wa-bg);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.wa-head { background: #075e54; color: #fff; padding: 10px 14px; display: flex; gap: 10px; align-items: center; }
.wa-head > span:last-child { min-width: 0; }
.wa-head b { display: block; font-size: 15px; line-height: 1.3; }
.wa-head small { display: block; opacity: .85; font-size: 12px; line-height: 1.35; }
.wa-avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; background: #25d366; display: grid; place-items: center; font-size: 18px; }
.wa-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.bubble {
  max-width: 86%;
  background: var(--wa-bubble);
  color: var(--wa-ink);
  border-radius: 8px;
  padding: 6px 10px 4px;
  font-size: 14px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .12);
  align-self: flex-start;
  overflow-wrap: break-word;
}
.bubble.me { align-self: flex-end; background: var(--wa-bubble-me); }
.bubble .who { font-size: 12.5px; font-weight: 700; color: var(--wa-who); }
.bubble .fwd { font-size: 11.5px; font-style: italic; color: var(--wa-meta); }
.bubble .time { font-size: 10.5px; color: var(--wa-meta); text-align: end; }
.bubble.me .time { color: var(--wa-meta-me); }

/* Mèmes et expéditeurs WhatsApp : jetons de couleur (clair, puis sombre). Une couleur stable par expéditeur. */
:root {
  --wa-n0: #c2185b; --wa-n1: #1565c0; --wa-n2: #0f7a55; --wa-n3: #7b3fb3;
  --wa-n4: #a85200; --wa-n5: #00796b; --wa-n6: #c62828; --wa-n7: #4652b8;
  --meme-edge: rgba(14, 24, 48, .08);
  --tw-bg: #ffffff;
  --tw-ink: #0f1419;
  --tw-muted: #536471;
  --tw-avatar: #e7ecf5;
  --news-paper: #fbfbf7;
  --news-line: #dddddd;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wa-n0: #ff7aa8; --wa-n1: #6cc4ff; --wa-n2: #3fd19a; --wa-n3: #c9a3ff;
    --wa-n4: #ffb15c; --wa-n5: #4fd6c6; --wa-n6: #ff8a80; --wa-n7: #a3adff;
    --meme-edge: rgba(255, 255, 255, .12);
    --tw-bg: #15202b;
    --tw-ink: #f7f9f9;
    --tw-muted: #8b98a5;
    --tw-avatar: #273340;
    --news-paper: #ebe7db;
    --news-line: #3a3f52;
  }
}
:root[data-theme="dark"] {
  --wa-n0: #ff7aa8; --wa-n1: #6cc4ff; --wa-n2: #3fd19a; --wa-n3: #c9a3ff;
  --wa-n4: #ffb15c; --wa-n5: #4fd6c6; --wa-n6: #ff8a80; --wa-n7: #a3adff;
  --meme-edge: rgba(255, 255, 255, .12);
  --tw-bg: #15202b;
  --tw-ink: #f7f9f9;
  --tw-muted: #8b98a5;
  --tw-avatar: #273340;
  --news-paper: #ebe7db;
  --news-line: #3a3f52;
}

/* Mème */
.meme-fig { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.meme {
  position: relative;
  background: #111;
  color: #fff;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  max-width: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  text-align: center;
  isolation: isolate;
  box-shadow: 0 0 0 1px var(--meme-edge);
  overflow-wrap: break-word;
}
.meme.format-macro { container-type: inline-size; }
.meme .m-bg { position: absolute; inset: 0; z-index: -1; display: grid; place-items: center; font-size: 150px; font-size: 40cqi; line-height: 1; filter: saturate(1.1); }
.meme .m-top, .meme .m-bottom {
  font-family: var(--font-meme);
  font-stretch: condensed;
  text-transform: uppercase;
  font-size: clamp(20px, 6.4vw, 32px);
  font-size: clamp(17px, 7.2cqi, 40px);
  line-height: 1.05;
  padding: 12px 14px;
  padding: 3.4cqi 4cqi;
  text-shadow: 2px 2px 0 #000, -2px 2px 0 #000, 2px -2px 0 #000, -2px -2px 0 #000, 0 3px 6px rgba(0, 0, 0, .6);
  letter-spacing: .01em;
  text-wrap: balance;
}
.meme.m-long .m-top, .meme.m-long .m-bottom { font-size: clamp(16px, 6.3cqi, 34px); }
.meme .m-he { font-family: var(--font-display); text-transform: none; direction: rtl; font-size: clamp(26px, 8vw, 40px); font-size: clamp(26px, 11cqi, 60px); line-height: 1; }
/* Affiche hébraïque longue (crochet posé par views.js) : un cran plus petit pour garder l'image au centre. */
.meme.m-he-long .m-he { font-size: clamp(22px, 7vw, 34px); font-size: clamp(22px, 9.5cqi, 52px); }
.meme .m-top .he-body, .meme .m-bottom .he-body { font-family: var(--font-display); font-size: 1.2em; line-height: .9; }
.meme sup { font-size: .55em; line-height: 0; vertical-align: .75em; text-transform: none; }
.meme .m-credit { position: absolute; inset-inline-end: 8px; bottom: 6px; font-size: 10px; opacity: .6; }
/* Drake : deux lignes, visage à gauche, texte à droite. */
.meme.format-drake { aspect-ratio: auto; grid-template-rows: none; grid-template-columns: 1fr; background: #fff; color: #111; }
.drake { display: grid; grid-template-columns: 36% minmax(0, 1fr); }
.drake > div { padding: 12px; display: grid; place-items: center; min-height: 110px; font-weight: 700; font-size: 16px; line-height: 1.25; }
.drake > div:nth-child(-n+2) { border-bottom: 1px solid #ddd; }
.drake .d-text { text-align: center; min-width: 0; }
.drake .d-face { font-size: 58px; line-height: 1; background: #f2c14e; }
.drake .d-face.yes { background: #8fd16a; }
/* Deux boutons */
.meme.format-twobuttons { aspect-ratio: auto; display: flex; flex-direction: column; align-items: center; background: #f3f5fb; color: #111; }
.tb-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 16px 12px 6px; width: 100%; }
.tb-btn { background: #e53935; color: #fff; border-radius: 10px; padding: 12px 10px; font-weight: 700; font-size: 15px; line-height: 1.3; box-shadow: 0 4px 0 #8e1b18; min-width: 0; display: grid; place-items: center; }
.tb-face { font-size: 64px; line-height: 1; padding: 10px 0 6px; }
.tb-who { font-weight: 700; padding: 0 14px 14px; line-height: 1.35; text-wrap: balance; }
/* Cerveau galactique */
.meme.format-brain { aspect-ratio: auto; display: flex; flex-direction: column; background: #fff; color: #111; }
.br-row { display: grid; grid-template-columns: minmax(0, 1fr) 84px; border-bottom: 1px solid #ddd; }
.br-row:last-child { border-bottom: 0; }
/* Hébreu : textes plus courts, rangées plus basses ; on garde la place du plus gros emoji (48 px). */
:root:lang(he) .br-row { min-height: 56px; }
.br-text { padding: 12px; font-weight: 700; font-size: 15px; line-height: 1.35; text-align: start; display: flex; align-items: center; min-width: 0; }
.br-brain { display: grid; place-items: center; font-size: 30px; line-height: 1; }
.br-0 .br-brain { background: #e9ecf3; }
.br-1 .br-brain { background: #cfe0ff; font-size: 36px; }
.br-2 .br-brain { background: #9fc1ff; font-size: 42px; }
.br-3 .br-brain { background: #ffe27a; font-size: 48px; text-shadow: 0 0 14px #fff6c8; }
/* Graphique */
.meme.format-chart { aspect-ratio: auto; display: flex; flex-direction: column; gap: 10px; padding: 14px; background: #fff; color: #111; text-align: start; }
.ch-title { font-size: 16px; line-height: 1.3; text-wrap: balance; }
.ch-bars { display: grid; grid-template-columns: fit-content(46%) minmax(0, 1fr) auto; gap: 7px 8px; align-items: center; font-size: 13px; line-height: 1.25; }
.ch-k { min-width: 0; }
.ch-track { height: 14px; background: #eef1f8; border-radius: 3px; overflow: hidden; }
.ch-track i { display: block; height: 100%; border-start-end-radius: 3px; border-end-end-radius: 3px; }
.ch-v { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ch-note { color: #555; font-size: 12.5px; line-height: 1.4; }
/* Tweet : suit le thème, comme une capture d'écran de l'application. */
.meme.format-tweet { aspect-ratio: auto; display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--tw-bg); color: var(--tw-ink); text-align: start; }
.tw-head { display: flex; gap: 10px; align-items: center; min-width: 0; }
.tw-avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--tw-avatar); display: grid; place-items: center; font-size: 22px; }
.tw-id { min-width: 0; line-height: 1.3; }
.tw-id b { display: block; }
.tw-id small, .tw-meta { color: var(--tw-muted); font-size: 13px; }
.tw-text { font-size: 16px; line-height: 1.42; }
/* Une de journal */
.meme.format-headline { aspect-ratio: auto; display: flex; flex-direction: column; gap: 6px; padding: 14px; background: var(--news-paper); color: #111; text-align: start; box-shadow: 0 0 0 1px var(--news-line); }
.hl-paper { font-family: var(--font-press); font-weight: 900; font-size: 24px; line-height: 1.2; border-bottom: 3px double #111; padding-bottom: 4px; text-align: center; }
.hl-title { font-family: var(--font-press); font-weight: 900; font-size: 26px; line-height: 1.08; text-wrap: balance; }
.hl-sub { font-family: var(--font-press); font-size: 15px; line-height: 1.45; color: #333; }
.meme-caption { font-size: 13px; color: var(--ink-soft); }

/* Écran de résultats et de fin */
.endcard {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.endcard .e-top { padding: 18px; background: var(--studio); color: var(--studio-ink); display: flex; flex-direction: column; gap: 6px; }
.endcard .e-top h2 { margin: 0; font-family: var(--font-display); font-size: 44px; line-height: .95; text-wrap: balance; }
.endcard .e-score { display: flex; align-items: baseline; gap: 6px; }
.endcard .e-score b { font-family: var(--font-display); font-size: 84px; line-height: .8; color: var(--flash); }
.endcard .e-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.statgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--paper-2); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat b { font-size: clamp(18px, 5.2vw, 22px); font-variant-numeric: tabular-nums; line-height: 1.1; white-space: nowrap; }
.stat small { font-size: 11.5px; color: var(--ink-soft); line-height: 1.25; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--envelope-soft);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}
.badge.locked { opacity: .45; filter: grayscale(1); }
.share-box {
  font-size: 13px;
  white-space: pre-wrap;
  background: var(--paper-2);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
}

/* Liste coalition */
.coal-list { display: flex; flex-direction: column; gap: 8px; }
.coal-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  background: var(--paper-2);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  text-align: start;
}
.coal-item.in { border-color: var(--good); background: rgba(15, 122, 85, .08); }
.coal-item.no { opacity: .55; }
.coal-item .ci-seats { font-family: var(--font-display); font-size: 30px; line-height: 1; }
.coal-meter { position: relative; height: 26px; background: var(--ground-2); border-radius: 6px; overflow: hidden; }
.coal-meter i { position: absolute; top: 0; bottom: 0; inset-inline-start: 0; background: var(--good); transition: width .5s; }
.coal-meter .m61 { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--alert); inset-inline-start: calc(61 / 120 * 100%); }
.coal-meter span { position: absolute; inset: 0; display: grid; place-items: center end; padding-inline: 10px; font-weight: 700; font-size: 13px; }

/* Journal */
.log { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.log-item { display: grid; grid-template-columns: 2.6em minmax(0, 1fr); gap: 8px; font-size: 14px; }
.log-item .l-week { font-weight: 700; color: var(--ink-faint); font-size: 12px; padding-top: 2px; }

/* Segments */
.segrow { display: grid; grid-template-columns: minmax(0, 1fr) 4.5em 3.5em; gap: 8px; align-items: center; font-size: 13.5px; }
.segrow .sr-bar { height: 8px; background: var(--ground-2); border-radius: 4px; overflow: hidden; }
.segrow .sr-bar i { display: block; height: 100%; background: var(--envelope); }
.segrow .sr-val { text-align: end; font-variant-numeric: tabular-nums; font-weight: 600; }

/* Modale */
.modal-back {
  position: fixed;
  inset: 0;
  background: rgba(5, 10, 25, .55);
  z-index: 40;
  display: grid;
  place-items: end center;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  animation: fade .2s ease;
}
@media (min-width: 600px) { .modal-back { place-items: center; } }
@keyframes fade { from { opacity: 0; } }
.modal {
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
}
.modal h2 { margin: 0; font-family: var(--font-display); font-size: 34px; line-height: 1; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  top: calc(14px + env(safe-area-inset-top, 0px));
  transform: translateX(-50%);
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.35;
  box-shadow: var(--shadow);
  animation: toast 2.6s ease forwards;
  width: max-content;
  max-width: min(440px, calc(100vw - 32px));
  text-align: center;
}
.toast:has(~ .toast) { display: none; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -8px); } 10%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

/* Soirée électorale */
.exitpoll-clock {
  font-family: var(--font-display);
  font-size: 72px;
  line-height: 1;
  text-align: center;
  color: var(--flash);
  letter-spacing: .04em;
}
.blink { animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.turnout { display: flex; flex-direction: column; gap: 6px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .ticker .t-run span { animation: none; padding-inline-start: 0; }
}

/* Coalition : exigences et boutons */
.ci-demands { grid-column: 1 / -1; font-size: 13px; color: var(--ink-soft); line-height: 1.35; }
.ci-actions { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; }

/* Tableau des sondages sortie des urnes */
.exit-wrap { overflow-x: auto; }
.exit { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.exit th, .exit td { padding: 5px 6px; text-align: end; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.exit thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #c4cff0; font-weight: 600; }
.exit thead th:first-child, .exit tbody th { text-align: start; font-weight: 500; }
.exit tbody th i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-inline-end: 7px; vertical-align: -1px; }
.exit tr.me th, .exit tr.me td { color: var(--flash); font-weight: 700; }
.exit tr.bloc th, .exit tr.bloc td { font-weight: 700; border-top: 2px solid rgba(255, 255, 255, .25); color: #fff; }
.exit td { font-weight: 700; }

/* Face-à-face avec le rival : libellé + verdict sur une ligne, le score en dessous */
.duel-row { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 8px; font-size: 13px; color: var(--ink-soft); }
.duel-row .d-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.duel-row .d-verdict { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; background: var(--ground-2); color: var(--ink-soft); }
.duel-row .d-verdict.up { color: var(--good); background: rgba(15, 122, 85, .12); }
.duel-row .d-verdict.down { color: var(--bad); background: rgba(211, 38, 28, .1); }
.duel-row .d-pair { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-size: 15px; }
.duel-row b { color: var(--ink); }
.vs { font-family: var(--font-display); font-size: 16px; color: var(--alert); }

/* Pastilles d'attitude sur les choix */
.pill {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--envelope-soft);
  color: var(--envelope);
}

/* Tons des cartes de résultat */
.card.tone-great { border: 2px solid #d9a915; box-shadow: 0 0 0 4px rgba(217, 169, 21, .18), var(--shadow); }
.card.tone-great .card-kicker { background: linear-gradient(90deg, #b8860b, #f2c94c); color: #1b1400; }
.card.tone-good { border: 2px solid var(--good); }
.card.tone-bad { border: 2px solid var(--bad); }
.card.tone-terrible { border: 2px solid var(--bad); animation: cardin .35s ease both, shake .4s ease .35s; }
.card.tone-terrible .card-kicker { background: var(--alert-bg); color: #fff; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
.effects .eff { animation: chipin .35s cubic-bezier(.3, .9, .3, 1) both; }
.effects .eff:nth-child(2) { animation-delay: .09s; }
.effects .eff:nth-child(3) { animation-delay: .18s; }
.effects .eff:nth-child(4) { animation-delay: .27s; }
.effects .eff:nth-child(5) { animation-delay: .36s; }
.effects .eff:nth-child(6) { animation-delay: .45s; }
@keyframes chipin { from { transform: translateY(6px) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.suspense { min-height: 240px; display: grid; place-items: center; font-family: var(--font-display); font-size: 64px; color: var(--ink-faint); }

/* Paliers de fin de campagne */
.tier-pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; background: #c98a4b; color: #2a1606; }
.tier-argent .tier-pill { background: #9fb2c8; color: #15202c; }
.tier-or .tier-pill { background: #e0c141; color: #2a2000; }
.tier-legende .tier-pill { background: #6cc6f5; color: #04263a; }
.tier-icone .tier-pill { background: #b79bf0; color: #1d0d40; }
.tier-or .e-top, .tier-legende .e-top, .tier-icone .e-top { background-image: radial-gradient(circle at 85% 0%, rgba(255, 207, 26, .25), transparent 55%); }
.ff { display: flex; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.ff b { display: block; font-family: var(--font-display); font-size: 44px; line-height: 1; }
.ff small { color: var(--ink-soft); font-weight: 600; }
.ff .vs { font-size: 26px; }
details.panel summary::marker { color: var(--envelope); }

/* Partage du parcours */
.share { display: flex; flex-direction: column; gap: 10px; border-top: 1px dashed var(--line); padding-top: 14px; }
.share h3 { margin: 0; font-family: var(--font-display); font-size: 30px; line-height: 1; }
.card-preview {
  background: var(--ground-2);
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--ink-soft);
  font-weight: 600;
  margin-inline: auto;
  width: 100%;
}
.card-preview.story { aspect-ratio: 9 / 16; max-width: 360px; }
.card-preview.post { aspect-ratio: 16 / 9; }
.card-preview img { width: 100%; height: 100%; display: block; box-shadow: var(--shadow); }
.share-hint { color: var(--ink-faint); text-align: center; }
.share-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.share-grid .btn { padding: 11px 12px; font-size: 14.5px; }
.share-grid > :first-child, .share-grid > :last-child:nth-child(even) { grid-column: 1 / -1; }
.btn.xbtn { background: #0f1419; color: #ffffff; }
:root[data-theme="dark"] .btn.xbtn { background: #ffffff; color: #0f1419; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.xbtn { background: #ffffff; color: #0f1419; } }
.share details summary { cursor: pointer; font-size: 14px; color: var(--ink-soft); font-weight: 600; padding-block: 10px; }
.share details .share-box { margin-top: 8px; }
.brand .b61 { font-family: var(--font-display); font-size: 26px; font-weight: 700; background: var(--flash); color: var(--flash-ink); padding: 0 6px; border-radius: 4px; line-height: 1.15; }
.mahapach { text-align: center; background: var(--alert-bg); color: #fff; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 4px; animation: cardin .4s ease both; }
.mahapach b { font-family: var(--font-display); font-size: 54px; line-height: .9; letter-spacing: .02em; }

/* ───── Écrans annexes : accueil, boutique, badges, Panthéon, collection de mèmes, références ───── */
.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; }
@media (max-width: 420px) {
  .tile.quest { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 10px; row-gap: 2px; align-items: start; }
  .tile.quest .t-icon { grid-row: span 3; line-height: 1.2; }
}
.annex-summary { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.option.static:hover { border-color: var(--line); }
.option.static.sel:hover { border-color: var(--envelope); }
.option .o-title .pill { margin-inline-start: 6px; vertical-align: 2px; }
.shop-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.shop-row small { color: var(--ink-soft); font-size: 12.5px; }

.badge-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
@media (min-width: 520px) { .badge-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.badge-card { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.badge-card .bc-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--envelope-soft); display: grid; place-items: center; font-size: 21px; line-height: 1; }
.badge-card .bc-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.badge-card .bc-name { font-weight: 700; font-size: 14.5px; line-height: 1.25; }
.badge-card .bc-text { font-size: 12.5px; color: var(--ink-soft); line-height: 1.35; }
.badge-card.locked { background: transparent; border-style: dashed; }
.badge-card.locked .bc-icon { background: var(--ground-2); filter: grayscale(1); opacity: .55; }
.badge-card.locked .bc-name { color: var(--ink-soft); font-weight: 600; }

.pantheon-list { display: flex; flex-direction: column; gap: 10px; }
.pantheon-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: var(--shadow); }
.pantheon-item .mini-slip { width: 46px; height: 60px; font-size: 21px; }
.pi-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pi-title { font-weight: 700; font-size: 15.5px; line-height: 1.25; }
.pi-text { font-size: 13.5px; color: var(--ink-soft); line-height: 1.35; }
.pi-meta { font-size: 12px; color: var(--ink-soft); }
.pi-score { text-align: end; line-height: 1; white-space: nowrap; }
.pi-score b { display: block; font-family: var(--font-display); font-size: 44px; line-height: .85; color: var(--envelope); }
.pi-score small { font-size: 12px; color: var(--ink-soft); }

.meme-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 520px) { .meme-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.meme-tile { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: center; text-align: start; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; min-width: 0; }
button.meme-tile { transition: border-color .12s, transform .12s; }
button.meme-tile:hover { border-color: var(--envelope); transform: translateY(-1px); }
.meme-tile .mt-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.meme-tile .t-title { font-weight: 700; font-size: 13.5px; line-height: 1.25; }
.meme-tile .t-sub { font-size: 12px; color: var(--ink-soft); line-height: 1.3; }
.meme-tile.locked { grid-template-columns: minmax(0, 1fr); background: transparent; border-style: dashed; }
.meme-tile.locked .t-title { color: var(--ink-soft); }
.meme-thumb { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; font-size: 22px; line-height: 1; background: var(--paper-2); box-shadow: 0 0 0 1px var(--meme-edge); overflow: hidden; }
.meme-thumb.thumb-drake { background: linear-gradient(180deg, #f2c14e 50%, #8fd16a 50%); }
.meme-thumb.thumb-twobuttons { background: #f3f5fb; }
.meme-thumb.thumb-brain { background: #ffe27a; }
.meme-thumb.thumb-chart { background: #ffffff; }
.meme-thumb.thumb-headline { background: var(--news-paper); }
.meme-thumb.thumb-tweet { background: var(--tw-bg); }

.panel.refs .ref-item { font-size: 14.5px; line-height: 1.5; overflow-wrap: anywhere; }
.panel.refs .ref-item small { color: var(--ink-soft); font-size: 12.5px; }
.panel.refs a, .modal-src a { color: var(--envelope); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.panel.how p { margin: 0; }

/* ───── Modales : mème, menu de partie, code de duel ───── */
.modal { overscroll-behavior: contain; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.modal-head .iconbtn { flex: none; width: 36px; height: 36px; font-size: 15px; margin-top: -2px; }
.modal-meme .meme.format-macro { width: min(100%, 56vh); margin-inline: auto; }
.modal-text { margin: 0; font-size: 14.5px; }
.modal-src { color: var(--ink-soft); font-size: 12.5px; overflow-wrap: anywhere; }
.btn.danger { background: var(--alert); color: var(--envelope-ink); }
.btn.danger-text { color: var(--bad); }
.field-label { font-weight: 600; }
.field { width: 100%; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper-2); color: var(--ink); font-size: 16px; letter-spacing: .04em; text-transform: uppercase; }
.field::placeholder { color: var(--ink-faint); }
.field:focus { border-color: var(--envelope); }

/* ───── Hébreu : sens de lecture droite → gauche ─────
 * L'essentiel se retourne tout seul : grilles, flex, propriétés logiques (inset-inline, margin-inline,
 * text-align: start/end…). Ici, ce que les propriétés logiques ne savent pas exprimer, et ce qui ne doit
 * surtout pas se retourner. Le français (dir="ltr") n'est touché par aucune de ces règles. */

/* Bandeau מבזק : l'étiquette passe à droite (flex), et le texte défile de gauche à droite,
 * pour que le début de la phrase entre en premier. */
@keyframes tick-rtl { to { transform: translateX(100%); } }
:root[dir="rtl"] .ticker .t-run span { animation-name: tick-rtl; }

/* Dégradés orientés : la lumière suit le début de ligne. */
:root[dir="rtl"] .tv-head { background: linear-gradient(270deg, #12245e, #0a1433); }
:root[dir="rtl"] .card.tone-great .card-kicker { background: linear-gradient(270deg, #b8860b, #f2c94c); }
:root[dir="rtl"] .tier-or .e-top, :root[dir="rtl"] .tier-legende .e-top, :root[dir="rtl"] .tier-icone .e-top { background-image: radial-gradient(circle at 15% 0%, rgba(255, 207, 26, .25), transparent 55%); }

/* Ce qui ne se retourne pas. */
/* Courbes : l'axe du temps va toujours de gauche à droite (et text-anchor="end" reste à gauche du point). */
:root[dir="rtl"] svg { direction: ltr; }
/* Score « 84 / 100 » : les chiffres se lisent de gauche à droite, le bloc reste calé à droite. */
:root[dir="rtl"] .endcard .e-score { direction: ltr; justify-content: flex-end; }
:root[dir="rtl"] .pi-score small { direction: ltr; unicode-bidi: isolate; }
/* Code de duel (LIKUD-K1A2B3C-31204) : un code latin se saisit de gauche à droite. */
:root[dir="rtl"] .field { direction: ltr; text-align: left; }
/* Adresses web (références, sources des mèmes) : toujours de gauche à droite, tirets et barres à leur place. */
:root[dir="rtl"] :is(.panel.refs, .modal-src) a { direction: ltr; unicode-bidi: isolate; }
/* Drake : le gabarit garde son visage à gauche, comme l'original (et 👉 montre toujours le texte). */
:root[dir="rtl"] .drake { direction: ltr; }
:root[dir="rtl"] .drake .d-text { direction: rtl; }
/* Nombres seuls (« +2,1 », « −3 », « 4,2 % », « 12 / 20 ») : sens déduit du contenu, pour que le signe
 * reste à gauche des chiffres et qu'une fraction ne s'inverse pas. L'alignement reste celui de la colonne. */
:root[dir="rtl"] :is(.num, .gauge .g-val, .barrow .b-val, .segrow .sr-val, .ch-v, .stat b, .coal-meter span, .menu-item small) { unicode-bidi: plaintext; }
:root[dir="rtl"] .seats-big > .num { unicode-bidi: normal; }
:root[dir="rtl"] :is(.barrow .b-val, .segrow .sr-val, .ch-v) { text-align: left; }
:root[dir="rtl"] :is(.stat b, .menu-item small) { text-align: right; }
/* Pastilles d'effet, étiquettes de coût, écarts (« +3 באזז », « −₪0,8M », « ▲2 ») : le nombre signé en tête se lit
 * de gauche à droite, signe compris ; le libellé hébreu reste d'un seul tenant à sa droite. */
:root[dir="rtl"] :is(.eff, .tag, .delta-up, .delta-down) { direction: ltr; unicode-bidi: isolate; }
/* Flèches et chevrons à retourner : <span class="flip-rtl">←</span> pointe vers la droite en hébreu. */
:root[dir="rtl"] .flip-rtl { display: inline-block; transform: scaleX(-1); }

/* ───── Hébreu : typographie ───── */
/* L'hébreu ne s'espace pas et n'a pas de capitales : l'interlettrage casse les mots, et text-transform
 * ne ferait que mettre en majuscules les mots latins (« TIKTOK »). */
:root:lang(he) :is(.btn, .hero h1, .ballotbox .box span, .seats-big .seuil, .gauge .g-label, .card-kicker, .panel h3,
  .tv-head .channel, .tv-head .live, .meme .m-top, .meme .m-bottom, .exit thead th, .duel-row .d-label, .pill, .tier-pill, .mahapach b) {
  letter-spacing: normal;
  text-transform: none;
}
/* Styles en ligne posés par le script (fiche de fin) : mêmes corrections. */
:root:lang(he) #app [style*="letter-spacing"] { letter-spacing: normal !important; }
:root:lang(he) #app [style*="uppercase"] { text-transform: none !important; }
/* Pas d'italique en hébreu (Rubik n'en a pas : le navigateur penche les lettres) : l'accent passe par la couleur. */
:root:lang(he) em, :root:lang(he) .bubble .fwd { font-style: normal; }
:root:lang(he) #app [style*="italic"] { font-style: normal !important; }
/* Karantina : à corps égal, la lettre hébraïque est moins haute qu'une capitale latine. Les titres hébreux prennent
 * environ 8 % de plus pour garder le poids visuel des titres français ; les petits libellés, privés de leurs
 * capitales espacées, gagnent un point pour rester lisibles. */
:root:lang(he) .hero h1 { font-size: 50px; line-height: 1; }
:root:lang(he) .step-head h2 { font-size: 44px; }
:root:lang(he) .card-title, :root:lang(he) .modal h2 { font-size: 37px; }
:root:lang(he) .endcard .e-top h2 { font-size: 48px; line-height: 1; }
:root:lang(he) .section-title h2, :root:lang(he) .share h3 { font-size: 33px; }
:root:lang(he) .outcome .o-verdict { font-size: 31px; }
:root:lang(he) .tv-head .channel { font-size: 28px; }
:root:lang(he) .gauge .g-label, :root:lang(he) .duel-row .d-label { font-size: 12.5px; }
:root:lang(he) .card-kicker { font-size: 13px; }
:root:lang(he) .pill, :root:lang(he) .tv-head .live { font-size: 12px; }
:root:lang(he) .panel h3 { font-size: 16px; }
:root:lang(he) .exit thead th { font-size: 13px; }
:root:lang(he) .tier-pill { font-size: 14px; }
:root:lang(he) .seats-big .seuil { font-size: 11.5px; }
/* Le texte du partage : en hébreu, la police du texte plutôt qu'une chasse fixe sans lettres hébraïques. */
:root:lang(he) .share-box { font-family: var(--font-body); font-size: 14px; }
/* Mèmes « macro » en hébreu : Karantina plutôt qu'Anton, à un corps qui rend la masse des capitales d'Anton.
 * (Les lignes entièrement hébraïques ont déjà leur réglage, .meme .m-he.) */
:root:lang(he) .meme :is(.m-top, .m-bottom):not(.m-he) { font-size: clamp(24px, 10.5cqi, 58px); line-height: 1; }
:root:lang(he) .meme.m-long :is(.m-top, .m-bottom):not(.m-he) { font-size: clamp(20px, 9cqi, 48px); }

/* Emplacements publicitaires (vides tant que la pub n'est pas configurée). Un seul par écran, toujours en dernier,
 * à 150 px au moins du dernier bouton (recommandation de Google pour les jeux). La taille de l'annonce est écrite
 * sur le <ins> par js/ui/ads.js (Google ne prend pas en charge une taille fixée par une feuille de style externe). */
.ad-slot { margin: 104px 0 0; padding: 8px 0 0; border-top: 1px dashed var(--line, #d5dbe8); text-align: center; }
.ad-slot .ad-label { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; }
:root:lang(he) .ad-slot .ad-label { letter-spacing: 0; text-transform: none; font-size: 12px; }
/* Pas d'annonce à montrer, ou bloqueur de pub : l'emplacement disparaît. */
.ad-slot:has(ins[data-ad-status="unfilled"]), .ads-off .ad-slot:not(.sponsor) { display: none; }
.ad-slot.sponsor img { display: block; max-width: 100%; height: auto; margin: 0 auto; border-radius: 10px; }

/* Mention « jeu satirique » dans les graphiques de sondage, de sortie des urnes et de résultats. */
.sim-band { background: #ffd21f; color: #1b1400; font-weight: 800; font-size: 13px; line-height: 1.3; text-align: center; padding: 5px 10px; letter-spacing: .02em; }
:root:lang(he) .sim-band { letter-spacing: 0; font-size: 14px; }
.poll-notice { margin: 10px 0 0; font-size: 12px; line-height: 1.45; color: var(--ink-faint); }
