/* A single tactical surface: no phase changes replace the board on touch screens. */
.latency-display{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;font-size:12px;font-variant-numeric:tabular-nums;color:var(--muted)}
.latency-display::before{content:'';width:6px;height:6px;background:currentColor;border-radius:50%}.latency-display[data-quality=good]{color:#235b48}.latency-display[data-quality=slow]{color:#835114}.latency-display[data-quality=bad]{color:#9a3237}
.match-settings{position:relative}.match-settings summary{cursor:pointer;padding:10px;min-height:40px}.match-settings>div{position:absolute;z-index:12;top:100%;right:0;min-width:230px;padding:12px;background:var(--panel);border:1px solid var(--line);display:grid;gap:8px}.match-settings label{display:flex;justify-content:space-between;gap:8px}
.team-economy{font-size:12px;font-variant-numeric:tabular-nums}#gameScreen:not(.tactical-layout) .selected-skill{display:block}#gameScreen:not(.tactical-layout) .selected-buttons{display:flex;gap:8px;margin-top:8px}.buy-compact{display:none}
#compactInstruction{display:none}
@media(max-width:1100px){
 #gameScreen:not(.tactical-layout):not([hidden]){height:100dvh;min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}
 #gameScreen:not(.tactical-layout) .masthead{flex:none;width:100%;min-height:44px;padding:2px 8px;gap:8px;flex-wrap:nowrap!important}
 #gameScreen:not(.tactical-layout) .masthead .wordmark,#gameScreen:not(.tactical-layout) .subtitle,#gameScreen:not(.tactical-layout) .masthead nav #saveButton,#gameScreen:not(.tactical-layout) .masthead nav #importButton,#gameScreen:not(.tactical-layout) .masthead nav #newButton{display:none!important}
 #gameScreen:not(.tactical-layout) .masthead nav{width:auto!important;flex-basis:auto!important;flex-wrap:nowrap;gap:4px;margin-left:0}
 #gameScreen:not(.tactical-layout) .masthead button{min-width:32px;min-height:40px;padding:6px;font-size:12px;white-space:nowrap}
 #gameScreen:not(.tactical-layout) .language-picker{margin-left:auto;gap:0}#gameScreen:not(.tactical-layout) .language-picker>span{display:none}#gameScreen:not(.tactical-layout) .language-picker select{min-height:40px;max-width:70px;font-size:12px;padding:4px}
 #gameScreen:not(.tactical-layout) .latency-display{font-size:11px;gap:4px}#gameScreen:not(.tactical-layout) .connection-bar{flex:none;margin:0;padding:2px 8px;border:0;border-bottom:1px solid var(--line);font-size:11px;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-height:18px}
 #gameScreen:not(.tactical-layout) .assist-bar{flex:none;position:static;flex-wrap:nowrap;padding:0 8px;gap:6px;min-height:36px;font-size:11px}
 #gameScreen:not(.tactical-layout) .assist-bar>span{flex:1 1 auto;font-size:11px;min-width:0;line-height:1.3}#gameScreen:not(.tactical-layout) .assist-bar button{min-height:36px;font-size:11px;padding:4px 8px}
 #gameScreen:not(.tactical-layout) .match-settings{flex:none}#gameScreen:not(.tactical-layout) .match-settings summary{font-size:11px;min-height:36px;padding:8px 2px}#gameScreen:not(.tactical-layout) .match-settings>div label{display:flex;flex:auto;font-size:13px}
 #gameScreen:not(.tactical-layout) .mobile-tabs,#gameScreen:not(.tactical-layout) .touch-tools{display:none!important}
 #gameScreen:not(.tactical-layout) main{display:flex;flex-direction:column;flex:1 1 0;min-height:0;width:100%;padding:0 8px 6px!important}
 #gameScreen:not(.tactical-layout) .battle-status{flex:none;min-height:26px;padding:3px 0;gap:4px;font-size:12px;flex-wrap:nowrap}
 #gameScreen:not(.tactical-layout) .battle-status>div:first-child{gap:6px;min-width:0;flex-wrap:nowrap}#gameScreen:not(.tactical-layout) #turnName{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:46vw}#gameScreen:not(.tactical-layout) #roundName{font-size:10px;white-space:nowrap}
 #gameScreen:not(.tactical-layout) .phase-track{display:none}#gameScreen:not(.tactical-layout) .arena{flex:1;min-height:0;display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:108px minmax(100px,1fr) 196px;gap:6px!important;align-items:stretch}
 #gameScreen:not(.tactical-layout) .arena>.crew-column{display:block!important;grid-row:1;overflow:hidden;padding:0;max-height:none}
 #gameScreen:not(.tactical-layout) .crew-column>.section-label,#gameScreen:not(.tactical-layout) .crew-note,#gameScreen:not(.tactical-layout) #gameEffects,#gameScreen:not(.tactical-layout) #galleryButton{display:none}
 #gameScreen:not(.tactical-layout) #crews{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;height:100%}
 #gameScreen:not(.tactical-layout) .player-crew{margin:0;min-width:0}#gameScreen:not(.tactical-layout) .crew-heading{margin:0 0 3px;font-size:11px;gap:4px}#gameScreen:not(.tactical-layout) .crew-heading strong{font-size:11px;white-space:nowrap;max-width:60%;overflow:hidden;text-overflow:ellipsis}#gameScreen:not(.tactical-layout) .crew-heading small{display:none}#gameScreen:not(.tactical-layout) .team-economy{font-size:11px;white-space:nowrap}
 #gameScreen:not(.tactical-layout) .crew-unit{display:grid;grid-template-columns:minmax(0,1fr) 30px;align-items:center;gap:4px;margin:0 0 4px}
 #gameScreen:not(.tactical-layout) .unit-card{min-width:0;min-height:40px;height:40px;margin:0;padding:4px 5px;position:relative;border-left-width:3px}
 #gameScreen:not(.tactical-layout) .unit-title{display:block;padding-right:34px}#gameScreen:not(.tactical-layout) .unit-title .system-card{display:none}#gameScreen:not(.tactical-layout) .unit-title small{display:none}#gameScreen:not(.tactical-layout) .unit-title strong{display:block;font-size:12px;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #gameScreen:not(.tactical-layout) .hp-row{position:absolute;top:5px;right:4px;margin:0}#gameScreen:not(.tactical-layout) .hp-pip{display:none}#gameScreen:not(.tactical-layout) .hp-row span{font-size:11px;margin:0;color:var(--ink)}
 #gameScreen:not(.tactical-layout) .unit-caption{font-size:10px;line-height:1.2;margin-top:4px}#gameScreen:not(.tactical-layout) .unit-caption span:last-child{max-width:70%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
 #gameScreen:not(.tactical-layout) .crew-unit .inspect-button{min-width:30px;min-height:40px;height:40px;margin:0;padding:2px;font-size:10px;border:1px solid var(--line)}
 #gameScreen:not(.tactical-layout) .arena>.map-column{display:grid!important;grid-row:2;grid-template-rows:auto auto minmax(0,1fr) auto;min-height:0;max-height:none;overflow:hidden;padding:0}
 #gameScreen:not(.tactical-layout) .map-heading{min-height:20px;margin:0;gap:4px;flex-wrap:nowrap}#gameScreen:not(.tactical-layout) .map-heading>div:first-child{gap:6px;flex-wrap:nowrap}#gameScreen:not(.tactical-layout) .map-heading h1{font-size:12px;white-space:nowrap}#gameScreen:not(.tactical-layout) #mapSize{font-size:9px;padding:1px 3px}
 #gameScreen:not(.tactical-layout) .collapse-clock{gap:6px;font-size:9px;flex-wrap:nowrap}#gameScreen:not(.tactical-layout) .map-rule-note{font-size:10px;line-height:1.3;padding:2px 0;margin:0;border:0}
 #gameScreen:not(.tactical-layout) .map-scroll{min-height:0;display:grid;place-items:center;overflow:hidden!important;width:100%}
 #gameScreen:not(.tactical-layout) .map-frame{width:var(--mobile-board-fit,100%)!important;max-width:100%;min-width:0!important;margin:0;padding:12px 0 0 12px!important;border:0;box-shadow:none}
 #gameScreen:not(.tactical-layout) .axis-x{top:0;left:12px;right:0;font-size:8px}#gameScreen:not(.tactical-layout) .axis-y{top:12px;bottom:0;left:0;width:11px!important;font-size:8px}
 #gameScreen:not(.tactical-layout) .board{gap:1px!important;aspect-ratio:12/10}#gameScreen:not(.tactical-layout) .tile{min-height:0!important;min-width:0!important;aspect-ratio:1;font-size:10px!important;opacity:1}
 #gameScreen:not(.tactical-layout) .terrain-icon{font-size:clamp(10px,2.5vw,17px)!important}#gameScreen:not(.tactical-layout) .tile.space .terrain-icon{font-size:10px!important}#gameScreen:not(.tactical-layout) .piece{width:88%!important;height:88%!important;font-size:12px!important}
 #gameScreen:not(.tactical-layout) .piece-initial{font-size:clamp(9px,2.6vw,14px)}#gameScreen:not(.tactical-layout) .piece sup,#gameScreen:not(.tactical-layout) .piece small{font-size:7px!important}#gameScreen:not(.tactical-layout) .coin{font-size:8px!important}#gameScreen:not(.tactical-layout) .birth-label{font-size:6px!important}
 #gameScreen:not(.tactical-layout) .map-caption{display:block;font-size:10px;line-height:1.3;padding:2px 0;min-height:17px;max-height:28px;overflow:auto;margin:0}#gameScreen:not(.tactical-layout) .warning-legend,#gameScreen:not(.tactical-layout) .terrain-key,#gameScreen:not(.tactical-layout) .map-footnote,#gameScreen:not(.tactical-layout) .log-section{display:none}
 #gameScreen:not(.tactical-layout) .arena>.action-column{display:grid!important;grid-row:3;grid-template-columns:1fr;grid-template-rows:96px 94px;gap:6px;min-height:0;max-height:none;padding:0;overflow:visible}
 #gameScreen:not(.tactical-layout) .action-panel{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(120px,42%);grid-template-rows:auto minmax(0,1fr);gap:4px 8px;min-width:0;min-height:0;padding:6px 0;border-top:1px solid var(--line);border-bottom:0;overflow:auto}
 #gameScreen:not(.tactical-layout) .action-panel>.section-label{display:none}#gameScreen:not(.tactical-layout) #actionTitle{font-size:13px;line-height:1.2;margin:0;grid-column:1;grid-row:1}
 #gameScreen:not(.tactical-layout) #instruction{display:none}#gameScreen:not(.tactical-layout) #compactInstruction{display:block;font-size:12px;line-height:1.35;margin:0;grid-column:1;grid-row:2;overflow:auto}
 #gameScreen:not(.tactical-layout) #controls{display:flex;flex-wrap:wrap;gap:4px;grid-column:2;grid-row:1 / 4;align-content:start;overflow:auto}
 #gameScreen:not(.tactical-layout) #controls button{min-height:40px;min-width:0;padding:5px 7px;font-size:12px;flex:1 1 auto}#gameScreen:not(.tactical-layout) #controls .dice-choices{display:grid;grid-template-columns:repeat(3,1fr);gap:4px;width:100%}#gameScreen:not(.tactical-layout) .deploy-hint{font-size:11px;line-height:1.4}
 #gameScreen:not(.tactical-layout) #controls .dice-choices button{min-height:24px;height:24px;padding:1px;font-size:12px}#gameScreen:not(.tactical-layout) #controls .dice-choices+button{min-height:28px;font-size:10px;padding:2px}
 #gameScreen:not(.tactical-layout) #controls:has(.danger){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:stretch}#gameScreen:not(.tactical-layout) #controls:has(.danger) button{min-height:36px;font-size:10px;line-height:1.2;padding:2px}
 #gameScreen:not(.tactical-layout) #dice{display:none}#gameScreen:not(.tactical-layout) #selectedUnit{grid-column:1;grid-row:3;font-size:11px;line-height:1.2;margin:0;padding:0;border:0;display:flex;align-items:center;justify-content:space-between;gap:6px}
 #gameScreen:not(.tactical-layout) .selected-buttons button[data-action*="character"]{display:none}
 #gameScreen:not(.tactical-layout) .selected-skill{display:none}#gameScreen:not(.tactical-layout) .selected-buttons{display:flex;margin:0;gap:6px}#gameScreen:not(.tactical-layout) .selected-buttons button{font-size:11px;min-height:30px;padding:3px 6px}#gameScreen:not(.tactical-layout) .selected-summary{font-size:11px}
 #gameScreen:not(.tactical-layout) .shop-section{display:grid!important;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(44px,1fr) 28px;gap:3px;padding:0;margin:0!important;min-height:0;overflow:auto;border-top:1px solid var(--line)}
 #gameScreen:not(.tactical-layout) .shop-section>.section-label,#gameScreen:not(.tactical-layout) #wallet,#gameScreen:not(.tactical-layout) #missingButton{display:none}#gameScreen:not(.tactical-layout) #shop{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
 #gameScreen:not(.tactical-layout) .shop-item{display:flex;flex-direction:column;min-width:0;padding:0;border:0;gap:0}#gameScreen:not(.tactical-layout) .shop-thumbnail{display:none}#gameScreen:not(.tactical-layout) .shop-item>div{display:none}
 #gameScreen:not(.tactical-layout) .shop-item>button:last-child{width:100%;min-height:44px;height:44px;padding:2px;white-space:normal;border:1px solid var(--line)}#gameScreen:not(.tactical-layout) .buy-full{display:none}#gameScreen:not(.tactical-layout) .buy-compact{display:block;font-size:11px;line-height:1.25}#gameScreen:not(.tactical-layout) .buy-compact small{display:block;font-size:10px;color:inherit}
 #gameScreen:not(.tactical-layout) #inventory{display:flex;flex-wrap:nowrap;align-items:center;gap:4px;min-height:28px;overflow:auto}#gameScreen:not(.tactical-layout) #inventory>.empty{font-size:10px;margin:0}#gameScreen:not(.tactical-layout) .inventory-item{display:flex;gap:4px;font-size:11px;padding:0;border:0;white-space:nowrap;flex-shrink:0}#gameScreen:not(.tactical-layout) .inventory-item button{min-width:0;min-height:28px;padding:3px;font-size:10px}#gameScreen:not(.tactical-layout) .inventory-item>span:first-child{max-width:64px;overflow:hidden;text-overflow:ellipsis}
 #gameScreen:not(.tactical-layout) #diceStage{padding:8px;gap:8px}.stage-die{min-width:50px}.stage-face{width:46px;height:46px;font-size:43px}.stage-die strong{font-size:14px}
 #gameScreen:not(.tactical-layout) .tutorial-panel{flex:none;margin:0 8px;padding:4px 6px;gap:3px}#gameScreen:not(.tactical-layout) .tutorial-panel h2{font-size:13px!important}#gameScreen:not(.tactical-layout) .tutorial-panel p{font-size:11px!important;line-height:1.3!important}#gameScreen:not(.tactical-layout) .tutorial-panel span{font-size:10px!important}
 #gameScreen:not(.tactical-layout) footer{display:none!important}.toast{bottom:calc(12px + env(safe-area-inset-bottom))!important}
}
@media(max-width:1100px) and (max-height:670px) and (orientation:portrait){
 #gameScreen:not(.tactical-layout) .arena{grid-template-rows:96px minmax(80px,1fr) 172px}
 #gameScreen:not(.tactical-layout) .crew-unit .unit-card,#gameScreen:not(.tactical-layout) .crew-unit .inspect-button{height:36px;min-height:36px}
 #gameScreen:not(.tactical-layout) .arena>.action-column{grid-template-rows:84px 82px}#gameScreen:not(.tactical-layout) .assist-bar{min-height:30px}#gameScreen:not(.tactical-layout) .assist-bar button,#gameScreen:not(.tactical-layout) .match-settings summary{min-height:30px;padding-block:3px}
}
@media(max-width:1100px) and (orientation:landscape){
 #gameScreen:not(.tactical-layout) .connection-bar{display:none}#gameScreen:not(.tactical-layout) .assist-bar{min-height:30px}#gameScreen:not(.tactical-layout) .arena{grid-template-columns:minmax(130px,22%) minmax(0,1fr) minmax(180px,30%)!important;grid-template-rows:minmax(0,1fr)}
 #gameScreen:not(.tactical-layout) .arena>.crew-column{grid-row:1;grid-column:1;overflow:auto}#gameScreen:not(.tactical-layout) #crews{display:flex;flex-direction:column;gap:8px}#gameScreen:not(.tactical-layout) .arena>.map-column{grid-row:1;grid-column:2}#gameScreen:not(.tactical-layout) .arena>.action-column{grid-row:1;grid-column:3;grid-template-rows:minmax(90px,1fr) minmax(148px,1fr)}
 #gameScreen:not(.tactical-layout) .shop-section{grid-template-rows:minmax(88px,1fr) 56px}#gameScreen:not(.tactical-layout) #inventory{display:grid;grid-template-columns:1fr;grid-template-rows:repeat(2,28px);gap:0;overflow:visible}
 #gameScreen:not(.tactical-layout) #shop{grid-template-columns:repeat(2,minmax(0,1fr))}#gameScreen:not(.tactical-layout) .action-panel{grid-template-columns:1fr;grid-template-rows:auto auto minmax(40px,1fr) auto}#gameScreen:not(.tactical-layout) #controls{grid-column:1;grid-row:3}#gameScreen:not(.tactical-layout) #selectedUnit{grid-column:1;grid-row:4}#gameScreen:not(.tactical-layout) .map-rule-note{font-size:9px}#gameScreen:not(.tactical-layout) .collapse-clock{display:none}
}
@media(max-width:600px) and (max-height:600px) and (orientation:portrait){
 #gameScreen:not(.tactical-layout) .masthead{gap:3px;padding-inline:4px}#gameScreen:not(.tactical-layout) .masthead button{font-size:10px;min-width:28px;padding-inline:3px}#gameScreen:not(.tactical-layout) .language-picker select{max-width:55px;font-size:11px}#gameScreen:not(.tactical-layout) .latency-display{font-size:10px}
 #gameScreen:not(.tactical-layout) .arena{grid-template-columns:90px minmax(0,1fr)!important;grid-template-rows:minmax(0,1fr) 172px}
 #gameScreen:not(.tactical-layout) .arena>.crew-column{grid-row:1;grid-column:1}#gameScreen:not(.tactical-layout) .arena>.map-column{grid-row:1;grid-column:2}#gameScreen:not(.tactical-layout) .arena>.action-column{grid-row:2;grid-column:1 / -1}
 #gameScreen:not(.tactical-layout) #crews{display:flex;flex-direction:column;gap:8px}#gameScreen:not(.tactical-layout) .crew-heading{display:flex;flex-direction:column;align-items:start;gap:0;line-height:1.25}#gameScreen:not(.tactical-layout) .crew-heading strong{max-width:100%}#gameScreen:not(.tactical-layout) .crew-heading .team-economy{font-size:10px}
 #gameScreen:not(.tactical-layout) .crew-unit{display:block}#gameScreen:not(.tactical-layout) .crew-unit .inspect-button{display:none}#gameScreen:not(.tactical-layout) .unit-card{width:100%}#gameScreen:not(.tactical-layout) .unit-title{padding-right:25px}#gameScreen:not(.tactical-layout) .unit-title strong{font-size:11px}#gameScreen:not(.tactical-layout) .hp-row span{font-size:10px}
 #gameScreen:not(.tactical-layout) .map-heading{flex-wrap:wrap;gap:0}#gameScreen:not(.tactical-layout) .map-heading h1{font-size:11px}#gameScreen:not(.tactical-layout) .collapse-clock{font-size:8px;gap:4px}#gameScreen:not(.tactical-layout) .map-rule-note{font-size:9px}#gameScreen:not(.tactical-layout) .map-caption{font-size:9px}
}
