/* Battlefield controls: preserve the miniature table and faction palette. */
[hidden]{display:none!important}
button:focus-visible,canvas:focus-visible{outline:3px solid #f0d17d;outline-offset:3px}
#game #sideRail{width:300px;flex:0 0 300px;overflow:auto;gap:8px}
#game #unitPanel{min-height:0;flex:0 0 auto;padding:12px;overflow:visible}
#game #unitPanel .empty{margin:22px 0;line-height:1.5}
#game .status{font-size:11px;max-width:none;line-height:1.4}
#game .panelHead{height:auto;float:none;min-height:60px}
#game .panelHead h2{font-size:17px}
#game .statbox small,#game .weapon span{font-size:11px}
#game .trait{font:12px/1.45 Arial;padding:8px 0}
#game .trait span{display:block}
#game .weapon p{font:12px/1.4 Arial;margin:6px 0}
#game #battleLog{min-height:120px;flex:1 0 120px}
#game #logEntries div{font-size:12px}
#game #logEntries small{font-size:10px}
#battleRoster{font-family:Arial;flex:none}
.rosterSide>strong{display:block;font-size:10px;letter-spacing:1.4px;color:#c8bc95;margin:4px 0 6px}
.rosterSide>div{display:grid;grid-template-columns:1fr 1fr;gap:4px;margin-bottom:8px}
.rosterSide button{display:flex;gap:6px;align-items:center;text-align:left;min-height:48px;padding:4px;background:#25271f;border:1px solid #56523e;font:12px/1.2 Arial;color:#e8ddbd}
.rosterSide button.canAct{border-left:3px solid #8bc3cf}
.rosterSide button.hostile{border-left-color:#c06d58}
.rosterSide button[aria-pressed=true]{background:#3b3b2a;border-color:#e5c76b}
.rosterSide button:disabled{opacity:.45;cursor:default}
.rosterSide small{display:block;color:#b7b09c;font-size:10px;margin-top:4px}
.rosterPortrait{flex:0 0 32px;width:32px;height:36px;background:#30392d}
#actionPreview{flex:none;min-height:88px;background:#26271f;border-top:1px solid #81724b;padding:10px 18px;display:flex;gap:14px;align-items:center;justify-content:space-between;font:13px/1.4 Arial}
.orderCopy{min-width:0;flex:1}
#orderSummary{font-family:Georgia;font-size:17px;color:#f0dc9e}
#orderDetail{margin:4px 0 0;color:#d0c9b0;max-width:1000px}
#actionPreview.invalid #orderDetail{color:#f0a28c}
.orderButtons{display:flex;gap:8px;flex-shrink:0}
.orderButtons button,#targetChoices button{min-height:44px;border:1px solid #a68b52;background:#33352a;padding:9px 14px;color:#ead9a6;font:11px Arial;letter-spacing:.5px}
#confirmOrder{background:#7e332a;border-color:#d1926d}
#confirmOrder:disabled{opacity:.45;cursor:not-allowed}
#targetChoices{display:flex;flex-wrap:wrap;gap:6px;margin-top:5px}
#game #boardWrap{background:#171b14;min-height:0}
#game canvas{background:#171b14}
#game #phaseGuide span{font-size:12px;line-height:1.4}
#game #toast{z-index:20;width:max-content;max-width:90%;font:13px/1.4 Arial;text-align:center}
#game #actionLabel{max-width:95%;white-space:normal;text-align:center;letter-spacing:1px;font-size:12px}
#app:has(#game:not(.hidden)) #audioControls{top:8px;left:240px;right:auto;bottom:auto;z-index:3}
#game .topbar .brand{margin-right:110px}
#game .topbar .blue{margin-left:auto}
#game .bottom #next{font:12px Arial;min-height:40px}
#game .bottom{gap:8px}
#game .diceTray{min-width:min(470px,94%);max-width:94%;pointer-events:auto}
#game .diceTitle{letter-spacing:.5px}
#game .combatSteps b{font-size:10px;padding:5px}
#game .modifiers{font:11px/1.4 Arial}
@media(max-width:1050px){#game .topbar .brand{display:none}#app:has(#game:not(.hidden)) #audioControls{left:8px}#game .topbar .blue{margin-left:95px}}
@media(max-width:750px){
 #game .topbar{gap:4px;min-height:48px}#game .topbar .blue{margin-left:76px}
 #app:has(#game:not(.hidden)) #audioControls{top:8px;left:4px;right:auto;bottom:auto;gap:3px}
 #app:has(#game:not(.hidden)) #audioControls button{width:32px;height:30px;padding:4px}
 #game #mobileMenu{display:none}#game .score{padding:0 4px;flex:1}
 #game .score small{display:none}#game .round small{font-size:7px}
 #game main{flex-direction:column;padding:4px;gap:4px;overflow:auto}
 #game #boardWrap{flex:1 0 230px;min-height:230px;border-width:4px}
 #game #sideRail{flex:0 0 auto;width:100%;height:auto;min-height:0;max-height:210px;margin:0;display:grid;grid-template-columns:1fr;gap:5px;overflow:auto}
 #battleRoster{position:relative}
 .rosterSide>div{grid-template-columns:repeat(4,minmax(0,1fr));gap:3px;margin-bottom:3px}
 .rosterSide>strong{font-size:9px;margin:2px 0 3px}
 .rosterSide button{font-size:10px;min-height:44px;padding:4px;gap:2px;overflow:hidden}
 .rosterSide small{font-size:9px}.rosterPortrait{display:none}
 #game #unitPanel{width:100%;height:auto;min-height:0;display:block;padding:8px}
 #game .panelHead{min-height:40px;padding-bottom:5px;gap:7px}
 #game .mini{width:40px;height:40px;flex:0 0 40px}
 #game .panelHead h2{font-size:14px;margin:0 0 3px}
 #game .status{font-size:11px;margin-top:3px}
 #game .statgrid{position:static;display:grid;grid-template-columns:repeat(3,1fr);margin-top:5px}
 #game .statbox{width:auto;padding:4px}
 #game .weapon,#game .trait,#game .coverTag,#game .objectiveTag{display:block;font-size:11px}
 #game .weapon{margin-top:6px;padding-top:6px}
 #game .hp{margin:6px 0}#game .trait{padding:4px 0}
 #game #battleLog{display:none}
 #actionPreview{min-height:100px;max-height:200px;overflow:auto;padding:8px;gap:6px;align-items:stretch;flex-direction:column;font-size:12px}
 #orderSummary{font-size:14px}#orderDetail{font-size:12px;line-height:1.35}
 .orderButtons{justify-content:flex-end}.orderButtons button{min-height:38px;padding:8px 12px}
 #game #phaseGuide{min-height:42px;height:42px;padding:0 8px}
 #game #phaseGuide span{font-size:10px}
 #game .bottom{min-height:46px;height:46px;padding:4px 8px}
 #game .bottom #next{width:100%;font-size:11px;margin:0}
 #game .diceTray{padding:8px;bottom:6px}
 #game .combatSteps b{font-size:8px}#game .combatSteps i{font-size:16px}
 #game #turnBanner b{font-size:20px;letter-spacing:1px}
 #game #turnBanner span{padding:8px;text-align:center;font-size:11px}
 #tutorialCard{padding:8px!important}#tutorialTitle{font-size:15px!important}#tutorialText{font-size:12px!important}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media(max-width:750px){
 #app:has(#builder:not(.hidden)) #audioControls,#app:has(#opening:not(.hidden)) #audioControls,#app:has(#generalIntro:not(.hidden)) #audioControls,#app:has(#tutorialOffer:not(.hidden)) #audioControls{top:6px;left:4px;right:auto;bottom:auto}
 #app:has(#builder:not(.hidden)) #audioControls button{width:32px;height:30px;padding:4px}
}

/* Turn cadence and lasting, reviewable combat feedback. */
#turnStatus,#lastEvent{display:flex;align-items:center;gap:12px;flex:none;padding:6px 18px;font:12px/1.4 Arial;border-bottom:1px solid #494534;background:#202219;min-height:34px}
#turnOwner{font-weight:bold;letter-spacing:1px;color:#ead18c;white-space:nowrap}
#flowNotice{flex:1;color:#c8c2ad}#lastEvent{background:#181b15;color:#c7bea2}
#eventSummary{flex:1;min-width:0}#turnStatus button,#lastEvent button{flex:none;min-height:32px;padding:5px 10px;border:1px solid #8b7951;background:#303328;color:#f0db9f;font:10px Arial;letter-spacing:.5px}
#game .bottom #next.ready{animation:none}
#game #diceTray.combatReport{cursor:default;min-width:0;width:480px;max-width:96%;max-height:calc(100% - 16px);overflow:auto;background:#20231bf5;border:1px solid #ad925a;bottom:8px;padding:14px;box-shadow:0 4px 14px #0008;text-align:center}
.reportHeading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px;color:#b8ac86;font:10px Arial;letter-spacing:1px}
.reportHeading button{padding:6px 10px;min-height:32px;background:#303328;border:1px solid #8b7951;color:#e9d9b1;font:10px Arial}
#game .combatReport .diceTitle{font:bold 15px/1.4 Georgia;letter-spacing:0;color:#eaddba}
.combatOutcome{display:block;font:15px/1.4 Georgia;color:#f2d282;margin-top:7px}
.rollCaption{font:11px Arial;color:#c5bea7}.chargeResult{font:13px Arial;margin-top:12px;color:#ddd2b1}.chargeResult b{font-size:20px;color:#f2d282}
#game .combatReport .combatSteps{margin:10px 0}.combatReport .combatSteps b{flex:1;animation:reportStep .3s both;animation-delay:calc(var(--step)*90ms)}
@keyframes reportStep{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:none}}
#game .combatReport .diceRow{margin:8px 0}.combatReport .modifiers{padding-top:5px;border-top:1px solid #474a39}
@media(max-width:750px){
 #turnStatus,#lastEvent{gap:6px;padding:4px 8px;font-size:11px;min-height:32px}
 #turnOwner{font-size:10px;letter-spacing:.5px}#flowNotice{font-size:10px}
 #turnStatus button,#lastEvent button{min-height:32px;font-size:9px;padding:4px 7px}
 #game #diceTray.combatReport{padding:8px;max-height:calc(100% - 8px);bottom:4px}
 .reportHeading{margin-bottom:4px;font-size:9px}
 #game .combatReport .diceTitle{font-size:13px}.combatOutcome{font-size:13px;margin-top:4px}
 #game .combatReport .combatSteps b{font-size:9px;letter-spacing:0;padding:4px 2px}
 #game .combatReport .combatSteps{margin:6px 0}.rollCaption{font-size:10px}
 #game .combatReport .die{height:25px;width:25px;font-size:14px}
}
@media(prefers-reduced-motion:reduce){.combatReport .combatSteps b{animation:none}}
#game #diceTray.combatReport{z-index:21}
/* Pixel scenery sits on an inset dark-wood table, with an optional rules key. */
#game #boardWrap{border:7px solid #463a2a;box-shadow:0 0 0 1px #80704c,0 5px 12px #0008;background:#20271e}
#game canvas{image-rendering:pixelated}
#terrainToggle[aria-pressed=true]{background:#494a31;border-color:#d3b46c;color:#fff0bf}
#terrainLegend{position:absolute;left:12px;top:12px;z-index:19;width:290px;max-width:calc(100% - 24px);padding:14px;background:#20261df5;border:1px solid #a28b59;box-shadow:3px 4px 0 #10160d99;color:#d6d1b9;font:12px/1.45 Arial;max-height:calc(100% - 24px);overflow:auto}
#terrainLegend>b{display:block;color:#e9d6a2;font:14px Georgia;letter-spacing:.5px;margin-bottom:10px}
#terrainLegend p{margin:10px 0;padding-left:18px;position:relative}#terrainLegend strong{display:block;color:#e9dfc1}
#terrainLegend i{position:absolute;left:0;top:3px;width:10px;height:10px;border:1px dashed #e6b77a;background:#69716b}
#terrainLegend .forestSwatch{border-color:#b0d68b;background:#4a6847}#terrainLegend .rockSwatch{border-color:#b8ad8a;background:#505958}
#terrainLegend small{display:block;border-top:1px solid #56563f;padding-top:8px;color:#b7b599;font-size:11px}
@media(max-width:750px){#game #boardWrap{border-width:4px}#terrainLegend{left:6px;top:6px;max-width:calc(100% - 12px);max-height:calc(100% - 12px);padding:10px;font-size:11px}#terrainLegend>b{font-size:12px;margin-bottom:6px}#terrainLegend p{margin:6px 0}#turnStatus{flex-wrap:wrap}#flowNotice:empty{min-width:0}#terrainToggle{margin-left:auto}}
