/* Screen-space positioning keeps the command list next to its unit at any zoom. */
:is(.map-shell,.sidebar) #quick-actions {
  right:auto; bottom:auto; display:flex; flex-direction:column; gap:3px;
  width:150px; max-width:calc(100% - 12px); padding:5px;
  background:#142e42; border:2px solid #fff0c1; border-radius:5px;
  box-shadow:3px 4px 0 #112c3a80; z-index:5; line-height:1.2;
}

/* The fitted 15 × 12 board fills its viewport exactly, including the right edge. */
/* Son : un bouton cadré comme Réglages, Pause et Aide, à l'accueil comme en jeu, téléphone compris. */
#sound{display:flex;align-items:center;justify-content:center;gap:4px;line-height:1;padding:0 8px}
#sound span{display:inline-block;min-width:2.4em;margin:0;font-size:10px;text-align:left}
/* Valeurs qui changent en cours de partie (jour, effectifs) : largeur réservée, rien ne glisse quand elles passent à deux chiffres. */
#game-screen .mission-header .unit-counts>.game-day{min-width:58px;justify-content:center}
#game-screen .mission-header .unit-counts b{display:inline-block;min-width:2ch;text-align:center;font-variant-numeric:tabular-nums}
#game-screen .map-shell{min-height:0}
#game-screen .map-viewport{width:100%;height:auto;min-height:0;max-height:none;aspect-ratio:var(--board-ratio,5/4)}

#game-screen .mission-header{display:flex;align-items:center;gap:12px}
#game-screen .mission-header h1{white-space:nowrap;line-height:1.05}
#game-screen .mission-header .unit-counts{color:#345069;gap:12px;margin-left:auto}
#game-screen .mission-header .unit-counts b{color:#b95039}
.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
#game-screen .economy-overview{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.45fr);grid-template-rows:12px 24px;align-content:center;column-gap:8px;min-height:64px}
#game-screen .economy-overview>div:first-child{grid-column:1;grid-row:1/3}
#game-screen .economy-overview>div:nth-child(2){grid-column:2;grid-row:1/3}
#game-screen .economy-overview .army-line{grid-column:3;grid-row:1/3;display:flex;align-items:flex-end;flex-direction:column;flex-wrap:nowrap;justify-content:space-between;gap:0;padding:0;text-align:right}
#game-screen .army-line .turn-tag{gap:4px;min-width:0;color:#afc2bd;line-height:12px}
#game-screen .army-line .turn-dot{width:7px;height:7px}
#game-screen .army-line .turn-tag b{font-size:10px;font-weight:700;white-space:nowrap;line-height:12px}
#game-screen .army-line #properties{color:#afc2bd;font-size:10px;font-weight:700;white-space:nowrap;line-height:12px}
@media(max-width:760px){
 body:has(#game-screen:not([hidden])) main#game-screen{padding:5px 3px 10px}
 #game-screen .mission-header{margin:0 3px 5px;min-height:30px;gap:5px;flex-wrap:wrap}
 #game-screen .mission-header h1{font-size:clamp(16px,4.4vw,21px)}
 #game-screen .mission-header .unit-counts{display:flex;width:100%;align-items:center;justify-content:flex-end;gap:10px;font-size:10px;line-height:1.2;white-space:nowrap}
 #game-screen .mission-header .unit-counts span{justify-content:flex-end;gap:4px}
 #game-screen .mission-header .unit-counts b{font-size:12px}
 #game-screen .field-hud{display:block}
 #game-screen .economy-overview{padding:8px 10px 7px;border:0;border-bottom:1px solid #466274;column-gap:5px}
 #game-screen .power-column{display:block;border:0}
 #game-screen .power-overview{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;padding:8px 12px 5px}
 #game-screen .power-track{width:100%;min-width:0}
 #game-screen .power-track>span{font-size:12px}
 #game-screen .power-column .zoom{gap:8px;padding:6px 12px 10px;border-top:1px solid #466274}
 #game-screen .power-column .zoom button{height:44px}
}
:is(.map-shell,.sidebar) #quick-actions:empty { display:none; }
:is(.map-shell,.sidebar) #quick-actions button {
  width:100%; min-height:44px; padding:9px 12px; border:0;
  border-radius:2px; box-shadow:none; text-align:left;
  background:#f7edcc; color:#18364a; font-size:15px; font-weight:700;
}
:is(.map-shell,.sidebar) #quick-actions button:hover { background:#ffdc87; }
:is(.map-shell,.sidebar) #quick-actions .capture { background:#c7e5b1; }
:is(.map-shell,.sidebar) #quick-actions .attack { background:#f6b193; }
:is(.map-shell,.sidebar) #quick-actions .undo { background:#d8e3e5; }
:is(.map-shell,.sidebar) #quick-actions button:focus-visible { outline:3px solid #5ecbde; outline-offset:-3px; }
#music-status { padding:9px 12px; background:#e5ecd5; border-radius:4px; }

/* A separate row is used when targets need the map or no overlay can fit safely. */
:is(.map-shell,.sidebar) #quick-actions.docked {
 position:fixed;left:12px!important;right:12px;top:auto!important;bottom:12px;width:auto;max-width:640px;
 margin:0 auto;flex-direction:row;flex-wrap:wrap;z-index:18;max-height:40dvh;overflow:auto;
}
:is(.map-shell,.sidebar) #quick-actions.docked button {width:auto;flex:1;min-width:120px;}
:is(.map-shell,.sidebar) #quick-actions.docked {justify-content:flex-start;}
.settings-fields select {width:100%;min-width:0;min-height:44px;}
.combat-card {max-height:calc(100dvh - 20px);overflow:hidden;}
/* Duel rendered by Phaser (PocketDuel): same box as the Canvas duel; Phaser's inline size is overridden. */
.combat-stage canvas[hidden]{display:none!important}
.combat-screen #battle-phaser {width:auto!important;height:auto!important;min-height:0;max-width:100%;max-height:calc(100dvh - 88px);aspect-ratio:48/31;object-fit:contain;}
@media(max-width:400px){.combat-top h2{font-size:20px;}:is(.map-shell,.sidebar) #quick-actions.docked button{min-width:100px;}.settings-fields{gap:14px;}}

/* Controls below the viewport never cover a movement destination. */
.board-bottom .zoom {position:static;padding:0;align-items:center;margin-right:auto;flex-shrink:0;}
.board-bottom .zoom button {min-height:44px;width:44px;}
.board-bottom #zoomfit {width:auto;min-width:100px;padding:0 8px;font-size:14px;font-weight:700;}
.board-bottom {flex-wrap:wrap;gap:10px;padding:6px 10px;}
#next-unit {margin-left:auto;min-height:44px;padding:7px 11px;background:#ffe19a;border:2px solid #20364b;border-radius:4px;color:#173449;font-size:12px;font-weight:800;box-shadow:0 2px 0 #20364b;}
#next-unit b {display:inline-grid;place-items:center;min-width:25px;height:25px;margin:0 5px;padding:0 5px;border-radius:50%;background:#20364b;color:#fff4d5;font-size:13px;}
#next-unit:disabled {background:#dce3d5;color:#697971;box-shadow:none;border-color:#93a398;}
#next-unit:disabled b {background:#87978e;}
.mobile-orders #mobile-next:not(:disabled) {background:#ffe19a;color:#173449;box-shadow:inset 0 0 0 2px #20364b;}
.power-overview {display:flex;gap:16px;padding:7px 12px;background:var(--navy);color:#fff4d5;}
.power-track {flex:1;min-width:0;}
.power-track span {display:flex;justify-content:space-between;gap:8px;font-size:14px;}
.power-track progress {display:block;width:100%;height:8px;margin-top:4px;appearance:none;border:0;background:#385365;}
.power-track progress::-webkit-progress-bar {background:#385365;}
.power-track.coral progress::-webkit-progress-value {background:#f6815f;}
.power-track.azure progress::-webkit-progress-value {background:#75c2f0;}
.power-track.coral progress::-moz-progress-bar {background:#f6815f;}
.power-track.azure progress::-moz-progress-bar {background:#75c2f0;}
.power-track .ready {color:#ffe394;}
.production-modal {width:min(760px,calc(100vw - 24px));max-height:85dvh;overflow:auto;}
.production-modal h2 {margin-bottom:8px;padding-right:30px;}
.production-modal #shop {grid-template-columns:1fr 1fr;grid-auto-rows:max-content;padding:0;gap:8px;}
.production-modal #shop[hidden] {display:none;}
.production-modal #shop button {min-height:74px;padding:8px;}
.production-modal #shop b,.production-modal #shop .price {font-size:14px;}
.production-modal #shop small {font-size:12px;}
.production-modal #shop canvas {flex:0 0 48px;width:48px;height:40px;}
.production-note,#production-funds {font-size:14px;}
@media(max-width:760px){:is(.map-shell,.sidebar) #quick-actions.docked{bottom:calc(76px + env(safe-area-inset-bottom));}.board-bottom>span{display:none!important;}.board-bottom #next-unit{display:none;}.board-bottom .zoom{margin:auto;}.mission-header{padding-bottom:10px;}.production-modal #shop{grid-template-columns:1fr;}}
.map-viewport {height:clamp(300px,65dvh,720px);min-height:0;max-height:none;}
.pause-button {font-size:16px;min-width:70px;}
.pause-button span {font-size:12px;}
.pause-dialog {text-align:center;}
.pause-dialog .primary {width:100%;font-size:15px;}
/* Signalement sous Reprendre : même largeur, espacé, style secondaire (comme la fenêtre de résultat). */
.pause-dialog .secondary {width:100%;min-height:44px;margin-top:10px;font-weight:700;}
.pause-dialog .pause-hint {font-size:12px;}
.result>.secondary {width:100%;margin-top:10px;}
.result .result-mission{font-size:13px;margin:0 0 12px;}
.result .result-stats{display:table;width:100%;border-collapse:collapse;table-layout:fixed;padding:0;text-align:center;}
.result-stats caption{font-weight:700;text-align:left;padding-bottom:8px;}
.result-stats th,.result-stats td{padding:10px 7px;border-bottom:1px solid var(--line);overflow-wrap:anywhere;}
.result-stats thead th{font-size:12px;}
.result-stats tbody th{text-align:left;font-size:12px;font-weight:500;}
.result-stats td{font-weight:700;font-variant-numeric:tabular-nums;}
.result>button{min-height:44px;white-space:normal;}
@media(max-width:400px){.modal.result{padding:20px 14px;}.result h2{font-size:30px;}.result-stats th,.result-stats td{padding:9px 5px;}}
.tutorial-cue {outline:3px solid #ffd23f;outline-offset:2px;animation:tutorial-cue 1.1s ease-in-out infinite;}
@keyframes tutorial-cue {50% {outline-color:#fff3b3;box-shadow:0 0 0 6px #ffd23f55;}}
@media (prefers-reduced-motion:reduce) {.tutorial-cue {animation:none;}}
.turn-complete {background:#b9e797!important;color:#12352b!important;border-color:#dff7c8!important;box-shadow:0 0 0 3px #a3d89055!important;}
#end-note {min-height:2.5em;}
#battle-log {white-space:pre-line;max-height:100px;overflow:auto;font-size:13px;line-height:1.5;}
.map-shell .zoom button {min-height:44px;}
#viewport {touch-action:pan-x pan-y;overscroll-behavior:contain;}
.combat-buttons {display:flex;gap:8px;flex-wrap:wrap;}
@media(max-width:760px){.top-right{gap:4px;}.pause-button{min-width:40px;}.pause-button span{display:none;}.map-viewport{height:60dvh;min-height:280px;}.combat-buttons button{font-size:13px;}}

/* Compact battlefield HUD: essential economy and power data stays attached to the map. */
.field-hud{display:grid;grid-template-columns:minmax(190px,.72fr) minmax(360px,1.55fr);background:var(--navy);color:#fff4d5;border-top:1px solid #466274}
.economy-overview{display:grid;grid-template-columns:1fr 1fr;gap:3px 14px;padding:9px 12px;border-right:1px solid #466274}
.economy-overview small{display:block;color:#afc2bd;font-size:10px;font-weight:700;letter-spacing:.8px}
.economy-overview strong{display:block;font:800 22px 'Barlow Condensed',sans-serif;line-height:1.05}
.economy-overview strong span{font:11px 'DM Sans',sans-serif;color:#afc2bd}
.economy-overview .income{color:#8dd8ad}
.economy-overview .army-line{grid-column:1/-1;display:flex;gap:12px;justify-content:space-between;border:0;padding:2px 0 0;color:#cad8d3;font-size:10px}
.power-column{display:grid;grid-template-rows:auto auto;border-left:1px solid #466274;min-width:0}
.power-overview{align-self:stretch;padding:8px 12px 5px;background:transparent}

/* Optional information stays reachable without forcing a long mobile page. */
.fold{border:1px solid #c4ceba;border-radius:6px;background:var(--paper);overflow:hidden}
.fold>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:44px;padding:9px 12px;background:#dfe7d7;color:#173449;font-size:13px;font-weight:800;cursor:pointer;list-style:none}
.fold>summary::-webkit-details-marker{display:none}
.fold>summary::after{content:'+';order:3;display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:#173449;color:#fff4d5;font-size:17px;line-height:1}
.fold[open]>summary::after{content:'−'}
.fold>summary span{margin-left:auto;color:#667a70;font-size:11px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.fold>summary .fold-label{margin-left:0;color:inherit;font-size:inherit;font-weight:inherit;overflow:visible;min-width:auto}
.fold .commander,.fold .intel-panel{border:0;border-radius:0;box-shadow:none}
.log-fold{margin-top:14px}
.log-fold .battle-log{max-height:130px;min-height:0;border:0;background:#f8f5e6}

/* Duel: one stage with unit/health/terrain labels, one live phase/result line. */
.combat-screen{padding:clamp(5px,2vw,22px)}
.combat-card{display:grid;grid-template-rows:auto minmax(0,1fr);width:min(900px,100%);border-color:#d5bf88;border-radius:8px}
.combat-top{display:grid;grid-template-columns:minmax(170px,1fr) minmax(0,2fr) minmax(170px,1fr);gap:12px;min-height:58px;padding:6px 10px;background:linear-gradient(#203c50,#142d40)}
.combat-top #battle-status{min-width:0;text-align:center;color:#ffce8d;font-size:15px;line-height:1.25;overflow-wrap:anywhere}
.combat-heading{min-width:0}
.combat-label{display:block;color:#fff4d5;font:700 22px/1.1 var(--font-heading)}
.combat-top h2{margin:0;overflow:hidden;font-size:27px;line-height:1;text-overflow:ellipsis;white-space:nowrap}
.combat-top button{min-height:44px;padding:7px 13px;border:1px solid #fff0c4;box-shadow:0 2px 0 #0d2232}
.combat-stage{display:grid;min-height:0;place-items:center;background:#102638;overflow:hidden}
.combat-stage canvas{display:block;width:auto;max-width:100%;height:auto}
.combat-buttons{flex-wrap:nowrap;justify-self:end}
.confirm-combat{display:grid;gap:10px;margin:4px 0 2px}
.confirm-combat[hidden]{display:none}
.confirm-position{padding:7px 10px;border-radius:4px;background:#dde8d8;color:#456558;font-size:12px;font-weight:800;text-align:center}
.confirm-matchup{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;padding:12px;border-radius:5px;background:#173249;color:#fff4d5;text-align:center}
.confirm-matchup span{color:#ffbd7b;font-size:20px}
.confirm-matchup strong{font:700 19px 'Barlow Condensed',sans-serif}
.confirm-estimates{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.confirm-estimates>span{display:grid;gap:4px;padding:10px 12px;border:1px solid #c8d1bd;border-radius:5px;background:#edf0df;color:#607267;font-size:11px}
.confirm-estimates b{color:#b74332;font:700 27px/1.05 var(--font-heading);white-space:nowrap}
.confirm-verdict{margin:0!important;padding:9px 10px;border-left:4px solid #e9a349;background:#fff0d4;color:#5d6f65!important;font-size:12px!important;font-weight:700;line-height:1.4!important}

@media(max-width:1100px){
 .field-hud{grid-template-columns:minmax(170px,.8fr) minmax(230px,1.2fr)}
}

@media(max-width:760px){
 body{padding-bottom:74px}
 .topbar{height:56px;padding:0 8px;border-bottom-width:3px}
 .logo{font-size:16px;line-height:.78}.logo-front{font-size:21px;margin-top:3px}
 .icon-button{min-width:38px;height:38px;min-height:38px}.pause-button{min-width:38px}
 main{padding:7px 6px 10px}
 .mission-header{min-height:34px;margin:0 2px 6px;padding:0}.mission-header h1{font-size:21px}
 .game-layout{gap:8px}.day strong{font-size:20px}
 .map-viewport{height:min(58dvh,75vw);min-height:270px}
 .field-hud{grid-template-columns:.95fr 1.05fr}
 .economy-overview{grid-template-columns:1fr 1fr;border-right:1px solid #466274;border-bottom:0;padding:7px 10px}
 .economy-overview strong{font-size:21px}.economy-overview .army-line{font-size:10px}
 .power-overview{padding:7px 10px;gap:10px}.power-track span{font-size:12px}.power-track progress{height:7px}
 .board-bottom{padding:2px 7px}.board-bottom .zoom button{min-height:40px;height:40px}.board-bottom #zoomfit{min-width:92px;font-size:13px}
 .sidebar{display:flex;gap:8px}
 .commander-fold,.intel-fold{width:100%}
 .commander{height:126px}.commander-quote{padding:7px 8px}
 .intel-panel .selected-heading{min-height:67px;padding:5px 8px}.intel-panel .selected-heading canvas{width:56px;height:56px}
 .description{margin:7px 10px}.terrain-info{margin:6px 10px}
 .log-fold{margin-top:8px;margin-bottom:6px}
 .fold>summary{min-height:42px;padding:7px 10px}
 .combat-screen{padding:5px}.combat-card{max-height:calc(100dvh - 10px)}
 .combat-top{grid-template-columns:auto minmax(0,1fr) auto;min-height:58px;padding:5px 7px;gap:6px}.combat-top h2{font-size:20px;max-width:none}
 .combat-label{font-size:16px}.combat-top #battle-status{font-size:12px}
 .combat-top button{min-height:44px;padding:5px 9px;font-size:12px}
 .combat-buttons{gap:5px}.combat-buttons button span:not(.button-label){display:none}
 .confirm-matchup{padding:10px 7px}.confirm-matchup strong{font-size:17px}
 .confirm-estimates>span{gap:3px;padding:9px;font-size:11px}.confirm-estimates b{font-size:25px}
}

@media(max-height:520px) and (orientation:landscape){
 .combat-card{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);width:min(900px,100%,calc((100dvh - 88px)*48/31 + 6px))}
 .combat-top{grid-template-columns:auto minmax(0,1fr) auto}
 .combat-top,.combat-stage{grid-column:1;grid-row:auto}
 .combat-screen #battle-phaser{max-height:calc(100dvh - 78px)}
}

/* The charge track itself is the action; no duplicate power row. */
.power-track{position:relative;display:grid;grid-template-rows:auto 18px;grid-template-columns:minmax(0,1fr);gap:3px;padding:0 2px;min-height:44px;border:0;border-radius:3px;background:transparent;color:#fff4d5;text-align:left;box-shadow:none}
.power-track:disabled{opacity:1;cursor:default}
.power-track .power-activate{display:none}
.power-track>span{grid-row:1;grid-column:1}
.power-track progress{grid-row:2;grid-column:1;height:18px;margin:0}
.power-track.available .power-activate{display:flex;grid-row:2;grid-column:1;position:relative;z-index:1;align-items:center;justify-content:center;text-align:center;font-size:10px;line-height:18px;font-style:normal;font-weight:800;color:#142e42;pointer-events:none}
.power-track:focus-visible{outline:2px solid #ffe394;outline-offset:2px}
.power-track.no-power{grid-template-rows:auto;min-height:0}.power-track.no-power progress,.power-track.no-power>span b{display:none}
:is(.map-shell,.sidebar) #quick-actions.scan-target{width:174px}
:is(.map-shell,.sidebar) #quick-actions.scan-target .capture{text-align:center;font-weight:800}
.power-column .zoom{position:static;display:flex;justify-content:center;gap:4px;padding:3px 10px 7px}
.power-column .zoom button{width:44px;height:44px;min-height:44px;flex-shrink:0}
.power-column #zoomfit{width:auto;min-width:0;flex:1;font-size:12px;font-weight:700;padding:0 3px}
.commander-power{padding:12px;color:#173449;border-top:1px solid #c4ceba;font-size:13px}
.commander-power p{margin:5px 0 0;line-height:1.4}
.unit-counts{display:flex;gap:10px;margin-left:auto;font-size:11px;white-space:nowrap}
.unit-counts span{display:flex;align-items:center;gap:4px}
.unit-counts b{font-size:15px;color:#ffe394}
@media(max-width:760px){
 .board-bottom{display:none}
 .power-overview{padding:3px 7px 0;gap:6px}
 .power-track span{font-size:11px;gap:3px}
 .power-column .zoom{padding:0 6px 6px;gap:3px}
 .field-hud{grid-template-columns:minmax(0,.9fr) minmax(175px,1.1fr)}
 .unit-counts{gap:8px;font-size:10px}.turn-tag{min-width:0}.turn-tag b{font-size:10px}
 .economy-overview{gap:3px 7px;padding:7px}
}

/* Stage 2: a real operations hub, separate from the battlefield.
   Harmonisation UI (docs/PHASER.md section 14) : parcours en trois étapes dans l'ordre École de commandement →
   Passage des Saules → Pont-Soleil, trois cartes de même taille reliées par des flèches ; partie en cours dans une
   carte pleine largeur de la même famille, au-dessus du parcours ; sauvegarde locale annoncée sous l'introduction ;
   quatre outils sur une ligne dès 761 px, en 2 × 2 sur téléphone. */
body.home-mode{padding-bottom:0;background:#dfe8d8}
body.home-mode #pause-button,body.home-mode #restart{display:none}
.home-screen{min-height:calc(100dvh - 56px);padding:clamp(18px,3vw,36px) clamp(18px,4vw,46px) clamp(22px,3vw,36px);background:
 radial-gradient(circle at 83% 9%,#f1d29255 0 2px,transparent 3px),
 linear-gradient(135deg,#edf2e5 0 56%,#dce7d7 56% 100%)}
.home-shell{max-width:1260px;margin:0 auto}
.home-intro{margin-bottom:22px}
.home-intro h1{font-size:clamp(38px,4.6vw,58px);max-width:760px}
.home-intro>p{max-width:680px;margin:10px 0 0;color:#60756d;font-size:15px;line-height:1.55}
.home-intro>.save-note{display:flex;align-items:center;gap:10px;width:fit-content;max-width:100%;margin-top:14px;padding:8px 14px 8px 11px;border:1px solid #c4ceba;border-left:3px solid var(--navy);border-radius:6px;background:var(--paper);color:var(--navy);font-size:13px;line-height:1.45}
.save-note svg{flex:none;width:19px;height:19px;color:var(--orange)}
.save-note b{font-weight:800}
.save-card{display:grid;grid-template-columns:200px minmax(0,1fr) auto;align-items:center;column-gap:22px;margin:0 0 24px;padding-right:22px;overflow:hidden;border:2px solid #173449;border-radius:8px;background:#fbf7e7;box-shadow:0 6px 0 #b9c9ba}
.save-card[hidden]{display:none}
.save-visual{align-self:stretch;min-height:104px;border-right:2px solid #173449;background:#7cac78}
.save-visual canvas{display:block;width:100%;height:100%;object-fit:cover;image-rendering:pixelated}
.save-copy{display:grid;gap:2px;min-width:0;padding:14px 0}
.save-card small{color:#bd573b;font-size:9px;font-weight:800;letter-spacing:1.6px}
.save-card strong{font:800 27px/1.05 'Barlow Condensed',Impact,sans-serif;text-transform:uppercase}
.save-card span{color:#5f7369;font-size:12px;line-height:1.4}
.save-card #save-date{color:#7f9088;font-size:11px}
.save-card .primary{min-width:190px;min-height:48px;padding:12px 18px;font-size:13px;font-weight:800}
/* Bureau : deux missions par ligne ; l'ordre est porté par les numéros. */
.mission-select{position:relative;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 28px}
.mission-select::before,.mission-select::after{display:none}
.mission-card{display:flex;flex-direction:column;overflow:hidden;border:2px solid #173449;border-radius:8px;background:#fbf7e7;box-shadow:0 6px 0 #b9c9ba}
.mission-visual{position:relative;flex:none;aspect-ratio:16/9;overflow:hidden;background:#7cac78}
.mission-visual canvas{display:block;width:100%;height:100%;object-fit:cover;image-rendering:pixelated}
.mission-number,.mission-status{position:absolute;top:12px;z-index:1;padding:6px 9px;border:1px solid #fff4cf;background:#173449e8;color:#fff4cf;font-size:9px;font-weight:800;letter-spacing:1.2px}
.mission-number{left:12px;display:flex;align-items:center;gap:7px;padding:3px 11px 3px 3px;border-radius:999px}
.mission-number b{display:grid;place-items:center;width:20px;height:20px;border-radius:50%;background:var(--orange);color:#fff;font-size:11px;letter-spacing:0}
.mission-status{right:12px;background:#e7643f;color:white}
.mission-copy{flex:1;display:flex;flex-direction:column;min-width:0;padding:16px 18px 18px}
.mission-copy h2{margin:1px 0 7px;font:800 clamp(28px,2.5vw,36px)/1.02 'Barlow Condensed',Impact,sans-serif;text-transform:uppercase;overflow-wrap:break-word}
.mission-copy p{margin:0 0 12px;color:#65786e;font-size:13px;line-height:1.55}
.mission-copy>:nth-last-child(2){margin-bottom:18px}
.mission-copy>.primary,.mission-copy>.secondary{width:100%;min-height:46px;margin-top:auto;font-weight:800}
.mission-tags{display:flex;flex-wrap:wrap;gap:6px}
/* Entry path (docs/PHASER.md section 12): who can start with this mission. */
.mission-copy p.mission-entry{min-height:0;margin:-6px 0 12px;color:var(--navy);font-weight:700}
.mission-tags span{padding:5px 8px;border:1px solid #b7c6b4;border-radius:20px;background:#e5ebdb;color:#51685e;font-size:10px;font-weight:700}
.home-tools{margin-top:24px;padding-top:18px;border-top:1px solid #bdcab9}
.home-tools>div{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.home-tools button{width:100%;min-height:48px;padding:12px 10px;border:2px solid var(--navy);border-radius:5px;background:var(--orange);color:#fff;font-size:.875rem;font-weight:800;line-height:1.35;box-shadow:0 3px 0 var(--dark);white-space:normal;overflow-wrap:break-word}
.mission-setup{width:min(560px,94vw)}
.mission-setup .setup-options{margin:20px 0}
.mission-setup .primary{width:100%}
.mission-setup>small{display:block;margin-top:12px;color:#56685f;font-size:11px;text-align:center}

/* Tablette : une carte par ligne, aperçu à gauche, dans le même ordre. */
@media(max-width:1100px){
 .mission-select{grid-template-columns:1fr;gap:18px}
 .mission-select::before,.mission-select::after{display:none}
 .mission-card{display:grid;grid-template-columns:minmax(0,1fr) minmax(280px,.9fr)}
 .mission-visual{aspect-ratio:auto;min-height:230px}
 .mission-visual canvas{position:absolute;inset:0}
}
@media(max-width:820px){
 .home-screen{min-height:calc(100dvh - 68px);padding:20px 14px}
 .home-intro h1{font-size:42px}
}
@media(max-width:760px){.home-tools>div{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){
 /* Carte de reprise : même composition qu'au bureau (aperçu pleine hauteur à gauche, filet), bouton sous le texte. */
 .save-card{grid-template-columns:clamp(104px,30%,200px) minmax(0,1fr);column-gap:16px;padding-right:0}
 .save-visual{grid-row:1/span 2}
 .save-copy{padding:14px 16px 2px 0}
 .save-card .primary{grid-column:2;justify-self:start;min-width:0;margin:8px 16px 14px 0}
}
@media(max-width:560px){
 body.home-mode .topbar{height:56px}
 .home-screen{min-height:calc(100dvh - 56px);padding:16px 8px 24px}
 .home-intro{margin-bottom:16px}.home-intro h1{font-size:34px}.home-intro>p{font-size:13px}
 .home-intro>.save-note{align-items:flex-start;font-size:12px}
 .save-card{grid-template-columns:104px minmax(0,1fr);column-gap:12px;margin-bottom:16px}
 .save-copy{padding:10px 12px 2px 0}.save-card strong{font-size:20px;line-height:1.1;overflow-wrap:anywhere}
 .save-card .primary{justify-self:stretch;margin:6px 12px 12px 0;min-height:44px;padding:8px 12px}
 .mission-select{gap:14px}.mission-card{display:flex}.mission-visual{aspect-ratio:16/9;min-height:0}.mission-visual canvas{position:static}
 .mission-copy{padding:14px}.mission-copy h2{font-size:32px}.mission-copy p{font-size:12px}
 .mission-setup .setup-options{grid-template-columns:1fr}.mission-setup .setup-options select{min-height:44px;font-size:14px}
}


/* Private hot-seat handoff masks the complete HUD as well as the board. */
.handoff-pending .app,.handoff-pending #mobile-orders{visibility:hidden}
.rules-options{margin-top:16px}.rules-note{font-size:.875rem;line-height:1.5}

/* D2: concise coaching above the board, detailed references in scrollable dialogs. */
.tutorial-coach[hidden]{display:none}.tutorial-coach{display:flex;align-items:center;gap:12px;padding:12px 16px;margin:0 0 14px;border:2px solid #d6a447;border-radius:10px;background:#fff2ca;color:#20364b}.tutorial-coach>div{flex:1}.tutorial-coach strong{font-size:1rem}.tutorial-coach p{font-size:.9375rem;line-height:1.45;margin:6px 0 0}.tutorial-coach button{min-height:44px}
.training-card{background:#e9f1de}.training-topics,.howto-list{padding-left:24px;line-height:1.6}.howto-list li{margin:12px 0}.footer button{min-height:44px}.footer>div{display:flex;flex-wrap:wrap;gap:8px}
.encyclopedia label{display:block;margin:16px 0 6px}.encyclopedia select{width:100%;min-height:44px}.encyclopedia details{margin:16px 0}.encyclopedia summary{cursor:pointer;min-height:44px;font-weight:bold}.encyclopedia table{width:100%;border-collapse:collapse;text-align:left;font-size:.9375rem}.encyclopedia th,.encyclopedia td{padding:9px 6px;border-bottom:1px solid #bdc9bd}.encyclopedia p{line-height:1.5}.table-scroll{overflow:auto}
@media(max-width:600px){.tutorial-coach{flex-wrap:wrap;padding:10px}.tutorial-coach>div{flex-basis:100%}.tutorial-coach button{flex:1}.rules-options{grid-template-columns:1fr}.footer>div{display:flex;flex-wrap:wrap;justify-content:center}}
@media(max-width:760px){#game-screen .mission-header>div:first-child{min-width:0}#game-screen .mission-header h1{white-space:normal}#game-screen .mission-header .unit-counts{flex-shrink:0}}

/* The training card has its own preview and follows the mission card layout; compact text so both cards align. */
.training-card .mission-copy{min-width:0}
.training-card .mission-copy h2{line-height:1.05;overflow-wrap:break-word}
.training-card .mission-copy p{min-height:0;margin:0 0 10px}
.training-topics{margin:0;padding-left:1.4rem;font-size:14px;line-height:1.45;columns:2 150px;column-gap:18px}
.training-topics li{break-inside:avoid}
.training-topics li+li{margin-top:3px}
/* Combat log in the right column, under the end-turn button (the column's gap spaces it). Fold titles
   stay on one line; the last-action summary shrinks with an ellipsis. */
.sidebar .log-fold{margin:0}
@media(min-width:761px){.sidebar .log-fold .battle-log{max-height:min(40vh,320px)}}
.fold>summary{white-space:nowrap}
.fold>summary span{min-width:0}
/* Between phone and wide desktop the funds panel is narrow: funds and income on one row, army line below. */
@media(min-width:761px) and (max-width:1279px){
 #game-screen .economy-overview{grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-template-rows:auto auto;row-gap:5px}
 #game-screen .economy-overview>div:first-child,#game-screen .economy-overview>div:nth-child(2){grid-row:1}
 #game-screen .economy-overview .army-line{grid-column:1/-1;grid-row:2;flex-direction:row;flex-wrap:wrap;align-items:center;justify-content:space-between;column-gap:10px;row-gap:2px}
}

/* Classic polish: immediate touch response and a visible pressed state on game controls. */
button{touch-action:manipulation}
:is(.map-shell,.sidebar) #quick-actions button:active:not(:disabled),.mobile-orders button:active:not(:disabled),.end-turn:active:not(:disabled),.zoom button:active:not(:disabled){filter:brightness(.9);transform:translateY(1px)}
@media (prefers-reduced-motion:reduce){:is(.map-shell,.sidebar) #quick-actions button:active:not(:disabled),.mobile-orders button:active:not(:disabled),.end-turn:active:not(:disabled),.zoom button:active:not(:disabled){transform:none}}
/* Plateau Phaser (docs/PHASER.md, lot U1) : la caméra remplace le défilement et le zoom CSS du viewport. */
.map-viewport.phaser{position:relative;overflow:hidden;touch-action:none}
.board-phaser{position:absolute;inset:0;touch-action:none}.board-phaser canvas{display:block}
/* Écran de jeu (lot Q1, docs/PHASER.md section 13) : sur bureau (761 px et plus), plateau limité à la hauteur de
   l'écran (--board-h, calculé par fitLayout dans game.js) ; colonne de droite à la hauteur du plateau sans dépasser
   l'écran (--side-max), « Unités à jouer » et « Fin du tour » au-dessus d'un journal qui prend la place restante.
   Q2 (section 14) : mission, jour, fonds, revenus, effectifs et jauges passent dans la barre du haut (#top-hud) ;
   l'ancienne ligne d'en-tête disparaît et le plateau remonte. Téléphone : en-tête de mission et bandeau inchangés. */
.top-hud{display:none}
.next-unit kbd{font:inherit;font-size:11px;padding:1px 5px;border:1px solid currentColor;border-radius:3px;opacity:.75}
.power-track .power-ready,.power-track .power-label,.power-track .power-pct{display:none}
@media(min-width:761px){
 /* The viewport fills its column; only the camera fits the map's proportions. */
 #game-screen{padding:8px 0 0}
 #game-screen .tutorial-coach,#game-screen .game-layout{max-width:none;margin-left:0;margin-right:0}
 #game-screen .map-viewport{height:var(--board-h,max(280px,calc(100dvh - 160px)));aspect-ratio:auto}
 #game-screen .mission-header{display:none}
 #game-screen .field-hud{display:none}
 /* Consigne compacte : titre et texte dans le même paragraphe, pour rendre de la hauteur au plateau. */
 #game-screen .tutorial-coach{padding:6px 10px 6px 12px;margin-bottom:8px}
 #game-screen .tutorial-coach strong{font-size:14px}
 #game-screen .tutorial-coach strong::after{content:' ·';color:#b98a2e}
 #game-screen .tutorial-coach p{display:inline;margin:0 0 0 4px;font-size:13.5px;line-height:1.4}
 #game-screen .game-layout{grid-template-columns:minmax(0,1fr) clamp(270px,28vw,340px);align-items:start}
 #game-screen .board-section{align-self:start}
 #game-screen .sidebar{height:var(--side-max,auto);max-height:var(--side-max,none);min-height:0;display:flex;flex-direction:column;gap:8px}
 #game-screen .sidebar>.fold:not(.log-fold){flex:0 1 auto;min-height:0;overflow:auto}
 #game-screen .sidebar>.fold:not([open]){flex:none}
 #game-screen .sidebar .log-fold[open]{flex:1 1 0;min-height:96px;overflow:auto}
 #game-screen .sidebar .log-fold>summary{position:sticky;top:0;z-index:1}
 #game-screen .sidebar #battle-log{max-height:none}
 #game-screen .sidebar .end-turn{flex:none;padding:11px 16px}
 #game-screen .sidebar #end-note{min-height:0;margin:0}
 #game-screen .sidebar #end-note:empty{display:none}
 #game-screen .sidebar .next-unit{flex:none;display:flex;align-items:center;justify-content:center;gap:6px;width:100%;margin:0;font-size:13px}
 /* Plus de bandeau permanent sous la carte : le zoom est dans la colonne, sous « Fin du tour » (placeHud) ; la légende
    reste expliquée dans Comment jouer et le manuel. Le conteneur reste vide et sans hauteur. */
 #game-screen .board-bottom{display:none}
 /* Zoom sur toute la largeur de la colonne : − et + aux bords, « Vue entière » au centre, qui prend le reste. */
 #game-screen .sidebar .zoom{position:static;display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:6px;width:100%;margin:0;padding:0;line-height:1}
 #game-screen .sidebar .zoom button{width:100%;height:34px;min-height:34px}
 #game-screen .sidebar .zoom #zoomfit{padding:0 10px;font-size:13px;font-weight:700}
 /* Note de tour dans la plaque « Unités à jouer » (placeHud) : sous-texte sur sa propre ligne, sans cadre. */
 #game-screen .sidebar .next-unit{flex-wrap:wrap;row-gap:2px}
 #game-screen .sidebar .next-unit #end-note{flex-basis:100%;margin:0;color:inherit;font-size:11.5px;font-weight:500;line-height:1.3;letter-spacing:0;text-align:center;text-transform:none;white-space:normal;opacity:.85}
}
@media(min-width:761px) and (pointer:fine){
 #game-screen .tutorial-coach button{min-height:34px;padding:4px 12px}
 #game-screen .sidebar .fold>summary{min-height:38px;padding:6px 12px}
 #game-screen .sidebar .next-unit{min-height:40px;padding:5px 11px}
}
/* Effectifs sur téléphone : une pastille par camp, teintée de sa couleur (--own / --enemy, posées par game.js selon
   le camp qui regarde), avec un libellé court visible (« Alliés 7 · Ennemis 7 »), sur la ligne du titre. */
#game-screen .mission-header .unit-counts{display:flex;align-items:center;gap:6px}
#game-screen .mission-header .unit-counts>span{display:inline-flex;align-items:center;gap:5px;padding:2px 9px 2px 8px;border:1px solid color-mix(in srgb,var(--own,#ed663f) 50%,#c4ceba);border-radius:999px;background:color-mix(in srgb,var(--own,#ed663f) 13%,#fbf7e7);color:#345069;font-size:11px;font-weight:700;line-height:1.3;white-space:nowrap}
#game-screen .mission-header .unit-counts>.enemy-count{border-color:color-mix(in srgb,var(--enemy,#4086bd) 50%,#c4ceba);background:color-mix(in srgb,var(--enemy,#4086bd) 13%,#fbf7e7)}
#game-screen .mission-header .unit-counts b{font:800 15px/1 'Barlow Condensed',Impact,sans-serif;color:var(--navy)}
@media(max-width:760px){
 #game-screen .sidebar .next-unit{display:none}
 #game-screen .mission-header{flex-wrap:nowrap}
 #game-screen .mission-header .unit-counts{width:auto;flex-shrink:0;gap:5px}
 #game-screen .unit-counts .count-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
 #game-screen .mission-header .unit-counts>span{gap:4px;padding:1px 7px 1px 7px;font-size:10.5px}
 #game-screen .mission-header .unit-counts b{font-size:14px}
}
/* Barre du haut (harmonisation UI, docs/PHASER.md section 14). Accueil : 56 px, logo sur une ligne, boutons discrets
   sur le marine ; l'étiquette « Centre de commandement / Opération 01 » doublonnait le titre et disparaît.
   En jeu sur bureau : HUD stratégique sur deux lignes. Ligne principale : mission, jour, fonds, revenus, alliés,
   ennemis. Ligne secondaire, plus discrète, sous l'économie : Maya et Viktor (la jauge active le pouvoir). Le nombre
   de bâtiments passe dans l'infobulle des revenus. Téléphone inchangé. */
@media(min-width:761px){
 .topbar{height:56px;padding:0 28px;border-bottom-width:3px}
 .logo{gap:9px;font-size:25px;line-height:1}
 .logo-star{font-size:30px}
 .logo-front{display:inline;margin:0 0 0 .22em;font-size:inherit}
 .logo small{margin-left:6px;padding:5px 0 5px 14px;color:#b7c8c2;font-size:9.5px}
 .edition{display:none}
 .top-right{gap:6px}
 .top-right .icon-button{min-width:40px;height:40px;min-height:40px;border-color:#ffffff38;border-radius:6px;background:#ffffff12;font-size:17px}
 .top-right .icon-button:hover:not(:disabled){background:#ffffff24}
 .top-right .icon-button.active{border-color:var(--orange);background:var(--orange)}
 /* En jeu : groupes à espacement régulier (--hud-gap), séparés par un filet : identité, mission et jour, économie,
    camp allié et son commandant, camp ennemi et son commandant ; puis seulement l'espace libre avant les commandes. */
 body:not(.home-mode) .topbar{display:flex;align-items:center;height:auto;min-height:60px;padding:6px 22px;--hud-gap:clamp(22px,3.4vw,60px)}
 body:not(.home-mode) .logo{flex:none;gap:8px;font-size:22px}
 body:not(.home-mode) .logo-star{font-size:26px}
 body:not(.home-mode) .logo small{display:none}
 body:not(.home-mode) .top-hud{display:flex;align-items:center;gap:var(--hud-gap);min-width:0;margin-left:var(--hud-gap);color:#fff4d5}
 body:not(.home-mode) .top-right{flex:none;margin-left:auto;padding-left:var(--hud-gap)}
 .top-hud>*{position:relative;flex:none;min-width:0}
 .top-hud>*::before{content:'';position:absolute;left:calc(var(--hud-gap) / -2);top:3px;bottom:3px;width:1px;background:#ffffff26}
 /* Mission et jour : contexte, sur une ligne, sans dominer la barre. */
 .top-hud .mission-title{flex:0 1 auto;min-width:96px}
 .top-hud .mission-title .eyebrow{display:none}
 .top-hud h1{display:flex;align-items:baseline;gap:7px;min-width:0;font-size:18px;line-height:1.1;white-space:nowrap}
 .top-hud #mission-name{max-width:230px;overflow:hidden;text-overflow:ellipsis;color:#fff4d5}
 .top-hud .mission-day{flex:none;color:#b7c8c2;font-size:15px;font-weight:700}
 .top-hud .mission-day .day-long{display:none}
 .top-hud .mission-day .day-short{display:inline}
 .top-hud .mission-day .day-short::before{content:'· ';color:#7f98a6}
 /* Économie : fonds au-dessus, revenus en dessous. */
 .top-hud .economy-overview{display:grid;grid-template-columns:auto;grid-template-rows:auto;row-gap:3px;min-height:0;padding:0;border:0;background:transparent}
 /* Fonds et revenus nommés (retour de Ninewashburn : un nouveau joueur doit lire « Fonds 9 000 G · Revenus +3 000 G »). */
 .top-hud .economy-overview>div:not(.army-line){display:grid;grid-template-columns:58px auto;align-items:baseline}
 .top-hud .army-line{display:none}
 .top-hud .economy-overview small{display:block;color:#a9bcb8;font-size:9px;font-weight:700;letter-spacing:1.2px}
 .top-hud .economy-overview strong{font-size:18px;line-height:1.05;color:#fff4d5}
 .top-hud .economy-overview strong span{color:#b7c8c2;font:600 11px 'DM Sans',sans-serif}
 .top-hud .economy-overview .income{font-size:16px;color:#8dd8ad}
 .top-hud .economy-overview .income span{color:#8dd8ad}
 /* Camps : effectif en pastille, puis le commandant et sa jauge (le bouton qui active le pouvoir). */
 .top-hud .side-group{display:grid;justify-items:start;row-gap:4px;width:clamp(150px,11vw,180px)}
 .top-hud .side-group>span{display:inline-flex;align-items:center;gap:6px;padding:2px 10px 2px 8px;border:1px solid color-mix(in srgb,var(--own,#ed663f) 75%,#20364b);border-radius:999px;background:color-mix(in srgb,var(--own,#ed663f) 24%,#20364b);color:#fff4d5;font-size:12px;font-weight:700;line-height:1.35;white-space:nowrap}
 .top-hud .side-group>.enemy-count{border-color:color-mix(in srgb,var(--enemy,#4086bd) 75%,#20364b);background:color-mix(in srgb,var(--enemy,#4086bd) 24%,#20364b)}
 .top-hud .side-group>span::before{content:'';flex:none;width:8px;height:8px;border-radius:50%;background:var(--own,#ed663f)}
 .top-hud .side-group>.enemy-count::before{background:var(--enemy,#4086bd)}
 .top-hud .side-group b{font:800 16px/1 'Barlow Condensed',Impact,sans-serif;color:#fff}
 .top-hud .count-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
 /* Camp = nom du commandant et effectif sur une ligne, puis la jauge « Pouvoir » (retours de Ninewashburn) : la charge remplit
    le fond, libellé à gauche et pourcentage à droite à position fixe, texte crème ombré lisible de 0 à 100 %. Pleine,
    quel que soit le commandant : « ★ Pouvoir prêt · 100 % » ; activable, elle devient le bouton (corail plein). */
 .top-hud .side-group{position:relative;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:8px}
 .top-hud .side-group>span{grid-column:2;grid-row:1}
 .top-hud .power-track{position:relative;grid-column:1/-1;grid-row:2;display:flex;align-items:center;justify-self:stretch;width:100%;min-height:0;height:22px;margin:0;padding:0 8px;border-radius:5px;background:#ffffff10;box-shadow:inset 0 0 0 1px #ffffff2e;color:#fff4d5}
 .top-hud .power-track progress{position:absolute;inset:0;z-index:0;width:100%;height:100%;margin:0;border-radius:5px;overflow:hidden;background:transparent;box-shadow:none}
 .top-hud .power-track progress::-webkit-progress-bar{background:transparent}
 .top-hud .power-track.coral progress::-webkit-progress-value{background:#b84a2f}
 .top-hud .power-track.azure progress::-webkit-progress-value{background:#2f6c9c}
 .top-hud .power-track.coral progress::-moz-progress-bar{background:#b84a2f}
 .top-hud .power-track.azure progress::-moz-progress-bar{background:#2f6c9c}
 .top-hud .power-track>span{display:flex;align-items:baseline;gap:6px;width:100%;font-size:11.5px;font-weight:700;line-height:1;white-space:nowrap}
 .top-hud .power-track>span>*{position:relative;z-index:1;text-shadow:0 1px 1px #0b1a2699}
 /* Nom du commandant : au-dessus de la jauge, sur la ligne de la pastille, à gauche (même bouton, même clic). */
 .top-hud .power-track>span>span{position:absolute;left:0;bottom:calc(100% + 4px);height:22px;display:flex;align-items:center;font-size:13.5px;font-weight:800;color:#fff4d5;text-shadow:none}
 .top-hud .power-track>span b,.top-hud .power-track .power-activate,.top-hud .power-track .power-ready{display:none}
 .top-hud .power-track .power-label{display:inline;font-style:normal;font-weight:600;color:#d6e1dc}
 .top-hud .power-track .power-pct{display:inline;margin-left:auto;font-style:normal;font-weight:800;font-variant-numeric:tabular-nums}
 .top-hud .power-track.full .power-label{display:none}
 .top-hud .power-track.full .power-ready{display:inline;font-style:normal;font-weight:800}
 .top-hud .power-track.full .power-ready::before{content:'★ ';color:#ffe394}
 .top-hud .power-track.available{background:#ed663f;box-shadow:0 0 0 1px #ffd2bf,0 0 12px #ed663f99;color:#14293a;cursor:pointer}
 .top-hud .power-track.available:hover{background:#f47a55}
 .top-hud .power-track.available progress{display:none}
 .top-hud .power-track.available>span>:not(span){text-shadow:none;color:#14293a}
 .top-hud .power-track.available .power-ready::before{color:#fff4d5}
 /* Ready to activate: the vivid colour of the side, not of the commander (azure side = azure gauge). */
 .top-hud .power-track.azure.available{background:#5aa9e6;box-shadow:0 0 0 1px #cbe6fb,0 0 12px #5aa9e699}
 .top-hud .power-track.azure.available:hover{background:#6fb6ec}
 /* Mission without powers: the name stays on the pill row, the gauge row collapses. */
 .top-hud .power-track.no-power{height:0;padding:0;background:none;box-shadow:none}
 .top-hud .power-track.no-power progress,.top-hud .power-track.no-power .power-label,.top-hud .power-track.no-power .power-pct{display:none}
}
@media(min-width:761px) and (pointer:coarse){.top-right .icon-button{min-width:44px;height:44px;min-height:44px}body:not(.home-mode) .top-hud .power-track{height:26px}}
/* Bureau moyen : logo réduit à l'étoile ; tablette : « Pause » en icône, titre et jauges plus courts ; bureau étroit :
   plus de logo (le bouton ⌂ ramène à l'accueil). */
@media(min-width:761px) and (max-width:1320px){body:not(.home-mode) .logo>span:not(.logo-star){display:none}}
@media(min-width:761px) and (max-width:1040px){
 body:not(.home-mode) .topbar{padding:6px 14px;--hud-gap:18px}
 body:not(.home-mode) #pause-button span{display:none}
 .top-hud #mission-name{max-width:200px}
 .top-hud .side-group{width:140px}
 .top-right{gap:5px}
}
@media(min-width:761px) and (max-width:960px){.top-hud #mission-name{max-width:150px}}
@media(min-width:761px) and (max-width:860px){body:not(.home-mode) .topbar{--hud-gap:12px}.top-hud .side-group{width:140px}.top-hud .power-track{padding:0 6px}.top-hud .power-track>span{font-size:10.5px;gap:4px}.top-hud .power-track>span>span{font-size:12.5px}.top-hud #mission-name{max-width:140px}.top-hud .economy-overview small{display:none}.top-hud .economy-overview>div:not(.army-line){grid-template-columns:auto}}
@media(min-width:761px) and (max-width:860px){
 body:not(.home-mode) .topbar{padding:6px 10px;--hud-gap:14px}
 body:not(.home-mode) .logo{display:none}
 body:not(.home-mode) .top-hud{margin-left:0}
 .top-hud>:first-child::before{display:none}
 .top-hud #mission-name{max-width:125px}
 .top-right .icon-button{min-width:38px}
}
/* Manuel : fiche « Lire l'interface » sur toute la largeur, termes du HUD en deux colonnes. */
.manual-grid .manual-hud{grid-column:1/-1}
.hud-terms{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:8px 22px;margin:8px 0 0}
.hud-terms>div{padding:8px 10px;border-left:3px solid var(--orange);background:#e4ebd5;border-radius:0 4px 4px 0}
.hud-terms dt{font-weight:800;font-size:13px;color:var(--navy)}
.hud-terms dd{margin:2px 0 0;font-size:12.5px;line-height:1.5;color:#596d63}

/* Détails d'une carte de recrutement : le bouton (i) de la carte les ouvre par-dessus cette carte (pas de panneau séparé,
   rien à faire défiler sur téléphone), à la souris, au clavier et au toucher (un appui sur la carte recrute). */
/* Fonds : estimation après achat sur sa propre ligne, toujours réservée (les cartes ne bougent jamais). */
#production-funds .funds-after{display:block;height:1.6em;line-height:1.6em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:700;color:var(--navy)}
#production-funds .funds-after.short{color:#b0482f}
/* Carte de recrutement : un groupe. Le nom est le bouton d'achat, étendu à toute la carte par ::after ; le bouton (i)
   suit le nom sur la même ligne, au-dessus de cette zone, avec une cible de 28 px : il n'achète jamais. */
/* Cartes de recrutement (brief recrutement, 8 octobre) : grille stable aperçu | texte | coût ; le nom (bouton d'achat
   étendu à toute la carte) passe à la ligne sans pousser le coût ni le (i) ; une seule marque de focus. */
.production-modal #shop .shop-card{position:relative;display:grid;grid-template-columns:56px minmax(0,1fr) auto;grid-template-areas:'img name price' 'img stats stats' 'img reason reason';grid-template-rows:max-content max-content max-content;align-content:start;align-items:center;column-gap:10px;row-gap:2px;min-height:70px;padding:8px 12px 8px 8px;box-sizing:border-box;background:linear-gradient(#f4ecd8,#e9e0c7);border:1px solid #c7bb9c;border-radius:6px;box-shadow:inset 0 1px 0 #fffaf0;text-align:left;transition:background .12s,border-color .12s}
.production-modal #shop .shop-card:hover:not(.disabled){background:linear-gradient(#fbf4e4,#efe6cf);border-color:#a8977a}
.production-modal #shop .shop-card:active:not(.disabled){background:#e3d8bc}
.production-modal #shop .shop-card>canvas{grid-area:img;width:56px;height:42px;align-self:center}
.production-modal #shop .shop-card>div:not(.recruit-info){display:contents}
.production-modal #shop .shop-card>div:not(.recruit-info)>p{grid-area:name;display:flex;align-items:flex-start;gap:6px;min-width:0;margin:0}
.production-modal #shop .shop-buy{display:inline;min-width:0;flex:1;min-height:0;padding:0;border:0;background:none;color:var(--navy);font-size:15px;font-weight:700;line-height:1.25;text-align:left;white-space:normal;overflow-wrap:anywhere;cursor:pointer;opacity:1}
.production-modal #shop .shop-buy,.production-modal #shop .shop-buy:hover,.production-modal #shop .shop-buy:active{filter:none;transform:none} /* un filtre ou une transformation rétrécirait la zone d'achat au seul nom */
.production-modal #shop .shop-buy::after{content:'';position:absolute;inset:0;border-radius:6px}
.production-modal #shop .shop-buy:disabled{cursor:default}
 .production-modal #shop .shop-card>div:not(.recruit-info)>small{min-width:0;overflow-wrap:anywhere;white-space:normal}
.production-modal #shop .shop-card>div:not(.recruit-info)>small:first-of-type{grid-area:stats;font-size:12px;color:#5d6e66}
/* Statistiques (premier small), puis raison d'indisponibilité (second small) : lisible, jamais estompée ; mission (interdit) en brique, fonds en ambre, autre en ardoise. */
.production-modal #shop .shop-card>div:not(.recruit-info)>small+small{grid-area:reason;align-self:start;display:block;font-size:12px;font-weight:700;line-height:1.3;color:#5a6a72}
.production-modal #shop .shop-card[data-reason="mission"]>div:not(.recruit-info)>small+small{color:#a3402a}
.production-modal #shop .shop-card[data-reason="funds"]>div:not(.recruit-info)>small+small{color:#8a5a12}
.production-modal #shop .shop-card.disabled{background:#e8e3d6;border-style:dashed}
.production-modal #shop .shop-card.disabled>canvas{opacity:.5;filter:grayscale(.5)}
.production-modal #shop .shop-card.disabled .shop-buy,.production-modal #shop .shop-card.disabled>b{color:#6f7a76}
.production-modal #shop .shop-card[data-reason="mission"]>b{text-decoration:line-through;text-decoration-thickness:1px}
.production-modal #shop .shop-card>b{grid-area:price;align-self:start;margin:2px 0 0;padding:2px 8px;border-radius:999px;background:#fff6e0;border:1px solid #e0c99a;white-space:nowrap;font-size:14px;font-variant-numeric:tabular-nums;color:#9a5a32}
.production-modal #shop .shop-card.disabled>b{background:transparent;border-color:#cfc7b4}
.production-modal #shop .shop-info{position:relative;z-index:2;flex:none;display:inline-flex;align-items:center;justify-content:center;width:26px;min-width:26px;height:26px;min-height:26px;margin-top:-2px;padding:0;border:1.5px solid #8fa293;border-radius:50%;background:var(--paper);color:var(--navy);font:700 italic 14px Georgia,serif;line-height:1}
.production-modal #shop .shop-info:hover{background:#fff}
.production-modal #shop .shop-info[aria-pressed="true"]{border-color:var(--navy);background:#fff2c9}
/* Focus : une seule marque. Achat (clavier ou manette) = contour orange de la carte entière, rien autour du nom ;
   Informations = anneau orange autour du (i) seul, la carte n'est pas marquée. Outline : aucune dimension ne change. */
.production-modal #shop .shop-buy:focus,.production-modal #shop .shop-buy:focus-visible,body .production-modal #shop .shop-buy.gamepad-focus{outline:none!important;box-shadow:none!important}
.production-modal #shop .shop-card:has(.shop-buy:focus-visible),.production-modal #shop .shop-card:has(.shop-buy.gamepad-focus){outline:3px solid #ffb354;outline-offset:2px}
.production-modal #shop .shop-info:focus{outline:none}
.production-modal #shop .shop-info:focus-visible,body .production-modal #shop .shop-info.gamepad-focus{outline:3px solid #ffb354!important;outline-offset:2px!important;box-shadow:none!important}
.recruit-info{position:absolute;z-index:10;top:calc(100% + 4px);left:0;right:0;display:flex;align-items:center;gap:12px;box-sizing:border-box;padding:10px 12px;border:2px solid var(--navy);border-radius:6px;background:#20364bf7;color:var(--paper);box-shadow:0 8px 18px #0005}
.recruit-info[hidden]{display:none}
/* La carte ouverte passe devant ses voisines (un survol avec filtre en ferait sinon un contexte d'empilement isolé). */
.production-modal #shop .shop-card:has(.recruit-info){z-index:10}
.recruit-info.up{top:auto;bottom:calc(100% + 4px)}
.recruit-info>div{flex:1;min-width:0}
.recruit-info b{display:block;margin-bottom:3px;font:800 18px 'Barlow Condensed',Impact,sans-serif;letter-spacing:.04em}
.recruit-info span{display:block;font-size:13px;line-height:1.4}
.recruit-info small{display:block;margin-top:4px;font-size:12px;color:#d8e2d0}
.recruit-info .range-diagram .self{fill:#fff2c9}
.recruit-info .range-diagram .dead{fill:#ffffff40}
/* Finition « table de commandement » du recrutement (brief Demo) : parchemin conservé, contours, titres, prix et
   fermeture aux couleurs du HUD (bleu nuit, acier, rouille). Couleurs et bordures seulement : la grille, les tailles
   et le comportement tactile ne changent pas. Trois états lisibles d'un coup d'œil, par un liseré à gauche, le
   badge de prix et le fond : achetable, fonds insuffisants (ambre), indisponible dans la mission (brique, hachures). */
.production-modal{border:2px solid #26313a;border-top:4px solid #c4552a;border-radius:8px;background:linear-gradient(#f6eedb,#ece0c3);box-shadow:inset 0 0 0 1px #d6c49c,0 18px 44px rgba(8,12,16,.55);scrollbar-color:#8c7350 transparent;scrollbar-width:thin}
.production-modal::-webkit-scrollbar{width:8px}
.production-modal::-webkit-scrollbar-thumb{background:#8c7350;border-radius:4px}
.production-modal .eyebrow{color:#b4461c;font-weight:800;letter-spacing:.18em}
.production-modal h2{color:#1d2a35;letter-spacing:.01em}
.production-modal #production-funds{color:#4e5d66}
.production-modal .close-modal{display:inline-grid;place-items:center;width:40px;height:40px;min-height:40px;padding:0;border:1px solid #4a5966;border-radius:5px;background:linear-gradient(#2b3742,#1a232b);color:#f2e2bb;font-size:16px;line-height:1;box-shadow:inset 0 1px 0 #3c4a56,0 2px 0 #0b0f12}
@media(hover:hover){.production-modal .close-modal:hover{border-color:#e8b041;color:#fff}}
.production-modal .close-modal:focus-visible{outline:3px solid #ffb354;outline-offset:2px}
.production-modal #shop .shop-card{border-color:#b9a77f;border-left:4px solid #26313a;background:linear-gradient(#f9f2e1,#ede2c7);box-shadow:inset 0 1px 0 #fffaf0,0 1px 0 rgba(38,49,58,.12)}
@media(hover:hover){.production-modal #shop .shop-card:hover:not(.disabled){background:linear-gradient(#fdf7ea,#f1e7cf);border-color:#26313a}}
.production-modal #shop .shop-buy{color:#1d2a35}
.production-modal #shop .shop-card>b{min-width:5.6em;box-sizing:border-box;text-align:center;background:#1f2a33;border-color:#0f161c;color:#ffd58a;box-shadow:inset 0 1px 0 #34424e}
.production-modal #shop .shop-info{border-color:#5a6a72;background:#fbf5e6;color:#1d2a35}
.production-modal #shop .shop-card.disabled{border-style:solid;border-color:#c9b48c}
.production-modal #shop .shop-card.disabled .shop-buy{color:#47525a}
.production-modal #shop .shop-card[data-reason="funds"]{border-left-color:#c98a1e;background:#efe6d2}
.production-modal #shop .shop-card[data-reason="funds"]>b{background:#fbf1dc;border-color:#c98a1e;color:#8a5a12;box-shadow:none}
.production-modal #shop .shop-card:is([data-reason="mission"],[data-reason="other"]){border-color:#b3a68a;border-style:dashed;border-left:4px solid #a3402a;background:repeating-linear-gradient(135deg,#e7e0d0 0 8px,#e0d8c6 8px 16px)}
.production-modal #shop .shop-card:is([data-reason="mission"],[data-reason="other"])>canvas{opacity:.45;filter:grayscale(1)}
.production-modal #shop .shop-card:is([data-reason="mission"],[data-reason="other"])>b{background:transparent;border-color:#b3a68a;color:#6b6457;box-shadow:none}
.range-diagram{display:block;flex:none}
.range-diagram .self{fill:#20364b}
.range-diagram .dead{fill:#c3cdb8}
.range-diagram .ring{fill:#ed663f}
/* Encyclopédie : schéma de portée des armes indirectes sous l'illustration de l'unité. */
.encyclopedia-visual{display:flex;flex-direction:column;align-items:center;gap:10px;flex:none}
#encyclopedia-range:empty{display:none}
/* Comment jouer : retour et entraînement côte à côte ; empilés sur petit écran, l'entraînement en premier. */
.howto-buttons .primary{width:auto;flex:2}
@media(max-width:480px){.howto-buttons{flex-direction:column-reverse}}

/* Liens GitHub (profil de l'auteur ; le dépôt reste privé) : discrets, jamais confondus avec une commande de jeu.
   Topbar d'accueil seulement (jamais en jeu, pour ne pas gêner le HUD) ; pied de page de jeu, sur la même ligne que
   « PIXEL TACTICS / ÉDITION JOUABLE ». Sur téléphone : icône seule. */
.github-link{display:inline-flex;align-items:center;justify-content:center;gap:6px;margin-left:10px;padding:0 10px;text-decoration:none;color:#eaf0df;font-size:12px;font-weight:700;letter-spacing:.06em}
.github-link .github-mark{flex:none}
body:not(.home-mode) .github-link{display:none}
.footer-right{display:flex;align-items:center;gap:16px}
.footer-link{display:inline-flex;align-items:center;gap:6px;min-height:44px;color:#526f67;text-decoration:none;font-size:11px;letter-spacing:1px}
.footer-link:hover{color:var(--navy);text-decoration:underline}
@media(max-width:760px){.github-link{margin-left:6px;padding:0;min-width:38px}.github-link span{display:none}.footer-right{justify-content:center}}

/* Pastille au bout de la flèche d'une unité à tir indirect : « Prochain tour : 3 cibles » (game.js placeCoverChip). */
.cover-chip{position:absolute;z-index:3;padding:4px 9px;border:1.5px solid #f0a53a;border-radius:999px;background:#20364bee;color:#fff2c9;font:700 12px/1.2 'DM Sans',system-ui,sans-serif;white-space:nowrap;pointer-events:none;box-shadow:0 2px 6px #0005}
.cover-chip[hidden]{display:none}
/* École : explication unique du tir indirect sous le texte de l'étape. */
.tutorial-tip{margin:6px 0 0;padding:6px 9px;border-left:3px solid #f0a53a;background:#fff4dc;color:#4a3a1c;font-size:13px;line-height:1.45}
.tutorial-tip[hidden]{display:none}
#game-screen .tutorial-coach .tutorial-tip:not([hidden]){display:block;margin:6px 0 0}

/* The header is full on phones: keep the canonical day in a small adjacent, sticky status row. */
.game-day{position:sticky;top:0;z-index:12;display:flex;align-items:center;justify-content:center;gap:6px;min-height:24px;padding:2px 10px;background:var(--navy);color:var(--paper);font-size:13px;line-height:20px;white-space:nowrap}
.game-day[hidden]{display:none}
.game-day strong{font-variant-numeric:tabular-nums}

/* États du hub (souris, clavier, manette) : le survol soulève la carte, le focus clavier/manette l'entoure d'orange,
   distinct du survol. */
.mission-card{transition:transform .12s ease,box-shadow .12s ease}
:is(.mission-copy,.save-card,.home-tools) :is(.primary,button):focus-visible{outline:3px solid var(--navy);outline-offset:2px;box-shadow:0 0 0 6px #ef7a3566}
:is(.mission-copy,.save-card,.home-tools) :is(.primary,button):hover:not(:disabled){filter:brightness(1.07)}
:is(.mission-copy,.save-card,.home-tools) :is(.primary,button):active:not(:disabled){transform:translateY(2px);box-shadow:0 1px 0 var(--dark)}
:is(.mission-copy,.save-card,.home-tools) :is(.primary,button):disabled{filter:grayscale(.7);opacity:.75;cursor:not-allowed}
@media(prefers-reduced-motion:reduce){.mission-card,.mission-card:hover{transition:none;transform:none}:is(.mission-copy,.save-card,.home-tools) :is(.primary,button):active{transform:none}}
/* L'accueil garde la description et les huit thèmes visibles sur toutes les tailles d'écran. */
/* Mobile: four items per column, preserving the native 1–8 reading order. */
@media(max-width:560px){
 .training-topics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(4,auto);grid-auto-flow:column;columns:auto;column-gap:24px;row-gap:6px}
 .training-topics li{min-width:0;overflow-wrap:anywhere}
 .training-topics li+li{margin-top:0}
}

/* Finitions accueil / recrutement : aucun sélecteur du HUD ou du plateau. */
.home-screen .save-card #save-date{color:#53695e}
.home-screen .mission-status{background:#a64327}
.home-screen :is(.mission-copy,.save-card,.home-tools) :is(.primary,button){background:#b94727}
.production-modal:has(#shop>.shop-card:only-child){width:min(440px,calc(100vw - 24px))}
.production-modal #shop:has(>.shop-card:only-child){grid-template-columns:minmax(0,1fr)}
/* Seule la liste défile : titre, fonds et fermeture restent accessibles sans recouvrir les cartes. */
.production-modal[open]{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto auto minmax(0,1fr) auto;overflow:hidden}
.production-modal .close-modal{grid-column:2;grid-row:1/span 2;align-self:start;float:none;width:44px;height:44px;min-height:44px}
.production-modal>.eyebrow{grid-column:1;grid-row:1}
.production-modal>h2{grid-column:1;grid-row:2;padding-right:10px}
.production-modal>#production-funds{grid-column:1/-1;grid-row:3}
.production-modal>#shop{grid-column:1/-1;grid-row:4;min-height:0;overflow:auto;align-content:start;padding:5px 6px;scroll-padding:6px;scrollbar-width:thin}
.production-modal #shop .shop-card{height:auto;align-self:stretch}
.production-modal>.production-note{grid-column:1/-1;grid-row:5}
/* Les détails font partie de la carte et restent parcourables même dans une fenêtre basse. */
.production-modal #shop .recruit-info{position:static;grid-column:1/-1;grid-row:4;margin-top:6px}
#production-funds .funds-after{height:auto;min-height:1.6em;white-space:normal;overflow:visible;overflow-wrap:anywhere}
@media(max-width:760px),(pointer:coarse){
 .production-modal #shop .shop-card{grid-template-columns:48px minmax(0,1fr) auto;grid-template-areas:'img name info' 'img stats price' 'reason reason reason'}
 .production-modal #shop .shop-card>canvas{width:48px}
 .production-modal #shop .shop-card>div:not(.recruit-info)>p{display:contents}
 .production-modal #shop .shop-buy{grid-area:name}
 .production-modal #shop .shop-info{grid-area:info;justify-self:end}
 .production-modal #shop .shop-info{width:44px;min-width:44px;height:44px;min-height:44px;margin-top:0}
 #production-funds .funds-after{min-height:3.2em}
}


/* Controller focus uses the existing orange focus accent, including an unavailable recruit's info button. */
.gamepad-focus{outline:3px solid #ffb354!important;outline-offset:2px!important}
/* Téléphone : le jour est une pastille de la ligne des effectifs (placeHud, game.js), plus une barre à part. */
#game-screen .mission-header .unit-counts>.game-day{position:static;display:inline-flex;min-height:0;gap:4px;padding:1px 7px;border:1px solid #9aa9a0;border-radius:999px;background:var(--navy);color:var(--paper);font-size:10.5px;font-weight:700;line-height:1.3}
#game-screen .mission-header .unit-counts>.game-day[hidden]{display:none}
#game-screen .mission-header .unit-counts>.game-day strong{font:800 14px/1 'Barlow Condensed',Impact,sans-serif;color:inherit}
/* Panneau Commandant, Illustré : le buste (toile 4:3) se pose sur le bandeau de citation, comme sur les bannières.
   Grille : buste à gauche (hauteur de la zone au-dessus du bandeau, largeur déduite, sans déformation), libellés
   centrés dans l'espace restant, à distance du buste et du bord ; bandeau sur toute la largeur. Rien ne se touche,
   quelle que soit la largeur de la colonne. */
.commander:has(.commander-art.bust){display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto}
.commander-art.bust{position:relative;inset:auto;grid-column:1;grid-row:1;align-self:stretch;width:auto;height:auto;min-height:0;aspect-ratio:4/3;margin:6px 0 0;background:none}
.commander-art.bust canvas{display:block;width:100%;height:100%}
.commander:has(.commander-art.bust) .commander-label{position:static;grid-column:2;grid-row:1;display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:0;padding:6px 14px 4px 10px;text-align:center}
.commander:has(.commander-art.bust) .commander-label>*{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.commander:has(.commander-art.bust) .commander-label h2{margin:3px 0 4px}
.commander:has(.commander-art.bust) .commander-quote{position:static;grid-column:1/-1;grid-row:2}


/* Connected-controller help stays visible beside the battlefield, in either HUD layout. */
.gamepad-panel{display:block;width:100%;min-height:36px;padding:7px 12px;background:#20364b;color:#fff4d5;border-top:1px solid #627582;font-size:12px;text-align:center}
.gamepad-panel[hidden]{display:none}
.gamepad-panel:focus-visible{outline:3px solid #ffb354;outline-offset:-3px}

/* Mobile battle: mission in the existing topbar, day and armies above the map. */
@media(max-width:760px){
 body:not(.home-mode) .topbar{gap:8px}
 body:not(.home-mode) .topbar>.mission-title{flex:1;min-width:0;overflow:hidden}
 body:not(.home-mode) .topbar>.mission-title .eyebrow{display:none}
 body:not(.home-mode) .topbar>.mission-title h1{margin:0;font:700 clamp(14px,4vw,18px)/1.05 'Barlow Condensed','Oswald',Impact,sans-serif;color:#fff;text-transform:uppercase}
 body:not(.home-mode) .topbar #mission-name{color:#fff;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;white-space:normal}
 body:not(.home-mode) .topbar>.top-right{flex:none;margin-left:auto}
 #game-screen .mission-header{align-items:center;justify-content:space-between;gap:12px;min-height:24px}
 #game-screen .mission-header>.game-day{position:static;flex:none;min-height:0;gap:4px;padding:1px 9px;border:1px solid #9aa9a0;border-radius:999px;background:var(--navy);color:var(--paper);font-size:11px;font-weight:700;line-height:1.3}
 #game-screen .mission-header>.game-day strong{font:800 14px/1 'Barlow Condensed',Impact,sans-serif}
 #game-screen .mission-header .unit-counts{gap:12px;margin-left:auto}
 #game-screen>.footer{display:none}
}

.confirm-preview-choice{display:grid;gap:0;margin:12px 0 0}
.confirm-preview-choice small{font-size:11px;color:#56685f}

/* Talents de commandant (docs/TALENTS.md) : panneau Commandant et fenêtre de choix. */
.commander-talents{padding:10px 12px 12px;border-top:1px solid #c4ceba;font-size:13px;color:#173449}
.commander-talents ul{display:flex;flex-wrap:wrap;gap:5px;margin:6px 0;padding:0;list-style:none}
.commander-talents li{padding:3px 8px;border-radius:999px;background:#e6efe0;border:1px solid #b9c9ae;font-weight:600;font-size:12px}
.commander-talents li.muted{background:none;border-color:transparent;padding-left:0;font-weight:400;color:#56685f}
.commander-talents p{margin:0;color:#4d6158;font-size:12px}
.commander-talents button{margin-top:8px;width:100%;min-height:40px}
.talent-pick{width:min(640px,94vw)}
.talent-pick h2{margin:4px 0 6px}
.talent-offers{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:16px 0}
.talent-card{display:flex;flex-direction:column;align-items:flex-start;gap:6px;text-align:left;padding:14px;min-height:132px;border:2px solid var(--navy);border-radius:8px;background:#fffdf4;color:var(--navy);cursor:pointer;font:inherit}
.talent-card small{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:#7a6a3c}
.talent-card b{font-family:var(--font-heading);font-size:21px;line-height:1.05}
.talent-card span{font-size:13px;line-height:1.35;color:#3e5260}
.talent-card:hover,.talent-card:focus-visible{background:#fff3cf;border-color:var(--orange);outline:none}
.talent-pick>.secondary{width:100%}
@media(max-width:620px){.talent-offers{grid-template-columns:1fr}.talent-card{min-height:0}}
@media(prefers-reduced-motion:no-preference){.talent-card{transition:background .15s,border-color .15s}}

/* Cycle jour/nuit (docs/JOUR_NUIT.md) : phase sous ou à côté du jour ; prochaine phase en info-bulle. */
.day-phase{font-size:.78em;font-weight:700;letter-spacing:.03em;text-transform:uppercase;opacity:.9}
.day-phase[hidden]{display:none}
.day-phase[data-phase=night]{color:#a9c4ff}.day-phase[data-phase=dusk]{color:#ffb27a}.day-phase[data-phase=dawn]{color:#ffc4d2}

/* Skirmish commanders: team colours stay attached to slots, including mirror matches. */
.setup-commanders{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}
.setup-commanders[hidden]{display:none}
.setup-commander-card{display:grid;grid-template-columns:56px minmax(0,1fr);gap:8px;align-items:center;padding:10px;border:1px solid var(--line);border-top:4px solid var(--orange);border-radius:6px;background:var(--paper)}
.setup-commander-card[data-team="1"]{border-top-color:var(--blue)}
.setup-commander-card canvas{width:56px;height:56px;image-rendering:pixelated}
.setup-commander-card label{display:block;font-size:12px;font-weight:700;margin-bottom:5px}
/* Shared native selects: keep touch/keyboard behaviour, reserve a real space for the chevron. */
.mission-setup :is(.setup-options,.setup-commander-card) select{appearance:none;width:100%;min-width:0;min-height:44px;border:2px solid #22385a;border-radius:12px;background-color:#efe3c4;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10' viewBox='0 0 14 10'%3E%3Cpath d='m2 2 5 5 5-5' fill='none' stroke='%2320364b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 13px center;background-size:14px 10px;color:#22385a;padding:9px 40px 9px 12px;font-size:15px;font-weight:700;line-height:1.3}
.mission-setup :is(.setup-options,.setup-commander-card) select:disabled{opacity:.65;cursor:not-allowed}
@media(forced-colors:active){.mission-setup :is(.setup-options,.setup-commander-card) select{appearance:auto;background-image:none}}
.setup-commander-card p{grid-column:1/-1;margin:0;font-size:12px;line-height:1.45}
@media(max-width:480px){.setup-commanders{grid-template-columns:1fr}.setup-commander-card{grid-template-columns:48px minmax(0,1fr)}.setup-commander-card canvas{width:48px;height:48px}}

/* Tactical information belongs to the combat journal, outside the board. */
.modal p,.modal dd,.tutorial-coach p,#selected-description,.recruit-info span,.recruit-info small{white-space:pre-line;line-height:1.55}
.manual-grid p{max-width:70ch}
/* Bandeau de tour (25 novembre 2026, lot « plus vivant ») : une carte aux couleurs du camp, portrait du commandant et
   « JOUR 5 » en grand, qui entre en biais par la gauche, se pose au centre du plateau puis sort par la droite (1,6 s).
   Il ne capte aucun clic. Sur téléphone, plus compact ; en mouvement réduit, un simple fondu. */
#phase-banner.phase-banner{z-index:30;left:50%;right:auto;top:40%;display:flex;align-items:center;gap:14px;width:max-content;max-width:calc(100% - 24px);box-sizing:border-box;padding:10px 28px 10px 10px;border:2px solid #22385a;border-radius:14px;background:linear-gradient(100deg,var(--phase-side,#c34b32) 0 70%,var(--phase-side-dark,#7e3420));color:#fff8e8;text-align:left;box-shadow:0 6px 0 #22385a,0 20px 44px #0b162466;overflow:hidden;transform:translate(-50%,-50%)}
#phase-banner.phase-banner::before{content:'';position:absolute;left:0;right:0;top:0;height:6px;background:repeating-linear-gradient(135deg,#22385a 0 12px,#fff8e8 12px 24px);opacity:.55}
#phase-banner.run{animation:phase-sweep 1.6s cubic-bezier(.2,.8,.2,1) both}
@keyframes phase-sweep{0%{opacity:0;transform:translate(-140%,-50%) skewX(-10deg)}16%{opacity:1;transform:translate(-50%,-50%) skewX(0)}80%{opacity:1;transform:translate(-50%,-50%) skewX(0)}100%{opacity:0;transform:translate(40%,-50%) skewX(8deg)}}
.phase-face{flex:none;width:64px;height:64px;border:2px solid #fff8e8;border-radius:10px;background:#22385a}
.phase-words{display:flex;flex-direction:column;gap:3px;min-width:0}
.phase-words b{font:800 42px/.92 var(--font-heading,'Barlow Condensed',sans-serif);letter-spacing:.02em;white-space:nowrap}
.phase-words small{font:700 13px/1.2 var(--font-ui,'DM Sans',sans-serif);letter-spacing:.12em;text-transform:uppercase;white-space:nowrap;opacity:.95}
@media(max-width:760px){#phase-banner.phase-banner{gap:10px;padding:8px 18px 8px 8px;top:34%}.phase-face{width:46px;height:46px}.phase-words b{font-size:30px}.phase-words small{font-size:11px}}
@media(prefers-reduced-motion:reduce){#phase-banner.run{animation:phase-fade .7s both}}
@keyframes phase-fade{0%,100%{opacity:0}20%,80%{opacity:1}}
/* Les fonds sautent quand les revenus du tour tombent (game.js incomeFloats). */
#funds.bump{display:inline-block;animation:funds-bump .7s .35s cubic-bezier(.3,1.6,.5,1) both}
@keyframes funds-bump{0%{transform:scale(1)}35%{transform:scale(1.28);color:#e8a317}100%{transform:scale(1)}}
@media(prefers-reduced-motion:reduce){#funds.bump{animation:none}}

.home-screen p,.home-screen [data-i18n$=".desc"],.home-screen [data-i18n$=".text"],.home-screen [data-i18n$=".intro"]{white-space:pre-line}

/* Notices share the journal. Their height cannot move a tactical cell. */
#game-screen .log-fold .notice-slot{position:relative;height:auto;margin:0;padding:10px 12px;border-bottom:1px solid #bca679;background:#f4eedb;color:#20364b}
#game-screen .log-fold .notice-slot[hidden]{display:none}
#game-screen .log-fold .notice-slot>#toast{position:static;inset:auto;transform:none;box-sizing:border-box;width:100%;max-width:none;min-height:32px;height:auto;margin:0;padding:0 40px 0 0;border:0;background:transparent;color:inherit;box-shadow:none;font-size:13px;line-height:1.5;white-space:pre-line;overflow:visible;opacity:1;pointer-events:auto;transition:none}
#game-screen .log-fold .notice-slot>#toast[hidden]{display:none}
#notice-details{position:absolute;right:8px;top:8px;display:grid;place-items:center;width:32px;min-height:32px;height:32px;padding:0;border:1px solid #bca679;border-radius:3px;background:#e8ddbf;color:#20364b;font-size:20px}
#notice-details span{display:grid;place-items:center;width:18px;height:18px;border:1.5px solid currentColor;border-radius:50%;font:bold 13px/1 serif}
#notice-details[hidden]{display:none}
#notice-text{white-space:pre-line}
#game-screen .tutorial-coach{box-sizing:border-box;height:96px;overflow:auto;flex-wrap:nowrap}
#game-screen .tutorial-coach>div{min-width:0}
#game-screen .tutorial-coach strong{display:block}
#game-screen .tutorial-coach strong::after{content:none}
#game-screen .tutorial-coach #tutorial-text{display:block;margin:5px 0 0;line-height:1.5;max-height:4.5em;overflow:auto}
#game-screen .tutorial-coach button{flex-shrink:0}
/* One stable toolbar: zoom normally, commands when they need the map clear. */
.action-shelf{position:relative;height:52px;padding:4px 6px;background:#20364b}
.action-shelf .zoom{position:static;display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:6px;width:100%;height:44px;margin:0;line-height:1}
.action-shelf .zoom button{width:100%;height:44px;min-height:44px;border:1px solid #627582;border-radius:3px;background:#334d60;color:#fff4d5}
.action-shelf .zoom #zoomfit{font-size:13px;font-weight:700}
.board-section:has(#quick-actions.docked:not(:empty)) .action-shelf .zoom{visibility:hidden}
@media(min-width:761px){#game-screen .board-section{overflow:visible}}
:is(.map-shell,.sidebar) #quick-actions.docked{position:absolute;top:100%!important;bottom:auto;left:0!important;right:0;box-sizing:border-box;width:100%;max-width:none;height:52px;max-height:52px;margin:0;padding:2px;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;justify-content:flex-start}
:is(.map-shell,.sidebar) #quick-actions.docked::-webkit-scrollbar{display:none}
:is(.map-shell,.sidebar) #quick-actions.docked button{flex:0 0 auto;width:auto;min-width:100px;white-space:nowrap;min-height:44px;padding:6px 10px}
@media(max-width:760px){
 #game-screen .log-fold .notice-slot>#toast{min-height:44px;padding-right:48px}
 #notice-details{width:44px;min-height:44px;height:44px}
 #game-screen .tutorial-coach{height:144px;flex-wrap:wrap;gap:8px}
 #game-screen .tutorial-coach>div{flex-basis:100%}
 #game-screen .tutorial-coach #tutorial-text{height:3em;max-height:3em;font-size:13px}
 #game-screen .tutorial-coach button{flex:1;min-width:0;padding:6px;font-size:12px}
}

/* Mobile HUD: economy and powers share one row; details stay in the existing folds. */
@media(max-width:760px){
 #game-screen .field-hud{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:stretch}
 #game-screen .economy-overview{grid-template-columns:1fr 1fr;grid-template-rows:auto;min-height:60px;padding:7px 8px;gap:6px;border:0}
 #game-screen .economy-overview>div:is(:first-child,:nth-child(2)){grid-row:auto;grid-column:auto;align-self:center}
 #game-screen .economy-overview .army-line{display:none}
 #game-screen .economy-overview strong{display:flex;align-items:baseline;gap:2px;font-size:clamp(17px,4.8vw,21px);white-space:nowrap;letter-spacing:-.02em}
 #game-screen .power-column{min-width:0;border-left:1px solid #466274}
 #game-screen .power-overview{min-height:60px;padding:5px 7px;gap:8px;align-items:center}
 #game-screen .power-track{min-height:44px;padding:3px 0}
 #game-screen .power-track>span{font-size:11px;gap:2px;flex-wrap:wrap}
 #game-screen .power-track progress{margin:0}
 #game-screen .board-bottom{display:none}
 #game-screen .sidebar{display:flex;flex-direction:column;gap:6px}
 #game-screen .sidebar .log-fold{margin-top:0}
 #game-screen .mission-header{padding-bottom:0}
}

/* Desktop: restore zoom to the right panel and give the whole recovered row to the board. */
.sidebar-orders:empty{display:none}
@media(min-width:761px){
 #game-screen .action-shelf{display:none}
 #game-screen .sidebar>.zoom{flex:none}
 #game-screen .sidebar-orders:not(:empty){flex:0 1 auto;min-height:52px;max-height:40vh;overflow:auto}
 #game-screen .sidebar .zoom button{height:44px;min-height:44px}
 #game-screen .sidebar #quick-actions.sidebar-docked{position:static!important;inset:auto!important;display:flex;flex-direction:column;flex-wrap:nowrap;box-sizing:border-box;width:100%;max-width:none;height:auto;max-height:none;margin:0;padding:5px;overflow:visible;justify-content:flex-start}
 #game-screen .sidebar #quick-actions.sidebar-docked button{flex:none;width:100%;min-width:0;min-height:44px;white-space:normal;text-align:left;padding:8px 10px}
}

/* Hardcore reserves belong to the existing information panel, without a new board banner. */
.unit-supplies[hidden]{display:none}
.unit-supplies{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,110px),1fr));gap:6px;padding:6px 12px;border-top:1px solid #bca679;font-size:12px;line-height:1.4}
.unit-supplies>small{grid-column:1/-1;margin:0}
.supply-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-content:start;gap:3px 6px;min-width:0;padding:5px 6px;border:1px solid #d4dcc7;border-radius:4px;background:#f4f0df}
.supply-row strong{font-size:12px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.supply-row meter{grid-column:1/-1;width:100%;height:10px;accent-color:#44664c}
.supply-row.low strong{color:#a03924}
.unit-supplies small{font-size:12px;line-height:1.5}

/* Keep reserves and the explanation reachable when the desktop information fold has to shrink. */
#game-screen .sidebar>#intel-fold:has(.unit-supplies:not([hidden])){overflow:auto}

.unit-stats:empty{display:none}
.shop-supplies{display:block;margin-top:3px;font-size:12px;line-height:1.4;color:var(--navy);white-space:normal}
/* Explicit areas keep names readable and reserve a reason row only when needed. */
.production-modal #shop .shop-card{grid-template-columns:56px minmax(0,1fr) auto;grid-template-areas:'img name info' 'img role price' 'stats stats stats';grid-template-rows:auto auto auto;row-gap:4px}
.production-modal #shop .shop-card[data-reason]{grid-template-areas:'img name info' 'img role price' 'stats stats stats' 'reason reason reason';grid-template-rows:auto auto auto auto}
.production-modal #shop .shop-card>div:not(.recruit-info)>p{display:contents}
.production-modal #shop .shop-buy{grid-area:name}
.production-modal #shop .shop-info{grid-area:info;justify-self:end;margin:0}
.production-modal #shop .shop-role{grid-area:role;min-width:0;font-size:11px;line-height:1.35;overflow-wrap:anywhere}

/* Aides sur les mots-clés (dist/glossary.js) : mot souligné en pointillé, point orange tant que l'aide n'a pas été
   ouverte, bulle d'aide ouverte au clic, au toucher ou au clavier. */
.kw{display:inline;padding:0;margin:0;border:0;background:none;font:inherit;color:inherit;line-height:inherit;text-decoration:underline dotted 1px;text-underline-offset:3px;cursor:help;border-radius:2px}
.kw:hover:not(:disabled){filter:none;text-decoration-style:solid}
.kw:active:not(:disabled){transform:none}
.kw-new::after{content:"";display:inline-block;width:6px;height:6px;margin:0 0 6px 2px;border-radius:50%;background:#ed663f;vertical-align:top}
.kw-pop{position:fixed;z-index:1000;box-sizing:border-box;background:#fbf7e7;color:#20364b;border:2px solid #20364b;border-radius:6px;box-shadow:4px 4px 0 #20364b55;padding:12px 14px;line-height:1.5;text-align:left}
.kw-pop[hidden]{display:none}
.kw-pop h3{margin:0 0 6px;font:800 20px/1.1 'Barlow Condensed',sans-serif;text-transform:uppercase}
.kw-pop p{margin:0 0 10px;font-size:13px;white-space:pre-line;color:#3d5257}
.kw-pop .kw-close{background:#e3e9d7;border:1px solid #bfceb3;border-radius:4px;padding:6px 12px;font-size:12px;font-weight:700}
.kw-list{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}
.kw.kw-chip{background:#e3e9d7;border:1px solid #bfceb3;border-radius:4px;padding:6px 10px;font-size:12px;font-weight:700;text-decoration:none;min-height:32px}
.kw-reset{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.kw-reset .secondary{padding:8px 12px}
#glossary-status{font-size:12px;color:#56685f}
/* Tactical pictograms: one code-native SVG set shared by the card, resources and help. */
.stat-icon{display:inline-block;flex:none;width:20px;height:20px;background:currentColor;mask:var(--metric-icon) center/contain no-repeat;vertical-align:middle}
.stat-health{--metric-icon:url('assets/ui/health.svg');color:#39734e}
.stat-move{--metric-icon:url('assets/ui/move.svg');color:#315d7b}
.stat-range{--metric-icon:url('assets/ui/range.svg');color:#906117}
.stat-modules{--metric-icon:url('assets/ui/modules.svg');color:#615579}
.stat-fuel{--metric-icon:url('assets/ui/fuel.svg');color:#997023}
.stat-ammo{--metric-icon:url('assets/ui/ammo.svg');color:#aa4929}
.stat-info{--metric-icon:url('assets/ui/info.svg')}
.metric-label{display:inline-flex;align-items:center;min-width:20px}
.metric-name{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
body:not(.home-mode) #game-screen .sidebar #unit-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(75px,1fr));gap:6px}
body:not(.home-mode) #game-screen .sidebar #unit-stats:empty{display:none}
body:not(.home-mode) #game-screen .sidebar #unit-stats>div{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:7px;padding:8px 5px;min-width:0}
body:not(.home-mode) #game-screen .sidebar #unit-stats strong{font-size:17px;font-variant-numeric:tabular-nums;line-height:1.2}
.supply-row{grid-template-columns:24px minmax(0,1fr);align-items:center;padding:5px 7px}
.supply-row>strong{justify-self:end}
.supply-row .stat-icon{width:21px;height:21px}
body:not(.home-mode) #game-screen .sidebar .selected-heading{align-items:center;gap:8px;padding-bottom:8px}
body:not(.home-mode) #game-screen .sidebar .selected-heading>div{flex:1;min-width:0}
body:not(.home-mode) #game-screen .sidebar .selected-heading canvas{width:56px;height:56px;flex:none}
body:not(.home-mode) #game-screen .sidebar .selected-heading #selected-name{font-size:24px;line-height:1.15}
body:not(.home-mode) #game-screen .sidebar #selected-sub{font-size:12px;line-height:1.35;margin:3px 0 0}
body:not(.home-mode) #game-screen .sidebar #intel-kicker[hidden]{display:none}
.intel-details{display:grid;place-items:center;flex:none;width:44px;height:44px;min-height:44px;padding:0;border:1px solid #bca679;border-radius:5px;color:#20364b;background:#eee3c8}
.intel-details:hover{border-color:var(--orange)}
.intel-details:focus-visible{outline:3px solid var(--orange);outline-offset:2px}
.intel-fold[open]>summary #intel-summary,.log-fold[open]>summary #log-summary{display:none}
.intel-alert{margin:6px 10px;padding:5px 8px;border-left:3px solid #b55b30;font-size:12px;line-height:1.4;color:#78361d;background:#f4e5ca}
.intel-alert[hidden]{display:none}
.intel-legend{display:flex;flex-wrap:wrap;gap:12px 18px;padding-top:14px;border-top:1px solid #bca679;font-size:14px}
.intel-legend>span:not(#intel-logistics-legend),#intel-logistics-legend>span{display:inline-flex;align-items:center;gap:7px}
#intel-logistics-legend{display:contents}
#intel-logistics-legend[hidden]{display:none}
#game-screen .log-fold .notice-slot{display:flex;align-items:center;gap:8px;padding:7px 8px}
#game-screen .log-fold .notice-slot>#toast{flex:1;width:auto;min-width:0;min-height:0;padding:0;font-size:12px;line-height:1.4}
#game-screen .log-fold .notice-slot>#notice-details{position:static;flex:none;width:44px;height:44px;min-height:44px;margin:0}
#notice-symbol{width:18px;height:18px}
@media(max-width:760px){
 #game-screen .sidebar .intel-panel{padding-bottom:5px}
 body:not(.home-mode) #game-screen .sidebar .selected-heading{padding:7px 10px}
 body:not(.home-mode) #game-screen .sidebar #unit-stats{padding:4px 10px;border:0}
 body:not(.home-mode) #game-screen .sidebar #unit-stats>div{padding:6px 4px;background:#f6f0de;border:1px solid #d4dcc7;border-radius:4px}
 .unit-supplies{padding-top:4px;padding-bottom:4px}
 #game-screen .log-fold .notice-slot>#toast{min-height:0;padding:0}
}
#game-screen .notice-slot>#notice-symbol.stat-info{display:none}

.production-modal #shop .shop-card small:first-of-type{display:flex;align-items:center;flex-wrap:wrap;gap:5px 12px}
.shop-metric{display:inline-flex;align-items:center;gap:4px;font-size:12px;line-height:1.4;color:var(--navy)}
.shop-metric .stat-icon{width:16px;height:16px}
.shop-metric strong{font:700 12px/1.4 var(--font-ui);font-variant-numeric:tabular-nums}
.production-modal #shop .shop-supplies{display:flex;flex-basis:100%;flex-wrap:wrap;gap:5px 12px;margin-top:0}

/* Phone action shelf: every available command owns the same share of the row. */
@media(max-width:760px){
 :is(.map-shell,.sidebar) #quick-actions.docked{gap:4px;align-items:stretch;overflow:hidden}
 :is(.map-shell,.sidebar) #quick-actions.docked button{flex:1 1 0;min-width:0;width:0;height:100%;min-height:44px;padding:4px 6px;white-space:normal;overflow-wrap:normal;text-align:center;font-size:clamp(11px,3vw,12px);line-height:1.15}
}

@media(max-width:760px){.home-tools>div>:last-child:nth-child(odd){grid-column:1/-1}}

/* Short first-selection help: shared modal styling, equal insets on narrow screens. */
.engineer-advice.modal.small{width:min(360px,calc(100vw - 24px));max-height:calc(100dvh - 24px);padding:20px}
.engineer-advice h2{margin:0 0 12px;font-size:30px}
.engineer-advice p{margin:0 0 16px;white-space:pre-line}
.engineer-advice>.primary{min-height:44px;margin:0}

/* L'en-tête de mission n'appartient qu'à la partie : jamais sur l'accueil, quelle que soit la largeur (paysage). */
body.home-mode .topbar>.mission-title{display:none}
