:root {
  color-scheme: dark;
  --fond: #0d0b12;
  --fond-carte: #181420;
  --fond-champ: #110e18;
  --bord: #3a3148;
  --or: #c9a45c;
  --or-clair: #e8cf94;
  --texte: #ece6f2;
  --texte-doux: #a79fb4;
  --bon: #6fcf97;
  --mauvais: #ef7b7b;
  --rouge: #c85a5a;
  --focus: #f0d28a;   /* liseré doré, 3 px (accessibilité au clavier) */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: var(--haut-jeu, 12rem); }
/* À la souris (PC), la place de la barre de défilement est toujours gardée : la page ne se décale pas de 15 px entre un écran court (la
   Carte) et un écran long (retour n° 38). Au doigt (téléphone, tablette), la barre se pose par-dessus la page : rien à garder. */
@media (hover: hover) and (pointer: fine) { html { scrollbar-gutter: stable; } }
body {
  margin: 0; background: var(--fond); color: var(--texte);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(rgba(13, 11, 18, .72), rgba(13, 11, 18, .94) 60%), url(/static/art/ecrans/ciel.webp) center top / cover fixed, var(--fond);
  min-height: 100vh;
}
h1, h2, h3 { font-family: Georgia, "Times New Roman", serif; font-weight: 600; letter-spacing: .02em; margin: 0 0 .4em; }
h1 { color: var(--or-clair); font-size: 1.6rem; }
h2 { font-size: 1.25rem; color: var(--or-clair); }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .6em; }
a { color: var(--or-clair); }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
:where(h1, h2, h3, h4, h5, h6, article, section, p)[tabindex="-1"]:focus { outline: none; }
:where(html.clavier) :where(h1, h2, h3, h4, h5, h6, article, section, p)[tabindex="-1"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-seul { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.evitement { position: absolute; left: 8px; top: -60px; background: var(--or); color: #000; padding: 8px 12px; z-index: 100; }
.evitement:focus { top: 8px; }

.entete {
  background: linear-gradient(rgba(13, 11, 18, .25), var(--fond)), url(/static/art/ecrans/titre.webp) center 35% / cover;
  border-bottom: 1px solid var(--or); margin-bottom: 8px; position: relative; padding-top: env(safe-area-inset-top, 0px);
}
.entete-in { max-width: 760px; margin: 0 auto; padding: 14px 16px 12px; }
.entete h1 {
  font-size: clamp(1.8rem, 6vw, 2.6rem); letter-spacing: .12em; text-transform: uppercase; margin: 0;
  background: linear-gradient(#f6e2ae, #b8903f); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 6px #000);
}
.resume { color: var(--texte); margin: 4px 0 0; font-size: .95rem; text-shadow: 0 1px 4px #000; }
main { max-width: 760px; margin: 0 auto; padding: 0 16px 40px; outline: none; }
main:focus-visible { outline: none; }   /* le focus y est posé par le jeu (après la création), pas au clavier */

.carte, .panneau > article {
  background: var(--fond-carte); border: 1px solid var(--bord); border-radius: 10px;
  padding: 16px; margin-bottom: 12px;
}
.aide { color: var(--texte-doux); font-size: .9rem; }
.erreur { color: var(--mauvais); min-height: 1.5em; margin-top: 8px; }

label { display: block; margin: 12px 0 4px; }
input, select, textarea {
  width: 100%; padding: 12px; font: inherit; color: var(--texte);
  background: var(--fond-champ); border: 1px solid #7d7392; border-radius: 8px; min-height: 44px;   /* 3:1 : le bord du champ se voit */
}
.rangee { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
button, .bouton {
  font: inherit; min-height: 44px; padding: 10px 16px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--or); color: var(--texte); background: transparent; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
button.primaire { background: linear-gradient(#d8b66e, #a98440); color: #1a1208; font-weight: 600; }
button:disabled { opacity: .5; cursor: not-allowed; }
.bouton { margin-top: 12px; }

.onglets { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; margin: 8px 0 14px; }
.onglets button { padding: 10px 2px; font-size: .95rem; border-color: var(--bord); }
.onglets button[aria-selected="true"] { border-color: var(--or); color: var(--or-clair); background: #241d30; box-shadow: inset 0 -3px 0 var(--or); }

.grille { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pastille { border: 1px solid var(--bord); border-radius: 8px; padding: 8px 10px; background: var(--fond-champ); }
.pastille small { display: block; color: var(--texte-doux); }
.valeur { font-size: 1.4rem; color: var(--or-clair); font-family: Georgia, serif; }
.dette { color: var(--mauvais); }
.tableau { width: 100%; border-collapse: collapse; }
.tableau th, .tableau td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--bord); }
.tableau td.num, .tableau th.num { text-align: right; }
.ligne-action { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin-top: 10px; }
.ligne-action > div { flex: 1 1 110px; }
.badge { display: inline-block; padding: 0 8px; border-radius: 99px; border: 1px solid var(--bord); font-size: .85rem; }
.bon { color: var(--bon); } .mauvais { color: var(--mauvais); }
.compte { font-variant-numeric: tabular-nums; font-size: 1.3rem; color: var(--or-clair); }

.message {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); max-width: calc(100% - 32px);
  background: #2a2236; border: 1px solid var(--or); border-radius: 8px; padding: 10px 16px; z-index: 50;
}
.message:empty { display: none; }
.message.erreur-msg { border-color: var(--mauvais); }

/* ---- Écran de résolution (le dé à 20 faces, comme dans Baldur's Gate 3) ---- */
.resolution {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-start; justify-content: center;
  padding: calc(24px + env(safe-area-inset-top, 0px)) 16px 24px; overflow-y: auto; background: #050409;
}
.res-boite { position: relative; width: min(100%, 34rem); margin: auto; padding-top: 44px; text-align: center; }   /* le cadre est celui du jet (jet.css) */
.res-son { position: absolute; top: 0; right: 0; min-height: 44px; min-width: 44px; padding: 4px; border-color: var(--bord); }
.res-retour { position: absolute; top: 0; left: 0; }   /* avant le lancer : sortir sans lancer ; « Continuer » prend le relais après */
.res-tire { margin: 0 0 8px; }   /* course, embuscade, marchandage : pas de « Retour » avant le dé, la raison est écrite */
.res-son svg { display: block; margin: auto; }
.res-son[aria-pressed="true"] .son-off, .res-son[aria-pressed="false"] .son-on { display: none; }
/* Le bouton du son : rond, discret, dans l'en-tête sur la ligne du titre ; dans un plein écran (intro, dé, décollage) il flotte en haut à droite. */
.commande-son { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 4px); right: max(12px, env(safe-area-inset-right), calc((100% - 760px) / 2 + 16px)); z-index: 80; display: flex; align-items: center; gap: 8px; }   /* aligné sur le titre */
.volume-global { width: 78px; height: 22px; margin: 0; accent-color: var(--or-clair); cursor: pointer; opacity: .88; }
.volume-global:hover, .volume-global:focus-visible { opacity: 1; }
@media (max-width: 600px) { .volume-global { width: 54px; } }
.zone-decollage .commande-son { right: auto; left: max(12px, env(safe-area-inset-left)); }   /* « Passer » occupe le coin droit */
#son-global { width: 44px; height: 44px; min-width: 44px; padding: 0; border-radius: 50%; border-color: rgba(201, 164, 92, .55); background: rgba(13, 11, 18, .6); color: var(--or-clair); }
#son-global[aria-pressed="true"] .son-off, #son-global[aria-pressed="false"] .son-on { display: none; }
@media (forced-colors: active) {
  #son-global { background: ButtonFace; color: ButtonText; border-color: ButtonText; }
  #son-global:focus-visible { outline-color: Highlight; }
}
.res-pied { text-align: center; }
.res-suite { display: none; margin: 0 0 6px; font-size: .84rem; color: var(--or-clair); }
#res-fermer { margin-top: 12px; }
@media (max-width: 600px), (max-height: 700px) {
  .resolution { padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 0; }
  .res-boite { padding-bottom: 16px; }
  .res-pied {
    position: sticky; bottom: 0; z-index: 4;
    margin: 12px -12px -16px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
    background: #050409; border-top: 1px solid var(--bord); box-shadow: 0 -10px 24px rgba(5, 4, 9, .92);
  }
  .res-pied:has(#res-fermer[hidden]) { display: none; }
  .res-suite:not([hidden]) { display: block; }
  #res-fermer { margin-top: 0; width: 100%; max-width: 20rem; }
}

/* Les avantages à dépenser (le bloc est indépendant du rendu du dé) */
.res-avantages { text-align: left; margin: 4px 0 14px; scroll-margin-top: 12px; scroll-margin-bottom: 96px; }   /* le titre reste visible, ni coupé en haut ni sous le pied collant */
.res-avantages h3 { margin: 0 0 8px; font-size: 1.05rem; text-align: center; }
.res-avantages fieldset { margin: 10px 0 0; min-width: 0; }
.res-avantages legend { padding: 0; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--texte-doux); }
.res-avantages label.choix {
  display: flex; gap: 10px; align-items: flex-start; min-height: 44px; margin-top: 6px; padding: 8px 10px;
  border: 1px solid var(--bord); border-radius: 10px; background: var(--fond-champ); cursor: pointer;
}
.res-avantages label.choix:has(input:checked) { border-color: var(--or-clair); background: #221a2e; }
.res-avantages label.choix:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.res-avantages input[type="radio"] { margin: 3px 0 0; width: 20px; height: 20px; flex: none; accent-color: var(--or); }
.res-avantages label.choix b { display: block; }
.res-avantages label.choix small { display: block; color: var(--texte-doux); }
.res-avantages .aide, .res-avantages .erreur { text-align: center; }
.res-avantages .depense { text-align: center; color: var(--or-clair); margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .de, .res-bonus li { transition: none; transform: none; }
  .res-verdict, .pop { animation: none; }
}
@media (max-width: 420px) {
  .onglets button { font-size: .82rem; }
}

/* ---- Plateau : carte de la Bordure, fiche du système, équipage ---- */
.plateau-carte {
  position: relative; aspect-ratio: 1 / 1; width: min(100%, 82vh, 920px); margin-inline: auto; margin-bottom: 12px;
  overflow: hidden; border-radius: 14px; border: 1px solid var(--or);
  box-shadow: 0 0 0 3px #120e1a, 0 0 0 4px #5e4a26, 0 10px 30px rgba(0, 0, 0, .5);
  background: #0d0b12;
}
.fond-galaxie {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none;
  opacity: clamp(.3, calc(1.1 - var(--zoom, 1) * .08), 1); transition: opacity .3s ease-out;
}
.fond-proche { position: absolute; pointer-events: none; opacity: clamp(0, calc((var(--zoom, 1) - 2) * .35), .9); transition: opacity .3s ease-out; }
.carte-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.carte-svg .grille line { stroke: var(--or-clair); stroke-width: .05; opacity: .12; }
.anneau { fill: none; stroke: var(--or-clair); stroke-width: .18; stroke-dasharray: .8 .8; opacity: .22; }
.anneau.bord { opacity: .35; }
.zone-galaxie { fill: var(--zone-c, #c9a45c); fill-opacity: .075; stroke: var(--zone-c, #c9a45c); stroke-opacity: .34; stroke-width: .22; stroke-dasharray: 1.4 1.1; stroke-linejoin: round; stroke-linecap: round; }
.voie-galaxie { fill: none; stroke: #cfc8da; stroke-width: .16; stroke-dasharray: 1.2 .8; stroke-linejoin: round; stroke-linecap: round; opacity: .28; }
.etoile { fill: #fff; opacity: .35; }
.etoile.scint { animation: scintille 4s ease-in-out infinite alternate; }
@keyframes scintille { from { opacity: .15; } to { opacity: .9; } }
.route { stroke: rgba(201, 164, 92, .45); stroke-width: .35; stroke-dasharray: 1.4 1.6; animation: flux 6s linear infinite; }
@keyframes flux { to { stroke-dashoffset: -3; } }
@keyframes flux-trajet { to { stroke-dashoffset: -2.7; } }
.noeud {   /* au-dessus des vaisseaux des autres : leur orbite passe derrière le nom du monde */
  position: absolute; z-index: 3; transform: translate(-50%, -50%) scale(calc(1 / var(--zoom, 1))); min-height: 44px; min-width: 44px; padding: 0; border: 0; background: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--texte);
}
.planete {
  --t: 200; width: clamp(34px, 8vw, 60px); aspect-ratio: 1; border-radius: 50%; position: relative;
  background: center / cover radial-gradient(circle at 32% 30%, hsl(var(--t) 70% 70%), hsl(var(--t) 55% 32%) 55%, hsl(var(--t) 50% 10%));
  background-color: hsl(var(--t) 50% 24%);   /* le décor peint couvre tout ; s'il manque encore, un disque de couleur plutôt qu'un trou noir (lot 6) */
  border: 2px solid var(--or);
  box-shadow: 0 0 14px hsl(var(--t) 70% 50% / .6);
}
.planete::after {   /* anneau qui pulse */
  content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid hsl(var(--t) 70% 70% / .7);
  animation: pulse 3.2s ease-out infinite;
}
@keyframes pulse { from { transform: scale(.85); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }
.noeud.port .planete { box-shadow: 0 0 18px #f0c060, 0 0 0 2px rgba(240, 192, 96, .6); }
.noeud.choisi .planete { outline: 2px dashed var(--or-clair); outline-offset: 4px; }   /* le monde choisi : cercle pointillé */
@property --dx { syntax: "<length>"; inherits: true; initial-value: 0px; }
@property --dy { syntax: "<length>"; inherits: true; initial-value: 0px; }
.nom-noeud { transition: opacity .18s, --dx .18s ease-out, --dy .18s ease-out; font-size: clamp(.75rem, 2.2vw, .85rem); text-shadow: 0 1px 4px #000, 0 0 8px #000; white-space: nowrap; transform: translate(var(--dx, 0px), var(--dy, 0px)); }   /* 12 px au moins : lisible à 390 px ; --dx/--dy gardent le nom dans le cadre */
.vaisseau {
  --cap: 0deg; position: absolute; width: 24px; height: 24px; z-index: 3; pointer-events: none;
  transform: translate(-50%, -50%) rotate(var(--cap)) scale(calc(1 / var(--zoom, 1))); transition: left 1s linear, top 1s linear;
}
.coque {   /* icones/ton-vaisseau.svg, proue en haut comme les autres icônes : le cap seul la tourne */
  display: block; width: 100%; height: 100%;
  filter: drop-shadow(0 0 1.5px #000) drop-shadow(0 1px 2px #000) drop-shadow(0 0 3.5px rgba(255, 220, 140, .95)) drop-shadow(0 0 7px rgba(201, 164, 92, .55));
}
.vaisseau.vole::after {   /* sillage du moteur */
  content: ""; position: absolute; left: 50%; top: 80%; width: 4px; height: 18px; transform: translateX(-50%);
  background: linear-gradient(#ffb347, transparent); filter: blur(1px); animation: moteur .25s ease-in-out infinite alternate;
}
@keyframes moteur { from { opacity: .5; height: 12px; } to { opacity: 1; height: 20px; } }
.vaisseau:not(.vole) { animation: flotte 3s ease-in-out infinite alternate; }
@keyframes flotte { from { margin-top: -1px; } to { margin-top: 2px; } }

.mission-ligne { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--bord); }
.mission-ligne > div { flex: 1 1 auto; }
.mission-ligne p { margin: 0; }
.capitaine { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.jeton { flex: none; border-radius: 50%; border: 2px solid var(--or); object-fit: cover; }
.bandeau { display: block; width: 100%; aspect-ratio: 3 / 1; object-fit: cover; border-radius: 8px; margin-bottom: 10px; }
.plan { position: relative; border: 1px solid var(--or); border-radius: 8px; overflow: hidden; }
.plan img { display: block; width: 100%; }
.pin {
  position: absolute; transform: translate(-50%, -50%); min-width: 44px; min-height: 44px; border-radius: 50%;
  border: 2px solid #fff; background: rgba(150, 40, 30, .9); color: #fff; font-weight: 700; box-shadow: 0 2px 8px #000;
}
.pin:hover, .pin:focus-visible { background: #c0392b; outline: 2px solid var(--or-clair); }
.compagnons { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.compagnons figure { margin: 0; text-align: center; font-size: .75rem; color: var(--texte-doux); }
.compagnons figcaption { margin-top: 2px; }
.equipage h4 { margin: 14px 0 6px; color: var(--or-clair); font-family: Georgia, serif; font-size: .95rem; letter-spacing: .04em; }
.caracs, .competences, .talents { list-style: none; margin: 0; padding: 0; }
.caracs { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 4px 24px; }
.caracs li, .competences li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 3px 0; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 11px; height: 11px; border-radius: 3px; border: 1px solid var(--bord); background: transparent; }
.pips i.plein { background: linear-gradient(#e8cf94, #a98440); border-color: var(--or); }
.des-ico { display: inline-flex; gap: 2px; }
.talents li { padding: 4px 0; border-bottom: 1px dotted var(--bord); }

@media (prefers-reduced-motion: reduce) {
  .etoile.scint, .route, .planete::after, .vaisseau.vole::after, .vaisseau:not(.vole) { animation: none; }
  .vaisseau { transition: none; }
}
@media (max-width: 330px) { .onglets { grid-template-columns: repeat(2, 1fr); } }
.sous-titre { margin: 12px 0 4px; color: var(--or-clair); font-family: Georgia, serif; font-size: .95rem; }

.guide { margin-bottom: 12px; padding: 12px 14px; border: 1px solid var(--or); border-radius: 10px; background: var(--fond-carte); }
.guide summary { cursor: pointer; color: var(--or-clair); font-family: Georgia, serif; font-size: 1.05rem; min-height: 44px; padding: 10px 0; box-sizing: border-box; }
.guide ol { margin: 8px 0; padding-left: 22px; } .guide li { margin: 4px 0; }
.guide .etape { padding: 8px 10px; border-left: 3px solid var(--or-clair); background: rgba(201, 164, 92, .12); font-weight: 600; }
.jauge { height: 10px; border-radius: 5px; background: #2a2236; overflow: hidden; margin: 6px 0; }
.jauge i { display: block; height: 100%; background: linear-gradient(90deg, #a98440, #e8cf94); }

/* ---- Habillage des pages ---- */
.bandeau-page { position: relative; margin: 0 0 12px; border-radius: 12px; overflow: hidden; border: 1px solid var(--or); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.bandeau-page img { display: block; width: 100%; aspect-ratio: 16 / 5; object-fit: cover; }
.bandeau-page figcaption { position: absolute; inset: auto 0 0 0; padding: 28px 16px 12px; background: linear-gradient(transparent, rgba(8, 6, 12, .92)); }
.bandeau-page h2 { margin: 0; font-size: 1.5rem; text-shadow: 0 2px 6px #000; }
.bandeau-page p { margin: 2px 0 0; color: var(--texte); text-shadow: 0 1px 4px #000; }
.panneau > article { background: linear-gradient(rgba(24, 20, 32, .96), rgba(18, 14, 24, .96)); box-shadow: 0 4px 16px rgba(0, 0, 0, .35); }
.mission-carte { display: flex; gap: 14px; align-items: flex-start; }
.mission-carte .vignette { flex: none; width: clamp(80px, 24vw, 150px); aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 1px solid var(--or); }
.mission-carte > div { flex: 1 1 auto; min-width: 0; }
.rapport { border-left: 4px solid var(--bord); } .rapport.ok { border-left-color: var(--bon); } .rapport.ko { border-left-color: var(--mauvais); }
.pied { max-width: 760px; margin: 0 auto; padding: 8px 16px 32px; text-align: center; }
.pied button { min-height: 44px; font-size: .85rem; border-color: var(--bord); margin: 0 6px; }   /* 12 px entre deux boutons : pas de déconnexion au lieu de l'intro */
.formulaire-compte { text-align: left; margin-top: 12px; }
.lien-retour { display: inline-flex; align-items: center; min-height: 44px; padding: 8px; overflow-wrap: anywhere; }
#formulaire-retour { overflow-wrap: anywhere; }
#formulaire-retour fieldset { min-width: 0; }
#formulaire-retour .choix { min-height: 44px; }
#formulaire-retour textarea { resize: vertical; max-width: 100%; }
#formulaire-retour a { display: inline-block; min-height: 44px; padding-block: 8px; }
#aide-mot-de-passe { margin-top: 12px; overflow-wrap: anywhere; }
#aide-mot-de-passe a { display: inline-block; min-height: 44px; padding-block: 10px; }
@media (forced-colors: active) {
  .entete h1 { color: CanvasText; background: none; filter: none; }
  button.primaire { color: ButtonText; background: ButtonFace; }
  :focus-visible, :where(html.clavier) :where(h1, h2, h3, h4, h5, h6, article, section, p)[tabindex="-1"]:focus-visible { outline-color: Highlight; }
}
#vue-connexion { background: linear-gradient(rgba(13, 11, 18, .7), rgba(13, 11, 18, .92)), url(/static/art/ecrans/titre.webp) center / cover; border-color: var(--or); }

/* ---- Introduction cinématique ---- */
.accueil { position: fixed; inset: 0; z-index: 60; background: #000; overflow: hidden; }
.accueil::before, .accueil::after { content: ""; position: absolute; left: 0; right: 0; height: 9vh; background: #000; z-index: 3; }
.accueil::before { top: 0; } .accueil::after { bottom: 0; }
.scenes, .scene { position: absolute; inset: 0; }
.scene { opacity: 0; transition: opacity 1.6s ease; display: flex; align-items: flex-end; justify-content: center; }
.scene.actif { opacity: 1; }
.scene img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scene.actif img { animation: panoramique 9s ease-out forwards; }
.scene:nth-child(even).actif img { animation-name: panoramique-inverse; }
@keyframes panoramique { from { transform: scale(1.02) translate(0, 0); } to { transform: scale(1.16) translate(-2%, -1%); } }
@keyframes panoramique-inverse { from { transform: scale(1.16) translate(2%, 1%); } to { transform: scale(1.02) translate(0, 0); } }
.scene::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 40%, transparent 40%, rgba(0, 0, 0, .65)), linear-gradient(transparent 55%, rgba(0, 0, 0, .85)); }
.legende {
  position: relative; z-index: 2; max-width: 34ch; margin: 0 16px max(16vh, calc(9vh + 72px)); text-align: center; font: italic clamp(1.15rem, 3.6vw, 1.8rem) / 1.45 Georgia, serif;
  color: #f3e7c8; text-shadow: 0 2px 10px #000, 0 0 24px #000; opacity: 0;
}
.scene.actif .legende { animation: apparition 2s ease 1s forwards; }
@keyframes apparition { to { opacity: 1; } }
.titre-jeu { position: relative; z-index: 4; text-align: center; margin-bottom: 12vh; padding: 0 16px; opacity: 0; }
.legende-finale { max-width: 34ch; margin: 0 auto 18px; font: italic clamp(1.1rem, 3.4vw, 1.6rem) / 1.45 Georgia, serif; color: #f3e7c8; text-shadow: 0 2px 10px #000, 0 0 24px #000; }
.scene-titre.actif .titre-jeu { animation: apparition 2.2s ease .6s forwards; }
.scene-titre { z-index: 4; }
.titre-jeu h2 {
  margin: 0 0 14px; font-size: clamp(2.2rem, 10vw, 5rem); letter-spacing: .14em; text-transform: uppercase;
  background: linear-gradient(#fff2c6, #c8963c); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 14px #000);
}
.sur-titre { margin: 0; letter-spacing: .3em; text-transform: uppercase; font-size: clamp(.7rem, 2.4vw, 1rem); color: #f3e7c8; text-shadow: 0 2px 8px #000; }
button.grand { min-height: 52px; padding: 12px 28px; font-size: 1.1rem; }
.accueil-pied { position: absolute; z-index: 5; right: 16px; bottom: calc(9vh + 10px); display: flex; gap: 8px; }
.accueil-pied button { background: rgba(0, 0, 0, .6); }
#accueil-son svg { display: block; }   /* l'icône du son : une seule des deux lignes, selon aria-pressed */
#accueil-son[aria-pressed="true"] .son-off, #accueil-son[aria-pressed="false"] .son-on { display: none; }
@media (prefers-reduced-motion: reduce) {
  .scene { transition: none; }
  .scene.actif .legende, .scene-titre.actif .titre-jeu { animation: none; opacity: 1; }
  .scene.actif img { animation: none; }
}

/* Horloge d'essai (jeu local seulement) */
.barre-essai { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center;
  padding: 8px 16px; background: var(--fond); border-top: 2px dashed var(--bord); font-size: .85rem; }
.barre-essai button { min-height: 44px; min-width: 44px; }
.avec-barre-essai { padding-bottom: 110px; }

/* ---- Lot 5 : compte, équipage, en-tête, Spatioport, vaisseau ---- */
button.lien { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--or-clair); text-decoration: underline; }
.bascule { margin-top: 14px; }
.rangee > button.grand { flex: 1 1 100%; }
fieldset { border: 0; margin: 14px 0 0; padding: 0; }
legend { padding: 0; margin-bottom: 6px; }
label.choix { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 8px; padding: 10px 12px; border: 1px solid var(--bord); border-radius: 10px; background: var(--fond-champ); }
.choix input { width: 22px; height: 22px; min-height: 0; margin: 3px 0 0; flex: none; accent-color: var(--or); }
.choix:has(input:checked) { border-color: var(--or); background: #241d30; }
.choix.ferme { border-style: dashed; }   /* sans opacité : la description reste lisible */
.bonjour { border-left: 4px solid var(--bon); padding: 8px 12px; background: rgba(111, 207, 151, .1); margin: 0 0 12px; border-radius: 0 8px 8px 0; }
/* Une note du lieu n'est pas une réussite : cadre sombre à filet doré, comme sur les maquettes. Le vert reste aux actions réussies. */
.bonjour.note { border: 1px solid rgba(201, 164, 92, .34); border-left: 1px solid rgba(201, 164, 92, .34); border-radius: 8px; background: rgba(201, 164, 92, .05); color: var(--texte, inherit); }
.bonjour.pas-branche { border-left-color: var(--or-clair); background: rgba(201, 164, 92, .1); }   /* un échec : pas le vert d'une réussite */

.en-jeu .entete-in { padding-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.en-jeu .entete h1 { font-size: 1.25rem; margin-right: auto; }
.resume { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { border: 1px solid var(--bord); border-radius: 99px; padding: 2px 12px; background: rgba(17, 14, 24, .85); font-size: .9rem; }
.puce b { color: var(--or-clair); font-variant-numeric: tabular-nums; }
.puce.dette b { color: var(--mauvais); }

.objectif { border: 2px solid var(--or); border-radius: 14px; padding: 16px; margin: 0 0 14px; overflow-wrap: anywhere;
  background: linear-gradient(135deg, #2a2236, #181420); box-shadow: 0 0 0 4px #120e1a, 0 10px 30px rgba(0, 0, 0, .5); }
.objectif .chap { margin: 0; letter-spacing: .18em; text-transform: uppercase; font-size: .78rem; color: var(--texte-doux); }
.objectif .but { margin: 6px 0 8px; font-size: .95rem; }
.objectif h2 { font-size: 1.35rem; margin: 2px 0 6px; color: #fff; }
.objectif .etape { padding: 8px 10px; border-left: 4px solid var(--or-clair); background: rgba(201, 164, 92, .14); font-weight: 600; margin: 12px 0 0; }
.objectif .jauge { height: 14px; border: 1px solid #7d7392; border-radius: 7px; }
.objectif .fin { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: .92rem; }
.versement { margin-top: 10px; }
.versement label { margin-top: 0; }
.verser-avance { margin-top: 12px; }
.verser-avance summary { cursor: pointer; min-height: 44px; padding: 10px 0; color: var(--or-clair); }
.coups-regles summary, details.carte > summary { cursor: pointer; min-height: 44px; padding: 10px 0; box-sizing: border-box; color: var(--or-clair); }   /* gros coups : une cible de 44 px */
.panneau > .guide ul { margin: 8px 0 0; padding-left: 20px; }
.panneau > .guide li { margin: 4px 0; }

.vaisseau-tete { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.vaisseau-tete img { width: 92px; height: auto; flex: none; filter: drop-shadow(0 0 8px rgba(255, 220, 140, .35)); }
.vaisseau-tete h2, .vaisseau-tete p { margin: 0; }
.emplacements { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: 1fr; }
.emplacements.court { grid-template-columns: 1fr 1fr; }
.emplacements.court .nom { flex-wrap: wrap; }
.emplacements li { border: 1px dashed var(--or); border-radius: 10px; padding: 10px 12px; background: var(--fond-champ); }
.emplacements .nom { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-family: Georgia, serif; color: var(--or-clair); }
.emplacements p { margin: 4px 0 0; font-size: .92rem; }
.rang { display: inline-flex; gap: 3px; vertical-align: middle; }
.rang i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--texte-doux); }
.vide { white-space: nowrap; font-size: .82rem; color: var(--texte-doux); border: 1px solid var(--bord); border-radius: 99px; padding: 0 8px; }
.en-vol { border-color: var(--or) !important; }
.en-vol .compte { font-family: Georgia, serif; font-size: 2rem; margin: 0; }
ol.liste { padding-left: 22px; margin: 0; } ol.liste li { margin: 4px 0; }

/* Carte : mondes fermés grisés, vaisseaux des autres */
.noeud.ferme { pointer-events: none; color: #cfc8da; }
.noeud.ferme.touchable { pointer-events: auto; }
.trajet-fin ul { margin: 0; padding-left: 1.1rem; }
.noeud.ferme .planete { width: clamp(22px, 5vw, 40px); filter: grayscale(.85) brightness(.65); border: 1px dashed #8a8296; box-shadow: none; }
.noeud.ferme .planete::after { animation: none; display: none; }
.nom-noeud.chap { font-size: .75rem; color: #d9d2e4; }
/* Chapitre 5 : le bord « Hors des cartes », ses routes dorées, et les zones (signe, mot et trait du cercle : jamais la couleur seule) */
.route.hors { stroke: var(--or); stroke-width: .45; opacity: .85; }
.route.hors.ferme { opacity: .35; stroke-dasharray: .5 1.6; animation: none; }   /* route d'un monde fermé : estompée et plus fine en pointillés, pas seulement une autre teinte */
.bord-carte { fill: none; stroke: var(--or-clair); stroke-width: .5; stroke-dasharray: 2.4 1.6; }
.hors-cartes { position: absolute; z-index: 2; padding: 2px 8px; border-radius: 10px; background: rgba(13, 11, 18, .85); color: var(--or-clair);
  font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; pointer-events: none; white-space: nowrap;
  transform: translate(-50%, -50%) scale(calc(1 / var(--zoom, 1))) translate(var(--dx, 0px), var(--dy, 0px)); transform-origin: center; }
.noeud.zone-sure .planete { border-color: var(--bon); }
.noeud.zone-sauvage .planete { border: 3px double var(--mauvais); }
.badge.zone-sure { border-color: var(--bon); border-width: 2px; }
.badge.zone-sauvage { border: 2px dashed var(--mauvais); }
@media (forced-colors: active) {
  .noeud.zone-sure .planete, .badge.zone-sure, .noeud.zone-sauvage .planete, .badge.zone-sauvage { border-color: CanvasText; }
  .bord-carte { stroke: CanvasText; }
  .hors-cartes { border: 1px solid CanvasText; background: Canvas; color: CanvasText; }
}
.autre { position: absolute; width: 0; height: 0; z-index: 2; pointer-events: none; --r: clamp(26px, 7vw, 44px);
  transform: scale(calc(1 / var(--zoom, 1))); filter: drop-shadow(0 0 1.5px #000) drop-shadow(0 0 2.5px rgba(0, 0, 0, .85)); transition: left 1s linear, top 1s linear; }
.autre i { position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; background: #d9d2e4;
  -webkit-mask-image: url(/static/art/icones/equipage.svg); mask-image: url(/static/art/icones/equipage.svg);
  -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center;
  transform: rotate(var(--a)) translateX(var(--r)); }
.autre.vole i { animation: orbite 24s linear infinite; animation-delay: var(--d); }
/* Un pavillon noir (syndicat, lot 4) : le vaisseau posé sur un rond sombre cerclé de clair, qui le suit partout. */
.autre u { position: absolute; left: -12px; top: -12px; width: 24px; height: 24px; border-radius: 50%; box-sizing: border-box;
  background: rgba(8, 6, 12, .82); border: 1.5px solid #d9d2e4; transform: rotate(var(--a)) translateX(var(--r)); }
.autre.vole u { animation: orbite 24s linear infinite; animation-delay: var(--d); }
.autre.route u { transform: none; animation: none; }
.noir-cle { display: inline-grid; place-items: center; width: 18px; height: 18px; box-sizing: border-box; border-radius: 50%; background: #08060c;
  border: 1.5px solid #d9d2e4; color: #d9d2e4; font-size: 8px; line-height: 1; }
/* Tes corsaires en chasse (syndicat, lot 3) : un losange doré qui file de ta base vers le convoi visé par le raid. */
.chasseur { position: absolute; width: 0; height: 0; z-index: 3; pointer-events: none; transform: scale(calc(1 / var(--zoom, 1)));
  transition: left 1s linear, top 1s linear; }
.chasseur i { position: absolute; left: -6px; top: -6px; width: 12px; height: 12px; box-sizing: border-box; background: var(--or-clair, #e6c98a);
  border: 1.5px solid #1a1422; transform: rotate(45deg); box-shadow: 0 0 7px rgba(230, 201, 138, .8); }
.chasseur-cle { display: inline-block; width: 10px; height: 10px; box-sizing: border-box; background: var(--or-clair, #e6c98a); border: 1.5px solid #1a1422;
  transform: rotate(45deg); }
.proie-ordre { border-left: 3px solid var(--or-clair, #e6c98a); padding-left: .6em; }
@media (prefers-reduced-motion: reduce) { .chasseur { transition: none; } }
@media (forced-colors: active) { .chasseur i, .chasseur-cle { forced-color-adjust: none; background: Highlight; border-color: CanvasText; } }
.pavillon-noir { display: inline-block; padding: 0 .45em; border-radius: 999px; background: #08060c; border: 1px solid #d9d2e4; color: #ece6f2; font-size: .9em; }
.carte.pavillon .drapeau { color: var(--or-clair, #e6c98a); }
.carte.pavillon.noir { border-left: 3px solid #d9d2e4; background: linear-gradient(90deg, rgba(8, 6, 12, .55), transparent 60%); }
.carte.pavillon.noir .drapeau { color: #ece6f2; text-shadow: 0 0 6px #000; }
@keyframes orbite { from { transform: rotate(0deg) translateX(var(--r)); } to { transform: rotate(360deg) translateX(var(--r)); } }
.legende-carte, .nouvelles, .flotte-autres { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.nouvelles li, .flotte-autres li { overflow-wrap: anywhere; }   /* un nom de 40 caractères sans espace ne déborde pas */
.flotte-autres b { unicode-bidi: isolate; }
.legende-carte li { display: flex; gap: 8px; align-items: baseline; border-top: 1px solid var(--bord); padding: 4px 0; }
.legende-carte .cad { flex: none; width: 1.2em; text-align: center; }
.icone-fiche.icone-zone { display: inline-block; width: 1em; height: 1em; margin: 0 .3em 0 0; vertical-align: -.14em; background: currentColor; }   /* l'icône de zone (fiche) à la taille du texte autour : sa couleur est celle du texte (mask + currentColor) */
.legende-carte .cad .icone-fiche.icone-zone { margin: 0; }
.nouvelles li, .flotte-autres li { padding: 8px 0; border-top: 1px solid var(--bord); }
.nouvelles time { display: block; font-size: .8rem; color: var(--texte-doux); }
ol.classement { margin: 0; padding-left: 2.4em; font-size: .92rem; }
ol.classement li { overflow-wrap: anywhere; padding: 8px 0; border-top: 1px solid var(--bord); }
ol.classement b { unicode-bidi: isolate; }
ol.classement .aide { display: block; }
ol.classement li.toi { border-left: 3px solid var(--or-clair); background: rgba(201, 164, 92, .12); padding-left: 8px; }
ol.classement.hors li { border-top-style: dashed; }   /* ta ligne, loin des premiers */
@media (prefers-reduced-motion: reduce) { .autre.vole i, .autre.vole u { animation: none; } }

/* ---- La carte qui bouge (syndicat, lot 3) : zoom et glisser, trafic de la Bordure, clé et « Sur les routes » ----
   La carte agrandie : .carte-monde porte --zoom, --zx et --zy (plateau.js, commandesZoom) ; ce qui est posé dessus divise sa taille
   par --zoom, si bien que seules les distances grandissent. Ces trois valeurs sont animées ensemble par plateau.js (une seule animation, pas
   de transition CSS : échelle et décalage avancent du même pas, le point sous les doigts ne dérive pas). */
@property --zoom { syntax: "<number>"; inherits: true; initial-value: 1; }
@property --zx { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
@property --zy { syntax: "<percentage>"; inherits: false; initial-value: 0%; }
.carte-monde { position: absolute; inset: 0; transform-origin: 0 0; transform: translate(var(--zx, 0%), var(--zy, 0%)) scale(var(--zoom, 1)); }
.plateau-carte { touch-action: pan-y; }   /* un doigt fait défiler la page ; deux doigts agrandissent et déplacent la carte (sur l'écran Carte, un doigt la déplace toujours : .plateau-plein, touch-action: none) */
.plateau-carte.zoomee { cursor: grab; -webkit-user-select: none; user-select: none; }   /* agrandie : la souris la fait glisser ; au doigt, deux doigts */
.plateau-carte.glisse { cursor: grabbing; }
.couche-mobile { position: absolute; inset: 0; pointer-events: none; }
.carte-monde .route { stroke-width: calc(.35px / var(--zoom, 1)); }   /* agrandie, la carte garde des routes fines et des étoiles petites */
.carte-monde .route.hors { stroke-width: calc(.45px / var(--zoom, 1)); }
.carte-monde .bord-carte { stroke-width: calc(.5px / var(--zoom, 1)); }
.carte-monde .grille line { stroke-width: calc(.05px / var(--zoom, 1)); }
.carte-monde .anneau { stroke-width: calc(.18px / var(--zoom, 1)); }
.carte-monde .zone-galaxie { stroke-width: calc(.22px / var(--zoom, 1)); }
.carte-monde .voie-galaxie { stroke-width: calc(.16px / var(--zoom, 1)); }
.carte-monde .etoile { transform-box: fill-box; transform-origin: center; transform: scale(calc(1 / var(--zoom, 1))); }
.noms-galaxie { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.nom-region, .nom-zone, .nom-voie, .repere { position: absolute; transform: translate(-50%, -50%) scale(calc(1 / var(--zoom, 1))); white-space: nowrap; }
.nom-region { font: 600 .72rem/1 Georgia, "Times New Roman", serif; font-variant: small-caps; letter-spacing: .16em; color: var(--or-clair); opacity: .55; text-shadow: 0 1px 4px #000; }
.nom-zone { font: italic .75rem/1.1 Georgia, "Times New Roman", serif; color: var(--or-clair); opacity: .7; text-shadow: 0 1px 4px #000; }
.nom-voie { transform: translate(-50%, -50%) rotate(var(--angle, 0deg)) scale(calc(1 / var(--zoom, 1))); font: italic .68rem/1 Georgia, "Times New Roman", serif; letter-spacing: .06em; color: #cfc8da; opacity: .55; text-shadow: 0 1px 4px #000; }
.repere { display: inline-flex; align-items: center; gap: 4px; color: #cfc8da; font-size: .72rem; opacity: .8; text-shadow: 0 1px 4px #000; }
.repere i { width: 5px; height: 5px; border-radius: 50%; background: #cfc8da; opacity: .8; flex: none; }
.repere b { font-weight: 500; }
.regle-haut { position: absolute; top: 0; left: 0; right: 0; height: 20px; z-index: 4; pointer-events: none;
  background: rgba(13, 11, 18, .92); border-bottom: 1px solid rgba(201, 164, 92, .22); }
.regle-gauche { position: absolute; top: 0; left: 0; bottom: 0; width: 24px; z-index: 4; pointer-events: none;
  background: linear-gradient(to bottom, transparent 0 20px, rgba(13, 11, 18, .92) 20px); box-shadow: inset -1px 0 0 rgba(201, 164, 92, .22); }
.regle-haut span, .regle-gauche span { position: absolute; font-size: 11px; line-height: 1; color: var(--or-clair); opacity: .88; font-variant-numeric: tabular-nums; }
.regle-haut span { top: 4px; transform: translateX(-50%); }
.regle-gauche span { left: 0; right: 0; text-align: center; transform: translateY(-50%); }
.mini-carte { position: absolute; left: 8px; bottom: 8px; width: 96px; height: 96px; z-index: 5; border: 1px solid var(--or); border-radius: 8px;
  overflow: hidden; background: #0d0b12; box-shadow: 0 2px 10px rgba(0, 0, 0, .75); cursor: pointer; }
.mini-carte img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .75; pointer-events: none; }
.mini-vue { position: absolute; border: 1.5px solid var(--or-clair); background: rgba(201, 164, 92, .12); pointer-events: none; box-sizing: border-box; }
.mini-vaisseau { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--or-clair); border: 1px solid #0d0b12; transform: translate(-50%, -50%); pointer-events: none; }
.carte-et-zoom { width: min(100%, 82vh, 920px); margin-inline: auto; }
.carte-et-zoom .plateau-carte { width: 100%; }
.zoom-carte { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; margin-bottom: 6px; }   /* au-dessus de la carte, jamais dessus */
.zoom-carte button { min-width: 44px; min-height: 44px; padding: 0 12px; border-radius: 10px; background: rgba(13, 11, 18, .85); color: var(--or-clair); font-size: 1.2rem; line-height: 1; }
.zoom-carte button.mot { font-size: .85rem; }   /* « Galaxie », « Bordure » */
.zoom-carte button[aria-pressed="true"] { border-color: var(--or); background: rgba(201, 164, 92, .24); color: var(--or-clair); font-weight: 700; box-shadow: inset 0 0 0 1px var(--or); }   /* la vue en cours */
/* Les pointillés gardent leur pas quand la carte grandit (jusqu'au zoom 8), comme l'épaisseur des traits ; leur
   défilement aussi (flux). */
.carte-monde .route { stroke-dasharray: calc(1.4px / var(--zoom, 1)) calc(1.6px / var(--zoom, 1)); }
.carte-monde .route.hors.ferme { stroke-dasharray: calc(.5px / var(--zoom, 1)) calc(1.6px / var(--zoom, 1)); }
.carte-monde .bord-carte { stroke-dasharray: calc(2.4px / var(--zoom, 1)) calc(1.6px / var(--zoom, 1)); }
.carte-monde .anneau { stroke-dasharray: calc(.8px / var(--zoom, 1)) calc(.8px / var(--zoom, 1)); }
.carte-monde .zone-galaxie { stroke-dasharray: calc(1.4px / var(--zoom, 1)) calc(1.1px / var(--zoom, 1)); }
.carte-monde .voie-galaxie { stroke-dasharray: calc(1.2px / var(--zoom, 1)) calc(.8px / var(--zoom, 1)); }
.carte-monde .trajet-moi { stroke-dasharray: calc(1.6px / var(--zoom, 1)) calc(1.1px / var(--zoom, 1)); }
/* Une planète prend les deux tiers d'une case de la grille (cqi : un centième de la largeur de la carte, 26 cases), entre 22 et 60 px :
   de loin, les mondes voisins ne se chevauchent pas ; de près, ils gardent leur taille d'avant. */
.plateau-carte { container-type: inline-size; }
.carte-monde .planete { width: clamp(22px, calc(2.4cqi * var(--zoom, 1)), 60px); }
.carte-monde .noeud.ferme .planete { width: clamp(16px, calc(1.6cqi * var(--zoom, 1)), 40px); }
.plateau-carte.loin .noeud .planete { width: 12px; height: 12px; border-width: 1.5px; }
.plateau-carte.loin .vaisseau { width: 18px; height: 18px; }   /* de loin, plus petit qu'une planète proche : il ne cache pas son monde */
.plateau-carte.loin .planete::after { display: none; }
.plateau-carte.loin .noeud { justify-content: center; }
.plateau-carte.loin .nom-noeud, .plateau-carte.loin .etiquette-carte:not(.ici), .plateau-carte.loin .badges-noeud, .plateau-carte.loin .fanion-base, .plateau-carte.loin .signe-evenement, .plateau-carte.loin .repere b { display: none; }
.plateau-carte.proche .nom-region, .plateau-carte.proche .nom-zone, .plateau-carte.proche .nom-voie { display: none; }
.masque { visibility: hidden; opacity: 0; transition: opacity .18s, visibility 0s .18s; }
@media (max-width: 420px) {
  .mini-carte { width: 72px; height: 72px; }
  .zoom-carte { gap: 4px; }
  .zoom-carte button { padding: 0 9px; }
  .nom-region { font-size: .64rem; letter-spacing: .1em; }
  .hors-cartes { font-size: .72rem; letter-spacing: .06em; padding: 2px 6px; }
}
.trajet-moi { fill: none; stroke: var(--or-clair); stroke-width: calc(.7px / var(--zoom, 1)); stroke-linejoin: round; stroke-dasharray: 1.6 1.1; opacity: .9; animation: flux-trajet 3s linear infinite; }
/* Le trafic : une forme par sorte (jamais la couleur seule), un sillage derrière, dans le sens de la route. */
.trafic { position: absolute; width: 0; height: 0; z-index: 2; pointer-events: none; transform: scale(calc(1 / var(--zoom, 1)));
  filter: drop-shadow(0 0 1.5px #000) drop-shadow(0 0 2.5px rgba(0, 0, 0, .85)); transition: left 1s linear, top 1s linear; }
.trafic b, .autre b { position: absolute; left: -1px; top: 0; width: 2px; height: 16px; transform-origin: 50% 0; transform: rotate(var(--cap, 0deg));
  background: linear-gradient(rgba(255, 200, 120, .9), transparent); animation: sillage 1.4s ease-in-out infinite alternate; }
@keyframes sillage { from { opacity: .35; } to { opacity: .95; } }
.autre:not(.route) b { display: none; }
.autre.route i { transform: rotate(var(--cap, 0deg)); animation: none; }
.trafic i, .ancre i, .navire i { position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; border-radius: 0; background: #d9d2e4;
  -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; }
.trafic i { transform: rotate(var(--cap, 0deg)); }
.t-convoi i { background: #d8b36a; -webkit-mask-image: url(/static/art/icones/vaisseaux/faction_convoi.png); mask-image: url(/static/art/icones/vaisseaux/faction_convoi.png); }
.t-hutt i { left: -9px; top: -9px; width: 18px; height: 18px; background: #a3b55a;
  -webkit-mask-image: url(/static/art/icones/vaisseaux/faction_hutt.png); mask-image: url(/static/art/icones/vaisseaux/faction_hutt.png); }
.t-patrouille i { background: #7fb0ff; -webkit-mask-image: url(/static/art/icones/vaisseaux/faction_patrouille.png); mask-image: url(/static/art/icones/vaisseaux/faction_patrouille.png); }
.t-pirates i { background: #e2683f; -webkit-mask-image: url(/static/art/icones/vaisseaux/faction_pirates.png); mask-image: url(/static/art/icones/vaisseaux/faction_pirates.png); }
.a-autre i { -webkit-mask-image: url(/static/art/icones/equipage.svg); mask-image: url(/static/art/icones/equipage.svg); }
/* Lot E2 : un autre équipage vole sur la coque de son espèce ; sa silhouette du dessus (tools/3d/icones_carte.py), un peu plus grande
   que l'icône commune pour qu'elle se lise. L'Humain et une espèce encore sans coque gardent icones/equipage.svg. */
.autre.espece i { left: -9px; top: -9px; width: 18px; height: 18px; }
.autre.e-twilek i { -webkit-mask-image: url(/static/art/icones/vaisseaux/twilek.png); mask-image: url(/static/art/icones/vaisseaux/twilek.png); }
.autre.e-rodien i { -webkit-mask-image: url(/static/art/icones/vaisseaux/rodien.png); mask-image: url(/static/art/icones/vaisseaux/rodien.png); }
.autre.e-wookiee i { -webkit-mask-image: url(/static/art/icones/vaisseaux/wookiee.png); mask-image: url(/static/art/icones/vaisseaux/wookiee.png); }
.autre.e-trandoshan i { -webkit-mask-image: url(/static/art/icones/vaisseaux/trandoshan.png); mask-image: url(/static/art/icones/vaisseaux/trandoshan.png); }
.autre.e-bothan i { -webkit-mask-image: url(/static/art/icones/vaisseaux/bothan.png); mask-image: url(/static/art/icones/vaisseaux/bothan.png); }
.autre.e-gand i { -webkit-mask-image: url(/static/art/icones/vaisseaux/gand.png); mask-image: url(/static/art/icones/vaisseaux/gand.png); }
.autre.e-droide i { -webkit-mask-image: url(/static/art/icones/vaisseaux/droide.png); mask-image: url(/static/art/icones/vaisseaux/droide.png); }
/* La flotte (syndicat, lot 5) : tes vaisseaux en doré, cerclés de sombre ; ceux des autres en clair. Une silhouette par sorte (jamais la
   couleur seule) : le cargo léger (petit vraquier), le corsaire (intercepteur en flèche), l'éclaireur (sonde fine et son halo qui bat
   pendant le guet, posé sur un pseudo-élément non masqué). À quai, autour de leur port ; en route, un sillage derrière. */
.navire { position: absolute; width: 0; height: 0; z-index: 3; pointer-events: none; transform: scale(calc(1 / var(--zoom, 1)));
  filter: drop-shadow(0 0 1.5px #000) drop-shadow(0 0 2.5px rgba(0, 0, 0, .85)); transition: left 1s linear, top 1s linear; }
.navire b { position: absolute; left: -1px; top: 0; width: 2px; height: 15px; transform-origin: 50% 0; transform: rotate(var(--cap, 0deg));
  background: linear-gradient(rgba(230, 201, 138, .9), transparent); animation: sillage 1.4s ease-in-out infinite alternate; }
.navire:not(.vole) b { display: none; }
.navire i { box-sizing: border-box; border: 0; background: var(--or-clair, #e6c98a); transform: rotate(var(--cap, 0deg)); }
.n-cargo i { -webkit-mask-image: url(/static/art/icones/vaisseaux/flotte_cargo.png); mask-image: url(/static/art/icones/vaisseaux/flotte_cargo.png); }
.n-corsaire i { -webkit-mask-image: url(/static/art/icones/vaisseaux/flotte_corsaire.png); mask-image: url(/static/art/icones/vaisseaux/flotte_corsaire.png); }
.n-eclaireur i { -webkit-mask-image: url(/static/art/icones/vaisseaux/flotte_eclaireur.png); mask-image: url(/static/art/icones/vaisseaux/flotte_eclaireur.png); }
.n-eclaireur::before { content: ""; position: absolute; left: -7px; top: -7px; width: 14px; height: 14px; border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(230, 201, 138, .3); pointer-events: none; }
.n-eclaireur.sejour::before { animation: radar 1.8s ease-out infinite; }
@keyframes radar { from { box-shadow: 0 0 0 0 rgba(230, 201, 138, .75); } to { box-shadow: 0 0 0 10px rgba(230, 201, 138, 0); } }
.navire.autres i { background: #d9d2e4; }
.navire.autres b { background: linear-gradient(rgba(217, 210, 228, .8), transparent); }
.navire.autres.n-eclaireur::before { box-shadow: 0 0 0 3px rgba(217, 210, 228, .25); }
.navire.autres.n-eclaireur.sejour::before { animation: none; }
@media (prefers-reduced-motion: reduce) { .navire { transition: none; } .navire b, .n-eclaireur.sejour::before, .n-eclaireur.sejour i { animation: none; } }
@media (forced-colors: active) {
  .navire i { forced-color-adjust: none; background: Highlight; border-color: CanvasText; }
  .navire.autres i { background: CanvasText; }
  .navire b { forced-color-adjust: none; background: CanvasText; }
  .n-eclaireur::before { forced-color-adjust: none; box-shadow: 0 0 0 1.5px CanvasText; }
}
/* La clé, sous la carte, et la liste « Sur les routes » */
.cle-carte { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .88rem; color: var(--texte-doux); }
.cle-carte li { display: flex; align-items: center; gap: 6px; }
.signe-carte { position: relative; display: inline-block; flex: none; width: 18px; height: 18px; }
.ancre { position: absolute; left: 50%; top: 50%; width: 0; height: 0; filter: drop-shadow(0 0 1.5px #000) drop-shadow(0 0 2px rgba(0, 0, 0, .85)); }
.coque-cle { display: block; width: 18px; height: 18px;
  filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 2.5px rgba(255, 220, 140, .85)); }
.sur-les-routes ul { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.sur-les-routes li { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--bord); overflow-wrap: anywhere; }
.sur-les-routes .signe-carte { top: 3px; }
.sur-les-routes bdi { unicode-bidi: isolate; }
@media (prefers-reduced-motion: reduce) {
  .carte-monde, .fond-galaxie, .fond-proche, .regle-haut, .regle-gauche, .mini-carte, .noms-galaxie, .trafic, .autre { transition: none; }
  .trafic b, .autre b, .trajet-moi { animation: none; }
}
@media (forced-colors: active) {
  .trafic i, .autre i, .ancre i { forced-color-adjust: none; background: CanvasText; }
  .autre u { forced-color-adjust: none; background: Canvas; border-color: CanvasText; }
  .trafic b, .autre b { forced-color-adjust: none; background: CanvasText; }
  .trajet-moi { stroke: CanvasText; }
  .regle-haut, .regle-gauche { background: Canvas; border-color: CanvasText; box-shadow: none; }
  .regle-haut span, .regle-gauche span { color: CanvasText; opacity: 1; }
}

/* ---------- Lot 6 : cartes de mission, rangée de bonus, départ, arc ---------- */
.faits { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.fait { flex: 1 1 90px; min-width: 0; padding: 6px 10px; border: 1px solid var(--bord); border-radius: 8px; background: var(--fond-champ); }
.fait small { display: block; color: var(--texte-doux); font-size: .8rem; }
.fait b { overflow-wrap: anywhere; }
.chance { display: inline-flex; align-items: center; gap: 8px; }
.seg { display: inline-flex; gap: 3px; }
.seg i { width: 14px; height: 10px; border-radius: 2px; background: #2a2236; border: 1px solid var(--bord); }
.seg i.on { background: var(--or); border-color: var(--or-clair); }
.petit { font-size: .9rem; }
.mauvais { color: var(--mauvais); } .bon { color: var(--bon); }
.approche h4 { margin: 12px 0 6px; font-size: 1rem; }
.reserve { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.reserve h5 { margin: 0 0 4px; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--texte-doux); }
.reserve ul { list-style: none; margin: 0; padding: 0; }
.reserve li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 8px; padding: 6px 0; border-top: 1px solid var(--bord); overflow-wrap: anywhere; }
.reserve li b { color: var(--or-clair); }
.reserve li small { flex: 1 1 100%; color: var(--texte-doux); }
.reserve li.grise { color: var(--texte-doux); }
.reserve li.grise b { color: var(--texte-doux); font-weight: 400; font-size: .85rem; }
.reserve .contre li b { color: var(--mauvais); }
@media (max-width: 520px) { .reserve { grid-template-columns: 1fr; } }
.approche .total { margin: 12px 0 0; padding: 8px 10px; border-left: 4px solid var(--or-clair); background: rgba(201, 164, 92, .12); }
.aide-de { margin: 0 0 12px; padding: 4px 14px; border: 1px solid var(--bord); border-radius: 10px; background: var(--fond-carte); }
.aide-de summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; color: var(--or-clair); list-style: none; }
.aide-de summary::-webkit-details-marker { display: none; }
.aide-de summary::before { content: "▸"; display: inline-block; transition: transform .2s; }   /* en flex, le triangle du navigateur disparaît : on le remet */
.aide-de[open] summary::before { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .aide-de summary::before { transition: none; } }
.aide-de ul { margin: 0 0 8px; padding-left: 20px; }
.liens-depart { list-style: none; margin: 0; padding: 0; }
.liens-depart button.lien { text-align: left; }
.arc { margin: 8px 0 0; padding-left: 0; list-style: none; }
.arc li { padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--bord); border-radius: 8px; overflow-wrap: anywhere; }
.arc li.en-cours { border-color: var(--or); background: rgba(201, 164, 92, .1); }
.arc li.clos { color: var(--texte-doux); }
.zone-decollage { position: fixed; inset: 0; z-index: 70; }
button.lien { gap: .35em; }

/* Listes compactes (Ici, carte) : une ligne par mission, un monde par volet */
.liste-missions, .liste-mondes { list-style: none; margin: 8px 0; padding: 0; }
.ligne-mission { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--bord); }
.ligne-mission:first-child { border-top: 0; }
.ligne-mission > button { flex: none; white-space: nowrap; }   /* « Voir » ne se coupe pas en « Voi / r » dans une carte étroite (la mission conseillée, sur le Bord) */
.ligne-texte { display: flex; flex-direction: column; min-width: 0; }
.ligne-texte > .etiquette-mission { align-self: flex-start; max-width: 100%; }   /* une pastille à sa taille, pas une barre sur toute la ligne */
.ligne-texte small { color: #cfc8da; font-size: .85rem; }
.monde-liste { border-top: 1px solid var(--bord); padding: 6px 0; }
.monde-liste summary { cursor: pointer; padding: 6px 0; min-height: 44px; box-sizing: border-box; display: flex; align-items: center; }   /* une cible de 44 px */
.repliable > summary { cursor: pointer; min-height: 44px; box-sizing: border-box; display: flex; align-items: center; }   /* une cible de 44 px */
.repliable > summary, .monde-liste summary { gap: 8px; list-style: none; }
.repliable > summary::-webkit-details-marker, .monde-liste summary::-webkit-details-marker { display: none; }
.repliable > summary::before, .monde-liste summary::before { content: "▸"; display: inline-block; transition: transform .2s; }   /* en flex, le triangle du navigateur disparait : on le remet */
.repliable[open] > summary::before, .monde-liste[open] > summary::before { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .repliable > summary::before, .monde-liste summary::before { transition: none; } }
.liste-mondes li { padding: 4px 0; }
.liste-mondes button.lien { min-width: 44px; justify-content: center; }   /* « Teth » : un nom court reste une cible de 44 px */

/* ---------- Lot 2 du chapitre 2 : scène d'ouverture, équipage ---------- */
.scene-ch2 figcaption { padding-top: 60px; }
.scene-ch2 img { aspect-ratio: 16 / 9; }
/* Cinématique (cinematique.js) : la vidéo sans texte, ses légendes posées par-dessus, le texte entier à la fin. */
.scene-cine { aspect-ratio: 16 / 9; background: #000; }
.scene-cine video, .scene-cine > img { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
.scene-cine figcaption { transition: opacity .6s; }
.scene-cine.joue figcaption { opacity: 0; }
/* Le récit entier (état « fini ») : la figure grandit avec lui au lieu de le rogner (téléphone, 360-412 px : titre coupé en haut) ;
   le bouton « Revoir la vidéo » passe dans le flux, au-dessus du récit, au lieu de se poser dessus. */
.scene-cine.fini { display: flex; flex-direction: column; justify-content: flex-end; overflow: visible; }
.scene-cine.fini > img, .scene-cine.fini > video { border-radius: inherit; }
.scene-cine.fini figcaption { position: relative; inset: auto; }
.scene-cine.fini .cine-commandes { position: relative; order: -1; top: auto; right: auto; align-self: flex-end; margin: 8px 8px auto 0; z-index: 1; }
.cine-legende, .cine-titre { position: absolute; left: 0; right: 0; margin: 0; padding: 0 16px; text-align: center; pointer-events: none;
  font-family: Georgia, "Times New Roman", serif; color: #f3ead8; text-shadow: 0 2px 8px #000, 0 0 2px #000; opacity: 0; transition: opacity .5s; }
.cine-legende { bottom: 7%; font-size: clamp(.95rem, 2.6vw, 1.45rem); }
.cine-titre { top: 50%; transform: translateY(-50%); font-size: clamp(1.4rem, 5vw, 2.8rem); color: var(--or-clair); letter-spacing: .04em; }
.cine-legende.vue, .cine-titre.vue { opacity: 1; }
.cine-commandes { position: absolute; top: 8px; right: 8px; }
.cine-passer { min-height: 36px; padding: 4px 14px; background: rgba(8, 6, 12, .6); border: 1px solid var(--or); color: var(--texte); border-radius: 999px; }
.cine-dialogue { width: min(960px, calc(100vw - 16px)); max-width: none; padding: 8px; background: var(--fond); color: var(--texte); border: 1px solid var(--or); border-radius: 12px; }
.cine-dialogue::backdrop { background: rgba(4, 3, 8, .88); }
.cine-dialogue .scene-cine { margin-bottom: 8px; }
@media (prefers-reduced-motion: reduce) { .scene-cine figcaption, .cine-legende, .cine-titre { transition: none; } }
.replique { margin: 12px 0; padding: 8px 14px; border-left: 4px solid var(--or-clair); background: rgba(201, 164, 92, .1); font: italic 1.05rem/1.5 Georgia, serif; }
.passagere .faits { margin-top: 12px; }
.competences-liste { list-style: none; margin: 8px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 20px; }
.competences-liste li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-top: 1px solid var(--bord); }
.competences-liste b { color: var(--or-clair); font-variant-numeric: tabular-nums; }
.equipier-bientot { display: flex; gap: 14px; align-items: center; padding: 8px 0; border-top: 1px dashed var(--bord); }
.equipier-bientot:first-child { border-top: 0; }
.equipier-bientot .jeton { filter: grayscale(1) brightness(.7); border-style: dashed; }
.equipier-bientot h3, .equipier-bientot p { margin: 0; }
.vaisseau-tete .jeton { width: 56px; height: 56px; }
.sous-onglets { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 6px; margin: 0 0 14px; }
.monde-choisi, #monde-choisi, .sous-onglets, .panneau > [role="tabpanel"] { scroll-margin-top: 0; }
.carte > h2[id], .panneau article > h2[id] { scroll-margin-top: 18px; }
.sous-onglets button { border-color: var(--bord); }
.sous-onglets button[aria-selected="true"] { border-color: var(--or); color: var(--or-clair); background: #241d30; box-shadow: inset 0 -3px 0 var(--or); }
.portrait { width: 72px; height: 72px; }
.atelier-tete .replique { margin-bottom: 0; }
.amelioration.posee { border-color: var(--bon) !important; }
.avertir { padding: 8px 10px; border-left: 4px solid var(--or-clair); background: rgba(201, 164, 92, .12); }

/* Chapitre 2 : les cinq puces du bandeau, les conditions, les rangs posés */
.puces { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.puces li { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-height: 28px; padding: 2px 10px; border-left: 3px solid var(--bord); font-size: .92rem; color: var(--texte-doux); }
.puces li.fait { border-left-color: var(--bon, #6fbf8b); }
.puces li.en-cours { border-left-color: var(--or-clair); color: var(--texte); font-weight: 600; }
.puces small { white-space: nowrap; }
.conditions { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.conditions li { border: 1px solid var(--bord); border-radius: 10px; padding: 10px 12px; background: var(--fond-champ); }
.conditions li.fait { border-color: var(--bon, #6fbf8b); }
.conditions p { margin: 4px 0 0; }
.rang i.plein { background: var(--or); border-color: var(--or); }
@media (forced-colors: active) {   /* les couleurs forcées effacent le remplissage : un rang posé reste plein, un rang vide reste creux */
  .rang i { border-color: CanvasText; }
  .rang i.plein { forced-color-adjust: none; background: CanvasText; border-color: CanvasText; }
}
.note-versement .faits { margin-top: 0; }

/* ---- Lot 3 : le marché, le marchandage, la soute ---- */
.choix-mondes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.choix-mondes button { min-height: 44px; border-color: var(--bord); }
.choix-mondes button[aria-pressed="true"] { border-color: var(--or); color: var(--or-clair); background: #241d30; box-shadow: inset 0 -3px 0 var(--or); }
.ligne-marche-tete { display: flex; gap: 12px; align-items: center; }
.ligne-marche-tete h3, .ligne-marche-tete p { margin: 0; }
.ligne-marche p { margin: 6px 0 0; }
.ligne-marche .rangee { margin-top: 10px; }
.ligne-marche .rangee button { flex: 1 1 120px; min-height: 44px; }
.caisse-img { flex: none; width: 40px; height: 40px; object-fit: contain; }
/* Marché : la caisse se voit (retour n° 29). Grande sur sa fiche, petite à côté du nom dans le comparatif. */
.ligne-marche-tete .caisse-img { width: 76px; height: 76px; padding: 6px; border-radius: 14px; background: radial-gradient(circle at 50% 42%, rgba(201, 164, 92, .2), rgba(13, 11, 18, .55) 72%); border: 1px solid rgba(201, 164, 92, .35); }
/* La Commande du Hutt (marche.js, carteCommande) : en haut du marché, jamais plus large que l'écran. */
.commande-hutt { margin-bottom: 14px; border-left: 4px solid var(--or-clair); }
.commande-hutt p { margin: 6px 0 0; overflow-wrap: anywhere; }
.commande-demande { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.commande-demande p { margin: 0; }
.commande-reclame { font-weight: 600; }
.commande-classement { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.commande-classement li { display: grid; grid-template-columns: 2.6em minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 4px 8px; border-radius: 6px; background: rgba(201, 164, 92, .06); }
.commande-classement li.toi { background: rgba(201, 164, 92, .18); font-weight: 600; }
.commande-nom { overflow-wrap: anywhere; }
.commande-caisses { white-space: nowrap; color: var(--texte-doux); }
.comparatif-bien { display: flex; align-items: center; gap: 8px; }
.comparatif-bien .caisse-img { width: 30px; height: 30px; }
@media (max-width: 600px) {
  .ligne-marche-tete { align-items: flex-start; }
  .ligne-marche-tete .caisse-img { width: 60px; height: 60px; padding: 4px; border-radius: 12px; }
  .comparatif-bien .caisse-img { display: none; }
}
.tendance.hausse { color: var(--bon); } .tendance.baisse { color: var(--mauvais); }
.caisses { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.caisse { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--bord); border-radius: 8px; background: var(--fond-champ); font-size: .9rem; min-width: 0; overflow-wrap: anywhere; }
.vide-caisse { border-style: dashed; color: var(--texte-doux); }
.caisse-vide { flex: none; width: 40px; height: 40px; border: 1px dashed var(--bord); border-radius: 6px; }
.issues { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.issues li { display: flex; gap: 8px; }
.issues .signe { flex: none; width: 1.2em; text-align: center; color: var(--or-clair); font-weight: bold; }
@media (max-width: 420px) { .caisses { grid-template-columns: 1fr; } }

/* ---- Lot 3 : les plans de Tuwa, la fabrication, les faux codes, le bilan ---- */
.plan-img { flex: none; width: 92px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--bord); }
.matieres, .gains { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.matieres li.ok { color: var(--bon); }
.matieres li.manque { color: var(--mauvais); }   /* le ✗ et « manque » le disent aussi : la couleur n'est pas seule */
.gains li { display: flex; gap: 6px; }
.gains li.bon { color: var(--texte); }
.gains .bon span { color: var(--bon); font-weight: bold; }
.fabrication.attente { border-style: dashed; }
.faux-codes { margin: 10px 0; }
.faux-codes label.choix { margin-bottom: 4px; }
.coup-de-chance { margin: 10px 0; }
.coup-de-chance label.choix b, .coup-de-chance label.choix small { display: block; }   /* le titre, puis son aide (retour du 19/11 : « coup de chanceDeux dés ») */
.coup-de-chance label.choix small { color: var(--texte-doux); }
.faux-codes b, .faux-codes small { display: block; }
.faux-codes small { color: var(--texte-doux); }
.res-avantages h4, .rapport h4 { margin: 8px 0 2px; }
.butin { margin: 4px 0; color: var(--texte); }   /* neutre : un butin vendu sur place n'est pas une alerte */
.comment-marchander { margin: 10px 0 0; }
.comment-marchander summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--or-clair); }
.lien-ancre { display: inline-flex; align-items: center; min-height: 44px; }
.rapport-pret:not(:empty) { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0; padding: 10px 14px; border: 2px solid var(--or); border-radius: 10px; background: #241d30; position: sticky; top: 0; z-index: 5; }
.rapport-pret button { min-height: 44px; }
/* Marché et soute : l'un sous l'autre sur téléphone, côte à côte au bureau */
.marche-duo { display: block; }
.marche-duo article, .marche-duo .comparatif-marche { background: linear-gradient(rgba(24, 20, 32, .96), rgba(18, 14, 24, .96)); box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
  border: 1px solid var(--bord); border-radius: 10px; padding: 16px; margin-bottom: 12px; }
.marche-duo .comparatif-marche { padding: 8px 16px 14px; }
.comparatif-marche > summary { color: var(--or-clair); font: 600 1.05rem/1.3 Georgia, "Times New Roman", serif; }
.comparatif-marche > .aide { margin: 2px 0 8px; }
.tableau-defilement { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tableau-comparatif { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
.tableau-comparatif th, .tableau-comparatif td { padding: 7px 6px; vertical-align: top; }
.tableau-comparatif thead th { color: var(--texte-doux); font-size: .8rem; font-weight: 600; }
.tableau-comparatif tbody th { font-weight: 600; color: var(--texte); }
.tableau-comparatif .chiffrage { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tableau-comparatif .comparatif-monde { display: block; }
.tableau-comparatif .comparatif-prix { display: block; text-align: left; color: var(--or-clair); font-weight: 600; }
.tableau-comparatif .comparatif-revente { display: block; white-space: nowrap; font-size: .78rem; font-weight: 400; }
.tableau-comparatif .comparatif-ici { min-width: 4.6rem; }
.tableau-comparatif td.chiffrage:last-child { white-space: normal; }
.tableau-comparatif .ici-court { display: none; }
.tableau-comparatif td.monde-ici { background: rgba(201, 164, 92, .12); box-shadow: inset 3px 0 0 var(--or); }
.badge.badge-ici { border-color: var(--or); background: rgba(201, 164, 92, .18); color: var(--or-clair); font-size: .74rem; padding: 0 6px; }
@media (max-width: 600px) {
  .marche-duo .comparatif-marche { padding: 6px 10px 12px; }
  .tableau-comparatif { font-size: .82rem; }
  .tableau-comparatif th, .tableau-comparatif td { padding: 6px 4px; }
  .tableau-comparatif thead th { font-size: .74rem; }
  .tableau-comparatif .ici-long { display: none; }
  .tableau-comparatif .ici-court { display: inline; }
}
@media (min-width: 1024px) {
  .marche-duo { display: flex; flex-direction: column; gap: 14px; }
}
@media (forced-colors: active) {
  .choix-mondes button[aria-pressed="true"], .sous-onglets button[aria-selected="true"], .onglets button[aria-selected="true"] { border-width: 3px; text-decoration: underline; }
  .tableau-comparatif td.monde-ici { outline: 2px solid CanvasText; outline-offset: -2px; }
  .badge.badge-ici { border-color: CanvasText; }
}

/* ---------- Lot 4 du chapitre 2 : prêter et emprunter une pilote ---------- */
.liste-pilotes { list-style: none; margin: 8px 0; padding: 0; }
.ligne-pilote { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--bord); }
.ligne-pilote:first-child { border-top: 0; }
.ligne-pilote.choisie { border-left: 4px solid var(--or); padding-left: 10px; }
.ligne-pilote button { flex: none; }
.ligne-pilote .ligne-texte { overflow-wrap: anywhere; }
.pret label.choix b, .pret label.choix small { display: block; }
.pret label.choix small { color: var(--texte-doux); }
.emprunt { margin: 10px 0; padding: 10px 12px; border: 1px solid var(--bord); border-radius: 10px; }
.emprunt h4 { margin-top: 0; }
.emprunt p { overflow-wrap: anywhere; }
@media (max-width: 520px) { .ligne-pilote { flex-wrap: wrap; } .ligne-pilote button { width: 100%; } }

/* ---------- Bord : une colonne au téléphone ; faits et objectif côte à côte au bureau ---------- */
#panneau-bord { overflow-wrap: anywhere; }
.bord-bonjour { margin: 6px 0 12px; }
.bord-grille { display: flex; flex-direction: column; gap: 12px; }
.bord-col-g, .bord-col-d, .bord-col-p, .bord-bas { display: grid; gap: 12px; min-width: 0; }   /* bord-col-p : le pack du jour et le savoir-faire, sous le but */
.bord-col-g:empty { display: none; }
.bord-grille section, .bord-guide { min-width: 0; margin: 0; }
.bord-alerte { border: 2px solid var(--mauvais); background: linear-gradient(135deg, #2b1820, var(--fond-carte)); }
.bord-alerte h2 { color: var(--texte); }
.bord-faits, .bord-encours, .bord-pieces, .bord-conditions { list-style: none; margin: 0; padding: 0; }
.bord-faits > li { display: flex; flex-wrap: wrap; align-items: start; gap: 8px; padding: 10px 0; border-top: 1px solid var(--bord); }
.bord-faits > li:first-child { border-top: 0; }
.bord-fait { flex: 1 1 190px; min-width: 0; }
.bord-fait > b, .bord-fait > span, .bord-fait > time { display: block; }
.bord-encours > li { padding: 8px 0; border-top: 1px solid var(--bord); }
.bord-encours > li:first-child { border-top: 0; }
.bord-ligne { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; }
.bord-dette-montant { font: 600 1.8rem/1.2 Georgia, serif; color: var(--mauvais); }
.bord-versements summary { min-height: 44px; padding: 10px 0; cursor: pointer; color: var(--or-clair); }
.bord-versements ol { padding-left: 24px; }
.bord-versements li { margin: 8px 0; }
.bord-versements li > span, .bord-versements li > b { margin-right: 8px; }
.bord-vaisseau-tete { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.bord-vaisseau-tete img { flex: none; width: 84px; height: auto; }
.bord-vaisseau-tete > div { min-width: 0; }
.bord-pieces > li { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 0; border-top: 1px solid var(--bord); }
.bord-pieces > li > span { min-width: 0; }
.bord-pieces .badge { border-width: 2px; }
.bord-pieces .mauvais { border-style: dashed; }
.bord-conditions li { display: flex; flex-wrap: wrap; gap: 8px; align-items: start; padding: 6px 0; border-top: 1px solid var(--bord); }
.bord-conditions .badge { flex: none; }
.bord-conditions li > span:not(.badge) { flex: 1 1 13rem; min-width: 0; }   /* le texte garde sa largeur : le bouton passe dessous quand la carte est étroite */
.bord-conditions li > .rangee { margin: 0 0 0 auto; }
.bord-but .primaire.grand { flex-direction: column; width: 100%; }
.bord-but button small { font-weight: normal; }
.bord-grille button { max-width: 100%; white-space: normal; }
.bord-grille .guide { margin: 0; }
/* ---------- Vaisseau : illustration et fiches des pièces ---------- */
#panneau-vaisseau { overflow-wrap: anywhere; }
.vaisseau-grille { display: grid; gap: 16px; }
.vaisseau-gauche, .vaisseau-droite { min-width: 0; }
.vaisseau-intro { margin: 6px 0 16px; }
.vaisseau-droite > article { background: var(--fond-carte); border: 1px solid var(--bord); border-radius: 10px; padding: 16px; margin-bottom: 12px; }
.cargo-zones { margin: 0 0 8px; border: 1px solid var(--bord); border-radius: 10px; padding: 10px;
  background: radial-gradient(circle, #2a2236, #120e1a 72%); }
.cargo-composition { position: relative; aspect-ratio: 1; max-width: 380px; margin: auto; }
.cargo-composition > img { position: absolute; inset: 0; width: 100%; height: 100%; }
.cargo-calque { pointer-events: none; mask-mode: luminance; -webkit-mask-size: 100% 100%; mask-size: 100% 100%; }
.cargo-calque-hyperdrive { -webkit-mask-image: url(/static/art/vaisseaux/cargo_zones_masque_hyperdrive.png); mask-image: url(/static/art/vaisseaux/cargo_zones_masque_hyperdrive.png); }
.cargo-calque-soute { -webkit-mask-image: url(/static/art/vaisseaux/cargo_zones_masque_soute.png); mask-image: url(/static/art/vaisseaux/cargo_zones_masque_soute.png); }
.cargo-calque-blindage { -webkit-mask-image: url(/static/art/vaisseaux/cargo_zones_masque_blindage.png); mask-image: url(/static/art/vaisseaux/cargo_zones_masque_blindage.png); }
.cargo-calque-compartiments { -webkit-mask-image: url(/static/art/vaisseaux/cargo_zones_masque_compartiments.png); mask-image: url(/static/art/vaisseaux/cargo_zones_masque_compartiments.png); }
.piece-numero { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 26px; height: 26px;
  border: 2px solid currentColor; border-radius: 50%; background: var(--fond); color: var(--texte); font-weight: bold; }
.cargo-repere { position: absolute; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; text-decoration: none; transform: translate(-50%, -50%); }
.cargo-repere-hyperdrive { left: 15%; top: 48%; }
.cargo-repere-soute { left: 52%; top: 63%; }
.cargo-repere-blindage { left: 52%; top: 13%; }
.cargo-repere-compartiments { left: 53%; top: 35%; }
.vaisseau-legende, .vaisseau-pieces { list-style: none; margin: 0 0 12px; padding: 0; }
.vaisseau-legende > li { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 8px; border-top: 1px solid var(--bord); }
.vaisseau-legende a { gap: 8px; text-decoration: none; }
.vaisseau-legende a:hover { text-decoration: underline; }
.vaisseau-legende .badge, .piece-cargo > summary .badge { border-width: 2px; }
.vaisseau-legende .mauvais, .piece-cargo > summary .mauvais { border-style: dashed; }
.vaisseau-aide { margin: 4px 0; padding-left: 22px; }
.piece-cargo { margin-bottom: 12px; border: 1px solid var(--bord); border-left: 8px dashed var(--mauvais); border-radius: 10px; background: var(--fond-carte); }
.piece-cargo.remise { border-left: 8px solid var(--bon); }
.piece-cargo.prochaine { outline: 2px solid var(--or); }
.piece-cargo summary { min-height: 44px; padding: 10px; cursor: pointer; color: var(--or-clair); }
.piece-cargo > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.piece-cargo > summary::before { content: '▸'; }
.piece-cargo[open] > summary::before { content: '▾'; }
.piece-cargo > summary h3 { margin: 0; flex: 1 1 130px; }
.piece-prix { font-size: .9rem; }
.piece-contenu { padding: 0 12px 12px; }
.piece-suite { border-top: 1px solid var(--bord); padding-top: 8px; }
.piece-suite h4 { margin: 0 0 8px; color: var(--or-clair); font-family: Georgia, serif; }
.piece-faits { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px 14px; font-size: .95rem; margin: 0; }
.piece-faits dt { color: var(--texte-doux); }
.piece-faits dd { margin: 0; }
.piece-missions summary { padding-inline: 0; }
.piece-future, .piece-etapes .future { color: var(--texte-doux); border-style: dashed; }
.piece-etapes { list-style: none; padding: 10px 0 0; margin: 12px 0 0; border-top: 1px solid var(--bord); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; font-size: .82rem; }
.piece-etapes li { padding: 6px 8px; border: 1px solid var(--bord); border-radius: 6px; }
.piece-etapes .actuelle { border: 2px solid var(--or); color: var(--or-clair); }
.piece-etapes .badge { white-space: normal; }
.piece-contenu button { max-width: 100%; white-space: normal; }
@media (min-width: 900px) {
  .vaisseau-grille { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); align-items: start; }
  .vaisseau-gauche { position: static; }
}
@media (max-width: 520px) {
  .piece-faits { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .piece-faits dt { margin-top: 6px; font-size: .82rem; }
  .piece-contenu .rangee button { width: 100%; }
}
@media (forced-colors: active) {
  .piece-cargo, .piece-etapes .actuelle, .vaisseau-legende .badge, .piece-cargo > summary .badge { border-color: CanvasText; }
  .piece-cargo.prochaine { outline-color: Highlight; }
  .cargo-repere .piece-numero { background: Canvas; color: CanvasText; }
}
@media (min-width: 900px) {
  .bord-grille { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: start; }
  .bord-col-g { grid-column: 1; grid-row: 1; }
  .bord-bas { grid-column: 1; grid-row: 2; }
  .bord-col-d { grid-column: 2; grid-row: 1 / 3; }
  .bord-grille.premiere { display: flex; max-width: 640px; margin-inline: auto; }
  .premiere .bord-col-g, .premiere .bord-col-d, .premiere .bord-bas { width: 100%; }
}
@media (forced-colors: active) {
  .bord-grille .badge { border: 2px solid CanvasText; }
  .bord-grille .mauvais { border-style: dashed; }
  .bord-dette-montant, .bord-alerte h2 { color: CanvasText; }
}

/* Étude : même carte à toute largeur sur mobile. */
/* Maquette des blocs du 02/12 (Gégé : « ok go »). Proposition 2 : trois colonnes au plus, les 6 savoir-faire en 3 + 3 et non plus en 5 + 1
   en grand écran (une colonne fait au moins 30 % de la grille). Proposition 3 : à l'écran Savoir-faire, les cartes d'une rangée ont la même
   hauteur et leur bouton « Étudier » tombe au pied, comme au comptoir des packs ; un titre seul (domaine fermé) reste en haut. Pas ailleurs :
   en colonne flexible, les marges des paragraphes ne se fondent plus (+43 px sur une carte de l'onglet Organisation, qui n'a rien à aligner). */
.savoir-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, max(260px, 30%)), 1fr)); gap: 1rem; }
.savoir-grille .carte { min-width: 0; }
#panneau-savoir_faire .savoir-grille > .carte { display: flex; flex-direction: column; }
#panneau-savoir_faire .savoir-grille > .carte > .rangee:last-child { margin-top: auto; padding-top: 10px; }
.savoir-grille button { min-height: 44px; white-space: normal; }
.savoir-grille progress { width: 100%; accent-color: #c9a45c; }
.etude-active { border-color: #c9a45c; }
.carte.ferme { border-style: dashed; color: var(--texte-doux); }   /* domaine fermé : tirets et texte adouci, sans opacité (le texte reste lisible) */

@media (max-width: 600px) { .onglets { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Les trois rôles d'un gros coup (maquette du 02/12) : les trois sur une ligne quand la liste a 580 px, sinon l'un sous l'autre, jamais
   deux plus un (bascule : la colonne vaut 30 % au-dessus du seuil, 100 % en dessous) ; le bouton d'inscription au pied de chaque rôle. */
.coup-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(clamp(30%, (580px - 100%) * 999, 100%), 1fr)); gap: 1rem; list-style: none; padding: 0; }
.coup-roles > li { display: flex; flex-direction: column; }
.coup-roles > li > button:last-child { margin-top: auto; width: 100%; }

/* Chapitre 4 : la carte d'une livraison. Aucun état ne tient à la couleur seule : chaque case dit son mot, chaque caisse son signe. */
button[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.choix-livraison { border: 0; padding: 0; margin: 12px 0; min-width: 0; }
.choix-livraison legend { padding: 0; font-weight: 700; }
.choix-livraison .choix b, .choix-livraison .choix small { display: block; overflow-wrap: anywhere; }
.choix-livraison .choix small { color: var(--texte-doux); }
.cases-livraison, .livraison .caisses { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; padding: 0; list-style: none; }
.case-livraison { flex: 1 1 130px; min-width: 0; padding: 8px 10px; border: 1px solid var(--bord); border-radius: 8px; background: var(--fond-champ); }
.case-livraison small, .case-livraison b, .case-livraison span { display: block; overflow-wrap: anywhere; }
.case-livraison small { color: var(--texte-doux); font-size: .8rem; }
.livraison .caisses li { padding: 4px 8px; border: 1px solid var(--bord); border-radius: 6px; font-size: .85rem; }
.livraison .caisses li.saisie { border-style: dashed; }
.livraison .detail-livraison { margin-top: 8px; }
.etapes-expedition { margin: 8px 0; padding-left: 22px; }
.etapes-expedition li { margin: 6px 0; }

/* La fin de la dette : « Le cargo est à toi », plein écran, une seule fois (chapitre4.js) */
.scene-fin { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 24px 16px; overflow: auto; border: 0; background: var(--fond); color: var(--texte); }
.scene-fin::backdrop { background: #000; }
.scene-fin .scene-texte { max-width: 40rem; margin: 6vh auto 24px; }
.scene-fin .scene-texte:has(.scene-cine) { max-width: 60rem; margin-top: 2vh; }
.scene-fin .papier { padding: 14px 18px; border: 1px solid var(--or); border-radius: 8px; background: rgba(201, 164, 92, .1); animation: papier-pose 1.2s ease-out both; }
.scene-fin .carte { max-width: 40rem; margin: 0 auto; }
.scene-fin h1 { outline-offset: 4px; }
.carte progress { width: 100%; height: 14px; accent-color: var(--or); }
@keyframes papier-pose { from { opacity: 0; transform: translateY(-16px) rotate(-1.5deg); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .scene-fin .papier { animation: none; } }
/* Les boutons d'une scène plein écran, collés en bas partout, comme « Continuer » du dé (tour Android du 21/11 : la scène
   d'ouverture du chapitre 5 cachait ses boutons sous le bas de l'écran ; tour du 28/11 : sur ordinateur de 768 px de haut, à y = 873). */
.scene-fin { padding-bottom: 0; overscroll-behavior: contain; }   /* la page du jeu derrière ne défile pas avec la scène */
.scene-fin .scene-pied {
  position: sticky; bottom: 0; z-index: 2; max-width: none; margin: 16px -16px 0;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--fond); border-top: 1px solid var(--bord); box-shadow: 0 -10px 24px rgba(5, 4, 9, .92);
}
/* ---------- Les bandes (chapitre 4, lot 6) ---------- */
.champ label { display: block; margin-bottom: 6px; }
.raison { color: var(--mauvais); margin: 6px 0 0; }
.raison:empty { display: none; }
input[aria-invalid="true"] { border-color: var(--mauvais); border-width: 2px; }
input.code { text-transform: uppercase; letter-spacing: .2em; font-family: monospace; }
p.code { font-family: monospace; font-size: 1.8rem; letter-spacing: .25em; margin: 8px 0; overflow-wrap: anywhere; }
.membres { list-style: none; padding: 0; }
.membres li { padding: 8px 0; border-bottom: 1px solid var(--bord); }
.membres details { margin-top: 6px; }
/* Fin de la saison (chapitre 5, lot 7) : la scène lue à la demande, les titres gardés */
#fin-scene { margin: 12px 0 0; padding: 10px 14px; border-left: 3px solid var(--or-clair); background: rgba(201, 164, 92, .08); }
.titres-fin { list-style: none; margin: 8px 0; padding: 0; }
.titres-fin li { padding: 6px 0; overflow-wrap: anywhere; border-top: 1px solid var(--bord); }
@media (forced-colors: active) { #fin-scene { border-left-color: CanvasText; } }

/* Navigation guidée : chapitre, pannes en 1 clic, à faire sur place, missions par destination et carte guidée */
.puce.chapitre-puce { border-color: rgba(201, 164, 92, .5); background: rgba(201, 164, 92, .12); color: var(--or-clair); font-weight: 600; }
button.puce.panne-puce { min-height: 44px; padding: 4px 12px; border-color: var(--rouge); background: rgba(200, 90, 90, .2); color: #f6c1bd; font-size: .88rem; cursor: pointer; }
button.puce.panne-puce:hover { background: rgba(200, 90, 90, .32); }
.onglets .pt.pt-panne { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 99px; background: var(--rouge); color: #fff; font-size: .75rem; font-weight: 700; line-height: 1.3; }
.alerte-pannes-liste { display: grid; gap: 10px; margin: 10px 0; }
.alerte-panne { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; padding: 12px 14px; border: 1px solid var(--rouge); border-left-width: 4px; border-radius: 10px; background: linear-gradient(90deg, rgba(200, 90, 90, .18), rgba(22, 26, 36, .95)); }
.alerte-panne-texte { flex: 1 1 240px; min-width: 0; font-size: .92rem; }
.alerte-panne-texte strong { color: #f6c1bd; }
.a-faire-ici { border-color: rgba(201, 164, 92, .45); background: linear-gradient(165deg, rgba(30, 35, 50, .96), rgba(20, 24, 34, .98)); }
.liste-a-faire { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.a-faire-ligne { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 12px; border: 1px solid var(--bord); border-radius: 8px; background: rgba(12, 15, 22, .65); }
.a-faire-ligne.urgent { border-color: rgba(200, 90, 90, .55); background: rgba(200, 90, 90, .1); }
.a-faire-texte { flex: 1 1 220px; min-width: 0; }
.a-faire-texte small { display: block; margin-top: 2px; color: var(--texte-doux); font-size: .82rem; }
.etiquette-mission { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: .76rem; font-weight: 700; vertical-align: middle; }
.etiquette-mission.or { border: 1px solid rgba(201, 164, 92, .5); background: rgba(201, 164, 92, .16); color: var(--or-clair); }
.etiquette-mission.dest { border: 1px solid rgba(110, 168, 224, .45); background: rgba(110, 168, 224, .14); color: #b8dcff; }
.etiquette-mission.urgent { border: 1px solid rgba(200, 90, 90, .55); background: rgba(200, 90, 90, .2); color: #f6c1bd; }
.groupe-missions-titre { margin: 14px 0 6px; padding-bottom: 4px; border-bottom: 1px solid var(--bord); color: var(--or-clair); font-size: .86rem; text-transform: uppercase; letter-spacing: .04em; }
.etiquette-carte { display: block; margin-top: 2px; padding: 1px 6px; border-radius: 99px; font-size: .68rem; font-weight: 700; white-space: nowrap; transform: translate(var(--dx, 0px), var(--dy, 0px)); }
.etiquette-carte.ici { border: 1px solid rgba(92, 184, 138, .6); background: rgba(20, 48, 36, .92); color: #9ce6be; }
.etiquette-carte.objectif { border: 1px solid var(--or); background: rgba(42, 32, 16, .94); color: var(--or-clair); }
.badges-noeud {
  position: absolute; bottom: calc(100% + 3px); left: 50%; z-index: 2;
  display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
  transform: translate(calc(-50% + var(--dx, 0px)), var(--dy, 0px));
}
.pastille-missions {
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px;
  border: 1.5px solid var(--or); background: rgba(17, 14, 24, .94); color: var(--or-clair);
  font-size: .74rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
  box-shadow: 0 1px 4px #000;
}
.pastille-missions.avec-contrat {
  border-color: #fff3cf; background: var(--or-clair); color: #1a1208;
  box-shadow: 0 0 0 2px #0d0b12, 0 0 8px rgba(232, 207, 148, .75);
}
.signe-contrat { font-size: .72rem; line-height: 1; }
.signe-produit {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 4px; border-radius: 99px;
  border: 1.5px solid var(--bon); background: rgba(14, 34, 24, .94); color: #9ce6be;
  font-size: .7rem; line-height: 1; box-shadow: 0 1px 4px #000;
}
.signe-carte:has(.pastille-missions-cle, .signe-produit-cle) { width: auto; min-width: 18px; display: inline-flex; align-items: center; justify-content: center; }
.pastille-missions-cle {
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px;
  border: 1.5px solid var(--or); background: rgba(17, 14, 24, .94); color: var(--or-clair);
  font-size: .7rem; font-weight: 700; line-height: 1;
}
.pastille-missions-cle.avec-contrat { border-color: #fff3cf; background: var(--or-clair); color: #1a1208; }
.signe-produit-cle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 99px;
  border: 1.5px solid var(--bon); background: rgba(14, 34, 24, .94); color: #9ce6be;
  font-size: .68rem; line-height: 1;
}
.produit-monde { margin: 6px 0; padding: 6px 10px; border-left: 3px solid var(--bon); border-radius: 0 8px 8px 0; background: rgba(111, 207, 151, .08); color: var(--texte); }
.filtres-missions.portee-missions { margin: 6px 0 10px; }
.groupe-missions-titre.groupe-contrat { border-bottom-color: var(--or); color: var(--or-clair); }
@media (forced-colors: active) {
  .pastille-missions, .pastille-missions-cle, .signe-produit, .signe-produit-cle { forced-color-adjust: none; border-color: CanvasText; background: Canvas; color: CanvasText; }
  .pastille-missions.avec-contrat, .pastille-missions-cle.avec-contrat { background: Highlight; color: HighlightText; }
  .produit-monde { border-left-color: CanvasText; }
}
.choix-trajet-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 12px; margin-top: 10px; }
.choix-trajet-carte { padding: 12px; border: 1px solid var(--bord); border-radius: 10px; background: rgba(12, 15, 22, .65); }
.choix-trajet-carte.recommandee { border-color: rgba(201, 164, 92, .55); background: rgba(201, 164, 92, .06); }
.choix-trajet-carte h4 { margin-top: 0; }
.filtres-missions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.filtre-mission { min-height: 44px; padding: 6px 12px; border-color: var(--bord); font-size: .88rem; }
.filtre-mission[aria-pressed="true"] { border-color: var(--or); color: var(--or-clair); background: #241d30; font-weight: 700; }

/* ---------- Navigation du 18/11 : quatre onglets, la petite barre de leurs écrans, le cadre « À faire », la Cantina ---------- */
/* Le cadre « À faire » et le bandeau des rapports collent ensemble en haut de l'écran (ils ne se recouvrent plus). */
.haut-jeu { position: sticky; top: 0; z-index: 5; display: grid; gap: 6px; padding: 6px 0 4px; background: var(--fond); }
.haut-jeu .rapport-pret:not(:empty) { position: static; margin: 0; }
/* Le cadre « À faire » (afaire.js) : la phrase et son pourquoi à gauche, le seul bouton à droite, ce qui est en cours dessous. */
.afaire {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "phrase action" "pourquoi action" "cours cours";
  align-items: center; gap: 2px 16px; margin: 0; padding: 10px 14px; border: 1px solid rgba(201, 164, 92, .6); border-radius: 10px;
  background: var(--fond-carte); box-shadow: inset 4px 0 0 var(--or), 0 4px 14px rgba(0, 0, 0, .45); color: var(--texte);
}
.afaire[hidden] { display: none; }
.afaire-phrase { grid-area: phrase; margin: 0; font-size: 1rem; line-height: 1.35; }
.afaire-titre { display: inline-block; margin-right: 2px; padding: 1px 8px; border-radius: 99px; background: var(--or); color: #1d160a;
  font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; vertical-align: 2px; }
.afaire-pourquoi { grid-area: pourquoi; margin: 0; color: var(--texte-doux); font-size: .88rem; line-height: 1.35; }
.afaire-action { grid-area: action; min-height: 44px; max-width: 280px; }
.afaire-action small { display: none; }
.badge.conseil { border-color: var(--or); background: var(--or); color: #1d160a; }   /* l'approche que conseille le cadre, sur la fiche de la mission */   /* le petit texte du gros bouton de l'étape : le pourquoi le dit déjà */
.afaire-cours { grid-area: cours; margin: 6px 0 0; padding-top: 6px; border-top: 1px dashed var(--bord); color: var(--texte-doux); font-size: .85rem; }
.afaire-commande { display: block; margin-top: 4px; }
.afaire-cours b { color: var(--texte); font-weight: 600; }
.afaire-des { grid-column: 1 / -1; margin: 6px 0 0; padding-top: 6px; border-top: 1px dashed var(--bord); font-size: .88rem; }
.afaire-des b { font-weight: 600; }
.afaire-des button.lien { min-height: 40px; }
.afaire.urgent { border-color: var(--mauvais); box-shadow: inset 4px 0 0 var(--mauvais), 0 4px 14px rgba(0, 0, 0, .45); }   /* le trait, pas la couleur seule */
.afaire.urgent .afaire-pourquoi { color: var(--mauvais); }
/* « Ta dette », repliée sous le but du chapitre (bord.js) : le total, les quatre versements, verser d'avance. */
.bord-dette { margin-top: 12px; border-top: 1px solid var(--bord); }
.bord-dette > summary { min-height: 44px; padding: 10px 0; cursor: pointer; color: var(--or-clair); }
.bord-dette > summary b { color: var(--mauvais); }
/* La petite barre : les écrans d'un même onglet (Bord et Rapports ; Vaisseau, Équipage, Savoir-faire ; Cantina, Gros coups, Bande). */
.sous-nav { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.sous-nav-choix { min-height: 44px; padding: 6px 16px; border-color: var(--bord); border-radius: 99px; color: var(--texte-doux); font-size: .92rem; gap: 6px; }
.sous-nav-choix[aria-current="page"] { border-color: var(--or); background: #241d30; color: var(--or-clair); font-weight: 700; box-shadow: inset 0 -3px 0 var(--or); }
.sous-nav .chip { padding: 0 8px; border: 1px solid var(--or); border-radius: 99px; background: #2a2326; color: var(--or-clair); font-size: .78rem; font-weight: 400; }
@media (min-width: 601px) {   /* au téléphone, les pastilles de telephone.css */
  .onglets .pt.pt-n { display: inline-block; width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; background: var(--or); vertical-align: middle; }   /* un écran neuf dans cet onglet */
  .onglets .pt.pt-lire { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 99px; background: var(--or); color: #1a1208; font-size: .75rem; font-weight: 700; line-height: 1.3; }   /* rapports à lire */
}
/* L'onglet Carte : la carte, puis ce qu'on fait dans le monde choisi ; la liste des mondes, repliée, en bas. */
.mondes-en-liste { margin: 0 0 12px; padding: 4px 16px; border: 1px solid var(--bord); border-radius: 10px; background: var(--fond-carte); }
/* La Cantina */
#panneau-cantina { overflow-wrap: anywhere; }
.cantina-grille { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.cantina-carte { margin: 0; display: flex; flex-direction: column; }
.cantina-carte h3 { color: var(--or-clair); }
.cantina-carte .rangee { margin-top: auto; padding-top: 12px; }
.cantina-carte.pas-encore { border-style: dashed; background: transparent; }
.cantina-carte.pas-encore h3 { color: var(--texte-doux); }
.classement.court, .tetes { margin: 0 0 8px; padding-left: 22px; }
.classement.court li.toi { color: var(--or-clair); font-weight: 600; }

/* L'onglet Syndicat (syndicat.js) : la base, ses chiffres, ses pièces et ses recherches. */
.syndicat-chiffres { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.syndicat-onglet-organisation { gap: .35em; }   /* bouton en inline-flex : l'espace après le signe reste visible avant le nom */
.syndicat-chiffres .puce { margin: 0; }
.syndicat-chantier { margin: 12px 0; padding: 10px 14px; border: 1px solid var(--bord); border-radius: 10px; background: var(--fond-carte); }
.syndicat-ici { border-color: var(--or); }
.syndicat-piece h3 { margin-bottom: 4px; }
.syndicat-recherches { margin-top: 16px; }
.syndicat-liste { margin: 0; padding-left: 20px; display: grid; gap: 10px; }
.rangee.rangee-ligne { display: inline-flex; margin-top: 4px; align-items: center; }
.fanion-base { position: absolute; top: -8px; right: -6px; font-size: 15px; line-height: 1; color: var(--or-clair); text-shadow: 0 0 3px #000, 0 0 6px #000; pointer-events: none; }
.fanion-base.autres { color: var(--texte); opacity: .7; }
.signe-evenement { position: absolute; top: -9px; left: -9px; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; font-size: 12px; line-height: 1; color: #1a1422; background: var(--or-clair); box-shadow: 0 0 0 2px #0d0b12, 0 0 10px 2px var(--or); pointer-events: none; animation: evenement-pulse 2.4s ease-in-out infinite; }   /* un monde qui s'anime (evenements.py) : un badge doré, pas une étoile de plus dans le ciel */
.signe-evenement-cle { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; color: #1a1422; background: var(--or-clair); }
.evenement-monde { border-left: 3px solid var(--or); padding-left: 8px; }
@keyframes evenement-pulse { 50% { box-shadow: 0 0 0 2px #0d0b12, 0 0 2px 0 var(--or); } }
@media (prefers-reduced-motion: reduce) { .signe-evenement { animation: none; } }
.syndicat-scene { font-family: Georgia, "Times New Roman", serif; font-style: italic; color: var(--or-clair); }
.syndicat-ordres { margin: 16px 0; }
.syndicat-ordres-grille { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; }
.syndicat-ordres-piece h3 { margin: 0 0 4px; }
.syndicat-ordre + .syndicat-ordre { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--bord); }
.syndicat-a-lire { border-color: var(--or); box-shadow: 0 0 0 1px var(--or) inset; }
.syndicat-ordre.pas-encore h4 { color: var(--texte-doux); }
/* Ordres du Syndicat, lisibles d'un coup d'œil : l'état de chaque pièce en haut, puis les ordres possibles, puis les autres, grisés avec leur raison. Rien n'est replié. */
.syndicat-but-ordres { margin: 4px 0 10px; max-width: 70ch; }
.syndicat-etat { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.syndicat-etat-ligne { display: grid; grid-template-columns: minmax(7.5em, 11em) 1fr; gap: 4px 10px; align-items: baseline; padding: 6px 10px; border: 1px solid var(--bord); border-left-width: 4px; border-radius: 8px; background: var(--fond-carte); overflow-wrap: anywhere; }
.syndicat-etat-ligne.libre { border-left-color: #6fbf73; }
.syndicat-etat-ligne.ok { border-left-color: var(--or); background: rgba(201, 164, 92, .10); }
.syndicat-etat-ligne.attente { border-left-color: #6a8fd0; }
.syndicat-etat-ligne.manque { border-left-color: #d08a4a; }
.syndicat-etat-ligne.ferme { border-left-color: var(--bord); color: var(--texte-doux); }
.syndicat-etat-piece { color: var(--or); }
@media (max-width: 600px) { .syndicat-etat-ligne { grid-template-columns: 1fr; } }
.syndicat-stock { margin: 6px 0 12px; }
.syndicat-ordre-texte { margin: 4px 0; }
.syndicat-ligne { margin: 3px 0; font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.syndicat-ligne .chance { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.syndicat-raison { margin: 8px 0 0; padding: 6px 8px; border-left: 3px solid #d08a4a; background: rgba(208, 138, 74, .08); border-radius: 0 6px 6px 0; color: var(--texte); }
.syndicat-sous-titre { margin: 14px 0 4px; font-size: 14px; color: var(--texte-doux); }
.syndicat-ordre-bloc + .syndicat-ordre-bloc { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--bord); }
.syndicat-ordre-bloc .syndicat-ordre + .syndicat-ordre { margin-top: 0; padding-top: 0; border-top: 0; }
.syndicat-indispo { opacity: .78; }
.syndicat-indispo h4 { color: var(--texte-doux); }
.syndicat-indispo .syndicat-raison { opacity: 1; }
.syndicat-pillage-bloc { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--bord); }   /* le pillage d'une base, sous les raids du corsaire (lot 8) */
.syndicat-pillage-bloc > .syndicat-ordre { border-top: 0; margin-top: 8px; padding-top: 0; }
/* La flotte (syndicat.js, lot 5) : tes vaisseaux, leurs ordres, le chantier naval de chaque base. */
.syndicat-choix label { margin: 8px 0 4px; }
.syndicat-navire bdi, .syndicat-chantier-naval bdi { unicode-bidi: isolate; overflow-wrap: anywhere; }
.syndicat-navire h3 { overflow-wrap: anywhere; }
.syndicat-chantiers-navals { margin-top: 18px; }
.syndicat-chantier-naval { margin-top: 12px; }
.syndicat-chantier-naval .rangee button { flex: 1 1 13em; }
.syndicat-sorte h3 { margin-bottom: 4px; }
/* Le syndicat et les mondes tenus (organisation.js, lot 7) : anneau sur la carte, pastilles, choix de couleur. */
.noeud.tenu .planete::before {
  content: ""; position: absolute; inset: -7px; border-radius: 50%; pointer-events: none;
  border: 2.5px solid var(--syndicat-couleur); box-shadow: 0 0 8px var(--syndicat-couleur);
}
.noeud.tenu-mien .planete::before {
  inset: -8px; border-width: 3.5px; box-shadow: 0 0 0 1.5px #0d0b12, 0 0 12px var(--syndicat-couleur);
}
.plateau-carte.loin .noeud.tenu .planete::before { inset: -4px; border-width: 2px; }
.nom-noeud.syndicat-noeud { font-size: clamp(.68rem, 2vw, .76rem); color: var(--texte); opacity: .95;
  position: absolute; top: 100%; left: 50%; transform: translate(calc(-50% + var(--dx, 0px)), var(--dy, 0px)); }   /* hors du flux : la planète reste sur son point, comme un monde non tenu */
.anneau-syndicat-cle {
  display: inline-block; width: 14px; height: 14px; box-sizing: border-box; border-radius: 50%;
  border: 2.5px solid var(--or-clair); box-shadow: 0 0 5px rgba(232, 207, 148, .6);
}
.pastille-syndicat {
  display: inline-block; flex: none; width: .75em; height: .75em; margin-right: .35em; vertical-align: -.08em;   /* flex: none : jamais écrasée en trait dans un choix */
  border-radius: 50%; background: var(--syndicat-couleur, transparent); border: 1.5px solid rgba(255, 255, 255, .75);
}
.syndicat-equipage { color: var(--texte-doux); font-size: .92em; }
.monde-tenu-encart { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--or); border-radius: 0 8px 8px 0; background: rgba(201, 164, 92, .08); }
.monde-tenu-encart p:last-child { margin-bottom: 0; }
.couleurs-syndicat { margin: 12px 0 8px; min-width: 0; }
.couleurs-grille { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.choix-couleur { align-items: center; margin: 0; min-height: 44px; }
.syndicats-bordure, .mondes-syndicat { list-style: none; margin: 8px 0; padding: 0; }
.syndicats-bordure li, .mondes-syndicat li { padding: 8px 0; border-top: 1px solid var(--bord); overflow-wrap: anywhere; }
.syndicats-bordure li:first-child, .mondes-syndicat li:first-child { border-top: 0; }
@media (forced-colors: active) {
  .noeud.tenu .planete::before, .anneau-syndicat-cle, .pastille-syndicat { forced-color-adjust: none; }
}

/* ---------- Lot E1 : les espèces (choix à la création et sur le Bord, portrait 64 px, fiche du capitaine) ---------- */
.choix-especes { margin: 14px 0 8px; min-width: 0; }
.especes-grille { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) {
  main:has(#vue-creation:not([hidden])) { max-width: 920px; }
  .especes-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
label.choix.choix-espece { margin: 0; padding: 12px; align-items: flex-start; cursor: pointer; }
.espece-corps { flex: 1 1 auto; min-width: 0; }
.espece-tete { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.espece-titre { flex: 1 1 auto; min-width: 0; }
.espece-nom-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.espece-phrase { margin: 4px 0 0; }
.portrait-espece {
  flex: none; width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--or); background: #241d30; color: var(--or-clair);
  display: inline-flex; align-items: center; justify-content: center;
  font: 600 1.5rem/1 Georgia, "Times New Roman", serif;
}
.portrait-espece-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait-initiale { user-select: none; }
.repli-choix { margin-top: 6px; }
.repli-choix > summary { cursor: pointer; font-size: .92rem; color: var(--or-clair); min-height: 44px; display: flex; align-items: center; }
.repli-choix > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.repli-choix[open] > summary { margin-bottom: 2px; }
@media (max-width: 600px) {   /* la page de création tenait en 8 écrans : cartes plus serrées au téléphone */
  label.choix.choix-espece { padding: 8px 10px; gap: 8px; }
  .choix-espece .espece-tete { margin-bottom: 0; gap: 10px; }
  .choix-espece .portrait-espece { width: 48px; height: 48px; font-size: 1.2rem; }
  .choix-espece .espece-phrase { font-size: .92rem; line-height: 1.3; }
  .especes-grille { gap: 8px; }
}
.espece-effets { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: .92rem; }
.espece-effets li { padding: 4px 8px; border-radius: 0 6px 6px 0; overflow-wrap: anywhere; }
.espece-plus { border-left: 3px solid var(--bon); background: rgba(111, 207, 151, .07); color: var(--texte); }
.espece-plus b, .espece-plus .espece-signe { color: var(--bon); }
.espece-moins { border-left: 3px dashed var(--mauvais); background: rgba(239, 123, 123, .07); color: var(--texte); }
.espece-moins b, .espece-moins .espece-signe { color: var(--mauvais); }
.carte-espece-capitaine {
  margin: 10px 0 12px; padding: 12px; border: 1px solid var(--bord); border-radius: 10px;
  background: var(--fond-champ);
}
.bord-espece { border-color: var(--or); }
.competences-liste { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.competence-valeur { text-align: right; }
.competence-espece { font-weight: 400; }
@media (forced-colors: active) {
  .espece-plus { border-left: 3px solid CanvasText; }
  .espece-moins { border-left: 3px dashed CanvasText; }
  .portrait-espece { border-color: CanvasText; }
}

/* ---------- Lot P1 : le pack du jour, son ouverture en CSS 3D et ta main (packs.js) ---------- */
.bord-pack { border-color: var(--or); background: linear-gradient(150deg, #241c33, var(--fond-carte)); }
.bord-pack-prochain { margin: 0; padding: 8px 12px; border: 1px dashed var(--bord); border-radius: 10px; background: var(--fond-carte); }
.pack-attente { margin: 4px 0 8px; }
.pack-chances { margin-top: 12px; border-top: 1px solid var(--bord); padding-top: 6px; }
.pack-chances > summary { color: var(--or-clair); font-weight: 600; }
.pack-garantie { margin: 8px 0; padding: 8px 10px; border-left: 3px solid var(--or-clair); background: rgba(201, 164, 92, .12); font-weight: 600; }
.pack-tableau-chances { margin: 8px 0; font-size: .92rem; }

/* Le paquet : sachet métallisé à deux faces, en CSS seul (nuit violette et or du jeu) */
.paquet-scene { perspective: 900px; display: flex; justify-content: center; margin: 12px 0; }
.paquet-3d {
  position: relative; width: 164px; height: 228px; transform-style: preserve-3d;
  transition: transform .4s ease-out;
}
.paquet-3d.tourne {
  animation: paquet-rotation 1.5s cubic-bezier(.22, .61, .36, 1) forwards;
}
.paquet-3d.tourne.rare {
  animation: paquet-rotation-rare 1.1s cubic-bezier(.18, .72, .32, 1) forwards;
}
/* La lueur d'un pack rare : sur les faces. Un `filter` sur .paquet-3d aplatirait la 3D (le nom se lirait à l'envers en tournant). */
.paquet-3d.tourne.rare .paquet-face { box-shadow: inset 0 0 0 3px rgba(13, 11, 18, .85), 0 0 22px rgba(232, 207, 148, .75); }
@keyframes paquet-rotation {
  0% { transform: rotateY(0deg) scale(.92); }
  50% { transform: rotateY(360deg) scale(1.04) rotateZ(-2deg); }
  100% { transform: rotateY(720deg) scale(1); }
}
@keyframes paquet-rotation-rare {
  0% { transform: rotateY(0deg) scale(.9); }
  45% { transform: rotateY(540deg) scale(1.08) rotateZ(3deg); }
  100% { transform: rotateY(1080deg) scale(1); }
}
.paquet-haut {
  position: absolute; top: 0; left: 0; right: 0; height: 30px; z-index: 3; border-radius: 10px 10px 0 0; overflow: hidden;
  background: repeating-linear-gradient(90deg, #2d2340 0 4px, #1b1528 4px 8px), linear-gradient(180deg, var(--or), #251c35);
  border: 2px solid var(--or); border-bottom: 1.5px dashed var(--or-clair);
  transform-origin: 80% 100%;
}
.paquet-entaille {
  position: absolute; right: 10px; bottom: -2px; width: 10px; height: 6px;
  background: var(--fond); clip-path: polygon(100% 0, 0 50%, 100% 100%);
}
.paquet-corps { position: absolute; inset: 28px 0 0 0; transform-style: preserve-3d; }
.paquet-face {
  position: absolute; inset: 0; border-radius: 0 0 12px 12px; backface-visibility: hidden; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, #32264a, var(--fond-carte) 65%, #0e0b14 100%);
  border: 2px solid var(--or); border-top: 0;
  box-shadow: inset 0 0 0 3px rgba(13, 11, 18, .85), 0 10px 24px rgba(0, 0, 0, .55);
  display: flex; align-items: stretch; justify-content: center; padding: 10px;
}
.paquet-arriere { transform: rotateY(180deg); background: linear-gradient(135deg, #1b1526, #0d0b12 50%, #241c33); }
.paquet-couture { position: absolute; top: 0; bottom: 0; left: 50%; width: 4px; transform: translateX(-50%); background: rgba(201, 164, 92, .35); }
.paquet-lisere {
  position: relative; z-index: 1; flex: 1; border: 1px solid rgba(232, 207, 148, .55); border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px; text-align: center;
}
.paquet-sceau { font-size: 1.8rem; color: var(--or-clair); text-shadow: 0 0 10px rgba(232, 207, 148, .65); line-height: 1; }
.paquet-nom { font-family: Georgia, "Times New Roman", serif; font-size: 1rem; color: var(--or-clair); line-height: 1.2; }
.paquet-sous, .paquet-marque { font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--texte-doux); }
.paquet-reflet {
  position: absolute; inset: -40% -90%; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(232, 207, 148, .28) 47%, rgba(255, 255, 255, .52) 50%, rgba(201, 164, 92, .28) 53%, transparent 60%);
  transform: translateX(-55%);
}
.paquet-3d.tourne .paquet-reflet { animation: paquet-reflet-glisse 1.5s ease-in-out forwards; }
.paquet-3d.tourne.rare .paquet-reflet { animation: paquet-reflet-glisse 1.1s ease-in-out forwards; }
@keyframes paquet-reflet-glisse {
  0% { transform: translateX(-60%); }
  50% { transform: translateX(55%); }
  100% { transform: translateX(15%); }
}
.paquet-3d.dechire .paquet-haut {
  animation: paquet-dechirure .5s ease-out forwards;
}
@keyframes paquet-dechirure {
  to { transform: translate(38px, -48px) rotate(18deg) scale(.85); opacity: 0; }
}
.ouverture-paquet-zone .paquet-3d.dechire { height: 74px; opacity: .55; transform: scale(.78); }
.ouverture-paquet-zone .paquet-3d.dechire .paquet-corps { display: none; }

/* Fenêtre d'ouverture du pack, comme un booster : une scène sombre sous un projecteur, le paquet qu'on touche pour l'ouvrir, l'éclair,
   les cartes qui jaillissent face cachée (les belles brillent déjà de leur couleur), puis chacune qui se soulève et se retourne dans un
   éclat. Les temps sont ceux de packs.js (TEMPS_PACK, RETOURNEMENT_PACK, ROULETTE_PACK). La classe de .ouverture-boite dit l'étape :
   phase-arrivee (le paquet arrive en tournant), phase-pret (il flotte et attend), phase-ouvre (il s'emballe et éclate), phase-roulette
   (la roulette tire les cartes une à une ; roulette-visible quand la bande est là), phase-cartes (sans roulette possible), phase-fin. */
.ouverture-pack {
  position: fixed; inset: 0; z-index: 55; display: flex; align-items: flex-start; justify-content: center;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 12px calc(24px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto; background: rgba(8, 6, 13, .94);
}
.ouverture-boite {   /* overflow: clip, pas hidden : la fenêtre ne défile jamais, même quand un éclat déborde */
  position: relative; overflow: hidden; overflow: clip; isolation: isolate;
  width: min(100%, 48rem); margin: auto; padding: 18px 16px; border: 1px solid var(--or); border-radius: 14px;
  background: radial-gradient(ellipse 70% 52% at 50% 26%, #3b2d55 0%, #251c35 46%, var(--fond-carte) 78%);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .75);
  text-align: center;
}
.ouverture-quitter { position: relative; z-index: 8; display: flex; justify-content: flex-end; margin: -4px 0 4px; }
.bouton-quitter-pack { min-height: 44px; min-width: 88px; }
.ouverture-boite > h2, .ouverture-consigne, .ouverture-actions, .pack-annonce { position: relative; z-index: 7; }
.ouverture-consigne { margin-bottom: 4px; min-height: 1.4em; }
.ouverture-actions { justify-content: center; }
.pack-annonce { min-height: 1.5em; margin: 10px 0 0; color: var(--or-clair); font-weight: 600; }
.ouverture-scene { position: relative; display: grid; justify-items: center; align-items: start; min-height: 290px; margin: 4px 0 8px; }
.ouverture-scene > .ouverture-paquet-zone, .ouverture-scene > .ouverture-cartes, .ouverture-scene > .ouverture-roulette { grid-area: 1 / 1; }

/* Les rayons du projecteur, qui tournent lentement derrière le paquet, et la poussière d'or qui monte */
.ouverture-rayons {
  position: absolute; left: 50%; top: 132px; width: 680px; height: 680px; margin: -340px 0 0 -340px; z-index: 0; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(232, 207, 148, .17) 0deg 5deg, transparent 5deg 15deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, .55) 32%, transparent 62%);
  mask-image: radial-gradient(circle, #000 0, rgba(0, 0, 0, .55) 32%, transparent 62%);
  opacity: 0; scale: .6;
  transition: opacity .9s ease, scale .9s ease;
  animation: rayons-tournent 48s linear infinite;
}
@keyframes rayons-tournent { to { rotate: 360deg; } }
.pack-rare .ouverture-rayons { background: repeating-conic-gradient(from 0deg, rgba(255, 210, 120, .28) 0deg 5deg, transparent 5deg 13deg); }
.phase-arrivee .ouverture-rayons { opacity: .35; scale: .8; }
.phase-pret .ouverture-rayons { opacity: .8; scale: 1; }
.phase-ouvre .ouverture-rayons { opacity: 1; scale: 1.4; transition-duration: .45s; }
.phase-roulette .ouverture-rayons, .phase-cartes .ouverture-rayons, .phase-fin .ouverture-rayons { opacity: .3; scale: 1.7; }
.ouverture-poussiere {
  position: absolute; left: 50%; top: 0; width: 320px; height: 300px; margin-left: -160px; z-index: 1; pointer-events: none;
  opacity: 0; transition: opacity .8s;
}
.phase-pret .ouverture-poussiere, .phase-ouvre .ouverture-poussiere { opacity: 1; }
.phase-roulette .ouverture-poussiere, .phase-cartes .ouverture-poussiere, .phase-fin .ouverture-poussiere { opacity: .45; }
.ouverture-poussiere i {
  position: absolute; bottom: 30px; width: 3px; height: 3px; border-radius: 50%;
  background: #f6e2a6; box-shadow: 0 0 6px 1px rgba(246, 226, 166, .85); opacity: 0;
  animation: poussiere-monte 3.4s linear infinite;
}
.pack-rare .ouverture-poussiere i { width: 4px; height: 4px; background: #ffd27a; box-shadow: 0 0 8px 2px rgba(255, 196, 90, .9); }
@keyframes poussiere-monte {
  0% { opacity: 0; transform: translate(0, 0) scale(.5); }
  15% { opacity: 1; }
  80% { opacity: .8; }
  100% { opacity: 0; transform: translate(var(--vx, 0px), -250px) scale(1.1); }
}

/* Le paquet : il arrive en tournant (.tourne), flotte sous un halo qui respire, grossit sous le pointeur ; touché, il s'emballe, son
   haut se déchire et il éclate dans un éclair. */
.ouverture-paquet-zone {
  position: relative; z-index: 2; margin-top: 18px; border-radius: 16px; cursor: pointer; outline-offset: 8px;
  transition: scale .25s ease-out;
}
.ouverture-paquet-zone .paquet-scene { margin: 0; }
.ouverture-paquet-zone::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 320px; height: 320px; margin: -160px 0 0 -160px; z-index: -1;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(232, 207, 148, .5), rgba(201, 164, 92, .14) 45%, transparent 70%);
  opacity: 0; transition: opacity .6s, scale .6s;
}
.pack-rare .ouverture-paquet-zone::before { background: radial-gradient(circle, rgba(255, 214, 120, .75), rgba(232, 150, 60, .22) 45%, transparent 70%); }
.phase-pret .ouverture-paquet-zone::before { opacity: 1; animation: halo-respire 2.4s ease-in-out infinite; }
.phase-ouvre .ouverture-paquet-zone::before { opacity: 1; scale: 1.5; }
@keyframes halo-respire { 0%, 100% { scale: .88; opacity: .7; } 50% { scale: 1.08; opacity: 1; } }
@media (hover: hover) { .phase-pret .ouverture-paquet-zone:hover { scale: 1.05; } }
.phase-ouvre .ouverture-paquet-zone, .phase-roulette .ouverture-paquet-zone, .phase-cartes .ouverture-paquet-zone,
.phase-fin .ouverture-paquet-zone { pointer-events: none; }
.ouverture-boite.phase-pret .paquet-3d { animation: paquet-flotte 3.2s ease-in-out infinite; }
@keyframes paquet-flotte {
  0%, 100% { transform: translateY(0) rotateY(-12deg) rotateX(4deg); }
  50% { transform: translateY(-12px) rotateY(12deg) rotateX(-3deg); }
}
.ouverture-boite.phase-pret .paquet-3d .paquet-face { box-shadow: inset 0 0 0 3px rgba(13, 11, 18, .85), 0 0 26px rgba(232, 207, 148, .5); }
.ouverture-boite.pack-rare.phase-pret .paquet-3d .paquet-face { box-shadow: inset 0 0 0 3px rgba(13, 11, 18, .85), 0 0 34px rgba(255, 200, 100, .8); }
.ouverture-boite.phase-pret .paquet-3d .paquet-reflet { animation: paquet-reflet-boucle 2.6s ease-in-out infinite; }
@keyframes paquet-reflet-boucle { 0% { transform: translateX(-60%); } 55%, 100% { transform: translateX(60%); } }
.ouverture-boite.phase-ouvre .paquet-3d {
  animation: paquet-charge .62s cubic-bezier(.55, 0, .85, .35) forwards, paquet-eclate .34s ease-out .6s forwards;
}
@keyframes paquet-charge {
  0% { transform: rotateY(0deg) rotateZ(0deg) scale(1); }
  25% { transform: rotateY(110deg) rotateZ(-2deg) scale(1.03); }
  50% { transform: rotateY(300deg) rotateZ(2.5deg) scale(1.07); }
  75% { transform: rotateY(520deg) rotateZ(-3deg) scale(1.11); }
  100% { transform: rotateY(720deg) rotateZ(0deg) scale(1.15); }
}
@keyframes paquet-eclate {
  from { opacity: 1; transform: rotateY(720deg) rotateZ(0deg) scale(1.15); }
  to { opacity: 0; transform: rotateY(720deg) rotateZ(0deg) scale(1.75); }
}
.ouverture-boite.phase-ouvre .paquet-3d .paquet-face {
  box-shadow: inset 0 0 0 3px rgba(13, 11, 18, .85), 0 0 46px rgba(255, 236, 190, .95); transition: box-shadow .5s ease-in;
}
.ouverture-boite.phase-ouvre .paquet-haut { animation: paquet-dechirure .42s ease-out .48s forwards; }
.ouverture-flash {
  position: absolute; left: 50%; top: 132px; width: 560px; height: 560px; margin: -280px 0 0 -280px; z-index: 6; pointer-events: none;
  border-radius: 50%; opacity: 0; scale: .2;
  background: radial-gradient(circle, #fffdf6 0, rgba(255, 240, 200, .95) 16%, rgba(232, 194, 90, .55) 38%, transparent 68%);
}
.pack-rare .ouverture-flash { background: radial-gradient(circle, #fffdf6 0, rgba(255, 226, 150, 1) 18%, rgba(255, 170, 60, .6) 42%, transparent 70%); }
.phase-ouvre .ouverture-flash { animation: ouverture-flash .8s ease-out .56s forwards; }
@keyframes ouverture-flash { 0% { opacity: 0; scale: .2; } 16% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: 1.9; } }

/* Les cartes jaillissent du paquet (--d : leur écart au centre ; --i : leur rang) et se posent face cachée */
.ouverture-cartes {
  position: relative; z-index: 3; width: 100%;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 0; padding-top: 6px; perspective: 1000px;
}
.ouverture-cartes:not(.sorties) { opacity: 0; pointer-events: none; }
.ouverture-cartes.sorties .carte-tirage {
  animation: carte-jaillit .6s cubic-bezier(.2, .85, .3, 1.15) both;
  animation-delay: calc(.72s + var(--i, 0) * .13s);
}
@keyframes carte-jaillit {
  0% { opacity: 0; transform: translate(calc(var(--d, 0) * 105%), -70px) scale(.3) rotate(calc(var(--d, 0) * -18deg)); }
  45% { opacity: 1; }
  100% { opacity: 1; transform: none; }
}
.carte-tirage {
  position: relative; isolation: isolate; flex: 0 1 205px; width: 205px; min-height: 276px; perspective: 900px;
  cursor: pointer; border-radius: 12px; text-align: left;
  --t-flip: .4s;
}
.carte-tirage.rarete-rare, .carte-tirage.rarete-epique { --t-flip: .7s; }
.carte-tirage.rarete-legendaire { --t-flip: 1s; }
.carte-tirage:focus-visible { outline: 2px solid var(--or-clair); outline-offset: 4px; }
.carte-tirage-3d {
  position: relative; width: 100%; min-height: 276px; transform-style: preserve-3d;
  transition: transform .25s ease-out;
}
.carte-tirage.retournee .carte-tirage-3d { transform: rotateY(180deg); transition-duration: .55s; }
@media (hover: hover) {
  .ouverture-cartes.sorties .carte-tirage.face-cachee:hover .carte-tirage-3d { transform: translateY(-10px) scale(1.04); }
}
.carte-face {
  border-radius: 12px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
.carte-dos {
  position: absolute; inset: 0; border: 2px solid var(--or);
  background: radial-gradient(circle at 50% 40%, #2c2240, var(--fond-carte) 72%);
  box-shadow: inset 0 0 0 4px rgba(13, 11, 18, .8), inset 0 0 0 5px rgba(201, 164, 92, .4), 0 6px 16px rgba(0, 0, 0, .45);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px; text-align: center;
}
.carte-dos-sceau { font-size: 2.2rem; color: var(--or-clair); }
.carte-dos-texte { font-family: Georgia, "Times New Roman", serif; color: var(--or-clair); font-size: .95rem; }
.carte-recto {
  position: relative; width: 100%; min-height: 276px; transform: rotateY(180deg);
  padding: 12px; background: var(--fond-carte);
  border: 2.5px solid var(--rarete-couleur, var(--bord));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 6px 18px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column; gap: 6px;
}

/* Face cachée, une belle carte s'annonce : une peu commune luit, une rare, une épique ou une légendaire palpite de sa couleur, et une
   légendaire tremble. Comme dans un booster, on sait qu'elle est là avant de la voir. */
.carte-tirage.face-cachee.rarete-peu_commune .carte-dos {
  box-shadow: inset 0 0 0 4px rgba(13, 11, 18, .8), inset 0 0 0 5px rgba(201, 164, 92, .4), 0 0 12px rgba(192, 102, 46, .55);
}
.carte-tirage.face-cachee.rarete-rare .carte-dos,
.carte-tirage.face-cachee.rarete-epique .carte-dos,
.carte-tirage.face-cachee.rarete-legendaire .carte-dos { animation: dos-lueur 1.5s ease-in-out infinite; }
.carte-tirage.face-cachee.rarete-legendaire .carte-dos { animation-duration: 1s; }
@keyframes dos-lueur {
  0%, 100% { box-shadow: inset 0 0 0 4px rgba(13, 11, 18, .8), inset 0 0 18px rgba(255, 255, 255, .06), 0 0 10px 0 var(--rarete-couleur, #e8c25a); }
  50% { box-shadow: inset 0 0 0 4px rgba(13, 11, 18, .8), inset 0 0 26px rgba(255, 255, 255, .14), 0 0 28px 6px var(--rarete-couleur, #e8c25a); }
}
.carte-tirage.face-cachee.rarete-legendaire .carte-dos-sceau { color: #ffe9a8; text-shadow: 0 0 14px #e8c25a; }
.carte-tirage.face-cachee.rarete-legendaire .carte-tirage-3d { animation: dos-tremble 2.4s ease-in-out infinite; }
@keyframes dos-tremble {
  0%, 78%, 100% { transform: rotate(0deg); }
  82% { transform: rotate(-1.2deg); }
  86% { transform: rotate(1.2deg); }
  90% { transform: rotate(-.8deg); }
  94% { transform: rotate(.6deg); }
}
.carte-tirage.brille-rare .carte-recto { box-shadow: 0 0 16px rgba(90, 134, 208, .65), inset 0 0 10px rgba(232, 207, 148, .35); }
.carte-tirage.brille-rare.face-cachee::after {
  content: ""; position: absolute; inset: -3px; border-radius: 14px; pointer-events: none;
  border: 2px solid var(--or-clair); animation: carte-brille 1.4s ease-in-out infinite alternate;
}
@keyframes carte-brille { from { opacity: .35; transform: scale(.99); } to { opacity: 1; transform: scale(1.02); } }

/* Touchée, la carte se soulève et se retourne (une belle carte est secouée avant) ; à l'instant où elle montre sa face (--t-flip,
   plus --j × 0,3 s pour « Tout retourner »), un halo de sa couleur, une onde, des rayons et des éclats pour une épique ou une
   légendaire, et son gain qui s'envole. */
.carte-tirage.revele .carte-tirage-3d {
  animation: carte-revele .7s cubic-bezier(.3, .7, .3, 1) both;
  animation-delay: calc(var(--j, 0) * .3s);
}
.carte-tirage.revele.rarete-rare .carte-tirage-3d,
.carte-tirage.revele.rarete-epique .carte-tirage-3d { animation-name: carte-revele-belle; animation-duration: 1s; }
.carte-tirage.revele.rarete-legendaire .carte-tirage-3d { animation-name: carte-revele-legendaire; animation-duration: 1.4s; }
@keyframes carte-revele {
  0% { transform: translateY(0) scale(1) rotateY(0deg) rotateZ(0deg); }
  38% { transform: translateY(-16px) scale(1.08) rotateY(0deg) rotateZ(0deg); }
  100% { transform: translateY(0) scale(1) rotateY(180deg) rotateZ(0deg); }
}
@keyframes carte-revele-belle {
  0% { transform: translateY(0) scale(1) rotateY(0deg) rotateZ(0deg); }
  28% { transform: translateY(-22px) scale(1.14) rotateY(0deg) rotateZ(0deg); }
  36% { transform: translateY(-22px) scale(1.14) rotateY(0deg) rotateZ(-2.5deg); }
  44% { transform: translateY(-22px) scale(1.14) rotateY(0deg) rotateZ(2.5deg); }
  52% { transform: translateY(-22px) scale(1.15) rotateY(0deg) rotateZ(-1.5deg); }
  58% { transform: translateY(-22px) scale(1.15) rotateY(0deg) rotateZ(0deg); }
  100% { transform: translateY(0) scale(1) rotateY(180deg) rotateZ(0deg); }
}
@keyframes carte-revele-legendaire {
  0% { transform: translateY(0) scale(1) rotateY(0deg) rotateZ(0deg); }
  22% { transform: translateY(-26px) scale(1.18) rotateY(0deg) rotateZ(0deg); }
  30% { transform: translateY(-26px) scale(1.18) rotateY(0deg) rotateZ(-3deg); }
  36% { transform: translateY(-26px) scale(1.19) rotateY(0deg) rotateZ(3deg); }
  42% { transform: translateY(-26px) scale(1.19) rotateY(0deg) rotateZ(-3.5deg); }
  48% { transform: translateY(-26px) scale(1.2) rotateY(0deg) rotateZ(3.5deg); }
  54% { transform: translateY(-26px) scale(1.2) rotateY(0deg) rotateZ(-2deg); }
  60% { transform: translateY(-26px) scale(1.2) rotateY(0deg) rotateZ(0deg); }
  100% { transform: translateY(0) scale(1) rotateY(180deg) rotateZ(0deg); }
}
.carte-halo {
  position: absolute; inset: -28%; z-index: -1; pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle, var(--rarete-couleur, #fffaf0) 0, transparent 62%);
  opacity: 0; scale: .4;
}
.carte-tirage.revele .carte-halo { animation: carte-halo-doux .9s ease-out forwards; animation-delay: calc(var(--j, 0) * .3s + var(--t-flip)); }
.carte-tirage.revele.rarete-rare .carte-halo,
.carte-tirage.revele.rarete-epique .carte-halo,
.carte-tirage.revele.rarete-legendaire .carte-halo { animation-name: carte-halo; animation-duration: 1.2s; }
@keyframes carte-halo-doux { 0% { opacity: 0; scale: .5; } 30% { opacity: .35; scale: 1; } 100% { opacity: 0; scale: 1.1; } }
@keyframes carte-halo { 0% { opacity: 0; scale: .4; } 22% { opacity: 1; scale: 1.15; } 100% { opacity: .4; scale: 1; } }
.carte-onde {
  position: absolute; left: 50%; top: 50%; width: 90%; aspect-ratio: 1; translate: -50% -50%; z-index: 5; pointer-events: none;
  border-radius: 50%; border: 3px solid var(--rarete-couleur, #e8c25a); box-shadow: 0 0 18px var(--rarete-couleur, #e8c25a);
  opacity: 0; scale: .3;
}
.carte-tirage.revele.rarete-rare .carte-onde,
.carte-tirage.revele.rarete-epique .carte-onde,
.carte-tirage.revele.rarete-legendaire .carte-onde {
  animation: carte-onde .85s ease-out forwards; animation-delay: calc(var(--j, 0) * .3s + var(--t-flip));
}
@keyframes carte-onde { 0% { opacity: .95; scale: .3; } 100% { opacity: 0; scale: 2.3; } }
.carte-rayons {
  position: absolute; left: 50%; top: 50%; width: 190%; aspect-ratio: 1; translate: -50% -50%; z-index: -2; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, var(--rarete-couleur, #e8c25a) 0deg 6deg, transparent 6deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 12%, transparent 60%);
  mask-image: radial-gradient(circle, #000 12%, transparent 60%);
  opacity: 0;
}
.carte-tirage.revele .carte-rayons {
  animation: carte-rayons 1.4s ease-out forwards, rayons-tournent 14s linear infinite;
  animation-delay: calc(var(--j, 0) * .3s + var(--t-flip)), 0s;
}
@keyframes carte-rayons { 0% { opacity: 0; scale: .5; } 25% { opacity: .9; scale: 1.1; } 100% { opacity: .38; scale: 1; } }
.carte-eclats { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.carte-eclats i {
  position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; border-radius: 2px;
  background: var(--rarete-couleur, var(--or-clair)); box-shadow: 0 0 6px var(--rarete-couleur, var(--or-clair));
  opacity: 0; transform: translate(-50%, -50%) rotate(45deg);
}
.carte-tirage.eclats-actifs .carte-eclats i { --t0: calc(var(--j, 0) * .3s + var(--t-flip)); animation: carte-eclat .8s ease-out forwards; }
.carte-tirage.eclats-actifs .carte-eclats i:nth-child(1) { --ex: -78px; --ey: -88px; animation-delay: var(--t0); }
.carte-tirage.eclats-actifs .carte-eclats i:nth-child(2) { --ex: 82px; --ey: -82px; animation-delay: calc(var(--t0) + .04s); }
.carte-tirage.eclats-actifs .carte-eclats i:nth-child(3) { --ex: -96px; --ey: 12px; animation-delay: calc(var(--t0) + .08s); }
.carte-tirage.eclats-actifs .carte-eclats i:nth-child(4) { --ex: 96px; --ey: 16px; animation-delay: calc(var(--t0) + .06s); }
.carte-tirage.eclats-actifs .carte-eclats i:nth-child(5) { --ex: -68px; --ey: 92px; animation-delay: calc(var(--t0) + .1s); }
.carte-tirage.eclats-actifs .carte-eclats i:nth-child(6) { --ex: 74px; --ey: 88px; animation-delay: calc(var(--t0) + .12s); }
@keyframes carte-eclat {
  0% { opacity: 1; transform: translate(-50%, -50%) scale(.6) rotate(45deg); }
  70% { opacity: .95; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--ex, 0px)), calc(-50% + var(--ey, 0px))) scale(1.25) rotate(135deg); }
}
.carte-gain-envol {
  position: absolute; left: 0; right: 0; top: 16%; z-index: 6; pointer-events: none; text-align: center; white-space: nowrap;
  font-family: Georgia, "Times New Roman", serif; font-size: 1.2rem; font-weight: 700; color: #ffe9a8;
  text-shadow: 0 2px 6px #000, 0 0 14px rgba(232, 194, 90, .9); opacity: 0;
}
.carte-tirage.revele .carte-gain-envol {
  animation: gain-envol 1.7s ease-out forwards; animation-delay: calc(var(--j, 0) * .3s + var(--t-flip) + .2s);
}
@keyframes gain-envol {
  0% { opacity: 0; transform: translateY(14px) scale(.7); }
  14% { opacity: 1; transform: translateY(0) scale(1.15); }
  70% { opacity: 1; transform: translateY(-40px) scale(1); }
  100% { opacity: 0; transform: translateY(-60px) scale(1); }
}

/* Sous mouvement réduit : ni projecteur, ni paquet, ni vol ; les cartes sont retournées tout de suite (packs.js) */
.ouverture-boite.calme .ouverture-rayons, .ouverture-boite.calme .ouverture-poussiere, .ouverture-boite.calme .ouverture-flash { display: none; }
.ouverture-boite.calme *, .ouverture-boite.calme *::before, .ouverture-boite.calme *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .ouverture-boite *, .ouverture-boite *::before, .ouverture-boite *::after { animation: none !important; transition: none !important; }
  .ouverture-rayons, .ouverture-poussiere, .ouverture-flash { display: none; }
}

/* La roulette, comme celle de c411 : une bande de cartes tirées aux chances publiées défile sous le repère, ralentit et s'arrête sur
   la carte tirée, qui brille ; la bande s'efface et la carte se retourne vite dans la rangée (classe « vite » : sa face à 0,35 s,
   ROULETTE_PACK.vite). Pendant que la bande tourne, les autres cartes s'assombrissent et celle qu'elle tire luit. packs.js lit la largeur
   des cases et leur écart sur la page : on peut les changer ici (le téléphone les rétrécit). */
.ouverture-roulette {
  position: relative; z-index: 5; align-self: center; width: calc(100% + 32px); margin: 0 -16px; height: 178px;
  overflow: hidden; overflow: clip;
  pointer-events: none; opacity: 0; visibility: hidden;
  background: linear-gradient(180deg, rgba(9, 7, 14, .94), rgba(26, 20, 38, .94) 50%, rgba(9, 7, 14, .94));
  border-block: 1px solid rgba(232, 207, 148, .4);
  box-shadow: 0 0 46px rgba(0, 0, 0, .7);
  transition: opacity .25s ease, visibility 0s linear .25s;
}
.ouverture-roulette.active { opacity: 1; visibility: visible; transition: opacity .25s ease; }
.ouverture-roulette::before, .ouverture-roulette::after {   /* les bords se perdent dans l'ombre */
  content: ""; position: absolute; top: 0; bottom: 0; width: 16%; z-index: 2; pointer-events: none;
}
.ouverture-roulette::before { left: 0; background: linear-gradient(90deg, #09070e, rgba(9, 7, 14, 0)); }
.ouverture-roulette::after { right: 0; background: linear-gradient(270deg, #09070e, rgba(9, 7, 14, 0)); }
.roulette-bande { position: absolute; left: 0; top: 19px; display: flex; gap: 12px; will-change: transform; }
.roulette-case {
  position: relative; isolation: isolate; flex: 0 0 104px; width: 104px; height: 140px; border-radius: 10px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 0 5px 7px;
  background: radial-gradient(circle at 50% 34%, #2c2240, var(--fond-carte) 76%);
  border: 2px solid var(--rarete-couleur, var(--bord));
}
.roulette-case::before {   /* le pied de la case prend la couleur de sa rareté */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .42;
  background: linear-gradient(0deg, var(--rarete-couleur, #6b6278), rgba(0, 0, 0, 0) 72%);
}
.roulette-img { position: absolute; left: 0; top: 0; z-index: -2; width: 100%; height: 100px; object-fit: cover; opacity: .85; }
.roulette-signe {
  position: absolute; left: 0; right: 0; top: 30px; font-size: 2.4rem; line-height: 1;
  color: var(--rarete-couleur, var(--or-clair)); text-shadow: 0 0 14px rgba(0, 0, 0, .7);
}
.roulette-nom {
  font-family: Georgia, "Times New Roman", serif; font-size: .74rem; line-height: 1.15; color: var(--texte); text-align: center;
  text-shadow: 0 1px 3px #000, 0 0 6px #000;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.roulette-rarete { position: absolute; top: 5px; right: 7px; font-size: .8rem; color: var(--rarete-couleur, var(--or)); text-shadow: 0 0 4px #000; }
.roulette-repere {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; z-index: 3;
  background: linear-gradient(180deg, rgba(255, 243, 207, 0), #fff3cf 14%, #fff3cf 86%, rgba(255, 243, 207, 0));
  box-shadow: 0 0 10px 2px rgba(244, 213, 138, .75);
}
.roulette-repere::before, .roulette-repere::after {
  content: ""; position: absolute; left: 50%; margin-left: -8px; border: 8px solid transparent;
}
.roulette-repere::before { top: 0; border-top-color: #f4d58a; }
.roulette-repere::after { bottom: 0; border-bottom-color: #f4d58a; }
.roulette-case.gagnante { z-index: 1; animation: case-gagne .45s ease-out forwards; }
@keyframes case-gagne {
  0% { transform: scale(1); box-shadow: 0 0 0 0 var(--rarete-couleur, #e8c25a); }
  55% { transform: scale(1.13); box-shadow: 0 0 24px 6px var(--rarete-couleur, #e8c25a); }
  100% { transform: scale(1.08); box-shadow: 0 0 18px 4px var(--rarete-couleur, #e8c25a); }
}
.ouverture-cartes .carte-tirage { transition: filter .3s ease; }
.roulette-visible .ouverture-cartes .carte-tirage.face-cachee:not(.en-roulette) { filter: brightness(.38) saturate(.5); }
.carte-tirage.en-roulette .carte-dos {
  border-color: var(--or-clair);
  box-shadow: inset 0 0 0 4px rgba(13, 11, 18, .8), 0 0 0 2px rgba(244, 213, 138, .55), 0 0 26px rgba(244, 213, 138, .45);
}
.carte-tirage.revele.vite { --t-flip: .35s; }
.carte-tirage.revele.vite .carte-tirage-3d,
.carte-tirage.revele.vite.rarete-rare .carte-tirage-3d,
.carte-tirage.revele.vite.rarete-epique .carte-tirage-3d,
.carte-tirage.revele.vite.rarete-legendaire .carte-tirage-3d { animation-name: carte-revele; animation-duration: .6s; }

/* Cadres par rareté et contenu des cartes (ouverture et main) */
.rarete-badge {
  border-color: var(--rarete-couleur, var(--bord)); border-width: 2px;
  background: rgba(13, 11, 18, .85); color: var(--texte); font-weight: 600;
}
.rarete-signe { color: var(--rarete-couleur, var(--or-clair)); }
.rarete-legendaire .carte-recto, .carte-pack.rarete-legendaire { border-width: 3px; border-style: double; }
.rarete-epique .carte-recto, .carte-pack.rarete-epique { border-width: 3px; }
.carte-pack-entete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; }
.carte-pack-visuel {
  width: 100%; height: 96px; border-radius: 8px; overflow: hidden; border: 1px solid var(--bord);
  background: radial-gradient(circle, #261e36, var(--fond-champ));
  display: flex; align-items: center; justify-content: center;
}
.carte-pack-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.carte-pack-signe { font-size: 2.4rem; color: var(--rarete-couleur, var(--or-clair)); line-height: 1; }
.carte-pack-nom { margin: 2px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: 1rem; color: var(--or-clair); }
.carte-pack-serie { margin: 0; font-size: .8rem; color: var(--texte-doux); letter-spacing: .02em; }
.carte-pack-texte { margin: 0; font-size: .88rem; color: var(--texte); flex: 1 1 auto; }
.carte-pack-gain { margin: 4px 0 0; padding-top: 6px; border-top: 1px solid var(--bord); font-size: .88rem; color: var(--or-clair); }

/* Ta main et les effets en cours sur le Bord */
.pack-en-cours { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--bon); border-radius: 0 8px 8px 0; background: rgba(111, 207, 151, .08); }
.pack-en-cours-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: .92rem; }
.main-cartes-grille {
  list-style: none; margin: 8px 0 0; padding: 0;
  display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
}
.carte-pack-main {
  display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: 10px;
  background: var(--fond-champ); border: 2px solid var(--rarete-couleur, var(--bord)); min-width: 0; overflow-wrap: anywhere;
}
.carte-pack-main .rangee { margin-top: auto; padding-top: 6px; }
/* Une pile de cartes identiques (retour n° 36) : le nombre en pastille dorée, et deux cartes qui dépassent derrière. */
.carte-pack-main.pile { box-shadow: 4px 4px 0 -1px var(--fond-champ), 4px 4px 0 1px var(--rarete-couleur, var(--bord)), 8px 8px 0 -1px var(--fond-champ), 8px 8px 0 1px var(--rarete-couleur, var(--bord)); margin: 0 8px 8px 0; }
.main-nombre { padding: 0 9px; border-radius: 999px; background: var(--or-clair); color: #1a1206; font: 700 .9rem/1.5 system-ui, sans-serif; }
.carte-pack-suite { margin: 0; font-size: .82rem; }
.carte-pack-bloquee { margin: 0; }
.carte-pack-main .bouton-jouer-carte { margin-top: 0; width: 100%; }

/* Téléphone (390 px) : les cartes de l'ouverture passent à la ligne sans coupure à droite, la main sur une colonne */
@media (max-width: 600px) {
  .ouverture-boite { padding: 14px 10px; }
  .ouverture-roulette { width: calc(100% + 20px); margin: 0 -10px; height: 152px; }
  /* la roulette a sa propre ligne, au-dessus des cartes : elle ne recouvre plus la carte 1 */
  .ouverture-scene > .ouverture-roulette { grid-area: 1 / 1; }
  .ouverture-scene > .ouverture-paquet-zone, .ouverture-scene > .ouverture-cartes { grid-row: 2; }
  .ouverture-boite:not(.roulette-visible):not(.phase-roulette) .ouverture-roulette { height: 0; border-width: 0; box-shadow: none; }
  .roulette-bande { top: 16px; gap: 10px; }
  .roulette-case { flex-basis: 88px; width: 88px; height: 120px; }
  .roulette-img { height: 84px; }
  .roulette-signe { top: 24px; font-size: 2rem; }
  .ouverture-cartes {
    flex-wrap: wrap; justify-content: center; overflow-x: visible;
    gap: 10px; padding: 6px 0 12px;
  }
  .carte-tirage { flex: 1 1 160px; max-width: 240px; width: auto; }
  .main-cartes-grille { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .paquet-3d, .paquet-3d.tourne, .paquet-3d.tourne.rare,
  .paquet-reflet, .paquet-3d.tourne .paquet-reflet,
  .paquet-haut, .paquet-3d.dechire .paquet-haut,
  .carte-tirage, .carte-tirage-3d, .ouverture-cartes, .ouverture-cartes.sorties .carte-tirage,
  .carte-tirage.brille-rare.face-cachee::after,
  .carte-eclats i, .roulette-case, .ouverture-roulette {
    animation: none !important;
    transition: none !important;
  }
  .paquet-reflet, .carte-eclats { display: none !important; }
}

/* ---------- Grand écran (PC, 1200 px et plus) : la largeur sert, les pages s'étalent en colonnes au lieu de s'allonger ----------
   Téléphone et écran moyen : rien ne change. Les pages de jeu prennent jusqu'à 1600 px ; celles qu'on lit (rapports, histoire,
   scènes, guide, fin de saison) gardent des lignes courtes. Chaque grille garde l'ordre du document : le lecteur d'écran et la
   touche Tab vont dans le même ordre qu'au téléphone. */
/* Une seule largeur de page en jeu, sur tous les écrans et à toute taille de fenêtre (retour n° 38 de Sano, 29/11 : « la taille de
   l'écran n'est pas consistante selon le menu où l'on va, le menu se balade ») : avant, `main` faisait 760, 1040, 1280, 1440 ou 1600 px
   selon l'écran, et la barre d'onglets (ou le menu à gauche) sautait avec lui. La page, l'en-tête et le pied gardent 1600 px au plus.
   Maquette des blocs du 02/12 (Gégé : « ok go », proposition 1) : chaque écran prend toute la largeur de la page, celle de la barre des
   menus et des bannières, à toute taille de fenêtre ; plus de colonne de 728, 960 ou 1248 px dessous, dont les bords ne tombaient pas sous
   ceux de la barre. Ce sont les paragraphes qui gardent des lignes lisibles : 80 caractères au plus (sans poids, `:where` : une règle de
   classe qui en demande moins, dans une bannière ou une carte, passe devant). Sauf les paragraphes en encadré (fond ou filet), relevés
   sur tous les écrans le 02/12 : bornés, leur bord droit tombait en escalier à côté des blocs pleine largeur. */
main:has(> #vue-jeu:not([hidden])), body:has(#vue-jeu:not([hidden])) .entete-in, body:has(#vue-jeu:not([hidden])) .pied { max-width: 1600px; }
:where(#vue-jeu > .panneau) p:not(:where(.bonjour, .note, .objectif, .total, .bord-foire, .bord-suivant, .comptoir-evenement, .pack-garantie, .proie-ordre,
  .puce, .replique, .syndicat-chantier, .syndicat-indispo-ligne, .syndicat-ligne, .syndicat-but-ordres)) { max-width: 80ch; }
/* Les récits (scène, mission d'histoire, départ, fin de saison) ne sont pas des blocs sous une bannière mais une page qu'on lit, avec sa
   cinématique en 16:9 : ils gardent leur colonne centrée (pleine largeur, la vidéo ferait 880 px de haut en grand écran). */
#panneau-histoire, #panneau-scene, #panneau-parti, #panneau-fin_saison { max-width: 960px; margin-inline: auto; }
@media (min-width: 601px) {
  /* l'image d'en-tête d'une page (Journal de bord, guide…) : un bandeau de 200 px, pas un demi-écran, quelle que soit la largeur */
  .bandeau-page:not(.scene-cine):not(.scene-ch2) img { aspect-ratio: auto; height: 200px; }
}
@media (min-width: 1200px) {
  .scene-ch2 img { aspect-ratio: 24 / 5; }   /* l'image de la scène du chapitre 2 : un bandeau en grand écran, pas un demi-écran */
  .en-jeu .commande-son { right: max(12px, env(safe-area-inset-right), calc((100% - 1600px) / 2 + 16px)); }   /* le son au bout de la ligne du titre, */
  .en-jeu .entete-in { padding-right: 204px; }   /* et la place gardée pour lui : le résumé s'arrête avant */

  /* Bord : à gauche le vaisseau, l'équipage et la Bordure ; à droite le but, et à côté le pack du jour et le savoir-faire.
     Un équipage sans espèce choisit la sienne sur quatre colonnes. */
  .bord-grille:not(.premiere) { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: 16px; }
  .bord-grille:not(.premiere) .bord-col-d:has(> .bord-col-p) { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto 1fr; column-gap: 16px; align-items: start; }
  .bord-grille:not(.premiere) .bord-col-d:has(> .bord-col-p) > * { grid-column: 1; }
  .bord-grille:not(.premiere) .bord-col-d > .bord-col-p { grid-column: 2; grid-row: 1 / -1; }
  #panneau-bord .especes-grille { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  /* Vaisseau : le cargo à gauche ; à droite les cartes deux par deux, et les quatre pièces sur deux colonnes */
  .vaisseau-grille { grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 20px; }
  .vaisseau-droite { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; align-items: start; }
  .vaisseau-droite > * { grid-column: 1 / -1; min-width: 0; }
  .vaisseau-droite > :is(article, section) { grid-column: auto; }
  .vaisseau-pieces { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; align-items: start; }
  .vaisseau-pieces > li > .piece-cargo { margin-bottom: 0; }

  /* Équipage : deux colonnes ; le capitaine, plus long, tient deux lignes à gauche */
  #panneau-equipage { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; align-items: start; }
  #panneau-equipage > * { grid-column: 1 / -1; min-width: 0; }
  #panneau-equipage > .equipage-carte { grid-column: auto; }
  #panneau-equipage > .equipage-carte:first-of-type { grid-row: span 2; }

  /* Gros coups : les départs deux par deux ; les rôles d'un départ sur une ligne */
  #panneau-coups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 16px; align-items: start; }
  #panneau-coups > * { grid-column: 1 / -1; min-width: 0; }
  #panneau-coups > .carte { grid-column: auto; }

  /* Syndicat : les pièces de la base par trois, les recherches sur deux colonnes */
  #panneau-syndicat .cantina-grille { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #panneau-syndicat .syndicat-liste { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
}
/* Très grand écran (1500 px et plus) : une colonne de plus là où les cartes restent assez larges pour se lire */
@media (min-width: 1500px) {
  /* Bord : le vaisseau, puis l'équipage et la Bordure à côté ; le but, puis le pack et le savoir-faire : quatre colonnes */
  .bord-grille:not(.premiere) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bord-grille:not(.premiere) .bord-bas { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto 1fr; column-gap: 16px; align-items: start; }
  .bord-grille:not(.premiere) .bord-bas > * { grid-column: 2; }
  .bord-grille:not(.premiere) .bord-bas > .bord-vaisseau { grid-column: 1; grid-row: 1 / -1; }
}

/* ---------- L'écran Carte (24/11, étape 2) : la carte EST la page ----------
   Toute la largeur de l'écran (bord à bord), toute la hauteur sous l'en-tête, le cadre « À faire » et les onglets : plateau.js mesure ce haut (--haut-carte).
   Au téléphone la barre d'onglets du bas (fixe) en retire sa hauteur. Tout le reste flotte sur la carte, dans des panneaux sombres semi-opaques
   (.flot) : le zoom en haut à gauche, le monde choisi à droite (feuille en bas sous 1000 px, repliable), quatre boutons en bas à gauche.
   Le Spatioport (#panneau-spatioport) n'est pas concerné : il garde la mise en page des autres écrans. */
.carte-plein { --bas-carte: 0px; position: relative; width: 100vw; margin-left: calc(50% - 50vw); width: var(--carte-large, 100vw); margin-left: var(--carte-gauche, calc(50% - 50vw));   /* mesurés par plateau.js (mesurerCarte) : 100vw compte la barre de défilement, la carte débordait alors de la fenêtre */ overflow: hidden; background: #0d0b12;
  height: max(420px, calc(100vh - var(--haut-carte, 220px) - var(--bas-carte)));
  height: max(420px, calc(100dvh - var(--haut-carte, 220px) - var(--bas-carte))); }
@media (max-width: 600px) { .carte-plein { --bas-carte: calc(var(--barre, 56px) + var(--zone, 0px)); } }
body:has(.carte-plein) { overflow-x: clip; padding-bottom: 0; }
main:has(.carte-plein) { padding-bottom: 0; }   /* rien sous la carte : la page ne défile pas */
body:has(#vue-jeu:not([hidden]) > #panneau-carte:not([hidden])) .pied { display: none; }   /* la carte finit au bas de l'écran : pas de pied de page qui fasse défiler */
.plateau-carte.plateau-plein { position: absolute; inset: 0; width: auto; aspect-ratio: auto; margin: 0; border: 0; border-radius: 0; box-shadow: none; touch-action: none; overscroll-behavior: contain; cursor: grab; }
.plateau-carte.plateau-plein.glisse { cursor: grabbing; }
.plateau-plein .carte-monde { inset: auto; left: 0; top: 0; width: var(--L, 100%); height: var(--L, 100%); }   /* le monde reste un carré (côté L = le petit côté de la vue) ; le reste de la vue est du fond */
.plateau-plein .carte-monde .planete { width: clamp(22px, calc(.024 * var(--L, 600px) * var(--zoom, 1)), 60px); }
.plateau-plein .carte-monde .noeud.ferme .planete { width: clamp(16px, calc(.016 * var(--L, 600px) * var(--zoom, 1)), 40px); }
.plateau-plein .mini-carte { left: 32px; bottom: 68px; overflow: hidden; }   /* à droite de la règle de gauche (24 px) : ses chiffres restent lisibles */
.plateau-plein .mini-carte .mini-vue { min-width: 2px; }

.flot { position: absolute; z-index: 6; box-sizing: border-box; color: var(--texte); border: 1px solid var(--bord); border-radius: 12px;
  background: rgba(13, 11, 18, .86); background: color-mix(in srgb, var(--fond) 86%, transparent);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.flot-zoom { top: 28px; left: 32px; padding: 6px; max-width: calc(100% - 44px); }
.flot-zoom .zoom-carte { margin: 0; justify-content: flex-start; }
.flot-vide { top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 12px 16px; }

/* Le monde choisi : un panneau à droite (ordinateur), replié il ne reste que sa languette */
.flot-monde { top: 28px; right: 12px; width: min(400px, 36%); min-width: 340px; max-height: calc(100% - 40px); display: grid; grid-template-rows: auto minmax(0, 1fr); overflow: hidden;
  transition: width .2s ease; }
.flot-monde-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; width: 100%; padding: 6px 14px; border: 0; border-radius: 0;
  background: linear-gradient(90deg, rgba(14, 11, 24, .9), rgba(14, 11, 24, .72)), url("/static/art/bannieres/carte.webp") center 45% / cover;   /* la bannière de la Carte (29/11), voilée : le nom reste lisible */
  color: var(--or-clair); font: 700 1rem Georgia, "Times New Roman", serif; text-align: left; cursor: pointer; }
.flot-monde-nom { min-width: 0; overflow-wrap: anywhere; margin-right: auto; }
.flot-monde-vignette { flex: none; width: 36px; height: 36px; border-radius: 9px; object-fit: cover; border: 1px solid var(--or); box-shadow: 0 1px 6px rgba(0, 0, 0, .6); }   /* la vignette du monde « Ici », dans l'en-tête (le fond voilé de la bannière reste lisible autour) */
.flot-chevron { flex: none; width: 10px; height: 10px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .2s ease; }   /* ouvert : flèche vers la droite (replier) */
.flot-monde[data-ouvert="0"] .flot-chevron { transform: rotate(135deg); }   /* replié : flèche vers la gauche (déplier) */
.flot-monde-corps { min-height: 0; overflow: auto; padding: 0 10px 12px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.flot-monde-corps > * { margin: 0; }
/* Le titre du monde est déjà dans l'en-tête du panneau (le bouton) : celui de la carte n'est plus que pour le lecteur d'écran, et le cadre du panneau suffit (pas de cadre dans le cadre) */
.flot-monde-corps > .monde-choisi { border: 0; outline: 0; background: none; box-shadow: none; border-radius: 0; padding-inline: 2px; }
.flot-monde-corps > .monde-choisi > h2#monde-choisi, .flot-monde-corps > .monde-choisi > h3#monde-choisi,
.flot-monde-corps > .carte-ici .carte-ici-texte > h2 { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.flot-monde[data-ouvert="0"] { width: auto; min-width: 0; grid-template-rows: auto 0fr; }
.flot-monde[data-ouvert="0"] .flot-monde-corps { visibility: hidden; display: none; padding-block: 0; overflow: hidden; }   /* hors de la tabulation et du lecteur d'écran ; « display: none » : sinon la largeur de son texte étirait la languette sur toute la carte */

/* Les quatre boutons du bas et le panneau qu'ils ouvrent (un seul à la fois) */
.flot-bas { left: 32px; bottom: 12px; display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 8px; width: calc(100% - 44px); max-width: 640px; max-height: calc(100% - 24px);
  background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none; border-radius: 0; }
.flot-bas > * { pointer-events: auto; }
.flot-bas-boutons { display: flex; flex-wrap: wrap; gap: 6px; }
.flot-bas-boutons button { min-height: 44px; padding: 0 12px; border-radius: 10px; font-size: .9rem; background: rgba(13, 11, 18, .88); background: color-mix(in srgb, var(--fond) 88%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.flot-bas-boutons button[aria-expanded="true"] { border-color: var(--or); color: var(--or-clair); }
.flot-bas-boutons .lib-court { display: none; }
.flot-popup { width: 100%; max-height: min(60vh, 560px); display: flex; flex-direction: column; box-sizing: border-box; border: 1px solid var(--bord); border-radius: 12px; overflow: hidden;
  background: rgba(13, 11, 18, .96); background: color-mix(in srgb, var(--fond) 96%, transparent); box-shadow: 0 6px 24px rgba(0, 0, 0, .45); animation: flot-entree .18s ease-out; }
.flot-popup:focus { outline: none; }
.flot-popup:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.flot-popup-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 2px 14px; border-bottom: 1px solid var(--bord); }
.flot-popup-tete h2 { margin: 0; font: 700 1rem Georgia, "Times New Roman", serif; color: var(--or-clair); }
.flot-fermer { min-width: 44px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--texte-doux); font-size: 1rem; cursor: pointer; }
.flot-popup-corps { min-height: 0; overflow: auto; padding: 10px 14px 14px; overscroll-behavior: contain; }
.flot-popup-corps > * { margin-top: 0; }
@keyframes flot-entree { from { opacity: 0; transform: translateY(8px); } }

/* Sous 1000 px : le monde choisi est une feuille en bas, repliée sur une ligne (le nom et un chevron) ; les quatre boutons passent au-dessus */
@media (max-width: 999px) {
  .flot-monde { top: auto; left: 0; right: 0; bottom: 0; width: auto; min-width: 0; max-height: 55%; border-radius: 14px 14px 0 0; border-width: 1px 0 0; }
  .flot-monde[data-ouvert="0"] { width: auto; }
  .flot-chevron { transform: rotate(-135deg); }   /* replié : flèche vers le haut (ouvrir) */
  .flot-monde[data-ouvert="1"] .flot-chevron { transform: rotate(45deg); }   /* ouvert : flèche vers le bas (fermer) */
  .flot-monde[data-ouvert="0"] .flot-chevron { transform: rotate(-135deg); }
  .flot-bas { bottom: 60px; max-height: calc(100% - 72px); }
  .flot-monde[data-ouvert="1"] ~ .flot-bas { visibility: hidden; }   /* feuille ouverte : elle prend la place des boutons */
  .plateau-plein .mini-carte { bottom: 116px; width: 72px; height: 72px; }
}
@media (max-width: 600px) {
  .flot-bas-boutons .lib-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .flot-bas-boutons .lib-court { display: inline; }   /* « Routes », « Mondes », « Aide » : les quatre tiennent sur une ligne à 360 px ; le lecteur d'écran lit le nom entier */
  .flot-bas-boutons button { padding: 0 10px; }
  .flot-zoom { left: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .flot-monde, .flot-chevron { transition: none; }
  .flot-popup { animation: none; }
}
@media (forced-colors: active) { .flot, .flot-popup { border-color: CanvasText; background: Canvas; } }

/* Les infobulles, à la Crusader Kings (infobulles.js) : le mot souligné, la bulle, et la barre qui se remplit avant qu'elle se fige. */
.terme {
  text-decoration: underline dotted var(--or);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: help;
  border-radius: 3px;
}
.terme:hover, .terme[aria-expanded="true"] { color: var(--or-clair); text-decoration-style: solid; }
.terme:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.infobulle {
  position: fixed;
  z-index: 90;
  inset: auto;
  margin: 0;
  box-sizing: border-box;
  width: max-content;
  max-width: 340px;
  max-height: 60vh;
  overflow: auto;
  padding: 10px 14px 12px;
  background: #1f1a29;
  color: var(--texte);
  border: 1px solid var(--or);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .55);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  text-align: left;
  pointer-events: none;
}
.infobulle.figee { pointer-events: auto; }
.infobulle:focus { outline: none; }
.infobulle:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.infobulle-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.infobulle-titre { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 16px; font-weight: 700; color: var(--or-clair); }
.infobulle-fermer {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  margin: -10px -12px -10px 0;
  padding: 0;
  background: none;
  border: 0;
  color: var(--texte-doux);
  font-size: 16px;
  cursor: pointer;
}
.infobulle-fermer:hover { color: var(--texte); }
.infobulle-texte { margin: 4px 0 0; }
.infobulle-figer { height: 2px; margin-top: 10px; background: var(--bord); border-radius: 1px; overflow: hidden; }
.infobulle-figer::before { content: ""; display: block; height: 100%; background: var(--or); transform-origin: left center; transform: scaleX(0); }
.infobulle.en-cours .infobulle-figer::before { transform: scaleX(1); transition: transform var(--infobulle-figer, 900ms) linear; }
.infobulle.figee .infobulle-figer::before { transform: scaleX(1); }
@media (prefers-reduced-motion: reduce) {
  .infobulle.en-cours .infobulle-figer::before { transition: none; }
}
@media (forced-colors: active) {
  .terme { text-decoration-color: CanvasText; }
  .infobulle { border-color: CanvasText; }
  .infobulle-figer::before { background: Highlight; }
}

/* Ce qui est en cours, en barre (retour des joueurs du 19/11 : « une barre de progression là où c'est pertinent ») : un <progress>
   natif, rempli chaque seconde par majAvancements (plateau.js). */
progress.avancement {
  display: block;
  width: 100%;
  max-width: 420px;
  height: 6px;
  margin: 8px 0 4px;
  -webkit-appearance: none;
  appearance: none;
  border: 0;
  border-radius: 3px;
  background: var(--bord);
  color: var(--or);
  overflow: hidden;
}
progress.avancement::-webkit-progress-bar { background: var(--bord); border-radius: 3px; }
progress.avancement::-webkit-progress-value { background: linear-gradient(90deg, var(--or), var(--or-clair)); border-radius: 3px; transition: width 1s linear; }
progress.avancement::-moz-progress-bar { background: linear-gradient(90deg, var(--or), var(--or-clair)); border-radius: 3px; }
@media (prefers-reduced-motion: reduce) {
  progress.avancement::-webkit-progress-value { transition: none; }
}
@media (forced-colors: active) {
  progress.avancement { border: 1px solid CanvasText; }
}

/* La jauge du temps (retour des joueurs n° 12) : une barre fine qui se vide, sous la ligne qui dit le temps restant, ou au pied d'un
   bouton (le bouton garde son texte, la barre est posée sur son bord du bas). Remplie par majJauges (plateau.js). */
.jauge-temps {
  display: block; width: 100%; max-width: 420px; height: 5px; margin: 6px 0 2px; border-radius: 3px;
  background: var(--bord); overflow: hidden; box-sizing: border-box;
}
.jauge-temps .jauge-reste { display: block; height: 100%; min-width: 0; background: linear-gradient(90deg, var(--or), var(--or-clair)); border-radius: 3px; transition: width 1s linear; }
button:has(> .jauge-temps) { position: relative; overflow: hidden; padding-bottom: 14px; }
button > .jauge-temps { position: absolute; left: 0; right: 0; bottom: 0; width: auto; max-width: none; height: 4px; margin: 0; border-radius: 0; background: rgba(0, 0, 0, .35); }
button > .jauge-temps .jauge-reste { border-radius: 0; }
button.primaire > .jauge-temps { background: rgba(26, 18, 8, .25); }
button.primaire > .jauge-temps .jauge-reste { background: #1a1208; }
@media (prefers-reduced-motion: reduce) {
  .jauge-temps .jauge-reste { transition: none; }
}
@media (forced-colors: active) {
  .jauge-temps { border: 1px solid CanvasText; }
  .jauge-temps .jauge-reste { background: Highlight; }
}

/* L'encadré des nouvelles du Bord, quand un résultat attend d'être lu (retour du 19/11 : « mettre en valeur des encadrés ») */
.bord-absence.a-lire { border-color: var(--or); box-shadow: 0 0 0 1px var(--or), 0 6px 22px rgba(201, 164, 92, .18); }
.bord-absence .compte-a-lire {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--or);
  color: #1a1422;
  font: 600 13px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  vertical-align: middle;
}
@media (forced-colors: active) {
  .bord-absence.a-lire { outline: 2px solid CanvasText; }
  .bord-absence .compte-a-lire { border: 1px solid CanvasText; }
}

/* ---------- L'album (lot P2, album.js) : les cartes de collection, série par série ----------
   Une carte possédée montre son image dans un cadre à la couleur de sa rareté ; une carte qui manque, une silhouette sombre avec le
   signe de sa rareté, son nom et « Choisir ». Grille souple : deux colonnes et plus sur téléphone, sans débordement. */
.album-resume { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin: 8px 0; }
.album-serie { margin: 18px 0; padding-top: 10px; border-top: 1px solid var(--bord); }
.album-serie.finie > .album-serie-tete h3 { color: var(--or-clair); }
.album-serie-tete { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; }
.album-serie-tete h3 { margin: 0; }
.album-complete { background: var(--or); color: #1a1422; border-color: var(--or); }
.album-porte { border-color: var(--or); color: var(--or-clair); }
.motif { height: 1.1em; width: 1.1em; vertical-align: -0.2em; }   /* un motif de pavillon, à côté d'un nom (plateau.js : imageMotif) */
.motif-grand { height: 40px; width: 40px; vertical-align: middle; flex: none; }
.album-ton-signes { gap: 8px 18px; }
.album-signe { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 6px 0; padding: 6px 8px; border: 1px dashed var(--bord); border-radius: 8px; min-width: 0; }
.album-signe.gagne { border-style: solid; border-color: var(--or); }
.album-signe-texte { flex: 1 1 14em; min-width: 0; overflow-wrap: anywhere; }
.album-signe .motif-grand { opacity: .45; filter: grayscale(.6); }
.album-signe.gagne .motif-grand { opacity: 1; filter: none; }
.nuancier { display: inline-flex; gap: 3px; flex: none; }
.nuancier i { display: block; width: 22px; height: 28px; border: 1px solid var(--bord); border-radius: 4px; }
.album-cartes { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.album-carte {
  --rarete-couleur: var(--bord);
  display: flex; flex-direction: column; min-width: 0;
  background: var(--fond-carte); border: 2px solid var(--rarete-couleur); border-radius: 10px; overflow: hidden;
}
.album-visuel { position: relative; aspect-ratio: 3 / 2; background: #08060c; display: grid; place-items: center; overflow: hidden; }
.album-visuel img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-silhouette { background: repeating-linear-gradient(135deg, #0f0c15 0 10px, #141019 10px 20px); }
.album-silhouette span { font-size: 2rem; color: var(--rarete-couleur); opacity: .55; }
.album-manque { border-style: dashed; }
.album-manque .album-carte-nom { color: var(--texte-doux); }
.album-carte-corps { padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.album-carte-nom { margin: 0; font: 600 .95rem/1.25 Georgia, "Times New Roman", serif; color: var(--texte); overflow-wrap: anywhere; }
.album-carte-texte { margin: 2px 0 0; font-size: .82rem; line-height: 1.35; color: var(--texte-doux); }
.album-double { font-size: .85rem; color: var(--or-clair); }
/* La pastille du coin : combien d'exemplaires (×N, dorée s'il y a des doubles), ou « Manque » sur l'image éteinte (Gégé, 29/11). */
.album-manque .album-visuel img { filter: grayscale(1) brightness(.42); }
.album-pastille {
  position: absolute; top: 6px; right: 6px; min-width: 2.4em; padding: 1px 8px; border-radius: 999px; text-align: center;
  background: rgba(10, 8, 16, .85); border: 1px solid var(--rarete-couleur); color: var(--texte); font: 700 .85rem/1.45 system-ui, sans-serif;
}
.album-pastille-double { background: var(--or-clair); border-color: var(--or-clair); color: #1a1206; }
.album-pastille-manque { border-style: dashed; color: var(--texte-doux); font-weight: 600; }
.album-choisir, .album-titre-bouton { font-size: .85rem; padding: 4px 10px; }
.album-choisir[aria-disabled="true"] { opacity: .6; }
@media (forced-colors: active) {
  .album-carte { border: 2px solid CanvasText; }
  .album-manque { border-style: dashed; }
}

/* ---------- Lot P3 : le comptoir des packs (comptoir.js), et les paquets à la couleur de leur pack ---------- */
.comptoir-resume { gap: 16px; margin: 8px 0 12px; }
.comptoir-packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: stretch; }
.comptoir-packs:has(> :nth-child(3)) { grid-template-columns: repeat(auto-fit, minmax(clamp(30%, (1000px - 100%) * 999, 100%), 1fr)); }   /* trois packs (la Foire du week-end) : sur une ligne dès 1000 px, sinon l'un sous l'autre, jamais deux plus un (maquette du 02/12 ; en dessous, le tableau des chances, 284 px, déborderait de sa carte) */
.comptoir-pack { display: flex; flex-direction: column; }
.comptoir-pack > .rangee { margin-top: auto; }   /* les trois boutons « Acheter et ouvrir » alignés en bas de carte */
.comptoir-pack h3 { margin-top: 0; }
.comptoir-pack .paquet-scene { margin: 4px 0 10px; }
.comptoir-hutt { margin: 8px 0; padding: 8px 10px; border-left: 3px solid #d0643c; background: rgba(208, 100, 60, .12); }
.comptoir-acheter[aria-disabled="true"] { opacity: .6; cursor: not-allowed; }
.paquet-3d.paquet-contrebandier .paquet-face.paquet-avant { background: radial-gradient(circle at 50% 35%, #4a3322, var(--fond-carte) 65%, #120d0a 100%); }
.paquet-3d.paquet-contrebandier .paquet-haut { background: repeating-linear-gradient(90deg, #4a3322 0 4px, #24180f 4px 8px), linear-gradient(180deg, var(--or), #3a2618); }
.paquet-3d.paquet-baron .paquet-face.paquet-avant { background: radial-gradient(circle at 50% 35%, #5a1e26, var(--fond-carte) 65%, #14080b 100%); }
.paquet-3d.paquet-baron .paquet-haut { background: repeating-linear-gradient(90deg, #5a1e26 0 4px, #2a0e12 4px 8px), linear-gradient(180deg, var(--or), #3a1219); }
/* Le pack de la Foire (lot P3) : l'ocre des lanternes et le rouge brique des auvents. */
.paquet-3d.paquet-foire .paquet-face.paquet-avant { background: radial-gradient(circle at 50% 35%, #7a4a1c, var(--fond-carte) 65%, #160c06 100%); }
.paquet-3d.paquet-foire .paquet-haut { background: repeating-linear-gradient(90deg, #8a3a22 0 4px, #3a160c 4px 8px), linear-gradient(180deg, var(--or), #4a2410); }
.comptoir-evenement { margin: 10px 0; }
.comptoir-evenement.en-cours { border-left: 3px solid var(--or); padding: 6px 10px; background: rgba(201, 164, 92, .08); }
.bord-foire { border-left: 3px solid var(--or); padding: 4px 10px; }
@media (forced-colors: active) {
  .comptoir-hutt { border-left-color: CanvasText; }
}

/* #17 & #24 : soute plus lisible et sélecteur de quantité au Marché */
.soute-resume-puces { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.marche-badge-soute { border-color: rgba(201, 164, 92, .55); background: rgba(201, 164, 92, .16); color: var(--or-clair); }
.marche-badge-vide { opacity: .65; }
.ligne-marche.en-soute { border-left: 3px solid var(--or); }
.marche-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.marche-action-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.marche-qte-groupe { display: inline-flex; align-items: center; gap: 4px; background: rgba(255, 255, 255, .04); border: 1px solid var(--bord); border-radius: 999px; padding: 2px 6px; }
.marche-qte-btn, .marche-qte-max { min-width: 30px; min-height: 30px; padding: 2px 8px; border-radius: 999px; font-size: .86rem; }
.marche-qte-val { min-width: 24px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* #19 & #20 : titres illustrés et mise en valeur du lieu où le vaisseau revient */
.titre-section-illustre { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.titre-section-img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; border: 1px solid rgba(201, 164, 92, .4); background: rgba(13, 11, 18, .7); flex: 0 0 auto; }
.titre-section-texte { min-width: 0; flex: 1; }
.titre-section-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.titre-section-ligne h2, .titre-section-ligne h3 { margin: 0; }
.titre-section-texte .aide { margin: 2px 0 0; }
.badge-vaisseau-ici { border-color: rgba(212, 169, 87, .75); background: rgba(212, 169, 87, .2); color: var(--or-clair); font-weight: 700; }
.section-missions-ici.vaisseau-present, .section-panneau-ici { border: 1px solid rgba(212, 169, 87, .45); border-radius: 12px; padding: 14px; background: linear-gradient(180deg, rgba(212, 169, 87, .07), transparent 140px); }
.carte-retour-vaisseau { border: 1.5px solid var(--or); border-radius: 12px; padding: 12px 14px; background: linear-gradient(135deg, rgba(212, 169, 87, .16), rgba(20, 16, 30, .85)); box-shadow: 0 0 18px rgba(212, 169, 87, .18); margin: 8px 0 12px; }
.groupe-missions-titre { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.groupe-monde-ic { width: 24px; height: 24px; border-radius: 6px; object-fit: cover; border: 1px solid rgba(201, 164, 92, .35); flex: 0 0 auto; }
.groupe-missions-titre.groupe-monde-ici { padding: 6px 10px; border-radius: 8px; background: rgba(212, 169, 87, .12); border-left: 3px solid var(--or); }
/* L'accroche d'une mission du Spatioport se lit en entier (le thème de la Carte la coupait à 2 lignes) */
.section-missions-ici .mission-accroche { display: block; -webkit-line-clamp: unset; overflow: visible; }
/* Planques (Spatioport) : une colonne au téléphone, deux sur tablette, et chaque carte garde la hauteur de son contenu (pas de vide en bas) */
#titre-planques ~ .grille { grid-template-columns: 1fr; align-items: start; }
@media (min-width: 640px) { #titre-planques ~ .grille { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Pastilles d'action sur onglets (CSS ::after, sans ajouter de nœuds DOM) */
.onglets [role="tab"][data-alerte="1"], .sous-nav-choix[data-alerte="1"] { position: relative; }
.onglets [role="tab"][data-alerte="1"]::after, .sous-nav-choix[data-alerte="1"]::after { content: ""; position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--or-vif, #e2b857); box-shadow: 0 0 8px rgba(226, 184, 87, .75); }

/* Bouton et dialogue Réglages */
.bouton-reglages { width: 40px; height: 40px; min-width: 40px; padding: 0; border-radius: 50%; border-color: rgba(201, 164, 92, .45); background: rgba(13, 11, 18, .65); color: var(--or-clair); font-size: 1.05rem; }
.zone-decollage .bouton-reglages, .resolution .bouton-reglages { display: none; }
.dialogue-reglages { border: 1px solid rgba(212, 169, 87, .55); border-radius: 14px; background: rgba(16, 13, 24, .97); color: var(--texte); padding: 0; max-width: 420px; width: calc(100% - 24px); box-shadow: 0 18px 48px rgba(0, 0, 0, .7); }
.dialogue-reglages::backdrop { background: rgba(6, 5, 10, .72); backdrop-filter: blur(4px); }
.reglages-boite { padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.reglages-tete { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.reglages-tete h2 { margin: 0; font-size: 1.1rem; }
.reglages-bloc { display: flex; flex-direction: column; gap: 6px; }
.reglages-bloc input[type="range"] { flex: 1; accent-color: var(--or-clair); }
.reglages-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.reglages-etiquette { margin: 0; font-weight: 600; }
.reglages-bloc .aide { margin: 0; }
.reglages-themes { display: flex; gap: 8px; }
.reglages-themes button { flex: 1 1 0; min-height: 44px; font-weight: 500; }
.reglages-themes button[aria-pressed="true"] { border-color: var(--or-vif); font-weight: 700; box-shadow: inset 0 -3px 0 var(--or-vif); }
.reglages-themes button[aria-pressed="true"]::before { content: "\2713\00a0"; }

/* En-tête plus compacte en jeu sur grand écran */
@media (min-width: 720px) {
  body.en-jeu .entete { padding-top: 8px; padding-bottom: 8px; }
  body.en-jeu .entete h1 { font-size: 1.32rem; margin-bottom: 2px; }
  body.en-jeu .afaire { padding: 8px 12px; }
}

/* Missions à venir */
.missions-futures { margin-top: 14px; }
.grille-missions-futures { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 10px; }
.mission-future { margin: 0; opacity: .88; border-style: dashed; border-color: rgba(212, 169, 87, .35); }
.mission-future-tete { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.mission-future-tete h3 { margin: 0; font-size: .98rem; }
.mission-future-raison { margin: 6px 0 0; }

@media (max-width: 600px) {
  .entete > .commande-son .volume-global { display: none; }
  .en-jeu .entete-in { padding-right: 100px; }
}

/* Refonte visuelle Marché & Atelier */
.marche-tete-banniere { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.marche-tete-img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; border: 1px solid rgba(212, 169, 87, .45); flex: 0 0 auto; }
.marche-tete-banniere h2 { margin: 0 0 4px; }
.marche-haut { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
.marche-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, max(330px, 30%)), 1fr)); gap: 12px; align-items: stretch; }   /* trois colonnes au plus : les 6 marchandises en 3 + 3, pas en 4 + 2 en grand écran (maquette du 02/12) */
.ligne-marche { display: flex; flex-direction: column; justify-content: space-between; margin-bottom: 0 !important; }
.marche-prix-bande { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 4px; padding: 8px 10px; border-radius: 8px; background: rgba(13, 11, 18, .65); border: 1px solid rgba(255, 255, 255, .08); }
.marche-prix-pilule { display: inline-flex; flex-direction: column; gap: 1px; min-width: 82px; }
.marche-prix-pilule small { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--texte-doux); }
.marche-prix-pilule b { font-size: .96rem; color: var(--or-clair); font-variant-numeric: tabular-nums; }
.marche-prix-bande .tendance { margin-left: auto; }
.atelier-haut { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 14px; align-items: start; }
.atelier-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.atelier-col > article { margin: 0; }
.atelier-plans-entete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.atelier-plans-entete h2 { margin: 0; }
.atelier-plans-grille { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.atelier-plans-grille .plan { margin: 0; }
.plan.plan-pret { border-color: rgba(212, 169, 87, .65); box-shadow: 0 0 18px rgba(212, 169, 87, .12); }
@media (min-width: 900px) {
  .marche-haut { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .atelier-haut { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
}

/* Refonte visuelle Vaisseau */
.vaisseau-intro { margin: 0 0 14px; }
.vaisseau-intro p:last-child { margin-bottom: 0; }
#panneau-vaisseau > .vaisseau-resume { margin-bottom: 16px; }
.vaisseau-sections, .vaisseau-pieces-tete { grid-column: 1 / -1; }
.vaisseau-pieces-tete h2 { margin: 4px 0 8px; }
.vaisseau-droite > .vaisseau-pieces,
.vaisseau-droite > .cartes-pieces { grid-column: 1 / -1; }

/* Icônes/vignettes sur les en-têtes de blocs et sous-onglets */
.bloc-tete-ic { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.bloc-tete-ic h2, .bloc-tete-ic h3 { margin: 0; }
.bloc-ic-img { width: 32px; height: 32px; border-radius: 8px; object-fit: cover; border: 1px solid rgba(212, 169, 87, .35); background: rgba(13, 11, 18, .65); flex: 0 0 auto; padding: 2px; }
.vaisseau-tab-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.vaisseau-tab-ic { width: 18px; height: 18px; flex: 0 0 auto; opacity: .9; }
.piece-cargo > summary .ic-piece { width: 18px; height: 18px; color: var(--or-clair); flex: 0 0 auto; }

/* La carte « Course en duel » de la Cantina (course_duel.js) : un formulaire qui se range sur une colonne au téléphone, des boutons de 44 px. */
.cantina-course-duel h3 { margin: 1rem 0 .3rem; }
.course-duel-champs { display: grid; grid-template-columns: minmax(7rem, max-content) minmax(0, 1fr); gap: 8px 12px; align-items: center; max-width: 44rem; }
.course-duel-champs select, .course-duel-champs input { min-height: 44px; min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.cantina-course-duel .rangee button { min-height: 44px; }
.course-duel-dernieres { margin: 0; padding-left: 1.1rem; overflow-wrap: anywhere; }
.afaire-course { display: block; margin-top: 4px; }
.afaire-course .lien { min-height: 40px; }
@media (max-width: 600px) { .course-duel-champs { grid-template-columns: minmax(0, 1fr); } }

/* Ordres : une ligne par ordre pas possible, cartes resserrées, bandeau fin sur téléphone. */
.syndicat-indispo-ligne { margin: 4px 0; padding: 5px 8px; font-size: 14px; line-height: 1.35; color: var(--texte-doux); border-left: 3px solid var(--bord); background: rgba(255, 255, 255, .02); border-radius: 0 6px 6px 0; overflow-wrap: anywhere; }
.syndicat-indispo-ligne b { color: var(--texte); font-weight: 600; }
.syndicat-ordre-bloc .syndicat-ordre-puces { margin: 4px 0; }
.syndicat-ordre-bloc .syndicat-ligne { margin: 2px 0; }
.syndicat-ordre-bloc .syndicat-ordre-texte { margin: 4px 0; font-size: 14px; color: var(--texte-doux); }
.syndicat-ordre-bloc .syndicat-ordre-expire { margin: 2px 0; }
.syndicat-ordre-bloc .rangee { margin-top: 6px; }
@media (max-width: 600px) {
  #panneau-syndicat .syndicat-ordres-grille .syndicat-ordres-piece .carte-illustree-visuel { aspect-ratio: 16 / 2.2; }
}
.syndicat-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.syndicat-meta .chance-courte { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.syndicat-ordre-bloc .syndicat-ordre-expire { font-size: 13px; color: var(--texte-doux); }
.syndicat-ordre-bloc .syndicat-ordre-entete { gap: 6px; }

/* La carte « Les manches du Hutt » de la Cantina (Rivalité, lot 1) : le mot du Hutt en citation, six règles, un bouton de 44 px. */
.mot-du-hutt { margin: 12px 0; padding: 8px 14px; border-left: 3px solid var(--or); background: rgba(201, 164, 92, .08); font-style: italic; overflow-wrap: anywhere; }
.mot-du-hutt p { margin: .35em 0; }
.manche-regles { margin: 0 0 12px; padding-left: 1.2rem; overflow-wrap: anywhere; }
.manche-regles li { margin: .3em 0; }
.manche-compte { margin: 0 0 8px; }
.cantina-manche .rangee button { min-height: 44px; }

/* Le receleur de la Cantina (lot cartes 1) : une ligne par carte, le nom et la rareté, le détail, puis le bouton à droite (sous le texte au téléphone). */
.receleur-liste { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .5rem; }
.receleur-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .75rem; padding: .5rem .75rem; border: 1px solid var(--rarete-couleur, #3a3f4a); border-left-width: 4px; border-radius: 8px; }
.receleur-nom { flex: 1 1 14rem; }
.receleur-detail { flex: 1 1 8rem; }
.receleur-vendre { flex: 0 0 auto; margin-left: auto; white-space: nowrap; }
.pack-verrouillees { margin: .5rem 0 0; padding-left: 1.1rem; }
/* Fonds des bâtiments et des recherches (fonds-base, 27/11) : une teinte et un motif par type de point, sans image neuve.
   Liseré et titre colorés (>= 4,5:1 sur la carte), motif très pâle à droite (aucune hauteur de plus), « pas encore bâti » en gris. */
#panneau-syndicat .syndicat-piece, #panneau-syndicat .syndicat-liste > li[class] {
  --t: #c9a45c; --tr: 201, 164, 92; --m: none;
  border-left: 4px solid var(--t);
  background: linear-gradient(100deg, rgba(var(--tr), .16), rgba(24, 20, 32, .94) 55%) , var(--m) right 10px center / 56px no-repeat, rgba(24, 20, 32, .95);
}
#panneau-syndicat .syndicat-piece h3, #panneau-syndicat .syndicat-liste > li[class] > b:first-child { color: var(--t); }
#panneau-syndicat .syndicat-liste > li.t-comptoir, #panneau-syndicat .syndicat-piece.t-comptoir { --t: #e8b04a; --tr: 232, 176, 74; --m: url(/static/art/motifs/caisse.svg); }
#panneau-syndicat .syndicat-liste > li.t-atelier, #panneau-syndicat .syndicat-piece.t-atelier { --t: #e8925a; --tr: 224, 138, 74; --m: url(/static/art/motifs/main.svg); }
#panneau-syndicat .syndicat-liste > li.t-labo, #panneau-syndicat .syndicat-piece.t-labo { --t: #5fc7c0; --tr: 95, 199, 192; --m: url(/static/art/motifs/etoile.svg); }
#panneau-syndicat .syndicat-liste > li.t-corsaires, #panneau-syndicat .syndicat-piece.t-corsaires { --t: #ee7f72; --tr: 224, 103, 90; --m: url(/static/art/motifs/masque.svg); }
#panneau-syndicat .syndicat-liste > li.t-codes, #panneau-syndicat .syndicat-piece.t-codes { --t: #6fcf97; --tr: 111, 207, 151; --m: url(/static/art/motifs/balise.svg); }
#panneau-syndicat .syndicat-liste > li.t-salon, #panneau-syndicat .syndicat-piece.t-salon { --t: #bf9af2; --tr: 181, 140, 240; --m: url(/static/art/motifs/lune.svg); }
#panneau-syndicat .syndicat-piece.pas-encore { --t: #a79fb4; --tr: 167, 159, 180; --m: none; border-left-style: dashed; background: rgba(24, 20, 32, .5); }
#panneau-syndicat .syndicat-liste > li .aide { color: #c4bccf; }
@media (forced-colors: active) { #panneau-syndicat .syndicat-piece, #panneau-syndicat .syndicat-liste > li[class] { background: Canvas; } }

/* Tes points à dépenser : en haut des ordres, bien visibles. */
.syndicat-stock { margin: 8px 0 12px; }
.syndicat-stock-titre { margin: 0 0 6px; font-size: 15px; color: var(--or); }
.syndicat-points { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.syndicat-point { display: flex; flex-direction: column; gap: 1px; padding: 8px 12px; border: 1px solid var(--or); border-radius: 10px; background: rgba(201, 164, 92, .10); }
.syndicat-point.manque { border-color: #d08a4a; background: rgba(208, 138, 74, .12); }
.syndicat-point-nom { font-size: 13px; text-transform: capitalize; color: var(--texte-doux); }
.syndicat-point-valeur { font-size: 28px; line-height: 1.1; color: var(--or-clair); font-variant-numeric: tabular-nums; }
.syndicat-point.manque .syndicat-point-valeur { color: #e6a263; }
.syndicat-point-aide { font-size: 12px; color: var(--texte-doux); }
.syndicat-point-alerte { margin-top: 3px; font-size: 12px; font-weight: 700; color: #e6a263; }
.syndicat-point { border-left: 4px solid var(--t, #c9a45c); border-color: rgba(var(--tr, 201, 164, 92), .55); border-left-color: var(--t, #c9a45c); background: linear-gradient(100deg, rgba(var(--tr, 201, 164, 92), .16), rgba(24, 20, 32, .94) 70%); }
.syndicat-point-nom { color: var(--t, var(--or)); font-weight: 700; text-transform: none; }
.syndicat-point-valeur { color: var(--texte); }
/* Une couleur par sorte de point, les mêmes que les bâtiments (t-<pièce> : --t le trait, --tr le même en r, v, b pour les fonds). */
/* Contours des six pastilles : mêmes familles de teintes que les bâtiments, mais adoucies (28/11) ; elles restent distinctes entre elles */
.syndicat-point.t-comptoir { --t: #d9b872; --tr: 217, 184, 114; }
.syndicat-point.t-atelier { --t: #d9a07d; --tr: 217, 160, 125; }
.syndicat-point.t-labo { --t: #84bdb8; --tr: 132, 189, 184; }
.syndicat-point.t-corsaires { --t: #d8928b; --tr: 216, 146, 139; }
.syndicat-point.t-codes { --t: #8bbf9f; --tr: 139, 191, 159; }
.syndicat-point.t-salon { --t: #b8a4dc; --tr: 184, 164, 220; }
.syndicat-point.manque { border-left-color: var(--t); }
.syndicat-prio-ligne { margin: 4px 0 0; font-size: 14px; color: var(--texte); }
.syndicat-prio-ligne .etoile-or { color: var(--or); }
@media (max-width: 600px) { .syndicat-points { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; } .syndicat-point { padding: 6px 10px; } .syndicat-point-valeur { font-size: 24px; } }

/* Écran Base (fonds-base, 27/11) : la base d'abord, une phrase d'aide par section, le syndicat de joueurs en une ligne. */
#panneau-syndicat .syndicat-aide-section { margin: 4px 0 10px; }
#panneau-syndicat .syndicat-a-quoi { margin: 0; color: var(--texte); }
#panneau-syndicat .syndicat-ligne-synd { margin: 0; }
#panneau-syndicat .lien-bouton { background: none; border: 0; padding: 4px 2px; min-height: 32px; color: var(--or-clair); font: inherit; text-decoration: underline; cursor: pointer; }
#panneau-syndicat .syndicat-section-base { margin-bottom: 16px; }
/* Les points à dépenser : toujours 6 pastilles, jamais une orpheline : 6 sur une ligne si ça tient, sinon 3 x 2, et 2 x 3 sur téléphone. */
#panneau-syndicat .syndicat-points { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
#panneau-syndicat .syndicat-point { padding: 6px 10px; }
#panneau-syndicat .syndicat-point-valeur { font-size: 24px; }
@media (min-width: 1100px) { #panneau-syndicat .syndicat-points { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 600px) {   /* téléphone : deux colonnes, les bâtiments arrivent plus tôt */
  #panneau-syndicat .syndicat-points { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  #panneau-syndicat .syndicat-point { padding: 5px 8px; }
  #panneau-syndicat .syndicat-point-valeur { font-size: 20px; }
  #panneau-syndicat .syndicat-section-base .syndicat-point-aide + .syndicat-point-aide { display: none; }
  #panneau-syndicat .syndicat-point-nom { font-size: 12px; }
}
/* La phrase « Un ordre, c'est une mission… » : pleine largeur, alignée avec le reste. */
#panneau-syndicat .syndicat-but-ordres { max-width: none; }
/* Vue Syndicat : les six couleurs ne se coupent plus au bord de leur carte (le nom entier tient dans chaque case). */
#panneau-syndicat .couleurs-grille { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); }
#panneau-syndicat .choix-couleur { min-width: 0; overflow-wrap: anywhere; }

/* Images peintes des bâtiments (fonds-base, 27/11) : bandeau en tête de chaque carte (comme les cartes d'ordres), vignette ronde sur les recherches.
   Elles remplacent le pictogramme pâle en filigrane. Hauteur fixe : pas de saut de mise en page au chargement. */
#panneau-syndicat .syndicat-piece, #panneau-syndicat .syndicat-liste > li[class] {
  background: linear-gradient(100deg, rgba(var(--tr), .16), rgba(24, 20, 32, .94) 55%), rgba(24, 20, 32, .95);
}
#panneau-syndicat .syndicat-piece { overflow: hidden; }
#panneau-syndicat .syndicat-piece-visuel { position: relative; height: 110px; margin: -16px calc(-1 * var(--pad-x, 14px)) 10px; overflow: hidden; background: #181420; }   /* l'image va d'un bord à l'autre de la carte, sans la dépasser (elle débordait de 4 px) */
#panneau-syndicat .syndicat-piece-visuel img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
#panneau-syndicat .syndicat-piece-visuel::after { content: ""; position: absolute; inset: auto 0 0 0; height: 65%; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(24, 20, 32, .97)); }
#panneau-syndicat .syndicat-piece.pas-encore .syndicat-piece-visuel img { filter: grayscale(1) brightness(.7); opacity: .75; }
#panneau-syndicat .syndicat-piece h3 { text-shadow: 0 1px 3px rgba(0, 0, 0, .7); }
#panneau-syndicat .syndicat-liste > li[class] { display: flow-root; }
#panneau-syndicat .syndicat-recherche-vignette { float: left; width: 40px; height: 40px; margin: 0 10px 4px 0; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--t); background: #181420; }
#panneau-syndicat .syndicat-recherche-vignette img { display: block; width: 100%; height: 100%; object-fit: cover; }
#panneau-syndicat .syndicat-liste > li.faite .syndicat-recherche-vignette img { filter: saturate(.6); }
@media (max-width: 600px) {
  #panneau-syndicat .syndicat-piece-visuel { height: 80px; }
  #panneau-syndicat .syndicat-recherche-vignette { width: 32px; height: 32px; }
}
@media (forced-colors: active) { #panneau-syndicat .syndicat-piece-visuel::after { display: none; } #panneau-syndicat .syndicat-recherche-vignette { border-color: CanvasText; } }

/* La ligne « Pour le chapitre N : … » du Cockpit (bord.js, ligneChapitreSuivant) : le fait en retrait, ce qui reste en évidence. */
.bord-suivant { margin: 6px 0; padding: 6px 10px; border-left: 3px solid var(--or); background: rgba(212, 169, 87, .08); border-radius: 0 6px 6px 0; font-size: .92rem; line-height: 1.45; }
.bord-suivant .suivant-fait { color: var(--texte-doux); }
.bord-suivant .suivant-afaire { color: var(--or); }

/* « Ton équipage » du Cockpit : une miniature ronde par équipier (bord.js, equipier). */
.bord-equipage > li.bord-equipier { display: grid; grid-template-columns: 40px minmax(0, 1fr); grid-template-areas: "img nom" "img detail"; align-items: center; gap: 0 10px; }
.bord-equipier > img { grid-area: img; width: 40px; height: 40px; border-width: 1px; }
.bord-equipier > .bord-equipier-nom { grid-area: nom; font-weight: 600; }
.bord-equipier > span:last-child { grid-area: detail; color: var(--texte-doux); font-size: .9rem; }

/* « Dans la Bordure » du Cockpit : une icône dorée (art/icones/galaxie-or.svg) dans sa vignette, plus la galaxie réduite (bord.js, bordureBord). */
.bord-bordure-corps > .vignette-mini.icone-or { box-sizing: border-box; object-fit: contain; padding: 8px; }

/* ---------- Débuts courts : la rangée de bonus d'une approche se replie ---------- */
.repli-bonus { margin: 10px 0 4px; }
.repli-bonus > summary { cursor: pointer; font-weight: 600; color: var(--or-clair); min-height: 44px; display: flex; align-items: center; }
.repli-bonus > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.repli-bonus[open] > summary { margin-bottom: 4px; }
@media (max-width: 600px) {   /* cartes d'approche plus serrées au téléphone : la page de l'histoire faisait 4 600 px */
  .panneau > article.approche { padding: 12px; margin-bottom: 10px; }
  .approche .total { margin: 8px 0 0; padding: 6px 10px; }
  .approche h3 { margin: 0 0 4px; }
  .approche .faits { margin: 4px 0; }
  .approche .fait { padding: 4px 10px; }
  .repli-bonus { margin: 6px 0 2px; }
  .approche .rangee { margin-top: 10px; }
}
.repli-bonus .regles-titre { margin: 8px 0 2px; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--texte-doux); }
.repli-bonus > ul { margin: 0 0 8px; padding-left: 20px; }

/* Retour n° 39 (30/11) : rappel lieu et heure du gros coup dans le Cockpit */
.bord-coup-rappel { margin: 6px 0 4px; padding: 6px 10px; border-left: 3px solid var(--or); border-radius: 0 6px 6px 0; background: rgba(212, 169, 87, .11); color: var(--texte); font-size: .92rem; }
.bord-coup-rappel b { color: var(--or-clair); }
.bord-coup-lieu { margin: 2px 0 6px; color: #f0b673; }

/* Retour n° 40 (30/11) : série / album complété bien visible (couleur + effet) à l'ouverture de pack et au Cockpit */
.carte-tirage.serie-complete.retournee .carte-recto {
  border-color: #ffd66b;
  box-shadow: 0 0 0 2px rgba(255, 214, 107, .55), 0 0 26px rgba(255, 200, 74, .45);
  animation: serie-complete-halo 2.2s ease-in-out infinite;
}
.carte-pack-gain.avec-serie-complete { display: flex; flex-direction: column; gap: 6px; }
.carte-pack-gain-base { color: var(--texte-doux); font-weight: 500; }
.carte-pack-serie-complete {
  display: block;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 214, 107, .75);
  background: linear-gradient(135deg, rgba(255, 214, 107, .24), rgba(111, 207, 151, .16));
  color: #ffe89e;
  line-height: 1.35;
}
.carte-pack-serie-complete b { color: #fff0b8; }
.serie-complete-badge {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 7px;
  border-radius: 999px;
  background: #ffd66b;
  color: #1a1206;
  font: 700 .78rem/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: .02em;
  vertical-align: middle;
}
.ouverture-serie-complete {
  position: relative;
  overflow: hidden;
  width: min(100%, 640px);
  margin: 8px auto 4px;
  padding: 12px 16px;
  border: 2px solid #ffd66b;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 214, 107, .22), rgba(40, 28, 12, .92) 55%, rgba(111, 207, 151, .18));
  box-shadow: 0 0 24px rgba(255, 214, 107, .35), inset 0 0 18px rgba(255, 214, 107, .14);
  text-align: center;
}
.ouverture-serie-complete.actif { animation: serie-complete-entree .45s cubic-bezier(.2, .9, .25, 1.15) both; }
.ouverture-serie-complete::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 240, 184, .32) 50%, transparent 75%);
  transform: translateX(-120%);
  animation: serie-complete-reflet 1.6s ease-out .25s 2;
  pointer-events: none;
}
.ouverture-serie-complete-tete {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 12px;
  border-radius: 999px;
  background: #ffd66b;
  color: #1a1206;
  font: 800 .92rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.ouverture-serie-complete-etoile { font-size: 1.05em; }
.ouverture-serie-complete-texte { margin: 8px 0 0; font-weight: 700; font-size: .98rem; color: #fff2c2; line-height: 1.4; }
.bord-faits > li.bord-fait-serie-complete {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 214, 107, .65);
  background: linear-gradient(120deg, rgba(255, 214, 107, .16), rgba(111, 207, 151, .09));
}
.bord-faits > li.bord-fait-serie-complete .bord-fait > b { color: #ffe89e; }
@keyframes serie-complete-entree {
  0% { opacity: 0; transform: scale(.92) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes serie-complete-reflet {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(130%); }
}
@keyframes serie-complete-halo {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255, 214, 107, .55), 0 0 22px rgba(255, 200, 74, .38); }
  50% { box-shadow: 0 0 0 3px rgba(255, 232, 158, .85), 0 0 34px rgba(255, 214, 107, .68); }
}
@media (prefers-reduced-motion: reduce) {
  .carte-tirage.serie-complete.retournee .carte-recto,
  .ouverture-serie-complete.actif,
  .ouverture-serie-complete::after { animation: none !important; }
}
@media (forced-colors: active) {
  .ouverture-serie-complete, .carte-pack-serie-complete, .bord-faits > li.bord-fait-serie-complete { border: 2px solid CanvasText; background: Canvas; color: CanvasText; }
  .ouverture-serie-complete-tete, .serie-complete-badge { border: 1px solid CanvasText; background: Highlight; color: HighlightText; }
}

/* ---------- Territoires des syndicats sur la carte (partition de Voronoï bornée) ---------- */
.plateau-carte.sans-territoires .couche-territoires,
.plateau-carte.sans-territoires .noms-territoires { display: none; }
.couche-territoires { pointer-events: none; }
.territoire-fond { fill: var(--terr-c, #c9a45c); fill-opacity: .14; stroke: none; }
.territoire-bloc.joueur .territoire-fond { fill-opacity: .17; }
.territoire-bloc.mien .territoire-fond { fill-opacity: .22; }
.territoire-bloc.dispute .territoire-fond { fill-opacity: .09; }
.territoire-hachure { fill: url(#hachure-dispute); stroke: none; }
.hachure-dispute-trait { stroke: #e4c37e; stroke-width: .18; stroke-opacity: .34; }
.carte-monde .territoire-lueur {
  fill: none; stroke: var(--terr-c, #c9a45c);
  stroke-width: calc(2.4px / var(--zoom, 1));
  stroke-opacity: .16; stroke-linejoin: round; stroke-linecap: round;
}
.carte-monde .territoire-bloc.mien .territoire-lueur {
  stroke-width: calc(3px / var(--zoom, 1));
  stroke-opacity: .24;
}
.carte-monde .territoire-bord {
  fill: none; stroke: var(--terr-c, #c9a45c);
  stroke-width: calc(.7px / var(--zoom, 1));
  stroke-opacity: .76; stroke-linejoin: round; stroke-linecap: round;
}
.carte-monde .territoire-bloc.pnj .territoire-bord {
  stroke-width: calc(.55px / var(--zoom, 1));
  stroke-opacity: .64;
  stroke-dasharray: calc(1.5px / var(--zoom, 1)) calc(.9px / var(--zoom, 1));
}
.carte-monde .territoire-bloc.mien .territoire-bord {
  stroke-width: calc(1px / var(--zoom, 1));
  stroke-opacity: .95;
}
.carte-monde .territoire-bloc.dispute .territoire-bord {
  stroke-width: calc(.75px / var(--zoom, 1));
  stroke-opacity: .84;
  stroke-dasharray: calc(.9px / var(--zoom, 1)) calc(.9px / var(--zoom, 1));
}
.carte-monde .territoire-aura {
  fill: var(--terr-c, #c9a45c); fill-opacity: .15;
  stroke: var(--terr-c, #c9a45c); stroke-width: calc(.22px / var(--zoom, 1)); stroke-opacity: .5;
}
.carte-monde .territoire-aura.mien { fill-opacity: .22; stroke-opacity: .74; }
.carte-monde .territoire-aura.dispute { fill-opacity: .12; stroke-dasharray: calc(.5px / var(--zoom, 1)) calc(.5px / var(--zoom, 1)); }
.noms-territoires { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.nom-territoire {
  position: absolute; transform: translate(-50%, -50%) scale(calc(1 / var(--zoom, 1)));
  white-space: nowrap; pointer-events: none;
  font: 700 .72rem/1.15 Georgia, "Times New Roman", serif;
  font-variant: small-caps; letter-spacing: .09em;
  color: var(--terr-c, var(--or-clair));
  color: color-mix(in srgb, var(--terr-c, var(--or-clair)) 72%, #fff);
  opacity: .82;
  text-shadow: 0 1px 4px #000, 0 0 8px rgba(0, 0, 0, .92);
  transition: opacity .18s;
}
.nom-territoire.mien { opacity: .94; }
.nom-territoire.dispute { color: var(--or-clair); letter-spacing: .07em; }
.signe-territoire { opacity: .95; }
.plateau-carte.loin .nom-territoire, .plateau-carte.proche .nom-territoire { display: none; }
.territoire-cle {
  display: inline-block; width: 18px; height: 14px; box-sizing: border-box;
  border-radius: 5px 7px 6px 4px;
  border: 1.5px solid var(--or-clair);
  background: linear-gradient(135deg, rgba(201, 164, 92, .32), rgba(201, 164, 92, .12));
}
.legende-territoires { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--bord); }
.legende-territoires-titre { margin: 0 0 6px; font: 700 .92rem Georgia, "Times New Roman", serif; color: var(--or-clair); }
.cle-territoires { gap: 6px 14px; }
.territoire-puce {
  display: inline-grid; place-items: center; width: 18px; height: 18px; box-sizing: border-box;
  border-radius: 5px; border: 1.5px solid var(--terr-c, var(--or-clair));
  background: color-mix(in srgb, var(--terr-c, var(--or-clair)) 22%, #14101d);
  color: color-mix(in srgb, var(--terr-c, var(--or-clair)) 82%, #fff);
  font-size: .72rem; line-height: 1;
}
.territoire-puce.pnj { border-style: dashed; }
.territoire-puce.mien { border-width: 2px; box-shadow: 0 0 6px color-mix(in srgb, var(--terr-c, var(--or-clair)) 55%, transparent); }
.territoire-puce.dispute {
  border-style: dashed; border-color: var(--or-clair); color: var(--or-clair);
  background: repeating-linear-gradient(45deg, rgba(228, 195, 126, .24) 0 3px, rgba(20, 16, 29, .9) 3px 6px);
}
.cle-territoires .territoire-mien { color: var(--texte); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .nom-territoire { transition: none; }
}
@media (forced-colors: active) {
  .territoire-fond { fill: none; }
  .carte-monde .territoire-bord, .carte-monde .territoire-aura, .zone-galaxie { stroke: CanvasText; stroke-opacity: 1; }
  .territoire-bloc.mien .territoire-bord { stroke: Highlight; }
  .nom-territoire { color: CanvasText; opacity: 1; text-shadow: none; background: Canvas; padding: 1px 4px; border: 1px solid CanvasText; border-radius: 4px; }
  .territoire-cle, .territoire-puce { forced-color-adjust: none; border-color: CanvasText; background: Canvas; color: CanvasText; }
}

/* ---------- Puce Chapitre cliquable, L'arc (bilan & scènes), et dédoublonnage Syndicat ---------- */
button.puce.chapitre-puce {
  min-height: 32px; padding: 2px 12px; border-radius: 99px; cursor: pointer;
  color: var(--texte); font: inherit; font-size: .9rem; line-height: 1.35;
  border-color: rgba(201, 164, 92, .55); background: rgba(201, 164, 92, .12);
}
button.puce.chapitre-puce:hover { border-color: var(--or-clair); background: rgba(201, 164, 92, .22); color: var(--or-clair); }
.arc li.termine { border-color: rgba(111, 207, 151, .45); background: rgba(111, 207, 151, .06); }
.arc li.a-venir { border-style: dashed; border-color: rgba(201, 164, 92, .45); }
.arc-bilan, .arc-scenes { margin-top: 14px; }
.arc-bilan-grille { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.arc-bilan-grille li { padding: 8px 10px; border: 1px solid var(--bord); border-radius: 8px; background: var(--fond-champ); display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.arc-bilan-grille small { font-size: .78rem; color: var(--texte-doux); text-transform: uppercase; letter-spacing: .05em; }
.arc-bilan-grille b { color: var(--or-clair); }
.arc-scenes-grille { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.arc-scenes-grille button { min-height: 44px; flex: 1 1 200px; text-align: left; justify-content: flex-start; }

/* Quand la barre unifiée (#sous-nav) ou le menu à gauche est affiché, les doublons internes de Syndicat (Flotte, Organisation, Ordres) s'effacent */
#vue-jeu:has(> #sous-nav:not([hidden])) #panneau-syndicat .syndicat-nav-doublon,
html.menu-gauche #vue-jeu:has(> #sous-nav:not([hidden])) #panneau-syndicat .syndicat-nav-doublon,
#vue-jeu:has(> #sous-nav:not([hidden])) #panneau-syndicat .syndicat-sous-nav-wrap.une-seule-base,
#vue-jeu:has(> #sous-nav:not([hidden])) #panneau-syndicat .syndicat-sommaire.syndicat-sommaire-ordres { display: none; }
