/* Pavillon — direction artistique « carnet de bord de flibustier » (création originale) :
   mer de nuit turquoise, laiton et or des instruments, parchemin des cartes marines, encre rouge pour l'ennemi.
   Titres en Pirata One, notes à la plume en IM Fell English, chiffres en JetBrains Mono.
   Navigation latérale / bulle du bas, toasts et entrées animées repris de Cap ICNA et Patrimoine. */
:root {
  --bg: #06141A; --bg-2: #0A1C23; --surface: #0D2129; --surface-2: #133039; --surface-3: #1B3E48;
  --border: rgba(231, 178, 76, 0.12); --border-2: rgba(231, 178, 76, 0.24);
  --text: #F1E8D2; --text-2: #A9B9B3; --text-3: #6E8780;
  --gold: #E7B24C; --gold-soft: rgba(231, 178, 76, 0.14); --gold-glow: rgba(231, 178, 76, 0.45); --on-gold: #1E1404;
  --sea: #2FB8A6; --sea-soft: rgba(47, 184, 166, 0.14); --sea-deep: #0B3A42;
  --parch: #EBDDB8; --parch-ink: #3A2A14; --red: #E25B45; --red-soft: rgba(226, 91, 69, 0.15); --good: #7BD88F;
  --sloop: #4FD1C5; --brig: #E7B24C; --galleon: #E8735F;
  --t-wiki: #7BD88F; --t-forum: #6FB7FF; --t-modele: #C39BFF; --t-estim: #E7B24C; --t-mesure: #FF8FC7;
  --radius: 18px; --sidebar: 228px;
  --display: "Pirata One", "IM Fell English", serif; --quill: "IM Fell English", Georgia, serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace; --body-font: Inter, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-family: var(--body-font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body::before { /* houle lointaine + lueur de lanterne */
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60% 50% at 90% -10%, rgba(231, 178, 76, .10), transparent 60%),
    radial-gradient(70% 60% at 0% 110%, rgba(47, 184, 166, .12), transparent 60%),
    repeating-radial-gradient(circle at 50% 140%, transparent 0 22px, rgba(47, 184, 166, .035) 22px 23px);
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.quill { font-family: var(--quill); font-style: italic; }
h1, h2, h3 { margin: 0; font-weight: 400; }
h1 { font-family: var(--display); font-size: clamp(34px, 4vw, 56px); line-height: 1; letter-spacing: .01em; color: var(--parch); text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
h2 { font-family: var(--display); font-size: 24px; line-height: 1.1; margin-bottom: 10px; color: var(--parch); }
h3 { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--text-3); margin: 14px 0 6px; }
.eyebrow { margin: 0 0 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.eyebrow::before { content: '✦ '; }
.lede { margin: 10px 0 0; color: var(--text-2); font-size: 15px; max-width: 70ch; font-family: var(--quill); font-size: 17px; line-height: 1.45; }

/* ── Barre latérale (ordinateur) / bulle du bas (téléphone) ── */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40; display: flex; flex-direction: column; gap: 22px; padding: 22px 14px;
  background: color-mix(in srgb, var(--surface) 78%, transparent); border-right: 1px solid var(--border); backdrop-filter: blur(24px) saturate(160%); -webkit-backdrop-filter: blur(24px) saturate(160%); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px; }
.brand img { width: 42px; height: 42px; border-radius: 12px; box-shadow: 0 0 0 1px var(--border-2), 0 0 24px -6px var(--gold-glow); }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand b { font-family: var(--display); font-size: 24px; font-weight: 400; color: var(--parch); }
.brand small { font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text-2); font-weight: 500; transition: background-color .2s, color .2s; }
.nav a svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.nav a span { white-space: nowrap; }
@media (hover: hover) { .nav a:hover { background: var(--surface-2); color: var(--text); } }
.nav a.active { background: var(--gold-soft); color: var(--gold); font-weight: 600; box-shadow: inset 2px 0 0 var(--gold); }
.nav-pill { display: none; }
.sidebar-foot { margin-top: auto; padding: 0 8px; font-size: 12px; color: var(--text-3); }
.sidebar-foot p { margin: 0; }
.main { margin-left: var(--sidebar); padding: 30px clamp(18px, 2.6vw, 44px) 64px; max-width: 1800px; }

/* ── Mise en page ── */
.page-h { margin-bottom: 22px; }
.card { position: relative; background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 94%, var(--gold) 2%), var(--surface)); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; min-width: 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 18px 40px -28px rgba(0, 0, 0, .7); }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.card.parch { background: linear-gradient(160deg, #F2E6C6, #E2CF9F); color: var(--parch-ink); border-color: rgba(58, 42, 20, .3); }
.card.parch h2 { color: #4A2E10; }
.card.parch .muted { color: rgba(58, 42, 20, .72); }
.deck { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(320px, .95fr); gap: 18px; margin-bottom: 18px; align-items: start; }
.deck.wide { grid-template-columns: minmax(0, 1.6fr) minmax(300px, .8fr); }
.deck > .card, .stack > .card, .cols2 > .card, .cols3 > .card { margin-bottom: 0; }
.stack { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.cols2, .cols3 { display: grid; gap: 18px; margin-bottom: 18px; }
.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.plain { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.tips li { padding-left: 22px; position: relative; }
.tips li::before { content: '⚓'; position: absolute; left: 0; color: var(--gold); font-size: 12px; top: 1px; }

/* ── Boutons, segments, curseurs ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 16px; border-radius: 12px; background: var(--gold); color: var(--on-gold); font-weight: 600; white-space: nowrap; transition: transform .15s var(--ease), filter .2s; }
.btn:active { transform: scale(.96); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn.fire { background: linear-gradient(180deg, #F0704F, #C2412B); color: #fff; box-shadow: 0 8px 20px -10px var(--red); font-family: var(--display); font-size: 20px; font-weight: 400; letter-spacing: .04em; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { padding: 6px 12px; border-radius: 9px; font-size: 13px; color: var(--text-2); font-weight: 500; transition: background .2s, color .2s; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 6px rgba(0, 0, 0, .3), inset 0 0 0 1px var(--border-2); }
.seg button[data-ship].on { color: var(--c); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 5px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); font-size: 12.5px; font-weight: 500; transition: all .2s; }
.chip.on { background: var(--gold-soft); color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.field { display: grid; gap: 6px; margin-top: 14px; }
.field-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; color: var(--text-2); }
.field-h b { font-family: var(--mono); font-weight: 600; color: var(--text); font-size: 13.5px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: linear-gradient(90deg, var(--gold) 0 var(--p, 50%), var(--surface-3) var(--p, 50%)); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 99px; background: var(--surface-3); }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 99px; background: var(--gold); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFE3A3, var(--gold) 60%, #9C6A16); border: 2px solid #3A2A14; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: var(--gold); border: 2px solid #3A2A14; }
input[type=number], input[type=text], select { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; min-height: 36px; width: 100%; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: var(--text-2); }
.switch input { appearance: none; -webkit-appearance: none; width: 40px; height: 24px; border-radius: 99px; background: var(--surface-3); position: relative; transition: background .2s; margin: 0; flex: none; }
.switch input::after { content: ''; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--text); transition: transform .2s var(--ease); }
.switch input:checked { background: var(--gold); }
.switch input:checked::after { transform: translateX(16px); background: var(--on-gold); }

/* ── Étiquettes de source ── */
.tag { display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; background: color-mix(in srgb, var(--c, var(--text-3)) 16%, transparent); color: var(--c, var(--text-2)); white-space: nowrap; vertical-align: 1px; font-family: var(--body-font); }
.t-wiki { --c: var(--t-wiki); } .t-forum { --c: var(--t-forum); } .t-modele { --c: var(--t-modele); } .t-estim { --c: var(--t-estim); } .t-mesure { --c: var(--t-mesure); }
.card.parch .tag { background: rgba(58, 42, 20, .12); color: #5A3A12; }

/* ── Indicateurs ── */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpi { display: flex; flex-direction: column; gap: 2px; padding: 13px 15px; background: var(--surface); min-width: 0; }
.kpi strong { font-family: var(--mono); font-size: 26px; line-height: 1.1; font-weight: 600; letter-spacing: -.03em; }
.kpi strong small { font-size: 13px; color: var(--text-3); margin-left: 3px; font-weight: 400; letter-spacing: 0; }
.kpi span { font-size: 12px; color: var(--text-2); }
.kpi.gold strong { color: var(--gold); } .kpi.sea strong { color: var(--sea); } .kpi.red strong { color: var(--red); }
.order { font-family: var(--display); font-size: clamp(26px, 2.6vw, 36px); line-height: 1.1; color: var(--gold); margin: 2px 0 6px; }
.order-sub { font-family: var(--quill); font-size: 17px; color: var(--text); margin: 0 0 14px; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--red), var(--gold) 55%, var(--good)); background-size: calc(100% / var(--f, 1)) 100%; width: calc(var(--f) * 100%); transition: width .3s var(--ease); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c); }

/* ── Tableaux ── */
.tbl-w { overflow-x: auto; margin: 0 -4px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); font-weight: 400; padding: 8px 10px; border-bottom: 1px solid var(--border-2); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.n { font-family: var(--mono); white-space: nowrap; }
.tbl .act b { display: block; font-weight: 600; }
.tbl .act small { color: var(--text-3); font-size: 12px; }
.cell-btn { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 8px; border: 1px solid transparent; font-family: var(--mono); font-size: 14px; transition: background .2s, border-color .2s; }
.cell-btn:hover { background: var(--surface-2); border-color: var(--border); }
.cell-btn.meas { color: var(--t-mesure); }
.cell-btn .sw { opacity: .45; font-size: 12px; }
.matrix td, .matrix th { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.mx { display: inline-flex; flex-direction: column; align-items: center; padding: 5px 8px; border-radius: 9px; min-width: 76px; transition: background .2s; }
.mx:hover { background: var(--surface-2); }
.mx b { font-family: var(--mono); font-size: 15px; color: var(--gold); }
.mx small { font-size: 11px; color: var(--text-2); }
.mx.out b { color: var(--red); }
.mx.cur { box-shadow: inset 0 0 0 1.5px var(--gold); }

/* ── Rose des vents (voiles) ── */
.rose-card { display: flex; flex-direction: column; align-items: center; }
.rose { width: 100%; max-width: 560px; aspect-ratio: 1; touch-action: none; user-select: none; -webkit-user-select: none; overflow: visible; }
.handle { cursor: grab; }
.handle:active { cursor: grabbing; }
.rose .ring-t { font-family: var(--display); font-size: 20px; fill: var(--parch); text-anchor: middle; dominant-baseline: central; }
.rose .ring-s { font-family: var(--mono); font-size: 8px; fill: var(--text-3); text-anchor: middle; dominant-baseline: central; }
.rose-ctl { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.polar { width: 100%; max-width: 420px; display: block; margin: 0 auto; }
.polar text { font-family: var(--mono); font-size: 7px; fill: var(--text-3); }

/* ── Canon ── */
.fpv-wrap { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--border-2); background: #0A2730; }
.fpv { display: block; width: 100%; aspect-ratio: 16 / 9; touch-action: none; user-select: none; }
.hud { position: absolute; left: 12px; top: 10px; right: 12px; display: flex; justify-content: space-between; gap: 8px; pointer-events: none; font-family: var(--mono); font-size: 12px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.hud b { color: var(--gold); font-size: 15px; }
.hud .verdict { padding: 3px 10px; border-radius: 8px; background: rgba(0, 0, 0, .45); backdrop-filter: blur(6px); }
.hud .verdict.hit { color: var(--good); } .hud .verdict.miss { color: #FFB4A6; }
.fire-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: end; }
.side, .top { width: 100%; display: block; }
.side text, .top text, .turnmap text { font-family: var(--mono); font-size: 10px; fill: var(--text-3); }
.shot-file { display: none; }

/* ── Barre ── */
.wheel { width: 100%; max-width: 330px; aspect-ratio: 1; display: block; margin: 0 auto; touch-action: none; user-select: none; cursor: grab; }
.wheel:active { cursor: grabbing; }
.turnmap { width: 100%; display: block; aspect-ratio: 1; max-height: 640px; }

/* ── Dialogue (chronomètre) ── */
dialog { border: 1px solid var(--border-2); border-radius: 20px; background: var(--surface); color: var(--text); padding: 22px; width: min(420px, calc(100vw - 24px)); box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
dialog::backdrop { background: rgba(2, 8, 10, .65); backdrop-filter: blur(4px); }
.watch { font-family: var(--mono); font-size: 64px; text-align: center; color: var(--gold); letter-spacing: -.04em; margin: 10px 0; font-variant-numeric: tabular-nums; }
.watch.run { color: var(--sea); }

/* ── Toast, écran d'accueil, entrées ── */
.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 90; background: var(--parch); color: var(--parch-ink); padding: 10px 16px; border-radius: 12px; font-weight: 600; transition: opacity .25s, transform .25s var(--ease); max-width: calc(100vw - 32px); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.splash { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #06141A; color: var(--gold); transition: opacity .6s, visibility .6s; }
.splash.out { opacity: 0; visibility: hidden; }
.splash-rose { width: 120px; height: 120px; animation: spin 2.4s var(--ease) infinite; }
.splash-rose circle { fill: none; stroke: currentColor; stroke-opacity: .5; }
.splash-rose path { fill: var(--parch); } .splash-rose .n { fill: var(--red); }
.splash p { margin: 0; font-family: var(--display); font-size: 34px; letter-spacing: .2em; color: var(--parch); }
.splash small { font-family: var(--quill); font-style: italic; font-size: 15px; opacity: .7; }
@keyframes spin { 0% { transform: rotate(-30deg); } 50% { transform: rotate(25deg); } 100% { transform: rotate(-30deg); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.enter :is(.page-h, .card) { animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 1180px) {
  .deck, .deck.wide { grid-template-columns: 1fr; }
  .cols3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .sidebar { inset: auto 12px max(8px, calc(env(safe-area-inset-bottom) - 16px)) 12px; width: auto; height: auto; padding: 5px; flex-direction: row; gap: 0;
    border: 1px solid var(--border-2); border-radius: 999px; background: color-mix(in srgb, var(--surface) 86%, transparent); box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .7); overflow: visible; }
  .brand, .sidebar-foot { display: none !important; }
  .nav { flex-direction: row; justify-content: space-around; width: 100%; gap: 2px; align-items: stretch; position: relative; touch-action: none; }
  .nav > a { position: relative; z-index: 1; flex: 1; flex-direction: column; justify-content: center; gap: 3px; height: 54px; padding: 0; border-radius: 999px; box-shadow: none; }
  .nav > a svg { width: 21px; height: 21px; }
  .nav > a span { font-size: 10px; font-weight: 600; line-height: 1; }
  .nav a.active { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); color: var(--gold); }
  .nav.pill-on > a.active { background: transparent; box-shadow: none; }
  .nav-pill { display: block; position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; opacity: 0; border-radius: 999px; overflow: hidden;
    background: var(--gold-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--gold) 35%, transparent), 0 0 18px -6px var(--gold-glow); transform-origin: center; will-change: transform; }
  .nav.pill-on .nav-pill { opacity: 1; }
  .nav.pill-ready .nav-pill { transition: opacity .2s; }
  .nav.pill-lens .nav-pill { z-index: 2; box-shadow: inset 0 0 0 1px var(--border-2), 0 6px 18px -6px rgba(0, 0, 0, .5); background: var(--surface-2); }
  .nav-pill::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: calc(.65 + .35 * var(--pill-v, 0));
    background: radial-gradient(52% 34% at calc(36% + var(--pill-dir, 0) * 26%) 10%, rgba(255, 255, 255, .2), rgba(255, 255, 255, 0) 62%), radial-gradient(70% 30% at calc(62% - var(--pill-dir, 0) * 20%) 100%, rgba(255, 255, 255, .07), rgba(255, 255, 255, 0) 65%); }
  .nav-pill .nav-lens { position: absolute !important; left: 0; top: 0; margin: 0 !important; padding: 0 !important; display: flex; flex-direction: row; justify-content: space-around; gap: 2px; pointer-events: none; will-change: transform; visibility: hidden; }
  .nav.pill-lens .nav-pill .nav-lens { visibility: visible; }
  .nav-pill .nav-lens > a { position: static !important; display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 54px; background: transparent !important; box-shadow: none !important; transition: none !important; color: var(--gold); }
  .nav-pill .nav-lens > :not(a) { display: none; }
  .nav:is(.pill-drag, .pill-follow) > a, .nav:is(.pill-drag, .pill-follow) .nav-lens > a { color: color-mix(in srgb, var(--gold), var(--text-2) calc(var(--pill-d, 1) * 100%)) !important; transition: none !important; }

  .main { margin-left: 0; padding: max(18px, env(safe-area-inset-top)) 14px 104px; }
  .card { padding: 16px; border-radius: 16px; }
  .deck, .cols2, .cols3, .stack { gap: 14px; margin-bottom: 14px; }
  .cols2, .cols3 { grid-template-columns: 1fr; }
  .rose-ctl { grid-template-columns: 1fr; }
  .kpis.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 11px 12px; } .kpi strong { font-size: 22px; }
  .fire-row { grid-template-columns: 1fr; }
  .hud { font-size: 10.5px; } .hud b { font-size: 12.5px; }
  .toast { bottom: 96px; }
}

/* ── Ajouts v2 : équipage, fuir/rattraper, explications, bandeaux ── */
.hud-b { position: absolute; left: 10px; right: 10px; bottom: 8px; pointer-events: none; font-family: var(--mono); font-size: 12px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .9); text-align: center; }
.hud-b b { color: #FFE3A3; }
.ctl-grid { display: grid; grid-template-columns: repeat(3, auto); gap: 4px 28px; justify-content: start; }
.ctl-grid h3 { margin-top: 0; }
.seg button:disabled { opacity: .3; cursor: not-allowed; }
.roles { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.roles li::marker { color: var(--gold); font-family: var(--mono); }
.hint { width: 100%; margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; font-size: 13.5px; color: var(--text-2); }
.hint summary { cursor: pointer; color: var(--gold); font-weight: 600; list-style: none; }
.hint summary::before { content: '? '; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--gold-soft); margin-right: 6px; font-size: 11px; }
.hint p { margin: 8px 0 0; }
.flee { display: grid; gap: 8px; margin: 12px 0 8px; }
.flee-r { display: grid; grid-template-columns: 130px minmax(0, 1fr) 56px; align-items: center; gap: 10px; font-size: 13px; }
.flee-bar { position: relative; height: 10px; border-radius: 99px; background: var(--surface-3); }
.flee-bar::after { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--text-3); }
.flee-bar i { position: absolute; top: 0; bottom: 0; width: var(--w); background: var(--c); border-radius: 99px; }
.flee-r b { text-align: right; }
.mini-order { display: none; }

@media (max-width: 760px) {
  body { font-size: 15px; }
  h1 { font-size: 34px; }
  h2 { font-size: 22px; }
  .lede { font-size: 15.5px; }
  .page-h { margin-bottom: 14px; }
  .nav > a span { font-size: 9.5px; }
  .nav > a svg { width: 20px; height: 20px; }
  /* Curseurs et boutons à la taille du pouce */
  input[type=range] { height: 36px; }
  input[type=range]::-webkit-slider-runnable-track { height: 8px; }
  input[type=range]::-webkit-slider-thumb { width: 30px; height: 30px; margin-top: -11px; }
  .field { margin-top: 10px; gap: 2px; }
  .field-h { font-size: 14px; }
  .field-h b { font-size: 14.5px; }
  .seg { display: flex; width: 100%; }
  .seg button { flex: 1; min-height: 40px; padding: 6px 8px; font-size: 14px; }
  .chip { min-height: 36px; padding: 7px 12px; font-size: 13.5px; }
  .btn.sm { min-height: 40px; }
  .switch { font-size: 14px; }
  .ctl-grid { grid-template-columns: 1fr; gap: 8px; }
  .order { font-size: 27px; }
  .order-sub { font-size: 16.5px; }
  .kpi span { font-size: 12.5px; }
  .rose { max-width: 100%; }
  .wheel { max-width: 260px; }
  /* Viseur collé en haut de l'écran pendant qu'on règle la situation */
  .fpv-wrap.mobile-top { position: sticky; top: max(6px, env(safe-area-inset-top)); z-index: 6; margin: 0 -6px 14px; box-shadow: 0 16px 30px -12px rgba(0, 0, 0, .8); }
  .hud { font-size: 10px; left: 8px; right: 8px; top: 6px; }
  .hud b { font-size: 12px; }
  .hud .verdict { padding: 2px 6px; }
  .hud-b { font-size: 10px; bottom: 5px; }
  .fire-row .btn.fire { width: 100%; min-height: 50px; font-size: 24px; }
  /* Bandeau d'ordre collé en haut (Voiles) */
  .mini-order { display: flex; position: sticky; top: max(6px, env(safe-area-inset-top)); z-index: 6; align-items: center; gap: 10px; margin: 0 -4px 12px; padding: 9px 14px; border-radius: 14px;
    background: color-mix(in srgb, var(--surface-2) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--border-2); box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .8); font-size: 13.5px; }
  .mini-order b { font-family: var(--display); font-weight: 400; font-size: 19px; color: var(--gold); line-height: 1; }
  .mini-order span { color: var(--text-2); }
  .mini-order .num { margin-left: auto; font-size: 16px; color: var(--text); font-weight: 600; white-space: nowrap; }
  /* Tableaux en fiches */
  .tbl { font-size: 14px; }
  .tbl.stackable thead { display: none; }
  .tbl.stackable tr { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 4px 6px; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .tbl.stackable td { border: 0; padding: 2px 0; }
  .tbl.stackable td.act { grid-column: 1 / -1; }
  .tbl.stackable td[data-l]::before { content: attr(data-l); display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
  .cell-btn { padding: 6px 8px; font-size: 15px; background: var(--surface-2); border-color: var(--border); }
  .matrix { font-size: 12px; }
  .matrix th { font-size: 9px; letter-spacing: .04em; white-space: normal; padding: 6px 4px; }
  .matrix td { padding: 4px 2px; }
  .matrix td:first-child { font-size: 12px; }
  .mx { min-width: 0; width: 100%; padding: 5px 2px; }
  .mx b { font-size: 13px; }
  .mx small { font-size: 10px; }
  .flee-r { grid-template-columns: 96px minmax(0, 1fr) 46px; font-size: 12.5px; }
  .legend { font-size: 12px; }
}
.hud-b { left: 50%; right: auto; transform: translateX(-50%); width: max-content; max-width: calc(100% - 16px); padding: 3px 10px; border-radius: 8px; background: rgba(0, 0, 0, .42); backdrop-filter: blur(6px); }
