/* Fixed battlefield and order dock; dialogs keep optional information accessible. */
.command-layout .move-plan-bar.reaction-risk{border-color:#e2a36f;background:#48362a}.command-layout .move-plan-bar.reaction-risk #movePlanSummary{color:#ffe1a2}
.command-layout .field-intel{flex-wrap:nowrap}.command-layout #fieldIntel{flex:0 0 auto;overflow-wrap:anywhere}.command-layout #movementIntel,.command-layout #pathHint{flex-shrink:0}.three-label-count b,.three-label-count strong{flex-shrink:0;white-space:nowrap}.three-unit-label.overwatch-ready.spent{opacity:1}
.command-layout #overwatchButton{border:1px solid #d7bd7e;background:#3c4834;color:#ffe0a0;border-radius:4px}.command-layout #overwatchButton.is-ready{background:#e1c47d;color:#233326;opacity:1}.overwatch-ready .card-state{color:#ffe19d!important}.command-layout .unit-card.overwatch-ready{border-color:#edcb7e;background:#41452f}.three-unit-label.overwatch-ready{border-color:#f2d58d;box-shadow:0 0 8px #f0cb7755}.three-unit-label.overwatch-ready .three-label-name{color:#ffe4a6}
.command-layout{height:100vh;height:100dvh;overflow:hidden;display:grid;grid-template-rows:52px minmax(0,1fr)}
.command-layout .topbar{height:52px;padding:0 14px}.command-layout .brand strong{font-size:22px}.command-layout .brand small{font-size:8px}.command-layout .crest{width:32px;height:32px;font-size:20px}.command-layout .chapter{font-size:14px}.command-layout .quiet{padding:6px 10px;min-height:36px}.command-layout .game-footer{display:none}
.command-layout .game-shell{width:100%;height:100%;min-height:0;max-width:1900px;padding:10px;display:block;overflow:hidden}
.command-layout .battle-column{height:100%;min-height:0;display:grid;grid-template-columns:minmax(0,1fr) 290px;grid-template-areas:'battle intel' 'tools intel' 'camera intel' 'roster intel' 'stage intel' 'stage plan' 'stage commands';grid-template-rows:44px 46px auto 54px minmax(0,1fr) 76px 96px;column-gap:10px}
.command-layout .battle-toolbar{grid-area:battle;height:auto;padding:3px 12px;border-radius:6px 6px 0 0}.command-layout .army-summary{gap:6px}.command-layout .army-summary strong{font-size:19px}.command-layout .army-summary small{font-size:9px}.command-layout .faction-symbol{font-size:18px}.command-layout .battle-clock strong{font-size:17px;line-height:1.1}.command-layout #phaseLabel{font-size:9px}.command-layout #battleObjective{font-size:10px;max-width:400px}
.command-layout .map-view-toolbar{grid-area:tools;min-height:0;padding:3px 7px;gap:4px;flex-wrap:nowrap}.command-layout .commander-focus{min-width:0;gap:5px!important}.command-layout .commander-focus .portrait{width:25px;height:30px}.command-layout .commander-copy strong{font-size:14px;max-width:150px}.command-layout .commander-copy small,.command-layout .commander-copy>span{display:none!important}.command-layout .map-view-toolbar>div:last-child{width:auto;min-width:0;gap:4px;flex-wrap:nowrap}.command-layout .map-view-toolbar button{min-width:32px;min-height:36px;padding:3px 8px;font-size:11px}.command-layout .map-zoom{gap:3px;margin-left:2px}.command-layout .map-view-toolbar output{min-width:35px;font-size:10px}
.command-layout .three-options{grid-area:camera;margin:0;padding:2px 7px;gap:4px;min-height:32px;flex-wrap:nowrap}.command-layout .three-options>span{display:none}.command-layout .three-options>small{font-size:10px}.command-layout .three-options button{min-height:28px;padding:2px 8px;font-size:10px}
.command-layout .army-legend,.command-layout .roster-heading,.command-layout #orderHint{display:none}
.command-layout #roster{grid-area:roster;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;padding:4px 0;min-height:0}
.command-layout .unit-card{padding:3px 5px;gap:5px;min-height:0;height:100%;align-items:center}.command-layout .unit-card .portrait{width:28px;height:34px}.command-layout .unit-card h3{font-size:11px;margin:0}.command-layout .unit-card .unit-meta{display:none}.command-layout .unit-card .troop-number{display:inline;font-size:13px;line-height:1;margin:0}.command-layout .unit-card .mini-bar{display:none}.command-layout .unit-card .card-state{display:inline;font-size:9px;margin-left:4px}.command-layout .unit-card.selected{background:#3b5140;border-color:#ffe0a0}
.command-layout #stage{grid-area:stage;height:100%;min-height:0;max-height:none!important;aspect-ratio:auto;border-radius:0 0 6px 6px;box-shadow:none}
.command-layout .field-intel{grid-area:intel;min-height:0;overflow:auto;display:flex;flex-direction:column;align-items:stretch;gap:9px;padding:13px;border-radius:6px 6px 0 0}.command-layout #fieldIntel{flex:0;min-width:0}.command-layout #fieldIntel strong{font-size:16px}.command-layout #fieldIntel span{font-size:13px}.command-layout #movementIntel{font-size:12px;padding:9px}.command-layout #movementIntel strong{font-size:13px}.command-layout #pathHint{font-size:13px;line-height:1.7;margin:0;min-height:0}
.move-plan-bar{grid-area:plan;display:grid;grid-template-columns:1fr auto;gap:5px;padding:8px;background:#253d30;border:1px solid #6a7958;border-top:0;min-height:0}.move-plan-bar>div{grid-column:1/-1;font-size:12px;line-height:1.4;color:#d9d9b5}.move-plan-bar button{min-height:32px;border:1px solid #9a9e6b;background:#344d38;border-radius:4px;padding:5px 10px;color:#eae6c5}.move-plan-bar #confirmMove{background:#d2b577;color:#203326;font-weight:700}.move-plan-bar.has-plan{border-color:#e2c57f}.move-plan-bar.has-plan>div{color:#ffe2a2}
.command-layout .command-bar{grid-area:commands;position:static;box-shadow:none;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:40px 40px;gap:4px;padding:7px;border-radius:0 0 6px 6px;min-height:0}.command-layout .commands{grid-column:1/-1;grid-row:1;display:flex;gap:4px}.command-layout .commands button{flex:1;justify-content:center;min-height:36px;padding:3px;font-size:12px}.command-layout #endTurn{grid-column:2;grid-row:2;min-height:36px;min-width:0;padding:3px;font-size:12px}.command-layout #nextUnit{grid-column:1;grid-row:2;background:#2d4839;border:1px solid #8bb497;border-radius:4px;font-size:12px;color:#dfe8cb;min-height:36px}.command-layout #remaining{display:none}
.command-layout #terrainToggle[aria-pressed=true]{border-color:#d5c084;background:#4b5030;color:#fff0bd}
.editor-table input[data-key=troops]{width:84px}.troop-number,.detail-stat strong,#friendlyTroops,#enemyTroops{font-variant-numeric:tabular-nums}
.troop-odachi{color:#f3b08e;background:#583628;border-color:#b77858}.unit-profile{display:block;font-size:11px;line-height:1.5;margin-top:4px;color:#d2d9bd}.profile-odachi{color:#f3b08e}.profile-spear{color:#b9ddca}.command-layout #fieldIntel .unit-profile{font-size:11px;display:block}.forecast~.unit-profile{font-size:11px;margin:3px 0}
.command-layout .info-dialog{width:min(680px,calc(100% - 16px))}.command-layout .info-dialog .side-panel{display:flex;max-height:none;border:0}.command-layout .info-dialog .side-panel>section{display:block;padding:14px 3px}.command-layout .info-dialog #movementRules{padding-top:12px}.command-layout .control-settings{display:flex;gap:8px;flex-wrap:wrap}.command-layout .control-settings button{min-height:44px;padding:8px;border:1px solid #8c9466;border-radius:4px;background:#2a4332;color:#e6dfba}.command-layout .control-settings button[aria-pressed=true]{border-color:#dac07c;color:#ffe3a7}.command-layout #settingsDialog .scenario-toolbar{flex-wrap:wrap}.command-layout dialog{max-height:calc(100dvh - 20px)}
.objective-marker{--flag-color:#9ba5ac;position:absolute;z-index:2;pointer-events:none;transform:translate(-50%,-100%);display:flex;align-items:center;gap:6px;padding:6px 9px;background:linear-gradient(135deg,#182b30f5,#172723f5);border:1px solid var(--flag-color);border-radius:6px;box-shadow:0 3px 12px #0008;white-space:nowrap;text-align:left;color:#e5ece4;font-size:10px}.objective-marker:after{content:'';position:absolute;left:50%;top:100%;border:5px solid transparent;border-top-color:var(--flag-color);transform:translateX(-50%)}.objective-marker .objective-flag{width:30px;height:45px;flex:none;filter:drop-shadow(0 2px 2px #0007)}.flag-pole{fill:none;stroke:#d4bd87;stroke-width:2.2;stroke-linecap:round}.flag-finial,.flag-crest{fill:#f8e5ae}.flag-cloth{fill:var(--flag-color);stroke:#eddbb0;stroke-width:1}.objective-marker strong,.objective-marker span{display:block}.objective-marker strong{font-size:11px;font-weight:600;color:#d1d8ce}.objective-marker .objective-progress{display:block;font:700 18px/1.35 var(--sans);letter-spacing:.4px;color:#f4ecd4}.objective-marker .objective-hint{font-size:10px;color:#bbc7bd;margin-top:3px}.objective-steps{display:flex;gap:3px;margin-top:1px}.objective-steps i{height:3px;flex:1;background:#8c9a9340;border-radius:2px}.objective-steps i.filled{background:var(--flag-color);box-shadow:0 0 4px color-mix(in srgb,var(--flag-color) 60%,transparent)}.objective-marker.friendly .objective-progress{color:#a5d4ff}.objective-marker.enemy .objective-progress{color:#ffb3a9}.objective-marker.urgent{border-color:#e9c374;box-shadow:0 0 0 1px #e9c37466,0 3px 12px #0008}.objective-marker.urgent .objective-hint{color:#ffe4a3}.objective-marker.contested{border-style:dashed}.objective-marker.contested .objective-progress{color:#e9dab3}#battleObjective.urgent{color:#ffce91;font-weight:700}
.three-leaders,.three-costs{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:hidden}.three-leaders{z-index:0}.three-unit-label{z-index:1}.three-leader{stroke:#9dd9c4;stroke-width:1.3;fill:#ccecd7}.three-leader.enemy{stroke:#e0a38a;fill:#f2bea6}.three-leader.selected{stroke:#ffe49b;stroke-width:2;fill:#ffe49b}.three-cost{position:absolute;transform:translate(-50%,-50%);border:1px solid #dbe3c380;background:#193b30e8;color:#f2e5b5;border-radius:3px;padding:1px 3px;font:600 11px/1.2 var(--sans);white-space:nowrap}.three-costs{z-index:0}.three-leaders circle{stroke-width:1}
@media(max-width:1100px){.command-layout .commander-focus{display:none!important}.command-layout .map-view-toolbar>div:last-child{width:100%;justify-content:center}.command-layout .battle-column{grid-template-columns:minmax(0,1fr) 250px;column-gap:7px}.command-layout .unit-card .portrait{display:none}.command-layout .unit-card h3{font-size:10px}.command-layout .unit-card .card-state{font-size:9px}}
@media(max-width:700px) and (orientation:portrait){
 .command-layout{grid-template-rows:44px minmax(0,1fr)}.command-layout .topbar{height:44px;padding:0 6px;gap:3px}.command-layout .brand{gap:0}.command-layout .brand strong{font-size:15px;letter-spacing:0}.command-layout .brand small,.command-layout .crest,.command-layout .chapter{display:none}.command-layout .top-actions{gap:3px}.command-layout .top-actions button{min-height:34px;min-width:34px;padding:3px 6px;font-size:11px}.command-layout .icon-button{width:30px;min-width:30px!important}
 .command-layout .game-shell{padding:5px}.command-layout .battle-column{grid-template-columns:minmax(0,1fr);grid-template-areas:'battle' 'tools' 'camera' 'roster' 'stage' 'intel' 'plan' 'commands';grid-template-rows:38px 38px auto 44px minmax(0,1fr) 98px 44px 46px;column-gap:0}
 .command-layout .battle-toolbar{padding:2px 7px}.command-layout .army-summary strong{font-size:16px}.command-layout .army-summary small{display:none}.command-layout .faction-symbol{font-size:12px}.command-layout .battle-clock strong{font-size:15px}.command-layout .battle-clock small{max-width:175px;font-size:9px}.command-layout #phaseLabel{font-size:9px}.command-layout .battle-clock{line-height:1.2}
 .command-layout .map-view-toolbar{padding:2px 4px}.command-layout .map-view-toolbar>div:last-child{gap:4px}.command-layout .map-view-toolbar button{min-height:32px;min-width:32px;padding:2px 7px}.command-layout .three-options{padding:1px 5px;min-height:29px}.command-layout .three-options small{font-size:9px}.command-layout .three-options button{font-size:10px;min-height:27px;padding:2px 5px}
 .command-layout .unit-card{padding:2px 4px}.command-layout .unit-card h3{font-size:10px;max-width:65px}.command-layout .unit-card .card-state{font-size:8px;display:block;margin:1px 0 0;line-height:1}.command-layout .unit-card .troop-number{font-size:12px}.command-layout .unit-card .portrait{display:none}
 .command-layout .field-intel{padding:5px 8px;gap:2px;border-radius:0;overflow:auto}.command-layout #fieldIntel strong,.command-layout #fieldIntel span{display:inline;font-size:11px;line-height:1.5;margin:0}.command-layout #fieldIntel strong{margin-right:7px}.command-layout #movementIntel{padding:2px 6px;margin:1px 0;font-size:10px}.command-layout #movementIntel strong{font-size:11px}.command-layout #movementIntel span{display:none}.command-layout #pathHint{font-size:11px;line-height:1.4;padding-top:2px;min-height:30px}.command-layout .move-plan-bar{grid-template-columns:minmax(0,1fr) auto auto;padding:3px 5px;gap:4px;align-items:center}.command-layout .move-plan-bar>div{grid-column:auto;font-size:10px;line-height:1.3}.command-layout .move-plan-bar button{min-height:36px;padding:3px 8px;font-size:11px}
 .command-layout .command-bar{display:flex;gap:4px;padding:3px;align-items:stretch}.command-layout .commands{display:flex;flex:3;gap:4px}.command-layout .commands button{padding:2px;min-height:38px;font-size:11px}.command-layout #nextUnit,.command-layout #endTurn{flex:1;padding:2px;font-size:11px;min-height:38px}.command-layout .map-caption{font-size:9px;padding:3px 5px;top:5px;left:5px}.objective-marker{font-size:9px;padding:2px 4px}.objective-marker strong{font-size:10px}.three-cost{font-size:10px;padding:1px 2px}
}
@media(max-height:540px) and (orientation:landscape){
 .command-layout{grid-template-rows:36px minmax(0,1fr)}.command-layout .topbar{height:36px;padding:0 9px}.command-layout .brand strong{font-size:17px}.command-layout .brand small,.command-layout .crest,.command-layout .chapter{display:none}.command-layout .top-actions button{min-height:30px;padding:3px 9px;font-size:11px}.command-layout .game-shell{padding:4px}.command-layout .battle-column{grid-template-columns:minmax(0,1fr) 240px;grid-template-rows:32px 34px auto 38px minmax(0,1fr) 65px 86px;column-gap:5px}.command-layout .battle-toolbar{padding:1px 8px}.command-layout .army-summary strong{font-size:15px}.command-layout .army-summary small,.command-layout #phaseLabel{display:none}.command-layout .battle-clock strong{font-size:15px}.command-layout .battle-clock small{font-size:9px}.command-layout .map-view-toolbar{padding:1px 5px}.command-layout .map-view-toolbar button{min-height:30px;padding:1px 7px}.command-layout .three-options{min-height:26px;padding:0 4px}.command-layout .three-options small{display:none}.command-layout .three-options button{min-height:24px;font-size:9px;padding:1px 7px}.command-layout .field-intel{padding:7px;gap:4px}.command-layout #fieldIntel strong{font-size:12px}.command-layout #fieldIntel span{font-size:11px}.command-layout #movementIntel{font-size:10px;padding:4px}.command-layout #movementIntel strong{font-size:11px}.command-layout #movementIntel span{display:none}.command-layout #pathHint{font-size:11px;line-height:1.4;padding-top:4px}.command-layout .move-plan-bar{padding:4px;gap:3px}.command-layout .move-plan-bar>div{font-size:10px}.command-layout .move-plan-bar button{min-height:30px;padding:2px 8px;font-size:11px}.command-layout .command-bar{padding:4px;grid-template-rows:36px 36px}.command-layout .commands button,.command-layout #endTurn,.command-layout #nextUnit{min-height:34px;font-size:11px}.command-layout .map-caption{font-size:9px;padding:2px 5px;top:4px;left:4px}.objective-marker{font-size:9px;padding:2px 4px}.objective-marker strong{font-size:10px}
}

.command-layout .three-options button{flex:0 0 auto;white-space:nowrap}.command-layout .three-options>small{flex:1 1 auto;flex-basis:auto;order:0;min-width:0;white-space:nowrap}.move-plan-bar>div{white-space:pre-line}
.command-layout .commands #waterButton{border-color:#6798a1;background:#213e43;color:#c5edf1;line-height:1.1}
.command-layout .commands #waterButton span{display:block;font-size:10px;line-height:1.1;text-align:center}
@media(max-width:700px) and (orientation:portrait){.command-layout .three-options>small{display:none}.command-layout .three-options button{flex:1;min-height:27px}.command-layout .unit-card .card-state{display:inline;margin-left:3px;font-size:8px}.command-layout .unit-card h3{line-height:1.25}.command-layout .unit-card .troop-number{line-height:1.1}}

/* Guard state remains visible after the unit has spent its action. */
.guard-shield{width:13px;height:15px;flex:0 0 auto;vertical-align:middle}.guard-badge{display:inline-flex;align-items:center;justify-content:center;gap:3px;white-space:nowrap;color:#ffe09a;font-weight:700}.guard-rate{font-variant-numeric:tabular-nums}.guard-duration{font-size:11px;color:#e6d7ad;line-height:1.6}
.command-layout #guardButton{display:inline-flex;align-items:center;gap:3px}.command-layout #guardButton.is-guarding:disabled{background:#655535;border-color:#f2d28c;color:#ffe8af;opacity:1}.command-layout .unit-card.guarding.spent{border-color:#e6c277;background:linear-gradient(120deg,#4c4930,#273e30);box-shadow:inset 0 0 0 1px #e3c77d33}.command-layout .unit-card.guarding .card-state{color:#ffe09a;opacity:1}.command-layout .unit-card .guard-badge{gap:2px}.command-layout .unit-card .guard-shield{width:10px;height:11px}.command-layout .toast{max-width:calc(100% - 20px);min-width:0;width:max-content}
.three-label-guard{display:none}.three-unit-label.guarding{border-color:#ffe09a;box-shadow:0 0 0 1px #e3c77d66,0 2px 7px #0008}.three-unit-label.guarding.spent{opacity:1}.three-unit-label.guarding .three-label-guard{display:block;line-height:14px;font-size:10px}.three-unit-label.guarding .three-label-guard .guard-badge{gap:2px}.three-unit-label.guarding .three-label-guard .guard-shield{width:11px;height:12px}.three-unit-label.compact.guarding .three-label-guard{font-size:9px;line-height:13px}
@media(max-width:700px) and (orientation:portrait){.command-layout .unit-card .guard-rate{display:none}.command-layout .unit-card .guard-badge{gap:1px}}
.command-layout .unit-card.guarding.spent{opacity:1}.command-layout .unit-card.guarding .unit-card-body{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:0 2px;min-width:0}.command-layout .unit-card.guarding h3{grid-column:1/-1}.command-layout .unit-card.guarding .troop-number{grid-column:1}.command-layout .unit-card.guarding .card-state{grid-column:2;margin:0;min-width:0}
.command-layout #guardButton{white-space:nowrap}@media(max-width:360px) and (orientation:portrait){.command-layout #guardButton .guard-shield{display:none}}
.troop-ninja{color:#d0c0f2;background:#30273d;border-color:#807293}.profile-ninja{color:#d0c0f2}.reserve-detail{padding:12px;border:1px dashed #ab99ca;color:#dfd0f9}.tactics-brief{font-size:10px;line-height:1.5;color:#afd9e4;border-top:1px solid #456765;margin-top:4px;padding-top:3px}.tactics-brief[hidden]{display:none}
#setupDialog{width:min(1120px,calc(100vw - 16px));padding:22px}.deployment-overview{display:grid;grid-template-columns:minmax(300px,1.15fr) minmax(240px,1fr);gap:18px;margin:18px 0}.deployment-map{display:grid;grid-template-columns:repeat(14,minmax(0,1fr));aspect-ratio:14/8;background:#263e32;border:1px solid #758d74;border-radius:6px;overflow:hidden}.deploy-cell{position:relative;display:grid;place-items:center;border:1px solid #ffffff12;background:#52684c;min-width:0;font:700 11px Microsoft JhengHei}.deploy-cell.terrain-forest{background:#244b39}.deploy-cell.terrain-hill{background:#807d58}.deploy-cell.terrain-river{background:#255f78}.deploy-cell.terrain-bridge{background:#9f8656}.deploy-cell.flood-cell{box-shadow:inset 0 0 0 2px #71ddf0;background-image:repeating-linear-gradient(160deg,transparent,transparent 5px,#7cdeee55 5px,#7cdeee55 7px)}.deploy-token{display:block;border:1px solid #bbebdc;border-radius:3px;padding:1px 3px;background:#173e37;color:#d8fff3;z-index:1}.deploy-token.side-1{background:#69382f;border-color:#f3ac90;color:#ffe1cd}.deploy-token.reserve-token{border-style:dashed;background:#382e4a;color:#ecddff;font-size:9px;padding:1px}.deployment-key{font-size:11px;color:#adbbab;margin-top:7px}.deployment-plan{display:flex;flex-direction:column;gap:7px;padding:12px;background:#1b352d;border:1px solid #4c7867;border-radius:5px;margin-bottom:10px}.deployment-plan.hostile{border-color:#8c6551;background:#352c26}.deployment-plan select{width:100%;min-height:40px;background:#142920;color:#f0e3bd;border:1px solid #8d9271;border-radius:4px;padding:6px}.deployment-plan small,.deployment-note{font-size:11px;line-height:1.7;color:#bbc9bb}.deployment-summary{display:flex;gap:10px;flex-wrap:wrap;background:#293b31;border-left:3px solid #d4b879;padding:10px;font-size:12px;line-height:1.7;margin-bottom:12px}.deployment-summary span{flex:1;min-width:220px}.deployment-summary strong{color:#eed59b;margin-right:7px}.water-friendly{color:#ffb29f;font-weight:700}#waterPreview p{line-height:1.7}#waterPreview li{font-size:13px;margin:8px 0}#waterPreview .forecast{margin:15px 0}.editor-table select[data-key=flank]{width:170px}.command-layout .commands button{min-width:0}#waterButton{color:#b9e6f0}
@media(max-width:700px){#setupDialog{padding:14px}.deployment-overview{grid-template-columns:1fr;gap:14px}.deployment-map{max-height:260px}.deployment-summary{gap:3px}.deployment-summary span{flex-basis:100%;min-width:0}.command-layout .commands button{font-size:11px}.tactics-brief{font-size:9px;line-height:1.3}.deployment-plan{padding:9px}}

/* Keep all five cards legible without letting inline states wrap outside them. */
.command-layout .unit-card .unit-card-body,.command-layout .unit-card.guarding .unit-card-body{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:12px 14px 10px;gap:0;align-content:center;min-width:0}
.command-layout .unit-card h3,.command-layout .unit-card.guarding h3{grid-column:1;grid-row:1;line-height:12px;max-width:100%}
.command-layout .unit-card .troop-number,.command-layout .unit-card.guarding .troop-number{grid-column:1;grid-row:2;float:none;display:block;white-space:nowrap;font-variant-numeric:tabular-nums;line-height:14px}
.command-layout .unit-card .card-state,.command-layout .unit-card.guarding .card-state{grid-column:1;grid-row:3;display:block;margin:0;line-height:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.command-layout .army-summary{flex-shrink:0}.command-layout .army-summary strong{white-space:nowrap}.command-layout .battle-clock{min-width:0}.command-layout #battleObjective{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.editor-team-title button{border:1px solid #7f9576;background:#294431;border-radius:4px;padding:6px 9px;font-size:11px}.editor-team-title button:disabled{opacity:.45}
@media(max-width:700px) and (orientation:portrait){.command-layout .battle-column{grid-template-rows:38px 38px auto 48px minmax(0,1fr) 98px 44px 46px}.command-layout .unit-card .unit-card-body,.command-layout .unit-card.guarding .unit-card-body{grid-template-rows:10px 13px 9px}.command-layout .unit-card h3{line-height:10px}.command-layout .unit-card .troop-number{font-size:11px;line-height:13px}.command-layout .unit-card .card-state{font-size:8px;line-height:9px}.command-layout .battle-clock{flex:1}.command-layout .army-summary{gap:3px}.command-layout .army-summary strong{font-size:15px}.command-layout #battleObjective{font-size:8px}}
@media(max-height:540px) and (orientation:landscape){.command-layout .unit-card h3{display:none}.command-layout .unit-card .unit-card-body,.command-layout .unit-card.guarding .unit-card-body{grid-template-rows:13px 9px}.command-layout .unit-card .troop-number,.command-layout .unit-card.guarding .troop-number{grid-row:1;line-height:13px}.command-layout .unit-card .card-state,.command-layout .unit-card.guarding .card-state{grid-row:2;line-height:9px}}
.deploy-cell.landing-eligible{padding:0;border:1px solid #e3c577;border-radius:0;min-height:0;color:#fff1be;cursor:pointer;box-shadow:inset 0 0 0 1px #e3c57755}.deploy-cell.landing-eligible:hover,.deploy-cell.landing-eligible:focus-visible{outline:2px solid #fff4bb;outline-offset:-3px;background:#8e7950}.deploy-cell small{font-size:9px;pointer-events:none}.landing-plan button{min-height:36px;color:#f1d494;border:1px solid #8a8960;background:#293e32;border-radius:4px}.landing-plan button[aria-pressed=true]{background:#76633c;outline:1px solid #e3c577}.landing-plan label{font-size:12px;line-height:1.8}.landing-plan strong{overflow-wrap:anywhere}

.deployment-secrecy{padding:10px 12px;border:1px solid #967e50;border-left:3px solid #d0b073;background:#28382f;color:#e3d2a5;font-size:12px;line-height:1.7;border-radius:4px}.deployment-note{overflow-wrap:anywhere}

/* Deployment is the opening screen; keep its map and confirmation usable on touch screens. */
.deployment-pending .topbar,.deployment-pending .game-shell,.deployment-pending .game-footer{visibility:hidden}
#setupDialog{padding:0;max-height:calc(100dvh - 16px);width:min(1160px,calc(100vw - 16px))}
#setupDialog[open]{display:flex;flex-direction:column}
#setupDialog>.dialog-header{flex:none;margin:0;padding:16px 22px;border-bottom:1px solid #62745a}
.deployment-content{min-height:0;overflow:auto;padding:0 22px 18px;overscroll-behavior:contain}
.deployment-intro{font-size:13px;line-height:1.6;color:#d6d8bb;margin:12px 0 2px}
#setupDialog>.dialog-footer{flex:none;margin:0;padding:12px 22px;align-items:center;background:#1c3026}
#setupDialog .budget-comparison{flex:1;margin:0;padding:6px 10px;font-size:11px}
#setupDialog #deployButton{min-height:44px;white-space:nowrap}
#setupDialog .deployment-overview{grid-template-columns:minmax(0,1.4fr) minmax(250px,.8fr);gap:18px;margin:12px 0}
.deployment-map-panel{min-width:0}
.deployment-map-tools{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:8px 0}
.deployment-map-tools button{min-height:36px;border:1px solid #8a9470;border-radius:4px;background:#2b4737;color:#ead8a3;padding:5px 10px;font-size:12px}
.deployment-map-tools small{color:#b6c5ae;font-size:10px}
.deployment-map-scroll{overflow-x:auto;overflow-y:hidden;max-width:100%;border:1px solid #758d74;border-radius:5px;overscroll-behavior-x:contain;scrollbar-color:#b6aa75 #21392b}
#setupDialog .deployment-map{min-width:586px;height:352px;max-height:none;aspect-ratio:auto;border:0;border-radius:0;grid-template-columns:26px repeat(14,minmax(0,1fr));grid-template-rows:24px repeat(8,minmax(0,1fr))}
.deployment-axis{display:grid;place-items:center;background:#1c3427;color:#e5d29a;font-size:11px;font-weight:700}
.deployment-row-axis{position:sticky;left:0;z-index:3;border-right:1px solid #738568}
#setupDialog .deploy-cell{min-width:0;min-height:0;padding:1px;gap:0;grid-template-columns:1fr;grid-template-rows:1fr 12px;align-content:center;line-height:1}
.deploy-terrain{font-size:22px;opacity:.44;grid-row:1;grid-column:1;pointer-events:none}
.deploy-cell.terrain-forest .deploy-terrain{color:#a3c890;opacity:.86}
.deploy-cell.terrain-river .deploy-terrain{color:#b4e7ed}
.deploy-cell.terrain-hill .deploy-terrain{color:#e8d5a2;opacity:.75}
#setupDialog .deploy-cell .deploy-token{grid-row:1;grid-column:1;padding:2px;font-size:11px;line-height:1.2}
#setupDialog .deploy-cell small{grid-row:2;font-size:9px;color:#e0e6c8;pointer-events:none}
#setupDialog .deploy-cell.landing-selected{outline:3px solid #fff2ac;outline-offset:-4px;box-shadow:inset 0 0 0 2px #d8af50;background-color:#786742}
#setupDialog .deploy-cell.landing-home{border-color:#8dd5c4}
.deployment-pick-hint{padding:8px 10px;border-left:3px solid #d6b76c;background:#293e30;color:#f1deb0;font-size:12px;line-height:1.6;margin:7px 0}
.deployment-key{display:flex;flex-wrap:wrap;gap:5px 12px;line-height:1.7}
.deployment-ninjas h3,.deployment-roster-heading{font:600 16px var(--serif);color:#e6d19d;margin:0 0 10px}
.ninja-deployment-card{display:flex;flex-direction:column;gap:7px;text-align:left;width:100%;padding:12px;border:1px solid #6c826b;border-radius:5px;background:#1b352d;color:#d7e1cd;margin:0 0 10px}
.ninja-deployment-card[aria-pressed=true]{border-color:#e1c375;box-shadow:inset 3px 0 #e1c375;background:#2f4131}
.ninja-card-title{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.ninja-card-title>b{padding:3px 5px;border-radius:3px;background:#4c3d5c;color:#e4d5f1;font-size:11px}
.ninja-card-title strong{flex:1;overflow-wrap:anywhere}
.ninja-deployment-card small{font-size:11px;line-height:1.6;color:#becab6}
.ninja-map-button{min-width:120px;min-height:40px;padding:5px 8px;background:#2e4334;color:#ebd49e;border:1px solid #a09365;border-radius:4px;line-height:1.6}
.ninja-map-button small{font-size:10px;white-space:nowrap}
@media(max-width:1000px){#setupDialog .deployment-overview{grid-template-columns:minmax(0,1fr)}.deployment-ninjas{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:0 10px}.deployment-ninjas h3{grid-column:1/-1}}
@media(max-width:700px){#setupDialog>.dialog-header{padding:12px 14px}.deployment-content{padding:0 14px 14px}#setupDialog>.dialog-footer{padding:8px 10px;gap:8px}#setupDialog .budget-comparison{font-size:10px;padding:4px 7px}#setupDialog #deployButton{padding:8px 12px;font-size:13px}.deployment-intro{font-size:12px}.deployment-pick-hint{font-size:11px}.deployment-map-tools{gap:6px}.deployment-map-tools button{flex:1;min-height:40px}.deployment-map-tools small{width:100%;text-align:center}.deployment-ninjas{grid-template-columns:1fr}}

/* Contextual labels leave the field clear while retaining troop and status marks. */
.three-unit-label.symbol-only{min-height:22px;padding:2px 3px;border-radius:5px;box-shadow:0 1px 3px #0006;background:#153a39df;line-height:1.2}
.three-unit-label.symbol-only.enemy{background:#58332cde}
.three-unit-label.symbol-only .three-label-name,.three-unit-label.symbol-only .three-label-count strong,.three-unit-label.symbol-only.guarding .three-label-guard{display:none}
.three-unit-label.symbol-only .three-label-count{gap:0}.three-unit-label.symbol-only .three-label-count b{font-size:12px;line-height:16px}
.three-label-state{display:none}.three-unit-label.symbol-only .three-label-state:not([hidden]){display:grid;place-items:center;position:absolute;right:-5px;top:-5px;width:12px;height:12px;border-radius:50%;background:#26352a;border:1px solid #d4c894;color:#f6dc99;font:700 8px/1 sans-serif}
.three-unit-label.symbol-only .three-label-state .guard-shield{width:9px;height:10px}
