:root {
  --bg: #0f1115;
  --panel: #171a21;
  --panel2: #1f242e;
  --line: #2a303c;
  --txt: #e7ebf0;
  --muted: #8b96a5;
  --accent: #22c55e;
  --accent2: #2563eb;
  --danger: #ef4444;
  --gold: #f5c518;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--txt);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

#hud + main button { cursor: pointer; }

/* HUD */
#hud {
  display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 16px;
  background: var(--panel2); border-bottom: 1px solid var(--line);
}
.stat {
  display: flex; flex-direction: column; padding: 4px 12px;
  border-right: 1px solid var(--line); min-width: 90px;
  position: relative;                 /* pour la puce de suspicion, en haut à droite */
}
/* Pastilles d'état : la couleur porte l'information, le chiffre est dans l'infobulle. */
.puce {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%;
  vertical-align: middle; flex: none;
}
.puce-suspicion { position: absolute; top: 5px; right: 5px; }

/* Réponses automatiques : une jauge par trait, et la part de chaque règle. */
.temoin-save {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 8px; z-index: 900;
  background: rgba(234, 179, 8, .92); color: #1c1917; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.temoin-save[hidden] { display: none; }
.lg-veh.auto b { color: #22c55e; }
.lg-veh-edit.colonne { display: grid; gap: 6px; }
.tr-choix { margin: 6px 0 10px; display: grid; gap: 4px; }
.tr-choix select { max-width: 420px; }
.tr-verdict { font-size: 12px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tr-ok { color: #16a34a; }
.tr-manque { color: #ea580c; }
.fret-manuel { margin: 6px 0; }
.fret-manuel summary { cursor: pointer; font-size: 12px; }
.lg-partage {
  font-size: 11px; padding: 1px 6px; border-radius: 999px;
  background: rgba(234, 179, 8, .15); color: #ca8a04; white-space: nowrap;
}
.align-courbes {
  width: 100%; height: 150px; background: rgba(127,127,127,.06);
  border-radius: 8px; margin-top: 4px;
}
.al-legendes { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; margin: 4px 0 10px; }
.al-leg { white-space: nowrap; }
.traits-graphe { display: grid; gap: 10px; margin: 10px 0 14px; }
.trait-bloc { background: rgba(127,127,127,.06); border-radius: 8px; padding: 7px 9px; }
.trait-tete { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.trait-jauge {
  position: relative; height: 9px; margin: 5px 0 4px; border-radius: 5px;
  background: rgba(127,127,127,.18); overflow: visible;
}
.trait-jauge .tj-actuel {
  position: absolute; inset: 0 auto 0 0; border-radius: 5px; background: #64748b;
}
.trait-jauge .tj-cible {
  position: absolute; top: -3px; width: 2px; height: 15px; background: #e2e8f0;
  border-radius: 1px; box-shadow: 0 0 0 1px rgba(0,0,0,.5);
}
.trait-parts { display: flex; height: 7px; gap: 1px; border-radius: 4px; overflow: hidden; }
.trait-parts .tp-seg {
  border: 0; padding: 0; cursor: pointer; background: #38bdf8; min-width: 3px;
}
.trait-parts .tp-seg:nth-child(2n) { background: #818cf8; }
.trait-parts .tp-seg:nth-child(3n) { background: #34d399; }
.trait-parts .tp-seg:nth-child(4n) { background: #fbbf24; }
.trait-parts .tp-seg:hover { background: #ef4444; }
.trait-legende { margin-top: 3px; }
/* La santé, à côté du nom : la pastille ET son chiffre ouvrent les soins. */
.jauge-sante {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 7px;
  vertical-align: middle; cursor: pointer;
}
.jauge-sante small { font-size: 11px; color: var(--muted); font-weight: 400; }
.jauge-sante:hover small { color: var(--txt); }
.stat span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.stat b { font-size: 16px; }
.stat.dette b { color: var(--danger); }
.stat.blessure b { color: var(--danger); }

/* Layout principal */
main { flex: 1; display: flex; min-height: 0; }
#map-wrap { flex: 1; position: relative; }
#map { position: absolute; inset: 0; }
#side {
  width: 380px; background: var(--panel); border-left: 1px solid var(--line);
  overflow-y: auto; padding: 14px;
}

/* Marché */
h2 { margin: 0 0 4px; font-size: 18px; }
.muted { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
table.marche { width: 100%; border-collapse: collapse; font-size: 13px; }
table.marche th, table.marche td { text-align: left; padding: 2px 5px; border-bottom: 1px solid var(--line); }
table.marche .num { text-align: right; white-space: nowrap; }

/* Lignes compactes : le nom occupe la place restante et se tronque plutôt que
   de passer sur deux lignes ; prix et actions restent sur une seule ligne. */
table.marche td.m-nom { max-width: 0; width: 100%; }
table.marche .mn { display: flex; align-items: center; gap: 4px; min-width: 0; cursor: pointer; }
table.marche .mn-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.marche .mn .tag { flex: 0 0 auto; }
table.marche td.m-act { white-space: nowrap; text-align: right; width: 1%; }
/* plus spécifique que `table.marche button:last-child`, sinon l'icône de vente
   récupérerait le fond vert du bouton plein */
table.marche td.m-act button.ico {
  padding: 1px 5px; font-size: 15px; line-height: 1.15; margin-left: 2px;
  background: transparent; border: 1px solid var(--line); filter: saturate(.9);
}
table.marche td.m-act button.ico:hover:not(:disabled) {
  border-color: var(--accent2); filter: none; background: rgba(255, 255, 255, .06);
}
table.marche button {
  background: var(--accent2); border: none; color: #fff; padding: 5px 8px;
  border-radius: 6px; font-size: 12px; margin-left: 4px; cursor: pointer;
}
table.marche button:last-child { background: var(--accent); }
table.marche button:disabled { opacity: .4; cursor: not-allowed; }
.tag { background: var(--gold); color: #000; padding: 1px 6px; border-radius: 5px; font-size: 10px; }

.ligne { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.ligne input, #modal input { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); padding: 8px; border-radius: 6px; flex: 1; }
/* une case à cocher ne doit jamais s'étirer : sinon elle repousse son libellé */
.ligne input[type=checkbox], #modal input[type=checkbox] {
  flex: 0 0 auto; width: auto; padding: 0; margin: 0; cursor: pointer;
}
button.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }

/* Journal — colonne verticale à gauche de la carte */
#journal-bar {
  position: relative;
  flex-shrink: 0;
  width: var(--jb-w, 260px);
  background: var(--panel2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.jb-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.jb-title { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
#jb-toggle {
  background: var(--panel); color: var(--txt); border: 1px solid var(--line);
  border-radius: 6px; padding: 2px 9px; cursor: pointer; font-size: 12px; line-height: 1.2;
}
#jb-toggle:hover { border-color: var(--accent2); }
#journal {
  flex: 1; min-height: 0;
  font-size: 12px; color: var(--muted); line-height: 1.6;
  overflow-y: auto; padding: 4px 12px;
}
#journal div { border-bottom: 1px dashed var(--line); padding: 3px 0; }
/* poignée de redimensionnement (bord droit, largeur) */
#jb-resize {
  position: absolute; top: 0; right: 0; bottom: 0; width: 6px;
  cursor: ew-resize; background: linear-gradient(to right, transparent, var(--line));
}
#jb-resize:hover { background: var(--accent2); opacity: .6; }
/* état replié : bande fine, seul le bouton reste visible */
#journal-bar.collapsed { width: 30px; }
#journal-bar.collapsed .jb-title,
#journal-bar.collapsed #journal,
#journal-bar.collapsed #jb-resize { display: none; }
#journal-bar.collapsed .jb-head { padding: 6px 3px; justify-content: center; }
@media (max-width: 820px) {
  #journal-bar { width: auto; border-right: none; border-bottom: 1px solid var(--line); }
  #journal { max-height: 22vh; }
  #journal-bar.collapsed { width: auto; }
}

/* Marqueurs carte */
.joueur-pin { font-size: 26px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
.controle-pin { font-size: 22px; }
.maison-pin { font-size: 24px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); }
/* Labos : une ligne par labo (large, très basse), groupées par ville, triées par drogue */
.labo-ville { margin-bottom: 8px; }
summary.labo-ville-titre { margin: 6px 0 4px; font-size: 13px; opacity: .9; cursor: pointer; user-select: none; }
summary.labo-ville-titre:hover { opacity: 1; }
/* second niveau : les types à l'intérieur d'une ville, repliables aussi */
.labo-type { margin: 2px 0 4px 12px; border-left: 1px solid #2a2f3a; padding-left: 8px; }
summary.labo-type-titre {
  font-size: 12px; padding: 2px 0; cursor: pointer; user-select: none; color: #cbd5e1;
}
summary.labo-type-titre:hover { color: #fff; }
summary.labo-type-titre .muted { margin-left: 6px; }
.labo-catalogue { margin-top: 14px; }
summary.labo-catalogue-titre {
  font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer;
  user-select: none; padding: 4px 0;
}
summary.labo-catalogue-titre:hover { color: var(--txt); }
.labo-list { display: flex; flex-direction: column; gap: 2px; }
.labo-row {
  display: flex; align-items: center; gap: 8px; min-height: 24px;
  padding: 1px 8px; font-size: 12px; line-height: 1.2;
  border: 1px solid rgba(127,127,127,.20); border-radius: 4px; background: rgba(127,127,127,.05);
}
.labo-row .lr-nom { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.labo-row .lr-etat { flex: 0 0 auto; white-space: nowrap; }
.labo-row .lr-etat.actif { color: var(--accent, #ffc107); }
.labo-row .lr-etat.manque { color: var(--danger, #ef4444); }
.labo-row .lr-mix { flex: 0 0 auto; display: flex; align-items: center; gap: 3px; white-space: nowrap; }
.labo-row .lr-mix b { display: inline-block; min-width: 22px; text-align: center; } /* évite que le layout saute quand le % change */
.labo-row .lr-mix input[type=range] { width: 104px; min-width: 104px; }
.labo-row .mini { flex: 0 0 auto; padding: 0 7px; }

/* Pion client façon smiley jaune, bien visible sur la carte */
.client-icon { background: none; border: 0; }
.client-marker { position: relative; width: 38px; height: 38px; cursor: pointer; }
.client-face {
  position: absolute; left: 4px; top: 4px; width: 30px; height: 30px; border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #ffe864, #ffcb1f 60%, #f0a500 100%);
  border: 2px solid #8a5a00; box-sizing: border-box;
  box-shadow: 0 2px 5px rgba(0,0,0,.55);
}
.client-face::before, .client-face::after { /* yeux */
  content: ""; position: absolute; top: 8px; width: 4px; height: 6px;
  background: #3a2600; border-radius: 50%;
}
.client-face::before { left: 7px; }
.client-face::after  { right: 7px; }
.client-smile { /* sourire */
  position: absolute; left: 50%; top: 13px; transform: translateX(-50%);
  width: 15px; height: 8px; border: 2px solid #3a2600; border-top: 0;
  border-radius: 0 0 15px 15px;
}
.client-badge { /* drogue commandée */
  position: absolute; top: -3px; right: -3px; font-size: 15px; line-height: 1;
  background: #fff; border-radius: 50%; padding: 1px;
  box-shadow: 0 1px 3px rgba(0,0,0,.6);
}
.client-marker.ordering .client-face { animation: clientPulse 1.6s ease-in-out infinite; }
@keyframes clientPulse {
  0%, 100% { box-shadow: 0 2px 5px rgba(0,0,0,.55), 0 0 0 0 rgba(255,203,31,.65); }
  50%      { box-shadow: 0 2px 5px rgba(0,0,0,.55), 0 0 0 8px rgba(255,203,31,0); }
}
.client-marker.idle .client-face { filter: grayscale(.55) brightness(.95); opacity: .8; }

/* Installation de labos en lot : modèle (mix) + quantité */
.labo-modele {
  display: flex; align-items: center; gap: 5px; margin: 6px 0 2px;
  font-size: 12px; color: #9aa4b2; white-space: nowrap;
}
.labo-modele .lm-titre { margin-right: 2px; }
.labo-modele input[type=range] { flex: 1 1 auto; min-width: 70px; }
.labo-modele b { min-width: 22px; text-align: center; color: #e6e9ef; }
.labo-achat { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.labo-achat label { display: flex; align-items: center; gap: 3px; font-size: 12px; color: #9aa4b2; }
.labo-achat input { width: 54px; padding: 2px 4px; }
.labo-achat button { flex: 1 1 auto; }
h4 > .mini { margin-left: 8px; font-size: 12px; padding: 2px 8px; vertical-align: middle; }

/* Pressentiment (Psychologie 4) sur une commande douteuse */
.pressentiment {
  margin-bottom: 4px; padding: 3px 7px; border-radius: 5px; font-size: 12px; font-weight: 600;
  background: rgba(239, 68, 68, .14); border: 1px solid rgba(239, 68, 68, .45); color: #fca5a5;
}

/* Alertes : bandeaux pour les faits qui ne doivent pas se noyer dans le journal */
/* Trois coins : ce qui te tombe dessus en bas à droite, ce que ton monde te
   demande en bas à gauche, ce qui attend une décision en haut au milieu. */
.zone-alertes {
  position: fixed; z-index: 10000; display: flex; gap: 8px;
  width: min(460px, calc(100vw - 24px)); pointer-events: none;
}
#alertes-bd { bottom: 12px; right: 12px; flex-direction: column-reverse; }
#alertes-bg { bottom: 12px; left: 12px; flex-direction: column-reverse; }
#alertes-hc {
  top: 12px; left: 50%; transform: translateX(-50%); flex-direction: column;
  align-items: center;
}
#alertes-hc .alerte { width: 100%; }
.alerte {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
  border-radius: 10px; border: 1px solid #2a2f3a; background: #161a22;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .55); cursor: pointer; pointer-events: auto;
  animation: alerteEntree .22s ease-out;
}
.alerte.sortie { opacity: 0; transform: translateY(8px); transition: all .22s ease-in; }
@keyframes alerteEntree { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
.alerte .al-emoji { font-size: 20px; line-height: 1.1; flex: 0 0 auto; }
.alerte .al-corps { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.alerte .al-corps small { color: #9aa4b2; font-size: 12px; }
.alerte .al-x {
  flex: 0 0 auto; background: transparent; border: 0; color: #64748b;
  font-size: 14px; cursor: pointer; padding: 0 2px;
}
.alerte .al-x:hover { color: #e2e8f0; }
.alerte.grave { border-left: 4px solid #ef4444; }
.alerte.sante { border-left: 4px solid #f472b6; }
.alerte.echec { border-left: 4px solid #f59e0b; }
/* Une alerte qui attend une réponse : elle reste, et elle se voit. */
.alerte.attend {
  cursor: default; border-color: #f59e0b;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .6), 0 0 0 1px rgba(245, 158, 11, .35);
}
.alerte .al-choix { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.alerte .al-auto {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 5px;
  color: #9aa4b2; font-size: 11px; cursor: pointer;
}

/* Bilan des formations */
.form-hist { margin-top: 6px; }
.fh-row {
  display: flex; align-items: center; gap: 10px; padding: 3px 6px;
  border-bottom: 1px solid #23272f; font-size: 12px;
}
.fh-row .fh-jour { flex: 0 0 46px; }
.fh-row .fh-nom { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fh-row .fh-taux { flex: 0 0 42px; text-align: right; }
.fh-row .fh-res { flex: 0 0 86px; }
.fh-row .fh-cout { flex: 0 0 70px; text-align: right; }
.fh-row.ok .fh-res { color: #22c55e; }
.fh-row.ko .fh-res { color: #ef4444; }

/* ===== Casino : hall + salles animées (js/casinoUI.js) ===== */
.casino-barre {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 6px 0 10px;
  padding: 8px 12px; border-radius: 10px; background: rgba(0,0,0,.35); border: 1px solid #2a2f3a; font-size: 13px;
}
.casino-barre .jetons b { color: var(--gold); font-size: 15px; }
.casino-barre .cb-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.casino-barre .cb-actions input { width: 120px; }
.casino-resultat {
  margin: 8px 0; padding: 8px 12px; border-radius: 8px; font-weight: 600;
  background: rgba(255, 255, 255, .05); border: 1px solid #2a2f3a;
}
.casino-hall { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-top: 10px; }
.jeu-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 14px; cursor: pointer;
  background: linear-gradient(160deg, #1b2030, #0f1320); border: 1px solid #2a2f3a; border-radius: 14px; color: var(--txt);
  text-align: center; transition: transform .15s, border-color .15s;
}
.jeu-card:hover { transform: translateY(-3px); border-color: var(--gold); }
.jeu-card .jc-emoji { font-size: 44px; line-height: 1; }
.jeu-card b { font-size: 16px; }
.jeu-card small { color: var(--muted); font-size: 12px; }
button.go { background: var(--gold); color: #000; font-weight: 700; }
button.go:disabled { opacity: .45; }

/* jetons */
.jeton-choix { display: flex; align-items: center; gap: 6px; margin: 6px 0; flex-wrap: wrap; }
.jeton-choix .jeton {
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer; font-weight: 800; font-size: 11px; color: #fff;
  border: 4px dashed rgba(255,255,255,.75); box-shadow: 0 2px 4px rgba(0,0,0,.5); opacity: .7;
}
.jeton-choix .jeton.actif { opacity: 1; transform: scale(1.12); box-shadow: 0 0 0 2px var(--gold), 0 2px 6px rgba(0,0,0,.6); }
.jeton.j10 { background: #6b7280; } .jeton.j50 { background: #dc2626; } .jeton.j100 { background: #2563eb; }
.jeton.j500 { background: #7c3aed; } .jeton.j1000 { background: #111827; } .jeton.j5000 { background: #b45309; }
.jeton.j10000 { background: #0e7490; } .jeton.j25000 { background: #15803d; } .jeton.j50000 { background: #be185d; }
.jeton.j100000 { background: #4338ca; } .jeton.j500000 { background: #7f1d1d; border-color: #fbbf24; } .jeton.j1000000 { background: #000; border-color: #fbbf24; color: #fbbf24; }
.jeton-pose {
  position: absolute; right: -4px; top: -6px; min-width: 22px; height: 22px; line-height: 16px; padding: 0 4px; box-sizing: border-box;
  border-radius: 50%; background: #fbbf24; color: #000; font-size: 10px; font-weight: 800;
  border: 3px dashed rgba(0,0,0,.35); box-shadow: 0 2px 3px rgba(0,0,0,.5); pointer-events: none;
}

/* --- roulette --- */
.salle-roulette { display: grid; grid-template-columns: minmax(260px, 380px) 1fr; gap: 18px; align-items: start; }
@media (max-width: 800px) { .salle-roulette { grid-template-columns: 1fr; } }
.roue-zone { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.roue-svg { width: 100%; max-width: 380px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.6)); }
.roue-hist { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; min-height: 22px; }
.roue-hist .rh { width: 22px; height: 22px; border-radius: 50%; font-size: 11px; font-weight: 700; line-height: 22px; text-align: center; color: #fff; }
.rh.rouge { background: #b91c1c; } .rh.noir { background: #111827; border: 1px solid #444; } .rh.vert { background: #0f7a3a; }
.tapis {
  display: grid; grid-template-columns: 34px 1fr 44px; grid-template-rows: auto auto auto; gap: 3px;
  padding: 10px; border-radius: 12px; background: #0f6a3a; border: 6px solid #6b3b13; box-shadow: inset 0 0 30px rgba(0,0,0,.45);
}
.tp-zero { grid-row: 1; grid-column: 1; display: flex; }
.tp-nums { grid-row: 1; grid-column: 2; display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: repeat(3, 1fr); gap: 3px; }
.tp-cols { grid-row: 1; grid-column: 3; display: grid; grid-template-rows: repeat(3, 1fr); gap: 3px; }
.tp-douz { grid-row: 2; grid-column: 2; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.tp-simples { grid-row: 3; grid-column: 2; display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; }
.tp-num, .tp-ext {
  position: relative; min-height: 34px; border: 1px solid rgba(255,255,255,.6); border-radius: 4px; color: #fff;
  font-weight: 700; font-size: 13px; cursor: pointer; padding: 0; background: transparent;
}
.tp-num.rouge { background: #b91c1c; } .tp-num.noir { background: #111827; } .tp-num.vert { background: #0f7a3a; }
.tp-z { flex: 1; writing-mode: vertical-rl; }
.tp-ext { background: rgba(0,0,0,.15); font-size: 12px; }
.tp-ext.rouge { background: #b91c1c; } .tp-ext.noir { background: #111827; }
.tp-num:hover, .tp-ext:hover { outline: 2px solid #fbbf24; z-index: 1; }

/* --- blackjack --- */
.feutre {
  padding: 18px 16px; border-radius: 120px 120px 16px 16px; min-height: 300px;
  background: radial-gradient(ellipse at 50% 0%, #1f8a4c, #0f5a30 70%, #0a3f22); border: 8px solid #5b3a1a;
  box-shadow: inset 0 0 40px rgba(0,0,0,.45), 0 8px 20px rgba(0,0,0,.5);
}
.feutre-regle { text-align: center; color: rgba(255,255,255,.55); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px; }
.bj-main { margin: 8px 0 16px; }
.bj-titre { color: rgba(255,255,255,.8); font-size: 13px; margin-bottom: 6px; }
.bj-titre b { color: #fff; font-size: 15px; }
.bj-cartes { display: flex; gap: 8px; flex-wrap: wrap; min-height: 100px; }
.bj-mise-pose { text-align: center; color: #fde68a; font-weight: 600; margin-top: 4px; }
.pcard { position: relative; width: 68px; height: 96px; perspective: 600px; }
.pcard .pc-face, .pcard .pc-dos {
  position: absolute; inset: 0; border-radius: 7px; backface-visibility: hidden; transition: transform .6s;
  box-shadow: 0 3px 6px rgba(0,0,0,.45);
}
.pcard .pc-face { background: #fdfdf7; color: #111; transform: rotateY(0deg); }
.pcard .pc-face.rouge { color: #c1121f; }
.pcard .pc-dos {
  transform: rotateY(180deg);
  background: repeating-linear-gradient(45deg, #1e3a8a 0 4px, #1d4ed8 4px 8px);
  border: 4px solid #fdfdf7; box-sizing: border-box;
}
.pcard.cachee .pc-face { transform: rotateY(-180deg); }
.pcard.cachee .pc-dos { transform: rotateY(0deg); }
.pcard.flip .pc-face { animation: retourne-face .7s forwards; }
.pcard.flip .pc-dos { animation: retourne-dos .7s forwards; }
@keyframes retourne-face { from { transform: rotateY(-180deg); } to { transform: rotateY(0deg); } }
@keyframes retourne-dos { from { transform: rotateY(0deg); } to { transform: rotateY(180deg); } }
.pcard.nouvelle { animation: distribue .45s cubic-bezier(.2,.8,.3,1) both; }
@keyframes distribue { from { transform: translate(140px, -120px) rotate(25deg); opacity: 0; } to { transform: none; opacity: 1; } }
.pc-coin { position: absolute; font-weight: 800; font-size: 14px; line-height: 1; display: flex; flex-direction: column; align-items: center; }
.pc-coin small { font-size: 12px; }
.pc-coin.haut { top: 5px; left: 5px; }
.pc-coin.bas { bottom: 5px; right: 5px; transform: rotate(180deg); }
.pc-centre { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; }

/* --- machine à sous --- */
.slot-machine {
  margin: 0 auto; max-width: 420px; padding: 18px; border-radius: 18px;
  background: linear-gradient(180deg, #7f1d1d, #450a0a); border: 6px solid #fbbf24; box-shadow: 0 10px 30px rgba(0,0,0,.6);
}
.slot-fenetre {
  position: relative; display: flex; gap: 10px; justify-content: center; padding: 10px;
  background: #0b0b0b; border-radius: 12px; border: 3px solid #333;
}
.rouleau { width: 96px; height: 84px; overflow: hidden; background: linear-gradient(180deg, #ddd, #fff 30%, #fff 70%, #ddd); border-radius: 8px; }
.rouleau .bande { display: flex; flex-direction: column; will-change: transform; }
.rouleau .bande span { height: 84px; display: flex; align-items: center; justify-content: center; font-size: 48px; line-height: 1; }
.slot-ligne { position: absolute; left: 6px; right: 6px; top: 50%; height: 2px; background: rgba(239,68,68,.75); pointer-events: none; }
.slot-fenetre.gagne { animation: clignote .5s 4; }
@keyframes clignote { 50% { box-shadow: 0 0 0 4px #fbbf24, 0 0 30px #fbbf24; } }
.slot-paie { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; margin-top: 10px; font-size: 12px; color: #fde68a; }
.slot-paie b { color: #fff; }
button.levier { font-size: 15px; padding: 10px 18px; }

/* --- courses --- */
.hippodrome { border-radius: 12px; overflow: hidden; border: 4px solid #5b3a1a; margin-bottom: 8px; }
.tribune { background: #1f2937; color: #e5e7eb; text-align: center; font-size: 12px; letter-spacing: .1em; padding: 4px; text-transform: uppercase; }
.piste { position: relative; background: repeating-linear-gradient(180deg, #7a5a2e 0 44px, #6b4e26 44px 88px); padding: 6px 0; }
.arrivee { position: absolute; top: 0; bottom: 0; right: 36px; width: 8px; background: repeating-linear-gradient(180deg, #fff 0 8px, #000 8px 16px); }
.couloir { display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 8px; }
.dossard { width: 22px; height: 22px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 800; line-height: 22px; text-align: center; flex: 0 0 auto; }
.dossard.petit { display: inline-block; width: 18px; height: 18px; line-height: 18px; font-size: 10px; }
.piste-ligne { position: relative; flex: 1; height: 100%; border-bottom: 1px dashed rgba(255,255,255,.25); }
.cheval { position: absolute; top: 4px; left: 0; width: 36px; margin-left: -18px; font-size: 28px; line-height: 1; transition: none; }
.cheval .cv-emoji { display: inline-block; transform: scaleX(-1); }
.cheval.galop .cv-emoji { animation: galop .28s infinite alternate; }
@keyframes galop { from { transform: scaleX(-1) translateY(0) rotate(-4deg); } to { transform: scaleX(-1) translateY(-4px) rotate(4deg); } }
.cv-rang { width: 30px; text-align: right; color: #fde68a; font-weight: 700; font-size: 13px; }
.courses-table td { vertical-align: middle; }
table.marche tr.gagnant { background: rgba(34, 197, 94, .12); }

/* Traîtres en fuite */
.traitre-row.enfuite { border-color: rgba(239, 68, 68, .45); background: rgba(239, 68, 68, .06); }
.traitre-row.retrouve { border-color: rgba(34, 197, 94, .5); background: rgba(34, 197, 94, .07); }

/* Équipe : détail des ventes d'un employé sous sa ligne */
.emp-ventes {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  margin: -1px 0 6px 26px; padding: 3px 8px; font-size: 12px; color: #9aa4b2;
  border-left: 2px solid #2a2f3a;
}
.emp-ventes .ev-titre { color: #cbd5e1; }
.emp-ventes .ev-item b { color: #e2e8f0; font-weight: 600; }
.emp-ventes .ev-alerte { color: #fca5a5; }
.emp-ventes .ev-note { color: #fcd34d; }

/* Clients : bandeau de stats compact sur chaque carte */
.client-stats {
  display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 4px 0 2px;
  font-size: 12px; color: #9aa4b2;
}
.client-stats .mauvais { color: #ef4444; }
.promo-non { font-size: 12px; font-style: italic; margin: 4px 0 2px; }

/* Planque : drogues et matières premières séparées */
.stash-groupe { margin-bottom: 10px; }
.stash-groupe .sg-titre {
  display: flex; align-items: center; gap: 6px; padding: 3px 2px 4px;
  border-bottom: 1px solid #2a2f3a; margin-bottom: 4px;
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .3px;
}
.stash-groupe .sg-titre .muted { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; }
.stash-groupe .sg-check { width: auto; flex: 0 0 auto; margin: 0; cursor: pointer; }

/* Graphique de patrimoine */
.patri-chart {
  width: 100%; height: 160px; background: rgba(127, 127, 127, .07);
  border: 1px solid #2a2f3a; border-radius: 6px;
}
.trend.hausse, .hausse { color: #22c55e; }
.trend.baisse, .baisse { color: #ef4444; }

/* Banque : bandeau des masses d'argent + sous-onglets */
.argent-resume {
  display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 8px 0; padding: 8px 12px;
  border: 1px solid #2a2f3a; border-radius: 8px; background: rgba(255, 255, 255, .03); font-size: 13px;
}
.sous-onglets { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 14px; }
.sous-onglets .so {
  background: transparent; border: 1px solid #2a2f3a; color: var(--muted);
  padding: 6px 12px; border-radius: 7px; cursor: pointer; font-size: 13px;
}
.sous-onglets .so.actif { background: var(--panel2); color: var(--txt); border-color: var(--accent2, #3b82f6); }
/* deuxième rangée (dans « Comptes & placements ») : plus discrète, soulignée */
.sous-onglets.niveau2 { margin: -6px 0 12px; padding-bottom: 8px; border-bottom: 1px solid #2a2f3a; }
.sous-onglets.niveau2 .so { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.stash-row .mini { margin-left: 8px; }

/* Formations : catalogue à gauche, file planifiée à droite */
.formation-cols { display: flex; gap: 14px; align-items: flex-start; }
.formation-cols .fc-gauche { flex: 1 1 auto; min-width: 0; }
.formation-cols .fc-droite { flex: 0 0 300px; position: sticky; top: 0; }
@media (max-width: 900px) {
  .formation-cols { flex-direction: column; }
  .formation-cols .fc-droite { flex: 1 1 auto; width: 100%; position: static; }
}
.skill-card[draggable=true] { cursor: grab; }
.skill-card[draggable=true]:active { cursor: grabbing; }
.skill-niveaux { margin: 6px 0 4px; }
.skill-niveaux > summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.skill-niveaux ul { margin: 6px 0 0; padding-left: 16px; font-size: 12px; line-height: 1.45; }
.skill-niveaux li { margin-bottom: 5px; }
.skill-niveaux li.acquis { color: var(--accent, #22c55e); }

.file-drop {
  min-height: 130px; padding: 8px; border: 1px dashed #2a2f3a; border-radius: 8px;
  background: rgba(255, 255, 255, .02);
}
.file-drop.survol { border-color: var(--accent2, #3b82f6); background: rgba(59, 130, 246, .10); }
.file-drop .fd-vide { margin: 12px 4px; font-size: 12px; }
.file-item {
  display: flex; align-items: center; gap: 7px; padding: 6px 7px; margin-bottom: 5px;
  border: 1px solid #2a2f3a; border-radius: 6px; background: var(--panel2); font-size: 12px;
  cursor: grab;
}
.file-item.deplace { opacity: .4; }
.file-item > span { min-width: 0; }
.file-item .fi-rang {
  flex: 0 0 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 50%;
  background: #2a2f3a; font-weight: 700;
}
.file-item .fi-nom { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .fi-info { flex: 0 0 auto; white-space: nowrap; }

/* Historique de santé */
.stat.clic { cursor: pointer; }
.stat.stat-droite { margin-left: auto; }
.ag-filtre { cursor: pointer; display: inline-flex; align-items: center; }
.recap-demandes.bloque { border-color: rgba(245, 158, 11, .55); background: rgba(245, 158, 11, .08); }
.maintien-table .mt-sous { color: #fbbf24; }
.ville-card.village { opacity: .85; border-style: dashed; }
.regle-row .lien-regle { flex: 1 1 auto; text-align: left; background: transparent; border: 0; color: var(--txt); cursor: pointer; padding: 2px 4px; font: inherit; line-height: 1.3; }
.regle-row .lien-regle:hover { background: rgba(255,255,255,.05); border-radius: 6px; }
.align-regle { color: #a5b4fc; }
.regle-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; }
.regle-option { text-align: left; background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; color: var(--txt); cursor: pointer; font: inherit; line-height: 1.35; }
.regle-option:hover { border-color: var(--accent2); }
.regle-option.actuelle { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.regle-option.danger { border-color: rgba(239, 68, 68, .5); }
.ag-filtre.off { opacity: .45; text-decoration: line-through; }
.toi-onglets { display: flex; gap: 6px; margin: -4px 0 10px; }
.marche-volume { margin-top: -6px; }
.stat.clic:hover { background: rgba(255, 255, 255, .06); }
.sante-row {
  display: flex; align-items: center; gap: 10px; padding: 4px 8px;
  border-bottom: 1px solid #23272f; font-size: 13px;
}
.sante-row .sr-jour { flex: 0 0 52px; color: #9aa4b2; }
.sante-row .sr-delta { flex: 0 0 44px; text-align: right; font-weight: 700; }
.sante-row.perte .sr-delta { color: #ef4444; }
.sante-row.gain .sr-delta { color: #22c55e; }
.sante-row .sr-cause { flex: 1 1 auto; }
.sante-liste { max-height: 340px; overflow-y: auto; }

/* Nom réel du point de soin : peut être long, on le borne à 2 lignes */
.soin-nom {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.25;
}

/* Fret : convois en cours + formulaire d'envoi */
.fret-row {
  display: flex; align-items: center; gap: 10px; padding: 5px 8px;
  border: 1px solid #2a2f3a; border-radius: 6px; margin-bottom: 4px; font-size: 13px;
}
/* min-width:0 partout : sans ça un élément en nowrap refuse de rétrécir et
   déborde du cadre dès que la cargaison compte plusieurs produits. */
.fret-row > span { min-width: 0; }
.fret-row .fr-trajet {
  flex: 0 1 auto; font-weight: 600; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.fret-row .fr-cargo {
  flex: 1 1 0; color: #9aa4b2; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.fret-row .fr-veh { flex: 0 0 auto; letter-spacing: -2px; }
.fret-row .fr-jours { flex: 0 0 46px; text-align: right; font-weight: 700; }
/* bandeau de résumé : reste lisible même avec beaucoup de convois */
.fret-resume {
  display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 8px 0 4px; padding: 7px 10px;
  border: 1px solid #2a2f3a; border-radius: 6px; background: rgba(255, 255, 255, .03); font-size: 13px;
}
/* convois groupés par destination */
.fret-groupe { margin-bottom: 6px; }
.fret-groupe > summary { cursor: pointer; padding: 4px 6px; border-radius: 5px; font-weight: 600; font-size: 13px; }
.fret-groupe > summary:hover { background: rgba(255, 255, 255, .05); }
.fret-row .fr-prog {
  flex: 0 0 70px; height: 6px; border-radius: 3px; background: #2a2f3a; overflow: hidden;
}
.fret-row .fr-prog .bar { display: block; height: 100%; background: #3b82f6; }
.fret-row .fr-prog .bar.retour { background: #6b7280; }
/* lignes régulières */
.ligne-row {
  display: flex; align-items: center; gap: 6px 10px; padding: 5px 8px; flex-wrap: wrap;
  border: 1px solid #2a2f3a; border-radius: 6px; margin-bottom: 4px; font-size: 13px;
}
.ligne-row.pause { opacity: .55; }
.ligne-row > span { min-width: 0; }
.ligne-row .lg-trajet { flex: 1 1 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne-row .lg-periode { flex: 0 0 auto; color: #9aa4b2; white-space: nowrap; }
.ligne-row .lg-periode input { width: 48px; padding: 1px 4px; font-size: 12px; }
/* répétition d'un convoi en route */
.fret-row .fr-rep { flex: 0 0 84px; display: flex; align-items: center; justify-content: flex-end; gap: 3px; }
.fret-row .fr-rep input { width: 44px; padding: 1px 4px; font-size: 12px; }
.fret-row .fr-rep .mini { padding: 1px 6px; font-size: 12px; }
.ligne-row .lg-cargo { flex: 1 1 130px; color: #9aa4b2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne-row .lg-veh { flex: 0 0 auto; letter-spacing: -2px; }
.ligne-row .lg-next { flex: 0 0 auto; margin-left: auto; text-align: right; font-weight: 600; white-space: nowrap; }
.ligne-row .lg-runs { flex: 0 0 34px; text-align: right; color: #9aa4b2; }
.ligne-row .lg-actions { flex: 0 0 auto; display: flex; gap: 3px; }

.fret-form h5 { margin: 12px 0 4px; font-size: 12px; text-transform: uppercase; color: #9aa4b2; }
.fret-line {
  display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 5px;
}
.fret-line:hover { background: rgba(255, 255, 255, .04); }
.fret-line .fl-nom { flex: 0 0 190px; }
.fret-line .fl-info { flex: 1 1 auto; color: #9aa4b2; }
.fret-line input { flex: 0 0 84px; }
.fret-line .mini { flex: 0 0 auto; padding: 1px 7px; font-size: 11px; }
.fret-recap {
  display: flex; gap: 14px; margin: 10px 0 8px; padding: 6px 10px;
  border: 1px solid #2a2f3a; border-radius: 6px; font-weight: 600; font-size: 13px;
}
.fret-recap .manque { color: #ef4444; }

/* Amas de clients (leaflet.markercluster) : bulle numérotée qui éclate au zoom */
.client-cluster { background: none; border: 0; }
.client-cluster .cc-bubble {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; box-sizing: border-box;
  background: rgba(59, 130, 246, .9); border: 2px solid rgba(255, 255, 255, .85);
  color: #fff; font-weight: 700; font-size: 13px; line-height: 1;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .45);
}
.client-cluster.has-order .cc-bubble {
  background: rgba(34, 197, 94, .95);            /* vert : une commande servable dans l'amas */
  border-color: #eaffef;
  animation: clientPulse 1.6s ease-in-out infinite;
}

/* Adresse client cliquable (recentre la carte) */
.adresse-link {
  display: inline-block; margin: 0; padding: 0; border: 0; background: none;
  color: var(--accent, #ffc107); font: inherit; font-size: 12px; text-align: left;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.adresse-link:hover { filter: brightness(1.2); }
.poste-icon { font-size: 13px; opacity: .85; }
#map.pose-maison { cursor: crosshair; }
.chk { flex-direction: row !important; align-items: center; gap: 6px; color: var(--txt); }

/* Modal */
#modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); display: none;
  align-items: center; justify-content: center; z-index: 9999; padding: 20px;
}
.modal-box {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 22px; width: min(1180px, 100%); max-height: 90vh; overflow-y: auto; overflow-x: hidden; position: relative;
}
/* les cartes en grille doivent pouvoir rétrécir sous la largeur de leur contenu */
.shop-card { min-width: 0; }
.shop-card input, .ligne input { min-width: 0; }
.modal-close { position: absolute; top: 10px; right: 12px; background: none; border: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.modal-box h3 { margin: 0 0 8px; }
.modal-box h4 { margin: 18px 0 8px; color: var(--muted); }

.tiers { display: flex; gap: 8px; margin: 12px 0; flex-wrap: wrap; }
.tier { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); padding: 10px 14px; border-radius: 8px; cursor: pointer; text-align: center; font-size: 13px; }
.tier:hover { border-color: var(--accent2); }
.tier.max { background: var(--accent); color: #04210f; font-weight: 700; border-color: var(--accent); }
.tier.ghost { background: transparent; color: var(--muted); }
#apercu { font-size: 14px; margin-top: 4px; }

/* Planque */
.maison-bloc { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 4px 0 12px; font-size: 14px; }
.maison-bloc button { background: var(--accent2); border: none; color: #fff; padding: 6px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.maison-bloc button.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
.stash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stash-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.stash-row span { flex: 1; }
.stash-row button { background: var(--accent2); border: none; color: #fff; padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; }
@media (max-width: 620px) { .stash-cols { grid-template-columns: 1fr; } }
#valider, #ok, #cfg-save, #rejouer, #fuir { background: var(--accent); border: none; color: #04210f; font-weight: 700; padding: 9px 14px; border-radius: 8px; cursor: pointer; }
#stop { cursor: pointer; }

/* Grilles */
.villes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 10px; }
.ville-card { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); border-radius: 8px; padding: 10px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.ville-card:hover { border-color: var(--accent2); }
.ville-card small { color: var(--muted); }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.shop-card { background: var(--panel2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.shop-card.actif { border-color: var(--accent); }
.shop-emoji { font-size: 30px; }
.shop-card ul { padding-left: 16px; margin: 6px 0; font-size: 12px; color: var(--muted); }
.shop-card button { background: var(--accent2); border: none; color: #fff; padding: 7px 10px; border-radius: 7px; cursor: pointer; margin-top: 6px; width: 100%; }
.shop-card button:disabled { opacity: .4; cursor: not-allowed; }

.config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.config-grid label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 4px; }
.config-grid input { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); padding: 7px; border-radius: 6px; }

/* Économie */
.eco-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.eco-tab { background: var(--panel2); border: 1px solid var(--line); color: var(--txt); padding: 5px 10px; border-radius: 999px; cursor: pointer; font-size: 12px; }
.eco-tab:hover { border-color: var(--accent2); }
.eco-tab.actif { background: var(--accent2); border-color: var(--accent2); color: #fff; }

/* Clients / réseau */
.client-card .client-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fiab { font-size: 11px; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.fiab.bon { background: rgba(34,197,94,.2); color: #22c55e; }
.fiab.moyen { background: rgba(245,197,24,.2); color: var(--gold); }
.fiab.mauvais { background: rgba(239,68,68,.2); color: #ef4444; }
.fiab.neutre { background: var(--panel); color: var(--muted); }
.client-card.actif { border-color: var(--accent2); }
.cmd { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cmd button { background: var(--accent); border: none; color: #04210f; font-weight: 700; padding: 5px 9px; border-radius: 6px; cursor: pointer; }
.cmd button:disabled { background: var(--panel); color: var(--muted); cursor: not-allowed; }
.promo-btn { margin-top: 8px; width: 100%; background: var(--gold); border: none; color: #000; font-weight: 700; padding: 7px; border-radius: 7px; cursor: pointer; }
.client-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.client-actions .mini { flex: 1; background: var(--panel); border: 1px solid var(--line); color: var(--txt); padding: 5px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.client-actions .mini:hover { border-color: var(--accent2); }
.client-actions .mini.danger { border-color: rgba(239,68,68,.5); color: #ff9a9a; }

/* Soins */
.care-pin { font-size: 18px; cursor: pointer; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
.care-pin.owned { filter: drop-shadow(0 0 4px var(--gold)); }
.soigner-btn { background: var(--accent) !important; color: #04210f !important; font-weight: 700; }
.soin-alerte { border-radius: 8px; padding: 8px 12px; margin: 4px 0 12px; font-size: 14px; border: 1px solid var(--line); }
.soin-alerte.grave { background: rgba(239,68,68,.12); border-color: rgba(239,68,68,.4); }
.soin-alerte.critique { background: rgba(239,68,68,.25); border-color: var(--danger); }

/* Chaleur */
.heatbar-cell { display: flex; align-items: center; gap: 8px; }
.heatbar { flex: 1; height: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; min-width: 90px; }
.heatbar span { display: block; height: 100%; border-radius: 999px; }
.corrupt-icon { font-size: 15px; }
table.marche button[data-corrompre] { background: var(--gold); color: #000; font-weight: 700; }
table.eco td.spark { width: 210px; padding: 4px 6px; }
table.eco td.spark svg { display: block; width: 200px; height: 38px; }
table.eco .trend.up { color: var(--accent); }
table.eco .trend.down { color: var(--danger); }

@media (max-width: 820px) {
  main { flex-direction: column; }
  #side { width: auto; max-height: 45vh; }
  #map-wrap { min-height: 40vh; }
}

/* --- Panneau de couches sur la carte (🗺️ en haut à droite) --- */
.carte-couches { background: #fff; color: #111; border-radius: 4px; overflow: hidden; }
.carte-couches .cc-toggle {
  display: block; width: 30px; height: 30px; padding: 0; border: 0; background: #fff;
  font-size: 16px; line-height: 30px; text-align: center; cursor: pointer; color: #111;
}
.carte-couches .cc-toggle:hover { background: #f0f0f0; }
.carte-couches .cc-body { display: none; padding: 6px 10px 8px; border-top: 1px solid #ddd; }
.carte-couches.ouvert .cc-body { display: block; }
.carte-couches .cc-body label {
  display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap;
  padding: 3px 0; cursor: pointer; margin: 0;
}
.carte-couches .cc-body input[type="checkbox"] { margin: 0; }

/* --- Appels à l'aide (problèmes personnels d'un vendeur) --- */
.alerte.aide { border-left: 4px solid #38bdf8; }
.aide-card {
  border: 1px solid rgba(56,189,248,.35); background: rgba(56,189,248,.07);
  border-radius: 8px; padding: 8px 10px; margin: 6px 0 10px;
}
.aide-tete { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.aide-emoji { font-size: 22px; flex: 0 0 auto; }
.aide-delai { margin-left: auto; font-size: 12px; white-space: nowrap; }
.aide-texte { margin: 6px 0 8px; font-style: italic; color: #cbd5e1; }
#btn-equipe.attention, .stat.attention { box-shadow: 0 0 0 1px #38bdf8 inset; }

/* --- Ligne de production (Labos) --- */
.labo-type-titre input.prod-sel { margin: 0 4px 0 0; vertical-align: middle; }
.prod-ligne {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px;
  margin: 6px 0 10px; padding: 6px 8px; border: 1px dashed rgba(148,163,184,.35); border-radius: 6px;
}
.prod-ligne .pl-titre { font-weight: 600; }
.prod-ligne label { display: inline-flex; align-items: center; gap: 4px; margin: 0; }
.prod-ligne input[type="number"] { width: 72px; min-width: 72px; flex: 0 0 auto; }
.prod-ligne select { flex: 0 0 auto; }
.prod-ligne .pl-apercu { color: #a5b4fc; }
.prod-ligne .pl-vehs { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.prod-ligne .pl-vehs input[type="number"] { width: 60px; min-width: 60px; }
.ligne-row .lg-cargo input[type="number"] { width: 66px; min-width: 66px; flex: 0 0 auto; }

/* --- Banque : offres, variantes immobilières --- */
.shop-card.offre { border-color: rgba(34,197,94,.45); background: rgba(34,197,94,.06); }
.bien-card .bien-vars { display: flex; flex-direction: column; gap: 3px; margin: 4px 0; }
.bien-var {
  display: grid; grid-template-columns: auto 1fr auto; column-gap: 6px; align-items: center;
  font-size: 12px; padding: 3px 6px; border-radius: 5px; border: 1px solid transparent; cursor: pointer; margin: 0;
}
.bien-var:has(input:checked) { border-color: rgba(59,130,246,.5); background: rgba(59,130,246,.08); }
.bien-var input[type="radio"] { margin: 0; grid-row: span 2; }
.bien-var .bv-nom { font-weight: 600; }
.bien-var .bv-prix { text-align: right; font-weight: 600; }
.bien-var .bv-info { grid-column: 2 / span 2; color: #94a3b8; font-size: 11px; }
.shop-card.offre small { display: block; margin-top: 2px; }

/* --- Bouton « Jour suivant » : toujours visible, par-dessus tout --- */
#btn-temps { position: fixed; top: 12px; right: 12px; z-index: 10001; display: flex; gap: 4px; }
#btn-temps button {
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 7px 10px; font-weight: 600; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.35); white-space: nowrap;
}
#btn-temps button:hover { filter: brightness(1.1); }
#btn-temps[hidden] { display: none; }

/* --- Inventaire : planques par ville --- */
.inv-planque td { vertical-align: middle; }
.fp-chip { display: inline-block; font-size: 11px; padding: 0 5px; border-radius: 8px; margin-left: 3px; background: rgba(148,163,184,.15); white-space: nowrap; }
.fp-chip.in { background: rgba(34,197,94,.15); }
.fp-chip.out { background: rgba(239,68,68,.15); }
.inv-planque .moyen { color: #f59e0b; }

/* --- Biographie des incorruptibles --- */
.alerte.bio { border-left: 4px solid #a78bfa; }
.bio-fiche { padding: 10px 12px; border-radius: 8px; background: rgba(167,139,250,.08); border: 1px solid rgba(167,139,250,.35); }
.bio-fiche p { margin: 4px 0; }
.bio-decision { margin: 10px 0; padding: 10px 12px; border-radius: 8px; background: rgba(251,191,36,.10); border: 1px solid rgba(251,191,36,.45); }
.bio-liste { list-style: none; padding: 0; margin: 0; }
.bio-liste li { padding: 5px 8px; border-left: 2px solid #2a2f3a; margin-bottom: 3px; font-size: 13px; }
.bio-liste li.majeur { border-left-color: #a78bfa; background: rgba(167,139,250,.06); }
.bio-liste li .muted { display: inline-block; min-width: 46px; }
button.mini.attention { box-shadow: 0 0 0 1px #fbbf24 inset; }

.aide-card.faute { border-color: rgba(251,191,36,.45); background: rgba(251,191,36,.06); }
.tag.faute { background: rgba(251,191,36,.2); color: #fde68a; }
.aide-card button.danger { background: #7f1d1d; color: #fff; }

/* ===== Combat (façon JRPG) ===== */
.combat { display: flex; flex-direction: column; gap: 10px; }
.cb-titre { display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 16px; }
.cb-scene {
  border-radius: 12px; padding: 14px; min-height: 240px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px;
  background: linear-gradient(180deg, #1f2937 0%, #0b1020 60%, #111827 100%); border: 2px solid #374151; box-shadow: inset 0 0 40px rgba(0,0,0,.6);
}
.combat.armee .cb-scene, .combat.forces .cb-scene { background: linear-gradient(180deg, #2a1a1a 0%, #100808 60%, #1a0f0f 100%); border-color: #7f1d1d; }
.cb-ennemis { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.cb-unite { width: 110px; text-align: center; padding: 6px 4px; border-radius: 8px; transition: transform .1s, opacity .4s; }
.cb-unite .cb-emoji { font-size: 40px; line-height: 1; }
.cb-unite.ko { opacity: .3; filter: grayscale(1); }
.cb-unite.ko .cb-emoji { transform: rotate(90deg); display: inline-block; }
.cb-unite.etourdi .cb-emoji::after { content: " 💫"; font-size: 18px; }
.cb-unite.touche { animation: secousse .4s; }
.cb-unite.esquive { animation: esquive .4s; }
@keyframes secousse { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes esquive { 50% { transform: translateX(14px); opacity: .6; } }
.cb-nom { font-size: 12px; margin: 4px 0 3px; }
.cb-barre { position: relative; height: 12px; background: #1f2937; border-radius: 6px; overflow: hidden; border: 1px solid #374151; }
.cb-barre-in { height: 100%; background: #22c55e; transition: width .35s; }
.cb-barre-in.moyen { background: #f59e0b; } .cb-barre-in.bas { background: #ef4444; }
.cb-barre span { position: absolute; inset: 0; font-size: 9px; line-height: 12px; text-align: center; color: #fff; text-shadow: 0 0 2px #000; }
.cb-barre.joueur { height: 16px; }
.cb-barre.joueur span { font-size: 11px; line-height: 16px; }
.cb-joueur { width: 220px; margin: 0 auto; text-align: center; padding: 6px; border-radius: 8px; }
.cb-joueur .cb-emoji { font-size: 40px; line-height: 1; }
.cb-joueur.touche { animation: flash-rouge .5s; }
.cb-joueur.soigne { animation: flash-vert .5s; }
@keyframes flash-rouge { 30% { background: rgba(239,68,68,.35); transform: translateX(-5px); } 60% { transform: translateX(5px); } }
@keyframes flash-vert { 30% { background: rgba(34,197,94,.35); } }
.cb-log { height: 120px; overflow-y: auto; background: rgba(0,0,0,.35); border: 1px solid #2a2f3a; border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.cb-ligne { padding: 2px 0; opacity: .8; }
.cb-ligne.nouvelle { animation: apparait .3s; opacity: 1; }
@keyframes apparait { from { opacity: 0; transform: translateY(4px); } }
.cb-ligne.intro { color: #cbd5e1; font-style: italic; }
.cb-ligne.coup { color: #fca5a5; }
.cb-ligne.touche, .cb-ligne.ko { color: #86efac; }
.cb-ligne.ko, .cb-ligne.victoire { font-weight: 700; }
.cb-ligne.victoire { color: #fde68a; }
.cb-ligne.mort { color: #ef4444; font-weight: 700; }
.cb-ligne.soin { color: #6ee7b7; }
.cb-ligne.fuite, .cb-ligne.soudoye { color: #93c5fd; font-weight: 600; }
.cb-actions { display: flex; flex-direction: column; gap: 6px; }
.cb-groupe { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cb-lib { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); width: 64px; }
.cb-act { display: inline-flex; flex-direction: column; align-items: center; gap: 1px; min-width: 110px; padding: 7px 10px; }
.cb-act small { font-size: 10px; color: inherit; opacity: .75; }
.cb-act:disabled { opacity: .45; }
.cb-fin { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 8px; background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.4); }
.cb-actions[hidden] { display: none; }

/* combat : ton camp (hommes de main + toi) */
.cb-camp { display: flex; gap: 10px; justify-content: center; align-items: flex-end; flex-wrap: wrap; }
.cb-unite.allie { width: 96px; }
.cb-unite.allie .cb-emoji { font-size: 32px; }

/* panier d'un client */
.cmd-lignes { display: flex; flex-direction: column; gap: 2px; margin: 3px 0 4px; }
.cmd-ligne { font-size: 12px; }
.cmd-ligne.ko { color: #fca5a5; }
.cmd-ligne.ok { color: #d1fae5; }

.garde-row { flex-wrap: wrap; }
.garde-equip { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.garde-equip select { max-width: 260px; font-size: 12px; }

/* labos : retirer / lignes part du stock */
.lt-retirer { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; }
.lt-retirer input[type="number"] { width: 62px; min-width: 62px; }
.fret-part-choix { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.fret-part-choix label.tag { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.fret-part-choix input { margin: 0; }

/* --- Aide / FAQ --- */
.aide-liste { display: flex; flex-direction: column; gap: 6px; }
.aide-sec { border: 1px solid #2a2f3a; border-radius: 8px; background: rgba(255,255,255,.02); }
.aide-sec summary { padding: 8px 12px; cursor: pointer; font-weight: 600; list-style: none; }
.aide-sec summary::before { content: "▸ "; color: var(--muted); }
.aide-sec[open] summary::before { content: "▾ "; }
.aide-corps { padding: 0 14px 10px; font-size: 13px; line-height: 1.5; }
.aide-corps p { margin: 6px 0; }
.aide-corps ul, .aide-corps ol { margin: 6px 0; padding-left: 20px; }
.aide-corps li { margin: 3px 0; }

/* champs numériques des panneaux : jamais écrasés par les flèches du navigateur */
#modal input[type="number"] { min-width: 56px; padding-right: 2px; }

/* portraits (DiceBear) */
img.avatar { border-radius: 50%; vertical-align: middle; background: #1f2937; flex: 0 0 auto; }
.avatar-emoji { vertical-align: middle; }
.lr-nom img.avatar { margin-right: 2px; }

.lg-veh-edit { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 8px; margin-top: 4px; border-radius: 6px; background: rgba(255,255,255,.04); font-size: 12px; }
.lg-veh-edit .tag { display: inline-flex; align-items: center; gap: 4px; }
.lg-veh-edit small { flex-basis: 100%; }

/* --- filleuls --- */
.filleul-card { border: 1px solid rgba(167,139,250,.35); background: rgba(167,139,250,.06); border-radius: 6px; padding: 3px 8px; margin: 3px 0; font-size: 12px; }
.filleul-card.attente { border-color: rgba(251,191,36,.5); }
.filleul-tete { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 30px; }
.filleul-tete > b { font-size: 13px; }
.filleul-actions { display: inline-flex; gap: 4px; align-items: center; margin-left: auto; }
.lien-barre { display: inline-block; height: 6px; width: 90px; background: #1f2937; border-radius: 3px; overflow: hidden; vertical-align: middle; }
.lien-in { display: block; height: 100%; }
.lien-in.bon { background: #22c55e; } .lien-in.moyen { background: #f59e0b; } .lien-in.mauvais { background: #ef4444; }
.filleul-question { margin-top: 8px; padding: 8px 10px; border-radius: 6px; background: rgba(251,191,36,.10); border: 1px solid rgba(251,191,36,.4); }
.filleul-liste { margin-top: 8px; }
.filleul-compte { flex-wrap: wrap; }

.stat .stat-date { display: block; font-size: 10px; color: var(--muted); font-weight: 400; margin-top: -2px; }
.filleul-perso { display: inline-flex; gap: 4px; flex-wrap: wrap; align-items: center; font-size: 11px; }
.tag.trait { background: rgba(167,139,250,.18); }
.tag.trait.bas { background: rgba(148,163,184,.15); color: #94a3b8; }
.tag.bon { background: rgba(34,197,94,.18); color: #86efac; }

.filleul-question { margin-top: 4px; padding: 5px 8px; }
.filleul-question b { font-size: 12px; }

/* --- agenda --- */
.ag-jour { margin: 8px 0 10px; }
.ag-date { font-size: 13px; margin-bottom: 4px; padding-bottom: 2px; border-bottom: 1px solid #2a2f3a; }
.ag-ev { display: flex; align-items: center; gap: 8px; padding: 4px 8px; margin: 3px 0; border-radius: 6px; background: rgba(255,255,255,.03); border: 1px solid #2a2f3a; font-size: 13px; flex-wrap: wrap; }
.ag-ev.national { border-color: rgba(251,191,36,.35); }
.ag-emoji { font-size: 18px; flex: 0 0 auto; }
.ag-titre { flex: 1; min-width: 200px; }
.ag-actions { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-left: auto; }

/* Équipe : récap des demandes en attente, en haut */
.recap-demandes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; margin: 6px 0 10px; border: 1px solid rgba(251,191,36,.45); background: rgba(251,191,36,.07); border-radius: 8px; }
.recap-demandes.vide { border-color: rgba(255,255,255,.08); background: transparent; padding: 4px 0; }
.recap-chip { display: inline-flex; gap: 4px; align-items: center; }
.recap-chip small { opacity: .7; }
.recap-chip.aide { border-color: rgba(248,113,113,.5); }
.recap-chip.filleul { border-color: rgba(96,165,250,.5); }
.aide-card.flash, .filleul-card.flash { outline: 2px solid var(--gold); outline-offset: 2px; transition: outline-color 1.2s; }

/* Labos : outils de vue, résumé de ville, type à sec */
.labo-outils { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: 12px; font-weight: normal; }
.labo-outils .mini.actif { box-shadow: 0 0 0 1px var(--gold) inset; color: var(--gold); }
summary.labo-ville-titre { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 6px; border-radius: 6px; background: rgba(255,255,255,.03); }
summary.labo-ville-titre .lv-sortie { font-size: 12px; color: #cbd5e1; }
summary.labo-ville-titre .lv-types { margin-left: auto; font-size: 11px; }
.labo-type.alerte > summary.labo-type-titre { color: #fca5a5; }

.aide-card.q-inline { border-color: rgba(96,165,250,.45); }
.aide-card.q-inline .aide-texte { font-style: normal; }

/* Clients : une ligne par client */
.client-row { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; padding: 3px 8px; font-size: 12px; }
.client-row.actif { border-color: var(--accent2); }
.client-row .cl-nom { flex: 0 1 130px; min-width: 70px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-row .cl-fiab { flex: 0 0 auto; display: inline-flex; gap: 4px; }
.client-row .cl-fiab .fiab { padding: 0 5px; }
.client-row .cl-profil { flex: 1 1 120px; min-width: 60px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-row .cl-stats { flex: 0 0 auto; white-space: nowrap; display: inline-flex; gap: 6px; }
.client-row .cl-stats .mauvais { color: #ef4444; }
.client-row .cl-panier { flex: 2 1 200px; min-width: 90px; display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-row .cl-panier .cmd-ligne { white-space: nowrap; }
.client-row .cl-total { white-space: nowrap; }
.client-row .cl-flair { cursor: help; }
.client-row .cl-actions { flex: 0 0 auto; margin-left: auto; display: inline-flex; gap: 4px; }
.client-row .cl-actions .mini { padding: 1px 6px; font-size: 12px; margin: 0; width: auto; }
.client-row .cl-actions .mini.danger { border-color: rgba(239,68,68,.5); color: #ff9a9a; }
.client-row .cl-actions .promo-btn { margin: 0; width: auto; padding: 1px 6px; }
.client-row .cl-actions .cl-vendre { background: var(--accent); border: none; color: #04210f; font-weight: 700; padding: 2px 8px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.client-row .cl-actions .cl-vendre:disabled { background: var(--panel); color: var(--muted); cursor: not-allowed; }

.ag-tous { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px 8px; margin: 6px 0; border: 1px dashed rgba(251,191,36,.45); border-radius: 8px; font-size: 13px; }

.ligne-row .lg-manque { flex: 0 0 auto; padding: 0 6px; white-space: nowrap; font-size: 11px; }

/* Famille */
.famille-card { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 8px 0; background: var(--panel2); }
.famille-card.flash { outline: 2px solid var(--gold); outline-offset: 2px; }
.fam-tete { display: flex; align-items: center; gap: 10px; }
.fam-id { flex: 1 1 auto; min-width: 0; font-size: 13px; }
.fam-actions { display: inline-flex; gap: 4px; }
.fam-besoin { margin: 8px 0; padding: 8px 10px; border: 1px solid rgba(251,191,36,.45); background: rgba(251,191,36,.07); border-radius: 8px; font-size: 13px; }
.fam-besoin label { font-size: 12px; }
.fam-besoin select { max-width: 320px; }
.fam-biens, .fam-autres { font-size: 12px; margin: 6px 0; }
.fam-liste { margin-top: 6px; }

/* Personnel des établissements (Banque) */
.etab-postes { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; margin: -2px 0 8px 10px; color: var(--muted); }
.etab-postes .poste.plein { color: #a7f3d0; }
.etab-postes .poste .mini { padding: 0 4px; font-size: 10px; margin-left: 2px; }
.placer-choix { font-size: 12px; display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.placer-choix select { max-width: 280px; }

.lg-prod-edit { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 8px; margin-top: 4px; border-radius: 6px; background: rgba(255,255,255,.04); font-size: 12px; }
.lg-prod-edit .tag { display: inline-flex; align-items: center; gap: 4px; background: var(--panel); color: var(--txt); font-size: 12px; }
.lg-prod-edit input[type=number] { padding: 1px 4px; font-size: 12px; }

.labo-bilan { margin: 6px 0 10px; }
.labo-bilan table { margin-top: 6px; font-size: 12px; }

.lg-prod-edit.colonne { flex-direction: column; align-items: flex-start; }
.lp-table { border-collapse: collapse; width: auto; min-width: 520px; font-size: 12px; }
.lp-table th, .lp-table td { padding: 2px 8px; border-bottom: 1px solid rgba(255,255,255,.06); text-align: left; white-space: nowrap; }
.lp-table th.num, .lp-table td.num { text-align: right; }
.lp-table td input[type=number] { width: 90px; padding: 1px 4px; font-size: 12px; text-align: right; }
.lp-table tr.charge td { color: #d1fae5; }

.fb-apercu { margin: 4px 0 10px 18px; font-size: 12px; }
.fb-liste { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.fb-liste .tag { background: var(--panel); color: var(--txt); font-size: 12px; display: inline-flex; align-items: center; gap: 4px; }

.ligne-row .lg-cargo { flex-basis: 220px; }
.ligne-row .lg-cargo input[type=number] { width: 48px; padding: 1px 3px; font-size: 12px; }

.stat .stat-nom { font-size: 12px; white-space: nowrap; }

.aa-liste { display: inline-flex; gap: 4px; flex-wrap: wrap; margin-left: 4px; }
.aa-liste .tag { background: var(--panel); color: var(--txt); font-size: 11px; display: inline-flex; align-items: center; gap: 3px; }

.placer-logement { flex-basis: 100%; font-size: 12px; }
.logements { font-size: 12px; margin: 4px 0 6px; }
.logements tr.ok td { color: #d1fae5; }
.logements tr.cher td { color: #fca5a5; }
.logements td input[type=radio] { width: auto; }

/* Comptes : une ligne d'infos, puis une ligne graphique de la même hauteur */
.marche.comptes tr.compte-graph-row td { padding: 0 8px 4px; border-bottom: 1px solid rgba(255,255,255,.08); }
.marche.comptes tbody tr:not(.compte-graph-row) td { border-bottom: 0; padding-bottom: 2px; }
.compte-graph { display: block; width: 100%; height: 26px; }
.compte-graph-txt { display: block; line-height: 1; margin-top: 1px; }

/* Tournées déléguées (Équipe) : sélecteurs compacts, colonne « hier » lisible */
.tr-table { table-layout: auto; }
.tr-table td { vertical-align: middle; }
.tr-table select { max-width: 150px; }
.tr-table td:nth-child(4) { min-width: 170px; }
.tr-table td.num { white-space: normal; max-width: 130px; text-align: left; }
.tr-table td:last-child { white-space: nowrap; }
.tr-table .nowrap { white-space: nowrap; }

/* Filières (Fournisseur) */
.fil-row { align-items: center; flex-wrap: wrap; }
.fil-row .lr-nom { flex: 1 1 320px; white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.35; }
.fil-row .lr-nom small { display: inline; }
.fil-row .fil-cmd { white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.fil-row.pause { opacity: .6; }

/* bulle « clients connus » d'une autre ville (un seul pion par ville) */
.client-cluster.ville-clients .cc-bubble { background: rgba(30, 41, 59, .85); border: 1px solid rgba(255,255,255,.35); font-size: 11px; padding: 0 6px; white-space: nowrap; border-radius: 14px; }

/* Alignement */
#stat-align b { font-size: 12px; }
.align-trait { display: grid; grid-template-columns: 110px 1fr 36px; align-items: center; gap: 8px; margin: 5px 0; }
.align-trait.dominant .align-g { font-weight: 700; }
.align-g { text-align: right; font-size: 12px; } .align-val { text-align: right; }
.align-jauge { position: relative; height: 10px; border-radius: 5px; background: #1e293b; overflow: hidden; }
.align-jauge span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }
.align-jauge i { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.25); }
.align-effets li { margin: 4px 0; }
.sevir-ligne { border-top: 1px dashed rgba(255,255,255,.12); padding-top: 6px; }

/* Services de la maison */
.services-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.service-card small { display: block; margin: 2px 0; }
.service-card.actif { border-color: #22c55e; }
.service-ligne button { font-weight: 600; }

/* Comptes des filleuls : graphique + projection sous chaque ligne */
.filleul-compte-graph { padding: 0 8px 6px; border-bottom: 1px solid rgba(255,255,255,.08); }
.filleul-compte-graph .compte-graph { height: 22px; }
.filleul-compte-graph .fv-proj { display: block; line-height: 1.2; margin-top: 2px; }

.bien-card.jeux { border-color: rgba(245, 158, 11, .45); }

/* Mode Waze (barrage → dévier en direct sur la carte) */
#waze { position: absolute; top: 10px; right: 10px; z-index: 900; width: 300px; max-width: 45%; background: rgba(15, 23, 42, .94); border: 1px solid #22c55e; border-radius: 10px; padding: 8px 10px; font-size: 13px; box-shadow: 0 6px 24px rgba(0,0,0,.5); }
#waze .wz-tete { display: flex; align-items: center; gap: 6px; font-size: 15px; }
#waze .wz-eta { margin-left: auto; font-size: 12px; color: #22c55e; white-space: nowrap; }
#waze .wz-aide { font-size: 12px; color: #cbd5e1; margin: 4px 0 6px; }
#waze .wz-alertes { display: flex; flex-direction: column; gap: 3px; max-height: 190px; overflow: hidden; }
#waze .wz-alerte { font-size: 12px; padding: 3px 6px; border-radius: 6px; background: rgba(255,255,255,.06); }
#waze .wz-alerte.danger { background: rgba(239, 68, 68, .25); color: #fecaca; font-weight: 600; }
#waze .wz-alerte.ok { background: rgba(34, 197, 94, .2); color: #bbf7d0; }
#waze .wz-alerte.bruit { opacity: .7; }
#waze .wz-alerte.info { background: rgba(59, 130, 246, .2); }
#waze .wz-btns { display: flex; gap: 6px; margin-top: 8px; }
.waze-icon { background: none; border: 0; }
.waze-voiture { font-size: 24px; line-height: 30px; text-align: center; filter: drop-shadow(0 0 4px #22c55e); }
.waze-police { font-size: 22px; line-height: 28px; text-align: center; }
.waze-police.poursuite { animation: wz-gyro 0.8s infinite alternate; }
@keyframes wz-gyro { from { filter: drop-shadow(0 0 3px #3b82f6); } to { filter: drop-shadow(0 0 8px #ef4444); } }
.waze-wp { font-size: 22px; line-height: 26px; text-align: center; }
.waze-wazer { font-size: 16px; line-height: 22px; text-align: center; opacity: .85; }
body.waze-actif #side { display: none !important; }
body.waze-actif #journal-bar { display: none !important; }

.auto-chip { padding: 0 6px; opacity: .7; }
.auto-chip:hover { opacity: 1; }
.auto-regles { margin: 6px 0 10px; }
.auto-regles summary { cursor: pointer; }

.syn-pols { display: flex; flex-direction: column; gap: 3px; margin: 4px 0; }
.syn-pol { display: flex; justify-content: space-between; gap: 6px; align-items: center; font-size: 12px; }
.syn-pol select { max-width: 60%; font-size: 12px; }

.service-card .capa { display: block; margin-bottom: 4px; }


/* ============================================================================
   Téléphone (≤ 700 px) : barre et indicateurs qui défilent, trois pages
   (carte / marché / journal) avec une barre d'onglets en bas, boutons de temps
   à portée du pouce, fenêtres plein écran, cibles tactiles de 40 px.
   Sur PC rien ne change : tout est sous ce media query.
   ========================================================================== */
#mobile-bar { display: none; }
.bulle-tactile {
  position: fixed; z-index: 10005; background: #0b0d12; color: var(--txt); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font-size: 13px; line-height: 1.35; white-space: pre-line;
  box-shadow: 0 6px 22px rgba(0,0,0,.6); pointer-events: none;
}
@media (max-width: 700px) {
  body { height: 100dvh; }
  /* barre du haut : marque courte, boutons qui défilent */
  /* indicateurs : une ligne qui défile */
  #hud { flex-wrap: nowrap; overflow-x: auto; gap: 0; padding: 3px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  #hud::-webkit-scrollbar { display: none; }
  .stat { min-width: 0; padding: 2px 9px; flex: 0 0 auto; }
  .stat span { font-size: 9px; }
  .stat b { font-size: 13px; white-space: nowrap; }
  .stat .stat-date, .stat .stat-nom { font-size: 9px; white-space: nowrap; }
  .stat.stat-droite { margin-left: 0; }
  /* corps : une page à la fois, barre d'onglets en bas */
  main { flex-direction: column; padding-bottom: 54px; }
  #journal-bar, #map-wrap, #side { display: none; }
  body[data-mtab="carte"] #map-wrap { display: block; flex: 1; min-height: 0; }
  body[data-mtab="marche"] #side { display: block; width: auto; max-height: none; flex: 1; min-height: 0; border-left: none; padding: 10px; }
  body[data-mtab="journal"] #journal-bar { display: flex; width: auto; flex: 1; min-height: 0; border: none; }
  #journal { max-height: none; font-size: 13px; }
  #jb-resize, #jb-toggle { display: none; }
  #journal-bar.collapsed { width: auto; }
  #journal-bar.collapsed #journal { display: block; }
  #mobile-bar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 54px; z-index: 10001;
    background: var(--panel); border-top: 1px solid var(--line); padding: 5px 232px 5px 5px; gap: 4px;
    padding-bottom: calc(5px + env(safe-area-inset-bottom));
  }
  #mobile-bar button {
    flex: 1 1 0; min-width: 0; background: var(--panel2); color: var(--muted); border: 1px solid var(--line);
    border-radius: 8px; font-size: 10px; padding: 0 2px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  #mobile-bar button.actif { color: var(--txt); border-color: var(--accent2); background: rgba(37, 99, 235, .18); }
  #btn-temps { top: auto; bottom: calc(6px + env(safe-area-inset-bottom)); right: 5px; gap: 3px; }
  #btn-temps button { padding: 0 7px; font-size: 12px; height: 42px; }
  body.waze-actif #mobile-bar { display: none; }
  /* notifications au-dessus de la barre */
  #alertes { bottom: calc(62px + env(safe-area-inset-bottom)); right: 8px; width: calc(100vw - 16px); }
  /* fenêtres plein écran */
  #modal { padding: 0; align-items: stretch; }
  .modal-box { width: 100%; max-width: none; max-height: none; height: 100%; border-radius: 0; border: none; padding: 12px 10px 70px; }
  .modal-close { position: fixed; top: 4px; right: 6px; z-index: 10003; font-size: 22px; background: var(--panel); border: 1px solid var(--line); border-radius: 50%; width: 36px; height: 36px; line-height: 1; }
  .modal-box h3 { padding-right: 44px; font-size: 17px; }
  .shop-grid { grid-template-columns: 1fr; }
  .modal-box table { display: block; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
  .modal-box .ligne { flex-wrap: wrap; }
  /* cibles tactiles */
  button { min-height: 40px; }
  button.mini, .auto-chip { min-height: 32px; }
  #mobile-bar button, #btn-temps button, .modal-close, #jb-toggle { min-height: 0; }
  input[type=number], input[type=text], select { min-height: 40px; font-size: 16px; }
  .modal-box select, .modal-box label, .modal-box input[type=text] { max-width: 100%; }
  #side select, #side input[type=text] { max-width: 100%; }
  .toi-onglets { flex-wrap: wrap; }
}

/* Fret : le trajet en tête — d'où, vers où, qui charge */
.fret-route {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 14px; margin: 8px 0 10px; padding: 10px 12px;
  border: 1px solid var(--accent2, #3b82f6); border-radius: 10px; background: rgba(59, 130, 246, .07);
}
.fret-route .fr-bout { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.fret-route .fr-bout select { font-size: 15px; font-weight: 600; min-width: 190px; padding: 4px 6px; }
.fret-route .fr-auto { font-size: 15px; color: var(--txt); }
.fret-route .fr-fleche { font-size: 22px; line-height: 1; padding-bottom: 6px; color: var(--accent2, #3b82f6); }
.fret-route .fr-qui { flex-basis: 100%; }
.fret-suivi { margin-top: 10px; }
.fret-suivi > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.fret-aide { margin-top: 12px; }
.fret-aide > summary { cursor: pointer; }

/* Équipe : la ligne vers les réponses automatiques, et les explications repliées */
.eq-lien-regles {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 8px 0 4px; padding: 6px 10px;
  border: 1px solid #2a2f3a; border-radius: 8px; background: rgba(255, 255, 255, .03); font-size: 13px;
}
.eq-aide { margin: 2px 0 8px; }
.eq-aide > summary { cursor: pointer; font-size: 12px; }
.eq-aide p { margin: 4px 0; }

/* Agenda : réglages automatiques */
.ag-auto { margin: 6px 0 10px; padding: 6px 10px; border: 1px solid #2a2f3a; border-radius: 8px; background: rgba(255, 255, 255, .03); }
.ag-auto > summary { cursor: pointer; }
.ag-auto-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 6px 16px; margin: 6px 0 8px; }
.ag-auto-grille label { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.ag-auto-grille input[type="number"] { width: 80px; }
.ag-auto-tag { border-color: var(--accent2, #3b82f6); }

/* Carte : la recherche, à droite des boutons de zoom ; le choix du fond */
.leaflet-left .leaflet-control.carte-recherche { clear: none; margin-left: 6px; position: relative; background: #fff; }
.carte-recherche input { width: 230px; max-width: 52vw; padding: 6px 9px; border: 0; border-radius: 4px; font-size: 13px; color: #111; background: #fff; outline: none; }
.carte-recherche ul { position: absolute; top: calc(100% + 2px); left: 0; width: 300px; max-width: 80vw; margin: 0; padding: 4px 0; list-style: none;
  background: #fff; color: #111; border-radius: 4px; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); z-index: 1000; }
.carte-recherche li { padding: 5px 10px; cursor: pointer; font-size: 13px; line-height: 1.25; }
.carte-recherche li small { color: #666; }
.carte-recherche li.actif, .carte-recherche li:hover { background: #e8f0fe; }
.carte-couches .cc-fond { display: flex; flex-direction: column; gap: 3px; font-size: 12px; margin-bottom: 6px; }
.carte-couches .cc-fond select { font-size: 12px; }
.carte-couches .cc-avis { display: block; max-width: 230px; color: #b45309; font-size: 11px; margin-bottom: 6px; }

/* liens dans les fenêtres (À propos, aide…) : lisibles sur fond sombre */
.modal-box a { color: #8ab4f8; }
.modal-box a:visited { color: #c58af9; }
.modal-box a:hover { color: #aecbfa; }
table.apropos td:first-child { white-space: nowrap; }

/* Demande d'un filleul : son profil, et ce que chaque réponse change */
.filleul-profil { margin: 0 0 8px; padding: 6px 8px; border-radius: 6px; background: rgba(255,255,255,.03); border: 1px solid var(--line); font-size: 12px; }
.filleul-profil summary { cursor: pointer; font-weight: 600; }
.filleul-profil .fp-traits { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 4px; }
.filleul-profil .fp-t { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.filleul-profil .fp-t.faible { color: var(--muted); }
.filleul-profil .fp-barre { display: inline-block; width: 46px; height: 5px; background: #1f2937; border-radius: 3px; overflow: hidden; }
.filleul-profil .fp-barre span { display: block; height: 100%; background: #a78bfa; }
.filleul-profil .fp-t.fort .fp-barre span { background: #22c55e; }
.filleul-profil .fp-t.faible .fp-barre span { background: #64748b; }
.filleul-profil .fp-situ { margin: 2px 0 4px; }
.filleul-profil .fp-recents { margin: 2px 0 4px; }
.fp-choix > button { text-align: left; line-height: 1.25; }
.fp-csq { color: var(--muted); font-weight: normal; }
.filleul-profil .fp-recents li { padding: 1px 0; margin: 0; }

/* --- Casino : Jeu de Boudu --- */
.boudu-feutre { min-height: 0; }
.boudu-explic { color: rgba(255,255,255,.85); font-size: 13px; text-align: center; margin: 0 auto 12px; max-width: 560px; }
.boudu-scores, .boudu-aide { text-align: center; margin: 8px 0 0; font-size: 12px; }
.boudu-choix { margin-top: 12px; }
.boudu-plateau { --pas: min(58px, calc((100vw - 90px) / 10)); --tuile: calc(var(--pas) - 6px); position: relative; width: calc(var(--pas) * 10); height: calc(var(--tuile) + 52px); margin: 6px auto 0; user-select: none; touch-action: none; }
.boudu-rail { position: relative; width: 100%; height: var(--tuile); }
.boudu-tuile { position: absolute; top: 0; width: var(--tuile); height: var(--tuile); display: flex; align-items: center; justify-content: center;
  background: #f8fafc; color: #0f172a; border-radius: 8px; font: 700 calc(var(--tuile) * .55)/1 system-ui, sans-serif; cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,.4); transition: left .35s ease, background .2s, transform .2s; }
.boudu-tuile.sous-outil { background: #fde68a; transform: translateY(-3px); }
.boudu-tuile.en-place { color: #15803d; }
.boudu-plateau.fini .boudu-tuile { background: #bbf7d0; color: #14532d; }
.boudu-outil { position: absolute; top: calc(var(--tuile) + 6px); width: calc(var(--pas) * 4 - 6px); height: 40px; cursor: grab; transition: left .18s ease; }
.boudu-outil:active { cursor: grabbing; }
.boudu-outil .bo-grande, .boudu-outil .bo-petite { position: absolute; border: 6px solid #111; border-top: 0; background: rgba(255,255,255,.08); }
.boudu-outil .bo-grande { left: calc(var(--tuile) / 2 - 3px); width: calc(var(--pas) * 3 + 6px); top: 0; height: 36px; border-color: #fbbf24; }
.boudu-outil .bo-petite { left: calc(var(--pas) + var(--tuile) / 2 - 3px); width: calc(var(--pas) + 6px); top: 0; height: 18px; border-color: #fbbf24; }
.boudu-outil:hover .bo-grande, .boudu-outil:hover .bo-petite { border-color: #fde047; }
.boudu-plateau.fini .boudu-outil { opacity: .35; cursor: default; }

/* --- Casino : pyramide à palets --- */
.palet-feutre { min-height: 0; background: radial-gradient(ellipse at 50% 0%, #1e3a8a, #172554 70%, #0b1638); }
.palet-reglages { gap: 8px; flex-wrap: wrap; align-items: center; justify-content: center; margin-bottom: 8px; }
.palet-reglages select { width: auto; }
.palet-histo { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; min-height: 22px; margin-bottom: 4px; }
.palet-histo span { color: #1c1917; font: 700 11px system-ui, sans-serif; padding: 2px 6px; border-radius: 4px; }
.palet-histo span:first-child { outline: 2px solid #fff; }
.palet-plateau { display: flex; justify-content: center; }
.palet-plateau canvas { display: block; max-width: 100%; }
.palet-msg { text-align: center; font-weight: 700; min-height: 22px; margin-top: 6px; }
.palet-msg.gagne { color: #86efac; } .palet-msg.perd { color: #fca5a5; }
.palet-bilan { text-align: center; font-size: 12px; margin: 4px 0; }
.palet-chances { margin-top: 8px; font-size: 12px; }
.palet-chances summary { cursor: pointer; color: rgba(255,255,255,.8); }
.palet-chances table { margin-top: 6px; }

.palet-courbe { margin-top: 6px; }
.palet-courbe-leg { text-align: center; font-size: 12px; color: rgba(255,255,255,.75); margin-top: 2px; }
.palet-courbe-leg .pc-barre { display: inline-block; width: 10px; height: 10px; background: #f59e0b; border-radius: 2px; vertical-align: middle; }
.palet-courbe-leg .pc-ligne { display: inline-block; width: 16px; height: 0; border-top: 2px solid #fde047; vertical-align: middle; }

/* pyramide : salle compacte (tout doit tenir dans la hauteur de l'écran) */
.salle-palet .palet-feutre { padding: 10px 12px; border-radius: 60px 60px 14px 14px; }
.salle-palet .feutre-regle { margin-bottom: 6px; }
.salle-palet .palet-reglages { margin-bottom: 4px; }
.palet-rangees input[type="range"] { width: 140px; vertical-align: middle; }
.palet-rangees b { display: inline-block; min-width: 2ch; color: #fff; }
.palet-chances > table, .palet-chances .palet-chances-defile { max-height: 180px; overflow-y: auto; display: block; }

/* pyramide : commandes et infos sur le côté quand il y a la place, plateau + courbe à gauche */
.palet-jeu { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "commandes" "plateau" "infos"; gap: 6px; }
.palet-commandes { grid-area: commandes; } .palet-gauche { grid-area: plateau; min-width: 0; } .palet-infos { grid-area: infos; }
.palet-commandes .feutre-regle { text-transform: none; letter-spacing: 0; }
@media (min-width: 900px) {
  .palet-jeu { grid-template-columns: minmax(0, 1fr) 290px; grid-template-areas: "plateau commandes" "plateau infos"; grid-template-rows: auto 1fr; column-gap: 14px; }
  .palet-commandes .palet-reglages { justify-content: flex-start; }
  .palet-commandes .feutre-regle { text-align: left; }
  .palet-histo { justify-content: flex-start; }
  .palet-msg, .palet-bilan { text-align: left; }
  /* la colonne des infos ne dicte pas la hauteur : elle prend celle du plateau, et défile si le tableau est long */
  .palet-infos { contain: size; overflow-y: auto; min-height: 0; }
  .palet-infos .palet-chances > table { max-height: none; }
}

/* --- Waze 3D (borne d'arcade) : plein écran, derrière le volant --- */
#waze3d { position: fixed; inset: 0; z-index: 10050; background: #0b1220; color: #e5e7eb; font-family: system-ui, sans-serif; user-select: none; }
#waze3d canvas#w3-canvas { position: absolute; inset: 0; display: block; }
#waze3d .w3-tete { position: absolute; top: 10px; left: 12px; display: flex; gap: 12px; align-items: center; background: rgba(15,23,42,.8); padding: 6px 12px; border-radius: 10px; font-size: 15px; }
#waze3d #w3-eta { color: #22c55e; font-weight: 700; }
#waze3d #w3-patrouille.danger { color: #f87171; font-weight: 700; }
#waze3d .w3-alertes { position: absolute; top: 10px; right: 12px; width: min(340px, 45vw); display: flex; flex-direction: column; gap: 4px; }
#waze3d .w3-alerte { background: rgba(15,23,42,.85); border-left: 3px solid #64748b; padding: 4px 8px; border-radius: 6px; font-size: 12px; }
#waze3d .w3-alerte.danger { border-color: #ef4444; } #waze3d .w3-alerte.ok { border-color: #22c55e; } #waze3d .w3-alerte.bruit { opacity: .75; }
#waze3d #w3-mini { position: absolute; left: 12px; bottom: 12px; width: 190px; height: 190px; }
#waze3d .w3-choix { position: absolute; left: 50%; top: 56px; transform: translateX(-50%); background: rgba(15,23,42,.85); border: 1px solid #334155; border-radius: 12px; padding: 8px 12px; text-align: center; }
#waze3d .w3-dist { font-size: 13px; margin-bottom: 6px; }
#waze3d .w3-fleches { display: flex; gap: 8px; justify-content: center; }
#waze3d .w3-fleches button { width: 84px; padding: 6px 0; font-size: 26px; line-height: 1; background: #1e293b; color: #fff; border: 2px solid #334155; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; }
#waze3d .w3-fleches button small { font-size: 11px; color: #cbd5e1; }
#waze3d .w3-fleches button.choisi { border-color: #fde047; background: #3f3f1a; }
#waze3d .w3-fleches button:disabled { opacity: .3; cursor: default; }
#waze3d .w3-etat { font-size: 12px; margin-top: 6px; color: #fde68a; }
#waze3d .w3-bas { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 10px; align-items: center; font-size: 12px; background: rgba(15,23,42,.7); padding: 6px 10px; border-radius: 8px; }
#waze3d .w3-centre { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); font-size: 28px; font-weight: 800; background: rgba(15,23,42,.85); padding: 14px 24px; border-radius: 14px; }
#waze3d .w3-centre.ok { color: #86efac; } #waze3d .w3-centre.danger { color: #fca5a5; }
#waze3d .w3-gyro { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .1s; }
@media (max-width: 700px) { #waze3d #w3-mini { width: 120px; height: 120px; bottom: 120px; } #waze3d .w3-fleches button { width: 64px; } #waze3d .w3-bas span { display: none; } }
#waze3d .w3-fleches button small { max-width: 80px; white-space: normal; line-height: 1.1; }
#waze3d .w3-danger { color: #fca5a5; font-weight: 700; }
@media (max-width: 1100px) { #waze3d .w3-alertes { top: 150px; width: min(280px, 40vw); } }
.aa-table th.tri { cursor: pointer; user-select: none; white-space: nowrap; }
.aa-table th.tri:hover { color: var(--gold); }

/* Plus de barre du haut : le logo (clique : la partie) et ⏭️ Jour, ensemble en haut à droite, toujours
   visibles (même par-dessus une fenêtre ouverte) ; les cases du bandeau s'écoulent à leur gauche */
#hud { padding-right: 290px; }
#btn-temps #btn-logo { background: var(--panel); color: var(--txt); border: 1px solid var(--line); font-size: 16px; white-space: nowrap; }
#btn-temps #btn-logo span { color: var(--gold); font-weight: 700; }
#btn-temps #btn-logo:hover { border-color: var(--gold); }
@media (max-width: 700px) { #hud { padding-right: 4px; } #btn-temps #btn-logo b, #btn-temps #btn-logo span { display: none; } }

/* Carte : lignes de fret (arcs fléchés, popup) */
.fret-fleche { background: none; border: 0; }
.fret-fleche span { display: block; width: 16px; height: 16px; line-height: 16px; text-align: center; font-size: 13px; text-shadow: 0 0 2px #fff, 0 0 3px #fff; cursor: pointer; }
.fret-popup { font-size: 13px; min-width: 240px; }
.fret-popup .fp-ligne { border-top: 1px solid #e5e7eb; padding: 6px 0; }
.fret-popup .fp-ligne.pause { opacity: .7; }
.fret-popup .fp-btns { margin-top: 4px; display: flex; gap: 6px; }
.fret-popup small { color: #475569; }
.fret-popup .muted { color: #64748b; }

/* Confirmation du jeu (à la place de confirm() du navigateur) */
#confirmer { position: fixed; inset: 0; z-index: 10200; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
#confirmer .cf-boite { background: var(--panel); color: var(--txt); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; width: min(460px, 100%); box-shadow: 0 12px 40px rgba(0,0,0,.6); }
#confirmer .cf-texte { margin: 0 0 16px; white-space: pre-line; line-height: 1.45; }
#confirmer .cf-btns { display: flex; justify-content: flex-end; gap: 8px; }
#confirmer .cf-btns button { padding: 8px 16px; border-radius: 8px; cursor: pointer; font-size: 14px; }
#confirmer .cf-btns .ghost { background: var(--panel2); color: var(--txt); border: 1px solid var(--line); }
#confirmer .cf-btns .go { background: var(--accent2); color: #fff; border: 1px solid var(--accent2); }
#confirmer .cf-btns .danger { background: var(--danger); color: #fff; border: 1px solid var(--danger); }
