/* STRONGHOLD PROTOCOL: LEGION V1.2: INDUSTRIAL FIELD TERMINAL
   Presentation-only skin: the battle, inventory, recruitment and observers
   remain the same DOM / same running LegionRoom as the debug interface.
   No third-party art or fonts are included. */
.formal-toolbar,.formal-situationbar,.formal-field-tools,.formal-board-actions,.formal-drawer-head,.formal-drawer-shade{display:none}
.legion-game.mode-formal{--f-bg:#101a20;--f-panel:#17232a;--f-line:#6d8588;--f-mint:#9be5ce;--f-gold:#e3bf82;--f-orange:#e4a465;--f-text:#ebf0ed;min-height:100vh;background:#0d151a;color:var(--f-text);background-image:linear-gradient(145deg,#172329,#0c151b 63%)}
/* The existing page-header retains exit & skin switch, but the game's toolbar owns the visual hierarchy. */
.legion-game.mode-formal .legion-header{position:absolute;top:0;left:0;right:0;z-index:35;display:flex;align-items:center;justify-content:flex-end;min-height:58px;height:58px;padding:6px 15px!important;background:none;border:0;box-shadow:none;pointer-events:none}
.legion-game.mode-formal .legion-header:before{display:none}
.legion-game.mode-formal .legion-header .brand{display:none}
.legion-game.mode-formal .legion-header .right{display:flex;align-items:center;gap:7px;pointer-events:auto}
.legion-game.mode-formal .legion-header .right #phase-label{display:none}
.legion-game.mode-formal .legion-header .right .back{display:none;align-items:center;min-height:34px;padding:6px 10px;border:1px solid #637579;color:#bbc6c6;background:#243138a8;font-size:10px;white-space:nowrap;text-decoration:none}
.legion-game.mode-formal .ui-mode-toggle{min-height:34px;border:1px solid #a2bbab;background:#31423d;color:#d7f1e7;font-size:10px;padding:6px 12px;letter-spacing:.1px}
/* V1.5.2: keep the debug return in the visible formal toolbar. */
.legion-game.mode-formal .legion-header .right #ui-mode-toggle{display:none!important}
.legion-game.mode-formal .formal-debug-return{
 position:absolute;right:15px;top:11px;z-index:40;display:inline-flex;align-items:center;justify-content:center;
 min-height:34px;padding:7px 12px;border:1px solid #a2bbab;border-radius:3px;
 background:linear-gradient(110deg,#314b45,#253a3b);color:#d7f1e7;
 font-size:11px;font-weight:700;letter-spacing:.35px;white-space:nowrap;cursor:pointer;
 box-shadow:0 2px 8px #0005;transition:background .13s,border-color .13s,transform .13s;
}
.legion-game.mode-formal .formal-debug-return:hover{background:#42645a;border-color:#b8efda;transform:translateY(-1px)}
.legion-game.mode-formal .formal-debug-return:focus-visible{outline:2px solid #a9ead5;outline-offset:2px}
.legion-game.mode-formal .formal-debug-return[hidden]{display:none!important}
.legion-game.mode-formal .ui-mode-status{display:none}
.legion-game.mode-formal .room-strip{display:none}
.legion-game.mode-formal .formal-toolbar{position:relative;z-index:26;display:flex;align-items:center;justify-content:space-between;gap:15px;min-height:58px;padding:7px 303px 7px 22px;width:100%;background:linear-gradient(91deg,#202d31 0%,#16272b 62%,#101b21 100%);border-bottom:1px solid #aebcb64b;box-shadow:0 4px 21px #000b}
.formal-toolbar-brand{display:flex;align-items:center;gap:11px;min-width:245px}
.formal-brand-mark{width:38px;height:38px;display:grid;place-items:center;position:relative;transform:skew(-10deg);border:2px solid #9de0cd;background:#6cac9823;font:900 22px Consolas,monospace;line-height:1;color:#d1f8e9;box-shadow:4px 4px 0 #89cbb034}
.formal-brand-mark span{font-size:10px;position:absolute;top:2px;right:1px;color:#e0bb85}
.formal-toolbar-brand b{display:block;font-size:16px;letter-spacing:1.9px;color:#e4f4ef}
.formal-toolbar-brand small{display:block;font:9px Consolas,monospace;color:#90adaf;letter-spacing:1.1px;margin-top:4px}
.formal-nav-actions{display:flex;align-items:center;gap:5px;min-width:0;flex-wrap:nowrap}
.legion-game.mode-formal .formal-nav-actions button{cursor:pointer;color:#c6d8d4;background:#24353c;border:1px solid #627b7d;padding:7px 10px;min-width:79px;min-height:34px;white-space:nowrap;font-size:12px;font-weight:600;letter-spacing:.4px;transition:background .13s}
.legion-game.mode-formal .formal-nav-actions button span{font-size:14px;color:#8cddc8;margin-right:5px}
.legion-game.mode-formal .formal-nav-actions button:hover,.legion-game.mode-formal .formal-nav-actions button.active{background:#376056;border-color:#aae8d7;color:#fff}
.legion-game.mode-formal .room-main{display:block!important;width:100%;max-width:none!important;margin:0!important;padding:0 12px 12px!important;gap:0!important}
.legion-game.mode-formal .room-main .battle{width:100%;max-width:none!important;min-height:0!important;max-height:none!important;border:0;box-shadow:none;background:transparent;padding:0!important;gap:0}
.legion-game.mode-formal .formal-situationbar{display:flex;justify-content:center;align-items:stretch;gap:0;width:min(100%,1380px);margin:7px auto 8px;height:62px;background:#132128df;border:1px solid #78858370;box-shadow:0 3px 20px #0007}
.formal-situation-segment{display:flex;flex-direction:column;gap:3px;align-items:flex-start;justify-content:center;padding:8px 19px;border-right:1px solid #63777874;min-width:0}
.formal-situation-segment:last-child{border:0}
.formal-situation-segment small{font:9px Consolas,monospace;color:#87a3a6;white-space:nowrap;letter-spacing:.8px}
.formal-situation-segment strong{white-space:nowrap;font:700 19px Consolas,'Microsoft Yahei',sans-serif;color:#ebf4ee;font-variant-numeric:tabular-nums}
.formal-situation-segment strong i{font:600 13px Consolas,monospace;color:#7fa4a5}
.formal-situationbar .formal-phase{flex:1;min-width:155px}
.formal-phase strong{color:#a6e9cb;font-size:16px;letter-spacing:1px}
.formal-kings{min-width:290px}
.formal-kings strong{display:flex;align-items:baseline;gap:16px;font-size:14px}
.formal-kings #formal-blue-king{color:#94cfee}.formal-kings #formal-red-king{color:#eda49a}
.formal-versus{color:#647c80;font:9px Consolas,monospace}
.formal-economy strong,.formal-economy strong i{font-size:20px!important;color:#f1d28a!important}
.formal-capacity strong{color:#b1ded0;font-size:16px}
.legion-game.mode-formal .battle-top{display:none}
.legion-game.mode-formal .view-toolbar{display:none}
.legion-game.mode-formal .board-wrap{width:min(100%,calc((100vh - 400px) * 1.7777778));max-width:1400px!important;aspect-ratio:16/9!important;margin:0 auto;min-height:0;align-self:center;border:1px solid #889a92;box-shadow:0 0 0 5px #18252baa,0 7px 25px #000d;background:#0a1318}
.legion-game.mode-formal .board-wrap:after{border:0;box-shadow:inset 0 0 30px #060f1499;z-index:8}
.legion-game.mode-formal .field-hud-top{padding:8px 11px;background:linear-gradient(#05131acb,transparent)}
.legion-game.mode-formal .field-hud-foot{padding:10px 12px;background:linear-gradient(0deg,#071318db,transparent)}
.legion-game.mode-formal .field-serial{color:#bad3c7;opacity:.8;font-size:9px}
.legion-game.mode-formal .field-live{background:#142b2dcf;font-size:10px;box-shadow:0 3px 8px #0008}
.legion-game.mode-formal .field-hud-foot span{font-size:9px}
.legion-game.mode-formal .formal-board-actions{position:absolute;z-index:9;right:14px;bottom:43px;display:flex;flex-direction:column;align-items:end;gap:7px;pointer-events:none}
.legion-game.mode-formal .formal-board-actions button{pointer-events:auto;cursor:pointer;border:1px solid #c3dfcf;color:#ecfff8;background:#228272ed;min-width:155px;min-height:48px;padding:11px 15px;text-align:center;font-size:14px;font-weight:800;letter-spacing:1.5px;box-shadow:5px 5px 0 #061112a8}
.legion-game.mode-formal .formal-board-actions button:disabled{opacity:.45;filter:grayscale(1);cursor:not-allowed}
.legion-game.mode-formal .formal-board-actions button[hidden]{display:none!important}
.legion-game.mode-formal .formal-board-actions .formal-ready{background:#28525fe8;border-color:#86c4cf;min-height:35px;font-size:12px}
.legion-game.mode-formal .formal-board-actions .formal-ready.is-ready{background:#714530ed;border-color:#e6b987}
.legion-game.mode-formal .formal-board-actions .formal-secondary{background:#7a4940;border-color:#d0a78a}
.legion-game.mode-formal .formal-field-tools{display:flex;align-items:center;justify-content:space-between;gap:15px;min-height:44px;width:min(100%,1380px);margin:7px auto 0;border-top:1px solid #647c79;background:#17282d;padding:5px 10px}
.formal-team-summary{display:flex;align-items:center;gap:11px;color:#83abb0;font:10px Consolas,monospace;letter-spacing:1px;white-space:nowrap}
#formal-team-dots{display:flex;gap:4px}
.formal-squad-seat{display:inline-grid;place-items:center;background:#25424a;border:1px solid #59868e;color:#d6f1e9;width:25px;height:24px;font:700 10px Consolas,monospace}
.formal-squad-seat:first-child{border-color:#b2deca;box-shadow:0 0 0 1px #7cbeac73 inset}.formal-squad-seat.finished{background:#245847;border-color:#81ddab}
.formal-field-controls{display:flex;gap:4px;align-items:center}
.legion-game.mode-formal .formal-field-controls button{min-height:29px;padding:6px 10px;border:1px solid #4e7379;background:#213940;color:#d3e9e3;font-size:10px;white-space:nowrap;cursor:pointer}
.legion-game.mode-formal .formal-field-controls button:hover:not(:disabled){background:#41645a;border-color:#91d8bb}
.legion-game.mode-formal .formal-field-controls button:disabled{opacity:.45;cursor:not-allowed}
.legion-game.mode-formal .formal-field-controls button[hidden]{display:none!important}
.legion-game.mode-formal .inventory-strip{width:min(100%,1380px);margin:9px auto 0;padding:7px 10px 8px;border:1px solid #76948b;border-top:3px solid #c4ab81;background:linear-gradient(135deg,#1c2d31,#14252d);box-shadow:0 7px 20px #0007}
.legion-game.mode-formal .inventory-title{margin-bottom:3px}
.legion-game.mode-formal .inventory-title strong{font-size:12px;color:#e3f3ed;letter-spacing:.8px}
.legion-game.mode-formal .inventory-title small{font-size:9px;color:#85adaf}
.legion-game.mode-formal .dock-kicker{font-size:9px;color:#ddbe87}
.legion-game.mode-formal .inventory-list{min-height:105px;padding:4px 1px 3px;gap:7px;margin-top:1px}
.legion-game.mode-formal .inventory-card{flex:0 0 92px;width:92px;min-height:96px;background:linear-gradient(150deg,#334046,#16242b);border:1px solid #728788;border-top:2px solid #b4a17b;box-shadow:3px 3px 0 #030b10b0}
.legion-game.mode-formal .inventory-card.selected{border-color:#b1f8d0;box-shadow:inset 0 0 0 1px #75e2be,0 0 13px #72d7b26a}
.legion-game.mode-formal .inventory-card.is-empty{background:repeating-linear-gradient(135deg,#14242a,#14242a 9px,#1b3035 10px,#1b3035 11px)}
.legion-game.mode-formal .inventory-portrait{max-height:70px}
.legion-game.mode-formal .garrison-strip{width:min(100%,1380px);margin:7px auto 0;border-color:#728d9c;border-top:3px solid #8fb4c0;background:#192830}
.legion-game.mode-formal .garrison-list{min-height:65px}
.legion-game.mode-formal .garrison-card{min-height:62px}
.legion-game.mode-formal .duel-overlay{width:min(100%,1380px);margin:7px auto 0;background:#1d3034;border:1px solid #72939a;border-left:3px solid #a3dfc6}
.legion-game.mode-formal #message{width:min(100%,1380px);margin:6px auto 0;padding:7px 9px;background:#1b2b30;border:1px solid #627d78;color:#bcd8d3;min-height:28px;font-size:10px}
/* Side sheets: the existing roster, dispatch, settings and watchers are real functional controls. */
.legion-game.mode-formal .formal-drawer-shade{display:none;position:fixed;inset:0;z-index:39;background:#020609a1;backdrop-filter:blur(2px);cursor:pointer}
.legion-game.mode-formal[data-formal-drawer]:not([data-formal-drawer=""]) .formal-drawer-shade{display:block}
.legion-game.mode-formal .room-main .panel.buy-panel,.legion-game.mode-formal .room-main .panel.watch-panel{display:none;position:fixed;top:0;bottom:0;z-index:42;min-height:100vh!important;max-height:100vh!important;width:min(440px,94vw);overflow:auto;margin:0;padding:14px 15px 28px;background:linear-gradient(165deg,#24383d,#101c22 76%);border:0;border-left:1px solid #9bb5aa;box-shadow:-12px 0 35px #000b;scrollbar-width:thin;scrollbar-color:#54766d #17272b}
.legion-game.mode-formal .room-main .panel.buy-panel{right:0}
.legion-game.mode-formal .room-main .panel.watch-panel{left:0;border-left:0;border-right:1px solid #9bb5aa;box-shadow:12px 0 35px #000b}
.legion-game.mode-formal[data-formal-drawer="recruit"] .room-main .buy-panel,.legion-game.mode-formal[data-formal-drawer="dispatch"] .room-main .buy-panel,.legion-game.mode-formal[data-formal-drawer="settings"] .room-main .buy-panel,.legion-game.mode-formal[data-formal-drawer="watch"] .room-main .watch-panel{display:block}
.legion-game.mode-formal .buy-group{display:none}
.legion-game.mode-formal[data-formal-drawer="recruit"] .buy-group[data-buy-group="recruit"],.legion-game.mode-formal[data-formal-drawer="dispatch"] .buy-group[data-buy-group="dispatch"],.legion-game.mode-formal[data-formal-drawer="settings"] .buy-group[data-buy-group="settings"]{display:block}
.legion-game.mode-formal .formal-drawer-head{display:flex;position:sticky;top:-14px;z-index:1;align-items:center;justify-content:space-between;gap:14px;padding:16px 0 14px;margin-bottom:12px;background:#22353a;color:#edfff6;border-bottom:1px solid #a5c8b6;font-size:16px;font-weight:800;letter-spacing:.9px}
.legion-game.mode-formal .formal-close{cursor:pointer;border:1px solid #8ca5a1;background:#2d4646;color:#edf8f4;min-width:32px;height:32px;font-size:15px}
.legion-game.mode-formal .panel .heading{font-size:11px;color:#c6e8d8;border-color:#5a7976;margin-top:9px}
.legion-game.mode-formal .recruit{background:#21353c;border:1px solid #607b7c;min-height:63px}
.legion-game.mode-formal .recruit .price{color:#edc387}
.legion-game.mode-formal .command-actions #next-wave{background:#236d60}
.legion-game.mode-formal .watch-btn.active{background:#2d5757;border-color:#b4ead9}
/* In combat, the soldiers remain the focus: no accidental giant debug panels. */
.legion-game.mode-formal .field-hud{z-index:5}
.legion-game.mode-formal .phase-cinematic{z-index:10}
.legion-game.mode-formal .board-wrap.inspection-flying .formal-board-actions{pointer-events:none}
.legion-game.mode-formal.duel-active .board-wrap{width:min(100%,calc((100vh - 555px) * 1.7777778));min-width:0}
.legion-game.mode-formal.duel-active .formal-board-actions button{min-height:37px;padding:6px 11px}
.legion-game.mode-formal.duel-active .inventory-list{min-height:86px}
.legion-game.mode-formal.duel-active .garrison-strip{padding:5px 9px}
@media(max-height:790px){
 .legion-game.mode-formal .board-wrap{width:min(100%,calc((100vh - 320px) * 1.7777778))}
 .legion-game.mode-formal.duel-active .board-wrap{width:min(100%,calc((100vh - 490px) * 1.7777778))}
 .legion-game.mode-formal .inventory-list{min-height:85px}
 .legion-game.mode-formal .formal-situationbar{height:51px}
}
@media(max-width:1180px){
 .legion-game.mode-formal .formal-toolbar{padding-right:270px;padding-left:12px}
 .formal-toolbar-brand{min-width:195px}.formal-toolbar-brand b{font-size:13px}
 .formal-toolbar-brand small{font-size:8px}
 .legion-game.mode-formal .formal-nav-actions button{min-width:0;padding:6px 7px;font-size:10px}
 .formal-kings{min-width:230px}.formal-situation-segment{padding:6px 12px}
}
@media(max-width:850px){
 .legion-game.mode-formal .formal-debug-return{right:9px;top:7px;min-height:28px;padding:5px 8px;font-size:9px}
 .legion-game.mode-formal .formal-toolbar{padding:6px 10px 6px 8px;flex-direction:column;align-items:flex-start;min-height:94px}
 .legion-game.mode-formal .formal-toolbar-brand{min-height:30px}
 .legion-game.mode-formal .formal-nav-actions{width:100%}
 .legion-game.mode-formal .formal-nav-actions button{flex:1}
 .legion-game.mode-formal .legion-header{justify-content:flex-end;height:40px;min-height:40px}
 .legion-game.mode-formal .legion-header .right .back{display:none}
 .legion-game.mode-formal .ui-mode-toggle{font-size:9px;padding:4px 5px;min-height:27px}
 .legion-game.mode-formal .formal-situationbar{flex-wrap:wrap;height:auto;gap:0}
 .formal-situation-segment{flex:1 1 30%;padding:7px!important}
 .formal-situation-segment small{font-size:8px}
 .formal-situation-segment strong{font-size:14px}
 .formal-kings{min-width:0}
 .legion-game.mode-formal .board-wrap{width:100%}
 .legion-game.mode-formal.duel-active .board-wrap{width:100%}
 .formal-field-tools{flex-wrap:wrap}
 .formal-team-summary{display:none}
 .formal-field-controls{width:100%;justify-content:center;flex-wrap:wrap}
 .legion-game.mode-formal .formal-board-actions button{min-width:115px;font-size:11px;min-height:36px;padding:6px}
 .legion-game.mode-formal .formal-board-actions{right:5px;bottom:31px}
 .legion-game.mode-formal .inventory-title small{display:none}
}
@media(prefers-reduced-motion:reduce){.legion-game.mode-formal .formal-nav-actions button{transition:none}}

/* Short-card variant leaves the entire reserve shelf in the viewport at 900p. */
.legion-game.mode-formal .inventory-entry{min-height:71px}
.legion-game.mode-formal .inventory-portrait{height:46px}
.legion-game.mode-formal .inventory-card{min-height:88px}
.legion-game.mode-formal .inventory-list{min-height:90px}

/* Maintain team-specific observer trim over the formal mode's general inset. */
.legion-game.mode-formal .board-wrap[data-observation="blue"]:after{
 box-shadow:inset 0 0 0 4px #67b5f294,inset 0 0 45px #13517daa}
.legion-game.mode-formal .board-wrap[data-observation="red"]:after{
 box-shadow:inset 0 0 0 4px #eb7f8299,inset 0 0 45px #7d212db0}


/* V1.2.4: full-scene reserve bay prototype. The playable logic is unchanged;
   this only turns the lower inventory into an in-world 3D staging area and
   lets the duel-only dock stack with it like a secondary shelf. */
.legion-game.mode-formal .battle{position:relative}
.legion-game.mode-formal .battle-top,.legion-game.mode-formal .view-toolbar,.legion-game.mode-formal .board-wrap,.legion-game.mode-formal .formal-field-tools,.legion-game.mode-formal .reserve-bay,.legion-game.mode-formal #message{width:min(100%,1500px)}
.legion-game.mode-formal .battle-top,.legion-game.mode-formal .view-toolbar,.legion-game.mode-formal .board-wrap,.legion-game.mode-formal .formal-field-tools,.legion-game.mode-formal .reserve-bay,.legion-game.mode-formal #message{margin-left:auto;margin-right:auto}
.legion-game.mode-formal .battle-top{margin-top:2px}
.legion-game.mode-formal .board-wrap{width:min(100%,1500px);border-color:#a7c7c9;box-shadow:0 0 0 1px #22353d,0 22px 48px #000a}
.legion-game.mode-formal .formal-field-tools{margin-top:5px;background:linear-gradient(180deg,#182b30,#132027);border-top:1px solid #6b8a8b;border-left:1px solid #324a53;border-right:1px solid #324a53;border-bottom:0}
.legion-game.mode-formal .reserve-bay{position:relative;display:grid;gap:10px;margin-top:-2px;padding:0 8px 12px;border:1px solid #304851;border-top:0;background:linear-gradient(180deg,#111c22,#0c151b 38%,#10191f 100%);box-shadow:0 16px 38px #0008}
.legion-game.mode-formal .reserve-bay:before{content:"";position:absolute;left:18px;right:18px;top:14px;height:18px;background:linear-gradient(90deg,#2d4950,#4f7980 24%,#2d4950 50%,#4f7980 76%,#2d4950);opacity:.38;filter:blur(10px);pointer-events:none}
.legion-game.mode-formal .reserve-bay:after{content:"RESERVE BAY / WAITING PLATFORM";position:absolute;right:16px;bottom:8px;color:#668287;font:9px Consolas,monospace;letter-spacing:2px;pointer-events:none;opacity:.7}
.legion-game.mode-formal .reserve-bay.has-duel{grid-template-rows:auto auto}
.legion-game.mode-formal .garrison-strip,.legion-game.mode-formal .inventory-strip{position:relative;overflow:hidden;margin:0;padding:14px 14px 14px;border:1px solid #6d8a8e;background:linear-gradient(180deg,#18262c,#10191f 50%,#172129 100%);box-shadow:inset 0 1px 0 #d5f7ff14,0 10px 18px #0006}
.legion-game.mode-formal .garrison-strip:before,.legion-game.mode-formal .inventory-strip:before{content:"";position:absolute;left:10px;right:10px;top:44px;height:58px;background:linear-gradient(180deg,#30464d,#24363b 52%,#121d22);transform-origin:top;transform:perspective(1200px) rotateX(72deg);border:1px solid #426069;box-shadow:0 8px 18px #0008,inset 0 0 0 1px #8ebac020}
.legion-game.mode-formal .garrison-strip:after,.legion-game.mode-formal .inventory-strip:after{content:"";position:absolute;left:12px;right:12px;bottom:0;height:18px;background:linear-gradient(180deg,#21343a,#0d1419);border-top:1px solid #50707a;box-shadow:0 -1px 0 #0a1014 inset}
.legion-game.mode-formal .garrison-strip>*,.legion-game.mode-formal .inventory-strip>*{position:relative;z-index:1}
.legion-game.mode-formal .inventory-title{display:flex;align-items:end;justify-content:space-between;gap:10px;margin-bottom:8px;padding:0 2px}
.legion-game.mode-formal .inventory-title strong{font-size:13px;letter-spacing:1px}
.legion-game.mode-formal .inventory-title small{font-size:10px;max-width:52%;line-height:1.4}
.legion-game.mode-formal .dock-kicker{color:#9accc8}
.legion-game.mode-formal .garrison-strip .dock-kicker{color:#b9cce0}
.legion-game.mode-formal .inventory-list,.legion-game.mode-formal .garrison-list{position:relative;display:flex;align-items:flex-end;gap:12px;min-height:162px;padding:18px 4px 12px;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;scrollbar-color:#5a7d85 #101a21}
.legion-game.mode-formal .garrison-list{min-height:126px;padding-top:14px}
.legion-game.mode-formal .inventory-card,.legion-game.mode-formal .garrison-card{position:relative;overflow:visible;border-radius:0;transform:translateY(0);transition:transform .13s ease,filter .13s ease,box-shadow .13s ease}
.legion-game.mode-formal .inventory-card{flex:0 0 112px;width:112px;min-height:116px;padding:0;border:1px solid #7f999c;border-top:3px solid #cdb48a;background:linear-gradient(180deg,#394951,#25353d 38%,#18242b 100%);box-shadow:0 12px 0 #111920,0 18px 24px #0008}
.legion-game.mode-formal .inventory-card:before,.legion-game.mode-formal .garrison-card:before{content:"";position:absolute;left:7px;right:7px;bottom:-13px;height:13px;background:linear-gradient(180deg,#21343a,#10161c);border:1px solid #4c6870;border-top:0}
.legion-game.mode-formal .inventory-card:after,.legion-game.mode-formal .garrison-card:after{content:"";position:absolute;left:5px;right:5px;bottom:-18px;height:4px;background:radial-gradient(ellipse at center,#88d8c933 0,#88d8c900 70%)}
.legion-game.mode-formal .inventory-card:hover:not(.is-empty),.legion-game.mode-formal .garrison-card:hover:not(:disabled){transform:translateY(-4px);filter:brightness(1.08)}
.legion-game.mode-formal .inventory-card.selected,.legion-game.mode-formal .garrison-card.selected{box-shadow:0 12px 0 #111920,0 18px 24px #0008,0 0 0 1px #8ee2c6 inset,0 0 16px #5bc5a96b}
.legion-game.mode-formal .inventory-card.is-empty{display:grid;place-items:end center;flex:0 0 94px;width:94px;min-height:105px;border:1px dashed #44616a;border-top:2px solid #617b82;background:linear-gradient(180deg,#16242c,#111a20);color:#5e7b80;opacity:.9}
.legion-game.mode-formal .inventory-card.is-empty:before{left:4px;right:4px;background:linear-gradient(180deg,#15242b,#0e141a)}
.legion-game.mode-formal .inventory-card.is-empty{padding-bottom:18px;font:700 18px Consolas,monospace}
.legion-game.mode-formal .inventory-entry{position:relative;display:flex;flex-direction:column;justify-content:flex-start;gap:5px;min-height:92px;padding:6px 7px 4px;background:transparent}
.legion-game.mode-formal .inventory-portrait{position:relative;height:54px;max-height:none;margin-top:-8px;padding:0 8px 6px;background:linear-gradient(180deg,#16242b,#0e181d);border:1px solid #4c646d;box-shadow:inset 0 1px 0 #d1f7ff18}
.legion-game.mode-formal .inventory-portrait:after{content:"";position:absolute;left:6px;right:6px;bottom:-1px;height:1px;background:linear-gradient(90deg,transparent,#96d5cf,transparent);opacity:.65}
.legion-game.mode-formal .inventory-unit-name{font-size:11px;line-height:1.2;min-height:27px;letter-spacing:.2px}
.legion-game.mode-formal .inventory-tag{font-size:9px;border-top:1px solid #3c5961;padding-top:4px;color:#9dc7c0}
.legion-game.mode-formal .inventory-sell{min-height:22px;padding:4px 6px;background:#1a2a30;border-top:1px solid #4e656d;color:#f0c890;font-size:9px}
.legion-game.mode-formal .garrison-card{flex:0 0 104px;max-width:none;min-width:104px;min-height:92px;padding:6px 6px 10px;border:1px solid #738da2;border-top:3px solid #9cb3c8;background:linear-gradient(180deg,#314655,#1a2c37 44%,#11212b);box-shadow:0 10px 0 #111920,0 15px 22px #0008}
.legion-game.mode-formal .garrison-portrait{height:48px;max-height:none;background:linear-gradient(180deg,#15232c,#101a21);border:1px solid #455f71;padding:4px 6px}
.legion-game.mode-formal .garrison-card small{padding-top:5px;font-size:9px;letter-spacing:.3px;color:#dceaf2}
.legion-game.mode-formal .inventory-strip.is-locked,.legion-game.mode-formal .garrison-strip.is-locked{filter:saturate(.55)}
.legion-game.mode-formal .inventory-strip.is-locked .inventory-card:not(.selected):not(.is-empty),.legion-game.mode-formal .garrison-strip.is-locked .garrison-card:not(.selected){opacity:.55}
.legion-game.mode-formal .inventory-strip.is-locked .inventory-title small:before,.legion-game.mode-formal .garrison-strip.is-locked .inventory-title small:before{content:"LOCKED · ";color:#e5a06d}
.legion-game.mode-formal.duel-active .reserve-bay{margin-top:-4px}
.legion-game.mode-formal.duel-active .inventory-list{min-height:144px}
.legion-game.mode-formal.duel-active .garrison-list{min-height:118px}
@media(max-width:1024px){.legion-game.mode-formal .inventory-list,.legion-game.mode-formal .garrison-list{gap:10px}.legion-game.mode-formal .inventory-card{flex-basis:102px;width:102px}.legion-game.mode-formal .garrison-card{min-width:96px;flex-basis:96px}}
@media(max-width:850px){.legion-game.mode-formal .reserve-bay{padding-left:5px;padding-right:5px}.legion-game.mode-formal .inventory-title{flex-direction:column;align-items:flex-start}.legion-game.mode-formal .inventory-title small{max-width:none}.legion-game.mode-formal .inventory-list,.legion-game.mode-formal .garrison-list{min-height:136px;padding-top:16px}.legion-game.mode-formal .inventory-card{flex-basis:96px;width:96px}.legion-game.mode-formal .garrison-card{min-width:90px;flex-basis:90px}}

/* V1.3.0: a REAL world-space staging dock. BoardScene renders the raised
   metal platform, the existing Spine stage renders waiting unit actors. Only
   transparent pick targets and names are HTML. The previous cards remain in
   the debug view and as fallback when WebGL2 isn't available. */
.legion-game.mode-formal.world-reserves-active .reserve-bay{display:none!important}
.legion-game.mode-formal.world-reserves-active .board-wrap{
 width:min(100%,calc((100vh - 195px) * 1.77778));max-width:1500px;
 border:0!important;outline:0;box-shadow:0 10px 30px #0006;background:#0b1419;
}
.legion-game.mode-formal.world-reserves-active .field-hud-foot{bottom:0}
.legion-game.mode-formal.world-reserves-active .formal-field-tools{max-width:1500px;margin-top:0}
.reserve-world-host[hidden]{display:none!important}
.reserve-world-host{position:absolute;inset:0;z-index:9;pointer-events:none;overflow:hidden;font-family:'Microsoft Yahei',sans-serif}
.reserve-world-host :is(button){font-family:inherit}
.world-reserve-actor{position:absolute;transform:translate(-50%,-83%);width:7%;height:17%;min-width:38px;max-width:105px;min-height:46px;
 display:flex;align-items:center;justify-content:space-between;flex-direction:column;padding:2px 0 0;
 border:1px solid transparent;color:#e2f8f7;background:transparent;pointer-events:auto;cursor:grab;touch-action:none;
 user-select:none;-webkit-user-select:none;filter:drop-shadow(0 2px 2px #000b)}
.world-reserve-actor:not(:disabled):hover,.world-reserve-actor:focus-visible{outline:1px solid #a5f5d5;background:#50c9be1b}
.world-reserve-actor:disabled{cursor:default;opacity:.6}
.world-reserve-number{align-self:flex-start;padding:1px 4px;background:#152b36da;color:#c0dbdc;border-left:2px solid #ddb77f;font:9px Consolas,monospace}
.world-reserve-actor[data-kind="garrison"] .world-reserve-number{border-color:#89b9ef}
.world-reserve-name{display:block;width:100%;max-width:105px;padding:3px 4px;text-align:center;background:#0b1c28e8;border:1px solid #7cadaa99;
 font-size:clamp(8px,.74vw,11px);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.world-reserve-actor[data-kind="garrison"] .world-reserve-name{border-color:#89b9ef99}
.world-reserve-sell{position:absolute;transform:translate(-50%,-50%);min-height:18px;padding:3px 5px;border:1px solid #b18b59;background:#32241cdd;
 color:#ffe0a9;font-size:9px;cursor:pointer;pointer-events:auto}
.world-reserve-sell:hover:not(:disabled){background:#6d4125}
.world-reserve-sell:disabled{opacity:.35;cursor:default}
.world-reserve-pages{position:absolute;transform:translate(-50%,-50%);display:flex;align-items:center;gap:5px;padding:5px 7px;
 border:1px solid #6a9090;background:#0b1c24ea;color:#cae4e4;pointer-events:auto;white-space:nowrap;font:9px Consolas,monospace;
 box-shadow:0 4px 12px #0009}
.world-reserve-pages button{cursor:pointer;border:1px solid #658c91;background:#243e46;color:#e2f8f5;font-size:12px;min-width:22px;min-height:23px}
.world-reserve-pages button:disabled{opacity:.3;cursor:default}
.world-reserve-pages span:first-child{font-size:9px;max-width:142px;overflow:hidden;text-overflow:ellipsis}
.legion-game.mode-formal.world-reserves-active .phase-cinematic{z-index:12}
.legion-game.mode-formal.world-reserves-active .board-wrap[data-observation] .reserve-world-host{display:none}
@media(max-height:780px){.legion-game.mode-formal.world-reserves-active .board-wrap{width:min(100%,calc((100vh - 145px) * 1.77778))}}
@media(max-width:850px){.world-reserve-pages span:first-child{display:none}.world-reserve-sell{font-size:8px}}

/* Keep the central field dominant during combat: the old 2D cards should not
   suddenly return just because the waiting models have left the stage. */
.legion-game.mode-formal.world-reserves-mode .reserve-bay{display:none!important}
