/* ==========================================================================
   La Bordure — Thème visuel (Lots 1 et 2 : socle visuel & composants)
   Chargé après bordure.css / animations.css / jet.css et AVANT telephone.css
   afin que les règles mobiles et paysage bas gardent le dernier mot.
   Toutes les ressources (polices, icônes) sont servies localement ('self').
   ========================================================================== */

/* ---------- 1. Polices locales auto-hébergées (SIL OFL 1.1) ---------- */
@font-face {
  font-family: "Cinzel";
  src: url("/static/polices/cinzel.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lora";
  src: url("/static/polices/lora.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Lora";
  src: url("/static/polices/lora-italique.woff2") format("woff2");
  font-weight: 400 700;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/static/polices/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- 2. Palette des maquettes et typographie ---------- */
:root {
  color-scheme: dark;

  /* Fonds & surfaces */
  --fond: #0d0b12;
  --fond-profond: #0b0911;
  --fond-carte: rgba(22, 18, 33, .90);
  --fond-carte-uni: #161221;
  --fond-champ: #100d18;
  --fond-survol: #1f192e;

  /* Bordures & or */
  --bord: #3a304d;
  --bord-or-doux: rgba(212, 169, 87, .28);
  --bord-or-actif: rgba(212, 169, 87, .75);
  --or: #d4a957;
  --or-clair: #f0d797;
  --or-vif: #f2dc9b;
  --or-bouton-haut: #e5c171;
  --or-bouton-bas: #b6893a;
  --or-texte-sombre: #1a1208;

  /* Textes */
  --texte: #f0eaf6;
  --texte-doux: #a89fb6;

  /* États sémantiques */
  --bon: #7ee2a8;
  --bon-fond: #193b2a;
  --bon-bord: #3f9b68;

  --ambre: #f2c67d;
  --ambre-fond: #472f16;
  --ambre-bord: #c98a3b;

  --mauvais: #f49090;
  --mauvais-fond: #3f1b22;
  --mauvais-bord: #bc4d4d;
  --rouge: #c85a5a;

  --info: #93c8ff;
  --info-fond: #182e47;
  --info-bord: #4d8cc9;

  --retour: #ceb7f7;
  --retour-fond: #2f214a;
  --retour-bord: #7e5ec0;

  --focus: #f0d28a;   /* liseré doré, 3 px (accessibilité au clavier) */

  /* Polices */
  --police-titre-jeu: "Cinzel", Georgia, "Times New Roman", serif;
  --police-titre: "Lora", Georgia, "Times New Roman", serif;
  --police-texte: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Volumes */
  --rayon-carte: 12px;
  --ombre-carte: 0 8px 24px rgba(0, 0, 0, .42);
}

body {
  font-family: var(--police-texte);
  color: var(--texte);
  background:
    radial-gradient(ellipse 85% 48% at 78% 8%, rgba(164, 92, 48, .22), transparent 62%),
    radial-gradient(ellipse 75% 55% at 14% 24%, rgba(86, 46, 122, .26), transparent 64%),
    linear-gradient(180deg, rgba(11, 9, 17, .64) 0%, rgba(11, 9, 17, .86) 44%, rgba(11, 9, 17, .96) 100%),
    url(/static/art/ecrans/ciel.webp) center top / cover fixed,
    var(--fond-profond);
}

/* Lora : titres de bannières, de sections et de cartes */
h1, h2, h3,
.equipage h4,
.sous-titre,
.guide summary,
.valeur,
.bord-dette-montant,
.comparatif-marche > summary,
.piece-suite h4,
.carte-pack-nom,
.album-carte-nom,
.infobulle-titre,
.emplacements .nom,
.en-vol .compte,
.paquet-nom,
.carte-dos-texte,
.roulette-nom,
.carte-gain-envol,
.legende,
.legende-finale,
.replique,
.syndicat-scene,
.nom-zone,
.nom-voie,
.dec-legende {
  font-family: var(--police-titre);
}

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: .01em;
}

/* Cinzel : nom du jeu et sur-titres en capitales */
.entete h1,
.titre-jeu h2,
.sur-titre,
.surtitre,
.objectif .chap,
.groupe-missions-titre,
.res-avantages legend,
.reserve h5,
.jet-titre,
.jet-etiquette,
.jet-mot,
.nom-region,
.hors-cartes {
  font-family: var(--police-titre-jeu);
}

.surtitre {
  margin: 0 0 4px;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--or-clair);
}

/* Inter : texte d'interface & chiffres tabulaires */
.infobulle,
.bord-absence .compte-a-lire {
  font-family: var(--police-texte);
}

.puce b,
.compte,
.valeur,
.bord-dette-montant,
.jauge-tete,
.anneau-valeur {
  font-variant-numeric: tabular-nums;
}

/* Cartes existantes : verre sombre translucide et filet or discret
   (sans écraser les bordures/fonds sémantiques de bordure.css) */
.carte,
.panneau > article,
.vaisseau-droite > article,
.marche-duo article,
.marche-duo .comparatif-marche,
.guide,
.mondes-en-liste {
  border-radius: var(--rayon-carte);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.carte:where(:not(.bord-alerte, .bord-pack, .bord-espece, .etude-active, .a-faire-ici, .syndicat-ici, .syndicat-a-lire, .pas-encore, .ferme, .rapport, .pavillon, .en-vol, .a-lire, .posee)),
.panneau > article:where(:not(.bord-alerte, .bord-pack, .bord-espece, .etude-active, .a-faire-ici, .syndicat-ici, .syndicat-a-lire, .pas-encore, .ferme, .rapport, .pavillon, .en-vol, .a-lire, .posee)),
.vaisseau-droite > article:where(:not(.en-vol, .pavillon)),
.marche-duo article,
.marche-duo .comparatif-marche,
.guide,
.mondes-en-liste {
  border-color: var(--bord-or-doux);
  box-shadow: var(--ombre-carte);
}

.panneau > article:where(:not(.bord-alerte, .bord-pack, .pas-encore, .pavillon, .a-faire-ici)),
.marche-duo article,
.marche-duo .comparatif-marche {
  background: linear-gradient(180deg, rgba(27, 22, 41, .90), rgba(18, 14, 28, .92));
}

/* Boutons par défaut (placés avant les barres d'onglets et variantes pour
   qu'aucun bouton spécialisé ne soit écrasé au repos ni au survol) */
button,
.bouton {
  gap: 6px;
  background: linear-gradient(180deg, rgba(31, 25, 46, .88), rgba(20, 16, 30, .94));
  border-color: rgba(212, 169, 87, .48);
  color: var(--or-clair);
  transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

:where(button:not(.lien, .noeud, .pin, .jet-de, .infobulle-fermer, .plus-onglets, .rg, .puce, .sous-nav-choix, .primaire, .bouton-or, .bouton-pilule, .bouton-or-contour, [aria-selected="true"], [aria-current="page"], [aria-pressed="true"]):not(:disabled)):hover,
.bouton:where(:not(.primaire, .bouton-or)):hover {
  background: linear-gradient(180deg, rgba(46, 37, 68, .94), rgba(29, 23, 44, .96));
  border-color: var(--or-vif);
  color: #fff6dc;
  box-shadow: 0 0 12px rgba(212, 169, 87, .18);
}

.objectif {
  border-color: rgba(212, 169, 87, .65);
  background: linear-gradient(155deg, rgba(42, 33, 60, .95), rgba(20, 16, 30, .96));
  box-shadow: 0 0 0 1px rgba(212, 169, 87, .22), 0 12px 32px rgba(0, 0, 0, .52);
}

.objectif .chap {
  color: var(--or-clair);
  opacity: .9;
}

/* ---------- 3. En-tête, emblème rose des vents et pilules ---------- */
.entete {
  background:
    radial-gradient(ellipse 60% 110% at 15% 50%, rgba(212, 169, 87, .14), transparent 70%),
    linear-gradient(180deg, rgba(16, 12, 24, .76), rgba(13, 11, 18, .96)),
    url(/static/art/ecrans/titre.webp) center 35% / cover;
  border-bottom: 1px solid var(--bord-or-doux);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .38);
}

.entete h1 {
  display: inline-flex;
  align-items: center;
  gap: .45em;
  font-weight: 700;
  letter-spacing: .12em;
  background: linear-gradient(180deg, #fff4cb 10%, #e5c171 58%, #b6893a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .75));
}

.entete h1::before {
  content: "";
  flex: none;
  width: 1.3em;
  height: 1.3em;
  background: linear-gradient(180deg, #fff4cb 0%, #d4a957 60%, #a5782c 100%);
  -webkit-mask: url(/static/art/icones/embleme-bordure.svg) center / contain no-repeat;
  mask: url(/static/art/icones/embleme-bordure.svg) center / contain no-repeat;
}

.en-jeu .entete h1 {
  font-size: 1.25rem;
}

.puce {
  border: 1px solid rgba(168, 159, 182, .28);
  border-radius: 999px;
  padding: 4px 12px;
  background: rgba(18, 14, 28, .88);
  color: var(--texte);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.puce.chapitre-puce {
  border-color: rgba(212, 169, 87, .55);
  background: linear-gradient(180deg, rgba(212, 169, 87, .22), rgba(182, 137, 58, .10));
  color: var(--or-clair);
  font-weight: 600;
}

button.puce.panne-puce {
  border-color: var(--mauvais-bord);
  background: var(--mauvais-fond);
  color: var(--mauvais);
}

button.puce.panne-puce:hover {
  background: #53222b;
  border-color: var(--mauvais);
}

#son-global {
  border-color: rgba(212, 169, 87, .48);
  background: rgba(18, 14, 28, .82);
  color: var(--or-clair);
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

#son-global:hover {
  border-color: var(--or-vif);
  background: rgba(34, 26, 48, .94);
  box-shadow: 0 0 12px rgba(212, 169, 87, .22);
}

/* ---------- 4. Cadre « À faire » ---------- */
.haut-jeu {
  background: rgba(13, 11, 18, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.afaire {
  border: 1px solid rgba(212, 169, 87, .55);
  border-radius: var(--rayon-carte);
  padding: 12px 16px;
  background:
    radial-gradient(ellipse 50% 100% at 0% 50%, rgba(212, 169, 87, .10), transparent 70%),
    linear-gradient(180deg, rgb(28, 22, 42), rgb(18, 14, 28)), var(--fond-carte, #1c162a);
  box-shadow: inset 3px 0 0 var(--or), 0 8px 24px rgba(0, 0, 0, .48);
}

.afaire-titre {
  padding: 2px 9px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--or-bouton-haut), var(--or-bouton-bas));
  color: var(--or-texte-sombre);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
}

.afaire-phrase b {
  font-weight: 600;
  color: var(--texte);
}

.afaire-pourquoi {
  color: var(--texte-doux);
}

.afaire-cours {
  border-top: 1px solid rgba(212, 169, 87, .18);
  color: var(--texte-doux);
}

.afaire.urgent {
  border-color: var(--mauvais-bord);
  background:
    radial-gradient(ellipse 50% 100% at 0% 50%, rgba(188, 77, 77, .18), transparent 70%),
    linear-gradient(180deg, rgb(44, 22, 30), rgb(24, 14, 22)), var(--fond-carte, #2c161e);
  box-shadow: inset 4px 0 0 var(--mauvais), 0 8px 24px rgba(0, 0, 0, .48);
}

/* ---------- 5. Barre d'onglets (bureau) et sous-navigation ---------- */
/* Le style rail doré et l'affichage des icônes sur bureau ne s'appliquent
   qu'au-dessus de 600 px : en dessous, telephone.css garde 100 % la main. */
@media (min-width: 601px) {
  .onglets {
    gap: 4px;
    padding: 4px;
    margin: 10px 0 14px;
    border-radius: var(--rayon-carte);
    border: 1px solid var(--bord-or-doux);
    background: linear-gradient(180deg, rgba(24, 19, 36, .95), rgba(15, 12, 23, .97));
    box-shadow: 0 6px 20px rgba(0, 0, 0, .42);
  }

  .onglets button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 9px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--texte-doux);
    font-weight: 500;
    transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
  }

  .onglets button:hover {
    color: var(--texte);
    background: rgba(212, 169, 87, .08);
    border-color: rgba(212, 169, 87, .22);
  }

  /* Spécificité (0, 2, 1) > .onglets .ic (0, 2, 0) dans telephone.css (ligne 4)
     pour afficher les icônes à gauche du libellé sur ordinateur uniquement. */
  nav.onglets .ic {
    display: inline-block;
    flex: none;
    width: 19px;
    height: 19px;
    opacity: .8;
    transition: opacity .18s ease, color .18s ease;
  }

  .onglets button:hover .ic {
    opacity: 1;
  }

  .onglets button[aria-selected="true"] {
    color: #fff6dc;
    font-weight: 600;
    border-color: rgba(212, 169, 87, .68);
    background:
      radial-gradient(ellipse 85% 95% at 50% 100%, rgba(212, 169, 87, .42), rgba(182, 137, 58, .16) 58%, transparent 100%),
      linear-gradient(180deg, rgba(46, 35, 62, .88), rgba(32, 24, 44, .96));
    box-shadow:
      inset 0 -3px 0 var(--or-vif),
      0 0 18px rgba(212, 169, 87, .22);
  }

  .onglets button[aria-selected="true"] .ic {
    opacity: 1;
    color: var(--or-vif);
  }

  .onglets .pt.pt-lire,
  .onglets .pt.pt-panne {
    margin-left: 2px;
  }
}

/* Six onglets (le Spatioport s'est ajouté le 24/11) : de 601 à 860 px, chaque case fait de 100 à 140 px, « Spatioport » ne tient plus avec son icône :
   sans icône, marges serrées. Au téléphone (600 px et moins), « Port » : telephone.css. */
@media (min-width: 601px) and (max-width: 860px) {
  nav.onglets .ic { display: none; }
  .onglets button { padding-inline: 6px; font-size: .9rem; }
}

/* Sous-navigation (Bord / Rapports, Cantina / Packs / Album…) */
.sous-nav {
  gap: 8px;
  margin: 0 0 14px;
}

.sous-nav-choix {
  min-height: 44px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(168, 159, 182, .26);
  background: rgba(22, 18, 33, .86);
  color: var(--texte-doux);
  font-weight: 500;
  transition: background .18s ease, color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.sous-nav-choix:hover {
  color: var(--texte);
  border-color: rgba(212, 169, 87, .48);
  background: rgba(36, 29, 52, .92);
}

.sous-nav-choix[aria-current="page"] {
  border-color: var(--or-vif);
  background: linear-gradient(180deg, var(--or-bouton-haut), var(--or-bouton-bas));
  color: var(--or-texte-sombre);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(212, 169, 87, .28), inset 0 1px 0 rgba(255, 248, 224, .45);
}

.sous-nav-choix[aria-current="page"] .chip {
  border-color: rgba(26, 18, 8, .45);
  background: rgba(26, 18, 8, .85);
  color: var(--or-clair);
  font-weight: 600;
}

/* Sous-onglets internes (Missions / Marché / Atelier sur la Carte) */
.sous-onglets button {
  border-color: rgba(168, 159, 182, .26);
  background: rgba(20, 16, 30, .88);
  color: var(--texte-doux);
  gap: 6px;
}

.sous-onglets button:hover {
  color: var(--texte);
  border-color: rgba(212, 169, 87, .42);
}

.sous-onglets button[aria-selected="true"] {
  border-color: rgba(212, 169, 87, .68);
  color: #fff6dc;
  font-weight: 600;
  background:
    radial-gradient(ellipse 85% 95% at 50% 100%, rgba(212, 169, 87, .35), rgba(182, 137, 58, .12) 60%, transparent 100%),
    rgba(34, 26, 48, .94);
  box-shadow: inset 0 -3px 0 var(--or-vif);
}

/* ==========================================================================
   LOT 2 — Bibliothèque de composants réutilisables
   ========================================================================== */

/* ---------- 6.1 Boutons dorés et secondaires ---------- */
/* Remarque : on ne fixe pas min-height ni padding sur button.primaire (0,1,1)
   afin que .afaire-action (0,1,0) dans telephone.css garde la main en mobile
   et en paysage bas. */
.bouton-or {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 9px;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

button.primaire,
.bouton.primaire,
.bouton-or {
  border: 1px solid var(--or-vif);
  background: linear-gradient(180deg, var(--or-bouton-haut) 0%, var(--or-bouton-bas) 100%);
  color: var(--or-texte-sombre);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(212, 169, 87, .24), inset 0 1px 0 rgba(255, 248, 224, .45);
  transition: filter .18s ease, box-shadow .18s ease, background .18s ease;
}

button.primaire:hover:not(:disabled),
.bouton.primaire:hover,
.bouton-or:hover:not(:disabled) {
  background: linear-gradient(180deg, #efd086 0%, #c69643 100%);
  border-color: #fff1c2;
  color: var(--or-texte-sombre);
  box-shadow: 0 4px 16px rgba(212, 169, 87, .38), inset 0 1px 0 rgba(255, 250, 234, .6);
}

button.primaire:active:not(:disabled),
.bouton.primaire:active,
.bouton-or:active:not(:disabled) {
  filter: brightness(.95);
}

/* Bouton secondaire sombre encadré d'or doux (Voir le classement →, Jouer →…) */
.bouton-sombre {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 9px 16px;
  border-radius: 9px;
  border: 1px solid rgba(212, 169, 87, .48);
  background: linear-gradient(180deg, rgba(31, 25, 46, .92), rgba(20, 16, 30, .96));
  color: var(--or-clair);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.bouton-sombre:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(46, 37, 68, .96), rgba(31, 24, 46, .98));
  border-color: var(--or-vif);
  color: #fff6dc;
  box-shadow: 0 0 14px rgba(212, 169, 87, .22);
}

/* Bouton contour or sur bannière illustrée */
.bouton-or-contour {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 9px 18px;
  border-radius: 9px;
  border: 1px solid var(--bord-or-actif);
  background: rgba(16, 13, 24, .78);
  color: var(--or-clair);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.bouton-or-contour:hover:not(:disabled) {
  background: rgba(212, 169, 87, .18);
  border-color: var(--or-vif);
  color: #fff6dc;
  box-shadow: 0 0 16px rgba(212, 169, 87, .28);
}

/* Bouton pilule pour commutateurs (Région / Galaxie, filtres compacts) */
.bouton-pilule {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(168, 159, 182, .30);
  background: rgba(20, 16, 30, .86);
  color: var(--texte-doux);
  font: inherit;
  font-size: .88rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.bouton-pilule:hover:not(:disabled) {
  color: var(--texte);
  border-color: rgba(212, 169, 87, .48);
}

.bouton-pilule[aria-pressed="true"],
.bouton-pilule[aria-current="page"],
.bouton-pilule.actif {
  border-color: var(--or-vif);
  background: linear-gradient(180deg, var(--or-bouton-haut), var(--or-bouton-bas));
  color: var(--or-texte-sombre);
  font-weight: 700;
}

/* ---------- 6.2 Bannière illustrée (.bandeau-hero) ---------- */
.bandeau-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 210px;
  margin: 0 0 16px;
  padding: 24px 28px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(212, 169, 87, .48);
  background: var(--fond-carte-uni);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}

.bandeau-hero > img,
.bandeau-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
}

/* Dégradé sombre à gauche par défaut : assure le contraste du texte */
.bandeau-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(11, 9, 17, .94) 0%,
    rgba(11, 9, 17, .78) 38%,
    rgba(11, 9, 17, .24) 68%,
    rgba(11, 9, 17, .42) 100%
  );
}

.bandeau-hero.droite {
  justify-content: flex-end;
}

.bandeau-hero.droite::after {
  background: linear-gradient(
    270deg,
    rgba(11, 9, 17, .94) 0%,
    rgba(11, 9, 17, .78) 36%,
    rgba(11, 9, 17, .20) 68%,
    rgba(11, 9, 17, .35) 100%
  );
}

.bandeau-hero.compact {
  min-height: 158px;
  padding: 18px 24px;
}

.bandeau-hero-corps {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 560px;
  min-width: 0;
}

.bandeau-hero.droite .bandeau-hero-corps {
  flex-direction: row-reverse;
  text-align: right;
}

.bandeau-hero-texte {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.bandeau-hero.droite .bandeau-hero-texte {
  align-items: flex-end;
}

.bandeau-hero h2 {
  margin: 0;
  font-family: var(--police-titre);
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  font-weight: 600;
  line-height: 1.15;
  color: var(--or-clair);
  text-shadow: 0 2px 10px rgba(0, 0, 0, .85);
}

.bandeau-hero p {
  margin: 0;
  max-width: 44ch;
  color: var(--texte);
  font-size: .95rem;
  line-height: 1.45;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .85);
}

.medaillon-hero {
  flex: none;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 2px solid var(--or);
  background: radial-gradient(circle at 35% 30%, rgba(56, 42, 76, .92), rgba(16, 13, 24, .96));
  color: var(--or-clair);
  box-shadow: 0 0 0 3px rgba(13, 11, 18, .75), 0 0 18px rgba(212, 169, 87, .28);
  overflow: hidden;
}

.medaillon-hero img,
.medaillon-hero svg {
  width: 66%;
  height: 66%;
  object-fit: contain;
}

.bandeau-hero-stats {
  position: relative;
  z-index: 2;
  flex: 0 1 320px;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--bord-or-doux);
  background: rgba(14, 11, 22, .84);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ---------- 6.3 Cartes à image (.carte-illustree) et variantes ---------- */
.carte-illustree {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--rayon-carte);
  border: 1px solid var(--bord-or-doux);
  background: linear-gradient(180deg, rgba(26, 21, 39, .92), rgba(17, 13, 27, .96));
  box-shadow: var(--ombre-carte);
  overflow-wrap: anywhere;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.carte-illustree:hover {
  border-color: rgba(212, 169, 87, .52);
}

.carte-illustree-visuel {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--fond-champ);
  border-bottom: 1px solid rgba(212, 169, 87, .18);
}

.carte-illustree.compacte .carte-illustree-visuel {
  aspect-ratio: 16 / 10;
}

.carte-illustree-visuel img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

@media (hover: hover) {
  .carte-illustree:hover .carte-illustree-visuel img {
    transform: scale(1.03);
  }
}

.carte-illustree-visuel::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 40%;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(16, 13, 24, .75));
}

.carte-illustree-corps {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px 14px;
  min-width: 0;
}

.carte-illustree-corps h3,
.carte-illustree-corps h4 {
  margin: 0;
  font-family: var(--police-titre);
  color: var(--or-clair);
}

.carte-illustree-corps p {
  margin: 0;
  font-size: .9rem;
  color: var(--texte);
}

.carte-illustree-corps .aide {
  color: var(--texte-doux);
  font-size: .84rem;
}

.carte-illustree-pied {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.carte-illustree-pied > button,
.carte-illustree-pied > .bouton,
.carte-illustree-pied > .bouton-sombre,
.carte-illustree-pied > .bouton-or,
.carte-illustree-pied > .pastille-etat.pleine {
  width: 100%;
}

/* Grilles utilitaires pour cartes illustrées */
.grille-cartes-2,
.grille-cartes-3,
.grille-cartes-4,
.grille-pieces {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.grille-cartes-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grille-cartes-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grille-cartes-4,
.grille-pieces { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Carte avec image fondue dans le coin bas-droit (« Pendant ton absence ») */
.carte-fond-illustre {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.carte-fond-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right bottom;
  z-index: -1;
  opacity: .34;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(125deg, transparent 25%, rgba(0, 0, 0, .65) 68%, #000 100%);
  mask-image: linear-gradient(125deg, transparent 25%, rgba(0, 0, 0, .65) 68%, #000 100%);
}

/* En-tête de carte avec icône dorée et action optionnelle à droite */
.carte-titre-ic {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
}

.carte-titre-ic h2,
.carte-titre-ic h3 {
  margin: 0;
}

.carte-titre-ic .ic-titre {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--or-clair);
}

.carte-titre-ic .carte-titre-droite {
  margin-left: auto;
  flex: none;
}

/* ---------- 6.4 Liste à vignettes (.liste-vignettes) ---------- */
.liste-vignettes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.liste-vignettes > li,
.ligne-vignette {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid rgba(168, 159, 182, .16);
  min-width: 0;
}

.liste-vignettes > li:first-child,
.ligne-vignette:first-child {
  border-top: 0;
  padding-top: 2px;
}

.liste-vignettes.encadree {
  gap: 8px;
}

.liste-vignettes.encadree > li,
.ligne-vignette.encadree {
  padding: 10px 12px;
  border: 1px solid rgba(168, 159, 182, .20);
  border-radius: 10px;
  background: rgba(16, 13, 24, .74);
  transition: border-color .18s ease, background .18s ease;
}

.liste-vignettes.encadree > li:hover,
.ligne-vignette.encadree:hover {
  border-color: rgba(212, 169, 87, .42);
  background: rgba(28, 22, 42, .85);
}

.ligne-vignette.actif {
  padding: 10px 12px;
  border: 1px solid rgba(212, 169, 87, .68);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(44, 34, 62, .92), rgba(22, 17, 34, .95));
  box-shadow: 0 0 14px rgba(212, 169, 87, .14);
}

.vignette-mini {
  flex: none;
  width: 68px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--bord-or-doux);
  background: var(--fond-champ);
  display: block;
}

.vignette-mini.carree {
  width: 56px;
  height: 56px;
}

.vignette-mini.ronde {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--or);
}

.vignette-mini.large {
  width: 88px;
  height: 58px;
}

.vignette-corps {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.vignette-corps > b,
.vignette-corps > strong,
.vignette-corps > h3,
.vignette-corps > h4 {
  display: block;
  margin: 0;
  color: var(--texte);
  font-size: .95rem;
  line-height: 1.3;
}

.vignette-corps > p,
.vignette-meta {
  margin: 2px 0 0;
  font-size: .84rem;
  color: var(--texte-doux);
  line-height: 1.35;
}

.vignette-action {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

/* ---------- 6.5 Anneau de progression SVG (.anneau-prog, composants.js) ---------- */
.anneau-prog {
  --anneau-taille: 108px;
  --anneau-debut: var(--or-vif);
  --anneau-fin: var(--or-bouton-bas);
  --anneau-lueur: rgba(212, 169, 87, .42);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  max-width: 100%;
}

.anneau-prog.anneau-petit { --anneau-taille: 76px; }
.anneau-prog.anneau-grand { --anneau-taille: 126px; }

.anneau-prog.anneau-bon {
  --anneau-debut: var(--bon);
  --anneau-fin: var(--bon-bord);
  --anneau-lueur: rgba(126, 226, 168, .38);
}

.anneau-prog.anneau-ambre {
  --anneau-debut: var(--ambre);
  --anneau-fin: var(--ambre-bord);
  --anneau-lueur: rgba(242, 198, 125, .38);
}

.anneau-prog.anneau-mauvais {
  --anneau-debut: var(--mauvais);
  --anneau-fin: var(--mauvais-bord);
  --anneau-lueur: rgba(244, 144, 144, .38);
}

.anneau-prog.anneau-info {
  --anneau-debut: var(--info);
  --anneau-fin: var(--info-bord);
  --anneau-lueur: rgba(147, 200, 255, .38);
}

.anneau-cadre {
  position: relative;
  width: var(--anneau-taille);
  height: var(--anneau-taille);
  display: grid;
  place-items: center;
}

.anneau-svg {
  display: block;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  overflow: visible;
}

.anneau-arret-debut { stop-color: var(--anneau-debut); }
.anneau-arret-fin { stop-color: var(--anneau-fin); }

.anneau-piste {
  fill: none;
  stroke: rgba(43, 35, 58, .92);
  stroke-width: 8;
}

.anneau-arc {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset .5s ease-out;
  filter: drop-shadow(0 0 5px var(--anneau-lueur));
}

.anneau-arc-vide {
  opacity: 0;
}

.anneau-centre {
  position: absolute;
  inset: 14%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  pointer-events: none;
}

.anneau-icone {
  display: grid;
  place-items: center;
  color: var(--or-clair);
  line-height: 1;
}

.anneau-icone svg,
.anneau-icone img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.anneau-petit .anneau-icone svg,
.anneau-petit .anneau-icone img {
  width: 24px;
  height: 24px;
}

.anneau-valeur {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--texte);
}

.anneau-petit .anneau-valeur {
  font-size: .88rem;
}

.anneau-leg {
  display: block;
  font-size: .76rem;
  line-height: 1.2;
  color: var(--texte-doux);
}

.anneau-pied {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

/* ---------- 6.6 Jauges linéaires harmonisées ---------- */
.jauge-tete {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
  font-size: .86rem;
  color: var(--texte-doux);
}

.jauge-tete b,
.jauge-tete strong {
  color: var(--texte);
  font-weight: 600;
}

.jauge {
  height: 8px;
  border-radius: 999px;
  background: #282038;
  border: 1px solid rgba(168, 159, 182, .18);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .55);
}

.jauge > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--or-bouton-bas), var(--or-vif));
  box-shadow: 0 0 8px rgba(212, 169, 87, .35);
  transition: width .35s ease;
}

.jauge.jauge-sante > i {
  background: linear-gradient(90deg, var(--bon-bord), var(--bon));
  box-shadow: 0 0 8px rgba(126, 226, 168, .35);
}

.jauge.jauge-ambre > i {
  background: linear-gradient(90deg, var(--ambre-bord), var(--ambre));
  box-shadow: 0 0 8px rgba(242, 198, 125, .35);
}

.jauge.jauge-mauvais > i {
  background: linear-gradient(90deg, var(--mauvais-bord), var(--mauvais));
  box-shadow: 0 0 8px rgba(244, 144, 144, .35);
}

.jauge.jauge-info > i {
  background: linear-gradient(90deg, var(--info-bord), var(--info));
  box-shadow: 0 0 8px rgba(147, 200, 255, .35);
}

.objectif .jauge {
  height: 10px;
  border-radius: 999px;
  border-color: rgba(212, 169, 87, .35);
}

progress.avancement {
  height: 8px;
  border-radius: 999px;
  background: #282038;
}

progress.avancement::-webkit-progress-bar {
  background: #282038;
  border-radius: 999px;
}

progress.avancement::-webkit-progress-value {
  background: linear-gradient(90deg, var(--or-bouton-bas), var(--or-vif));
  border-radius: 999px;
}

progress.avancement::-moz-progress-bar {
  background: linear-gradient(90deg, var(--or-bouton-bas), var(--or-vif));
  border-radius: 999px;
}

.jauge-temps {
  height: 7px;
  border-radius: 999px;
  background: #282038;
}

.jauge-temps .jauge-reste {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--or-bouton-bas), var(--or-vif));
}

/* ---------- 6.7 Pastilles d'état pleines (.pastille-etat) ---------- */
.pastille-etat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  max-width: 100%;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--bord);
  background: rgba(24, 20, 36, .90);
  color: var(--texte);
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.pastille-etat.ok {
  background: var(--bon-fond);
  border-color: var(--bon-bord);
  color: var(--bon);
}

.pastille-etat.attente {
  background: var(--ambre-fond);
  border-color: var(--ambre-bord);
  color: var(--ambre);
}

.pastille-etat.alerte {
  background: var(--mauvais-fond);
  border-color: var(--mauvais-bord);
  border-style: dashed;
  color: var(--mauvais);
}

.pastille-etat.action {
  background: var(--info-fond);
  border-color: var(--info-bord);
  color: var(--info);
}

.pastille-etat.retour {
  background: var(--retour-fond);
  border-color: var(--retour-bord);
  color: var(--retour);
}

.pastille-etat.actif {
  background: linear-gradient(180deg, var(--or-bouton-haut), var(--or-bouton-bas));
  border-color: var(--or-vif);
  color: var(--or-texte-sombre);
  font-weight: 700;
}

.pastille-etat.neutre {
  background: rgba(34, 28, 48, .92);
  border-color: rgba(168, 159, 182, .32);
  color: var(--texte);
}

.pastille-etat.pleine {
  width: 100%;
  padding: 5px 10px;
}

/* Profit sans risque sur les pastilles existantes (Bord et Vaisseau) */
.bord-pieces .badge,
.vaisseau-legende .badge,
.piece-cargo > summary .badge {
  padding: 2px 10px;
  font-weight: 600;
}

.bord-pieces .badge.bon,
.vaisseau-legende .badge.bon,
.piece-cargo > summary .badge.bon {
  background: var(--bon-fond);
  border-color: var(--bon-bord);
  color: var(--bon);
}

.bord-pieces .badge.mauvais,
.vaisseau-legende .badge.mauvais,
.piece-cargo > summary .badge.mauvais {
  background: var(--mauvais-fond);
  border-color: var(--mauvais-bord);
  color: var(--mauvais);
}

/* ==========================================================================
   7. Repli mobile (≤ 600 px / 412 px), paysage bas, mouvement réduit, contrastes
   ========================================================================== */
@media (max-width: 600px) {
  .sous-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .sous-nav::-webkit-scrollbar {
    display: none;
  }

  .sous-nav-choix {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Bannière héros compactée et lisible sans débordement à 412 px */
  .bandeau-hero,
  .bandeau-hero.droite,
  .bandeau-hero.compact {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-end;
    min-height: 176px;
    padding: 16px;
    gap: 12px;
  }

  .bandeau-hero::after,
  .bandeau-hero.droite::after {
    background: linear-gradient(
      180deg,
      rgba(11, 9, 17, .24) 0%,
      rgba(11, 9, 17, .82) 52%,
      rgba(11, 9, 17, .96) 100%
    );
  }

  .bandeau-hero-corps,
  .bandeau-hero.droite .bandeau-hero-corps {
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 12px;
  }

  .bandeau-hero.droite .bandeau-hero-texte {
    align-items: flex-start;
  }

  .medaillon-hero {
    width: 46px;
    height: 46px;
  }

  .bandeau-hero h2 {
    font-size: 1.4rem;
  }

  .bandeau-hero p {
    font-size: .88rem;
  }

  .bandeau-hero-stats {
    flex: 1 1 auto;
    padding: 10px 12px;
  }

  /* Grilles de cartes : 1 colonne, sauf les 4 pièces en 2 × 2 compact */
  .grille-cartes-2,
  .grille-cartes-3,
  .grille-cartes-4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .grille-pieces {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .grille-pieces .carte-illustree-visuel {
    aspect-ratio: 16 / 10;
  }

  .grille-pieces .carte-illustree-corps {
    padding: 8px 10px 10px;
  }

  /* Liste à vignettes : jamais d'écrasement ni de débordement à 412 px */
  .liste-vignettes > li,
  .ligne-vignette {
    flex-wrap: wrap;
    gap: 8px 10px;
  }

  .vignette-mini {
    width: 56px;
    height: 44px;
  }

  .vignette-mini.carree {
    width: 52px;
    height: 52px;
  }

  .vignette-mini.large {
    width: 68px;
    height: 48px;
  }

  .vignette-action {
    margin-left: auto;
    max-width: 100%;
  }

  .vignette-action > button,
  .vignette-action > .bouton,
  .vignette-action > .bouton-sombre,
  .vignette-action > .bouton-or {
    min-height: 44px;
  }

  /* Anneau de progression réduit pour rester équilibré */
  .anneau-prog { --anneau-taille: 88px; }
  .anneau-prog.anneau-petit { --anneau-taille: 68px; }
  .anneau-prog.anneau-grand { --anneau-taille: 100px; }

  .bouton-sombre,
  .bouton-or-contour,
  .bouton-pilule,
  .bouton-or {
    max-width: 100%;
    white-space: normal;
  }
}

/* Paysage bas sur téléphone (hauteur ≤ 500 px) : compacité + cibles ≥ 40 px */
@media (orientation: landscape) and (max-height: 500px) {
  .entete h1::before {
    width: 1.15em;
    height: 1.15em;
  }

  .bandeau-hero,
  .bandeau-hero.compact {
    min-height: 92px;
    padding: 10px 14px;
    margin-bottom: 8px;
    gap: 12px;
  }

  .medaillon-hero {
    width: 38px;
    height: 38px;
  }

  .bandeau-hero h2 {
    font-size: 1.2rem;
  }

  .bandeau-hero p {
    font-size: .82rem;
  }

  .bouton-sombre,
  .bouton-or-contour,
  .bouton-pilule,
  .bouton-or {
    min-height: 40px;
    padding: 6px 12px;
    font-size: .86rem;
  }
}

@media (orientation: landscape) and (max-height: 500px) and (min-width: 601px) {
  .onglets {
    padding: 2px;
  }

  nav.onglets .ic {
    width: 16px;
    height: 16px;
  }
}

/* Mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  .onglets button,
  nav.onglets .ic,
  .sous-nav-choix,
  button,
  .bouton,
  .bouton-or,
  .bouton-sombre,
  .bouton-or-contour,
  .bouton-pilule,
  #son-global,
  .carte-illustree,
  .carte-illustree-visuel img,
  .liste-vignettes.encadree > li,
  .ligne-vignette.encadree,
  .anneau-arc,
  .jauge > i {
    transition: none !important;
  }

  .carte-illustree:hover .carte-illustree-visuel img {
    transform: none;
  }
}

/* Couleurs forcées (Windows High Contrast) */
@media (forced-colors: active) {
  .entete h1 {
    color: CanvasText;
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    filter: none;
  }

  .entete h1::before {
    forced-color-adjust: none;
    background: CanvasText;
  }

  .carte,
  .panneau > article,
  .carte-illustree,
  .bandeau-hero,
  .bandeau-hero-stats,
  .afaire,
  .onglets {
    background: Canvas;
    border-color: CanvasText;
    box-shadow: none;
    backdrop-filter: none;
  }

  .bandeau-hero::after {
    background: none;
  }

  .onglets button[aria-selected="true"],
  .sous-nav-choix[aria-current="page"],
  .bouton-pilule[aria-pressed="true"],
  .bouton-pilule[aria-current="page"],
  .bouton-pilule.actif {
    background: Highlight;
    color: HighlightText;
    border: 2px solid CanvasText;
    box-shadow: none;
    text-decoration: underline;
  }

  button.primaire,
  .bouton.primaire,
  .bouton-or,
  .bouton-sombre,
  .bouton-or-contour,
  .bouton-pilule {
    background: ButtonFace;
    color: ButtonText;
    border-color: ButtonText;
    box-shadow: none;
  }

  .pastille-etat,
  .bord-pieces .badge,
  .vaisseau-legende .badge,
  .piece-cargo > summary .badge {
    background: Canvas;
    color: CanvasText;
    border-color: CanvasText;
  }

  .pastille-etat.alerte {
    border-style: dashed;
  }

  .pastille-etat.actif {
    background: Highlight;
    color: HighlightText;
  }

  .anneau-piste {
    stroke: CanvasText;
    opacity: .35;
  }

  .anneau-arc {
    stroke: Highlight;
    filter: none;
  }

  .jauge {
    border: 1px solid CanvasText;
    background: Canvas;
  }

  .jauge > i {
    forced-color-adjust: none;
    background: Highlight;
    box-shadow: none;
  }
}

/* ---------- Retouches ---------- */
/* Au téléphone, le cadre « À faire » est seul sur son fond : plus de rectangle carré noir derrière ses coins arrondis */
@media (max-width: 600px) {
  .haut-jeu { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; }
}
/* Onglet principal actif : lueur dorée, comme dans les maquettes */
@media (min-width: 601px) {
  .onglets button[aria-selected="true"] {
    color: #fffaf0;
    border-color: rgba(240, 215, 151, .9);
    text-shadow: 0 0 10px rgba(240, 215, 151, .55);
    box-shadow:
      inset 0 -3px 0 var(--or-vif),
      inset 0 0 14px rgba(240, 215, 151, .22),
      0 0 14px rgba(240, 215, 151, .5),
      0 0 34px rgba(212, 169, 87, .32);
  }
  .onglets button[aria-selected="true"] .ic { filter: drop-shadow(0 0 5px rgba(240, 215, 151, .8)); }
}
/* Rangées de sous-onglets qui défilent au téléphone : un dégradé et une flèche au bord droit, qui s'efface en fin de course */
@media (max-width: 600px) {
  @supports (animation-timeline: scroll()) {
    .sous-nav::after, #panneau-carte .sous-onglets::after, #panneau-spatioport .sous-onglets::after, #panneau-marche .sous-onglets::after {
      content: "›";
      position: sticky;
      right: 0;
      flex: none;
      align-self: stretch;
      width: 34px;
      margin-left: -34px;
      display: flex;
      align-items: center;
      justify-content: flex-end;
      padding-right: 8px;
      color: var(--or-clair);
      font-size: 1.4rem;
      background: linear-gradient(90deg, transparent, rgba(11, 9, 17, .96) 70%);
      pointer-events: none;
      opacity: 0;
      animation: indice-defilement 1ms linear both;
      animation-timeline: --defile;
    }
    .sous-nav, #panneau-carte .sous-onglets, #panneau-spatioport .sous-onglets, #panneau-marche .sous-onglets { scroll-timeline: --defile inline; }
    @keyframes indice-defilement { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
  }
}

/* Hiérarchie visuelle boutons : navigation secondaire plus sobre vs action primaire or */
.bouton-sombre {
  background: rgba(22, 18, 34, .65);
  border-color: rgba(255, 255, 255, .18);
  color: var(--texte);
}
.bouton-sombre:hover:not(:disabled) {
  border-color: rgba(212, 169, 87, .55);
  color: var(--or-clair);
}
button:disabled, .bouton-or:disabled, .bouton-sombre:disabled {
  opacity: .42;
  cursor: not-allowed;
  filter: saturate(.35);
  box-shadow: none;
}

/* ==========================================================================
   GABARIT COMMUN aux cinq onglets (d'après maquettes/*.png) — style seulement :
   en-tête massif et doré, onglets larges, boutons or / sombres, cartes à double
   filet, fond sur toute la hauteur.
   ========================================================================== */
:root {
  --or-degrade: linear-gradient(180deg, #f3d98f 0%, #d9ac55 52%, #b07f2f 100%);
  --filet-or: linear-gradient(90deg, transparent, rgba(240, 215, 151, .85) 18%, rgba(212, 169, 87, .9) 50%, rgba(240, 215, 151, .85) 82%, transparent);
  --ic-fleche: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M5 12h13M13 6l6 6-6 6' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  --ic-livre: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M4 5c3-1.5 6-1.5 8 .5 2-2 5-2 8-.5v14c-3-1.5-6-1.5-8 .5-2-2-5-2-8-.5z M12 5.5v14' fill='none' stroke='black' stroke-width='1.9' stroke-linejoin='round'/></svg>");
  --ic-piece: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><circle cx='12' cy='12' r='8.5' fill='none' stroke='black' stroke-width='2'/><path d='M12 7.5v9M9.6 9.6c0-1.3 4.8-1.3 4.8 0s-4.8 1.3-4.8 2.8 4.8 1.5 4.8 0' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round'/></svg>");
  --ic-lieu: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M12 21s6.5-6 6.5-11a6.5 6.5 0 0 0-13 0C5.5 15 12 21 12 21z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/><circle cx='12' cy='10' r='2.3' fill='black'/></svg>");
}

/* ---- Fond : calque fixe qui couvre toute la hauteur (marche aussi au toucher) ---- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 85% 50% at 78% 8%, rgba(164, 92, 48, .22), transparent 62%),
    radial-gradient(ellipse 75% 55% at 14% 24%, rgba(86, 46, 122, .26), transparent 64%),
    linear-gradient(180deg, rgba(11, 9, 17, .55) 0%, rgba(11, 9, 17, .78) 55%, rgba(11, 9, 17, .9) 100%),
    url(/static/art/ecrans/ciel.webp) center / cover no-repeat;
}
body { background: var(--fond-profond); }

/* ---- Pied de page : filet doré et boutons discrets ---- */
.pied {
  position: relative;
  margin-top: 18px;
  padding-top: 18px;
}
.pied::before {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  top: 0;
  height: 1px;
  background: var(--filet-or);
}
.pied button, .pied a {
  background: transparent;
  border-color: rgba(212, 169, 87, .3);
  color: var(--texte-doux);
}
.pied button:hover, .pied a:hover { color: var(--or-clair); border-color: var(--or-vif); }

/* ---- Flèche « → » des boutons de la maquette (le texte ne change pas) ---- */
.avec-fleche::after { content: "\00a0→"; }
.afaire-action::after, .bouton-or-contour.avec-fleche::after { content: "\00a0→"; }

/* ---- « À faire » : cadre doré fin, sans prendre plus de place ---- */
.afaire {
  border-color: rgba(212, 169, 87, .5);
  box-shadow: inset 0 0 0 3px rgba(11, 9, 17, .6), inset 0 0 0 4px rgba(212, 169, 87, .18), 0 6px 18px rgba(0, 0, 0, .45);
}
.afaire.urgent { box-shadow: inset 0 0 0 3px rgba(11, 9, 17, .6), inset 0 0 0 4px rgba(188, 77, 77, .4), 0 6px 18px rgba(0, 0, 0, .45); }

@media (min-width: 601px) {
  /* ---- En-tête massif et doré ---- */
  .entete {
    position: relative;
    background:
      radial-gradient(ellipse 50% 140% at 8% 50%, rgba(212, 169, 87, .22), transparent 70%),
      linear-gradient(180deg, rgba(20, 15, 28, .78), rgba(12, 10, 18, .94)),
      url(/static/art/ecrans/titre.webp) center 35% / cover;
    border-bottom: 1px solid rgba(212, 169, 87, .55);
    box-shadow: inset 0 -4px 0 rgba(11, 9, 17, .9), inset 0 -5px 0 rgba(212, 169, 87, .22), 0 6px 22px rgba(0, 0, 0, .5);
  }
  .entete::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--filet-or);
    pointer-events: none;
  }
  body.en-jeu .entete { padding-top: 6px; padding-bottom: 6px; }
  .en-jeu .entete-in { align-items: center; gap: 8px 16px; padding-top: 6px; padding-bottom: 6px; }
  .en-jeu .entete h1 {
    font-size: 1.85rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    gap: .4em;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .8)) drop-shadow(0 0 14px rgba(212, 169, 87, .3));
  }
  .en-jeu .entete h1::before { width: 1.7em; height: 1.7em; filter: drop-shadow(0 0 6px rgba(240, 215, 151, .55)); }
  .en-jeu .resume { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin: 0 0 0 auto; }
  .en-jeu .resume .puce {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border: 1px solid rgba(212, 169, 87, .5);
    background: linear-gradient(180deg, rgba(36, 28, 52, .9), rgba(16, 13, 24, .94));
    color: var(--texte);
    font-size: .92rem;
    box-shadow: inset 0 1px 0 rgba(255, 238, 190, .1), 0 2px 8px rgba(0, 0, 0, .4);
  }
  .en-jeu .resume .puce::before {
    content: "";
    flex: none;
    width: 17px;
    height: 17px;
    background: var(--or-degrade);
    -webkit-mask: var(--ic-lieu) center / contain no-repeat;
    mask: var(--ic-lieu) center / contain no-repeat;
  }
  .en-jeu .resume .puce.chapitre-puce::before { -webkit-mask-image: var(--ic-livre); mask-image: var(--ic-livre); }
  .en-jeu .resume .puce.chapitre-puce { color: var(--or-vif); }
  .en-jeu .resume .puce:nth-child(2)::before { -webkit-mask-image: var(--ic-piece); mask-image: var(--ic-piece); }
  .en-jeu .resume .puce b { color: var(--or-vif); }
  .en-jeu .entete .commande-son #son-global, .en-jeu .entete .bouton-reglages { border-radius: 50%; border-color: rgba(212, 169, 87, .65); box-shadow: 0 0 10px rgba(212, 169, 87, .18); }

  /* ---- Barre des onglets : dalles larges à icône dorée ---- */
  .onglets {
    gap: 0;
    padding: 3px;
    border: 1px solid rgba(212, 169, 87, .55);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(26, 20, 38, .96), rgba(13, 10, 20, .98));
    box-shadow: inset 0 0 0 3px rgba(11, 9, 17, .7), inset 0 0 0 4px rgba(212, 169, 87, .16), 0 6px 20px rgba(0, 0, 0, .5);
  }
  .onglets button {
    position: relative;
    min-height: 54px;
    gap: 12px;
    border-radius: 9px;
    font-family: var(--police-texte);
    font-size: 1.02rem;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    color: #d6cbb4;
  }
  .onglets button + button::before {
    content: "";
    position: absolute;
    left: 0;
    top: 22%;
    bottom: 22%;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(212, 169, 87, .35), transparent);
  }
  nav.onglets .ic { width: 27px; height: 27px; opacity: 1; color: var(--or); stroke-width: 2.1; filter: drop-shadow(0 0 4px rgba(212, 169, 87, .35)); }
  .onglets button:hover { color: #fff6dc; background: rgba(212, 169, 87, .1); border-color: rgba(212, 169, 87, .3); }
  /* Onglet actif, d'après les maquettes : fond sombre, lavis doré qui s'estompe (plus fort à gauche et en bas),
     filet doré lumineux dessous, libellé clair. (nav.onglets : pour passer devant la feuille Tôle sombre) Le filet et le gras disent « actif » sans la couleur seule. */
  nav.onglets button[aria-selected="true"] {
    color: #fff6dc;
    font-weight: 600;
    border-color: rgba(212, 169, 87, .38);
    background:
      radial-gradient(ellipse 80% 120% at 0% 100%, rgba(212, 169, 87, .46), transparent 75%),
      linear-gradient(90deg, rgba(212, 169, 87, .26), rgba(212, 169, 87, .05) 82%, transparent),
      linear-gradient(180deg, rgba(34, 27, 44, .92), rgba(18, 14, 26, .96));
    box-shadow: inset 0 -3px 0 var(--or-vif), 0 6px 14px -8px rgba(240, 215, 151, .7);
    text-shadow: none;
  }
  nav.onglets button[aria-selected="true"]::before, nav.onglets button[aria-selected="true"] + button::before { display: none; }
  nav.onglets button[aria-selected="true"] .ic { color: var(--or-vif); filter: drop-shadow(0 0 4px rgba(240, 215, 151, .55)); }

  /* ---- Boutons : or plein pour l'action principale, sombres à bord doré sinon ---- */
  button.primaire, .bouton.primaire, .bouton-or {
    background: linear-gradient(180deg, #f1d58b 0%, #d6a751 55%, #b07f2f 100%);
    border-color: #f6e2a4;
    letter-spacing: .01em;
    box-shadow: inset 0 1px 0 rgba(255, 250, 230, .6), 0 2px 10px rgba(212, 169, 87, .3);
  }
  .bouton-sombre, .bouton-or-contour {
    background: linear-gradient(180deg, rgba(34, 27, 48, .9), rgba(16, 13, 24, .95));
    border-color: rgba(212, 169, 87, .6);
    color: var(--or-vif);
  }
  .bouton-sombre:hover:not(:disabled) { border-color: var(--or-vif); color: #fff6dc; box-shadow: 0 0 14px rgba(212, 169, 87, .26); }

  /* ---- Cartes : double filet doré, titres en capitales, séparateur doré, densité serrée ---- */
  .carte:where(:not(.bord-alerte, .syndicat-a-lire, .a-lire)),
  .panneau > article:where(:not(.bord-alerte, .a-faire-ici)) {
    border-color: rgba(212, 169, 87, .55);
    outline: 1px solid rgba(212, 169, 87, .24);
    outline-offset: -5px;
    padding: 14px 16px;
  }
  :is(.carte, .panneau > article) > h2:first-child {
    font-family: var(--police-titre);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .01em;
    text-transform: none;
    color: var(--or-clair);
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 0;
    background: var(--filet-or) left bottom / 100% 1px no-repeat;
  }
  :is(.carte, .panneau > article):not(.carte-bordure) > h2:first-child::before {
    content: "";
    display: inline-block;
    width: .95em;
    height: .95em;
    margin-right: .55em;
    vertical-align: -.1em;
    background: var(--or-degrade);
    -webkit-mask: url(/static/art/icones/embleme-bordure.svg) center / contain no-repeat;
    mask: url(/static/art/icones/embleme-bordure.svg) center / contain no-repeat;
  }
  .panneau > article p:last-child { margin-bottom: 0; }
  :is(.carte-titre-ic, .bloc-tete-ic, .syndicat-section-entete) > h2 {
    font-family: var(--police-titre);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .01em;
    text-transform: none;
    color: var(--or-clair);
  }
  :is(.carte-titre-ic, .bloc-tete-ic) {
    padding-bottom: 8px;
    margin-bottom: 10px;
    background: var(--filet-or) left bottom / 100% 1px no-repeat;
  }
  :is(.carte-titre-ic, .bloc-tete-ic) :is(svg, .ic) { color: var(--or); }

  /* « À faire » : même cadre, même hauteur */
  .afaire { border-radius: 12px; }
}

/* Paysage bas (téléphone couché) : l'en-tête garde la mise en page de telephone.css (une ligne) */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 601px) {
  .en-jeu .entete h1 { font-size: .95rem; letter-spacing: .12em; }
  .en-jeu .entete h1::before { width: 1.3em; height: 1.3em; }
  .en-jeu .resume .puce { padding: 1px 8px; font-size: .76rem; }
  .en-jeu .resume .puce::before { display: none; }
  .onglets button { min-height: 40px; font-size: .9rem; gap: 8px; letter-spacing: .04em; }
  nav.onglets .ic { width: 18px; height: 18px; }
}

/* Paysage bas : tout tient en haut de l'écran — À faire sur une ligne, onglets fins */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 601px) {
  .entete { box-shadow: 0 3px 10px rgba(0, 0, 0, .5); }
  .entete::after { height: 1px; }
  body.en-jeu .entete { padding-top: 0; padding-bottom: 0; }
  .en-jeu .entete-in { padding-top: 3px; padding-bottom: 3px; }
  .entete .volume-global { display: none; }   /* le volume reste dans les Réglages */
  .en-jeu .entete .commande-son { top: 2px; right: 10px; gap: 6px; }
  .en-jeu .entete .commande-son #son-global, .en-jeu .entete .bouton-reglages { width: 40px; height: 40px; }
  .en-jeu .resume { padding-right: 112px; }
  .haut-jeu { padding: 4px 0 2px; gap: 2px; }
  body.en-jeu .haut-jeu .afaire { padding: 0 8px; box-shadow: inset 0 0 0 2px rgba(11, 9, 17, .6), inset 0 0 0 3px rgba(212, 169, 87, .18); }
  .haut-jeu .afaire .afaire-phrase { padding-block: 10px; }
  .afaire-action { min-height: 40px; }
  .onglets { margin: 2px 0 2px; padding: 2px; box-shadow: none; }
  .onglets button { min-height: 40px; padding: 0 8px; }
  .sous-nav { margin: 0 0 2px; min-height: 40px; }
}

/* ---------- Atelier : les plans de Tuwa sur bleu de plan d'ingénieur (dans les deux thèmes) ----------
   De haut en bas : vignettage sombre aux bords, dessin au trait en filigrane (milieu et bas de la carte, derrière le texte),
   quadrillage large et quadrillage fin, grain bleu. Le texte garde son contraste : couleurs plus claires dans la carte
   (--texte-doux, --mauvais) et un léger halo sombre autour des lettres, là où elles croisent un trait du dessin.
   :root:root hausse la priorité : le fond reste bleu quel que soit le thème. */
.plan[data-plan] {
  --texte-doux: #d3d8e2; --mauvais: #ffc4c4;
  text-shadow: 0 0 2px rgba(4, 9, 18, .95), 0 0 5px rgba(4, 9, 18, .9), 0 0 9px rgba(4, 9, 18, .6);
}
/* Les fonds peints (27/11) : un tableau par plan, sujet en bas ; un voile sombre dégradé garde le contraste du texte (≥ 4,5:1). */
.plan[data-plan] { --fond-plan: url(/static/art/atelier/fond_droide.webp); }
:root:root .plan[data-plan] {
  padding: 12px 14px;
  background:
    linear-gradient(180deg, rgba(10, 7, 20, .86) 0%, rgba(10, 7, 20, .78) 55%, rgba(10, 7, 20, .66) 100%),
    var(--fond-plan) center bottom / cover no-repeat,
    #140f22;
}
.plan[data-plan="droide"] { --fond-plan: url(/static/art/atelier/fond_droide.webp); }
.plan[data-plan="faux_codes"] { --fond-plan: url(/static/art/atelier/fond_faux_codes.webp); }
.plan[data-plan="epice_raffinee"] { --fond-plan: url(/static/art/atelier/fond_epice_raffinee.webp); }
.plan[data-plan="hyperdrive_rang2"] { --fond-plan: url(/static/art/atelier/fond_hyperdrive.webp); }
.plan[data-plan="soute_rang2"] { --fond-plan: url(/static/art/atelier/fond_soute.webp); }
.plan[data-plan="blindage_rang2"] { --fond-plan: url(/static/art/atelier/fond_blindage.webp); }
.plan[data-plan="compartiments_rang2"] { --fond-plan: url(/static/art/atelier/fond_compartiments.webp); }
/* Les cartes de tête : l'atelier de nuit, moitié gauche sombre. */
:root:root #panneau-atelier .atelier-tete, :root:root #panneau-atelier .fabrication, :root:root #panneau-atelier .atelier-plans-tete,
:root:root #panneau-atelier .atelier-col > .atelier-liste {
  background: linear-gradient(90deg, rgba(10, 7, 20, .88) 0%, rgba(10, 7, 20, .72) 60%, rgba(10, 7, 20, .55) 100%),
    url(/static/art/atelier/fond_atelier.webp) center / cover no-repeat, #140f22;
}
:root:root .plan[data-plan] .faits .fait { background: linear-gradient(rgba(6, 12, 24, .5), rgba(6, 12, 24, .5)), url(/static/art/habillage/plan-bleu.webp) 0 0 / 256px 256px, #121f33; text-shadow: none; }


/* ==========================================================================
   Menu global à 5 pôles (30/11) : sous-navigation unifiée (#sous-nav) soudée
   sous la barre principale sur PC (même largeur, coins soudés, libellé de pôle).
   Au doigt (≤ 600 px), #sous-nav reste une rangée de pilules en haut.
   ========================================================================== */
.sous-nav-pole {
  display: inline-flex;
  align-items: center;
  padding: 0 6px 0 4px;
  font-family: var(--police-titre-jeu, Georgia, serif);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--or-clair);
  opacity: .85;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .sous-nav-pole { display: none; }
}

@media (min-width: 601px) {
  #vue-jeu:has(> #sous-nav:not([hidden])) .onglets {
    margin-bottom: 0;
    border-radius: 12px 12px 0 0;
    border-bottom-color: rgba(212, 169, 87, .26);
  }

  #contenu #vue-jeu > #sous-nav#sous-nav:not([hidden]) {   /* plus fine le 01/12 (5 px au lieu de 8, 8 px dessous au lieu de 14) : la carte regagne 12 px, sur tous les écrans */
    max-width: none;
    width: 100%;
    margin: 0 0 8px;
    padding: 5px 14px;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(212, 169, 87, .42);
    border-top: 0;
    border-radius: 0 0 12px 12px;
    background: var(--fond-champ, #110e18);
    box-shadow: inset 0 1px 0 rgba(212, 169, 87, .12), 0 8px 20px rgba(0, 0, 0, .38);
  }

  .sous-nav-choix {
    min-height: 32px;
    padding: 4px 14px;
    font-size: .82rem;
    letter-spacing: .01em;
  }

  .sous-nav .chip {
    padding: 0 7px;
    font-size: .7rem;
  }
}

@media (orientation: landscape) and (max-height: 500px) and (min-width: 601px) {
  #contenu #vue-jeu > #sous-nav#sous-nav:not([hidden]) {
    margin: 0 0 4px;
    padding: 4px 10px;
    box-shadow: none;
  }
}

@media (min-width: 601px) and (pointer: coarse) {
  .sous-nav-choix {
    min-height: 40px;
  }
}

/* Peintures des vaisseaux par espèce et par sorte (rendus 480 x 324 sur un décor, art/cartes/vaisseau_*.webp) dans les cadres
   d'abord prévus pour le cargo détouré : elles remplissent le cadre sans se déformer. */
img.medaillon-hero.peinture-vaisseau { object-fit: cover; }
.vaisseau-tete img.peinture-vaisseau { border-radius: 8px; filter: none; }

/* ---------- Atelier resserré (27/11) : vignettes plus petites, cartes moins hautes, grille plus dense sur PC ---------- */
#panneau-atelier .plan-img { width: 68px; height: 46px; border-radius: 6px; }
#panneau-atelier .plan .bloc-ic-img { width: 30px; height: 30px; padding: 1px; }   /* l'ancien « .plan img { width: 100% } » étirait la vignette des pièces en bandeau */
#panneau-atelier .plan .vaisseau-tete { gap: 10px; margin-bottom: 6px; }
#panneau-atelier .plan .bloc-tete-ic { gap: 8px; margin-bottom: 4px; }
#panneau-atelier .plan h3 { font-size: 1.02rem; }
#panneau-atelier .atelier-tete .vaisseau-tete .jeton { width: 44px; height: 44px; }
#panneau-atelier .atelier-tete .vaisseau-tete { gap: 10px; margin-bottom: 6px; }
#panneau-atelier .bloc-tete-ic { gap: 8px; margin-bottom: 4px; }
#panneau-atelier .bloc-ic-img { width: 26px; height: 26px; border-radius: 6px; padding: 1px; }
#panneau-atelier .atelier-col { gap: 8px; }
#panneau-atelier .atelier-haut { gap: 10px; margin-bottom: 10px; }
#panneau-atelier .atelier-col > article { padding: 10px 12px; }

:root:root #panneau-atelier .plan[data-plan] { padding: 8px 10px; font-size: .92rem; }
#panneau-atelier .plan .faits { gap: 5px; margin: 4px 0; }
#panneau-atelier .plan .fait { flex: 1 1 60px; padding: 3px 7px; }
#panneau-atelier .plan .fait small { font-size: .72rem; }
#panneau-atelier .plan .fait b { font-size: .9rem; }
#panneau-atelier .plan .matieres, #panneau-atelier .plan .gains { margin: 4px 0; gap: 2px; }
#panneau-atelier .plan p { margin-block: 4px; }
#panneau-atelier .plan ul { margin-block: 4px; padding-left: 1.1rem; }
#panneau-atelier .plan .matieres, #panneau-atelier .plan .gains { padding-left: 0; }
#panneau-atelier .plan .rangee { margin-top: 8px; }
#panneau-atelier .plan .rangee button, #panneau-atelier .plan > button { min-height: 40px; padding: 6px 12px; }
#panneau-atelier .plan > button { margin-top: 6px; }
@media (max-width: 600px) {
  #panneau-atelier .plan-img { width: 56px; height: 38px; }
  #panneau-atelier .plan .bloc-ic-img { width: 26px; height: 26px; }
  :root:root #panneau-atelier .plan[data-plan] { padding: 8px; }
  #panneau-atelier .plan .aide { font-size: .84rem; }
}

#panneau-atelier .atelier-stock { display: flex; gap: 10px; align-items: center; }
#panneau-atelier .atelier-stock .plan-img { float: none; }
#panneau-atelier .atelier-stock p { margin: 0; flex: 1 1 auto; }

/* Les plans en liste (27/11) : une ligne par plan (vignette, nom, tuiles, état, bouton), le détail replié dessous. Le fond peint reste derrière, sous un voile. */
#panneau-atelier .atelier-plans-grille { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
:root:root #panneau-atelier .atelier-plans-grille .plan[data-plan] {
  margin: 0; padding: 8px 12px; font-size: .95rem;
  background:
    linear-gradient(90deg, rgba(10, 7, 20, .9) 0%, rgba(10, 7, 20, .82) 55%, rgba(10, 7, 20, .74) 100%),
    var(--fond-plan) center 85% / cover no-repeat, #140f22;
}
#panneau-atelier .plan > * { margin: 0; min-width: 0; }
#panneau-atelier .plan-ligne { display: grid; grid-template-columns: 72px minmax(150px, 1.1fr) minmax(250px, 1.2fr) minmax(130px, .8fr) minmax(170px, auto); gap: 6px 14px; align-items: center; }
#panneau-atelier .plan-ligne .plan-img { width: 72px; height: 48px; border-radius: 6px; object-fit: cover; }
#panneau-atelier .plan-nom { margin: 0; font-size: 1.02rem; line-height: 1.25; }
#panneau-atelier .plan-nom .badge { display: inline-block; vertical-align: middle; padding: 1px 8px; font-size: .74rem; white-space: nowrap; }
#panneau-atelier .plan .faits { margin: 0; flex-wrap: nowrap; }
#panneau-atelier .plan .fait { flex: 1 1 0; white-space: nowrap; padding: 2px 7px; }
#panneau-atelier .plan .fait b { white-space: nowrap; font-size: .88rem; }
#panneau-atelier .plan-etat { margin: 0; font-weight: 600; font-size: .9rem; }
#panneau-atelier .plan-etat.ok { color: #7fd69c; }
#panneau-atelier .plan-etat.manque { color: #ff9f8a; }   /* rouge brique clair : 4,5:1 au moins sur le voile */
#panneau-atelier .plan-action button { width: 100%; max-width: 100%; white-space: normal; min-height: 40px; padding: 6px 12px; }
#panneau-atelier .plan > .aide { margin: 4px 0 0; }
#panneau-atelier .plan-detail { margin-top: 4px; border-top: 1px solid rgba(212, 169, 87, .25); }
#panneau-atelier .plan-detail > summary { cursor: pointer; padding: 6px 0; min-height: 36px; display: flex; align-items: center; color: var(--or-clair); font-size: .9rem; }
#panneau-atelier .plan-detail > summary:focus-visible { outline: 2px solid var(--or-clair); outline-offset: 2px; }
#panneau-atelier .plan-corps { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 6px; max-width: 70ch; }
#panneau-atelier .plan-corps > * { margin: 0; }
@media (max-width: 900px) {
  #panneau-atelier .plan-ligne { grid-template-columns: 72px minmax(0, 1fr); }
  #panneau-atelier .plan-ligne .faits { grid-column: 1 / -1; }
  #panneau-atelier .plan-etat { grid-column: 1 / -1; }
  #panneau-atelier .plan-action { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  #panneau-atelier .plan-ligne .plan-img { width: 60px; height: 40px; }
  #panneau-atelier .plan-ligne { grid-template-columns: 60px minmax(0, 1fr); }
}

/* Survol d'une fiche de plan (27/11, demande de Gégé) : la vignette grossit pour qu'on lise le dessin.
   La carte laisse dépasser la vignette agrandie ; le fond peint garde ses coins arrondis. */
@media (hover: hover) and (pointer: fine) {
  #panneau-atelier .plan[data-plan] { overflow: visible; }
  #panneau-atelier .plan-ligne .plan-img { position: relative; transform-origin: left center; transition: transform .18s ease, box-shadow .18s ease; }
  #panneau-atelier .plan-ligne .plan-img:hover { transform: scale(3.2); z-index: 20; box-shadow: 0 10px 28px rgba(0, 0, 0, .7); }
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: reduce) {
  #panneau-atelier .plan-ligne .plan-img { transition: none; }
}
