/* Analyseur de sessions de poker — thème sombre, sans dépendance externe */
:root {
  --fond: #0f1216;
  --fond-2: #161b21;
  --fond-3: #1d242c;
  --bord: #2a333d;
  --bord-clair: #3a4551;
  --texte: #e6ebf1;
  --texte-2: #9aa7b4;
  --texte-3: #6c7a89;
  --accent: #5aa9e6;
  --accent-2: #7ad1a8;
  --vert: #4ec98a;
  --rouge: #e2685f;
  --orange: #e0a33e;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.55;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- En-tête / navigation ---------- */
.entete {
  background: var(--fond-2);
  border-bottom: 1px solid var(--bord);
  padding: 14px 20px 0;
}
.entete-inner { max-width: 1180px; margin: 0 auto; }
.marque { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.marque h1 { font-size: 1.16rem; margin: 0; letter-spacing: .2px; font-weight: 600; }
.marque .sous { color: var(--texte-3); font-size: .82rem; }
nav { display: flex; gap: 4px; margin-top: 12px; flex-wrap: wrap; }
nav a {
  padding: 8px 14px;
  border-radius: 8px 8px 0 0;
  color: var(--texte-2);
  font-size: .9rem;
  border: 1px solid transparent;
  border-bottom: none;
}
nav a:hover { background: var(--fond-3); text-decoration: none; color: var(--texte); }
nav a.actif {
  background: var(--fond);
  border-color: var(--bord);
  color: var(--texte);
  font-weight: 600;
}

/* ---------- Structure ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 22px 20px 40px; }
h2 { font-size: 1.12rem; margin: 26px 0 10px; font-weight: 600; }
h3 { font-size: .98rem; margin: 18px 0 8px; font-weight: 600; color: var(--texte); }
p { margin: 8px 0; }
.muted { color: var(--texte-2); }
.petit { font-size: .8rem; }
.mono { font-family: var(--mono); }
.vide { color: var(--texte-3); font-style: italic; }

.carte {
  background: var(--fond-2);
  border: 1px solid var(--bord);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 16px;
}
.carte > h2:first-child, .carte > h3:first-child { margin-top: 0; }

.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grille-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; }
.kpi {
  background: var(--fond-3);
  border: 1px solid var(--bord);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.kpi .lab { color: var(--texte-3); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }
.kpi .val { font-size: 1.34rem; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi .det { color: var(--texte-3); font-size: .74rem; margin-top: 2px; }
.kpi.neg .val { color: var(--rouge); }
.kpi.pos .val { color: var(--vert); }

/* ---------- Tables ---------- */
.tableau-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .87rem; }
th, td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--bord); white-space: nowrap; }
th {
  color: var(--texte-3); font-weight: 600; font-size: .74rem;
  text-transform: uppercase; letter-spacing: .05em;
  position: sticky; top: 0; background: var(--fond-2);
}
th:first-child, td:first-child { text-align: left; }
tbody tr:hover { background: var(--fond-3); }
tfoot td { font-weight: 600; border-top: 2px solid var(--bord-clair); }
td.num, th.num { font-variant-numeric: tabular-nums; }
table.compacte { font-size: .82rem; }
table.compacte th, table.compacte td { padding: 7px 8px; }
table.compacte th { font-size: .7rem; letter-spacing: .03em; }
.neg { color: var(--rouge); }
.pos { color: var(--vert); }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 20px;
  font-size: .72rem; font-weight: 600; border: 1px solid transparent; white-space: nowrap;
}
.badge.vert { background: rgba(78,201,138,.13); color: var(--vert); border-color: rgba(78,201,138,.33); }
.badge.orange { background: rgba(224,163,62,.13); color: var(--orange); border-color: rgba(224,163,62,.33); }
.badge.rouge { background: rgba(226,104,95,.13); color: var(--rouge); border-color: rgba(226,104,95,.33); }
.badge.neutre { background: var(--fond-3); color: var(--texte-2); border-color: var(--bord); }

/* ---------- Formulaires ---------- */
label { display: block; font-size: .8rem; color: var(--texte-2); margin-bottom: 4px; }
input[type=text], input[type=date], input[type=number], select, textarea {
  width: 100%; background: var(--fond); color: var(--texte);
  border: 1px solid var(--bord-clair); border-radius: 8px;
  padding: 8px 10px; font-size: .9rem; font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(90,169,230,.45); border-color: var(--accent); }
textarea { min-height: 220px; font-family: var(--mono); font-size: .8rem; line-height: 1.4; resize: vertical; }
input[type=file] { font-size: .85rem; color: var(--texte-2); }
.champ { margin-bottom: 12px; }
.aide { color: var(--texte-3); font-size: .76rem; margin-top: 3px; }

.bouton {
  display: inline-block; background: var(--accent); color: #06121c;
  border: none; border-radius: 8px; padding: 9px 18px;
  font-size: .9rem; font-weight: 700; cursor: pointer; font-family: inherit;
}
.bouton:hover { background: #74b9ee; }
.bouton.secondaire {
  background: transparent; color: var(--texte); border: 1px solid var(--bord-clair); font-weight: 500;
}
.bouton.secondaire:hover { background: var(--fond-3); }
.boutons { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.filtres { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.filtres .champ { margin-bottom: 0; min-width: 130px; }

/* ---------- Messages ---------- */
.message { border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; border: 1px solid; font-size: .88rem; }
.message.ok { background: rgba(78,201,138,.08); border-color: rgba(78,201,138,.4); }
.message.attention { background: rgba(224,163,62,.08); border-color: rgba(224,163,62,.4); }
.message.erreur { background: rgba(226,104,95,.08); border-color: rgba(226,104,95,.4); }
.message ul { margin: 6px 0 0 18px; padding: 0; }

/* ---------- Graphiques ---------- */
.graph { width: 100%; height: auto; display: block; }
.graph .grille line { stroke: var(--bord); stroke-width: 1; }
.graph .grille line.zero { stroke: var(--bord-clair); stroke-width: 1.5; stroke-dasharray: 4 4; }
.graph .etiq { fill: var(--texte-3); font-size: 12px; }
.graph .etiq.petit { font-size: 10px; }
.graph .etiq.titre-axe { font-size: 11px; }
.graph .val { fill: var(--texte-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.graph .ligne { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.graph .aire { fill: rgba(90,169,230,.11); stroke: none; }
.graph .barre.pos { fill: rgba(78,201,138,.85); }
.graph .barre.neg { fill: rgba(226,104,95,.85); }
.graph .fond-barre { fill: var(--fond-3); }
.graph .remplissage { fill: var(--accent-2); }
.graph .seuil { stroke: var(--orange); stroke-width: 2; stroke-dasharray: 3 3; }

/* ---------- Divers ---------- */
.pile { display: flex; flex-direction: column; gap: 10px; }
.rangee { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.liste-def { margin: 8px 0 0; padding-left: 18px; color: var(--texte-2); font-size: .85rem; }
.liste-def li { margin-bottom: 4px; }
code, kbd {
  font-family: var(--mono); font-size: .84em; background: var(--fond-3);
  padding: 1px 5px; border-radius: 4px; border: 1px solid var(--bord);
}
details { border-top: 1px solid var(--bord); padding: 8px 0; }
details summary { cursor: pointer; color: var(--texte-2); font-size: .84rem; }
details summary:hover { color: var(--texte); }
.formule {
  font-family: var(--mono); font-size: .82rem; background: var(--fond);
  border: 1px solid var(--bord); border-radius: 8px; padding: 10px 12px;
  color: var(--texte-2); overflow-x: auto;
}
.cartes { font-family: var(--mono); letter-spacing: .06em; }
.separateur { height: 1px; background: var(--bord); margin: 18px 0; }
.flex-espace { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }

/* ---------- Pied de page ---------- */
footer {
  border-top: 1px solid var(--bord);
  background: var(--fond-2);
  padding: 18px 20px 26px;
  color: var(--texte-3);
  font-size: .78rem;
}
footer .inner { max-width: 1180px; margin: 0 auto; }
footer strong { color: var(--texte-2); }
footer p { margin: 4px 0; }

/* ---------- Mobile ---------- */
@media (max-width: 820px) {
  .grille-2, .grille-3 { grid-template-columns: 1fr; }
  main { padding: 16px 12px 32px; }
  .entete { padding: 12px 12px 0; }
  nav a { padding: 7px 11px; font-size: .84rem; }
  body { font-size: 14px; }
  .kpi .val { font-size: 1.18rem; }
  th, td { padding: 7px 8px; }
  .kpis { grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); }
}

/* =========================================================================
   Entraînement graphique + page de règles — ajout du 2026-10-25
   Aucune dépendance externe : cartes dessinées en CSS + tracés SVG inline.
   ========================================================================= */

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Cartes dessinées ---------- */
.carte-jeu {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 3px 4px;
  border: none;
  border-radius: 5px;
  background: #f3f7fa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .55);
  font-family: var(--mono);
  font-weight: 700;
  line-height: 1;
  color: #12171d;
  cursor: default;
}
.cj-rouge { color: #c8352b; }
.cj-noir { color: #12171d; }
.carte-jeu .cj-r { font-size: .92em; letter-spacing: -.03em; }
.carte-jeu .cj-pip {
  position: absolute; right: 3px; bottom: 3px;
  width: .78em; height: .78em;
}
.carte-jeu .cj-pip svg { display: block; width: 100%; height: 100%; fill: currentColor; }

.cj-bouton { cursor: pointer; touch-action: manipulation; }
/* Zone de touche élargie à 44 px : le pseudo-élément fait partie du bouton. */
.cj-bouton::after, .carte-fantome::after { content: ""; position: absolute; inset: -4px; border-radius: 9px; }
.cj-bouton:active { transform: scale(.96); }
.cj-bouton:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.carte-fantome {
  background: rgba(255, 255, 255, .04);
  border: 2px dashed rgba(255, 255, 255, .30);
  box-shadow: none;
  color: rgba(255, 255, 255, .55);
  cursor: pointer;
  touch-action: manipulation;
  align-items: center;
  justify-content: center;
}
.carte-fantome .cf-q { font-size: 1.15em; font-weight: 700; opacity: .85; }
.carte-fantome .cf-points { display: none; }
.carte-fantome:hover,
.carte-fantome:focus-visible { border-color: var(--accent); color: var(--accent); background: rgba(90, 169, 230, .10); }
.carte-fantome:active { transform: scale(.96); }

.carte-vide { background: rgba(255, 255, 255, .05); color: rgba(255, 255, 255, .4); }

/* ---------- Page d'entraînement ---------- */
.spot-entete h2 { margin-top: 0; }
.spot-form { display: block; }

.fil {
  display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.fil-etape {
  flex: 1 1 0; min-width: 78px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 6px; border-radius: 10px;
  background: var(--fond-2); border: 1px solid var(--bord);
  font-size: .72rem; color: var(--texte-3);
}
.fil-etape .fil-puce {
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--fond-3); border: 1px solid var(--bord-clair);
  font-size: .68rem; color: var(--texte-2);
}
.fil-etape .fil-nom { font-weight: 600; color: var(--texte-2); }
.fil-etape .fil-act { font-size: .68rem; color: var(--accent-2); text-align: center; line-height: 1.15; }
.fil-etape.passee { border-color: var(--bord-clair); }
.fil-etape.passee .fil-puce { background: rgba(78, 201, 138, .16); border-color: rgba(78, 201, 138, .45); color: var(--vert); }
.fil-etape.courante { border-color: var(--accent); background: rgba(90, 169, 230, .10); }
.fil-etape.courante .fil-puce { background: var(--accent); border-color: var(--accent); color: #06121c; font-weight: 700; }
.fil-etape.courante .fil-nom { color: var(--texte); }

.bloc {
  background: var(--fond-2);
  border: 1px solid var(--bord);
  border-radius: var(--radius);
  padding: 14px 14px 16px;
  margin-bottom: 14px;
}
.bloc-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.bloc-tete h3 { margin: 0; font-size: .95rem; }
.bloc-info { font-size: .74rem; color: var(--texte-3); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- Table de poker ---------- */
.table-poker {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  aspect-ratio: 360 / 300;
}
.table-poker .tapis { position: absolute; inset: 0; width: 100%; height: 100%; }

.siege {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 54px; padding: 3px 7px;
  border-radius: 9px;
  background: rgba(9, 14, 19, .84);
  border: 1px solid rgba(255, 255, 255, .14);
  color: var(--texte); line-height: 1.15;
}
.siege .s-pos { font-size: .7rem; font-weight: 700; letter-spacing: .04em; }
.siege .s-stack { font-size: .58rem; color: var(--texte-3); font-variant-numeric: tabular-nums; }
.siege-heros {
  border-color: var(--accent);
  background: rgba(13, 34, 51, .95);
  box-shadow: 0 0 0 2px rgba(90, 169, 230, .30), 0 6px 16px rgba(0, 0, 0, .45);
}
.siege-heros .s-pos { color: #cfe8fb; }
.siege-vide { opacity: .32; }

.bouton-d {
  position: absolute; transform: translate(-50%, -50%);
  width: 17px; height: 17px; border-radius: 50%;
  background: #f3f7fa; color: #12171d;
  font-size: .58rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .55);
}

.table-centre {
  position: absolute; left: 50%; top: 42%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  width: 100%;
}
.tc-pot, .tc-apayer {
  display: flex; align-items: baseline; gap: 4px;
  font-size: .72rem; color: var(--texte-2);
  background: rgba(0, 0, 0, .30);
  border-radius: 20px; padding: 2px 10px;
}
.tc-pot strong, .tc-apayer strong { font-size: .92rem; color: var(--texte); font-variant-numeric: tabular-nums; }
.tc-apayer.actif { background: rgba(224, 163, 62, .20); color: #f0c987; }
.tc-apayer.actif strong { color: #f7d9a4; }
.tc-lab { text-transform: uppercase; font-size: .62rem; letter-spacing: .07em; color: var(--texte-3); }
.tc-unite { font-size: .62rem; color: var(--texte-3); }
.tc-board { display: flex; gap: 6px; min-height: 52px; align-items: center; }
.tc-attente { font-size: .66rem; color: rgba(255, 255, 255, .38); font-style: italic; }

.carte-table { width: 38px; height: 52px; font-size: 16px; }
.carte-main { width: 40px; height: 56px; font-size: 17px; }
.table-main {
  position: absolute; left: 50%; top: 76%;
  transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
}
.tm-lab { font-size: .58rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255, 255, 255, .45); }
.tm-cartes { display: flex; gap: 4px; }

.table-pied { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.table-pied .bouton-rue { flex: 1 1 auto; min-height: 46px; }
.bouton-mini { min-height: 46px; padding: 8px 14px; font-size: .84rem; }
.bouton[disabled], .bouton-rue[disabled] {
  opacity: .38; cursor: not-allowed; background: var(--fond-3); color: var(--texte-2);
  border: 1px solid var(--bord-clair);
}

/* ---------- Résultat ---------- */
.resultat {
  background: var(--fond-2);
  border: 1px solid var(--bord);
  border-radius: var(--radius);
  padding: 14px 14px 16px;
  margin-bottom: 14px;
}
.resultat-attente, .resultat-calcul { border-style: dashed; }
.att-titre { margin: 0 0 4px; font-weight: 700; font-size: 1rem; }
.att-detail { margin: 0 0 6px; font-size: .86rem; color: var(--texte-2); }
.att-aide { margin: 0; font-size: .8rem; color: var(--texte-3); }
.att-note { margin: 8px 0 0; font-size: .78rem; color: var(--texte-3); }
#att-chrono { font-variant-numeric: tabular-nums; }

.res-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.res-sur { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: var(--texte-3); }
.res-action { display: block; font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; margin-top: 2px; }
.res-droite { text-align: right; }
.res-ev { display: block; font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.res-ev-lab { font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-3); }
.res-phrase { margin: 10px 0 0; font-size: .78rem; color: var(--texte-2); border-left: 2px solid var(--bord-clair); padding-left: 8px; }
.res-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 0; }
.res-kpi { background: var(--fond-3); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.k-lab { font-size: .64rem; text-transform: uppercase; letter-spacing: .05em; color: var(--texte-3); }
.k-val { font-size: .98rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.k-det { font-size: .66rem; color: var(--texte-3); }

.res-termes { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.terme-tete { display: flex; justify-content: space-between; gap: 8px; font-size: .78rem; color: var(--texte-2); }
.terme-tete em { color: var(--texte-3); font-style: normal; font-size: .92em; }
.t-val { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--texte); }
.t-barre { height: 7px; border-radius: 4px; background: var(--fond-3); overflow: hidden; margin-top: 4px; }
.t-barre i { display: block; height: 100%; border-radius: 4px; }
.t-fold { background: var(--orange); }
.t-equite { background: var(--accent-2); }
.terme-somme { margin: 2px 0 0; font-size: .74rem; color: var(--texte-3); }
.res-flips { margin: 10px 0 0; font-size: .78rem; color: #e8c07a; }
.res-flips strong { color: var(--orange); }

.res-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.act {
  min-height: 50px; border-radius: 10px;
  border: 1px solid var(--bord-clair); background: var(--fond-3); color: var(--texte);
  font-family: inherit; font-size: .86rem; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  cursor: pointer; touch-action: manipulation;
}
.act:active { transform: scale(.98); }
.act[disabled] { opacity: .38; }
.act-reco { border-color: var(--accent); background: rgba(90, 169, 230, .16); }
.act-reco-tag { font-size: .58rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 700; }
.act-fold { border-color: rgba(226, 104, 95, .45); color: #f0b3ae; }
.act-fold.act-reco { background: rgba(226, 104, 95, .14); border-color: var(--rouge); }
.res-aide-actions { margin: 8px 0 0; font-size: .72rem; color: var(--texte-3); }
.res-fin { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--bord); }
.res-fin p { margin: 0 0 10px; font-size: .86rem; }

.res-details { margin-top: 14px; }
.res-details summary { padding: 6px 0; }
.res-details h4 { font-size: .82rem; margin: 14px 0 6px; color: var(--texte-2); text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Contrôles ---------- */
.champ { margin-bottom: 14px; }
.etiquette { display: block; font-size: .8rem; color: var(--texte-2); margin-bottom: 6px; }

.choix { display: flex; gap: 6px; flex-wrap: wrap; }
.choix-item { position: relative; margin: 0; display: inline-flex; }
.choix-item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choix-item span {
  display: flex; align-items: center; justify-content: center;
  min-width: 48px; min-height: 44px; padding: 0 12px;
  border: 1px solid var(--bord-clair); border-radius: 10px;
  background: var(--fond); color: var(--texte-2);
  font-size: .88rem; font-weight: 600;
  cursor: pointer; touch-action: manipulation;
}
.choix-item input:checked + span {
  background: var(--accent); border-color: var(--accent); color: #06121c;
}
.choix-item input:focus-visible + span { outline: 2px solid rgba(90, 169, 230, .6); outline-offset: 2px; }
.choix-6 .choix-item span { min-width: 52px; padding: 0 8px; font-size: .82rem; }
.choix-profils .choix-item span { min-width: 84px; }

.choix-preset {
  min-height: 44px; padding: 0 14px;
  border: 1px solid var(--bord-clair); border-radius: 10px;
  background: var(--fond); color: var(--texte-2);
  font-family: inherit; font-size: .84rem; font-weight: 600; cursor: pointer;
  touch-action: manipulation;
}
.choix-preset:active { background: var(--fond-3); }

.grille-num { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.champ-num { min-width: 0; }
.num-ligne { display: flex; gap: 6px; align-items: stretch; }
.num-ligne input {
  flex: 1 1 auto; min-width: 0; text-align: center;
  font-variant-numeric: tabular-nums; font-weight: 600;
  min-height: 44px; padding: 6px 4px;
}
.pas {
  flex: 0 0 44px; width: 44px; min-height: 44px;
  border-radius: 8px; border: 1px solid var(--bord-clair);
  background: var(--fond-3); color: var(--texte);
  font-size: 1.1rem; font-weight: 700; cursor: pointer;
  font-family: inherit; touch-action: manipulation;
}
.pas:active { background: var(--bord); }
.cote-live { color: var(--accent-2); }

input[type=range] {
  width: 100%; height: 44px; accent-color: var(--accent); background: transparent;
}
.bloc-details { margin-top: 4px; }

.barre-actions {
  position: sticky; bottom: 0; z-index: 30;
  display: flex; gap: 8px;
  margin: 0 -12px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--fond) 72%, rgba(15, 18, 22, 0));
}
.barre-actions .bouton {
  min-height: 48px; display: flex; align-items: center; justify-content: center;
  touch-action: manipulation;
}
.barre-retour { flex: 0 0 auto; }
.barre-recalc { flex: 1 1 auto; font-size: .95rem; }

/* ---------- Sélecteur de cartes ---------- */
.selection {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  max-height: 86vh; overflow-y: auto;
  padding: 12px 12px calc(14px + env(safe-area-inset-bottom));
  background: var(--fond-2);
  border-top: 1px solid var(--bord-clair);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -18px 50px rgba(0, 0, 0, .65);
}
.sel-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.sel-titre { margin: 0; font-size: 1rem; font-weight: 700; }
.sel-sous { margin: 2px 0 0; font-size: .78rem; color: var(--texte-2); }
.sel-fermer {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px;
  border: 1px solid var(--bord-clair); background: var(--fond-3); color: var(--texte);
  font-size: 1rem; cursor: pointer; touch-action: manipulation;
}
.grille-52-tete {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  margin: 0 0 4px; text-align: center;
  font-size: .8rem; color: var(--texte-3);
}
.grille-52-tete span:nth-child(2) { color: #e07a72; }
.grille-52-tete span:nth-child(3) { color: #e07a72; }
.grille-52 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.carte-52 {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 44px; padding: 4px 10px;
  border-radius: 8px; border: none;
  background: #f3f7fa; color: #12171d;
  font-family: var(--mono); font-weight: 700; font-size: 15px;
  cursor: pointer; touch-action: manipulation;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}
.carte-52.cj-rouge { color: #c8352b; }
.carte-52:active { transform: scale(.97); }
.carte-52:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.carte-52 svg { width: 15px; height: 15px; fill: currentColor; display: block; }
.carte-52.prise { opacity: .25; }
.sel-menus { margin-top: 12px; }
.sel-menu-ligne { display: flex; gap: 8px; margin-top: 8px; }
.sel-menu-ligne select { flex: 1 1 auto; min-height: 44px; }
.sel-menu-ligne .bouton { min-height: 44px; }

/* ---------- Page de règles ---------- */
.regles { max-width: 820px; margin: 0 auto; }
.regles-tete h2 { margin-top: 0; }
.sommaire { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 18px; }
.sommaire a {
  padding: 8px 12px; min-height: 42px; display: flex; align-items: center;
  border: 1px solid var(--bord); border-radius: 9px;
  font-size: .8rem; color: var(--texte-2); background: var(--fond-2);
}
.sommaire a:hover { background: var(--fond-3); text-decoration: none; color: var(--texte); }

.regle {
  background: var(--fond-2); border: 1px solid var(--bord);
  border-radius: var(--radius); padding: 16px; margin-bottom: 14px;
}
.regle h3 { margin-top: 0; }
.regle h4 { font-size: .9rem; margin: 16px 0 6px; color: var(--texte); }
.regle p { color: var(--texte-2); }
.regle p strong, .regle li strong { color: var(--texte); }

.rues { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.rues li { border-left: 3px solid var(--accent); padding: 2px 0 2px 12px; }
.rue-tete { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.rue-tete strong { font-size: .95rem; }
.rue-tete span { font-size: .74rem; color: var(--texte-3); }
.rues p { margin: 4px 0 0; font-size: .84rem; }
.rue-cartes { margin: 8px 0 0; }

.rangee-cartes { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.rangee-cartes .carte-jeu { width: 27px; height: 38px; font-size: 13px; }

.astuce {
  margin: 12px 0 0; padding: 10px 12px;
  background: rgba(90, 169, 230, .07);
  border: 1px solid rgba(90, 169, 230, .25);
  border-radius: 8px; font-size: .84rem; color: var(--texte-2) !important;
}

.classement { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 8px; }
.classement li { background: var(--fond-3); border: 1px solid var(--bord); border-radius: 9px; padding: 10px 12px; }
.cl-tete { display: flex; align-items: center; gap: 8px; }
.cl-rang {
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--fond); border: 1px solid var(--bord-clair);
  font-size: .7rem; color: var(--texte-2); flex: none;
}
.cl-nom { font-weight: 700; font-size: .92rem; }
.cl-cartes { margin: 8px 0 0; }
.cl-texte { margin: 6px 0 0; font-size: .8rem; color: var(--texte-2); }

.formule-inline {
  font-family: var(--mono); font-size: .82em; background: var(--fond);
  border: 1px solid var(--bord); border-radius: 5px; padding: 1px 5px; color: var(--texte-2);
  white-space: nowrap;
}

.cote-visuel { margin: 14px 0; padding: 12px; background: var(--fond-3); border-radius: 8px; }
.cote-ligne { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.cote-ligne span { font-size: .74rem; color: var(--texte-2); width: 78px; flex: none; }
.cote-ligne i { display: block; height: 12px; border-radius: 6px; background: var(--accent-2); }
.cote-ligne i.mise { background: var(--orange); }
.cote-legende { margin: 4px 0 0; font-size: .74rem; color: var(--texte-3); }

.erreurs { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.erreur { background: var(--fond-3); border: 1px solid var(--bord); border-radius: 9px; padding: 10px 12px; }
.erreur h4 { margin: 0 0 6px; font-size: .88rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.erreur p { margin: 0; font-size: .82rem; color: var(--texte-2); }
.regle-fin p { font-size: .86rem; }

/* ---------- Adaptations écran large ---------- */
@media (min-width: 700px) {
  .selection {
    left: auto; right: 24px; bottom: 24px;
    width: 430px; max-height: 88vh;
    border: 1px solid var(--bord-clair);
    border-radius: 14px;
  }
  .res-kpis { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
  .grille-num { grid-template-columns: repeat(4, 1fr); }
  .grille-priors { grid-template-columns: repeat(5, 1fr); }
  .res-actions { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 420px) {
  .res-action { font-size: 1.25rem; }
  .res-kpis { grid-template-columns: 1fr 1fr; }
  .k-val { font-size: .9rem; }
  .choix-6 .choix-item span { min-width: 48px; font-size: .78rem; }
  .grille-num { grid-template-columns: 1fr 1fr; }
  .fil-etape { min-width: 70px; font-size: .68rem; }
  .carte-table { width: 36px; height: 49px; font-size: 15px; }
  .carte-main { width: 38px; height: 53px; font-size: 16px; }
  .siege { min-width: 48px; padding: 2px 5px; }
  .siege .s-pos { font-size: .64rem; }
  .siege .s-stack { font-size: .54rem; }
}

/* Sur grand écran, la barre d'action n'a pas besoin de rester collée : le pouce
   n'est plus la contrainte, et elle masquerait le bas de la table. */
@media (min-width: 900px) {
  .barre-actions {
    position: static; margin: 0 0 14px; padding: 0;
    background: none; justify-content: flex-end;
  }
  .barre-recalc { flex: 0 0 auto; min-width: 220px; }
}

/* ---------- Écran large : table à gauche, résultat à droite ---------- */
@media (min-width: 1000px) {
  .spot-form {
    display: grid;
    grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
    grid-template-areas:
      "fil      fil"
      "table    result"
      "situation result"
      "hyp      result"
      "barre    barre";
    gap: 14px 18px;
    align-items: start;
  }
  .spot-form > .fil { grid-area: fil; margin-bottom: 0; }
  .spot-form > section.bloc:nth-of-type(1) { grid-area: table; }
  .spot-form > section.bloc:nth-of-type(2) { grid-area: situation; }
  .spot-form > section.bloc:nth-of-type(3) { grid-area: hyp; }
  .spot-form > #panneau-resultat { grid-area: result; }
  .spot-form > .barre-actions { grid-area: barre; }
  .spot-form > .bloc, .spot-form > .resultat { margin-bottom: 0; }
  .table-poker { max-width: 620px; }
  .carte-table { width: 44px; height: 60px; font-size: 18px; }
  .carte-main { width: 46px; height: 64px; font-size: 19px; }
  .tc-board { min-height: 60px; }
  .table-pied { justify-content: center; }
  .table-pied .bouton-rue { flex: 0 1 auto; min-width: 220px; }
  .spot-entete { max-width: 100%; }
}

/* --- Reponse adverse et etats d'attente (2026-10-24) --- */
.bloc-reponse { border-left: 3px solid #c9a227; }
.bloc-reponse h3 { margin: 0 0 .35rem; font-size: 1rem; }
.reponse-boutons { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .6rem; }
.reponse-boutons .bouton { flex: 1 1 180px; min-height: 48px; }
.res-attente { border-left: 3px solid #c9a227; }
@media (max-width: 480px) {
  .reponse-boutons .bouton { flex: 1 1 100%; }
}

/* ---------- Moteur de taille de relance (2026-10-25) ---------- */
.taille { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--bord); }
.taille-tete { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.taille-tete h4 { margin: 0; font-size: .9rem; }
.taille-tag {
  font-size: .6rem; text-transform: uppercase; letter-spacing: .06em; color: var(--orange);
  border: 1px solid rgba(224, 163, 62, .45); border-radius: 999px; padding: 1px 7px;
}
.taille-reco {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 10px;
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(90, 169, 230, .10), rgba(90, 169, 230, .03));
  border: 1px solid rgba(90, 169, 230, .35);
}
.tr-lab { display: block; font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; color: var(--texte-3); }
.tr-val { display: block; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.tr-mes { display: block; font-size: .72rem; color: var(--texte-2); }
.tr-droite { text-align: right; }
.tr-ev { display: block; font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tr-ev-lab { display: block; font-size: .64rem; color: var(--texte-3); }

.taille-ecart, .taille-alerte, .taille-stable { margin: 8px 0 0; font-size: .76rem; color: var(--texte-2); }
.taille-alerte { border-left: 2px solid var(--orange); padding-left: 8px; }
.taille-stable { border-left: 2px solid rgba(78, 201, 138, .5); padding-left: 8px; }

.graph-taille { margin: 10px 0 2px; background: var(--fond); border: 1px solid var(--bord); border-radius: 8px; padding: 2px; }
.graph-taille .pt { fill: var(--texte-3); }
.graph-taille .pt-best { fill: var(--accent); stroke: var(--fond); stroke-width: 2; }
.graph-taille .reco-trait { stroke: rgba(90, 169, 230, .45); stroke-width: 1; stroke-dasharray: 3 3; }
.taille-legende { margin: 0 0 8px; font-size: .7rem; color: var(--texte-3); }

.taille-table tr.reco td { background: rgba(90, 169, 230, .10); }
.taille-table tr.reco td:first-child { box-shadow: inset 2px 0 0 var(--accent); }

.taille-outils { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.taille-k { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.taille-k-lab { font-size: .72rem; color: var(--texte-3); }
.k-btn {
  min-height: 34px; min-width: 40px; border-radius: 8px; border: 1px solid var(--bord-clair);
  background: var(--fond-3); color: var(--texte-2); font-family: inherit; font-size: .78rem;
  cursor: pointer; touch-action: manipulation;
}
.k-btn.actif { border-color: var(--accent); color: var(--texte); background: rgba(90, 169, 230, .16); font-weight: 700; }

.taille-details { margin-top: 10px; }
.taille-details h5 { font-size: .78rem; margin: 12px 0 4px; color: var(--texte-2); }
.petite-table { margin-top: 4px; }

@media (max-width: 480px) {
  .tr-val { font-size: 1.3rem; }
  .taille-k { margin-left: 0; width: 100%; }
  .taille-table { font-size: .74rem; }
  .taille-table th, .taille-table td { padding: 5px 4px; }
  .taille-outils .bouton { flex: 1 1 100%; }
}
