/* ── Jetons de design ─────────────────────────────────────────────────────────
   Règle : toute couleur d'INTERFACE (texte, fond, bordure, bouton, badge) passe par
   un jeton. Les couleurs SÉMANTIQUES de carte (communes, lacs, rivières, états
   trouvé/faux/révélé), les dégradés du podium et de la barre XP et les confettis
   restent littéraux — ce n'est pas de l'interface.
   `--sb-h` (hauteur du bandeau) n'est PAS déclaré ici : nav.js le mesure et le pose
   sur <html> ; les usages gardent leur valeur de repli var(--sb-h, 60px). */
:root {
  --c-bg: #f4f6f8;
  --c-surface: #fff;
  --c-ink: #1c2a3a;
  --c-ink-2: #44505c;
  --c-muted: #6b7884;
  --c-line: #dde3ea;
  --c-green: #2b7;
  --c-green-deep: #178a55;
  --c-green-soft: #eafaf2;
  --c-violet: #7d23bc;
  --c-violet-soft: #f3eefb;
  --c-red: #d6463c;
  --c-amber: #e0a020;
  --c-xp: #241333;
  /* Défi du jour : un vert plus clair que Jouer, et son encre. */
  --c-green-light: #4fc78a;
  --c-green-ink: #0b3a26;
  /* Verts pâles : survols de liste, cantons jouables, filets. */
  --c-green-pale: #9ad6b5;
  --c-green-line: #d7e9df;
  /* Ambre doux : encarts d'information et leur texte. */
  --c-amber-soft: #fff3cd;
  --c-amber-ink: #8a6d1b;
  /* Rouge doux : mauvaise réponse du QCM et son texte. */
  --c-red-soft: #f6d7d4;
  --c-red-ink: #8a2018;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 16px;

  --shadow-card: 0 2px 12px rgba(0,0,0,.07);
  --shadow-hard: 0 3px 0 rgba(0,0,0,.28);

  --font-display: "Nunito", system-ui, sans-serif;
  --xp-h: 48px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: system-ui, sans-serif; background: var(--c-bg); color: var(--c-ink); }
.view { display: none; height: 100%; }
.view.active { display: flex; }
.hidden { display: none !important; }
.muted { color: var(--c-muted); }

#view-home, #view-scores { flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
/* Accueil + scores : peuvent déborder -> scrollables, centrés seulement si ça rentre (safe). */
#view-home, #view-scores { overflow-y: auto; justify-content: safe center; }
/* Laisse la place au bandeau fixe en haut */
#view-home, #view-scores { padding-top: calc(var(--sb-h, 60px) + 6px); }
/* Marge en bas : évite que la barre du navigateur mobile recouvre le pager */
#view-scores { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px); }
/* Marge en bas : évite que la barre du navigateur mobile recouvre les derniers boutons */
#view-home { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 72px); }

/* Bandeau site (accueil / scores), masqué pendant la partie */
#site-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 16px; background: var(--c-surface); border-bottom: 1px solid var(--c-line); }
#view-game.active ~ #site-bar { display: none; }
.sb-logo { font-weight: 700; font-size: .95rem; color: var(--c-ink-2); text-decoration: none;
  background: var(--c-bg); padding: 9px 16px; border-radius: 10px; }
.sb-logo:hover { background: var(--c-line); color: var(--c-green-deep); }
.sb-right { display: flex; align-items: center; gap: 10px; }
.sb-user { font-size: .85rem; color: var(--c-muted); }
/* Pseudo + Déconnexion fusionnés en un seul bloc bouton (style rétro). */
.sb-account { display: inline-flex; align-items: stretch; border: 2px solid var(--c-ink); border-radius: 6px;
  box-shadow: 0 3px 0 rgba(0,0,0,.28); overflow: hidden; font-size: .82rem; line-height: 1;
  transition: transform .07s ease, box-shadow .1s ease; }
.sb-account:active { transform: translateY(3px); box-shadow: 0 0 0 rgba(0,0,0,.28); }
.sb-account-name { display: inline-flex; align-items: center; gap: 6px; background: var(--c-bg); color: var(--c-ink-2); padding: 8px 12px; text-decoration: none; }
.sb-account-name:hover { background: var(--c-line); color: var(--c-green-deep); }
.sb-account-cnt { color: var(--c-green-deep); font-weight: 700; }
.sb-account-logout { display: inline-flex; align-items: center; background: var(--c-surface); color: var(--c-ink-2);
  padding: 8px 12px; text-decoration: none; border-left: 2px solid var(--c-ink); }
.sb-account-logout:hover { background: var(--c-bg); color: var(--c-green-deep); }
.sb-btn { font-size: .82rem; padding: 7px 14px; border-radius: 8px; text-decoration: none; border: 1px solid var(--c-line); color: var(--c-ink-2); background: var(--c-surface); }
.sb-btn:hover { border-color: var(--c-green); color: var(--c-green-deep); }
.sb-btn-primary { background: var(--c-green); color: #fff; border-color: var(--c-green); }
.sb-btn-primary:hover { opacity: .9; color: #fff; }
/* Cibles tactiles : hauteur minimale confortable au doigt. */
.sb-btn, .sb-logo { min-height: 40px; display: inline-flex; align-items: center; }
/* Mobile : une seule action dans le bandeau (Connexion ou le compte), tout sur une ligne.
   « Soutenir » et « Créer un compte » sont repris ailleurs (pied de page, page de connexion). */
@media (max-width: 520px) {
  #site-bar { padding: 7px 10px; gap: 6px; flex-wrap: nowrap; }
  .sb-logo { padding: 8px 10px; font-size: .85rem; white-space: nowrap; }
  .sb-right { gap: 6px; min-width: 0; }
  .sb-btn { padding: 8px 10px; font-size: .8rem; white-space: nowrap; }
  .sb-don, .sb-register, .sb-account-cnt { display: none; }
  .sb-account-name, .sb-account-logout { padding: 8px 9px; }
  .sb-account-name { max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* Lien « Soutenir » en pied de page (accueil), visible seulement quand le bandeau le masque. */
.don-foot { display: none; margin-top: 8px; color: var(--c-green-deep); font-weight: 700; text-decoration: none; padding: 12px 16px; }
@media (max-width: 520px) { .don-foot { display: inline-block; } }

/* Modes hors commune : pas de difficulté → on masque les modes.
   Commune ET district gardent le sélecteur de canton ; canton/lac le masquent. */
.home-play:not(.kind-commune) #mode-select { display: none; }
.home-play.kind-canton .suisse-wrap, .home-play.kind-canton .canton-row,
.home-play.kind-lac .suisse-wrap, .home-play.kind-lac .canton-row { display: none; }
/* Frontières de cantons en décor (jeux nationaux), non cliquables. */
#map path.border { fill: none; stroke: #8a97a4; stroke-width: 1.2; vector-effect: non-scaling-stroke; pointer-events: none; }
/* Mode lac : lacs (cibles) en bleu à l'état neutre (found/wrong gardent leur couleur),
   + gros contour à taille d'écran constante → les petits lacs deviennent cliquables.
   paint-order:stroke = le contour passe DERRIÈRE le remplissage (halo qui agrandit). */
#map[data-kind="lac"] path.commune:not(.found):not(.zone):not(.wrong):not(.reveal):not(.wrong-tried) { fill: #8ec9ec; }
#map[data-kind="lac"] path.commune { stroke: #3f7fa6; stroke-width: 6; paint-order: stroke; }

/* Sélecteur de mode (accueil) */
.mode-select { display: flex; gap: 8px; width: min(420px, 92vw); }
.mode-btn { flex: 1 1 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border: 2px solid var(--c-line); border-radius: 10px; background: var(--c-surface); cursor: pointer; font-family: inherit; color: var(--c-ink); transition: border-color .1s, background .1s; }
.mode-btn-name { font-weight: 700; font-size: .95rem; }
.mode-btn small { color: var(--c-muted); font-size: .75rem; }
/* .mode-btn.active vit désormais dans les sections page-game / page-quiz (tâche 2) :
   la pastille de difficulté et l'état du QCM ont chacun leur propre style. */
/* Sélecteur de son (accueil, connectés) */
.sound-pref { width: min(420px, 92vw); display: flex; flex-direction: column; gap: 6px; }

/* ── Mise en page de l'accueil ──
   Mobile (défaut) : les conteneurs sont transparents (display:contents),
   l'accueil reste la colonne centrée d'avant. */
.home-wrap, .home-grid, .home-top, .home-play, .home-side { display: contents; }

/* Desktop : disposition « tableau de bord » (jeu à gauche, explications à droite). */
@media (min-width: 860px) {
  #view-home { justify-content: flex-start; align-items: stretch; padding: 84px 28px 44px; }
  .home-wrap { display: block; width: 100%; max-width: 1140px; margin: 0 auto; }
  .home-top { display: block; text-align: center; margin-bottom: 22px; }
  .home-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 26px; align-items: start; }
  .home-play { display: flex; flex-direction: column; gap: 16px; grid-column: 1; grid-row: 1;
               background: var(--c-surface); border-radius: 16px; padding: 22px; box-shadow: 0 2px 12px rgba(0,0,0,.07); }
  .home-side { display: flex; flex-direction: column; gap: 16px; grid-column: 2; grid-row: 1; }
  /* Les composants remplissent leur colonne (on annule les largeurs mobiles). */
  .home-play .suisse-wrap, .home-play .canton-row, .home-play #mode-select, .home-play #pseudo,
  .home-side .sound-pref { width: 100%; max-width: none; }
  #view-home #pseudo { width: 100%; }
  /* Carte blanche dans la colonne de droite. */
  .home-side .sound-pref { background: var(--c-surface); border-radius: 14px; padding: 16px 18px; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
}
/* Badges de mode (classement) */
.mode-badge { display: inline-block; min-width: 16px; padding: 0 5px; border-radius: 4px; font-size: .75rem; font-weight: 700; color: #fff; text-align: center; vertical-align: middle; }
.badge-facile { background: var(--c-green-deep); }
.badge-moyen  { background: var(--c-amber); }
.badge-dur    { background: var(--c-red); }
.canton-badge { display: inline-block; min-width: 16px; padding: 0 5px; border-radius: 4px; font-size: .75rem; font-weight: 700; color: #fff; background: var(--c-muted); text-align: center; vertical-align: middle; }
/* Bascule « Meilleure par joueur » / « Toutes les parties » (vues classement) */
.scores-best { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
/* Onglets de filtre (page des scores) : le look vient de .chip, .filter-tab n'est plus qu'un crochet JS. */
.scores-filter { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; width: min(560px, 94vw); }
/* Carte de Suisse cliquable (accueil) */
.suisse-wrap { width: min(440px, 94vw); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.suisse-title { font-size: .78rem; color: var(--c-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.canton-map { width: 100%; height: auto; }
.canton-map-sm { width: min(300px, 78vw); }
/* Carte décorative d'accueil (jeux nationaux canton / lac), non cliquable. */
.home-canton { fill: #dceee3; stroke: #2b7; stroke-width: 1; vector-effect: non-scaling-stroke; }
.home-canton-bg { fill: #eef3f0; stroke: #cfe0d6; stroke-width: .6; vector-effect: non-scaling-stroke; }
.home-lake { fill: #8ec9ec; stroke: #3f7fa6; stroke-width: .6; vector-effect: non-scaling-stroke; }
#home-map { pointer-events: none; }
.scores-region { display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(440px, 94vw); margin-bottom: 4px; }
.canton-shape { stroke: #fff; stroke-width: 0.8; vector-effect: non-scaling-stroke; }
.canton-shape.unavailable { fill: #dde1e6; }
.canton-shape.available { fill: var(--c-green-pale); cursor: pointer; transition: fill .12s; }
.canton-shape.available.selected { fill: #2b7; }
.canton-lbl { font-family: system-ui, sans-serif; font-size: 22px; font-weight: 700; fill: #14402a; text-anchor: middle; dominant-baseline: central; pointer-events: none; paint-order: stroke; stroke: #fff; stroke-width: 4px; }
@media (hover: hover) and (pointer: fine) {
  .canton-shape.available:not(.selected):hover { fill: #6fc497; }
}
/* Sélecteur de canton (accueil) */
.canton-row { display: flex; align-items: center; gap: 10px; width: min(420px, 92vw); flex-wrap: wrap; }
.canton-row label { font-size: .78rem; color: var(--c-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.canton-select { flex: 1 1 140px; min-width: 0; padding: 10px 12px; border: 2px solid var(--c-line); border-radius: 10px; background: var(--c-surface); font-family: inherit; font-size: 1rem; color: var(--c-ink); cursor: pointer; }
.canton-select:focus { border-color: var(--c-green); }
.canton-filter { flex: 1 1 110px; min-width: 0; padding: 10px 12px; border: 2px solid var(--c-line); border-radius: 10px; background: var(--c-surface); font-family: inherit; font-size: .95rem; color: var(--c-ink); }
.canton-filter:focus { border-color: var(--c-green); }
h1 { font-size: 1.8rem; }
.sub { color: var(--c-muted); }
#pseudo { font-size: 1.1rem; padding: 12px 16px; border: 2px solid var(--c-line); border-radius: 10px; width: min(320px, 90vw); text-align: center; }
#pseudo.pseudo-locked { background: var(--c-bg); color: var(--c-green); font-weight: 700; cursor: not-allowed; }
/* ── Composant bouton ─────────────────────────────────────────────────────────
   Look rétro : bord 2 px encre, rayon net, ombre dure dessous, enfoncement à
   l'appui. `button` nu hérite du même look (aucune page n'a besoin d'ajouter .btn
   pour qu'un bouton soit correct). Variantes : primary (vert plein), secondary
   (blanc), ghost (fond de page, sans ombre), sm (compact), block (pleine largeur). */
button, .btn {
  font: inherit; font-size: 1rem; font-weight: 700; line-height: 1.2;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; min-height: 44px;
  border: 2px solid var(--c-ink); border-radius: var(--r-sm);
  background: var(--c-surface); color: var(--c-ink);
  box-shadow: var(--shadow-hard); cursor: pointer; text-decoration: none;
  transition: transform .07s ease, box-shadow .1s ease, background .12s ease;
}
button:active, .btn:active { transform: translateY(3px); box-shadow: 0 0 0 rgba(0,0,0,.28); }
button:disabled, .btn:disabled {
  background: var(--c-bg); color: var(--c-muted); border-color: var(--c-line);
  box-shadow: none; cursor: not-allowed; transform: none; opacity: .55;
}
.btn-primary { background: var(--c-green); color: #fff; }
.btn-primary:hover { background: var(--c-green-deep); color: #fff; }
.btn-secondary { background: var(--c-surface); color: var(--c-ink); }
.btn-secondary:hover { background: var(--c-green-soft); color: var(--c-green-deep); }
.btn-ghost { background: var(--c-bg); color: var(--c-ink-2); box-shadow: none; }
.btn-ghost:hover { background: var(--c-line); }
.btn-sm { padding: 8px 12px; min-height: 36px; font-size: .85rem; }
.btn-block { width: 100%; }
/* Défi du jour : vert plus clair que Jouer, rempli (variante du composant). */
.btn-defi { background: var(--c-green-light); color: var(--c-green-ink); }
.btn-defi small { color: var(--c-green-ink); opacity: .9; }
.btn-defi:hover { background: var(--c-green); color: var(--c-green-ink); }

/* Pilule : filtres, bascules, badges cliquables. Pas d'ombre dure. */
.chip {
  font: inherit; font-size: .85rem; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px; min-height: 40px;
  border: 2px solid var(--c-line); border-radius: var(--r-md);
  background: var(--c-surface); color: var(--c-ink-2); box-shadow: none;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.chip:hover { border-color: var(--c-green); color: var(--c-green-deep); }
.chip:active { transform: none; box-shadow: none; }
.chip.active, .chip[aria-pressed="true"] { background: var(--c-green); border-color: var(--c-green); color: #fff; }

/* ── Icônes ───────────────────────────────────────────────────────────────────
   Monochromes, à la taille et à la couleur du texte qui les entoure. */
.ico { width: 1.15em; height: 1.15em; vertical-align: -.18em; flex: 0 0 auto;
  fill: none; stroke: currentColor; }
h1 .ico, h2 .ico { width: 1em; height: 1em; vertical-align: -.1em; margin-right: 6px; }
/* Drapeau suisse en CSS (remplace l'emoji, rendu très variable d'un appareil à l'autre). */
.flag-ch { display: inline-block; width: 1em; height: 1em; vertical-align: -.12em;
  margin-right: 6px; border-radius: 2px; background: #d52b1e;
  background-image: linear-gradient(#fff, #fff), linear-gradient(#fff, #fff);
  background-size: 60% 20%, 20% 60%; background-position: center, center;
  background-repeat: no-repeat; }
/* Champs de recherche : l'icône remplace le 🔎 du placeholder. */
.search-wrap { position: relative; display: block; }
.search-wrap .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--c-muted); pointer-events: none; }
.search-wrap input { padding-left: 32px; }

/* Accessibilité : anneau de focus clavier visible partout. */
:focus-visible { outline: 3px solid var(--c-green); outline-offset: 2px; }

/* Bandeau : des liens, pas des <button> — ils reprennent le look du composant. */
.sb-btn, .sb-logo { border: 2px solid var(--c-ink); border-radius: var(--r-sm);
  box-shadow: var(--shadow-hard); transition: transform .07s ease, box-shadow .1s ease; }
.sb-btn:active, .sb-logo:active { transform: translateY(3px); box-shadow: 0 0 0 rgba(0,0,0,.28); }

/* Tuiles de l'accueil : juste le bord rétro — .page-home .xtile fixe rayon, ombre et survol. */
.xtile { border: 2px solid var(--c-ink); }

/* ── Typographie d'affichage ──────────────────────────────────────────────────
   Nunito (800/900) pour les titres et les gros chiffres ; le corps reste system-ui. */
h1, .end-title, .end-final, .hud-target, .hud-score, .count-num, .live-num,
.podium-name, .podium-points, #q-timer, #xp-bar .xpb-pct {
  font-family: var(--font-display); font-weight: 800;
}
/* Chiffres de même largeur : plus de sautillement des scores et des chronos. */
.hud-score, .hud-sub, .end-final, .end-sub, .end-compare, .live-num, .podium-points,
.podium-time, #q-timer, #time-left, #pg-info, .carte-prog, #xp-bar .xpb-side {
  font-variant-numeric: tabular-nums;
}
button:active { transform: translateY(1px); }

#view-game { flex-direction: column; }
#hud { display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--c-surface); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.hud-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; line-height: 1.12; }
/* Nom de la cible : UNE ligne, jamais deux (les longs noms sont coupés). */
.hud-target { font-size: clamp(1.15rem, 5.2vw, 2rem); font-weight: 800; color: var(--c-green-deep);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-sub { font-size: .85rem; color: var(--c-muted); }
.hud-score { flex: 0 0 auto; align-self: center; background: var(--c-green); color: #fff;
  font-weight: 800; font-size: clamp(1.1rem, 4.2vw, 1.6rem); padding: 8px 16px;
  border-radius: var(--r-md); box-shadow: 0 2px 6px rgba(43,187,119,.35); white-space: nowrap; }
.hud-buttons { flex: 0 0 auto; display: flex; gap: 6px; }
/* Barre de temps : 14 px, avec les secondes restantes de la cible à droite. */
#time-bar-wrap { position: relative; flex: 0 0 auto; height: 14px; width: 100%; background: rgba(0,0,0,.08); }
#time-bar { height: 100%; width: 100%; background: hsl(120,75%,45%);
  transition: width .12s linear, background .3s linear; }
.time-left { position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: .72rem; /* exception : tient dans la barre de 14 px */
  font-weight: 800; color: var(--c-ink); font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(255,255,255,.85); pointer-events: none; }
#map { flex: 1 1 auto; width: 100%; min-height: 0; touch-action: none; background: linear-gradient(180deg, #d9ecfb, #eef5fb); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* Relief doux : ombre portée sur le seul contour extérieur du canton (groupe .land). */
#map g.land { filter: drop-shadow(0 1.4px 1.5px rgba(40, 60, 90, .28)); }
/* Pendant un zoom (molette/pinch), on coupe l'ombre : la recalculer à chaque cran fait laguer. */
#map.zooming g.land { filter: none; }
#map path.commune { fill: #d4dce7; stroke: #fff; stroke-width: 1; stroke-linejoin: round; vector-effect: non-scaling-stroke; cursor: pointer; transform-box: fill-box; transform-origin: center; transition: transform .12s ease, filter .12s ease; }
#map path.lake { fill: url(#tlc-lake); stroke: none; pointer-events: none; }
#map path.river { fill: none; stroke: #8ec3e8; stroke-width: 0.9; stroke-opacity: 0.85; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
#map path.wrong-tried { fill: #f3b0aa; }   /* déjà cliquée à tort pour la commune en cours */
#map path.zone { fill: #ffd866; }
#map path.found { fill: #52cf94; }
#map path.wrong { fill: #e8625a; }
#map path.reveal { fill: #f0a836; }
/* Communes "importantes" (les plus peuplées) : teinte distincte tant que pas trouvées. */
#map path.commune[data-major]:not(.found):not(.zone):not(.wrong):not(.reveal):not(.wrong-tried) { fill: #b39ce4; }
/* Survol souris (PC uniquement) : surligne la commune neutre sous le curseur */
@media (hover: hover) and (pointer: fine) {
  #map path.commune:not(.found):not(.zone):not(.wrong):not(.reveal):not(.wrong-tried):hover { fill: #c4cedd; }
  #map path.commune[data-major]:not(.found):not(.zone):not(.wrong):not(.reveal):not(.wrong-tried):hover { fill: #a78ddd; }
  /* Effet pop 3D : la commune survolée se soulève (scale + ombre). Le z-order est géré en JS. */
  #map path.commune:hover { transform: scale(1.07); filter: drop-shadow(0 2px 3px rgba(20, 30, 50, .35)); }
}
/* Mode Dur : pas de rivières, pas de teinte violette sur les communes peuplées. */
#map[data-diff="dur"] path.river { display: none; }
#map[data-diff="dur"] path.commune[data-major]:not(.found):not(.zone):not(.wrong):not(.reveal):not(.wrong-tried) { fill: #d4dce7; }
@media (hover: hover) and (pointer: fine) {
  #map[data-diff="dur"] path.commune[data-major]:not(.found):not(.zone):not(.wrong):not(.reveal):not(.wrong-tried):hover { fill: #c4cedd; }
}
/* Étiquette qui suit le curseur (mode Facile) : trait à 45° + nom de la commune survolée. */
#cursor-hint { position: fixed; z-index: 60; pointer-events: none; display: none; }
#cursor-hint.show { display: block; }
#cursor-hint .ch-line { position: absolute; left: 0; bottom: 0; width: 46px; height: 0; border-top: 2px solid var(--c-ink); transform-origin: left center; transform: rotate(-45deg); }
#cursor-hint .ch-name { position: absolute; left: 33px; bottom: 26px; white-space: nowrap; background: var(--c-ink); color: #fff; font-weight: 700; font-size: .9rem; padding: 4px 9px; border-radius: 6px; transform: translateY(-50%); box-shadow: 0 2px 6px rgba(0,0,0,.3); }

/* Boutons de difficulté : look un peu rétro/pixel (coins nets + ombre dure)
   + brillance des bords quand on en sélectionne un. */
#mode-select .mode-btn, #indice-select .mode-btn { border-radius: 5px; box-shadow: 0 3px 0 rgba(0,0,0,.22); }
#mode-select .mode-btn:active, #indice-select .mode-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0,0,0,.22); }
#mode-select .mode-btn.active, #indice-select .mode-btn.active { animation: modeShine .55s ease-out; }
@keyframes modeShine {
  0%   { box-shadow: 0 3px 0 rgba(0,0,0,.22), 0 0 0 0 rgba(255,255,255,0), inset 0 0 0 0 rgba(255,255,255,0); }
  35%  { box-shadow: 0 3px 0 rgba(0,0,0,.22), 0 0 16px 3px rgba(255,255,255,.9), inset 0 0 12px rgba(255,255,255,.75); }
  100% { box-shadow: 0 3px 0 rgba(0,0,0,.22), 0 0 0 0 rgba(255,255,255,0), inset 0 0 0 0 rgba(255,255,255,0); }
}

.fx-shine { animation: btnShine .5s ease-out; }
@keyframes btnShine {
  0%   { box-shadow: 0 3px 0 rgba(0,0,0,.28), 0 0 0 0 rgba(255,255,255,0); }
  35%  { box-shadow: 0 3px 0 rgba(0,0,0,.28), 0 0 14px 2px rgba(255,255,255,.9), inset 0 0 9px rgba(255,255,255,.55); }
  100% { box-shadow: 0 3px 0 rgba(0,0,0,.28), 0 0 0 0 rgba(255,255,255,0); }
}

/* Mouvement réduit : on coupe tout ce qui bouge pour le plaisir. `.score-pop` se
   retire du DOM sur `animationend` → on garde l'animation mais instantanée,
   sinon les « +15 » resteraient collés à l'écran. */
@media (prefers-reduced-motion: reduce) {
  .count-num.pop, .fx-shine, #mode-select .mode-btn.active, #indice-select .mode-btn.active, #end-record,
  #map path.pop, .xtile:hover .xt-ico { animation: none; }
  .score-pop { animation-duration: .01ms; }
}

/* Décompte 3·2·1·GO! au début d'une partie */
.count-ovl { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.count-num { font-size: clamp(70px, 22vw, 160px); font-weight: 900; color: #fff; text-shadow: 0 4px 18px rgba(0,0,0,.45), 0 0 8px rgba(0,0,0,.35); }
.count-num.go { color: #2be88a; }
.count-num.pop { animation: countpop .7s ease-out; }
@keyframes countpop {
  0%   { transform: scale(.4);  opacity: 0; }
  25%  { transform: scale(1.12); opacity: 1; }
  80%  { transform: scale(1);    opacity: 1; }
  100% { transform: scale(.9);   opacity: 0; }
}
/* font-size posé dynamiquement en JS (map.js, ~constant à l'écran) ; pas de
   font-size ici sinon il écraserait l'attribut (priorité CSS > attribut SVG). */
#map text.initial { fill: #222; font-weight: 400; text-anchor: middle; dominant-baseline: central; pointer-events: none; }

/* ── Carte de fin de partie (composant js/endcard.js) ────────────────────────── */
.end-backdrop { position: fixed; inset: 0; z-index: 65; background: rgba(20,30,50,.45); }
.endcard { position: absolute; inset: 0; margin: auto; z-index: 70;
  width: min(380px, 92vw); height: max-content; max-height: 92vh; overflow-y: auto;
  background: var(--c-surface); border-radius: var(--r-lg); padding: 22px 20px 12px;
  text-align: center; box-shadow: 0 14px 40px rgba(0,0,0,.3);
  display: flex; flex-direction: column; gap: 10px; }
.endcard:focus, .end-title:focus { outline: none; }
.end-title { font-family: var(--font-display); font-size: 1.7rem; font-weight: 900; line-height: 1.1; margin: 0; }
.end-title.tone-top, .end-title.tone-good { color: var(--c-green-deep); }
.end-title.tone-ok { color: var(--c-amber); }
.end-title.tone-low { color: var(--c-ink-2); }
.end-final { font-family: var(--font-display); font-size: 2.6rem; font-weight: 900;
  color: var(--c-ink); line-height: 1.05; font-variant-numeric: tabular-nums; }
.end-final .end-max-wrap { font-size: 1rem; color: var(--c-muted); font-weight: 700; }
.end-compare { font-size: .95rem; font-weight: 700; color: var(--c-ink-2); min-height: 1.2em; }
.end-dots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.end-dots:empty { display: none; }
.end-dots i { display: block; width: 12px; height: 12px; border-radius: 50%; background: var(--c-line); }
.end-dots i.ok { background: var(--c-green); }
.end-dots i.ko { background: var(--c-red); }
/* Pastilles cliquables (fiche de commune). Elles reprennent la SILHOUETTE DU LOGO — l'épingle
   de carte du favicon — plutôt qu'un simple point : c'est la marque du jeu, et une épingle
   plantée dit bien ce qu'elle désigne. `button, .btn` impose un fond, une bordure et une ombre
   portée à tout bouton : sans ces remises à zéro, la pastille apparaît dans une capsule
   blanche qui lui donne un air ovale. La cible tactile est le bouton (30 px), pas l'épingle. */
.end-dots-click { gap: 2px; }
.end-dots-click button {
  display: grid; place-items: center; width: 30px; height: 30px;
  padding: 0; min-height: 0; border: 0; border-radius: 0;
  background: none; box-shadow: none; cursor: pointer;
}
.end-dots-click button:active { transform: none; box-shadow: none; }
.end-dots-click button::before {
  content: ''; display: block; width: 15px; height: 20px;
  background: var(--c-line); transition: transform .1s ease;
  /* Épingle du favicon (viewBox 0 0 60 82), normalisée en pourcentages. */
  clip-path: path('M 7.5,20 C 7.5,20 1,12.5 1,7 C 1,3.5 3.9,0.75 7.5,0.75 C 11.1,0.75 14,3.5 14,7 C 14,12.5 7.5,20 7.5,20 Z');
}
.end-dots-click button.ok::before { background: var(--c-green); }
.end-dots-click button.ko::before { background: var(--c-red); }
.end-dots-click button:hover::before, .end-dots-click button:focus-visible::before { transform: scale(1.3); }
.end-dots-click button:focus-visible { outline: 2px solid var(--c-violet); outline-offset: -2px; border-radius: 4px; }
/* Repli si clip-path: path() n'est pas gérée (Safari ancien) : un rond net, jamais un ovale. */
@supports not (clip-path: path('M 0,0 L 1,1 Z')) {
  .end-dots-click button::before { width: 14px; height: 14px; border-radius: 50%; clip-path: none; }
}

/* Infobulle au survol d'une pastille : le nom de la cible, collé au curseur. */
.end-tip { position: fixed; z-index: 90; pointer-events: none;
  padding: 5px 9px; border-radius: 7px; max-width: 220px;
  background: var(--c-ink); color: #fff; font-size: .8rem; font-weight: 700;
  line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 4px 14px rgba(0,0,0,.28); }
.end-tip.hidden { display: none; }

/* ── Fiche de commune (composant js/fiche.js, ouverte depuis une pastille) ────── */
.fiche-backdrop { position: fixed; inset: 0; z-index: 75; background: rgba(20,30,50,.55); }
.fiche { position: fixed; inset: 0; margin: auto; z-index: 80;
  width: min(360px, 92vw); height: max-content; max-height: 88vh; overflow-y: auto;
  background: var(--c-surface); border-radius: var(--r-lg); padding: 20px 20px 18px;
  text-align: center; box-shadow: 0 14px 40px rgba(0,0,0,.34);
  display: flex; flex-direction: column; align-items: center; gap: 10px; }
.fiche:focus, .fiche-nom:focus { outline: none; }
.fiche-close { position: absolute; top: 4px; right: 6px; width: 40px; height: 40px; padding: 0;
  border: 0; background: none; cursor: pointer; font-size: 1.6rem; line-height: 1; color: var(--c-muted); }
.fiche-close:hover { color: var(--c-ink); }
.fiche-blason { display: block; width: 52px; height: auto; }
.fiche-nom { font-family: var(--font-display); font-size: 1.35rem; font-weight: 900;
  line-height: 1.15; margin: 0; color: var(--c-ink); }
.fiche-dl { display: grid; grid-template-columns: auto auto; gap: 2px 14px; margin: 0;
  font-size: .9rem; text-align: left; }
.fiche-dl dt { color: var(--c-muted); }
.fiche-dl dd { margin: 0; font-weight: 700; color: var(--c-ink); font-variant-numeric: tabular-nums; }
.fiche-extrait { font-size: .88rem; line-height: 1.5; color: var(--c-ink-2); text-align: left;
  padding-top: 8px; border-top: 1px solid var(--c-line); }
.fiche-attente { font-size: .82rem; }
.fiche-wiki { font-size: .85rem; font-weight: 700; color: var(--c-green-deep); text-decoration: none;
  min-height: 44px; display: inline-flex; align-items: center; }
.fiche-wiki:hover { text-decoration: underline; }

/* ── Devine la commune : l'indice remplace le nom dans le HUD ─────────────── */
/* Le HUD normal tient le nom sur UNE ligne ; ici il doit accueillir une image ou
   trois lignes de texte, donc on relâche la contrainte pour cette page seulement. */
/* L'indice vit dans la scène, pas dans le HUD : il est la question, il prend la place.
   Sa hauteur est RÉSERVÉE, pas subie : un blason fait 92 px, un extrait 3 à 6 lignes selon
   la commune, et sans réserve les réponses sautaient de 17 px d'une question à l'autre —
   assez pour qu'un bouton se déplace sous le curseur au moment où on clique. */
.qcm-clue { display: flex; align-items: center; justify-content: center;
  min-height: 150px; margin-bottom: clamp(14px, 4vw, 26px); text-align: center; }
@media (min-width: 620px) { .qcm-clue { min-height: 132px; } }
.page-devine .clue-blason { display: block; height: 92px; width: auto; max-width: 120px; }
/* L'extrait fait 213 caractères en médiane, 281 au pire : il doit tenir ENTIER, on ne fait
   pas défiler un texte pendant que le chrono tourne. Le défilement reste en filet. */
.page-devine .clue-texte { font-family: var(--font-body, inherit); font-size: clamp(.86rem, 2.9vw, 1.05rem);
  font-weight: 600; line-height: 1.45; color: var(--c-ink);
  max-height: 11em; overflow-y: auto; }
@media (min-width: 620px) {
  .page-devine .clue-blason { height: 120px; max-width: 150px; }
  .page-devine .clue-texte { max-height: 8em; }
}
/* Deux choix côte à côte (Blason / Histoire). `min-width: 0` est indispensable : sans lui
   un élément flex refuse de descendre sous la largeur de son texte, et les sous-titres
   faisaient déborder le sélecteur hors de sa carte. */
.page-game .mode-select-2 .mode-btn { padding: 10px 8px; min-width: 0; }
.page-game .mode-select-2 .mode-btn small { font-size: .7rem; line-height: 1.2;
  white-space: normal; overflow-wrap: anywhere; }
.page-game .pick-lbl-space { margin-top: 16px; }
.end-sub, .end-status { font-size: .8rem; color: var(--c-muted); }
.end-status:empty { display: none; }
.end-xp-anon { font-size: .85rem; font-weight: 700; color: var(--c-violet); }
.end-xp-anon a { color: var(--c-violet); }
.end-change { display: inline-block; padding: 12px 10px; min-height: 44px; line-height: 20px;
  font-size: .85rem; color: var(--c-muted); text-decoration: none; }
.end-change:hover { color: var(--c-green-deep); }
/* Pendant la fin de partie, le HUD et la barre de temps s'effacent derrière le voile. */
#view-game.ended #hud, #view-game.ended #time-bar-wrap { visibility: hidden; }

#scores-table { border-collapse: collapse; width: min(560px, 94vw); background: var(--c-surface); border-radius: 10px; overflow: hidden; }
#scores-table th, #scores-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--c-line); }
#scores-table th { background: var(--c-bg); }
#scores-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
#scores-table th.sortable:hover { background: var(--c-line); }
#scores-table th.sortable.sorted { color: var(--c-green-deep); }
#scores-table th.sortable::after { content: attr(data-arrow); font-size: .8em; }
#scores-table td:nth-child(3), #scores-table td:nth-child(4) { font-variant-numeric: tabular-nums; }
/* Recherche par pseudo (page des scores) */
.scores-search { width: min(560px, 94vw); padding: 9px 14px; border: 2px solid var(--c-line); border-radius: 10px; font-family: inherit; font-size: .95rem; color: var(--c-ink); }
.scores-search:focus { border-color: var(--c-green); }

/* --- Game feel --- */
/* "+15 / +10 / +5" qui jaillit au clic */
.score-pop { position: fixed; transform: translate(-50%, -50%); font-weight: 800; font-size: 1.7rem; color: var(--c-green-deep); text-shadow: 0 1px 4px rgba(255,255,255,.8), 0 2px 6px rgba(0,0,0,.2); pointer-events: none; z-index: 50; animation: score-pop .85s ease-out forwards; white-space: nowrap; }
.score-pop.pop-wrong { color: var(--c-red); font-size: 1.15rem; }   /* nom de la commune cliquée par erreur */
@keyframes score-pop {
  0%   { opacity: 0; transform: translate(-50%, -50%)  scale(.6); }
  20%  { opacity: 1; transform: translate(-50%, -90%)  scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -220%) scale(1); }
}
/* Pop de la commune trouvée */
#map path.pop { transform-box: fill-box; transform-origin: center; animation: commune-pop .45s ease-out; }
@keyframes commune-pop { 0% { transform: scale(1); } 35% { transform: scale(1.18); } 100% { transform: scale(1); } }
/* Badge nouveau record (classe : la carte le régénère à chaque partie).
   La règle « mouvement réduit » plus haut le vise encore par son id, exprès :
   l'id (0,1,0,0) bat cette classe (0,0,1,0) malgré l'ordre du fichier. */
.end-record { align-self: center; background: linear-gradient(#ffd866, #f0a836); color: #5a3b00; font-weight: 800; padding: 6px 16px; border-radius: 999px; box-shadow: 0 2px 8px rgba(240,168,54,.4); animation: badge-pop .4s ease-out; }
@keyframes badge-pop { 0% { transform: scale(0); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
/* Confettis */
canvas.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 66; }

/* --- Podium top 3 --- */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 8px; width: min(520px, 94vw); margin: 0 auto 4px; }
.podium-step { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 12px 6px; border-radius: 12px 12px 0 0; color: var(--c-ink); box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.podium-medal  { font-size: 1.5rem; line-height: 1; }
.podium-rank   { font-size: .75rem; color: var(--c-muted); text-transform: uppercase; letter-spacing: .06em; }
.podium-name   { font-weight: 800; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-points { font-size: .85rem; color: var(--c-ink-2); font-variant-numeric: tabular-nums; }
.podium-time { font-size: .78rem; color: var(--c-muted); font-variant-numeric: tabular-nums; }
/* Pagination des scores */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 6px; }
.pager button { padding: 8px 16px; }
.pager button:disabled { opacity: .4; cursor: default; }
#pg-info { font-size: .9rem; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.podium-1 { order: 2; min-height: 132px; background: linear-gradient(#fff4cf, #ffe7a0); }
.podium-2 { order: 1; min-height: 108px; background: linear-gradient(#eef1f5, #dde4ec); }
.podium-3 { order: 3; min-height: 92px;  background: linear-gradient(#f7e7da, #eed3bd); }

/* ── Encart de don ── */
.don-card { width: min(420px, 92vw); background: var(--c-surface); border: 2px solid var(--c-green-soft);
  border-radius: var(--r-lg); padding: 16px 18px; text-align: left; box-shadow: var(--shadow-card); }
.don-title { font-weight: 800; color: var(--c-green-deep); margin-bottom: 4px; }
.don-text { font-size: .85rem; color: var(--c-ink-2); line-height: 1.45; margin-bottom: 12px; }
/* Cinq cellules de largeur égale : « Autre » est la cinquième. */
.don-amounts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 12px; }
.don-chip { font: inherit; font-size: .9rem; font-weight: 700; padding: 10px 4px; min-height: 44px;
  border: 2px solid var(--c-line); border-radius: var(--r-md); background: var(--c-surface);
  color: var(--c-ink-2); cursor: pointer; text-align: center; }
.don-chip.active { border-color: var(--c-green); background: var(--c-green-soft); color: var(--c-green-deep); }
#don-custom { width: 100%; min-width: 0; padding: 10px 4px; border: 2px solid var(--c-line);
  border-radius: var(--r-md); font: inherit; font-size: .9rem; text-align: center; }
#don-go { width: 100%; }
@media (min-width: 860px) { .home-side .don-card { width: 100%; max-width: none; } }
/* Page don.html : carte en haut, pas centrée verticalement (elle sautait au clavier). */
.don-page { min-height: 100%; display: flex; align-items: flex-start; justify-content: center;
  padding: calc(var(--sb-h, 60px) + 24px) 16px 24px; box-sizing: border-box; }

/* ── Boîte à idées ── */
.idea-box { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--c-line); display: flex; flex-direction: column; gap: 8px; }
/* Quand la boîte à idées est seule dans sa carte (accueil), pas de filet du haut. */
.idea-card .idea-box { margin-top: 0; padding-top: 0; border-top: none; }
.idea-title { font-size: .82rem; font-weight: 700; color: var(--c-ink-2); }
.idea-box textarea { width: 100%; padding: 9px 11px; border: 2px solid var(--c-line); border-radius: 10px; font: inherit; font-size: .9rem; resize: vertical; }
.idea-box textarea:focus, .idea-box input[type=email]:focus { border-color: var(--c-green); }
.idea-box input[type=email] { width: 100%; padding: 9px 11px; border: 2px solid var(--c-line); border-radius: 10px; font: inherit; font-size: .9rem; }
.idea-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.idea-box .btn { width: 100%; }
.idea-feedback { font-size: .82rem; min-height: 1em; }

/* Note "pseudo déjà pris" (non bloquante) */
.pseudo-note { font-size: .8rem; color: var(--c-red); min-height: 1em; text-align: center; }

/* ── Défi du jour ── */
#view-defi { flex-direction: column; align-items: center; gap: 12px; overflow-y: auto; padding: calc(var(--sb-h, 56px) + 8px) 16px 24px; }
#view-defi h1 { margin: 0; }
.defi-head { width: min(560px, 94vw); text-align: center; }
.defi-login-note { width: min(560px, 94vw); text-align: center; font-size: .85rem; line-height: 1.4; }
.defi-login-note:empty { display: none; }
.defi-login-note a { color: var(--c-green-deep); font-weight: 700; white-space: nowrap; }
.defi-login-note.defi-warn { color: var(--c-red); }
.defi-login-note.defi-ready { color: var(--c-green-deep); }
.defi-closed { font-weight: 700; color: var(--c-red); }
.defi-veille { margin-top: 6px; color: var(--c-ink-2); }
#btn-defi-play { width: min(560px, 94vw); }
#btn-defi-play:disabled { background: var(--c-bg); color: var(--c-muted); opacity: .55; cursor: not-allowed; box-shadow: none; }
#btn-replay:disabled { background: var(--c-bg); color: var(--c-muted); border-color: var(--c-line); cursor: not-allowed; box-shadow: none; }
.defi-login-note.defi-epuise { color: var(--c-amber-ink); }
.h1-ico { vertical-align: -7px; margin-right: 4px; image-rendering: pixelated; }
.xp-ico { width: 18px; height: 18px; vertical-align: -4px; image-rendering: pixelated; }
.defi-rank-title { margin: 8px 0 0; font-size: 1rem; }
#defi-table { width: min(560px, 94vw); border-collapse: collapse; }
#defi-table th, #defi-table td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--c-line); }
#defi-table th { font-size: .8rem; color: var(--c-muted); }
/* Classement du jour vide : la phrase se suffit, l'en-tête ne sert à rien. */
#defi-table.defi-empty thead { display: none; }
#defi-table.defi-empty td { text-align: center; border-bottom: none; }
.defi-anon { color: var(--c-muted); }
.defi-hc { font-size: .75rem; color: var(--c-muted); }
.defi-champions-link a { color: var(--c-green-deep); font-weight: 700; text-decoration: none; }
.champions-page { max-width: 640px; margin: 0 auto; padding: calc(var(--sb-h, 60px) + 10px) 16px 24px; }
.champions-sub { color: var(--c-muted); margin-top: -6px; }
.champions-table { width: 100%; border-collapse: collapse; }
.champions-table th, .champions-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--c-line); }
.champions-table th { font-size: .8rem; color: var(--c-muted); }

/* ── Page Formation ── */
#view-formation { flex-direction: column; align-items: stretch; padding: 0; }
/* flex-shrink:0 : sans ça, sur /trouve/blason.html, l'immense hauteur intrinsèque de
   .bl-grid (des milliers de cartes) écrase la barre d'outils à quelques pixels — un
   item flex avec overflow non visible perd son min-height automatique (rétréci à 0). */
.fm-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex-shrink: 0;
              padding: 10px 14px; background: var(--c-surface); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.fm-toolbar .canton-select, .fm-toolbar .canton-filter { flex: 0 1 200px; }
/* .search-wrap enveloppe le champ de recherche (icône + input) : sans ce flex-basis,
   l'enveloppe (item flex direct) reprendrait sa taille de contenu par défaut. */
.fm-toolbar .search-wrap { flex: 0 1 200px; }
.fm-toolbar .search-wrap input { width: 100%; }
.fm-toolbar .sb-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
@media (max-width: 760px) {
  /* Une seule rangée qui défile : plus de barre d'outils sur trois lignes. */
  .fm-toolbar { flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding: 8px 10px;
                -webkit-overflow-scrolling: touch; }
  .fm-toolbar > * { flex: 0 0 auto; }
  .fm-toolbar .canton-select, .fm-toolbar .canton-filter { flex: 0 0 150px; padding: 8px 10px; font-size: .85rem; }
  .fm-toolbar .search-wrap { flex: 0 0 150px; }
  .fm-toolbar .suisse-toggle { padding: 8px 12px; min-height: 36px; font-size: .82rem; }
  .fm-toolbar .sb-right { margin-left: 0; }
  .fm-toolbar .sb-don, .fm-toolbar .sb-register { display: none; }   /* mêmes règles que le bandeau */
  .fm-toolbar .sb-btn, .fm-toolbar .sb-account-name, .fm-toolbar .sb-account-logout {
    padding: 8px 10px; font-size: .8rem; }
  .fm-toolbar .bl-count { display: none; }
}
.fm-body { flex: 1; display: flex; min-height: 0; }
.fm-map-wrap { flex: 1 1 75%; min-width: 0; background: #eaf3fb; position: relative; }
#fm-map { width: 100%; height: 100%; display: block; touch-action: none; }
.fm-info { flex: 0 0 25%; max-width: 340px; min-width: 240px;
           display: flex; flex-direction: column; overflow: hidden;
           background: var(--c-surface); border-left: 1px solid var(--c-line); padding: 18px; }
.fm-empty { color: var(--c-muted); font-size: .95rem; }
/* Deux zones : survol (haut, défile si long) / fiche figée au clic, ANCRÉE EN BAS
   (margin-top:auto) pour ne plus bouger quand la zone de survol change de taille. */
.fm-hover { flex: 0 1 auto; min-height: 0; overflow-y: auto; padding-bottom: 14px; }
.fm-pinned { flex: 0 0 auto; margin-top: auto; max-height: 60%; overflow-y: auto;
             padding-top: 14px; border-top: 2px solid var(--c-line); background: var(--c-surface); }
/* En-tête de la pile de sélection + cartes empilées (× pour retirer). */
.fm-sel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.fm-sel-head span { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted); }
.fm-sel-clear { border: none; background: var(--c-bg); color: var(--c-ink-2); font-size: .75rem; font-weight: 600; padding: 4px 9px; border-radius: 6px; cursor: pointer; }
.fm-sel-clear:hover { background: var(--c-line); color: var(--c-red); }
.fm-sel-card { position: relative; padding: 12px 0; border-top: 1px solid var(--c-line); }
.fm-sel-card:first-of-type { border-top: none; }
.fm-sel-x { position: absolute; top: 8px; right: 0; z-index: 2; border: none; cursor: pointer;
            background: rgba(255,255,255,.85); color: var(--c-muted); border-radius: 50%;
            width: 24px; height: 24px; font-size: 1.15rem; line-height: 1; padding: 0; }
.fm-sel-x:hover { color: #fff; background: var(--c-red); }
.fm-extract { font-size: .9rem; color: var(--c-ink-2); line-height: 1.45; margin: 12px 0 0; }
.fm-info h2 { margin: 0 0 2px; font-size: 1.5rem; color: var(--c-green-deep); }
.fm-info .fm-sub { color: var(--c-muted); font-size: .9rem; margin-bottom: 12px; }
.fm-info .fm-blason { float: right; max-width: 64px; max-height: 80px; margin: 0 0 8px 10px; }
.fm-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fm-rows li { display: flex; gap: 8px; font-size: .98rem; }
.fm-rows .fm-k { color: var(--c-muted); flex: 0 0 92px; }
.fm-rows .fm-v { font-weight: 600; color: var(--c-ink); }
.fm-wiki { display: inline-block; margin-top: 14px; color: var(--c-green); font-weight: 700; text-decoration: none; }
.fm-wiki:hover { text-decoration: underline; }

/* --- Galerie des blasons (/trouve/blason) --- */
#view-blason { flex-direction: column; }
.bl-title { font-size: 1.05rem; color: var(--c-green-deep); white-space: nowrap; }
.bl-count { color: var(--c-muted); font-size: .9rem; margin-left: auto; white-space: nowrap; }
.bl-grid { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 16px;
           display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
           gap: 14px; align-content: start; }
.bl-card { display: flex; flex-direction: column; align-items: center; text-align: center;
           background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 12px; padding: 12px 8px;
           text-decoration: none; color: var(--c-ink); transition: box-shadow .12s ease, transform .12s ease; }
a.bl-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.10); transform: translateY(-2px); border-color: var(--c-green-line); }
.bl-card[hidden] { display: none; }
.bl-img { width: 56px; height: 70px; object-fit: contain; margin-bottom: 8px; }
.bl-noimg { display: flex; align-items: center; justify-content: center; color: var(--c-muted);
            font-size: 1.5rem; background: var(--c-bg); border-radius: 6px; }
.bl-name { font-weight: 700; font-size: .9rem; line-height: 1.2; }
.bl-canton { color: var(--c-muted); font-size: .75rem; margin-top: 2px; }
.bl-meta { color: var(--c-ink-2); font-size: .75rem; margin-top: 6px; }

/* SVG carte formation */
#fm-map .fm-commune { fill: #d4dce7; stroke: #fff; stroke-width: 0.4; vector-effect: non-scaling-stroke; transition: fill .12s ease; }
#fm-map .fm-commune.fm-active { fill: #9fb8df; }
/* Sélectionnée (cliquée) = vert, prioritaire sur survol/actif. */
#fm-map .fm-commune.fm-selected, #fm-map .fm-commune.fm-selected.fm-active { fill: #2e9e5b; }
/* font-size posé dynamiquement sur le groupe .fm-labels en JS (taille ~constante
   à l'écran quel que soit le zoom). Nom en noir fin, sans halo. */
#fm-map .fm-label { font-family: system-ui, sans-serif; font-weight: 500; fill: #222; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
#fm-map .fm-lake { fill: #93cee9; stroke: #6fb8d8; stroke-width: 0.4; vector-effect: non-scaling-stroke; transition: fill .12s ease; }
#fm-map .fm-lake.fm-active { fill: #3fa3dc; }
/* Survol (PC) : simple changement de couleur (pas de pop, on prend le temps). */
@media (hover: hover) and (pointer: fine) {
  #fm-map .fm-commune:hover { fill: #8eaedb; }
  #fm-map .fm-commune.fm-selected:hover { fill: #38b76c; }   /* sélectionnée survolée = vert clair */
  #fm-map .fm-lake:hover { fill: #6cbce6; }
}
#fm-map .fm-river { fill: none; stroke: #5aa6da; stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
/* Districts : couleur (semi-transparente, sous l'eau) + contour. Le remplissage est
   survolable (pointer-events:auto) : quand la couche est visible, étant au-dessus des
   communes, il capte le survol → fiche district (les communes sont en pause). */
#fm-map .fm-district-fill { fill-opacity: .6; stroke: none; pointer-events: auto; }
#fm-map .fm-district-fill.fm-dist-hover { fill-opacity: 1; filter: brightness(.82); stroke: #1f2530; stroke-width: 2.5; vector-effect: non-scaling-stroke; }
/* Canton sans district : couvre la zone (désactive le survol des communes) mais
   reste quasi-transparent et inerte (pas de surbrillance, pas de fiche). */
#fm-map .fm-district-fill.fm-district-filler { fill: #b9c2cc; fill-opacity: .03; pointer-events: all; }
#fm-map .fm-district-line { fill: none; stroke: #7a6a55; stroke-width: 1; vector-effect: non-scaling-stroke; stroke-linejoin: round; pointer-events: none; }
#fm-map .fm-canton { fill: none; stroke: #5a6b85; stroke-width: 1.4; vector-effect: non-scaling-stroke; pointer-events: none; }

/* --- Overlay sélecteur de couches (carte formation) --- */
.fm-layers { position: absolute; top: 10px; right: 10px; z-index: 5;
             display: flex; flex-direction: column; gap: 5px;
             background: rgba(255,255,255,.92); border: 1px solid var(--c-line);
             border-radius: 10px; padding: 8px; box-shadow: 0 2px 8px rgba(20,30,50,.12);
             font-size: .8rem; max-width: 46vw; }
.fm-layers .fm-layer-title { font-weight: 700; font-size: .75rem; text-transform: uppercase;
             letter-spacing: .04em; color: var(--c-muted); margin-bottom: 2px; }
.fm-layer-btn { display: flex; align-items: center; gap: 7px; cursor: pointer;
             border: none; background: none; padding: 3px 4px; border-radius: 6px;
             color: var(--c-ink-2); text-align: left; }
.fm-layer-btn:hover { background: var(--c-bg); }
.fm-layer-btn .fm-dot { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto;
             border: 1.5px solid var(--c-muted); background: var(--c-surface); }
.fm-layer-btn[aria-pressed="true"] .fm-dot { background: #2e9e5b; border-color: #2e9e5b; }
@media (max-width: 760px) {
  .fm-layers { top: 6px; right: 6px; padding: 6px; font-size: .75rem; max-width: 60vw; }
  .fm-layer-btn { padding: 10px 8px; min-height: 40px; }
}

/* Mobile : carte en haut, panneau info à hauteur FIXE en bas (sinon il grandit
   avec le contenu et la fiche bouge). La fiche épinglée reste collée en bas. */
@media (max-width: 760px) {
  .fm-body { flex-direction: column; }
  .fm-map-wrap { flex: 1 1 auto; min-height: 45vh; }
  .fm-info { flex: 0 0 42vh; max-width: none; min-width: 0;
             border-left: none; border-top: 1px solid var(--c-line); }
}

/* ── Barre de progression XP (gamification) ─────────────────────────────────── */
/* Barre d'XP façon WoW : centrée ~70 %, violette, segmentée en bulles, % au centre. */
#xp-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 9px; z-index: 50;
  width: 70%; max-width: 1800px; height: 30px; border-radius: 16px;
  background: var(--c-xp); border: 1px solid #120a1d;
  box-shadow: 0 3px 14px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.12); overflow: visible; }
/* Masquée pendant la partie, comme #site-bar. */
#view-game.active ~ #xp-bar { display: none; }
/* Remplissage violet + brillance. */
#xp-bar .xpb-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 15px 0 0 15px;
  background: linear-gradient(180deg, #d06bff 0%, #a93fe6 45%, #7d23bc 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -4px 7px rgba(0,0,0,.3);
  transition: width .5s ease; z-index: 0; }
#xp-bar .xpb-fill::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 48%;
  border-radius: 15px 0 0 0; background: linear-gradient(180deg, rgba(255,255,255,.45), rgba(255,255,255,0)); }
/* Bulles : 20 segments. */
#xp-bar .xpb-ticks { position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: 16px; overflow: hidden;
  background-image: repeating-linear-gradient(90deg,
    rgba(0,0,0,0) 0, rgba(0,0,0,0) calc(5% - 1.5px),
    rgba(0,0,0,.30) calc(5% - 1.5px), rgba(0,0,0,.30) 5%); }
/* Zone cliquable = toute la barre. On neutralise le style « bouton cartoon »
   global (spécificité plus forte que button/.btn) pour épouser la forme de la barre. */
#xp-bar .xpb-main { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%;
  background: none; cursor: pointer; font: inherit;
  border: none; border-radius: 16px; box-shadow: none; }
#xp-bar .xpb-main:active { transform: none; }
/* % de remplissage, au centre. */
#xp-bar .xpb-pct { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); z-index: 3;
  text-align: center; pointer-events: none; color: #fff; font-weight: 800; font-size: .92rem;
  letter-spacing: .02em; text-shadow: 0 1px 2px rgba(0,0,0,.75); }
/* Pastille niveau (or) à gauche. */
#xp-bar .xpb-lvl { position: absolute; left: 5px; top: 50%; transform: translateY(-50%); z-index: 3; pointer-events: none;
  display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 22px; padding: 0 8px;
  border-radius: 11px; background: linear-gradient(180deg, #ffdf7a, #e0a51c); color: #3a2400;
  font-weight: 800; font-size: .78rem; box-shadow: 0 1px 3px rgba(0,0,0,.45); }
/* Points / rang à droite. */
#xp-bar .xpb-side { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); z-index: 3; pointer-events: none;
  color: #ecdcff; font-size: .76rem; text-shadow: 0 1px 2px rgba(0,0,0,.75); }
#xp-bar.xp-bar--anon { background: #3a3a46; }
#xp-bar.xp-bar--anon .xpb-fill { display: none; }
#xp-bar.xp-bar--anon .xpb-pct { color: #e7e7ef; font-weight: 700; font-size: .82rem; }
#xp-bar.xp-bar--anon .xpb-lvl { background: #8a93a3; color: #fff; }
#xp-bar.xp-bar--anon .xpb-side { display: none; }
/* Version anonyme : plus basse, avec une croix pour la refermer 7 jours. */
#xp-bar.xp-bar--anon { height: 26px; background: #3a3a46; }
#xp-bar.xp-bar--anon .xpb-pct { font-size: .78rem; }
#xp-bar .xpb-close { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); z-index: 4;
  width: 26px; height: 22px; min-height: 0; padding: 0; border: none; border-radius: var(--r-sm);
  background: rgba(255,255,255,.14); color: #e7e7ef; font-size: .85rem; line-height: 1;
  box-shadow: none; cursor: pointer; }
#xp-bar .xpb-close:hover { background: rgba(255,255,255,.28); }
#xp-bar:not(.xp-bar--anon) .xpb-close { display: none; }
#xp-bar.xp-bar--up { animation: xp-up 2.4s ease; }
@keyframes xp-up { 0%, 100% { box-shadow: 0 3px 14px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.12); }
  20%, 60% { box-shadow: 0 0 26px rgba(180,80,255,.85), inset 0 1px 0 rgba(255,255,255,.3); } }
@media (prefers-reduced-motion: reduce) { #xp-bar .xpb-fill { transition: none; } #xp-bar.xp-bar--up { animation: none; } }

/* Panneau classement (déroulé au clic, ancré au-dessus de la barre). */
#xp-bar .xp-panel { position: absolute; right: 0; bottom: calc(100% + 10px); width: min(340px, 92vw);
  max-height: 60vh; overflow-y: auto; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,.18); padding: 12px 14px; z-index: 4; }
#xp-bar .xp-panel.hidden { display: none; }
#xp-bar .xpp-sec { margin-bottom: 12px; }
#xp-bar .xpp-sec h4 { margin: 0 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); }
#xp-bar .xpp-list { list-style: none; margin: 0; padding: 0; }
#xp-bar .xpp-list li { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 8px; font-size: .9rem; }
#xp-bar .xpp-list li.xpp-me { background: var(--c-green-soft); font-weight: 700; }
#xp-bar .xpp-rank { min-width: 22px; color: var(--c-muted); font-weight: 700; }
#xp-bar .xpp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#xp-bar .xpp-lvl { font-size: .76rem; font-weight: 800; color: var(--c-green-deep); }
#xp-bar .xpp-pts { color: var(--c-ink-2); font-variant-numeric: tabular-nums; }

/* Badge de niveau à côté d'un pseudo dans les classements. */
.lvl-badge { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 10px;
  background: var(--c-green-soft); color: var(--c-green-deep); font-size: .75rem; font-weight: 800; vertical-align: middle; }

/* Barre d'XP de fin de partie (dans #endcard) : remplissage animé des points gagnés. */
.xp-end { margin-top: 4px; }
.xp-end-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.xp-end-lvl { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 22px;
  padding: 0 8px; border-radius: 11px; background: linear-gradient(180deg, #ffdf7a, #e0a51c); color: #3a2400;
  font-weight: 800; font-size: .8rem; box-shadow: 0 1px 3px rgba(0,0,0,.35); }
.xp-end-gain { color: #a93fe6; font-weight: 800; font-size: .98rem; }
.xp-end-track { position: relative; height: 26px; border-radius: 14px; background: var(--c-xp);
  border: 1px solid #120a1d; overflow: hidden; box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.xp-end-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 13px 0 0 13px;
  background: linear-gradient(180deg, #d06bff 0%, #a93fe6 45%, #7d23bc 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 -4px 7px rgba(0,0,0,.3); }
.xp-end-ticks { position: absolute; inset: 0; pointer-events: none;
  background-image: repeating-linear-gradient(90deg,
    rgba(0,0,0,0) 0, rgba(0,0,0,0) calc(5% - 1.5px),
    rgba(0,0,0,.30) calc(5% - 1.5px), rgba(0,0,0,.30) 5%); }
.xp-end-pct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 800; font-size: .85rem; text-shadow: 0 1px 2px rgba(0,0,0,.7); }
.xp-end--up .xp-end-track { animation: xp-end-pop .6s ease; }
@keyframes xp-end-pop { 0%, 100% { box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
  30% { box-shadow: 0 0 18px rgba(180,80,255,.9), inset 0 1px 0 rgba(255,255,255,.3); } }
@media (prefers-reduced-motion: reduce) { .xp-end--up .xp-end-track { animation: none; } }

/* Laisse la place à la barre fixe en bas (sauf en jeu). */
body { padding-bottom: var(--xp-h); }

/* ── Carte « Ma Suisse » ─────────────────────────────────────────────────────── */
.carte-head { display: flex; gap: 12px; justify-content: center; align-items: center; flex-wrap: wrap;
  max-width: 1080px; margin: 10px auto 0; }
.carte-grade { padding: 4px 12px; border-radius: 12px; color: #fff; font-weight: 800; }
.carte-jetons { font-weight: 700; color: var(--c-green-deep); }
.carte-prog { font-weight: 800; color: var(--c-ink-2); font-variant-numeric: tabular-nums; }
.carte-login { max-width: 700px; margin: 10px auto 0; padding: 10px 14px; border-radius: 10px;
  background: var(--c-amber-soft); border: 1px solid var(--c-amber); text-align: center; }
.carte-login.hidden { display: none; }
body.carte-anon .carte-grade, body.carte-anon .carte-jetons { display: none; }
.carte-stage { max-width: 900px; margin: 12px auto 0; }
#carte-map { width: 100%; height: auto; max-height: 70vh; display: block; }
#carte-map .carte-canton { fill: #e4e8ee; stroke: #b8c2cc; stroke-width: .6; vector-effect: non-scaling-stroke;
  transition: fill .25s ease; }
#carte-map .carte-canton.can-play { cursor: pointer; fill: var(--c-green-line); }
#carte-map .carte-canton.can-play:hover { fill: var(--c-green-pale); }
/* Canton révélé : reste gris comme les autres, juste un halo lumineux pulsé (currentColor = sa couleur héraldique). */
#carte-map .carte-canton.is-deb { animation: carte-glow 2.4s ease-in-out infinite; }
@keyframes carte-glow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(255,255,255,.7)) drop-shadow(0 0 4px currentColor); }
  50%      { filter: drop-shadow(0 0 5px rgba(255,255,255,.95)) drop-shadow(0 0 10px currentColor); }
}
#carte-map .carte-ecu { pointer-events: none; transform-box: fill-box; transform-origin: center; animation: carte-drop .55s cubic-bezier(.34,1.5,.64,1) both; }
@keyframes carte-drop { 0% { opacity: 0; transform: translateY(-26px) scale(1.04); } 55% { opacity: 1; } 100% { opacity: 1; transform: translateY(0) scale(1); } }
.carte-msg { text-align: center; min-height: 1.4em; margin: 8px auto; font-weight: 700; color: var(--c-green-deep); }
body.carte-complete .carte-stage { filter: drop-shadow(0 0 14px rgba(224,165,28,.7)); }
@media (prefers-reduced-motion: reduce) {
  #carte-map .carte-ecu { animation: none; }
  #carte-map .carte-canton.is-deb { animation: none; filter: drop-shadow(0 0 4px currentColor); }
}

/* Toast de montée de niveau. */
#xp-toast { position: fixed; left: 50%; bottom: 64px; transform: translate(-50%, 20px); z-index: 70;
  background: var(--c-xp); color: #fff; border: 1px solid #120a1d; border-radius: 14px; padding: 12px 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); text-align: center; opacity: 0; transition: opacity .35s ease, transform .35s ease; }
#xp-toast.show { opacity: 1; transform: translate(-50%, 0); }
#xp-toast .xp-toast-h { font-weight: 800; font-size: 1.05rem; }
#xp-toast .xp-toast-g { font-size: .9rem; color: #ecdcff; margin-top: 2px; }
#xp-toast .xp-toast-cta { display: inline-block; margin-top: 8px; padding: 6px 12px; border-radius: 10px;
  background: linear-gradient(180deg, #d06bff, #a93fe6); color: #fff; font-weight: 800;
  text-decoration: none; border: none; box-shadow: none; }
@media (prefers-reduced-motion: reduce) { #xp-toast { transition: none; } }

/* Lien « Ma Suisse » dans le panneau de la barre. */
#xp-bar .xpp-link { display: block; margin-top: 4px; padding: 8px; text-align: center; border-radius: 10px;
  background: var(--c-violet-soft); color: var(--c-violet); font-weight: 700; text-decoration: none; }

/* Lien discret « Comment ça marche ? » (accueil, carte). */
.aide-inline { color: var(--c-violet); font-weight: 700; text-decoration: none; white-space: nowrap; display: inline-block; padding: 12px 10px; min-height: 44px; line-height: 20px; }
.aide-inline:hover { text-decoration: underline; }

/* ══ page-home (accueil /trouve/) ═════════════════════════════════════════════ */
.page-home .home-top { text-align: center; }
/* En-tête en 3 colonnes (mêmes largeurs + gap 16px que le tableau de bord en dessous) :
   carte stats gauche · titre centre · carte stats droite. align-items:stretch → même hauteur. */
.page-home .home-head { display: grid; grid-template-columns: 264px 1fr 264px; gap: 16px; align-items: stretch;
  max-width: 1080px; margin: 0 auto; }
.page-home .home-top   { grid-column: 2; grid-row: 1; }
.page-home .stat-left  { grid-column: 1; grid-row: 1; }
.page-home .stat-right { grid-column: 3; grid-row: 1; }
.page-home .stat-box   { display: flex; z-index: 1; }
.page-home .live-card { flex: 1; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 14px; box-shadow: var(--shadow-card);
  padding: 10px 20px; text-align: right; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; }
.page-home .live-label { display: block; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--c-muted); font-weight: 800; }
.page-home .live-num { display: block; font-size: 1.7rem; font-weight: 800; color: var(--c-green-deep); line-height: 1.1; }
.page-home .live-label .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c-green);
  margin-right: 6px; vertical-align: middle; animation: livepulse 1.6s ease-in-out infinite; }
@keyframes livepulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.page-home .dash { max-width: 1080px; margin: 16px auto 0; display: grid; gap: 16px; align-items: stretch;
  grid-template-columns: 264px 1fr 264px; }
.page-home .dash .card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 16px; padding: 16px;
  box-shadow: var(--shadow-card); }

/* Colonne gauche : choix du jeu */
.page-home .pick-lbl { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); font-weight: 800; margin-bottom: 8px; }
.page-home .game-list { display: flex; flex-direction: column; gap: 8px; }
.page-home .game-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: var(--c-surface); color: var(--c-ink); cursor: pointer; font: inherit; text-align: left; transition: .12s; }
.page-home .game-item .nm { font-weight: 700; font-size: 1.04rem; }
.page-home .game-item:hover { border-color: var(--c-green-pale); }
.page-home .game-item.active { border-color: var(--c-green-deep); background: var(--c-green); color: #fff; }
.page-home .game-item.active .nm { color: #fff; }
.page-home #pseudo { width: 100%; margin-top: 14px; padding: 12px 14px; border-radius: 10px; border: 2px solid var(--c-line); font: inherit; font-size: 1rem; }
.page-home #pseudo:focus { border-color: var(--c-green); }
.page-home .pseudo-hint { font-size: .82rem; color: var(--c-muted); line-height: 1.35; margin-top: 8px; }

/* Colonne centre : carte animée */
.page-home .stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 360px; overflow: hidden; }
.page-home .stage-tag { position: absolute; top: 12px; left: 14px; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); font-weight: 700; }
.page-home #home-map { width: 100%; height: 100%; max-height: 460px; }
.page-home #home-map .m-region { fill: #dceee3; stroke: #2b7; stroke-width: .5; vector-effect: non-scaling-stroke; transition: fill .35s ease; }
.page-home #home-map .m-line { fill: none; stroke: #9cc6ad; stroke-width: .5; vector-effect: non-scaling-stroke; }
.page-home #home-map .m-bg { fill: #eef3f0; stroke: #cfe0d6; stroke-width: .5; vector-effect: non-scaling-stroke; }
.page-home #home-map .m-lake { fill: #8ec9ec; stroke: #3f7fa6; stroke-width: .5; vector-effect: non-scaling-stroke; transition: fill .35s ease; }
.page-home #home-map .m-region.on { fill: var(--c-green); }
.page-home #home-map .m-lake.lake-on { fill: #2aa3e0; }
@media (prefers-reduced-motion: reduce) { .page-home #home-map .m-region, .page-home #home-map .m-lake { transition: none; } }

/* Colonne droite : infos du mode */
.page-home .info { display: flex; flex-direction: column; }
.page-home .info-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.page-home .info .desc { color: var(--c-ink-2); line-height: 1.55; font-size: 1.02rem; }
.page-home .info .defi-line { font-size: .95rem; color: var(--c-muted); line-height: 1.5; }
.page-home .info .defi-line strong { color: var(--c-green-deep); }
.page-home .info .btn { text-align: center; padding: 14px; text-decoration: none; font-weight: 700; cursor: pointer; margin-top: 16px; }

/* Boutons carrés colorés (un thème par bouton) ; icône sur pastille blanche qui tourne au survol. */
.page-home .trouve-extra { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; max-width: 1080px; margin: 18px auto 0; }
.page-home .xtile { position: relative; min-height: 100px; padding: 14px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  border-radius: 14px; text-decoration: none; color: #fff; font-weight: 800; text-align: center;
  box-shadow: 0 4px 14px rgba(0,0,0,.10); transition: transform .12s ease, box-shadow .12s ease; }
.page-home .xtile:hover { transform: translateY(-3px); box-shadow: 0 10px 22px rgba(0,0,0,.16); }
.page-home .xtile:active { transform: translateY(3px); box-shadow: 0 0 0 rgba(0,0,0,.28); }   /* enfoncement rétro, comme les boutons */
.page-home .xtile .xt-ico { width: 54px; height: 54px; border-radius: 50%; background: var(--c-surface); display: grid; place-items: center; box-shadow: 0 2px 7px rgba(0,0,0,.18); }
.page-home .xtile .xt-ico img { width: 38px; height: 38px; display: block; image-rendering: pixelated; }
.page-home .xtile:hover .xt-ico { animation: xtspin .7s ease; }
@keyframes xtspin { to { transform: rotate(360deg); } }
.page-home .xtile .xt-lbl { font-size: .92rem; }
/* Deux familles : jouer (vert) et apprendre (violet). */
.page-home .xtile.xt-play  { background: linear-gradient(140deg, var(--c-green), var(--c-green-deep)); }
.page-home .xtile.xt-learn { background: linear-gradient(140deg, #9b6cf6, var(--c-violet)); }
@media (prefers-reduced-motion: reduce) { .page-home .xtile:hover .xt-ico { animation: none; } }
@media (max-width: 560px) {
  .page-home .xtile.xt-wide { grid-column: 1 / -1; }   /* Classement sur toute la largeur */
  .page-home .xtile { min-height: 92px; }
}
/* Bas de page : encart « idée » à gauche, réseaux à droite. */
.page-home .trouve-bottom { display: flex; gap: 16px; align-items: stretch; max-width: 1080px; margin: 18px auto 0; }
.page-home .trouve-feedback { flex: 1 1 auto; min-width: 0; margin: 0; }
.page-home .trouve-feedback .don-card { width: 100%; }
.page-home .trouve-social { flex: 0 0 auto; display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.page-home .social-title { font-size: .82rem; font-weight: 700; color: var(--c-muted); text-align: center; }
.page-home .social-btn { display: flex; align-items: center; justify-content: center; gap: 9px; min-width: 170px; padding: 13px 20px; border-radius: 12px; text-decoration: none; color: #fff; font-weight: 700; transition: transform .1s ease, box-shadow .12s ease; }
.page-home .social-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.page-home .social-btn svg { display: block; width: 20px; height: 20px; }
.page-home .social-btn.ig { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.page-home .social-btn.fb { background: #1877f2; }
@media (max-width: 880px) {
  .page-home .trouve-bottom { flex-direction: column; }
  .page-home .trouve-social { flex-direction: row; }
  .page-home .trouve-social .social-title { display: none; }
  .page-home .social-btn { flex: 1; min-width: 0; }
}

/* Mobile : le choix du jeu, puis « Jouer » TOUT DE SUITE, puis la description.
   La carte animée (décorative) ne prend plus un écran pour rien. */
@media (max-width: 880px) {
  .page-home .home-head { grid-template-columns: 1fr; }
  .page-home .home-top, .page-home .stat-left, .page-home .stat-right { grid-column: 1; grid-row: auto; }
  /* .home-top est en display:contents hors tableau de bord : sans boite, pas de voile. */
  .page-home .home-top { display: block; width: min(440px, 94vw); margin: 0 auto; }
  .page-home .dash { grid-template-columns: 1fr; }
  .page-home .dash .pick  { order: 1; }
  .page-home .dash .info  { order: 2; }
  .page-home .dash .stage { display: none; }
  .page-home .info-body { order: 2; }          /* description SOUS le bouton */
  .page-home .info .btn-primary { order: 1; margin-top: 0; }
  .page-home .info .desc { font-size: .95rem; }
  /* Deux cartes de statistiques -> une seule ligne de texte. */
  .page-home .stat-box { display: none; }
  .page-home .live-line { display: block; }
  .page-home .trouve-extra { grid-template-columns: 1fr 1fr; }
  /* L'aide « Pas connecté ? » passe sous « Jouer » : sur les petits écrans (667 px de haut,
     barre XP fixe en bas) le bouton doit rester dans le premier écran. */
  /* Compacité : 5 boutons de mode + pseudo + « Jouer » doivent tenir dans 667 px de haut. */
  .page-home .game-item { padding: 9px 14px; }
  .page-home .game-list { gap: 6px; }
  .page-home .dash .card { padding: 12px; }
  .page-home #view-home .home-top { padding: 10px 20px; }
  .page-home #pseudo { margin-top: 10px; }
  .page-home .home-top .sub-txt { display: none; }   /* le sous-titre décoratif cède la place au bouton */
  .page-home .live-line { margin-top: 2px; }
  .page-home .pseudo-hint { display: none; }
  .page-home .info-body::after { content: 'Pas connecté ? Choisis un pseudo — connecte-toi pour le réserver et que tes scores comptent.';
    display: block; font-size: .82rem; color: var(--c-muted); line-height: 1.35; }
}
@media (min-width: 881px) { .page-home .live-line { display: none; } }
/* Ligne live du mobile. */
.page-home .live-line { margin-top: 6px; font-size: .85rem; color: var(--c-muted); font-weight: 700;
  font-variant-numeric: tabular-nums; }
.page-home .live-line .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--c-green); margin: 0 4px 0 8px; vertical-align: middle;
  animation: livepulse 1.6s ease-in-out infinite; }

/* Fond mosaïque d'écussons (vivant) : fondu enchaîné de 2 couches par tuile. */
.page-home #bg-mosaic { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  display: grid; grid-auto-rows: 122px; }
.page-home #bg-mosaic .bgtile { position: relative; }
.page-home #bg-mosaic .lyr { position: absolute; inset: 0; background-size: 70%; background-position: center;
  background-repeat: no-repeat; opacity: 0; transition: opacity 2s ease; }
.page-home #view-home { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) { .page-home #bg-mosaic .lyr { transition: none; } }
/* Fenêtre derrière le titre (cellule centrale de la grille d'en-tête). margin:0 annule le
   margin-bottom:22px hérité de style.css pour que la pastille remplisse toute la hauteur.
   Voile blanc (dégradé) qui garde le titre lisible même quand la mosaïque est bien visible. */
.page-home #view-home .home-top { background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,255,255,.82)); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  border-radius: 16px; padding: 14px 26px; box-shadow: 0 2px 16px rgba(0,0,0,.1); box-sizing: border-box; margin: 0; }

/* ══ page-game (canton · district · lac · commune · quiz) ════════════════════ */
.page-game .home-top { text-align: center; }
.page-game .dash { max-width: 1080px; margin: 16px auto 0; display: grid; gap: 16px;
  align-items: stretch; grid-template-columns: 252px 1fr 290px; }
.page-game .dash .card { background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--r-lg); padding: 16px; box-shadow: var(--shadow-card); }
.page-game .pick-lbl { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--c-muted); font-weight: 800; margin-bottom: 8px; }
.page-game .pick .canton-select, .page-game .pick .canton-filter,
.page-game .pick #mode-select, .page-game .pick #indice-select, .page-game .pick #pseudo { width: 100%; }
.page-game .pick .canton-filter { margin-top: 8px; }
.page-game .pick #mode-select { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
/* Devine la commune : même grille que la difficulté, mais à DEUX colonnes. Sans cette règle
   #indice-select garderait le width: min(420px, 92vw) de .mode-select et déborderait de la carte. */
.page-game .pick #indice-select { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 4px; }
.page-game .pick #mode-select .mode-btn, .page-game .pick #indice-select .mode-btn { padding: 10px 2px; overflow: hidden; }
.page-game .pick #mode-select .mode-btn-name { font-size: .9rem; white-space: nowrap; }
.page-game .pick #mode-select .mode-btn small { font-size: .75rem; white-space: nowrap; }
/* Devine la commune annonce AUSSI la durée par question, qui change selon l'indice :
   « 25 s » et « 200 pts » ne tiennent pas sur une ligne dans une colonne à trois boutons. */
.page-devine .pick #mode-select .mode-btn small { white-space: normal; line-height: 1.25; }
.page-devine .pick #mode-select .mode-btn small b { font-weight: 800; color: var(--c-ink-2); }

/* ── Devine la commune : les quatre réponses (js/qcm-core.js) ─────────────── */
.qcm-stage { flex: 1 1 auto; display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 4vw, 32px) clamp(12px, 4vw, 28px); background: var(--c-bg); overflow-y: auto; }
.qcm-wrap { width: min(520px, 100%); }
/* Une réponse par ligne, à toute largeur : quatre noms de communes se comparent mieux
   empilés qu'en damier, et la hauteur de la scène ne dépend plus du nombre de colonnes. */
.qcm-choices { display: grid; gap: 10px; width: 100%; }
@media (min-width: 620px) { .qcm-choices { gap: 12px; } }
.qcm-choice { width: 100%; min-height: 60px; padding: 14px 16px; text-align: center;
  font-size: clamp(.95rem, 2.6vw, 1.15rem); font-weight: 800; line-height: 1.25;
  overflow-wrap: anywhere; transition: background .1s, border-color .1s, transform .07s; }
.qcm-choice:hover:not(:disabled) { background: var(--c-green-soft); border-color: var(--c-green-deep); }
/* Bonne réponse : vert plein. Mauvaise : rouge, désactivée, et on retente. */
.qcm-choice.juste { background: var(--c-green); border-color: var(--c-green-deep); color: #fff; }
.qcm-choice.faux { background: var(--c-red); border-color: var(--c-red); color: #fff; opacity: 1; }
.qcm-choice:disabled { cursor: default; }
.qcm-choice.faux:active { transform: none; }
.page-game .snd-lbl { display: block; font-size: .78rem; color: var(--c-ink-2); margin: 6px 0 3px; }
.page-game .pick #sound-pref select { width: 100%; margin-bottom: 6px; }
.page-game .pick #pseudo { margin-top: 16px; padding: 12px 14px; border-radius: var(--r-md);
  border: 2px solid var(--c-line); font: inherit; font-size: 1rem; width: 100%; }
.page-game .pick #pseudo:focus { border-color: var(--c-green); }
.page-game .stage { position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 360px; overflow: hidden; }
.page-game .stage-tag { position: absolute; top: 12px; left: 14px; font-size: .75rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); font-weight: 700; }
.page-game #home-map, .page-game #canton-map { width: 100%; height: 100%; max-height: 460px; }
.page-game .info { display: flex; flex-direction: column; }
.page-game .info-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.page-game .rules-mini { list-style: none; display: flex; flex-direction: column; gap: 9px;
  color: var(--c-ink-2); font-size: .95rem; line-height: 1.4; text-align: left; }
.page-game .rules-mini li { padding-left: 16px; position: relative; }
.page-game .rules-mini li::before { content: '·'; position: absolute; left: 5px;
  color: var(--c-green); font-weight: 800; }
.page-game .cta { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.page-game .info .btn { width: 100%; }
.page-game .info .btn small { font-weight: 600; opacity: .9; font-size: .8rem; }
@media (max-width: 880px) {
  .page-game .dash { grid-template-columns: 1fr; }
  .page-game .stage { min-height: 280px; }
  .page-game .dash .pick  { order: 1; }
  .page-game .dash .info  { order: 2; }
  .page-game .dash .stage { display: none; }   /* décor : inutile avant de jouer */
  /* « Jouer / Défi / Classement » d'abord, les règles en dessous. */
  .page-game .info .cta { order: 1; margin-top: 0; }
  .page-game .info-body { order: 2; margin-top: 14px; }
  .page-game .rules-mini { font-size: .9rem; }
}
/* Réglages des sons repliés (ouverts au bureau par sound-pref.js). */
.page-game .settings { margin-top: 16px; border-top: 1px solid var(--c-line); padding-top: 10px; }
.page-game .settings > summary { cursor: pointer; list-style: none; font-size: .75rem;
  letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); font-weight: 800;
  min-height: 40px; display: flex; align-items: center; gap: 6px; }
.page-game .settings > summary::-webkit-details-marker { display: none; }
.page-game .settings > summary::after { content: '▾'; margin-left: auto; }
.page-game .settings[open] > summary::after { content: '▴'; }

/* Difficulté : bouton blanc + pastille de couleur à gauche (plus de fond plein pastel).
   Scopé .pick comme le reste du tableau de bord : sans lui, la spécificité plus élevée de
   `.pick #mode-select .mode-btn { padding: 10px 2px }` (ci-dessus) écraserait padding-left. */
.page-game .pick #mode-select .mode-btn { padding: 10px 6px; text-align: center; }
/* La pastille est dans le flux, collée au nom : le bloc nom + points reste centré. */
.page-game .pick #mode-select .mode-btn-name { display: inline-flex; align-items: center; gap: 6px; }
.page-game .pick #mode-select .mode-btn-name::before {
  content: ''; flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--c-line);
}
.page-game .pick #mode-select .mode-btn[data-mode="facile"] .mode-btn-name::before { background: var(--c-green-deep); }
.page-game .pick #mode-select .mode-btn[data-mode="moyen"] .mode-btn-name::before  { background: var(--c-amber); }
.page-game .pick #mode-select .mode-btn[data-mode="dur"] .mode-btn-name::before    { background: var(--c-red); }
.page-game .pick #mode-select .mode-btn.active,
.page-game .pick #indice-select .mode-btn.active { background: var(--c-green-soft); border-color: var(--c-green); }
/* L'indice choisi doit sauter aux yeux autant que la difficulté : son nom passe au vert foncé. */
.page-game .pick #indice-select .mode-btn.active .mode-btn-name { color: var(--c-green-deep); }

/* ══ page-commune (vue classement intégrée) ══════════════════════════════════ */
.page-commune .commune-idea { max-width: 1080px; margin: 18px auto 0; }
.page-commune #view-scores { flex-direction: column; align-items: stretch;
  justify-content: flex-start; padding: calc(var(--sb-h, 60px) + 6px) 0 0; overflow: hidden; }
.page-commune .sc-head { display: flex; align-items: center; gap: 12px; padding: 8px 16px; }
.page-commune .sc-head h1 { font-size: 1.3rem; margin: 0; }
.page-commune .sc-body { flex: 1; display: flex; min-height: 0; }
.page-commune .sc-controls { flex: 1 1 50%; min-width: 0; overflow-y: auto; padding: 4px 18px 20px; }
.page-commune .sc-controls .pick-lbl { font-size: .75rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--c-muted); font-weight: 800; margin: 8px 0; }
.page-commune .sc-controls .game-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.page-commune .sc-controls .game-item { display: block; padding: 11px 14px;
  background: var(--c-surface); color: var(--c-ink);
  text-decoration: none; font-weight: 700; }
.page-commune .sc-controls .game-item:hover { border-color: var(--c-green-pale); }
.page-commune .sc-controls .game-item.active { border-color: var(--c-green); background: var(--c-green-soft); }
.page-commune .sc-controls .suisse-toggle { width: 100%; margin-bottom: 8px; }
.page-commune .sc-controls .canton-map { width: min(320px, 92%); margin: 0 auto 8px; display: block; }
.page-commune .sc-controls .canton-select { width: 100%; }
.page-commune .sc-panel { flex: 1 1 50%; min-width: 0; overflow-y: auto; padding: 8px 18px 28px;
  border-left: 1px solid var(--c-line); background: var(--c-bg); }
.page-commune .sc-panel #scores-filter { justify-content: center; margin-bottom: 10px; }
.page-commune .sc-panel .scores-search { width: 100%; margin-bottom: 12px; }
.page-commune .sc-panel table { width: 100%; }
@media (max-width: 760px) {
  .page-commune #view-scores { overflow: auto; }
  .page-commune .sc-body { flex-direction: column; }
  .page-commune .sc-controls, .page-commune .sc-panel { flex: 1 1 auto; overflow: visible; }
  .page-commune .sc-panel { border-left: none; border-top: 1px solid var(--c-line); }
}
/* Place du podium réservée : le tableau ne saute pas quand il apparaît.
   La règle ci-dessous est la seule contre-règle assumée de `.hidden` : le podium
   garde sa place (visibility) au lieu de disparaître de la mise en page. */
.page-commune #podium, .page-scores #podium { min-height: 150px; margin: 0 0 8px; }
.page-commune #podium.hidden, .page-scores #podium.hidden { display: flex !important; visibility: hidden; }

/* ══ page-quiz ════════════════════════════════════════════════════════════════ */
.page-quiz .pick #pseudo { margin-top: 14px; }
.page-quiz .pick #mode-select { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 0; }
/* Le QCM n'a pas de pastille de difficulté (mode Normal/Révision, pas facile/moyen/dur) :
   look propre (fond plein sur l'actif), donc on efface la pastille et le décalage hérités
   de page-game — même scope .pick, même spécificité, place après dans la feuille → gagne. */
.page-quiz .pick #mode-select .mode-btn { padding: 12px 4px; border: 2px solid var(--c-line); background: var(--c-surface);
  color: var(--c-ink); border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer; }
.page-quiz .pick #mode-select .mode-btn-name::before { content: none; }
.page-quiz .pick #mode-select .mode-btn.active { border-color: var(--c-green-deep); background: var(--c-green); color: #fff; }
.page-quiz #revision-filters { margin-top: 12px; }
.page-quiz #revision-filters.hidden { display: none; }
.page-quiz #revision-filters select { width: 100%; margin-bottom: 6px; padding: 8px; border-radius: 8px; border: 2px solid var(--c-line); font: inherit; }
.page-quiz #quiz-canton-map { width: 100%; height: 100%; max-height: 420px; }
.page-quiz #quiz-canton-map .qc-shape { stroke: #fff; stroke-width: .5; vector-effect: non-scaling-stroke; }
.page-quiz #quiz-canton-map .qc-off { fill: #dfe5ec; }
.page-quiz #quiz-canton-map .qc-on { fill: #2b7; cursor: pointer; }
.page-quiz #quiz-canton-map .qc-on:hover { fill: #178a55; }
.page-quiz #quiz-canton-map .qc-on.qc-selected { fill: #178a55; stroke: #0a3d22; stroke-width: 2; }
.page-quiz .source-line { max-width: 1080px; margin: 16px auto 0; text-align: center; color: var(--c-muted); font-size: .82rem; }
.page-quiz .dev-note { display: inline-block; margin: 8px auto 0; padding: 4px 12px; border-radius: 999px; background: var(--c-amber-soft); color: var(--c-amber-ink); font-size: .85rem; font-weight: 700; }
.page-quiz #q-stage { max-width: 560px; margin: 24px auto; padding: 0 16px; }
.page-quiz #q-stage.hidden { display: none; }
.page-quiz .q-text { font-size: 1.35rem; font-weight: 700; color: var(--c-ink); line-height: 1.4; margin-bottom: 20px; text-align: center; }
/* Les réponses sont des boutons du composant (.btn .btn-secondary), pleine largeur,
   texte à gauche derrière une pastille A–D. */
.page-quiz .q-choices { display: grid; gap: 10px; }
.page-quiz .q-choice { width: 100%; min-height: 52px; justify-content: flex-start;
  text-align: left; font-size: 1.02rem; font-weight: 600; padding: 12px 14px; }
.page-quiz .q-letter { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; background: var(--c-bg); color: var(--c-muted);
  font-size: .82rem; font-weight: 800; }
.page-quiz .q-choice.good { background: var(--c-green); border-color: var(--c-green-deep); color: #fff; }
.page-quiz .q-choice.good .q-letter { background: rgba(255,255,255,.25); color: #fff; }
.page-quiz .q-choice.bad { background: var(--c-red-soft); border-color: var(--c-red); color: var(--c-red-ink); }
.page-quiz .q-choice.q-wrong { animation: q-shake .4s ease; }
@keyframes q-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); } 40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); } 80% { transform: translateX(2px); }
}
/* Mouvement réduit : placé APRÈS la règle animée (même spécificité → l'ordre décide). */
@media (prefers-reduced-motion: reduce) { .page-quiz .q-choice.q-wrong { animation: none; } }
/* Thème de la question : pilule dans le bandeau de jeu. */
/* align-self : .hud-main est une colonne flex, sans quoi la pilule s'étirerait. */
.page-quiz #q-theme { align-self: flex-start; min-height: 28px; padding: 5px 10px; font-size: .75rem; }
.page-quiz #q-theme:empty { display: none; }
.page-quiz .q-feedback { text-align: center; margin-top: 18px; }
.page-quiz .q-feedback.hidden { display: none; }
/* Chrono central du bandeau de jeu : grand, centré, vert ≤40 s / rouge >40 s (mode Normal). */
.page-quiz #hud { position: relative; }
.page-quiz .hud-timer { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: clamp(1.9rem, 8vw, 2.7rem); font-weight: 800; font-variant-numeric: tabular-nums; color: var(--c-ink-2); transition: color .2s; pointer-events: none; white-space: nowrap; }
.page-quiz .hud-timer.t-ok { color: var(--c-green-deep); }
.page-quiz .hud-timer.t-over { color: var(--c-red); }
/* Explication du calcul des points en mode Défi. */
.page-quiz .defi-rules { max-width: 560px; margin: 12px auto 16px; padding: 12px 16px; background: var(--c-green-soft); border: 1px solid var(--c-green-line); border-radius: 12px; color: var(--c-ink-2); font-size: .92rem; line-height: 1.5; text-align: left; }
.page-quiz .defi-rules strong { display: block; color: var(--c-green-deep); margin-bottom: 4px; }
@media (max-width: 880px) { .page-quiz .stage { min-height: 220px; } .page-quiz .q-text { font-size: 1.15rem; } }

/* ══ page-scores ══════════════════════════════════════════════════════════════ */
.page-scores { display: flex; flex-direction: column; overflow: hidden; }
.page-scores .sc-head { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-bottom: 1px solid var(--c-line); background: var(--c-surface); }
.page-scores .sc-head h1 { font-size: 1.3rem; margin: 0; }
.page-scores .sc-head .sb-right { margin-left: auto; }
.page-scores .sc-body { flex: 1; display: flex; min-height: 0; }
.page-scores .pick-lbl { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); font-weight: 800; margin: 8px 0; }
.page-scores .sc-controls { flex: 1 1 33%; min-width: 0; overflow-y: auto; padding: 8px 18px 24px; }
.page-scores .sc-controls .game-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.page-scores .sc-controls .game-row { display: flex; gap: 6px; }
.page-scores .sc-controls .game-item { flex: 1 1 auto; width: auto; text-align: left; padding: 12px 14px; background: var(--c-surface); color: var(--c-ink); cursor: pointer; font: inherit; font-weight: 700; }
.page-scores .sc-controls .game-item:hover { border-color: var(--c-green-pale); }
.page-scores .sc-controls .game-item.active { border-color: var(--c-green-deep); background: var(--c-green); color: #fff; }
.page-scores .sc-controls .game-item.active .nm { color: #fff; }
.page-scores .sc-controls .game-play { flex: 0 0 33%; display: flex; align-items: center; justify-content: center; gap: 5px;
  text-decoration: none; font-weight: 700; font-size: .92rem; background: var(--c-green); color: #fff; padding: 12px 8px; }
.page-scores .sc-controls .game-play:hover { background: var(--c-green-deep); }
.page-scores .sc-controls .suisse-toggle { width: 100%; margin-bottom: 8px; }
.page-scores .sc-controls .canton-map { width: min(340px, 94%); margin: 0 auto 8px; display: block; }
.page-scores .sc-controls .canton-select { width: 100%; }
.page-scores .sc-panel { flex: 1 1 67%; min-width: 0; overflow-y: auto; padding: 12px 18px 28px; border-left: 1px solid var(--c-line); background: var(--c-bg);
  display: flex; flex-direction: column; align-items: center; }
.page-scores .sc-panel #scores-filter { justify-content: center; margin: 0 auto 10px; }
.page-scores .sc-panel .scores-search { width: 100%; max-width: 300px; margin: 0 auto 12px; display: block; padding: 7px 12px; font-size: .85rem; }
.page-scores .sc-panel #podium { width: min(660px, 100%); }
.page-scores .sc-panel table { width: 100%; max-width: 660px; }
/* Quiz « Es-tu Suisse ? » : tout le monde fait 10/10, le classement se fait au temps → on masque la colonne Points. */
.page-scores #scores-table.no-points th:nth-child(3), .page-scores #scores-table.no-points td:nth-child(3) { display: none; }
.page-scores .sc-panel #scores-pager { margin: 0 auto; }
/* Bouton « Jouer à ce jeu », sous le podium : mobile uniquement (en large, chaque
   jeu a déjà son bouton « Jouer » dans la colonne de gauche). */
.page-scores .sc-play-one { display: none; }
@media (max-width: 760px) {
  .page-scores { overflow: auto; }
  .page-scores .sc-body { flex-direction: column; }
  .page-scores .sc-controls, .page-scores .sc-panel { flex: 1 1 auto; overflow: visible; }
  .page-scores .sc-panel { border-left: none; border-top: 1px solid var(--c-line); }
  .page-scores .sc-head { flex-wrap: wrap; row-gap: 8px; }
  .page-scores .sc-head h1 { flex: 1 1 auto; }
  .page-scores .sc-head .sb-right { flex: 0 1 auto; }
  /* Choix du jeu : une rangée de pilules qui défile, plus une colonne de boutons. */
  .page-scores .sc-controls { padding: 6px 12px 0; }
  .page-scores .sc-controls .game-list { flex-direction: row; flex-wrap: nowrap;
    overflow-x: auto; gap: 6px; margin-bottom: 10px; -webkit-overflow-scrolling: touch; }
  .page-scores .sc-controls .game-row { flex: 0 0 auto; }
  .page-scores .sc-controls .game-item { padding: 9px 14px; border-radius: var(--r-md);
    font-size: .85rem; white-space: nowrap; }
  .page-scores .sc-controls .game-play { display: none; }   /* un seul « Jouer », sous le podium */
  .page-scores .sc-controls .suisse-toggle,
  .page-scores .sc-controls .canton-map { display: none; }  /* la liste déroulante suffit */
  .page-scores .sc-controls .canton-select { width: 100%; }
  .page-scores .sc-controls .pick-lbl { margin: 4px 0; }
  /* Le classement commence le plus haut possible ; place pour la barre d'XP fixe. */
  .page-scores .sc-panel { padding: 8px 12px calc(var(--xp-h) + 8px); }
  .page-scores .sc-play-one { display: flex; width: 100%; margin: 0 0 12px; }
}

/* ══ page-aide ════════════════════════════════════════════════════════════════ */
.page-aide .aide { max-width: 820px; margin: 8px auto 0; display: flex; flex-direction: column; gap: 16px; text-align: left; }
.page-aide .aide-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 16px; padding: 18px 22px; box-shadow: 0 2px 12px rgba(0,0,0,.05); }
.page-aide .aide-card h2 { font-size: 1.15rem; margin: 0 0 10px; color: var(--c-ink); }
.page-aide .aide-card p { color: var(--c-ink-2); line-height: 1.55; margin: 0 0 8px; }
.page-aide .aide-card ul { margin: 0; padding-left: 18px; color: var(--c-ink-2); line-height: 1.55; }
.page-aide .aide-card li { margin-bottom: 6px; }
.page-aide .aide-card li strong { color: var(--c-ink); }
.page-aide .aide-tbl { width: 100%; border-collapse: collapse; }
.page-aide .aide-tbl th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--c-muted); padding: 4px 8px; }
.page-aide .aide-tbl td { padding: 6px 8px; border-top: 1px solid var(--c-line); color: var(--c-ink-2); }
.page-aide .aide-chip { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 22px;
  padding: 0 8px; border-radius: 11px; color: #fff; font-weight: 800; font-size: .76rem; }

/* ══ page-champions ══════════════════════════════════════════════════════════ */
.page-champions .champions-tabs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 4px 0 16px; }
.page-champions .ch-panel.hidden { display: none; }
.page-champions .champ-gate { position: fixed; top: var(--sb-h, 60px); left: 0; right: 0; bottom: 0; z-index: 45; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(20, 30, 40, .55); backdrop-filter: blur(3px); }
/* Sous le voile : la barre XP (z 50) passerait sinon devant — le bandeau reste la seule sortie. */
.page-champions #xp-bar { z-index: 40; }
.page-champions .champ-gate-card { background: var(--c-surface); border-radius: 18px; padding: 28px 24px; max-width: 380px; width: 100%;
  text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.page-champions .champ-gate-emoji { font-size: 3rem; line-height: 1; }
.page-champions .champ-gate-card h2 { margin: 10px 0 6px; }
.page-champions .champ-gate-card p { color: var(--c-muted); line-height: 1.45; margin-bottom: 18px; }
.page-champions .champ-gate-card .btn { margin-top: 8px; }

/* ══ page-merci ══════════════════════════════════════════════════════════════ */
/* *{box-sizing…} et body{…} restent globaux (style.css:1-2, 34-35) ; l'ancienne .idea-box
   de merci.php est un doublon de .idea-box ci-dessus (tâche 6 la retire du markup). */
.page-merci .box { background: var(--c-surface); border-radius: 16px; box-shadow: 0 6px 24px rgba(0,0,0,.1); max-width: 420px; width: 100%; padding: 36px 30px; text-align: center; }
.page-merci .ico { font-size: 48px; width: auto; height: auto; display: block; }   /* emoji 💚/🤔, pas une icône du sprite */
.page-merci h1 { font-size: 22px; color: var(--c-green-deep); margin: 10px 0; }
.page-merci p { color: var(--c-muted); font-size: 14px; line-height: 1.6; margin-bottom: 22px; }
.page-merci a.btn { display: inline-block; background: var(--c-green); color: #fff; text-decoration: none; font-weight: 700; padding: 12px 24px; border-radius: 10px; }

/* ══ page-compte + page-stats (tableaux de bord) ═════════════════════════════ */
.page-compte .st-wrap, .page-stats .st-wrap { max-width: 1100px; margin: 0 auto;
  padding: calc(var(--sb-h, 60px) + 12px) 16px 16px; }
.page-compte .st-wrap { max-width: 1000px; }
.page-compte .st-head, .page-stats .st-head { display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap; margin-bottom: 14px; }
.page-compte .st-head h1, .page-stats .st-head h1 { font-size: 1.4rem; margin: 0; }
.page-compte .st-controls, .page-stats .st-controls { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.page-compte .st-controls select, .page-stats .st-controls select { padding: 8px 10px;
  border-radius: var(--r-sm); border: 2px solid var(--c-line); font: inherit; }
.page-compte .st-cards, .page-stats .st-cards { display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.page-compte .st-card, .page-stats .st-card { background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--r-md); padding: 14px 16px; }
.page-compte .st-card .lbl, .page-stats .st-card .lbl { font-size: .75rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--c-muted); font-weight: 800; }
.page-compte .st-card .num, .page-stats .st-card .num { font-size: 1.7rem; font-weight: 800;
  color: var(--c-green-deep); font-variant-numeric: tabular-nums; }
.page-compte .st-section, .page-stats .st-section { background: var(--c-surface);
  border: 1px solid var(--c-line); border-radius: var(--r-lg); padding: 16px; margin-bottom: 18px; }
.page-compte .st-section h2, .page-stats .st-section h2 { font-size: 1.05rem; margin: 0 0 10px; }
.page-compte table.st, .page-stats table.st { width: 100%; border-collapse: collapse; font-size: .92rem; }
.page-compte table.st th, .page-compte table.st td,
.page-stats table.st th, .page-stats table.st td { padding: 7px 10px;
  border-bottom: 1px solid var(--c-line); text-align: left; }
.page-compte table.st th, .page-stats table.st th { color: var(--c-ink-2); font-weight: 700; }
.page-compte table.st td.num, .page-compte table.st th.num,
.page-stats table.st td.num, .page-stats table.st th.num { text-align: right; font-variant-numeric: tabular-nums; }
.page-compte .st-bad, .page-stats .st-bad { color: var(--c-red); font-weight: 700; }
/* propre à stats.php */
.page-stats .st-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.page-stats .st-cols .st-section { margin-bottom: 0; }
@media (max-width: 720px) { .page-stats .st-cols { grid-template-columns: 1fr; } }
.page-stats #st-heat { width: 100%; max-height: 460px; }
.page-stats #st-heat path { stroke: #fff; stroke-width: .4; vector-effect: non-scaling-stroke; }
.page-stats #st-heat .bg { fill: #eef3f0; }
.page-stats .st-legend { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--c-muted); margin-top: 8px; }
.page-stats .st-legend .bar { width: 160px; height: 10px; border-radius: 5px; background: linear-gradient(90deg, hsl(120,70%,50%), hsl(60,70%,50%), hsl(0,70%,50%)); }
.page-stats .st-filter-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.page-stats .st-filter-row label { display: flex; flex-direction: column; gap: 4px; font-size: .78rem; color: var(--c-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.page-stats .st-filter-row select, .page-stats .st-filter-row input { padding: 7px 10px; border-radius: 8px; border: 2px solid var(--c-line); font: inherit; font-size: .92rem; font-weight: 400; color: var(--c-ink); text-transform: none; letter-spacing: normal; }
