/* ===========================================================================
   styles.css — Habillage sobre (inspiré de 1in8b.life) par-dessus Bootstrap 5.3
   Fond neutre, police système, filets fins, jauges fines, peu de couleurs.
   Thème clair / sombre : attribut data-bs-theme sur <html> (posé avant
   l'affichage par le script du <head>, basculé par le bouton ◐).
   Toutes les couleurs passent par les variables ci-dessous.
   =========================================================================== */

/* --- Variables : thème clair ------------------------------------------------ */
:root,
[data-bs-theme="light"] {
  --bg: #f5f4ef;            /* papier chaud */
  --surface: #ffffff;
  --surface-2: #f0efe9;
  --surface-3: #e5e3db;
  --border: #e3e1d9;
  --border-strong: #c9c6bb;
  --text: #1d2125;
  --text-2: #454b51;
  --muted: #6f767c;
  --accent: #2b5d8e;        /* encre bleue */
  --accent-hover: #224b74;
  --accent-ink: #ffffff;    /* texte posé sur l'accent */
  --accent-soft: #e4ecf4;
  --good: #2e7d4f;
  --good-soft: #e5f1e9;
  --warn: #a2670f;
  --warn-soft: #f6ecd8;
  --bad: #b03a3a;
  --bad-ink: #ffffff;
  --bad-soft: #f6e3e1;
  --decision: #6d4a9c;      /* prune : décisions du maire (journal, frise) */
  --decision-ink: #ffffff;
  --decision-soft: #f1ebf8;
  --chart-grid: rgba(0, 0, 0, 0.07);
  --chart-text: #6b7177;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 4px 16px rgba(0, 0, 0, 0.06);
  --overlay: rgba(20, 22, 24, 0.55);
}

/* --- Variables : thème sombre ----------------------------------------------- */
[data-bs-theme="dark"] {
  --bg: #121416;
  --surface: #1a1d20;
  --surface-2: #22262a;
  --surface-3: #2c3136;
  --border: #2c3136;
  --border-strong: #3f464d;
  --text: #e6e8ea;
  --text-2: #c0c6cc;
  --muted: #8f969d;
  --accent: #7aaedf;
  --accent-hover: #96c0e9;
  --accent-ink: #0e1a26;
  --accent-soft: #1c2a38;
  --good: #67bf8a;
  --good-soft: #17271e;
  --warn: #e0ac4c;
  --warn-soft: #2c2415;
  --bad: #ec7c7c;
  --bad-ink: #2a0f0f;
  --bad-soft: #301b1b;
  --decision: #b99ae6;
  --decision-ink: #1b1424;
  --decision-soft: #251d33;
  --chart-grid: rgba(255, 255, 255, 0.08);
  --chart-text: #969da4;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
  --overlay: rgba(0, 0, 0, 0.6);
}

/* Repli si le script du <head> n'a pas tourné : on suit le système. */
@media (prefers-color-scheme: dark) {
  :root:not([data-bs-theme]) {
    --bg: #121416; --surface: #1a1d20; --surface-2: #22262a; --surface-3: #2c3136;
    --border: #2c3136; --border-strong: #3f464d; --text: #e6e8ea; --text-2: #c0c6cc;
    --muted: #8f969d; --accent: #7aaedf; --accent-hover: #96c0e9; --accent-ink: #0e1a26;
    --accent-soft: #1c2a38; --good: #67bf8a; --good-soft: #17271e; --warn: #e0ac4c;
    --warn-soft: #2c2415; --bad: #ec7c7c; --bad-ink: #2a0f0f; --bad-soft: #301b1b;
    --decision: #b99ae6; --decision-ink: #1b1424; --decision-soft: #251d33;
    --chart-grid: rgba(255, 255, 255, 0.08); --chart-text: #969da4;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.35);
    --overlay: rgba(0, 0, 0, 0.6);
  }
}

/* --- Raccord Bootstrap ------------------------------------------------------ */
:root,
[data-bs-theme] {
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --bs-body-font-family: var(--font);
  --bs-body-font-size: 0.9375rem;
  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-emphasis-color: var(--text);
  --bs-secondary-color: var(--muted);
  --bs-border-color: var(--border-strong);
  --bs-link-color: var(--accent);
  --bs-link-hover-color: var(--accent-hover);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4 { color: var(--text); }
.muted { color: var(--muted); font-weight: 400; }
[hidden] { display: none !important; }

:where(button, a, summary, input, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Boutons Bootstrap, version sobre */
.btn { border-radius: 6px; font-weight: 600; }
.btn-lg { border-radius: 8px; font-size: 1rem; padding: 10px 20px; }
.btn-sm { border-radius: 5px; }
.btn-primary {
  --bs-btn-color: var(--accent-ink);
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: var(--accent-ink);
  --bs-btn-hover-bg: var(--accent-hover);
  --bs-btn-hover-border-color: var(--accent-hover);
  --bs-btn-active-color: var(--accent-ink);
  --bs-btn-active-bg: var(--accent-hover);
  --bs-btn-active-border-color: var(--accent-hover);
  --bs-btn-disabled-color: var(--accent-ink);
  --bs-btn-disabled-bg: var(--accent);
  --bs-btn-disabled-border-color: var(--accent);
}
.btn-outline-primary {
  --bs-btn-color: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-color: var(--accent-ink);
  --bs-btn-hover-bg: var(--accent);
  --bs-btn-hover-border-color: var(--accent);
  --bs-btn-active-color: var(--accent-ink);
  --bs-btn-active-bg: var(--accent);
  --bs-btn-active-border-color: var(--accent);
  --bs-btn-disabled-color: var(--accent);
  --bs-btn-disabled-border-color: var(--accent);
}
.btn-outline-secondary {
  --bs-btn-color: var(--text-2);
  --bs-btn-border-color: var(--border-strong);
  --bs-btn-hover-color: var(--text);
  --bs-btn-hover-bg: var(--surface-2);
  --bs-btn-hover-border-color: var(--border-strong);
  --bs-btn-active-color: var(--text);
  --bs-btn-active-bg: var(--surface-3);
  --bs-btn-active-border-color: var(--border-strong);
}
.btn-danger {
  --bs-btn-color: var(--bad-ink);
  --bs-btn-bg: var(--bad);
  --bs-btn-border-color: var(--bad);
  --bs-btn-hover-color: var(--bad-ink);
  --bs-btn-hover-bg: var(--bad);
  --bs-btn-hover-border-color: var(--bad);
}
.form-control {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  border-radius: 6px;
}
.form-control:focus {
  background-color: var(--surface);
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-control::placeholder { color: var(--muted); }

/* Petits boutons maison (barre du haut) */
.icon-btn,
.ctl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.icon-btn { width: 32px; font-size: 1rem; }
a.icon-btn { text-decoration: none; }
.ctl-btn { padding: 0 12px; font-size: 0.85rem; white-space: nowrap; min-width: 96px; }
.icon-btn:hover,
.ctl-btn:hover { background: var(--surface-2); }
.icon-btn[aria-pressed="true"] { background: var(--surface-3); }
.ctl-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

.speed-group {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  overflow: hidden;
}
.speed-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  min-width: 34px;
  height: 30px;
  padding: 0 6px;
  border: none;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: pointer;
}
/* Durée réelle d'une année de jeu, en petit sous le multiplicateur :
   seulement sur la vitesse choisie (les autres la donnent en infobulle). */
.speed-sec { display: none; font-size: 0.6rem; font-weight: 500; opacity: 0.85; }
.speed-btn + .speed-btn { border-left: 1px solid var(--border); }
.speed-btn:hover { background: var(--surface-2); }
.speed-btn.active { background: var(--accent); color: var(--accent-ink); }
.speed-btn.active .speed-sec { display: block; }

.party-pill {
  display: inline-block;
  padding: 0 8px;
  border: 1px solid var(--party-color, var(--border-strong));
  border-radius: 999px;
  background: color-mix(in srgb, var(--party-color, transparent) 10%, transparent);
  color: var(--text-2);
  font-size: 0.74rem;
  line-height: 1.6;
  white-space: nowrap;
}
.party-pill:empty { display: none; }

/* --- Icônes Phosphor (js/icons.js) ---------------------------------------- */
/* Alignées sur la ligne de texte ; couleur héritée (currentColor). */
.ph, .ph-fill { vertical-align: -0.125em; }
.icon-btn .ph, .icon-btn .ph-fill { font-size: 1.05rem; vertical-align: 0; }
.ctl-btn .ph { margin-right: 2px; }
.city-zoom .ph { font-size: 1rem; vertical-align: 0; }
.party-ico { color: var(--party-color, currentColor); }
.party-pill .ph { color: var(--party-color, currentColor); }
.party-option .party-emoji { color: var(--party-color, currentColor); }
.win-mark { color: var(--warn); }
.ms-mark { color: var(--muted); }
.milestone-list .is-done .ms-mark { color: var(--good); }
.j-item.j-good .j-emoji { color: var(--good); }
.j-item.j-bad .j-emoji,
.j-item.j-alert .j-emoji { color: var(--bad); }
.j-item.j-decision .j-emoji { color: var(--decision); }
.j-item.j-info .j-emoji { color: var(--accent); }
.toast-good .toast-emoji { color: var(--good); }
.toast-bad .toast-emoji { color: var(--bad); }
.toast-info .toast-emoji { color: var(--accent); }
.verdict.win .verdict-emoji { color: var(--good); }
.verdict.lose .verdict-emoji { color: var(--bad); }
.gameover-emoji { color: var(--muted); }
.dec-align.is-approve .ph { color: var(--good); }
.dec-align.is-disapprove .ph { color: var(--bad); }
.live-badge .ph-fill { font-size: 0.6rem; vertical-align: 0.05em; }

/* ===========================================================================
   LANDING PAGE
   =========================================================================== */
.landing {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px 40px;
}
.landing-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

/* Logo MandatCity (mv_logo, _inc/fonctions.php) : version claire ou sombre selon data-bs-theme.
   Complet sur l'accueil, le classement et l'admin ; icône seule dans l'en-tête du jeu. */
.brand-logo { display: inline-flex; align-items: center; flex-shrink: 0; line-height: 0; border-radius: 6px; }
.brand-logo img { height: 44px; width: auto; }
.brand-logo-icone img { height: 36px; }
.brand-logo .logo-sombre,
[data-bs-theme="dark"] .brand-logo .logo-clair { display: none; }
[data-bs-theme="dark"] .brand-logo .logo-sombre { display: block; }
/* Petit écran : l'icône seule, c'est-à-dire le carré gauche de l'image */
@media (max-width: 720px) {
  .brand-logo img { width: 36px; height: 36px; object-fit: cover; object-position: left center; }
}

.landing-hero {
  padding: 28px 0 32px;
  border-bottom: 1px solid var(--border);
}
.eyebrow {
  margin: 0 0 10px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-title {
  margin: 0 0 16px;
  font-size: clamp(2.4rem, 7vw, 4.4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
/* Plan vivant de la hero (js/hero.js) : couleurs propres au plan (vue
   aérienne), fond = couleur d'attente du moteur pour éviter tout flash.
   Surtitre et titre sont posés par-dessus, sur un dégradé sombre. */
.hero-map {
  position: relative;
  height: clamp(320px, 50vw, 500px);
  margin: 0 0 28px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #a9b97f;
  box-shadow: var(--shadow);
}
.hero-map canvas {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;          /* la molette fait défiler la page */
}
[data-bs-theme="dark"] .hero-map canvas { filter: brightness(0.88) saturate(0.95); }
.hero-overlay {
  position: absolute;
  inset: 0 0 auto 0;
  padding: clamp(18px, 3.4vw, 36px) clamp(18px, 3.4vw, 40px) clamp(48px, 7vw, 90px);
  background: linear-gradient(180deg, rgba(14, 18, 22, 0.78) 0%, rgba(14, 18, 22, 0.5) 55%, rgba(14, 18, 22, 0) 100%);
  color: #fff;
  pointer-events: none;
}
.hero-overlay .eyebrow {
  color: rgba(255, 255, 255, 0.86);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.hero-overlay .hero-title {
  margin: 0;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
}
.hero-map-chip {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text);
  font-size: 0.84rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}
.hero-map-chip b { font-variant-numeric: tabular-nums; }
.hero-map-chip .ph { color: var(--accent); }
.hero-map-north {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text-2);
  font-size: 1.35rem;
  box-shadow: var(--shadow);
}
.hero-map-north .ph { vertical-align: 0; }

.hero-lead {
  margin: 0 0 10px;
  max-width: 34ch;
  font-size: clamp(1.15rem, 2.6vw, 1.5rem);
  line-height: 1.35;
}
.hero-sub { margin: 0 0 14px; max-width: 62ch; color: var(--text-2); }
.hero-badges { margin: 0 0 22px; font-size: 0.84rem; color: var(--muted); }

.resume-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  max-width: 780px;
  margin: 0 0 16px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.resume-card.is-over { border-left-color: var(--border-strong); box-shadow: none; }
.resume-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.resume-kicker {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.resume-city { font-size: 1.3rem; }
.resume-meta { font-size: 0.84rem; color: var(--text-2); }

.landing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  gap: 40px;
  align-items: start;
  padding-top: 32px;
}

.explain-block { margin-bottom: 28px; }
.explain-block h2 { margin: 0 0 8px; font-size: 1.15rem; font-weight: 750; }
.explain-block p { margin: 0 0 8px; max-width: 68ch; color: var(--text-2); }
.explain-note { font-size: 0.86rem; }

.howto-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.howto-steps li {
  position: relative;
  max-width: 68ch;
  padding: 0 0 12px 40px;
  color: var(--text-2);
  counter-increment: step;
}
.howto-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}
.howto-steps strong { color: var(--text); }

.weights { max-width: 540px; margin: 0 0 8px; padding: 0; list-style: none; }
.weights li {
  display: grid;
  grid-template-columns: minmax(0, 15em) 1fr 3em;
  gap: 10px;
  align-items: center;
  padding: 3px 0;
  font-size: 0.86rem;
}
.w-bar { height: 6px; overflow: hidden; border-radius: 3px; background: var(--surface-3); }
.w-bar > span { display: block; height: 100%; background: var(--accent); }
.w-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

.setup-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  scroll-margin-top: 16px;
}
.setup-card h2 { margin: 0 0 6px; font-size: 1.15rem; font-weight: 750; }
.setup-steps { margin: 0; padding: 0; list-style: none; }
.setup-step { padding: 10px 0 12px; border-bottom: 1px solid var(--border); }
.step-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.92rem;
  font-weight: 650;
}
.step-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.74rem;
  font-weight: 700;
}
.step-help { margin: 4px 0 6px; font-size: 0.78rem; color: var(--muted); }
.accueil-city-row { display: flex; gap: 8px; }
/* Année d'élection de départ (sous la ville) */
.accueil-year-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.accueil-year-label { flex: 0 0 auto; font-size: 0.82rem; color: var(--text-2); }
.accueil-year-row .form-select { flex: 1 1 auto; min-width: 0; }
#accueil-city-info.is-blocked { color: var(--bad); font-weight: 600; }
/* Style de partie (radios en cartes, comme les partis) */
.style-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.style-option {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.3;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.style-option:hover { background: var(--surface-2); }
.style-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.style-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.style-option:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  box-shadow: inset 0 0 0 1px var(--accent);
}
.style-name { font-weight: 600; }
.style-desc { color: var(--muted); font-size: 0.74rem; }
@media (max-width: 420px) { .style-grid { grid-template-columns: 1fr; } }
/* Titre du joueur (Monsieur le Maire / Madame la Maire) : deux icônes à gauche du pseudo */
.mayor-row { display: flex; align-items: stretch; gap: 8px; }
.mayor-row .form-control { flex: 1 1 auto; min-width: 0; }
.gender-toggle { display: flex; flex: 0 0 auto; gap: 4px; }
.gender-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-height: 38px;
  margin: 0;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 1.25rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}
.gender-option:hover { background: var(--surface-2); color: var(--text); }
.gender-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.gender-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.gender-option:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
  box-shadow: inset 0 0 0 1px var(--accent);
  color: var(--accent);
}
.form-error { margin: 12px 0 0; color: var(--bad); font-size: 0.86rem; font-weight: 600; }
#btn-start-game { margin-top: 14px; }
.setup-note { margin: 8px 0 0; font-size: 0.76rem; color: var(--muted); text-align: center; }
.landing-foot {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.76rem;
  color: var(--muted);
}

/* Avis de joueurs (bas de la landing, index.php ; publiés depuis admin/admin-avis.php) */
.avis-joueurs { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--border); }
.avis-titre { margin: 0 0 16px; font-size: 1.35rem; font-weight: 800; }
.avis-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.avis-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 18px 18px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}
.avis-quote { font-size: 1.6rem; line-height: 1; color: var(--accent); }
.avis-texte { flex: 1 1 auto; margin: 0; color: var(--text); white-space: pre-line; overflow-wrap: anywhere; }
.avis-auteur {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 0.86rem;
}
.avis-meta { font-size: 0.8rem; color: var(--muted); }
.avis-note { margin: 14px 0 0; font-size: 0.78rem; color: var(--muted); }

/* Aperçu du classement (bas de la landing, index.php) : les 10 plus longs mandats,
   en deux colonnes lues de haut en bas (1 à 5, puis 6 à 10), une seule sur mobile. */
.top-maires { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--border); }
.top-lead { max-width: 680px; margin: -6px 0 16px; font-size: 0.92rem; color: var(--text-2); }
.top-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(var(--top-rows, 5), auto);
  grid-auto-flow: column;
  gap: 8px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.top-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  height: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.top-row:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); }
.top-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.top-row.is-moi { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.top-rang { font-size: 1.25rem; font-weight: 800; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.top-list > li:nth-child(-n+3) .top-rang { color: var(--warn); }
.top-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.top-maire { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.top-pseudo { overflow-wrap: anywhere; }
.top-ville { font-size: 0.82rem; color: var(--text-2); }
.top-ville b { color: var(--text); }
.top-duree { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.top-duree strong { white-space: nowrap; }
.top-actions { margin: 16px 0 0; }
@media (max-width: 760px) {
  .top-list { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-flow: row; }
}
@media (max-width: 480px) {
  .top-row { grid-template-columns: 26px minmax(0, 1fr); padding: 10px 12px; }
  .top-rang { grid-row: 1 / span 2; align-self: start; }
  .top-duree { grid-column: 2; flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 10px; text-align: left; }
}

/* Formulaire d'avis (js/avis.js) : fin de partie, élection perdue, carte « Dernière partie » */
.gameover-avis { margin-top: 16px; text-align: left; }
.resume-avis { flex: 1 1 100%; margin-top: 0; }
.avis-form-wrap > summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.gameover-panel .avis-form-wrap > summary { text-align: center; }
.avis-form { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.avis-form textarea { min-height: 96px; resize: vertical; }
.avis-compteur { align-self: flex-end; font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.avis-consent { margin: 0; font-size: 0.76rem; color: var(--muted); }
.avis-form .form-error { margin: 0; }
.avis-form .btn { align-self: flex-start; }
.avis-merci { margin: 0; font-size: 0.86rem; font-weight: 600; color: var(--good); }

/* Administration (dossier admin/, protégé par admin/.htaccess ; _inc/admin.php) */
.adm-marque { display: inline-flex; align-items: center; gap: 8px; flex-shrink: 0; }
.adm-wordmark-tag {
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 2px;
}
.adm .nav-link-btn[aria-current="page"] { border-color: var(--accent); color: var(--accent); }
.adm-alerte {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 0;
  padding: 12px 14px;
  background: var(--warn-soft);
  border: 1px solid var(--warn);
  border-radius: 8px;
  font-size: 0.86rem;
}
.adm-alerte .ph-fill { font-size: 1.4rem; color: var(--warn); }
.adm-message {
  max-width: 680px;
  margin: 0 0 16px;
  padding: 10px 14px;
  background: var(--accent-soft);
  border-radius: 8px;
  font-size: 0.86rem;
}
.adm-tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 16px; margin: 0 0 32px; }
.adm-tuile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  color: var(--text);
  text-decoration: none;
}
.adm-tuile:hover { border-color: var(--accent); color: var(--text); }
.adm-tuile.is-urgent { border-left: 4px solid var(--warn); }
.adm-tuile-ico { font-size: 1.6rem; line-height: 1; color: var(--accent); }
.adm-tuile-titre { font-size: 1.05rem; font-weight: 750; }
.adm-tuile-chiffre { font-size: 2rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.adm-tuile.is-urgent .adm-tuile-chiffre { color: var(--warn); }
.adm-tuile-texte { flex: 1 1 auto; font-size: 0.86rem; color: var(--text-2); }
.adm-tuile-lien { font-size: 0.86rem; font-weight: 600; color: var(--accent); }
.adm-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.adm-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 600;
  text-decoration: none;
}
.adm-tab:hover { background: var(--surface-2); color: var(--text); }
.adm-tab.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.adm-count {
  min-width: 1.6em;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 0.74rem;
  text-align: center;
}
.adm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 16px; margin: 0 0 32px; }
.adm-meta { margin: 0; font-size: 0.76rem; color: var(--muted); }
.adm-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.adm-vide { color: var(--muted); }

/* Partis (landing : radios ; colonne Suivre : boutons) */
.party-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.party-switch { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; }
.party-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin: 0;
  padding: 8px 4px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.74rem;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.party-option:hover { background: var(--surface-2); }
.party-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.party-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.party-option:has(input:checked),
.party-option.is-selected {
  border-color: var(--party-color);
  background: color-mix(in srgb, var(--party-color) 10%, var(--surface));
  box-shadow: inset 0 0 0 1px var(--party-color);
}
.party-emoji { font-size: 1.25rem; }
.party-name { font-weight: 600; }
.party-program {
  margin-top: 10px;
  padding: 8px 12px;
  border-left: 3px solid var(--party-color);
  border-radius: 0 6px 6px 0;
  background: var(--surface-2);
  font-size: 0.82rem;
}
.party-tagline { color: var(--muted); }
.party-program ul { margin: 4px 0 0; padding-left: 18px; color: var(--text-2); }

/* Sélecteur de promesses (landing, soirée électorale, modale programme) */
.promise-picker { margin-top: 4px; }
.pp-list { display: grid; grid-template-columns: 1fr; gap: 6px; }
.pp-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.pp-item:hover:not(:disabled) { border-color: var(--border-strong); background: var(--surface-2); }
.pp-item:disabled { opacity: 0.45; cursor: not-allowed; }
.pp-check {
  flex: none;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  color: var(--accent-ink);
  font-size: 11px;
  line-height: 1;
}
.pp-item.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.pp-item.is-selected .pp-check { border-color: var(--accent); background: var(--accent); }
.pp-item.is-selected .pp-check::after { content: '\e182'; font-family: 'Phosphor'; font-weight: normal; }
.pp-label { display: block; font-size: 0.86rem; font-weight: 600; }
.pp-hint { display: block; font-size: 0.76rem; line-height: 1.35; color: var(--muted); }
.pp-count { margin: 8px 0 0; font-size: 0.8rem; font-weight: 600; color: var(--warn); }
.pp-count.is-ok { color: var(--good); }

/* ===========================================================================
   ÉCRAN DE JEU
   =========================================================================== */
.jeu {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

/* --- Barre du haut ----------------------------------------------------------- */
.topbar {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.tb-id { display: flex; flex-direction: column; min-width: 0; max-width: 260px; line-height: 1.25; }
.tb-city {
  overflow: hidden;
  font-size: 1.05rem;
  font-weight: 750;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tb-mayor {
  overflow: hidden;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.tb-time { flex: 1 1 240px; min-width: 210px; max-width: 420px; font-size: 0.86rem; }
.tb-time-line { white-space: nowrap; font-variant-numeric: tabular-nums; }
.tb-progress {
  height: 4px;
  margin: 4px 0 2px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--surface-3);
}
.tb-progress > span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.4s ease;
}
.tb-countdown { font-size: 0.75rem; color: var(--muted); }
.tb-hud {
  display: none;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tb-vote {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tb-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* --- Grille 3 colonnes --------------------------------------------------- */
.game {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(270px, 310px) minmax(0, 1fr) minmax(290px, 340px);
  /* Colonnes en cartes posées sur le fond, séparées par un petit couloir (façon 1in8b.life). */
  gap: 8px;
  padding: 8px;
  min-height: 0;
}
.col {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
  border: 1px solid var(--border);
  border-radius: 10px; /* le défilement (overflow) rogne le contenu aux coins arrondis */
}
.col-left,
.col-right { background: var(--surface); }
/* Colonne centrale : deux cartes, plan + frise puis journal, séparées par le même
   couloir que les colonnes (.game). La colonne elle-même n'a ni bord ni fond. */
.col-center {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  border: none;
  border-radius: 0;
}
.city-card,
.journal {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden; /* rogne le plan et la liste aux coins arrondis */
}
.city-card {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}
.col-title {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0;
  padding: 10px 16px 6px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- Sections repliables ----------------------------------------------- */
.sec { border-bottom: 1px solid var(--border); }
.col > .sec:last-child { border-bottom: none; } /* la bordure de la carte-colonne suffit */
.sec > summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary::before {
  content: '\e13a';
  font-family: 'Phosphor';
  display: inline-block;
  font-size: 0.75rem;
  color: var(--muted);
  transition: transform 0.15s ease;
}
.sec[open] > summary::before { transform: rotate(90deg); }
.sec > summary:hover { background: var(--surface-2); }
.sum-meta {
  margin-left: auto;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sec-body { padding: 0 16px 14px; }
.sec-help { margin: 0 0 8px; font-size: 0.8rem; color: var(--muted); }
.sub-title {
  margin: 14px 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.sub-title .muted { text-transform: none; letter-spacing: 0; }

.is-good { color: var(--good); }
.is-bad { color: var(--bad); }
.bs-note strong.is-warn { color: var(--warn); } /* risque de manifestation « réel » (séance du budget) */

/* --- GÉRER : budget ----------------------------------------------------------- */
.budget { margin: 0 0 8px; }
.bp-line { display: flex; justify-content: space-between; align-items: baseline; padding: 3px 0; }
.bp-line dt { font-size: 0.86rem; font-weight: 600; color: var(--text-2); }
.bp-line dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.bp-detail {
  margin: -2px 0 4px;
  font-size: 0.74rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.bp-detail > span { white-space: nowrap; }
.bp-total { margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--border); }
.bp-total dd { font-size: 1.05rem; }

/* --- GÉRER : curseurs ----------------------------------------------------- */
.lever { padding: 8px 0 10px; border-bottom: 1px dashed var(--border); }
.lever:last-child { border-bottom: none; }
.lever-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
  font-size: 0.85rem;
  font-weight: 600;
}
.lever-head label { margin: 0; }
.lever-pct { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lever-feedback { margin: 4px 0 0; font-size: 0.76rem; line-height: 1.35; color: var(--muted); }
.lever-feedback.is-good,
.lever-feedback.is-warn,
.lever-feedback.is-bad,
.lever-feedback.is-flat { color: var(--muted); }
.lever-feedback.is-good::before,
.lever-feedback.is-warn::before,
.lever-feedback.is-bad::before,
.lever-feedback.is-flat::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: 1px;
  background: var(--border-strong);
}
.lever-feedback.is-good::before { background: var(--good); }
.lever-feedback.is-warn::before { background: var(--warn); }
.lever-feedback.is-bad::before { background: var(--bad); }

/* Impôts, taxes et tarifs votés (lecture seule) : position du taux entre 0 et le
   plafond légal ; le trait vertical marque la moyenne nationale (ou l'habitude). */
.lever-ro .lever-head > span:first-child { min-width: 0; }
.lever-bar {
  position: relative;
  height: 6px;
  margin: 5px 0 2px;
  border-radius: 3px;
  background: var(--surface-3);
}
.lever-bar > span { display: block; height: 100%; border-radius: 3px; background: var(--accent); }
.lever-bar > i {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 12px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--text-2);
}
.fin-session { margin-top: 6px; }
.fin-tutelle {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--bad-soft);
  color: var(--bad);
  font-size: 0.8rem;
  line-height: 1.4;
}

/* Dette : emprunts en cours */
.loan-list { margin: 0 0 6px; padding: 0; list-style: none; font-size: 0.8rem; }
.loan {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0 6px;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}
.loan:last-child { border-bottom: none; }
.loan-name { min-width: 0; font-weight: 600; color: var(--text-2); }
.loan-num { font-weight: 700; font-variant-numeric: tabular-nums; }
.loan-meta { grid-column: 2 / -1; font-size: 0.74rem; color: var(--muted); }
.loan.is-bad .loan-name,
.loan.is-bad .ph { color: var(--bad); }
.loan.is-empty { display: block; color: var(--muted); }

/* Boutons segmentés (urbanisme) */
.seg {
  display: flex;
  margin-top: 4px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
}
.urbanism-btn {
  flex: 1;
  padding: 5px 4px;
  border: none;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.urbanism-btn + .urbanism-btn { border-left: 1px solid var(--border-strong); }
.urbanism-btn:hover { background: var(--surface-2); }
.urbanism-btn.active { background: var(--accent); color: var(--accent-ink); }

.milestone-list { margin: 0; padding: 0; list-style: none; font-size: 0.8rem; }
.milestone-list li { padding: 2px 0; color: var(--text-2); }
.milestone-list li.is-done { color: var(--good); }

/* --- GÉRER : services publics ------------------------------------------------- */
.svc-list { display: flex; flex-direction: column; }
.svc-row { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.svc-row:last-child { border-bottom: none; }
.svc-main { display: flex; align-items: center; gap: 6px; }
.svc-emoji { width: 1.4em; font-size: 1.05rem; text-align: center; }
.svc-name { flex: 1; min-width: 0; font-size: 0.86rem; font-weight: 600; }
.svc-tag {
  padding: 0 4px;
  border: 1px solid currentColor;
  border-radius: 4px;
  color: var(--warn);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.svc-count {
  min-width: 2.2em;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.svc-btn {
  padding: 2px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.svc-btn:hover:not(:disabled) { background: var(--surface-2); }
.svc-build:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.svc-build:hover:not(:disabled) { background: var(--accent); color: var(--accent-ink); }
.svc-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.svc-cov { display: flex; align-items: center; gap: 8px; margin: 5px 0 0 calc(1.4em + 6px); }
.svc-cov-track { flex: 1; height: 4px; overflow: hidden; border-radius: 2px; background: var(--surface-3); }
.svc-cov-fill { width: 0; height: 100%; background: var(--accent); transition: width 0.4s ease; }
.svc-cov-fill.cov-ok { background: var(--good); }
.svc-cov-fill.cov-warn { background: var(--warn); }
.svc-cov-fill.cov-bad { background: var(--bad); }
.svc-cov-pct {
  min-width: 3.4em;
  font-size: 0.74rem;
  color: var(--muted);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.svc-desc { margin: 3px 0 0 calc(1.4em + 6px); font-size: 0.74rem; line-height: 1.35; color: var(--muted); }

/* --- CENTRE : plan de la ville ---------------------------------------------- */
.city-view {
  position: relative;
  flex: 1 1 0;
  min-height: clamp(160px, 30vh, 240px); /* moins haut sur les écrans courts : place au journal */
  border-bottom: 1px solid var(--border);
  background: #a9b97f; /* même teinte que l'écran de chargement du plan */
}
#city-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none; /* gestes (pincement/glisser) gérés en JS */
  cursor: grab;
}
#city-canvas:active { cursor: grabbing; }
.city-zoom {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.city-zoom button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.city-zoom button:hover { background: var(--surface); }
.city-zoom button.active { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
/* Légende en surimpression du plan, en haut à gauche. Elle laisse passer les gestes
   (glisser, pincer) vers le plan. Vue zonage : plus d'entrées, donc deux colonnes. */
.city-legend {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  gap: 2px 12px;
  max-width: calc(100% - 64px); /* ne passe pas sous les boutons de zoom */
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: var(--shadow);
  color: var(--text-2);
  font-size: 0.72rem;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
}
.city-legend[hidden] { display: none; }
.zoning-legend { grid-template-columns: repeat(2, auto); }
.lg {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 3px;
  border-radius: 2px;
  vertical-align: -1px;
}
.lg-house { background: #b5651d; }
.lg-biz { background: #3f8ca3; }
.lg-svc { background: #e23b3b; }
.lg-shop { background: #3567c4; }
.lg-vacant { background: #8f877c; }
.lg-friche { background: #b7ab8c; }

/* --- CENTRE : frise du mandat (1 case = 1 mois) ------------------------------- */
.timeline-wrap {
  flex: none;
  padding: 8px 16px 10px;
  background: var(--surface);
}
.timeline-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  font-size: 0.78rem;
  color: var(--text-2);
}
#timeline-countdown { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.timeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.tl-year { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; }
.tl-cell {
  position: relative;
  height: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  background: transparent;
}
.tl-cell.sat-hi { border-color: var(--good); background: var(--good); }
.tl-cell.sat-ok { border-color: transparent; background: color-mix(in srgb, var(--good) 45%, var(--surface)); }
.tl-cell.sat-mid { border-color: var(--warn); background: var(--warn); }
.tl-cell.sat-lo { border-color: var(--bad); background: var(--bad); }
.tl-cell.sat-na { border-color: var(--surface-3); background: var(--surface-3); }
.tl-cell.is-vote { border-style: dashed; border-color: var(--accent); }
.tl-cell.is-now { border: 2px solid var(--accent); }
.tl-cell.ev-good::after,
.tl-cell.ev-bad::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--surface);
}
.tl-cell.ev-bad::after { background: var(--text); box-shadow: 0 0 0 1px var(--surface); }
.tl-cell.ev-decision::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--decision);
  box-shadow: 0 0 0 1px var(--surface);
}

/* --- CENTRE : journal de la ville ------------------------------------------- */
.journal {
  /* Récits de 2–3 phrases : on en voit au moins six ; la carte prend le reste.
     Sur un écran peu haut, le journal rétrécit (sa liste défile) plutôt que de
     déborder de la colonne : sinon la fin de la liste et le pied seraient rognés. */
  flex: 0 1 55%;
  display: flex;
  flex-direction: column;
  min-height: 150px;
  background: var(--surface);
}
.journal-head {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--border);
}
.journal-title { margin: 0; font-size: 0.9rem; font-weight: 700; }
.alert-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.alert-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent);
  border-radius: 999px;
  background: var(--bad-soft);
  color: var(--bad);
  font-size: 0.74rem;
  font-weight: 600;
}
.alert-chip.is-ok {
  border-color: color-mix(in srgb, var(--good) 30%, transparent);
  background: var(--good-soft);
  color: var(--good);
}
.journal-scroll {
  flex: 1 1 auto;
  min-height: 0; /* la liste défile dans la place restante, sans déborder de la colonne */
  padding: 0 16px 10px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.journal-list { margin: 0; padding: 0; list-style: none; }
.j-item {
  display: grid;
  grid-template-columns: 7.4em minmax(0, 1fr);
  gap: 10px;
  padding: 6px 0 6px 10px;
  border-bottom: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  font-size: 0.84rem;
  line-height: 1.4;
}
.j-date { padding-top: 2px; font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.j-body { min-width: 0; }
.j-label { margin: 0; font-weight: 650; }
.j-msg { margin: 2px 0 0; color: var(--text-2); line-height: 1.45; }
.j-chronique { border-left-color: var(--border); }
.j-chronique .j-label { font-weight: 600; }
.j-good { border-left-color: var(--good); }
.j-bad { border-left-color: var(--bad); }
.j-info { border-left-color: var(--accent); }
.j-alert { border-left-color: var(--warn); }
.j-alert .j-label { color: var(--warn); }
/* Décision du maire : carte colorée, étiquette et effets chiffrés. */
.j-item.j-decision {
  margin: 4px 0;
  padding-right: 10px;
  border-bottom-color: transparent;
  border-left-color: var(--decision);
  border-radius: 0 6px 6px 0;
  background: var(--decision-soft);
}
.j-tag {
  display: inline-block;
  margin-bottom: 3px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--decision);
  color: var(--decision-ink);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.j-effects {
  margin: 4px 0 0;
  padding: 0 0 0 1.1em;
  font-size: 0.78rem;
  color: var(--text-2);
}
.j-effects li { padding: 1px 0; }
.j-effects li::marker { color: var(--decision); }
.j-item.is-new { animation: j-flash 2.6s ease-out; }
.j-item.j-decision.is-new { animation-name: j-flash-decision; }
@keyframes j-flash {
  from { background: var(--accent-soft); }
  to { background: transparent; }
}
@keyframes j-flash-decision {
  from { background: color-mix(in srgb, var(--decision) 30%, var(--decision-soft)); }
  to { background: var(--decision-soft); }
}
.j-empty { padding: 14px 0; font-size: 0.84rem; color: var(--muted); }
/* Fin de la liste : le tout premier message de la partie est affiché. */
.j-start {
  padding: 10px 0 2px;
  font-size: 0.76rem;
  color: var(--muted);
  text-align: center;
  letter-spacing: 0.02em;
}
/* Bout du journal (dans la zone qui défile, sous « Début du journal ») : ouvrir la Gazette. */
.journal-end { padding: 10px 0 4px; }
.journal-end { text-align: center; }
.gazette-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  padding: 5px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.84rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.gazette-btn:hover { background: var(--surface-3); border-color: var(--text-2); }
.gazette-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.gazette-btn .ph { font-size: 1.15rem; }
.gazette-btn-name { font-family: Georgia, "Times New Roman", serif; font-size: 0.95rem; font-weight: 700; font-style: italic; }
.link-btn {
  padding: 8px 0 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

/* --- SUIVRE : indicateurs ------------------------------------------------------ */
.kpis { margin: 0 0 4px; }
.kpi {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border);
}
.kpi:last-child { border-bottom: none; }
.kpi dt { font-size: 0.85rem; font-weight: 500; color: var(--text-2); }
.kpi dd {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.trend {
  display: inline-block;
  min-width: 4.8em;
  margin-left: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  text-align: right;
}
.trend.is-flat { color: var(--muted); }
/* Sous-ligne du chômage : conjoncture nationale (phase, référence, inflation). */
.kpi.kpi-sub { padding-top: 0; }
.kpi:has(+ .kpi-sub) { border-bottom: none; }
.kpi.kpi-sub dt { padding-left: 1.2em; font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.kpi.kpi-sub dt.is-good { color: var(--good); }
.kpi.kpi-sub dt.is-bad { color: var(--bad); }
.kpi.kpi-sub dd { font-size: 0.74rem; font-weight: 500; color: var(--muted); }

.gauges { display: flex; flex-direction: column; gap: 8px; }
.gauge-row { display: flex; justify-content: space-between; margin-bottom: 3px; font-size: 0.82rem; }
.gauge-row b { font-variant-numeric: tabular-nums; }
.gauge-track { height: 6px; overflow: hidden; border-radius: 3px; background: var(--surface-3); }
.gauge-fill {
  width: 0;
  height: 100%;
  border-radius: 3px;
  background: var(--good);
  transition: width 0.4s ease, background-color 0.4s ease;
}
.gauge-fill.is-warn { background: var(--warn); }
.gauge-fill.is-critical { background: var(--bad); }

/* Effets durables des choix du maire */
.mod-list { margin: 0; padding: 0; list-style: none; }
.mod-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 8px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.78rem;
}
.mod-list li:last-child { border-bottom: none; }
.mod-label { font-weight: 600; }
.mod-when { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mod-fx { grid-column: 1 / -1; color: var(--text-2); font-variant-numeric: tabular-nums; }
.mod-list li.is-later .mod-label { color: var(--muted); }

.explain { margin-top: 12px; font-size: 0.8rem; }
.explain > summary { color: var(--accent); font-weight: 600; list-style: none; cursor: pointer; }
.explain > summary::-webkit-details-marker { display: none; }
.explain > summary::before { content: '\e3d4'; margin-right: 4px; font-family: 'Phosphor'; vertical-align: -0.1em; }
.explain[open] > summary::before { content: '\e32a'; }
.explain dl { margin: 8px 0 0; }
.explain dt { margin-top: 6px; font-weight: 650; color: var(--text-2); }
.explain dd { margin: 0; color: var(--muted); }
.explain .sec-help { margin-top: 8px; }

/* --- SUIVRE : politique ------------------------------------------------------------ */
.pol-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
}
.promise-status { margin: 0; padding: 0; list-style: none; }
.promise-status li {
  display: flex;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.82rem;
}
.promise-status li:last-child { border-bottom: none; }
.ps-mark { flex: none; width: 1.2em; font-weight: 700; text-align: center; }
.promise-status .is-ok > .ps-mark { color: var(--good); }
.promise-status .is-ko > .ps-mark { color: var(--bad); }
.ps-text strong { display: block; font-weight: 600; }
.ps-hint { display: block; font-size: 0.76rem; color: var(--muted); }
.ps-hint em { font-style: normal; font-weight: 600; }
.promise-status .is-ok .ps-hint em { color: var(--good); }
.promise-status .is-ko .ps-hint em { color: var(--warn); }
.ps-empty { font-size: 0.82rem; color: var(--muted); }

.bilan-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.bilan-metric {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 3px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.76rem;
}
.bilan-metric span { color: var(--muted); }
.bilan-metric strong { font-variant-numeric: tabular-nums; }
/* Sondages : une fiche par organisme (js/sondages.js, ui.renderPollOffers) */
.poll-order { margin: 4px 0 10px; }
.poll-offers { display: grid; gap: 6px; }
.poll-offer {
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2, transparent);
}
.po-head { display: flex; align-items: baseline; gap: 6px; }
.po-ico { flex: none; color: var(--accent); }
.po-name { flex: 1; min-width: 0; font-size: 0.8rem; font-weight: 650; color: var(--text); }
.po-price { flex: none; font-size: 0.78rem; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.poll-offer p { margin: 2px 0 0; font-size: 0.74rem; line-height: 1.35; }
.po-hint { color: var(--text-2); font-style: italic; }
.po-meta { color: var(--muted); }
.po-verdict { color: var(--text-2); font-weight: 600; }
.po-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 5px; }
.po-reason { font-size: 0.72rem; color: var(--muted); }
.poll-offer .btn:disabled { opacity: 0.45; cursor: not-allowed; }
.poll-offer.is-off .po-price { color: var(--muted); }

.vote-list:empty { display: none; }
.vote-row {
  display: grid;
  grid-template-columns: minmax(0, 7.6em) 1fr 3.8em;
  gap: 8px;
  align-items: center;
  margin-bottom: 5px;
  font-size: 0.78rem;
}
.vote-label { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.vote-track { height: 8px; overflow: hidden; border-radius: 4px; background: var(--surface-3); }
.vote-fill { height: 100%; border-radius: 4px; transition: width 0.8s ease; }
.vote-pct { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.vote-row.is-me .vote-label { color: var(--accent); font-weight: 700; }
.vote-row.is-me .vote-label::after { content: ' (vous)'; font-weight: 400; color: var(--muted); }

/* --- SUIVRE : courbes ------------------------------------------------------------- */
.charts { display: grid; grid-template-columns: 1fr; gap: 14px; }
.chart h3 { margin: 0 0 4px; font-size: 0.78rem; font-weight: 650; color: var(--text-2); }
.chart-box { position: relative; height: 120px; }

/* ===========================================================================
   MODALES
   =========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--overlay);
  backdrop-filter: blur(2px);
}
.modal-panel {
  width: 100%;
  max-width: 660px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  scrollbar-width: thin;
}

/* Soirée électorale */
.election-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.live-badge {
  padding: 3px 9px;
  border-radius: 999px;
  background: #c0392b;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  white-space: nowrap;
  animation: live-pulse 1.2s ease-in-out infinite;
}
@keyframes live-pulse { 50% { opacity: 0.5; } }
.election-headtxt { display: flex; flex-direction: column; line-height: 1.25; }
.election-titles { font-size: 0.8rem; color: var(--muted); }
.election-body { padding: 16px 18px 4px; }
.elec-step { margin: 0 0 10px; font-size: 0.86rem; font-weight: 650; color: var(--text-2); }
.elec-wait { margin: 6px 0; text-align: center; color: var(--muted); }
.election-panel .vote-row { grid-template-columns: minmax(0, 11em) 1fr 4.4em; margin-bottom: 8px; font-size: 0.88rem; }
.election-panel .vote-track { height: 12px; border-radius: 6px; }
.election-panel .vote-row.is-winner .vote-track { outline: 2px solid var(--warn); outline-offset: 1px; }
.election-panel .vote-row.is-winner .vote-label,
.election-panel .vote-row.is-winner .vote-pct { color: var(--text); font-weight: 800; }
/* Pied collé en bas du panneau : « Reprendre le mandat » reste visible pendant le choix. */
.election-footer {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin-top: 12px;
  padding: 12px 18px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
}
.election-footer:empty { display: none; }
.election-footer .btn { min-width: 220px; }
.soiree-msg { margin: 0 0 10px; font-weight: 600; }

.verdict-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  scroll-margin-top: 72px;
}
.verdict { padding: 6px 0 10px; text-align: center; }
.verdict-emoji { margin-bottom: 4px; font-size: 2.4rem; line-height: 1; }
.verdict h3 { margin: 0 0 6px; font-size: 1.4rem; font-weight: 800; }
.verdict.win h3 { color: var(--good); }
.verdict.lose h3 { color: var(--bad); }
.verdict p { margin: 0; color: var(--text-2); }
.verdict-review,
.verdict-programme { margin-top: 14px; }
.verdict-review h4,
.verdict-programme h4 { margin: 0 0 6px; font-size: 0.92rem; font-weight: 700; }
.promise-review { margin: 0; padding: 0; list-style: none; font-size: 0.84rem; }
.promise-review li { padding: 3px 0; }
.promise-review .is-ok { color: var(--good); }
.promise-review .is-ko { color: var(--bad); }
.note { margin: 0 0 8px; font-size: 0.8rem; color: var(--muted); }
.election-panel .pp-list,
.programme-panel .pp-list { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

/* Programme (reprise entre deux mandats) */
.programme-inner { padding: 20px 20px 4px; }
.programme-panel h2 { margin: 0 0 6px; font-size: 1.2rem; font-weight: 750; }
.modal-actions {
  position: sticky;
  bottom: 0;
  margin-top: 12px;
  padding: 12px 20px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
}
.modal-actions .btn { min-width: 220px; }

/* Choix du maire (dilemme) */
.decision-panel { max-width: 680px; }
.decision-inner { padding: 20px 20px 6px; }
.decision-kicker {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.decision-title { margin: 0 0 8px; font-size: 1.3rem; font-weight: 800; line-height: 1.25; }
.decision-text { margin: 0 0 14px; color: var(--text-2); }
.dec-options { display: grid; gap: 8px; }
/* « Oui / Non » et choix à 4 options : deux colonnes quand la place le permet. */
@media (min-width: 760px) {
  .dec-options[data-count="2"],
  .dec-options[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.dec-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.08s ease;
}
.dec-option:hover { border-color: var(--accent); background: var(--accent-soft); }
.dec-option:active { transform: translateY(1px); }
.dec-label { font-size: 0.97rem; font-weight: 700; }
.dec-risk {
  margin-left: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--warn);
  white-space: nowrap;
}
.dec-trends { font-size: 0.82rem; color: var(--text-2); }
.dec-cost { font-size: 0.8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.dec-cost em { font-style: normal; color: var(--bad); }
.dec-cost.is-gain { color: var(--good); }
.dec-align,
.dec-promise { font-size: 0.78rem; }
.dec-align.is-approve,
.dec-promise.is-help { color: var(--good); }
.dec-align.is-disapprove,
.dec-promise.is-hurt { color: var(--bad); }
.dec-align.is-split { color: var(--muted); }
.decision-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px 12px;
}
.decision-actions .btn-outline-secondary { min-width: 0; }
.dec-note { margin-right: auto; font-size: 0.78rem; color: var(--muted); }
.dec-option:disabled { cursor: not-allowed; opacity: 0.6; }
.dec-option:disabled:hover { border-color: var(--border-strong); background: var(--surface); }

/* --- Rapport de sondage · changement de parti (js/ui-rapports.js) ------------------ */
.report-panel { max-width: 760px; }
.rp-sec { margin: 0 0 18px; }
.rp-h {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
  font-size: 0.86rem;
  font-weight: 750;
  color: var(--text-2);
}
.rp-note { margin: 4px 0 0; font-size: 0.78rem; color: var(--muted); }
.rp-explain { margin: 8px 0 0; padding-left: 1.1em; font-size: 0.86rem; color: var(--text-2); }
.rp-explain li { margin-bottom: 5px; }
/* Barres des listes : libellé large (parti + nom d'époque), score + variation. */
.report-votes .vote-row,
.sw-pairs .vote-row { grid-template-columns: minmax(0, 13em) 1fr 5.6em; margin-bottom: 9px; font-size: 0.86rem; }
.report-votes .vote-row.is-me .vote-label::after,
.sw-pairs .vote-row.is-me .vote-label::after { content: none; }
.report-votes .vote-label,
.sw-pairs .vote-label { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.rp-party { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-you { font-style: normal; font-weight: 400; color: var(--muted); }
.rp-tend { overflow: hidden; color: var(--muted); font-size: 0.74rem; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.rp-track { position: relative; height: 14px; overflow: visible; }
.rp-track .vote-fill { border-radius: 4px; }
/* Marge d'erreur : trait fin à moustaches posé sur la barre. */
.vote-band {
  position: absolute;
  top: 50%;
  height: 2px;
  margin-top: -1px;
  background: var(--text);
  opacity: 0.6;
  pointer-events: auto;
}
.vote-band::before,
.vote-band::after {
  content: '';
  position: absolute;
  top: -4px;
  width: 2px;
  height: 10px;
  background: var(--text);
}
.vote-band::before { left: 0; }
.vote-band::after { right: 0; }
.report-votes .vote-pct { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.vote-delta { font-size: 0.72rem; font-weight: 700; white-space: nowrap; }
.vote-delta.is-up { color: var(--good); }
.vote-delta.is-down { color: var(--bad); }
.vote-delta.is-flat { color: var(--muted); }

/* Votre score, sondage après sondage (SVG en ligne). */
.poll-spark { display: block; width: 100%; max-width: 520px; height: auto; margin: 0 auto; }
.poll-spark .sp-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.poll-spark .sp-base { stroke: var(--border-strong); stroke-width: 1; }
.poll-spark .sp-half { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; }
.poll-spark circle { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.poll-spark .is-current circle { fill: var(--accent); }
.poll-spark .is-vote circle { stroke: var(--good); }
.poll-spark .is-press circle { stroke-dasharray: 2 2; }
.poll-spark text { font-size: 10px; fill: var(--muted); font-family: inherit; }
.poll-spark .sp-val { fill: var(--text-2); font-weight: 700; }
.poll-spark .is-current .sp-val { fill: var(--accent); }
.sp-legend { margin: 6px 0 0; padding-left: 1.4em; font-size: 0.76rem; color: var(--muted); }
.sp-legend .is-current { color: var(--text-2); font-weight: 600; }

/* Fiche technique. */
.rp-fiche { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; margin: 0; }
.rp-fiche div { min-width: 0; }
.rp-fiche div:last-child { grid-column: 1 / -1; } /* « Ce qu'on en dit » : sur toute la largeur */
.rp-fiche dt { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.rp-fiche dd { margin: 0; font-size: 0.84rem; color: var(--text); }

/* Réactions : alliés (filet vert), adversaires (filet rouge), habitants. */
.rx-list { display: grid; gap: 10px; }
@media (min-width: 640px) { .rx-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.rx-card {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-2);
}
.rx-card.is-good { border-left-color: var(--good); }
.rx-card.is-bad { border-left-color: var(--bad); }
.rx-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.rx-tag { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.rx-card.is-good .rx-tag { color: var(--good); }
.rx-card.is-bad .rx-tag { color: var(--bad); }
.rx-card.is-neutral .rx-tag { color: var(--muted); }
.rx-who { font-size: 0.88rem; }
.rx-role { flex-basis: 100%; font-size: 0.76rem; color: var(--muted); }
.rx-text { margin: 6px 0 4px; font-size: 0.88rem; font-style: italic; color: var(--text); }
.rx-meta { margin: 0; font-size: 0.72rem; color: var(--muted); }
.rx-tend { white-space: nowrap; }
.rx-tend::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--party-color, currentColor);
}

/* Coupure de presse. */
.press-clip {
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface-2);
  font-family: Georgia, 'Times New Roman', serif;
}
.press-clip p { margin: 0 0 8px; font-size: 0.9rem; line-height: 1.5; color: var(--text); }
.press-clip .pc-journal {
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.press-clip .pc-title { margin: 0 0 4px; font-size: 1.15rem; font-weight: 800; line-height: 1.25; color: var(--text); }
.press-clip .pc-byline { font-size: 0.78rem; font-style: italic; color: var(--muted); }

/* Changement de parti : avant → après. */
.sw-compare { display: grid; gap: 2px; }
.sw-row {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 1.2em minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 0.86rem;
}
.sw-row:last-child { border-bottom: none; }
.sw-headrow { border-bottom: 1px solid var(--border); }
.sw-label { color: var(--text-2); }
.sw-before { color: var(--muted); font-variant-numeric: tabular-nums; }
.sw-after { font-weight: 700; font-variant-numeric: tabular-nums; }
.sw-after.is-good { color: var(--good); }
.sw-after.is-bad { color: var(--bad); }
.sw-arrow { color: var(--muted); text-align: center; }
.sw-pill { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.sw-bars { display: grid; gap: 3px; }
.sw-bars .vote-track { height: 7px; }
.sw-track-before .vote-fill { opacity: 0.35; }
.sw-pairs .vote-pct { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.sw-pct-before { font-size: 0.72rem; font-weight: 400; color: var(--muted); }
.sw-pairs .rp-party { white-space: normal; } /* « (vous, avant) » jamais tronqué sur mobile */

/* Attentes des partis et politique menée (4 axes). */
.axis-chart { display: grid; gap: 10px; }
.axis-row { display: grid; grid-template-columns: minmax(0, 11em) 1fr; align-items: center; gap: 10px; font-size: 0.84rem; }
.axis-label { color: var(--text-2); }
.axis-track { position: relative; height: 10px; border-radius: 5px; background: var(--surface-3); }
.axis-mark {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 18px;
  margin-left: -2px;
  border-radius: 2px;
  background: var(--party-color);
}
.axis-mark.is-from { opacity: 0.45; }
.axis-you {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.axis-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; font-size: 0.76rem; color: var(--muted); }
.axis-key { display: inline-block; vertical-align: -1px; }
.axis-key.is-you { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.axis-key.is-from,
.axis-key.is-to { width: 4px; height: 12px; border-radius: 2px; background: var(--party-color); }
.axis-key.is-from { opacity: 0.45; }
.sw-promises { margin: 0; padding: 0; list-style: none; font-size: 0.86rem; }
.sw-promises li { margin-bottom: 4px; }
.sw-promises .is-ok > .ph:first-child { color: var(--good); }
.sw-promises .is-ko > .ph:first-child { color: var(--warn); }
.poll-review { display: inline-flex; align-items: center; gap: 4px; padding-top: 2px; }

@media (max-width: 599.98px) {
  .report-votes .vote-row,
  .sw-pairs .vote-row { grid-template-columns: minmax(0, 8.5em) 1fr 4.6em; }
  .sw-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 1em minmax(0, 1fr); font-size: 0.8rem; }
  .axis-row { grid-template-columns: minmax(0, 7.5em) 1fr; }
}

/* Séance budgétaire (vote annuel du budget) */
.budget-panel { max-width: 1020px; }
.budget-inner { padding: 20px 20px 6px; }
.budget-grid { display: grid; gap: 16px; }
@media (min-width: 860px) {
  .budget-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; }
  .budget-sum { position: sticky; top: 0; }
}
.bud-group {
  margin: 12px 0 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.bud-group:first-child { margin-top: 0; }
.bud-group-help { margin: 0 0 6px; font-size: 0.76rem; color: var(--muted); }
.bud-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 6px;
}
.bud-row.is-up { border-color: var(--warn); background: var(--warn-soft); }
.bud-row.is-down { border-color: var(--good); background: var(--good-soft); }
.bud-main { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; min-width: 0; }
.bud-label { font-size: 0.86rem; font-weight: 650; }
.bud-val { font-size: 0.86rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bud-val s { color: var(--muted); }
.bud-ctl { display: flex; gap: 4px; }
.bud-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
}
.bud-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.bud-btn:disabled { cursor: not-allowed; opacity: 0.4; }
.bud-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bud-desc { grid-column: 1 / -1; margin: 2px 0 0; font-size: 0.78rem; line-height: 1.4; color: var(--text-2); }
.bud-meta { grid-column: 1 / -1; margin: 0; font-size: 0.74rem; color: var(--muted); }
.bud-groups .ph { font-size: 0.9rem; vertical-align: -2px; }
.budget-sum {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  font-size: 0.82rem;
}
.bs-title { margin: 0 0 6px; font-weight: 700; }
.bs-line { display: flex; justify-content: space-between; gap: 10px; padding: 1px 0; color: var(--text-2); }
.bs-line strong { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.bs-line.bs-total { margin-bottom: 4px; padding-top: 3px; border-top: 1px solid var(--border); color: var(--text); }
.bs-line.bs-total strong { font-weight: 800; }
.bs-line.is-good strong { color: var(--good); }
.bs-line.is-bad strong { color: var(--bad); }
.bs-verdict { margin: 8px 0 4px; padding: 6px 8px; border-radius: 6px; font-weight: 650; }
.bs-verdict.is-good { background: var(--good-soft); color: var(--good); }
.bs-verdict.is-warn { background: var(--warn-soft); color: var(--warn); }
.bs-verdict.is-bad { background: var(--bad-soft); color: var(--bad); }
.bs-note { margin: 4px 0; color: var(--text-2); }
.bs-note .is-good, .bs-note strong.is-good { color: var(--good); }
.bs-note .is-bad, .bs-note strong.is-bad { color: var(--bad); }
.bs-groups { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.grp-chip {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}
.grp-chip.is-bad { background: var(--bad-soft); color: var(--bad); }
.grp-chip.is-good { background: var(--good-soft); color: var(--good); }
.budget-sum .dec-promise { margin: 3px 0; }
.bs-quote {
  margin: 8px 0 0;
  padding: 6px 10px;
  border-left: 3px solid var(--party-color, var(--border-strong));
  color: var(--text-2);
  font-style: italic;
}
.bs-quote strong { font-style: normal; }

/* Décision reportée : barre posée sur le journal de la ville, collée en bas de
   la zone qui défile (les entrées passent dessous ; en fin de liste, elle se
   range après la dernière). Le temps reste arrêté jusqu'à la réponse. */
.pending-bar {
  position: sticky;
  bottom: 10px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 560px);
  margin: 10px auto 0;
  padding: 10px 12px 10px 14px;
  border: none;
  border-radius: 12px;
  background: var(--decision);
  color: var(--decision-ink);
  font: inherit;
  text-align: left;
  box-shadow: var(--shadow);
  cursor: pointer;
  animation: pending-pulse 1.8s ease-in-out infinite;
}
.pending-bar[hidden] { display: none; }
.pending-bar:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.pending-bar-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--decision-ink) 16%, transparent);
  font-size: 1.3rem;
}
.pending-bar-ico .ph { vertical-align: 0; }
.pending-bar-text { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.pending-bar-text strong { font-size: 0.9rem; font-weight: 700; }
.pending-bar-sub {
  overflow: hidden;
  font-size: 0.8rem;
  opacity: 0.9;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pending-bar-cta {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 12px;
  border-radius: 8px;
  background: var(--decision-ink);
  color: var(--decision);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 0.15s ease;
}
.pending-bar:hover .pending-bar-cta { transform: translateX(2px); }
@keyframes pending-pulse {
  50% { box-shadow: var(--shadow), 0 0 0 6px color-mix(in srgb, var(--decision) 28%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .pending-bar,
  .live-badge { animation: none; }
}

/* Fin de partie */
.gameover-panel { max-width: 440px; padding: 26px 22px; text-align: center; }
.gameover-emoji { font-size: 3rem; line-height: 1; }
.gameover-modal-title { margin: 6px 0 8px; font-size: 1.5rem; font-weight: 800; color: var(--bad); }
#gameover-modal-msg { margin: 0 0 14px; color: var(--text-2); }
.gameover-stats {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 18px;
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-2);
  font-variant-numeric: tabular-nums;
}
.gameover-panel .btn { min-width: 200px; }
.gameover-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.election-footer .btn + .btn { margin-left: 8px; }
@media (max-width: 575.98px) {
  .election-footer .btn + .btn { margin: 8px 0 0; }
}

/* Aide « Comment jouer » */
.help-dialog {
  width: min(720px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.help-dialog::backdrop { background: rgba(15, 17, 19, 0.55); }
.help-inner { padding: 0 22px 18px; }
.help-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px 0 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.help-head h2 { margin: 0; font-size: 1.15rem; font-weight: 750; }
.help-body .explain-block:last-child { margin-bottom: 0; }

/* ===========================================================================
   LA GAZETTE — le journal de la ville en version papier (js/gazette.js)
   Un quotidien local : papier crème, encre, filets, colonnes, lettrine.
   Le papier reste du papier en thème sombre (seulement moins lumineux).
   =========================================================================== */
.gazette-dialog {
  --gz-paper: #f4eddc;
  --gz-ink: #1d1a15;
  --gz-ink-2: #3a342b;
  --gz-muted: #6b6253;
  --gz-rule: #2a251d;
  --gz-rule-soft: rgba(42, 37, 29, 0.26);
  --gz-desk: #4a4339;      /* le bureau sur lequel le journal est posé */
  --gz-mast: "UnifrakturMaguntia", "Old English Text MT", Georgia, serif;
  --gz-head: "Playfair Display", Georgia, "Times New Roman", serif;
  --gz-body: "Old Standard TT", Georgia, "Times New Roman", serif;
  --gz-sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif; /* réclames depuis 1975 */
  width: min(1100px, calc(100% - 24px));
  max-width: none;
  height: calc(100vh - 32px);
  height: calc(100dvh - 32px);
  max-height: none;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--gz-desk);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.gazette-dialog[open] { display: flex; flex-direction: column; }
.gazette-dialog::backdrop { background: rgba(12, 11, 9, 0.72); backdrop-filter: blur(2px); }
[data-bs-theme="dark"] .gazette-dialog { --gz-paper: #d8ceb6; --gz-desk: #1d1b18; }
@media (prefers-color-scheme: dark) {
  :root:not([data-bs-theme]) .gazette-dialog { --gz-paper: #d8ceb6; --gz-desk: #1d1b18; }
}
body.gz-open { overflow: hidden; }

/* Barre de navigation (hors du papier) */
.gz-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.gz-nav { display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }
.gz-select { width: auto; min-width: 9.5em; }
.gz-bar-hint { margin-left: auto; font-size: 0.74rem; color: var(--muted); }
.gz-close { margin-left: 8px; }

.gz-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 18px 28px;
  background: radial-gradient(ellipse at 50% 25%, rgba(255, 255, 255, 0.07), transparent 70%), var(--gz-desk);
  outline: none;
  scrollbar-width: thin;
}

/* La feuille */
.gz-paper {
  max-width: 1020px;
  margin: 0 auto;
  padding: 26px 34px 18px;
  color: var(--gz-ink);
  background-color: var(--gz-paper);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.45), transparent 60%),
    radial-gradient(ellipse at 100% 100%, rgba(120, 88, 40, 0.13), transparent 55%),
    radial-gradient(ellipse at 0% 100%, rgba(120, 88, 40, 0.09), transparent 50%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.32 0 0 0 0 0.25 0 0 0 0 0.15 0 0 0 0.14 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 34px rgba(0, 0, 0, 0.4);
  font-family: var(--gz-body);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-hyphens: auto;
  hyphens: auto;
  overflow-wrap: break-word;
}
/* Titres à l'encre noire, jamais en blanc : la règle globale h1-h4 (var(--text))
   les rendrait blancs en thème sombre. */
.gz-paper :is(h1, h2, h3, h4, h5, h6) { color: var(--gz-ink); }
.gz-paper sup { font-size: 0.68em; text-transform: none; }

/* Titre du journal */
.gz-mast { margin-bottom: 16px; text-align: center; }
.gz-mast-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}
.gz-ear {
  justify-self: start;
  max-width: 10.5em;
  padding: 5px 9px;
  border: 1px solid var(--gz-rule);
  font-size: 0.66rem;
  line-height: 1.3;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}
.gz-ear:last-child { justify-self: end; }
.gz-ear b { display: inline-block; margin-top: 2px; font-family: var(--gz-head); font-size: 1.05rem; letter-spacing: 0.02em; }
.gz-title {
  margin: 0;
  font-family: var(--gz-mast);
  font-size: clamp(2.2rem, 6.2vw, 4.6rem);
  font-weight: 400;
  line-height: 1.05;
  text-wrap: balance;
  -webkit-hyphens: manual;
  hyphens: manual;
}
.gz-motto { margin: 4px 0 8px; color: var(--gz-ink-2); font-size: 0.86rem; font-style: italic; }
.gz-dateline {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 18px;
  padding: 4px 2px;
  border-top: 1px solid var(--gz-rule);
  border-bottom: 4px double var(--gz-rule);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* La une + l'encadré de chiffres */
.gz-top {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr);
  gap: 0 26px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--gz-rule);
}
.gz-top.is-solo { grid-template-columns: minmax(0, 1fr); }
.gz-kicker {
  margin: 0 0 6px;
  color: var(--gz-muted);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.gz-headline {
  margin: 0 0 10px;
  font-family: var(--gz-head);
  font-size: clamp(1.75rem, 3.8vw, 2.9rem);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.012em;
  text-wrap: balance;
  -webkit-hyphens: manual;
  hyphens: manual;
}
.gz-deck {
  margin: 0 0 12px;
  color: var(--gz-ink-2);
  font-family: var(--gz-head);
  font-size: 1.12rem;
  font-style: italic;
  line-height: 1.35;
}
.gz-lead { margin: 0; font-size: 1.05rem; line-height: 1.6; text-align: justify; }
.gz-lead::first-letter {
  float: left;
  margin: 0.06em 0.1em 0 0;
  font-family: var(--gz-head);
  font-size: 3.5em;
  font-weight: 900;
  line-height: 0.82;
}
.gz-box-title {
  margin: 0 0 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--gz-rule);
  font-family: var(--gz-head);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.gz-figures { padding-left: 22px; border-left: 1px solid var(--gz-rule); }
.gz-figures dl { margin: 0; }
.gz-fig {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dotted var(--gz-rule-soft);
}
.gz-fig dt { font-size: 0.86rem; font-weight: 400; }
.gz-fig dd {
  margin: 0;
  font-family: var(--gz-head);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: right;
  font-variant-numeric: lining-nums tabular-nums;
}
.gz-fig small { display: block; color: var(--gz-muted); font-family: var(--gz-body); font-size: 0.72rem; font-weight: 400; }
.gz-fig-note { margin: 6px 0 0; color: var(--gz-muted); font-size: 0.72rem; font-style: italic; }

/* Articles en colonnes */
.gz-cols { column-count: 3; column-gap: 28px; column-rule: 1px solid var(--gz-rule-soft); }
.gz-cols[data-n="2"] { column-count: 2; }
.gz-cols[data-n="1"] { column-count: 1; max-width: 46em; }
.gz-art {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gz-rule-soft);
  break-inside: avoid;
}
.gz-art-title {
  margin: 0 0 6px;
  font-family: var(--gz-head);
  font-size: 1.14rem;
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
  -webkit-hyphens: manual;
  hyphens: manual;
}
.gz-art.is-major .gz-art-title { font-size: 1.32rem; font-weight: 900; }
.gz-art-deck { margin: 0 0 5px; color: var(--gz-ink-2); font-family: var(--gz-head); font-size: 0.95rem; font-style: italic; }
.gz-art-text { margin: 0; font-size: 0.93rem; line-height: 1.52; text-align: justify; }
.gz-effects {
  margin: 8px 0 0;
  padding: 6px 10px;
  border: 1px solid var(--gz-rule-soft);
  background: rgba(255, 255, 255, 0.28);
  font-size: 0.8rem;
  line-height: 1.4;
  list-style: none;
}
.gz-effects li + li { margin-top: 2px; }
.gz-effects .gz-effects-title {
  margin-bottom: 3px;
  color: var(--gz-muted);
  font-size: 0.64rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.gz-effects .ph { vertical-align: -0.12em; }

/* Brèves (alertes) */
.gz-brief { margin-top: 4px; padding-top: 10px; border-top: 4px double var(--gz-rule); }
.gz-brief ul {
  margin: 0;
  padding: 0;
  list-style: none;
  column-count: 2;
  column-gap: 28px;
  column-rule: 1px solid var(--gz-rule-soft);
}
.gz-brief li { margin: 0 0 8px; font-size: 0.86rem; line-height: 1.45; text-align: justify; break-inside: avoid; }
.gz-brief li b { font-variant: small-caps; letter-spacing: 0.04em; }

/* Vie politique (js/gazette-politique.js) : campagne (sondage, entretiens),
   résultats et chronique de la soirée électorale, encart « Échos politiques ». */
.gz-pol {
  margin: 0 0 16px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--gz-rule);
}
.gz-pol-flag {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 10px;
  border-top: 1px solid var(--gz-rule);
  border-bottom: 1px solid var(--gz-rule);
  color: var(--gz-ink);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.gz-pol-title {
  margin: 0 0 6px;
  font-family: var(--gz-head);
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  font-weight: 900;
  line-height: 1.1;
  text-wrap: balance;
  -webkit-hyphens: manual;
  hyphens: manual;
}
.gz-pol-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  margin-top: 10px;
}
.gz-pol-grid.is-results { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.3fr); }
.gz-pol-grid > :first-child { padding-right: 22px; border-right: 1px solid var(--gz-rule-soft); }
.gz-pol-grid > :last-child { padding-left: 22px; }
.gz-pol-note { margin: 4px 0 10px; color: var(--gz-muted); font-size: 0.7rem; font-style: italic; line-height: 1.35; }
.gz-pol-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 4px;
  border: 1px solid var(--gz-rule);
  color: var(--gz-ink);
  font-size: 0.58rem;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  vertical-align: 0.15em;
}

/* Tableaux : sondage et résultats */
.gz-res,
.gz-poll-table {
  width: 100%;
  margin: 0 0 4px;
  border-collapse: collapse;
  font-size: 0.8rem;
  font-variant-numeric: lining-nums tabular-nums;
}
.gz-res caption {
  caption-side: top; /* Bootstrap les place en bas */
  padding: 2px 0 4px;
  border-bottom: 2px solid var(--gz-rule);
  font-family: var(--gz-head);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: left;
}
.gz-res th,
.gz-res td,
.gz-poll-table th,
.gz-poll-table td {
  padding: 4px 8px 4px 0;
  border-bottom: 1px dotted var(--gz-rule-soft);
  font-weight: 400;
  text-align: left;
  vertical-align: top;
}
.gz-res thead th {
  border-bottom: 1px solid var(--gz-rule);
  color: var(--gz-muted);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.gz-res .gz-num,
.gz-poll-table .gz-num { padding-right: 0; text-align: right; white-space: nowrap; }
.gz-res tr.is-winner th,
.gz-res tr.is-winner td,
.gz-poll-table tr.is-player th { font-weight: 700; }
.gz-win { margin-right: 3px; vertical-align: -0.1em; }
.gz-poll-table th small:not(.gz-pol-tag) { display: block; color: var(--gz-muted); font-size: 0.7rem; font-weight: 400; }
.gz-gauge { display: block; min-width: 46px; height: 4px; margin-top: 3px; background: var(--gz-rule-soft); }
.gz-gauge > span { display: block; height: 100%; background: var(--gz-ink); }
.gz-poll-list { margin: 0; padding-left: 1.2em; font-size: 0.84rem; line-height: 1.45; }
.gz-poll-list li { margin-bottom: 5px; }
.gz-poll-list small:not(.gz-pol-tag) { color: var(--gz-muted); font-size: 0.74rem; }

/* Entretiens (questions en gras, réponses précédées d'un tiret) et chronique signée */
.gz-itws { column-count: 2; column-gap: 24px; column-rule: 1px solid var(--gz-rule-soft); }
.gz-itw { margin: 0 0 12px; break-inside: avoid; }
.gz-itw-title { margin: 0 0 4px; font-family: var(--gz-head); font-size: 1.06rem; font-weight: 700; line-height: 1.2; }
.gz-itw-intro { margin: 0 0 6px; color: var(--gz-ink-2); font-size: 0.8rem; font-style: italic; line-height: 1.35; }
.gz-q { margin: 7px 0 2px; font-size: 0.85rem; font-weight: 700; line-height: 1.35; }
.gz-a { margin: 0; font-size: 0.85rem; line-height: 1.45; text-align: justify; }
.gz-a::before { content: "— "; }
.gz-chron p { margin: 0 0 7px; font-size: 0.9rem; line-height: 1.5; text-align: justify; }
.gz-chron .gz-byline { margin-bottom: 8px; color: var(--gz-muted); font-size: 0.74rem; font-style: italic; text-align: left; }

/* Encart « Échos politiques » et palmarès (sous les chiffres) */
.gz-pol-box { margin-top: 16px; }
.gz-pol-box .gz-fig dd { font-size: 0.95rem; }
.gz-pol-box .gz-fig dd.is-text { font-family: var(--gz-body); font-size: 0.8rem; font-weight: 400; }
.gz-pol-quote { margin: 8px 0 0; padding: 4px 0 0 10px; border-left: 3px solid var(--gz-rule); }
.gz-pol-quote p { margin: 0; font-family: var(--gz-head); font-size: 0.92rem; font-style: italic; line-height: 1.35; }
.gz-pol-quote footer { margin-top: 4px; color: var(--gz-muted); font-size: 0.72rem; line-height: 1.3; }

/* Réclames d'époque (js/reclames.js) : encarts entre les articles, bandeau pleine
   largeur. Monochrome (encre, papier, inversions) ; le style suit l'époque. */
.gz-ad {
  --gz-ad-fg: var(--gz-ink);
  --gz-ad-bg: transparent;
  margin: 0 0 14px;
  padding: 10px 12px 9px;
  border: 1px solid var(--gz-rule);
  background: var(--gz-ad-bg);
  color: var(--gz-ad-fg);
  text-align: center;
  break-inside: avoid;
  -webkit-hyphens: manual;
  hyphens: manual;
}
.gz-ad-label,
.gz-ad-new,
.gz-ad-brand,
.gz-ad-head,
.gz-ad-text,
.gz-ad-slogan,
.gz-ad-price,
.gz-ad-addr,
.gz-ad-legal { margin: 0; }
.gz-ad-label {
  margin-bottom: 6px;
  color: var(--gz-muted);
  font-size: 0.6rem;
  line-height: 1.2;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.gz-ad-vignette { display: block; margin-bottom: 3px; font-size: 1.8rem; line-height: 1; }
/* Taille de la marque : propre à chaque époque (--gz-ad-brand), agrandie dans un bandeau (--gz-ad-scale). */
.gz-ad-brand {
  font-family: var(--gz-head);
  font-size: calc(var(--gz-ad-brand, 1.3rem) * var(--gz-ad-scale, 1));
  font-weight: 900;
  line-height: 1.08;
  text-wrap: balance;
}
.gz-ad-head {
  margin-top: 4px;
  font-family: var(--gz-head);
  font-size: 0.98rem;
  font-style: italic;
  line-height: 1.25;
  text-wrap: balance;
}
.gz-ad-text { margin-top: 7px; font-size: 0.84rem; line-height: 1.42; }
.gz-ad-slogan { margin-top: 6px; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.gz-ad-price {
  margin-top: 8px;
  font-family: var(--gz-head);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.25;
  font-variant-numeric: lining-nums;
}
.gz-ad-addr { margin-top: 5px; font-size: 0.74rem; font-style: italic; line-height: 1.35; }
.gz-ad-addr .ph { font-size: 1.15em; font-style: normal; vertical-align: -0.15em; }
.gz-ad-legal {
  margin-top: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--gz-rule-soft);
  font-size: 0.62rem;
  line-height: 1.3;
  text-align: left;
}
.gz-ad-new {
  display: inline-block;
  margin-bottom: 6px;
  padding: 1px 8px;
  background: var(--gz-ink);
  color: var(--gz-paper);
  font-family: var(--gz-sans);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-4deg);
}

/* Bandeau : marque | texte | prix, sur toute la largeur de la page */
.gz-ad.is-banner {
  --gz-ad-scale: 1.3;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.5fr) minmax(0, 0.85fr);
  grid-template-areas: "label label label" "main body side" "legal legal legal";
  align-items: center;
  gap: 2px 24px;
  margin: 0 0 16px;
  padding: 12px 18px;
}
.gz-ad.is-banner.no-side {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  grid-template-areas: "label label" "main body" "legal legal";
}
.gz-ad.is-banner .gz-ad-label { grid-area: label; }
.gz-ad.is-banner .gz-ad-main { grid-area: main; }
.gz-ad.is-banner .gz-ad-body { grid-area: body; }
.gz-ad.is-banner .gz-ad-side { grid-area: side; }
.gz-ad.is-banner .gz-ad-legal { grid-area: legal; }
.gz-ad.is-banner .gz-ad-text { margin-top: 0; font-size: 0.92rem; text-align: justify; }
.gz-ad.is-banner .gz-ad-price { margin-top: 0; font-size: 1.3rem; }

/* 1790-1814 : « Avis », capitales sobres, filet simple */
.gz-ad--revolution .gz-ad-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gz-ink);
  font-weight: 700;
  letter-spacing: 0.4em;
}
.gz-ad--revolution .gz-ad-label::before,
.gz-ad--revolution .gz-ad-label::after { content: ""; flex: 1; border-top: 1px solid var(--gz-rule); }
.gz-ad--revolution { --gz-ad-brand: 1.08rem; }
.gz-ad--revolution .gz-ad-brand { font-family: var(--gz-body); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.gz-ad--revolution .gz-ad-head { font-family: var(--gz-body); }
.gz-ad--revolution .gz-ad-text { text-align: justify; }

/* 1815-1869 : « Annonces », cadre double, capitales grasses, main pointée */
.gz-ad--romantique { --gz-ad-brand: 1.15rem; border: 4px double var(--gz-rule); }
.gz-ad--romantique .gz-ad-label { color: var(--gz-ink); font-size: 0.78rem; font-variant: small-caps; letter-spacing: 0.18em; text-transform: none; }
.gz-ad--romantique .gz-ad-brand { letter-spacing: 0.02em; text-transform: uppercase; }
.gz-ad--romantique .gz-ad-text { text-align: justify; }
.gz-ad--romantique .gz-ad-price { font-family: var(--gz-body); font-style: italic; }

/* 1870-1918 : « Réclame », cadre orné, marque en italique, slogan en bandeau */
.gz-ad--belle {
  padding: 13px 15px 12px;
  border: 2px solid var(--gz-rule);
  border-radius: 3px;
  box-shadow: inset 0 0 0 3px var(--gz-paper), inset 0 0 0 4px var(--gz-rule);
}
.gz-ad--belle { --gz-ad-brand: 1.5rem; }
.gz-ad--belle .gz-ad-brand { font-style: italic; }
.gz-ad--belle .gz-ad-slogan {
  display: inline-block;
  padding: 2px 10px;
  border-top: 1px solid var(--gz-rule);
  border-bottom: 1px solid var(--gz-rule);
  font-family: var(--gz-head);
  font-size: 0.86rem;
  font-style: italic;
  letter-spacing: 0.02em;
  text-transform: none;
}
.gz-ad--belle .gz-ad-price { font-size: 1.24rem; }

/* 1919-1945 : Art déco, étiquette inversée, capitales espacées */
.gz-ad--folles { border-width: 3px; outline: 1px solid var(--gz-rule); outline-offset: 2px; }
.gz-ad--folles .gz-ad-label {
  margin: -10px -12px 8px;
  padding: 3px 0;
  background: var(--gz-ink);
  color: var(--gz-paper);
  letter-spacing: 0.5em;
}
.gz-ad--folles.is-banner .gz-ad-label { margin: -12px -18px 8px; }
.gz-ad--folles { --gz-ad-brand: 1.05rem; }
.gz-ad--folles .gz-ad-brand { font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }
.gz-ad--folles .gz-ad-head { font-size: 0.8rem; font-style: normal; letter-spacing: 0.08em; text-transform: uppercase; }
.gz-ad--folles .gz-ad-price { display: inline-block; padding: 1px 12px; border: 2px solid var(--gz-rule); }

/* 1946-1974 : coins arrondis, prix en pastille, bon à découper */
.gz-ad--trente { border-width: 2px; border-radius: 14px; }
.gz-ad--trente { --gz-ad-brand: 1.4rem; }
.gz-ad--trente .gz-ad-brand { font-style: italic; }
.gz-ad--trente .gz-ad-head { font-family: var(--gz-body); font-style: normal; font-weight: 700; }
.gz-ad--trente .gz-ad-price {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--gz-ink);
  color: var(--gz-paper);
  transform: rotate(-3deg);
}
.gz-ad--trente .gz-ad-addr { display: inline-block; margin-top: 8px; padding: 3px 8px; border: 1px dashed var(--gz-rule); font-style: normal; }

/* 1975-1999 : bloc noir, linéale grasse */
.gz-ad--pub { --gz-ad-fg: var(--gz-paper); --gz-ad-bg: var(--gz-ink); --gz-ad-brand: 1.25rem; border-color: var(--gz-ink); }
.gz-ad--pub .gz-ad-label { color: inherit; letter-spacing: 0.1em; text-align: right; opacity: 0.75; }
.gz-ad--pub .gz-ad-brand { font-style: italic; letter-spacing: -0.02em; text-transform: uppercase; }
.gz-ad--pub .gz-ad-head { font-style: normal; font-weight: 700; }
.gz-ad--pub .gz-ad-price { font-size: 1.5rem; font-weight: 900; }
.gz-ad--pub .gz-ad-legal { border-top-color: currentColor; opacity: 0.8; }
.gz-ad--pub .gz-ad-new { background: var(--gz-paper); color: var(--gz-ink); }

/* Depuis 2000 : linéale nette, prix en bouton, astérisques et petites mentions */
.gz-ad--numerique { border-color: var(--gz-rule-soft); border-radius: 10px; background: rgba(255, 255, 255, 0.3); }
.gz-ad--numerique .gz-ad-label { letter-spacing: 0.08em; text-align: right; text-transform: none; }
.gz-ad--numerique .gz-ad-brand { font-weight: 800; letter-spacing: -0.02em; }
.gz-ad--numerique .gz-ad-head { font-style: normal; font-weight: 400; }
.gz-ad--numerique .gz-ad-price {
  display: inline-block;
  padding: 4px 14px;
  border: 1.5px solid var(--gz-rule);
  border-radius: 999px;
  font-size: 0.95rem;
}
.gz-ad--pub,
.gz-ad--pub :is(.gz-ad-brand, .gz-ad-head, .gz-ad-price),
.gz-ad--numerique,
.gz-ad--numerique :is(.gz-ad-brand, .gz-ad-head, .gz-ad-price) { font-family: var(--gz-sans); }
.gz-ad--pub .gz-ad-text,
.gz-ad--numerique .gz-ad-text { font-size: 0.8rem; }

/* Petites annonces */
.gz-classifieds { margin-top: 12px; padding-top: 10px; border-top: 4px double var(--gz-rule); }
.gz-classifieds ul {
  margin: 0;
  padding: 0;
  list-style: none;
  column-count: 3;
  column-gap: 22px;
  column-rule: 1px solid var(--gz-rule-soft);
}
.gz-classifieds li {
  margin: 0 0 7px;
  padding-bottom: 6px;
  border-bottom: 1px dotted var(--gz-rule-soft);
  font-size: 0.8rem;
  line-height: 1.4;
  text-align: justify;
  break-inside: avoid;
}
.gz-classifieds li b { font-variant: small-caps; letter-spacing: 0.06em; }
.gz-classifieds li i { color: var(--gz-muted); font-size: 0.92em; }

/* Réclames illustrées (images de img/img-gazette-pub, listées par index.php) :
   en hauteur dans une colonne, en largeur dans une rangée avant les petites annonces. */
.gz-pub { margin: 0 0 14px; break-inside: avoid; text-align: center; }
.gz-pub img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--gz-rule);
  mix-blend-mode: multiply; /* le papier de l'image se fond dans celui du journal */
}
.gz-pubs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 26px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 2px solid var(--gz-rule);
}
.gz-pubs .gz-pub { margin-bottom: 6px; }
/* Nombre impair : la dernière, seule sur sa ligne, reste à la même taille, centrée. */
.gz-pubs .gz-pub:last-child:nth-child(odd):not(:first-child) {
  grid-column: 1 / -1;
  width: calc(50% - 13px);
  margin-right: auto;
  margin-left: auto;
}
.gz-pubs.is-single { grid-template-columns: minmax(0, 1fr); }
.gz-pubs.is-single .gz-pub { width: min(100%, 720px); margin-right: auto; margin-left: auto; }

/* Sommaire du numéro spécial */
.gz-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
  column-count: 2;
  column-gap: 30px;
  column-rule: 1px solid var(--gz-rule-soft);
}
.gz-toc li { break-inside: avoid; }
.gz-toc-item {
  display: grid;
  grid-template-columns: 3.3em minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  padding: 7px 2px;
  border: none;
  border-bottom: 1px dotted var(--gz-rule-soft);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.gz-toc-item:hover .gz-toc-hl,
.gz-toc-item:focus-visible .gz-toc-hl { text-decoration: underline; text-underline-offset: 2px; }
.gz-toc-item:focus-visible { outline: 2px solid var(--gz-ink); outline-offset: 1px; }
.gz-toc-year { font-family: var(--gz-head); font-size: 1.1rem; font-weight: 900; font-variant-numeric: lining-nums; }
.gz-toc-hl { font-size: 0.92rem; line-height: 1.35; }
.gz-toc-page { color: var(--gz-muted); font-size: 0.72rem; font-style: italic; white-space: nowrap; }

.gz-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding-top: 6px;
  border-top: 1px solid var(--gz-rule);
  color: var(--gz-muted);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.gz-foot span:last-child { white-space: nowrap; }

@media (max-width: 1099.98px) {
  /* Bandeau plus étroit : la colonne de la marque s'élargit, la marque grossit moins. */
  .gz-ad.is-banner {
    --gz-ad-scale: 1.1;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.4fr) minmax(0, 0.8fr);
  }
}
@media (max-width: 899.98px) {
  .gz-cols,
  .gz-classifieds ul { column-count: 2; }
  .gz-itws { column-count: 1; }
  /* Bandeau sur deux étages : la marque en haut, le texte et le prix dessous. */
  .gz-ad.is-banner {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    grid-template-areas: "label label" "main main" "body side" "legal legal";
    gap: 6px 20px;
  }
  .gz-ad.is-banner.no-side {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "label" "main" "body" "legal";
  }
}
@media (max-width: 699.98px) {
  .gazette-dialog {
    width: 100%;
    height: 100%;
    height: 100dvh;
    margin: 0;
    border: none;
    border-radius: 0;
  }
  .gz-bar-hint,
  .gz-nav-txt { display: none; }
  .gz-close { margin-left: auto; }
  .gz-scroll { padding: 10px 8px 18px; }
  .gz-paper { padding: 16px 16px 12px; }
  .gz-mast-top { grid-template-columns: minmax(0, 1fr); }
  .gz-ear { display: none; }
  .gz-dateline { justify-content: center; }
  .gz-top { grid-template-columns: minmax(0, 1fr); }
  .gz-figures { margin-top: 14px; padding-left: 0; border-left: none; }
  .gz-cols,
  .gz-cols[data-n="2"],
  .gz-brief ul,
  .gz-classifieds ul,
  .gz-toc ol { column-count: 1; }
  .gz-pubs { grid-template-columns: minmax(0, 1fr); }
  .gz-pubs .gz-pub:last-child:nth-child(odd):not(:first-child) { width: auto; }
  .gz-pol-grid,
  .gz-pol-grid.is-results { grid-template-columns: minmax(0, 1fr); }
  .gz-pol-grid > :first-child { padding-right: 0; padding-bottom: 6px; border-right: none; border-bottom: 1px solid var(--gz-rule-soft); }
  .gz-pol-grid > :last-child { padding-top: 10px; padding-left: 0; }
  .gz-ad.is-banner,
  .gz-ad.is-banner.no-side {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "label" "main" "body" "side" "legal";
    gap: 6px;
    padding: 10px 12px 9px;
  }
  .gz-ad.is-banner { --gz-ad-scale: 1.12; }
  .gz-ad--folles.is-banner .gz-ad-label { margin: -10px -12px 4px; }
}

/* Notifications brèves */
.toast-stack {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 2400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(92vw, 420px);
  transform: translateX(-50%);
  pointer-events: none;
}
.toast-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast-card.show { opacity: 1; transform: none; }
.toast-good { border-left-color: var(--good); }
.toast-bad { border-left-color: var(--bad); }
.toast-info { border-left-color: var(--accent); }
.toast-emoji { font-size: 1.4rem; }
.toast-text { font-size: 0.84rem; line-height: 1.3; }

/* ===========================================================================
   RESPONSIVE
   =========================================================================== */

/* Écran de jeu sur ordinateur : tout tient dans la fenêtre (pas de défilement de page). */
@media (min-width: 900px) {
  body:not(.is-landing) { overflow: hidden; }
}

/* 900–1199px : carte + journal à droite sur toute la hauteur ; GÉRER et SUIVRE empilés à gauche. */
@media (max-width: 1199.98px) {
  .game {
    grid-template-columns: minmax(280px, 330px) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "left center"
      "right center";
  }
  .col-left { grid-area: left; }
  .col-right { grid-area: right; }
  .col-center { grid-area: center; }
}

/* Landing : une colonne. */
@media (max-width: 991.98px) {
  .landing-grid { grid-template-columns: 1fr; gap: 8px; }
}

/* Petites tablettes : la colonne SUIVRE est loin sous la carte → chiffres clés en haut. */
@media (min-width: 576px) and (max-width: 899.98px) {
  .tb-hud { display: flex; }
}

/* < 900px (mobile) : une seule colonne qui défile. */
@media (max-width: 899.98px) {
  .jeu { height: auto; min-height: 100vh; }
  .topbar { position: sticky; top: 0; z-index: 20; gap: 6px 12px; padding: 8px 12px; }
  .tb-id { order: 1; flex: 1 1 auto; max-width: none; }
  .tb-vote { order: 2; }
  .tb-time { order: 3; flex: 1 1 100%; max-width: none; }
  .tb-hud { order: 4; }
  .tb-controls { order: 5; }
  .game { display: flex; flex-direction: column; gap: 0; padding: 0; }
  .col { overflow: visible; border-radius: 0; }
  .col-left,
  .col-right { border: none; border-top: 1px solid var(--border); }
  .col-center { order: 1; overflow: visible; border: none; gap: 0; }
  /* Mobile : pas de cartes, les blocs se suivent bord à bord, séparés par un filet. */
  .city-card,
  .journal { border: none; border-radius: 0; }
  .city-card { flex: none; border-bottom: 1px solid var(--border); }
  .col-left { order: 2; }
  .col-right { order: 3; }
  .col-title { position: static; }
  .city-view { flex: none; height: 40vh; height: 40svh; min-height: 220px; }
  .journal { flex: none; }
  .journal-scroll { max-height: 55vh; max-height: 55svh; }
  .city-legend { top: 8px; left: 8px; grid-template-columns: repeat(2, auto); padding: 5px 8px; font-size: 0.68rem; }
  .timeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tl-cell { height: 12px; }
}

@media (max-width: 575.98px) {
  .landing { padding: 0 16px 32px; }
  .landing-hero { padding: 16px 0 22px; }
  .hero-map { height: 340px; margin-bottom: 22px; border-radius: 10px; }
  .hero-map-chip { left: 8px; bottom: 8px; font-size: 0.78rem; }
  .hero-map-north { right: 8px; bottom: 8px; width: 32px; height: 32px; font-size: 1.1rem; }
  .party-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .weights li { grid-template-columns: minmax(0, 1fr) 70px 2.6em; }
  .tb-hud { display: none; }
  .tb-controls { width: 100%; justify-content: space-between; gap: 6px; }
  .ctl-btn { min-width: 0; padding: 0 8px; }
  .speed-btn { min-width: 28px; padding: 0 3px; }
  .speed-sec { font-size: 0.56rem; }
  .icon-btn { width: 30px; }
  .j-item { grid-template-columns: 1fr; gap: 0; }
  .pending-bar { gap: 10px; padding: 9px 10px; }
  .pending-bar-ico { display: none; }
  .pending-bar-text strong { font-size: 0.84rem; }
  .election-panel .vote-row { grid-template-columns: minmax(0, 8em) 1fr 4em; font-size: 0.8rem; }
  .bilan-grid { grid-template-columns: 1fr; }
}

/* ===========================================================================
   SON : bouton haut-parleur et fenêtre de réglage (js/audio.js)
   =========================================================================== */
.audio-panel {
  position: fixed;
  top: 56px;
  right: 16px;
  z-index: 2600;              /* au-dessus des modales : on peut baisser le son à tout moment */
  width: 290px;
  max-width: calc(100vw - 16px);
  padding: 12px 14px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 0.875rem;
}
.audio-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.audio-head strong { font-size: 0.95rem; }
.audio-head .ph { color: var(--accent); }
.audio-block { padding: 8px 0; border-top: 1px solid var(--border); }
.audio-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.audio-panel .form-check { margin: 0; min-height: 0; }
.audio-panel .form-check-label { font-weight: 600; cursor: pointer; }
.audio-panel .form-check-label .ph { color: var(--muted); }
.audio-panel .form-check-input { cursor: pointer; }
.audio-panel .form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.audio-panel .form-check-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.audio-vol {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 3.2em;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
}
.audio-vol output { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-2); }
.audio-panel .form-range { height: 1.2rem; }
.audio-panel .form-range::-webkit-slider-thumb { background-color: var(--accent); }
.audio-panel .form-range::-moz-range-thumb { background-color: var(--accent); }
.audio-panel .form-range::-webkit-slider-runnable-track { background-color: var(--surface-3); }
.audio-panel .form-range::-moz-range-track { background-color: var(--surface-3); }
.audio-panel .form-range:focus::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--accent-soft); }
.audio-panel .form-range:focus::-moz-range-thumb { box-shadow: 0 0 0 3px var(--accent-soft); }
.audio-track,
.audio-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}
.audio-track { min-height: 1.35em; overflow-wrap: anywhere; }
.audio-panel > .audio-hint { padding-top: 8px; border-top: 1px solid var(--border); }
.audio-panel kbd {
  padding: 0 5px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.75rem;
}

/* Mobile : la fenêtre prend toute la largeur sous le bouton. */
@media (max-width: 575.98px) {
  .audio-panel { left: 8px !important; right: 8px !important; width: auto; max-width: none; }
}

/* ===========================================================================
   CLASSEMENT DES MAIRES ET COMPTE (classement.php, js/compte.js, js/serveur.js)
   =========================================================================== */

/* Barre de l'accueil : classement, compte, thème */
.landing-nav { display: flex; align-items: center; gap: 6px; min-width: 0; }
.nav-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  max-width: 260px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.nav-link-btn:hover { background: var(--surface-2); color: var(--text); }
.nav-link-btn .ph { font-size: 1.05rem; vertical-align: 0; }
.nav-link-btn .nav-txt { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) {
  .nav-link-btn { width: 32px; padding: 0; justify-content: center; }
  .nav-link-btn .nav-txt { display: none; }
}

/* Liens-boutons dans le texte courant */
.compte-body .link-btn,
.gameover-compte .link-btn,
.cl-filtre-btn .link-btn { padding: 0; font-size: inherit; }

/* Fenêtre de fin : place au classement, invitation au compte */
.gameover-rank {
  margin: -6px 0 16px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.88rem;
}
.gameover-rank .ph { color: var(--warn); }
.gameover-compte { margin: 14px 0 0; font-size: 0.8rem; color: var(--muted); }

/* Fenêtre du compte */
.compte-dialog { width: min(440px, calc(100% - 32px)); }
.compte-body form { display: flex; flex-direction: column; gap: 12px; }
.compte-intro { margin: 0 0 14px; font-size: 0.86rem; color: var(--text-2); }
.compte-field .form-label { margin-bottom: 4px; font-size: 0.84rem; font-weight: 600; }
.field-error { margin: 4px 0 0; color: var(--bad); font-size: 0.8rem; font-weight: 600; }
.compte-check { margin: 0; font-size: 0.84rem; }
.compte-alt { margin: 14px 0 0; font-size: 0.84rem; color: var(--muted); text-align: center; }
.compte-msg {
  margin: 0 0 14px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.86rem;
}
.compte-msg.is-ok { background: var(--good-soft); color: var(--text); }
.compte-msg.is-ok .ph { color: var(--good); }
.compte-msg.is-err { background: var(--bad-soft); color: var(--text); }
.compte-msg.is-err .ph { color: var(--bad); }
.compte-moi { margin: 0 0 12px; }
.compte-moi > div { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.compte-moi dt { flex: 0 0 72px; font-weight: 600; color: var(--muted); }
.compte-moi dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.compte-ok { color: var(--good); font-weight: 600; }
.compte-warn { color: var(--warn); font-weight: 600; }
.compte-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.compte-danger { font-size: 0.84rem; color: var(--text-2); }
.compte-danger summary { color: var(--bad); font-weight: 600; cursor: pointer; }
.compte-danger p { margin: 8px 0 10px; }

/* Page du classement */
.page-classement .landing { max-width: 980px; }
.cl-hero { padding: 26px 0 18px; }
.cl-title {
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
}
.cl-lead { max-width: 680px; margin: 0; color: var(--text-2); }
.cl-filtres {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.cl-filtre { flex: 1 1 180px; min-width: 0; }
.cl-filtre .form-label { margin-bottom: 4px; font-size: 0.76rem; font-weight: 600; color: var(--muted); }
.cl-filtre-btn { flex: 0 0 auto; display: flex; align-items: center; gap: 12px; }
.cl-compte { margin: 0 0 10px; font-size: 0.82rem; color: var(--muted); }
.cl-vide {
  margin: 24px 0;
  padding: 28px 16px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  text-align: center;
  color: var(--text-2);
}
.cl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cl-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 4px 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  scroll-margin-top: 16px;
}
.cl-row.is-moi { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.cl-row.is-cible { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.cl-rang {
  align-self: start;
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.cl-list > .cl-row:nth-child(-n+3) .cl-rang { color: var(--warn); }
.cl-main { min-width: 0; }
.cl-maire { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.cl-titre { font-size: 0.78rem; color: var(--muted); }
.cl-pseudo { font-size: 1.05rem; overflow-wrap: anywhere; }
.cl-vous {
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.6;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cl-ville { margin-top: 2px; font-size: 0.86rem; color: var(--text-2); }
.cl-ville-nom { font-weight: 700; color: var(--text); text-decoration: none; }
.cl-ville-nom:hover { text-decoration: underline; }
.cl-chiffres {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 14px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.8rem;
  color: var(--muted);
}
.cl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.cl-erreur { font-size: 0.8rem; color: var(--bad); font-weight: 600; }
.cl-mandats { margin-top: 8px; font-size: 0.84rem; }
.cl-mandats summary { width: fit-content; color: var(--accent); font-weight: 600; cursor: pointer; }
.cl-table-wrap { margin-top: 8px; overflow-x: auto; }
.cl-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; white-space: nowrap; }
.cl-table th, .cl-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.cl-table thead th { color: var(--muted); font-weight: 600; }
.cl-issue-reelu, .cl-issue-reconduit { color: var(--good); font-weight: 600; }
.cl-issue-battu, .cl-issue-remplace, .cl-issue-dissous { color: var(--bad); font-weight: 600; }
.cl-duree { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.cl-duree strong { font-size: 1.1rem; white-space: nowrap; }
.cl-issue { font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.cl-issue.is-live { color: var(--good); }
.cl-issue.is-live .ph-fill { font-size: 0.6rem; vertical-align: 0.1em; }
.cl-issue.is-pause { color: var(--warn); }
.cl-issue.is-fin { color: var(--muted); }
.cl-pages { display: flex; justify-content: center; align-items: center; gap: 12px; margin: 20px 0 0; }
.cl-pages-txt { font-size: 0.84rem; color: var(--muted); }
@media (max-width: 640px) {
  .cl-row { grid-template-columns: 34px minmax(0, 1fr); padding: 12px; }
  .cl-rang { font-size: 1.2rem; }
  .cl-rang { grid-row: 1 / span 2; }
  .cl-duree { grid-column: 2; grid-row: 1; flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: baseline; text-align: left; }
  .cl-main { grid-column: 2; grid-row: 2; }
  .cl-filtres { padding: 10px; }
}

/* Classement : vos parties de ce navigateur absentes de la page, et pourquoi (js/classement.js) */
.cl-vos {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid var(--accent);
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 0.86rem;
}
.cl-vos-titre { margin: 0 0 6px; font-size: 0.92rem; font-weight: 700; }
.cl-vos-titre .ph { color: var(--accent); }
.cl-vos ul { margin: 0; padding-left: 18px; }
.cl-vos li + li { margin-top: 4px; }
.cl-vos-detail { display: inline-block; margin-top: 2px; font-size: 0.8rem; color: var(--muted); }
