/* HUD bureau « table de commandement » (test, docs/HUD_DESKTOP.md) : reproduction de la maquette chaleureuse retenue
   par Ninewashburn (bureau de bois sombre, cadre d'acier riveté, fiches en parchemin, Fin du tour rouille). La version
   « navy / orange » précédente reste dans l'historique Git (commit 49b7564). Chargé seulement au-delà de 1100 px
   (index.html) et seulement en partie (body sans .home-mode) : téléphone, tablette, accueil et Rétro gardent leur
   interface. Aucun HTML ni JavaScript ajouté. La carte reste l'élément le plus lumineux de l'écran. */
body:not(.home-mode){
 --wood:#2a1d14;--wood-hi:#3b2a1e;--ink:#2b2117;--ink-soft:#5a4a3a;--paper:#efe4cc;--paper-hi:#f7eedb;--paper-lo:#ddcdab;
 --paper-line:#bfa983;--steel:#1f2a33;--steel-hi:#34434f;--steel-lo:#11181e;--rivet:#6b7b86;--txt:#e8e1d2;--dim:#a99c86;
 --rust:#c9542a;--rust-hi:#e8763f;--rust-lo:#8e3416;--gold:#e8b041;
 --grain:repeating-linear-gradient(97deg,rgba(255,255,255,.018) 0 2px,rgba(0,0,0,.035) 2px 5px,transparent 5px 11px);
 --paper-tex:radial-gradient(ellipse at 20% 10%,rgba(255,255,255,.45),transparent 55%),radial-gradient(ellipse at 90% 100%,rgba(150,110,60,.18),transparent 60%);
 --rivets:radial-gradient(circle at 8px 8px,var(--rivet) 2.2px,#0006 3px,transparent 3.5px),radial-gradient(circle at calc(100% - 8px) 8px,var(--rivet) 2.2px,#0006 3px,transparent 3.5px),radial-gradient(circle at 8px calc(100% - 8px),var(--rivet) 2.2px,#0006 3px,transparent 3.5px),radial-gradient(circle at calc(100% - 8px) calc(100% - 8px),var(--rivet) 2.2px,#0006 3px,transparent 3.5px);
 background:var(--grain),radial-gradient(ellipse 85% 75% at 45% 45%,var(--desk-hi) 0%,var(--desk) 70%,var(--desk-lo) 100%) fixed;color:var(--txt);
}
/* Jetons de thème de l'écran de jeu (docs/THEMES.md). Valeurs du thème actuel : un thème les redéfinit sous
   html[data-skin=…] body:not(.home-mode). Couleurs d'équipe et ombres noires restent en dur. */
body:not(.home-mode){
 --desk-hi:#3a2a1d;--desk:#22170f;--desk-lo:#160e09;--frame-hi:#26313b;--frame-lo:#141b21;--frame-edge:#0b0f12;--frame-line:#3b4955;--frame-glint:#44535f;--frame-text:#c9c1b2;--label-hi:#f3e7cd;--label-lo:#dccaa4;--label-edge:#8c7350;--label-glint:#fff8e6;--label-line:#b89f74;--btn-hi:#2c3843;--btn-lo:#19222a;--btn-edge:#4d5d6a;--btn-glint:#55677a;--board-frame-hi:#2a343d;--board-frame-lo:#151c22;--board-frame:#202931;--board-frame-line:#475663;--board-edge:#56677a;--board-frame-shade:#10161b;--card-head:#26313a;--card-head-line:#c9b48c;--card:#f9f2e2;--card-fold-hi:#e9dcc0;--card-fold-lo:#d8c7a2;--next-hi:#f2e2bb;--next-lo:#d9c08c;--action-hi:#d9622f;--action-lo:#a63e18;--action-text:#fff3e4;--action-ink:#3a1c10;--action-glint:#f39363;--action-edge:#7c2c10;--action-shade:#6d2510;--footer-hi:#1d262e;--footer-lo:#12181d;--hud-strong:#fff;--income:#a8d873;--btn-text:#fff;--pill:#1b252dee;--pill-text:#fff;--btn-label:#e8e1d2;--btn-on-hi:#3a3324;--btn-on-lo:#211c14;--track:#0a0f13;--track-edge:#33414d;
}
/* Coque quasi plein écran (brief HUD V3) : barre du haut, zone de jeu et pied de page partagent une seule largeur
   (--hud-w = fenêtre moins une marge de 12 à 24 px). La fenêtre de jeu prend la largeur restante et la hauteur
   --board-h calculée par fitLayout. La caméra conserve les proportions de la carte dans ce cadre indépendant.
   La colonne de droite reste bornée (--side-w). */
body:not(.home-mode){
 --side-w:clamp(320px,23vw,400px);
 --gutter:clamp(12px,1.25vw,24px);
 --hud-w:calc(100% - 2 * var(--gutter));
 /* Cartouche de l'opération (largeur fixe par palier : le jour, posé à sa droite, en dépend) */
 --mission-w:clamp(264px,calc(26vw - 40px),440px);--day-w:116px;
}
html:has(body:not(.home-mode)){background:#160e09}
body:not(.home-mode) .app{position:relative;max-width:none;width:var(--hud-w)}
body:not(.home-mode) #game-screen{padding-left:0;padding-right:0;padding-bottom:0}
body:not(.home-mode) #game-screen :is(.tutorial-coach,.game-layout){max-width:none}
body:not(.home-mode) #game-screen .game-layout{grid-template-columns:minmax(0,1fr) var(--side-w);gap:16px;align-items:start}
body:not(.home-mode) #game-screen .map-shell{max-width:none;margin:0}
body:not(.home-mode) :is(h1,h2,h3,.fold-label,.next-unit,.end-turn,#mission-name,.game-day){font-family:'Barlow Condensed','Oswald',Impact,sans-serif}

/* ---------- Barre du haut : bandeau d'acier sombre ; opération et jour sur un cartouche de parchemin ---------- */
body:not(.home-mode) .topbar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:14px;height:auto;min-height:76px;padding:0 16px;background:var(--rivets),linear-gradient(var(--frame-hi),var(--frame-lo));border-bottom:3px solid var(--frame-edge);box-shadow:inset 0 1px 0 var(--frame-glint),0 4px 12px rgba(0,0,0,.6)}
body:not(.home-mode) .topbar .logo{display:none}
body:not(.home-mode) .top-hud{display:grid;grid-template-columns:max-content minmax(196px,240px) minmax(180px,340px) minmax(180px,340px);grid-template-rows:64px;justify-content:start;align-items:stretch;margin:0;gap:0;height:64px;min-width:0}
body:not(.home-mode) .top-hud>*::before{display:none}
body:not(.home-mode) .top-hud>*{box-sizing:border-box;min-height:0;height:auto;display:flex;align-items:center;padding:0 22px;border-right:1px solid var(--frame-line);box-shadow:1px 0 0 var(--frame-edge)}
/* Cartouche : parchemin roulé, opération à gauche ; le jour (#game-day) est posé à sa droite */
body:not(.home-mode) .top-hud .mission-title{width:calc(var(--mission-w) + var(--wx-w,0px));max-width:calc(var(--mission-w) + var(--wx-w,0px));margin:6px 18px 6px 6px;padding:0 calc(var(--day-w) + var(--wx-w,0px) + 10px) 0 40px;position:relative;background:var(--paper-tex),linear-gradient(var(--label-hi),var(--label-lo));border:1px solid var(--label-edge);border-radius:3px;box-shadow:inset 0 1px 0 var(--label-glint),inset 0 -2px 0 var(--label-line),0 2px 4px rgba(0,0,0,.5);overflow:hidden}
body:not(.home-mode) .top-hud .mission-title::after{content:"";position:absolute;left:14px;top:50%;width:6px;height:40px;margin-top:-20px;border-radius:3px;background:linear-gradient(90deg,#7a5432,#c08a52,#6b4628);box-shadow:3px 0 0 -1px #e9c58f}
body:not(.home-mode) .top-hud .mission-title .eyebrow{display:none}
/* Titre : une ligne quand la place existe, sinon deux lignes plus petites, jamais coupé par « … ». */
body:not(.home-mode) .top-hud h1{font-size:clamp(20px,1.3vw,25px);line-height:1.02;letter-spacing:.5px;color:var(--ink);text-transform:uppercase;font-weight:800;white-space:normal}
body:not(.home-mode) .top-hud #mission-name{max-width:100%;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden;white-space:normal;color:var(--ink)}
body:not(.home-mode) .game-day{position:absolute;top:12px;left:calc(16px + 6px + var(--mission-w) - var(--day-w) - 3px);z-index:30;height:52px;width:calc(var(--day-w) + var(--wx-w,0px));box-sizing:border-box;display:flex;align-items:center;justify-content:center;gap:6px;margin:0;padding:0;background:transparent;border:0;border-left:2px solid var(--label-edge);color:var(--ink);font-size:26px;font-weight:700;text-transform:none}
body:not(.home-mode) .game-day strong{color:var(--ink);font:inherit}
/* Fonds : pile de pièces, libellés clairs */
body:not(.home-mode) .top-hud .economy-overview{display:grid;grid-template-columns:auto minmax(96px,1fr);grid-template-rows:1fr 1fr;column-gap:12px;row-gap:2px;min-width:0;align-content:center;background:transparent;border-top:0;border-bottom:0;padding-left:20px;position:relative}
body:not(.home-mode) .top-hud .economy-overview>div:not(.army-line){display:contents}
body:not(.home-mode) .top-hud .economy-overview small{grid-column:1;color:var(--frame-text);font:700 12px 'DM Sans',sans-serif;letter-spacing:1.6px}
body:not(.home-mode) .top-hud .economy-overview strong{grid-column:2;display:flex;align-items:center;justify-content:flex-end;gap:7px;line-height:1;font:800 22px/1 'Barlow Condensed',Impact,sans-serif;font-variant-numeric:tabular-nums;color:var(--gold)}
body:not(.home-mode) .top-hud .economy-overview small{align-self:center}
body:not(.home-mode) .top-hud .economy-overview strong span{margin-left:-3px}
body:not(.home-mode) .top-hud .economy-overview .income{color:var(--income)}
body:not(.home-mode) .top-hud .economy-overview strong span{font:700 15px 'Barlow Condensed',sans-serif;color:inherit}
/* Pièce : remplace l'unité « G » après les fonds et les revenus (le « G » reste lu par les lecteurs d'écran). Dessin
   aux couleurs de la maquette : or, tranche cuivrée, étoile frappée. */
body:not(.home-mode) .top-hud .economy-overview strong span{position:absolute;width:1px;height:1px;margin:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
body:not(.home-mode) .top-hud .economy-overview strong{gap:5px}
body:not(.home-mode) .top-hud .economy-overview strong::after{content:"";flex:none;width:var(--coin,17px);height:var(--coin,17px);background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cdefs%3E%3ClinearGradient id='f' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23ffeaa6'/%3E%3Cstop offset='1' stop-color='%23e9ad3a'/%3E%3C/linearGradient%3E%3ClinearGradient id='r' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23d99a2b'/%3E%3Cstop offset='1' stop-color='%23a8650f'/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx='12' cy='12.6' r='11' fill='%236e430e'/%3E%3Ccircle cx='12' cy='11.4' r='11' fill='url(%23r)' stroke='%236e430e' stroke-width='1'/%3E%3Ccircle cx='12' cy='11.4' r='8.2' fill='url(%23f)'/%3E%3Ccircle cx='12' cy='11.4' r='6.6' fill='none' stroke='%23c98a24' stroke-width='.9'/%3E%3Cpath d='M12 6.9l1.3 2.7 2.9.4-2.1 2 .5 2.9-2.6-1.4-2.6 1.4.5-2.9-2.1-2 2.9-.4z' fill='%23b8771a'/%3E%3Cpath d='M6.2 8.6a7 7 0 0 1 4-3.4' fill='none' stroke='%23fff8dc' stroke-width='1.3' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat}
/* Camps : portrait du commandant, puis deux lignes. Ligne 1 : son nom et l'effectif (pastille). Ligne 2 : la jauge de
   pouvoir, épaisse, à la couleur du camp, et sa charge. Les mots « Pouvoir », « Alliés » et « Ennemis » ne sont plus
   affichés (lus par les lecteurs d'écran). Le camp suit le bouton (.coral, .azure) et le portrait le commandant
   (data-commander posé par game.js), car le bloc de gauche est toujours celui du joueur qui regarde. */
body:not(.home-mode) .top-hud .side-group{--camp:#d9452f;--camp-hi:#ff9a72;--portrait:46px;width:auto;min-width:0;max-width:none;display:grid;grid-template-columns:var(--portrait) minmax(0,1fr);align-items:center;column-gap:10px;position:relative;margin:0;padding:0 18px;background:transparent;border:0;border-right:1px solid var(--frame-line);border-radius:0;box-shadow:1px 0 0 var(--frame-edge)}
body:not(.home-mode) .top-hud .side-group:has(.power-track.azure){--camp:#2f6fd6;--camp-hi:#8dd0ff}
body:not(.home-mode) .top-hud .side-group+.side-group{margin-left:0}
body:not(.home-mode) .top-hud .side-group:last-child{border-right:0;box-shadow:none}
body:not(.home-mode) .top-hud .side-group::before{content:"";display:block;position:static;grid-column:1;grid-row:1;width:var(--portrait);height:var(--portrait);box-sizing:border-box;border:2px solid var(--camp);border-radius:10px;background:color-mix(in srgb,var(--camp) 22%,var(--track)) no-repeat 50% 12%/cover;box-shadow:0 2px 0 var(--frame-edge)}
/* Les portraits carrés gardent le même cadrage dans les deux dispositions du bandeau. */
body:not(.home-mode) .top-hud .side-group:has([data-commander=maya])::before{background-image:url(assets/illustrated/commanders/maya-face.webp?v=20261126)}
body:not(.home-mode) .top-hud .side-group:has([data-commander=viktor])::before{background-image:url(assets/illustrated/commanders/viktor-face.webp?v=20261126)}
body:not(.home-mode) .top-hud .side-group:has([data-commander=konrad])::before{background-image:url(assets/illustrated/commanders/konrad-face.webp?v=20261126)}
body:not(.home-mode) .top-hud .side-group:has([data-commander=iris])::before{background-image:url(assets/illustrated/commanders/iris-face.webp?v=20261126)}
/* Effectif : pastille teintée du camp, pictogramme de soldat et nombre, posée à droite de la ligne du nom. */
body:not(.home-mode) .top-hud .side-group>span{position:absolute;top:calc(50% - 19px);right:18px;z-index:1;display:flex;align-items:center;gap:4px;height:22px;box-sizing:border-box;padding:0 8px 0 6px;border:1px solid color-mix(in srgb,var(--camp) 60%,transparent);border-radius:11px;background:color-mix(in srgb,var(--camp) 16%,transparent);color:var(--hud-strong);font:700 12px/1 'DM Sans',sans-serif;letter-spacing:0}
body:not(.home-mode) .top-hud .side-group>span::before{content:"";display:block;width:12px;height:12px;flex:none;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='3' r='2.5'/%3E%3Cpath d='M1 12c0-3.3 2.2-5.5 5-5.5s5 2.2 5 5.5z'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='3' r='2.5'/%3E%3Cpath d='M1 12c0-3.3 2.2-5.5 5-5.5s5 2.2 5 5.5z'/%3E%3C/svg%3E") center/contain no-repeat}
body:not(.home-mode) .top-hud .side-group>span .count-short{display:none}
body:not(.home-mode) .top-hud .side-group>span .count-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
body:not(.home-mode) .top-hud .side-group>span b{min-width:1.4ch;text-align:right;font:800 17px/1 'Barlow Condensed',Impact,sans-serif;font-variant-numeric:tabular-nums;color:inherit}
body:not(.home-mode) .top-hud .power-track{grid-column:2;grid-row:1;align-self:stretch;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"owner owner" "gauge state";align-content:center;row-gap:6px;column-gap:8px;width:100%;height:100%;padding:0;background:transparent;border:0;box-shadow:none;color:var(--txt);text-align:left}
body:not(.home-mode) .top-hud .power-track>span{display:contents}
body:not(.home-mode) .top-hud .power-track>span>*{text-shadow:none}
body:not(.home-mode) .top-hud .power-track [id^="power-owner"]{grid-area:owner;position:static;display:block;height:22px;padding:0 74px 0 0;font:800 21px/22px 'Barlow Condensed',sans-serif;color:var(--hud-strong);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body:not(.home-mode) .top-hud .power-track [id^="power-owner"]::before{content:none}
body:not(.home-mode) .top-hud .power-track :is(.power-label,.power-ready,.power-pct,.power-activate){display:none}
body:not(.home-mode) .top-hud .power-track [id^="power-state"]{grid-area:state;display:block;min-width:3.4ch;padding:1px 5px;border-radius:6px;font:800 15px/16px 'Barlow Condensed',sans-serif;font-variant-numeric:tabular-nums;text-align:right;color:var(--hud-strong)}
/* Jauge : 10 px, couleur du camp ; la charge glisse vers sa nouvelle valeur et des rayures défilent tant qu'elle se
   remplit. Pleine : elle passe à l'or et pulse, l'état devient une pastille « PRÊT ! ». */
body:not(.home-mode) .top-hud .power-track progress{grid-area:gauge;display:block;position:static;width:100%;height:10px;margin:0;padding:0;appearance:none;-webkit-appearance:none;border:0;border-radius:5px;background:var(--track);box-shadow:inset 0 0 0 1px var(--track-edge);overflow:hidden}
body:not(.home-mode) .top-hud .power-track progress::-webkit-progress-bar{border-radius:5px;background:var(--track);box-shadow:inset 0 0 0 1px var(--track-edge)}
body:not(.home-mode) .top-hud .power-track progress::-webkit-progress-value{border-radius:5px;background:linear-gradient(45deg,#ffffff40 25%,transparent 25% 50%,#ffffff40 50% 75%,transparent 75%) 0 0/14px 14px,linear-gradient(var(--camp-hi),var(--camp));transition:width .6s ease;animation:pf-stripes 1s linear infinite}
body:not(.home-mode) .top-hud .power-track progress::-moz-progress-bar{border-radius:5px;background:linear-gradient(45deg,#ffffff40 25%,transparent 25% 50%,#ffffff40 50% 75%,transparent 75%) 0 0/14px 14px,linear-gradient(var(--camp-hi),var(--camp));animation:pf-stripes 1s linear infinite}
body:not(.home-mode) .top-hud .power-track:is(.full,.available,.active) progress::-webkit-progress-value{background:linear-gradient(#ffe39a,#e2a93a);animation:none}
body:not(.home-mode) .top-hud .power-track:is(.full,.available,.active) progress::-moz-progress-bar{background:linear-gradient(#ffe39a,#e2a93a);animation:none}
body:not(.home-mode) .top-hud .power-track:is(.full,.available) progress{animation:pf-ready 1.6s ease-in-out infinite}
body:not(.home-mode) .top-hud .power-track [id^="power-state"].ready{background:#f6d77a;color:#22385a}
/* Pouvoir en cours : l'état « ACTIF » prend la couleur du camp et la jauge garde une lueur fixe. */
body:not(.home-mode) .top-hud .power-track.active [id^="power-state"]{background:var(--camp);color:#fff}
body:not(.home-mode) .top-hud .power-track.active progress{box-shadow:inset 0 0 0 1px var(--track-edge),0 0 8px var(--camp)}
/* Activable par le joueur : le module s'allume et « ACTIVER » remplace la charge. */
body:not(.home-mode) .top-hud .side-group:has(.power-track.available){background:linear-gradient(transparent,color-mix(in srgb,var(--camp) 18%,transparent));cursor:pointer}
body:not(.home-mode) .top-hud .power-track.available [id^="power-state"]{display:none}
body:not(.home-mode) .top-hud .power-track.available .power-activate{grid-area:state;display:block;position:static;padding:2px 7px;border:1px solid #7e3420;border-radius:6px;background:linear-gradient(#f39a4a,#e0662d);color:#fff;font:800 14px/15px 'Barlow Condensed',sans-serif;font-style:normal;letter-spacing:.4px}
/* Mission sans pouvoirs (École) : ni jauge ni charge ; le nom et l'effectif restent seuls, sur une ligne. */
body:not(.home-mode) .top-hud .power-track.no-power{grid-template-areas:"owner owner";row-gap:0}
body:not(.home-mode) .top-hud .power-track.no-power :is(progress,[id^="power-state"],.power-activate){display:none}
body:not(.home-mode) .top-hud .side-group:has(.power-track.no-power)>span{top:calc(50% - 11px)}
@keyframes pf-stripes{to{background-position:14px 0,0 0}}
@keyframes pf-ready{0%,100%{box-shadow:inset 0 0 0 1px #c9922c,0 0 0 #f6d77a00}50%{box-shadow:inset 0 0 0 1px #c9922c,0 0 10px 2px #f6d77acc}}
@media(prefers-reduced-motion:reduce){
 body:not(.home-mode) .top-hud .power-track progress{animation:none!important}
 body:not(.home-mode) .top-hud .power-track progress::-webkit-progress-value{animation:none;transition:none}
 body:not(.home-mode) .top-hud .power-track progress::-moz-progress-bar{animation:none}
 body:not(.home-mode) .top-hud .power-track:is(.full,.available) progress{box-shadow:inset 0 0 0 1px #c9922c,0 0 8px 1px #f6d77acc}
}
/* Commandes : boutons d'acier */
body:not(.home-mode) .top-right{display:flex;align-items:center;justify-content:flex-end;gap:10px;min-width:0}
body:not(.home-mode) .top-right .edition,body:not(.home-mode) .top-right .github-link{display:none!important}
body:not(.home-mode) #pause-button{width:auto;min-width:104px;font-size:16px}
/* Sound shares navigation.css's content-sized icon/label layout, including longer English labels. */
body:not(.home-mode) .topbar #sound.active{background:linear-gradient(var(--btn-on-hi),var(--btn-on-lo));border-color:var(--label-edge);color:var(--gold)}
body:not(.home-mode) #pause-button span{display:inline}
body:not(.home-mode) .topbar .icon-button{box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;gap:6px;width:auto;height:48px;min-height:48px;min-width:48px;padding:0 14px;font-size:17px;line-height:1;white-space:nowrap;background:linear-gradient(var(--btn-hi),var(--btn-lo));border:1px solid var(--btn-edge);border-radius:4px;color:var(--btn-label);box-shadow:inset 0 1px 0 var(--btn-glint),0 2px 0 #06090c;font-weight:700}

/* ---------- Carte : cadre d'acier sombre riveté sur le bureau ---------- */
body:not(.home-mode) #game-screen{padding-top:8px}
body:not(.home-mode) #game-screen .board-section{position:relative;overflow:visible;padding:10px 10px 8px;background:var(--rivets),linear-gradient(150deg,var(--board-frame-hi),var(--board-frame-lo) 55%,var(--board-frame));border:1px solid var(--board-frame-line);border-radius:8px;box-shadow:inset 0 1px 0 var(--board-edge),inset 0 0 0 4px var(--board-frame-shade),0 14px 34px rgba(0,0,0,.7)}
body:not(.home-mode) #game-screen .map-viewport{border:2px solid var(--frame-edge);border-radius:3px;box-shadow:0 0 0 1px var(--board-edge)}
body:not(.home-mode) #game-screen .coord-pill{padding:5px 9px;background:var(--pill);border:1px solid var(--board-edge);color:var(--pill-text);font:800 14px 'Barlow Condensed',sans-serif;border-radius:3px}
/* Zoom sous « Fin du tour » : petit groupe d'acier, moins visible que le bouton. */
body:not(.home-mode) #game-screen .sidebar .zoom button{height:36px;min-height:36px;background:linear-gradient(var(--btn-hi),var(--btn-lo));color:var(--btn-label);border:1px solid var(--btn-edge);border-radius:4px;box-shadow:inset 0 1px 0 var(--btn-glint)}
body:not(.home-mode) #game-screen .sidebar .zoom{gap:8px}
body:not(.home-mode) #game-screen .sidebar .zoom button{font-size:18px}
body:not(.home-mode) #game-screen .sidebar .zoom #zoomfit{font-size:14px;letter-spacing:.3px}
/* − et + plus larges (cible plus confortable), « Vue entière » au centre ; même acier que « Vue entière ». À la borne du
   zoom, le bouton garde son acier et seul le signe s'éteint (pas de grisé qui le ferait paraître non stylé). */
body:not(.home-mode) #game-screen .sidebar .zoom{grid-template-columns:76px minmax(0,1fr) 76px}
body:not(.home-mode) #game-screen .sidebar .zoom :is(#zoomout,#zoomin){font-size:22px;font-weight:700;line-height:1}
body:not(.home-mode) #game-screen .sidebar .zoom button:disabled{filter:none;opacity:1;color:#5f6e7a;cursor:default;box-shadow:inset 0 1px 0 #3c4a56}

/* ---------- Colonne de droite : fiches de parchemin cadrées d'acier ---------- */
body:not(.home-mode) #game-screen .sidebar{gap:12px}
body:not(.home-mode) #game-screen .sidebar>.fold{overflow:hidden;background:var(--paper-tex),linear-gradient(var(--paper-hi),var(--paper-lo));border:2px solid var(--card-head);border-radius:6px;color:var(--ink);box-shadow:inset 0 0 0 1px var(--card-head-line),0 6px 14px rgba(0,0,0,.55)}
body:not(.home-mode) #game-screen .sidebar .fold>summary{min-height:50px;padding:10px 12px 10px 16px;gap:12px;background:transparent;border-bottom:1px solid var(--paper-line);color:var(--ink-soft);font-weight:600}
body:not(.home-mode) #game-screen .sidebar .fold-label{flex:none;color:var(--ink);font-size:21px;font-weight:800;letter-spacing:1.2px;text-transform:uppercase}
body:not(.home-mode) #game-screen .sidebar .fold>summary :not(.fold-label){color:var(--ink-soft)}
/* + / - : bouton carré d'acier, posé à l'intérieur du bandeau (9. Commandant) */
body:not(.home-mode) #game-screen .sidebar .fold>summary::after{flex:none;width:28px;height:28px;border-radius:4px;background:linear-gradient(var(--btn-hi),var(--btn-lo));border:1px solid var(--btn-edge);box-shadow:inset 0 1px 0 var(--btn-glint);color:var(--btn-text);font:700 18px/1 'DM Sans',sans-serif}
body:not(.home-mode) #game-screen .sidebar .fold>summary>span:not(.fold-label){font-size:12px;opacity:.85}
body:not(.home-mode) #game-screen .sidebar .intel-panel{background:transparent;color:var(--ink);padding:14px 18px 16px}
body:not(.home-mode) #game-screen .sidebar .panel-kicker{background:transparent;padding:0 0 8px;color:var(--ink-soft);font:800 14px 'Barlow Condensed',sans-serif;letter-spacing:1.6px}
body:not(.home-mode) #game-screen .sidebar .selected-heading h3{color:var(--ink);font:800 28px 'Barlow Condensed',sans-serif}
body:not(.home-mode) #game-screen .sidebar #selected-sub,body:not(.home-mode) #game-screen .sidebar .description{color:var(--ink-soft)}
body:not(.home-mode) #game-screen .sidebar .selected-heading{border-bottom-color:var(--paper-line)}
body:not(.home-mode) #game-screen .sidebar .terrain-info,body:not(.home-mode) #game-screen .sidebar .forecast,body:not(.home-mode) #game-screen .sidebar .unit-stats>*{background:var(--card);border:1px solid var(--paper-line);border-radius:3px;color:var(--ink)}
/* Santé / Mouvement / Portée : trois cases égales séparées, libellé et valeur centrés dans chaque case. */
body:not(.home-mode) #game-screen .sidebar .unit-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;border-top:0}
body:not(.home-mode) #game-screen .sidebar .unit-stats>div{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;padding:8px 4px 9px;text-align:center}
body:not(.home-mode) #game-screen .sidebar .unit-stats small{margin:0;font-size:11px;letter-spacing:.06em;text-transform:uppercase;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
body:not(.home-mode) #game-screen .sidebar .unit-stats strong{margin:0;font-size:18px;line-height:1}
body:not(.home-mode) #game-screen .sidebar .terrain-info b{color:#9a6410}
body:not(.home-mode) #game-screen .sidebar .commander-power{color:var(--ink)}
body:not(.home-mode) #game-screen .sidebar .log-fold{background:var(--paper-tex),linear-gradient(var(--card-fold-hi),var(--card-fold-lo))}
body:not(.home-mode) #game-screen .sidebar #battle-log{background:transparent;color:var(--ink-soft);padding:12px 16px 14px;border-top:0;line-height:1.55;scrollbar-width:thin;scrollbar-color:var(--label-edge) transparent}
body:not(.home-mode) #game-screen .sidebar #battle-log::-webkit-scrollbar{width:8px}
body:not(.home-mode) #game-screen .sidebar #battle-log::-webkit-scrollbar-thumb{background:var(--label-edge);border-radius:4px}
/* Unités à jouer : plaque de parchemin, compteur dans une fente sombre */
body:not(.home-mode) #game-screen .sidebar .next-unit{box-sizing:border-box;min-height:56px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 14px 8px 18px;overflow:hidden;background:var(--paper-tex),linear-gradient(var(--next-hi),var(--next-lo));color:var(--ink);border:2px solid var(--card-head);border-radius:6px;box-shadow:inset 0 0 0 1px var(--card-head-line),0 4px 10px rgba(0,0,0,.5);font-size:19px;font-weight:800;letter-spacing:1.4px;text-transform:uppercase;white-space:nowrap}
body:not(.home-mode) #game-screen .sidebar .next-unit b{box-sizing:border-box;margin-left:auto;min-width:48px;height:36px;display:inline-grid;place-items:center;padding:0 10px;border-radius:4px;border:1px solid #7a4a2a;background:#1f1a16;color:#fff;font-size:24px;line-height:1;box-shadow:inset 0 2px 3px #000}
/* Sous-texte de tour (achats, pouvoir, consignes) dans la même plaque, sous le titre ; le compteur reste à droite sur
   toute la hauteur. Vide : la ligne disparaît et la plaque garde sa hauteur d'origine. */
body:not(.home-mode) #game-screen .sidebar .next-unit{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;align-content:center;column-gap:10px;row-gap:0;justify-content:stretch;text-align:left}
body:not(.home-mode) #game-screen .sidebar .next-label{display:contents}
body:not(.home-mode) #game-screen .sidebar .next-unit b{grid-column:2;grid-row:1/span 2}
body:not(.home-mode) #game-screen .sidebar .next-unit kbd{grid-column:3;grid-row:1/span 2}
body:not(.home-mode) #game-screen .sidebar .next-unit #end-note{grid-column:1;grid-row:2;min-height:0;max-width:none;margin:2px 0 0;color:var(--ink-soft);font:500 12px/1.3 'DM Sans',sans-serif;letter-spacing:0;text-align:left;text-transform:none;white-space:normal}
body:not(.home-mode) #game-screen .sidebar .next-unit kbd{background:#d9cbb0;color:var(--ink);border:1px solid var(--label-edge);border-radius:3px;padding:2px 7px}
/* Toutes jouées (bouton inactif) : statut calme, sans grisé ; la coche reste centrée dans sa fente */
body:not(.home-mode) #game-screen .sidebar button.next-unit:disabled{filter:none;opacity:1;cursor:default;background:var(--paper-tex),linear-gradient(#e2d4b4,#cbb68c);color:var(--ink-soft)}
body:not(.home-mode) #game-screen .sidebar button.next-unit:disabled b{background:#2b3a2a;border-color:#4f6b45;color:#bfe39a;font-size:20px}
/* Fin du tour : plaque rouille rivetée, double chevron */
/* Trois zones symétriques : chevrons dans la marge gauche, libellé (flèche comprise) centré sur le bouton entier,
   marge droite de même largeur. Le libellé garde le même axe. */
body:not(.home-mode) #game-screen .sidebar .end-turn{position:relative;box-sizing:border-box;width:100%;min-height:70px;display:flex;align-items:center;justify-content:center;gap:0;padding:0 64px;background:var(--rivets),linear-gradient(var(--action-hi),var(--action-lo));color:var(--action-text);border:2px solid var(--action-ink);border-radius:6px;box-shadow:inset 0 2px 0 var(--action-glint),inset 0 -3px 0 var(--action-edge),0 5px 12px rgba(0,0,0,.55);font-size:clamp(26px,2vw,32px);font-weight:700;letter-spacing:.4px;line-height:1;text-align:center;text-transform:none;white-space:nowrap;text-shadow:0 2px 0 var(--action-shade)}
body:not(.home-mode) #game-screen .sidebar .end-turn::before{content:"";position:absolute;left:18px;top:50%;width:32px;height:24px;margin-top:-12px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 28'%3E%3Cpath d='M4 3l11 11L4 25M19 3l11 11-11 11' fill='none' stroke='%23ffd28f' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;filter:drop-shadow(0 2px 0 var(--action-shade))}
body:not(.home-mode) #game-screen .sidebar .end-turn b{font-size:30px;line-height:1}
/* Tour prêt à terminer : même plaque rouille, allumée d'un liseré doré. */
body:not(.home-mode) #game-screen .sidebar .end-turn.turn-complete{background:var(--rivets),linear-gradient(#e86d36,#b4461c)!important;color:#fff7ea!important;border-color:var(--action-ink)!important;box-shadow:inset 0 2px 0 #f7a477,inset 0 -3px 0 var(--action-edge),0 0 0 2px var(--gold),0 0 18px rgba(232,176,65,.45)!important}
/* Toutes les plaques suivent exactement la largeur de la colonne */
body:not(.home-mode) #game-screen .sidebar>*{box-sizing:border-box;width:100%;margin-left:0;margin-right:0}

/* ---------- Pied de page ---------- */
body:not(.home-mode) .footer{margin-top:14px;padding:12px 18px;border-radius:6px 6px 0 0;background:linear-gradient(var(--footer-hi),var(--footer-lo));border-top:1px solid var(--frame-line);color:var(--dim);font-size:11px}
body:not(.home-mode) .footer b{color:var(--rust-hi)}
body:not(.home-mode) .footer button,body:not(.home-mode) .footer a{color:var(--txt)}

/* ---------- États : survol, focus clavier ou manette, appui, désactivé ---------- */
body:not(.home-mode) .topbar .icon-button:hover,body:not(.home-mode) #game-screen .sidebar .zoom button:hover:not(:disabled){border-color:var(--gold);color:var(--hud-strong)}
body:not(.home-mode) #game-screen .sidebar :is(.next-unit,.end-turn):hover:not(:disabled){filter:brightness(1.07)}
body:not(.home-mode) .topbar :is(button,a):focus-visible,body:not(.home-mode) #game-screen :is(button,summary,select):focus-visible,body:not(.home-mode) .footer :is(button,a):focus-visible{outline:3px solid var(--gold);outline-offset:2px;box-shadow:0 0 0 7px rgba(232,176,65,.32)}
body:not(.home-mode) :is(.topbar,#game-screen,.footer) .gamepad-focus{outline:3px solid var(--gold)!important;outline-offset:2px!important;box-shadow:0 0 0 7px rgba(232,176,65,.32)}
body:not(.home-mode) #game-screen .sidebar .fold>summary:is(:focus-visible,.gamepad-focus){outline-offset:-4px!important;box-shadow:inset 0 0 0 7px rgba(232,176,65,.28)}
body:not(.home-mode) #game-screen :is(button,.icon-button):active:not(:disabled){transform:translateY(1px);filter:brightness(.93)}
body:not(.home-mode) :is(.topbar,#game-screen) :is(button,.icon-button):disabled:not(.power-track){filter:grayscale(.75) brightness(.8);cursor:not-allowed}
@media(prefers-reduced-motion:reduce){body:not(.home-mode) #game-screen :is(button,.icon-button):active{transform:none}}

/* Bureau moyen (1250 à 1599 px) : cartouche et modules resserrés, Pause en icône (titre et aria-label conservés). */
@media(max-width:1599px){
 body:not(.home-mode){--day-w:96px}
 body:not(.home-mode) .top-hud h1{font-size:20px;letter-spacing:.3px}
 body:not(.home-mode) .game-day{font-size:22px}
 body:not(.home-mode) .top-hud>*{padding:0 12px}
 body:not(.home-mode) .top-hud .side-group{--portrait:42px;padding:0 14px;column-gap:9px}
 body:not(.home-mode) .top-hud .side-group>span{right:14px}
 body:not(.home-mode) .top-hud .power-track [id^="power-owner"]{font-size:19px;padding-right:66px}
 body:not(.home-mode) .top-right{gap:8px}
 body:not(.home-mode) .topbar .icon-button{min-width:46px;padding:0 12px}
 body:not(.home-mode) #pause-button{min-width:46px}
 body:not(.home-mode) #pause-button span{display:none}
}
/* Bureau étroit (1101 à 1249 px) : priorité aux informations ; libellés secondaires plus petits. */
@media(max-width:1249px){
 body:not(.home-mode){--mission-w:clamp(228px,calc(30vw - 110px),264px);--day-w:78px}
 body:not(.home-mode) .top-hud{grid-template-columns:max-content minmax(170px,190px) minmax(160px,240px) minmax(160px,240px)}
 body:not(.home-mode) .top-hud h1{font-size:17px;letter-spacing:0}
 body:not(.home-mode) .top-hud .mission-title{margin-right:10px;padding-left:34px}
 body:not(.home-mode) .game-day{font-size:20px}
 body:not(.home-mode) .top-hud .economy-overview{padding:0 8px;column-gap:8px}
 body:not(.home-mode) .top-hud .economy-overview small{font-size:10px;letter-spacing:1px}
 body:not(.home-mode) .top-hud .economy-overview strong{font-size:20px;--coin:15px}
 body:not(.home-mode) .top-hud .side-group{--portrait:38px;padding:0 10px;column-gap:8px}
 body:not(.home-mode) .top-hud .side-group>span{right:10px;padding:0 6px 0 5px}
 body:not(.home-mode) .top-hud .power-track [id^="power-owner"]{font-size:18px;padding-right:60px}
 body:not(.home-mode) .top-right{gap:6px}
 body:not(.home-mode) .topbar .icon-button{min-width:42px;padding:0 10px}
}
/* Talents : le panneau Commandant défile si sa hauteur est bornée, pour garder les talents accessibles. */
body:not(.home-mode) #game-screen .sidebar>.commander-fold[open]{overflow-y:auto}
body:not(.home-mode) #game-screen .sidebar .commander-talents{color:var(--ink);border-top-color:var(--paper-line)}
body:not(.home-mode) .game-day:has(.day-phase:not([hidden])){flex-wrap:wrap;align-content:center;row-gap:1px;line-height:1}
body:not(.home-mode) .game-day .day-phase{flex-basis:100%;text-align:center;font-size:12px;line-height:1.1}
body:not(.home-mode) .game-day .day-phase[data-phase=day]{color:var(--ink-soft)}
body:not(.home-mode) .game-day .day-phase[data-phase=night]{color:#2c4f9e}body:not(.home-mode) .game-day .day-phase[data-phase=dusk]{color:#b4561f}body:not(.home-mode) .game-day .day-phase[data-phase=dawn]{color:#a8476a}

/* Barre du haut : le résumé à gauche, les boutons à droite, toujours sur une seule ligne. Les boutons (Pause, Son,
   Aide, Plein écran) ont tous la même taille : carrés à icône jusqu'à 1599 px, avec leur nom et une largeur commune
   au-delà, où la place le permet. Sans icône visible, le nom reste lu par les lecteurs d'écran (aria-label). */
body:not(.home-mode) .topbar>.top-hud{grid-column:1;grid-row:1;width:auto;min-width:0;margin:0;flex-wrap:nowrap}
body:not(.home-mode) .topbar>.top-right{grid-column:2;grid-row:1;display:grid;grid-auto-flow:column;align-items:center;width:auto;max-width:none;margin:0;padding:0;gap:6px}
body:not(.home-mode) .topbar .top-right :is(#editor-top,#sound,#help,#settings-open,#pause-button,#fullscreen-toggle).nav-control{width:100%;min-width:0;padding:0 12px}
@media(min-width:1600px){body:not(.home-mode) .topbar>.top-right{grid-auto-columns:132px}
 /* Nom lisible à côté de l'icône (il restait en 11 px dans un bouton de 132 px). */
 body:not(.home-mode) .topbar .top-right :is(#editor-top,#sound,#help,#settings-open,#pause-button,#fullscreen-toggle).nav-control .nav-label{font:700 14px/1.1 var(--font-ui)}}
@media(max-width:1599px){
 body:not(.home-mode) .topbar>.top-right{grid-auto-columns:46px}
 body:not(.home-mode) .topbar .top-right :is(#editor-top,#sound,#help,#settings-open,#pause-button,#fullscreen-toggle).nav-control{height:46px;min-height:46px;padding:0}
 body:not(.home-mode) .topbar .top-right :is(#editor-top,#sound,#help,#settings-open,#pause-button,#fullscreen-toggle).nav-control .nav-label{display:none}
}
/* Tablette : le résumé se resserre pour laisser la place aux boutons (titre plus étroit, sans les mots « Fonds » et
   « Revenus », camps qui se partagent la largeur restante). */
@media(max-width:1100px){
 body:not(.home-mode){--mission-w:clamp(170px,calc(21vw - 10px),220px);--day-w:70px}
 body:not(.home-mode) .top-hud{grid-template-columns:max-content max-content minmax(0,1fr) minmax(0,1fr);gap:0}
 body:not(.home-mode) .top-hud .mission-title{margin-right:8px;padding-left:30px}
 body:not(.home-mode) .top-hud .economy-overview small{display:none}
 body:not(.home-mode) .top-hud .economy-overview{flex:none;grid-template-columns:auto;padding:0 6px}
 body:not(.home-mode) .top-hud .economy-overview strong{grid-column:1}
 body:not(.home-mode) .top-hud .side-group{min-width:0;padding:0 8px}
 body:not(.home-mode) .top-hud .side-group .power-track{width:100%;min-width:0}
}
/* Petite tablette (jusqu'à 960 px) : on garde le nom de la mission, les chiffres, la couleur du camp et la jauge ;
   « Opération », « Pouvoir », « Alliés » et « Ennemis » s'effacent (lus par les lecteurs d'écran ailleurs). */
@media(max-width:960px){
 body:not(.home-mode){--mission-w:184px;--day-w:62px}
 body:not(.home-mode) .top-hud .mission-title{padding-left:28px}
 body:not(.home-mode) .top-hud .side-group{--portrait:34px;padding:0 10px 0 8px;column-gap:8px}
 body:not(.home-mode) .top-hud .mission-title h1{font-size:15px}
 body:not(.home-mode) .top-hud .economy-overview strong{font-size:18px;--coin:14px}
 /* Le portrait identifie le camp : le nom du commandant s'efface (il reste dans le panneau et le nom du bouton).
    L'effectif passe au-dessus de la jauge, qui garde sa charge à droite. */
 body:not(.home-mode) .top-hud .side-group{grid-template-rows:auto auto;row-gap:5px;align-content:center}
 body:not(.home-mode) .top-hud .side-group::before{grid-row:1/3}
 body:not(.home-mode) #top-hud .side-group>span{position:static;grid-column:2;grid-row:1;justify-self:start}
 body:not(.home-mode) .top-hud .side-group .power-track{grid-row:2;height:auto;grid-template-areas:"gauge state";row-gap:0}
 body:not(.home-mode) .top-hud .side-group [id^=power-owner-]{display:none}
 body:not(.home-mode) .top-hud .mission-name-lead{display:none}
 body:not(.home-mode) .top-hud .economy-overview{width:auto;min-width:0}
}
/* Tablette portrait étroite : la jauge suffit pour la charge ; « Prêt » et « Actif » restent affichés. */
/* Tablette portrait étroite : sans portrait ni charge écrite. L'effectif (teinté du camp) et la jauge suffisent ;
   pleine, la jauge pulse en or, et quand le pouvoir est activable « ACTIVER » prend la place de l'effectif. */
@media(max-width:860px){
 body:not(.home-mode) .top-hud .side-group{grid-template-columns:minmax(0,1fr);grid-template-rows:22px 10px;padding:0 8px}
 body:not(.home-mode) .top-hud .side-group::before{display:none}
 body:not(.home-mode) #top-hud .side-group>span{grid-column:1}
 body:not(.home-mode) #top-hud .side-group .power-track{grid-column:1;grid-row:1/3;grid-template-columns:minmax(0,1fr);grid-template-rows:22px 10px;grid-template-areas:"act" "gauge";row-gap:5px}
 body:not(.home-mode) #top-hud .side-group [id^=power-state-]{display:none}
 body:not(.home-mode) #top-hud .side-group .power-track.available .power-activate{grid-area:act;justify-self:start;align-self:center}
 body:not(.home-mode) #top-hud .side-group:has(.power-track.available)>span{visibility:hidden}
}
/* Sans pouvoirs, l'effectif reste seul, centré dans le module. */
@media(max-width:960px){body:not(.home-mode) #top-hud .side-group:has(.power-track.no-power){grid-template-rows:auto;row-gap:0}}
/* Tablette en portrait : la colonne de droite passe sous la carte, qui prend toute la largeur et 52 % de la hauteur ;
   les panneaux se rangent sur deux colonnes en dessous (plus de carte réduite au milieu d'un grand vide). */
@media(max-width:1100px) and (orientation:portrait){
 body:not(.home-mode) #game-screen .game-layout{grid-template-columns:minmax(0,1fr)}
 body:not(.home-mode) #game-screen .map-viewport{height:min(var(--board-h,52dvh),52dvh)}
 body:not(.home-mode) #game-screen .sidebar{height:auto;max-height:none;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
 body:not(.home-mode) #game-screen .sidebar>*{min-width:0}
 /* « Unités à jouer » et « Fin du tour » juste sous la carte, à portée de main. */
 body:not(.home-mode) #game-screen .sidebar>:is(.next-unit,.end-turn){order:-1}
}
/* Jour et météo dans le cartouche : « Jour 1 » et la phase à gauche, la météo (actuelle et prévision) à droite, dans
   une case élargie d'autant. Avant, la météo s'intercalait entre « Jour » et « 1 » et poussait le numéro hors du
   cartouche. */
@media(min-width:761px) and (min-height:521px){
 body:not(.home-mode):has(#game-day #weather-status:not([hidden])){--wx-w:96px}
 body:not(.home-mode) .game-day:has(#weather-status:not([hidden])){display:grid;grid-template-columns:auto auto minmax(0,1fr);grid-template-areas:"label num wx" "phase phase wx";align-content:center;align-items:center;justify-content:start;column-gap:5px;row-gap:2px;padding:0 6px 0 10px;line-height:1}
 body:not(.home-mode) .game-day:has(#weather-status:not([hidden]))>#day-label{grid-area:label}
 body:not(.home-mode) .game-day:has(#weather-status:not([hidden]))>#day{grid-area:num}
 body:not(.home-mode) .game-day:has(#weather-status:not([hidden]))>#day-phase{grid-area:phase;text-align:left}
 body:not(.home-mode) .game-day:has(#weather-status:not([hidden]))>#weather-status{grid-area:wx;justify-self:end;align-self:center;margin-left:4px}
}
