/* One measured layout per screen; never let iOS inflate a narrow text column. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body:not(.lobby) #arena{position:fixed;inset:0;width:100%;height:100dvh;opacity:1;border:0}
:root{--ui-font:'Avenir Next','Bahnschrift','Segoe UI','PingFang SC','Microsoft YaHei',sans-serif}
.garage-workbench,.garage-workbench *{box-sizing:border-box;min-width:0}

/* Garage: a model bay, a scrollable inspector, and an independent robot rail. */
body.lobby[data-screen=garage]{--garage-header:76px;--garage-edge:clamp(18px,3vw,48px);background:#0c1118}
body.lobby[data-screen=garage]:after{display:none}
body.lobby[data-screen=garage] .masthead{height:var(--garage-header);padding:12px var(--garage-edge);background:#0c1118}
body.lobby[data-screen=garage] .masthead .brand{font:700 20px/1.1 var(--ui-font);letter-spacing:.05em}
body.lobby[data-screen=garage] .masthead .header-right{gap:16px}
body.lobby[data-screen=garage] .masthead :is(a,button,select){font-family:var(--ui-font)}
body.lobby[data-screen=garage] #lobbyPanel{position:fixed;inset:var(--garage-header) var(--garage-edge) max(16px,env(safe-area-inset-bottom));width:auto;max-height:none;margin:0;padding:0;display:grid;grid-template-rows:46px minmax(0,1fr) 64px;gap:18px;overflow:visible;background:none;pointer-events:none}
body.lobby[data-screen=garage] #lobbyPanel>.lobby-heading{display:none}
body.lobby[data-screen=garage] .lobby-tabs{position:static;height:auto;padding:0;gap:28px;overflow-x:auto;align-items:stretch}
body.lobby[data-screen=garage] .lobby-tabs button{font:500 14px/1.2 var(--ui-font);min-height:44px;white-space:nowrap;flex:none;padding:8px 2px}
body.lobby[data-screen=garage] .lobby-tabs .menu-back{margin-right:12px}
body.lobby[data-screen=garage] .lobby-screens{position:static;width:100%;max-width:none;min-height:0;max-height:none;overflow:visible;padding:0}
body.lobby[data-screen=garage] #garageScreen{height:100%;display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,350px);grid-template-rows:minmax(0,1fr) 110px;gap:18px;animation:none}
.garage-preview{grid-column:1;grid-row:1;position:relative;isolation:isolate;overflow:hidden;min-height:0;border:1px solid #c5d1df1b;border-radius:22px;background:#121b22;box-shadow:0 16px 40px #0002}
body.lobby[data-screen=garage] #garagePreview #arena{position:absolute;inset:0;width:100%;height:100%;min-height:0;opacity:1}
body.lobby[data-screen=garage] #garageControls{position:absolute;inset:auto 16px 14px;z-index:2;width:auto;max-width:none;margin:0;padding:0;text-align:center;border:0;background:none}
body.lobby[data-screen=garage] #garageControls>p{display:none}
body.lobby[data-screen=garage] #garageControls .garage-tools{display:flex;flex-wrap:nowrap;justify-content:center;gap:6px;margin:0}
body.lobby[data-screen=garage] .garage-tools button{display:grid;place-items:center;min-width:44px;min-height:44px;height:44px;padding:8px 12px;border:1px solid #d1dce52b;border-radius:12px;background:#111820e8;font:500 12px/1.2 var(--ui-font);color:#eaf0f4;box-shadow:0 3px 12px #0002}
body.lobby[data-screen=garage] .garage-tools button:hover{background:#303b48;border-color:#afc2d45c}
body.lobby[data-screen=garage] .garage-tools :is(#orbitLeft,#orbitRight,#zoomIn,#zoomOut){font-size:21px;width:44px;flex:none}
body.lobby[data-screen=garage] #exportModel{display:none}
.garage-inspector{grid-column:2;grid-row:1/3;display:flex;flex-direction:column;gap:24px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;padding:24px;border:1px solid #c5d1df1b;border-radius:22px;background:#161e28;color:#edf2f6;font-family:var(--ui-font)}
.garage-machine-heading{position:static;display:block;height:auto;padding:0;border:0;background:none}
.garage-machine-heading #garageName{margin:0;font:650 clamp(22px,2.1vw,30px)/1.2 var(--ui-font);letter-spacing:-.035em;overflow-wrap:anywhere;color:#f4f7f9}
.garage-workbench #robotParams{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px 16px;margin:0;padding:0;border:0;background:none}
.garage-workbench #robotParams>div{padding:0;border:0;display:grid;grid-template-columns:auto 1fr;align-items:baseline;gap:5px 3px}
.garage-workbench #robotParams span{grid-column:1/-1;font:500 12px/1.3 var(--ui-font);color:#aebbc9}
.garage-workbench #robotParams strong{font:600 26px/1.1 var(--ui-font);font-variant-numeric:tabular-nums;color:#f5f7fb}
.garage-workbench #robotParams small{font:400 13px/1.2 var(--ui-font);color:#aebbc9}
.garage-workbench #combatParams:empty{display:none}
.garage-workbench #combatParams{border-top:1px solid #d6dfeb1c;margin-top:22px;padding-top:20px}
.garage-workbench .combat-param-note{margin:0 0 14px;font:400 12px/1.5 var(--ui-font);color:#aebbc9}
.garage-workbench .combat-param-grid{display:grid;grid-template-columns:1fr 1fr;gap:18px 16px;margin:0}
.garage-workbench .combat-param-grid>div{display:grid;gap:6px}
.garage-workbench .combat-param-grid>div:last-child{grid-column:1/-1}
.garage-workbench .combat-param-grid span{font:500 12px/1.4 var(--ui-font);color:#aebbc9}
.garage-workbench .combat-param-grid strong{font:600 21px/1.25 var(--ui-font);color:#f5f7fb;overflow-wrap:anywhere}
.garage-workbench #skillLoadout{margin:0;padding:20px 0 0;border:0;border-top:1px solid #d6dfeb1c}
.garage-workbench #skillLoadout label>span{font:500 12px/1.4 var(--ui-font);letter-spacing:0;color:#aebbc9}
.garage-workbench #skillSelect{display:block;width:100%;min-height:46px;margin-top:8px;padding:10px 12px;background:#0c131e;border:1px solid #d1dce52b;border-radius:12px;font:500 15px var(--ui-font)}
.garage-workbench #skillDescription{margin:10px 0 0;font:400 13px/1.6 var(--ui-font);color:#b7c3ce}
.garage-details{margin-top:auto;border-top:1px solid #d6dfeb1c}
.garage-details>summary{min-height:48px;padding:15px 0 0;font:500 14px/1.3 var(--ui-font);color:#dbe5ee;cursor:pointer}
.garage-details .setup-section{margin:14px 0 0;padding:0}
.garage-details :is(.micro,#robotReference,.mechanism-sheet p){font:400 12px/1.6 var(--ui-font);color:#aebbc9}
.garage-details .mechanism-sheet{display:block;margin-top:16px;border:0}
.garage-details .mechanism-sheet summary{font:500 13px/1.4 var(--ui-font);min-height:44px}
.garage-details .machine-actions{display:block;margin:16px 0}
.garage-details #inspectRobot{display:none}
.garage-details :is(select,input){font:500 16px var(--ui-font);border-radius:10px;max-width:100%}
.garage-roster{grid-column:1;grid-row:2;overflow:hidden;display:flex;flex-direction:column;gap:10px;padding:0;min-height:0;font-family:var(--ui-font)}
.garage-roster>h2{margin:0;font:500 13px/1.3 var(--ui-font);color:#b9c6d2}
body.lobby[data-screen=garage] #robotCatalogue{position:static;display:flex;flex:1;gap:8px;inset:auto;width:100%;max-width:none;min-height:0;overflow-x:auto;overflow-y:hidden;margin:0;padding:0 2px 6px;scroll-snap-type:x proximity;scrollbar-width:thin;scrollbar-color:#56667a transparent}
body.lobby[data-screen=garage] #robotCatalogue button{display:flex;flex-direction:column;justify-content:center;gap:6px;flex:0 0 112px;min-height:68px;min-width:0;margin:0;padding:10px 12px;border:1px solid #b9c8d829;border-radius:13px;background:#17212d;color:#dce5ed;scroll-snap-align:start;text-align:left}
body.lobby[data-screen=garage] #robotCatalogue strong{font:650 24px/1.05 var(--ui-font);letter-spacing:-.02em}
body.lobby[data-screen=garage] #robotCatalogue span{display:block;font:400 11px/1.25 var(--ui-font);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:100%;color:#afbdcb}
body.lobby[data-screen=garage] #robotCatalogue button[aria-pressed=true]{background:#e8eef3;border-color:#e8eef3;color:#162330;box-shadow:0 4px 15px #0002}
body.lobby[data-screen=garage] #robotCatalogue button[aria-pressed=true] span{color:#405469}
body.lobby[data-screen=garage] #robotCatalogue button:after{display:none}
body.lobby[data-screen=garage] .lobby-footer{position:static;inset:auto;width:auto;display:grid;grid-template-columns:minmax(0,1fr) auto minmax(220px,300px);align-items:center;gap:14px;padding:0;margin:0;border:0;background:transparent}
body.lobby[data-screen=garage] .lobby-footer .setup-alliance{grid-column:2;grid-row:1;width:auto;min-height:48px;margin:0;padding:12px 18px;border:1px solid #c3d1dd30;border-radius:13px;background:#17212d;font:500 14px/1.3 var(--ui-font);text-align:center}
body.lobby[data-screen=garage] .lobby-footer #start{grid-column:3;grid-row:1;min-height:52px;margin:0;padding:12px 20px;border-radius:13px;font:650 15px/1.3 var(--ui-font);letter-spacing:0}
body.lobby[data-screen=garage] .lobby-device{grid-column:1;grid-row:1;margin:0;font:400 12px var(--ui-font)}
body.lobby[data-screen=garage] .lobby-device button{font:500 12px var(--ui-font)}
body.lobby[data-screen=garage] #gameMenuHint{display:none}

/* iPad: retain a full model bay beside a compact inspector, in either orientation. */
@media(min-width:700px) and (max-width:1180px){
 body.lobby[data-screen=garage]{--garage-header:64px;--garage-edge:18px}
 body.lobby[data-screen=garage] #lobbyPanel{gap:12px;grid-template-rows:44px minmax(0,1fr) 60px}
 body.lobby[data-screen=garage] #garageScreen{grid-template-columns:minmax(0,1fr) 290px;grid-template-rows:minmax(0,1fr) 100px;gap:12px}
 .garage-inspector{padding:20px;gap:20px;border-radius:18px}
 body.lobby[data-screen=garage] .garage-tools{flex-wrap:wrap!important}
 body.lobby[data-screen=garage] .masthead .header-right{gap:10px}
 body.lobby[data-screen=garage] .masthead .header-credits{display:none}
}
/* Phone portrait: model, horizontal rail, then independently scrolling specs. */
@media(max-width:699px){
 body.lobby[data-screen=garage]{--garage-header:58px;--garage-edge:12px}
 body.lobby[data-screen=garage] #lobbyPanel{gap:10px;grid-template-rows:44px minmax(0,1fr) 54px;bottom:max(10px,env(safe-area-inset-bottom))}
 body.lobby[data-screen=garage] .masthead .brand{font-size:17px}
 body.lobby[data-screen=garage] .masthead .brand-sub{display:none}
 body.lobby[data-screen=garage] .masthead .header-right{gap:8px}
 body.lobby[data-screen=garage] .masthead .header-credits,body.lobby[data-screen=garage] #help{display:none}
 body.lobby[data-screen=garage] #language{max-width:118px;padding:8px;font-size:14px;min-height:42px}
 body.lobby[data-screen=garage] .lobby-tabs{gap:20px}
 body.lobby[data-screen=garage] .lobby-tabs button{font-size:13px}
 body.lobby[data-screen=garage] .lobby-tabs .menu-back{margin:0}
 body.lobby[data-screen=garage] #garageScreen{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(150px,30%) 76px minmax(0,1fr);gap:10px}
 .garage-preview{grid-row:1;border-radius:17px}
 .garage-roster{grid-row:2;gap:0}
 .garage-roster>h2{display:none}
 body.lobby[data-screen=garage] #robotCatalogue button{flex-basis:105px;min-height:62px;padding:9px 12px}
 body.lobby[data-screen=garage] #robotCatalogue strong{font-size:22px}
 .garage-inspector{grid-column:1;grid-row:3;padding:18px;gap:18px;border-radius:17px}
 .garage-machine-heading #garageName{font-size:22px}
 .garage-workbench #robotParams{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
 .garage-workbench #robotParams strong{font-size:21px}
 .garage-workbench #robotParams span{font-size:11px}
 .garage-workbench #robotParams small{font-size:11px}
 .garage-workbench .combat-param-grid{grid-template-columns:1fr 1fr 1.6fr;gap:10px}
 .garage-workbench .combat-param-grid>div:last-child{grid-column:auto}
 .garage-workbench .combat-param-grid strong{font-size:16px}
 .garage-workbench .combat-param-note{font-size:12px}
 body.lobby[data-screen=garage] #garageControls{inset:auto 8px 8px}
 body.lobby[data-screen=garage] .garage-tools button{padding:6px 9px;min-height:40px;height:40px;border-radius:10px}
 body.lobby[data-screen=garage] .garage-tools :is(#orbitLeft,#orbitRight,#zoomIn,#zoomOut){min-width:40px;width:40px}
 body.lobby[data-screen=garage] .lobby-footer{grid-template-columns:minmax(0,1fr) minmax(0,1.35fr);gap:10px}
 body.lobby[data-screen=garage] .lobby-footer .setup-alliance{grid-column:1;padding:10px 8px;font-size:13px;height:50px}
 body.lobby[data-screen=garage] .lobby-footer #start{grid-column:2;font-size:13px;min-height:50px;padding:10px 12px}
 body.lobby[data-screen=garage] .lobby-device{display:none}
}
/* Phone landscape with browser chrome: content scrolls inside its own column. */
@media(max-height:500px) and (min-width:600px){
 body.lobby[data-screen=garage]{--garage-header:44px;--garage-edge:max(12px,env(safe-area-inset-left))}
 body.lobby[data-screen=garage] .masthead{padding-top:5px;padding-bottom:5px}
 body.lobby[data-screen=garage] .masthead .brand-sub,body.lobby[data-screen=garage] .header-credits,body.lobby[data-screen=garage] #help{display:none}
 body.lobby[data-screen=garage] .masthead .brand{font-size:16px}
 body.lobby[data-screen=garage] #lobbyPanel{gap:8px;grid-template-rows:40px minmax(0,1fr) 48px;bottom:max(8px,env(safe-area-inset-bottom))}
 body.lobby[data-screen=garage] #garageScreen{grid-template-columns:minmax(0,1fr) 290px;grid-template-rows:minmax(0,1fr) 64px;gap:8px}
 .garage-inspector{grid-column:2;grid-row:1/3;gap:16px;padding:16px;border-radius:14px}
 .garage-roster{grid-column:1;grid-row:2;gap:0}
 .garage-roster>h2{display:none}
 .garage-preview{grid-column:1;grid-row:1;border-radius:14px}
 .garage-machine-heading #garageName{font-size:21px}
 body.lobby[data-screen=garage] #robotCatalogue button{flex-basis:92px;min-height:56px;padding:7px 10px}
 body.lobby[data-screen=garage] #robotCatalogue strong{font-size:20px}
 body.lobby[data-screen=garage] #robotCatalogue span{font-size:10px}
 body.lobby[data-screen=garage] .garage-tools button{min-height:40px;height:40px}
 body.lobby[data-screen=garage] #garageControls{bottom:8px}
 body.lobby[data-screen=garage] .lobby-footer{grid-template-columns:minmax(0,1fr) auto 250px}
 body.lobby[data-screen=garage] .lobby-footer :is(.setup-alliance,#start){min-height:44px;height:44px;font-size:13px;padding:8px 16px}
 body.lobby[data-screen=garage] .lobby-device{display:flex}
}

/* Keep all preview actions available, using compact icons on phones. */
@media(max-width:699px),(max-height:500px){
 body.lobby[data-screen=garage] .garage-tools :is(#garageIntake,#garageInternals){display:grid;width:40px;min-width:40px;padding:8px;font-size:0}
 body.lobby[data-screen=garage] .garage-tools :is(#garageIntake,#garageInternals):before{content:'';width:21px;height:21px;background:center/contain no-repeat}
 body.lobby[data-screen=garage] .garage-tools #garageIntake:before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eaf0f4' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 4h14v8H5zM5 12l-2 8h18l-2-8M8 16h8M12 7v4m-2-2 2 2 2-2'/%3E%3C/svg%3E")}
 body.lobby[data-screen=garage] .garage-tools #garageInternals:before{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eaf0f4' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m12 3 9 5-9 5-9-5zM3 12l9 5 9-5M3 16l9 5 9-5'/%3E%3C/svg%3E")}
}
/* Shared scoreboard. Reserve room for five digits instead of clipping four. */
:is(#hud,#matchHUD){--hud-edge:max(12px,env(safe-area-inset-left));--hud-right:max(12px,env(safe-area-inset-right));--hud-bottom:max(12px,env(safe-area-inset-bottom));font-family:var(--ui-font);--body:var(--ui-font);--display:var(--ui-font)}
:is(#hud,#matchHUD) .scoreboard,:is(#hud,#matchHUD)[data-touch=true] .scoreboard{box-sizing:border-box;top:max(12px,env(safe-area-inset-top));width:min(440px,calc(100% - 28px));min-height:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(108px,1.05fr) minmax(0,1fr);gap:0;border:1px solid #e1edf340;border-radius:14px;box-shadow:0 6px 24px #0004;overflow:hidden;isolation:isolate}
:is(#hud,#matchHUD) .scoreboard :is(.alliance-score,.clock-box),:is(#hud,#matchHUD)[data-touch=true] .scoreboard :is(.alliance-score,.clock-box){box-sizing:border-box;min-width:0;width:auto;padding:9px 8px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;border:0;overflow:hidden}
:is(#hud,#matchHUD) .scoreboard .red-score{background:#a51e35;border-bottom:3px solid #ff8d99}
:is(#hud,#matchHUD) .scoreboard .blue-score{background:#125383;border-bottom:3px solid #7eceff}
:is(#hud,#matchHUD) .scoreboard .clock-box{background:#eaf0f3;color:#142334;border-bottom:3px solid #a7b6c3}
:is(#hud,#matchHUD) .scoreboard .alliance-score>strong,:is(#hud,#matchHUD)[data-touch=true] .scoreboard .alliance-score>strong{font:700 clamp(26px,4vw,40px)/1 var(--ui-font);font-variant-numeric:tabular-nums;letter-spacing:-.025em;white-space:nowrap;text-shadow:0 2px 2px #0002;max-width:100%;color:white}
:is(#hud,#matchHUD) .scoreboard .alliance-score>span,:is(#hud,#matchHUD)[data-touch=true] .scoreboard .alliance-score>span{font:600 10px/1.2 var(--ui-font);letter-spacing:.09em;color:#fff}
:is(#hud,#matchHUD) .scoreboard .alliance-score>small,:is(#hud,#matchHUD)[data-touch=true] .scoreboard .alliance-score>small{display:block;font:500 10px/1.2 var(--ui-font);color:#f1f5fa;white-space:nowrap;min-height:12px}
:is(#hud,#matchHUD) .scoreboard .clock-box>strong,:is(#hud,#matchHUD)[data-touch=true] .scoreboard .clock-box>strong{font:700 30px/1 var(--ui-font);letter-spacing:-.015em;font-variant-numeric:tabular-nums}
:is(#hud,#matchHUD) .scoreboard .clock-box>span,:is(#hud,#matchHUD)[data-touch=true] .scoreboard .clock-box>span{font:650 10px/1.2 var(--ui-font);letter-spacing:.06em}
:is(#hud,#matchHUD) .scoreboard .clock-box>small{font:500 10px/1.2 var(--ui-font)}
:is(#hud,#matchHUD) .scoreboard .phase-track{align-self:stretch;height:3px;margin:0}
:is(#hud,#matchHUD) .view-toolbar{background:#101c2aeb;border:1px solid #d8e5ef30;border-radius:12px;top:16px;left:16px;padding:4px;gap:4px}
:is(#hud,#matchHUD) .view-toolbar select{width:140px;font:500 13px var(--ui-font);border:0;background:transparent;min-height:44px}
:is(#hud,#matchHUD) .view-toolbar button{width:44px;min-height:44px;padding:8px;border:0;border-radius:9px;background:transparent}
:is(#hud,#matchHUD) .view-toolbar>span{display:none}
.combat-health{padding:12px 15px;border:1px solid #dce7f329;border-radius:13px;background:#111d2ce8;box-shadow:0 4px 16px #0002;font-family:var(--ui-font);gap:5px 16px;bottom:150px;left:20px}
.combat-health>span{font-size:12px;color:#ccd8e4}.combat-health>strong{font-size:20px;white-space:nowrap}.combat-health meter{width:190px;height:10px}
.combat-shortcuts{font:500 12px/1.4 var(--ui-font);border-radius:10px;padding:7px 12px;background:#111d2cdd}

/* Touch HUD: two thumb areas; frequently used actions above the right thumb. */
:is(#hud,#matchHUD)[data-touch=true]{--move-size:104px;--turn-size:96px;--edge:var(--hud-right);--bottom:var(--hud-bottom)}
:is(#hud,#matchHUD)[data-touch=true] .scoreboard{width:min(340px,calc(100% - 28px));top:max(8px,env(safe-area-inset-top))}
:is(#hud,#matchHUD)[data-touch=true] .scoreboard .alliance-score>strong{font-size:30px}
:is(#hud,#matchHUD)[data-touch=true] .scoreboard .clock-box>strong{font-size:25px}
:is(#hud,#matchHUD)[data-touch=true] .scoreboard :is(.alliance-score,.clock-box){padding:6px 6px;gap:3px}
:is(#hud,#matchHUD)[data-touch=true] .scoreboard .clock-box>small{display:none}
:is(#hud,#matchHUD)[data-touch=true] .view-toolbar{z-index:4;top:max(8px,env(safe-area-inset-top));left:var(--hud-edge);display:flex;padding:0;gap:2px;background:#101c2aeb;border:1px solid #d8e5ef30;border-radius:12px}
:is(#hud,#matchHUD)[data-touch=true] .view-toolbar select{width:100px;font:500 12px var(--ui-font);padding:8px}
:is(#hud,#matchHUD)[data-touch=true] .view-toolbar button{width:44px;min-width:44px;height:44px;padding:8px}
:is(#hud,#matchHUD)[data-touch=true] .telemetry{position:absolute;z-index:4;inset:max(8px,env(safe-area-inset-top)) var(--hud-right) auto auto;transform:none;padding:0;width:auto;min-width:0;max-width:none;min-height:0;background:none;border:0;box-shadow:none}
:is(#hud,#matchHUD)[data-touch=true] .fuel-meter{min-width:62px;max-width:none;display:grid;grid-template-columns:auto;gap:2px;padding:7px 12px;border:1px solid #d8e5ef30;border-radius:12px;background:#101c2aeb;text-align:center}
:is(#hud,#matchHUD)[data-touch=true] .fuel-meter>span{font:600 10px/1.2 var(--ui-font);color:#dce6ed}
:is(#hud,#matchHUD)[data-touch=true] .fuel-meter>strong{font:650 27px/1 var(--ui-font);font-variant-numeric:tabular-nums;color:#fff}
:is(#hud,#matchHUD)[data-touch=true] .touch-controls{z-index:3;left:var(--hud-edge);right:var(--hud-right);bottom:var(--hud-bottom);height:var(--move-size)}
:is(#hud,#matchHUD)[data-touch=true] .stick{background:#14233491;border-color:#deebf15c;box-shadow:inset 0 1px 0 #ffffff0c}
:is(#hud,#matchHUD)[data-touch=true] .touch-secondary{right:0;bottom:calc(var(--turn-size) + 14px);gap:8px;z-index:5;pointer-events:none}
:is(#hud,#matchHUD)[data-touch=true] .touch-secondary>button{width:46px;height:46px;min-height:46px;border-radius:13px;background:#152332e8;border:1px solid #d8e5ef42;padding:5px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;line-height:1.2}
:is(#hud,#matchHUD)[data-touch=true] .touch-secondary .status-toggle>span{font:500 10px/1.1 var(--ui-font);color:#ecf1f7}
:is(#hud,#matchHUD)[data-touch=true] .touch-secondary .status-toggle>strong{font:600 11px/1.1 var(--ui-font);margin:0}
:is(#hud,#matchHUD)[data-touch=true] .touch-secondary .status-toggle.enabled{background:#38566aed;border-color:#b6d6e7}
.touch-extra-panel{position:absolute;right:0;bottom:56px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;width:224px;padding:12px;border-radius:16px;background:#101b29f5;border:1px solid #d9e8f34d;box-shadow:0 10px 28px #0004;pointer-events:auto}
.touch-extra-panel[hidden]{display:none!important}
:is(#hud,#matchHUD)[data-touch=true] .touch-extra-panel button{position:static;min-height:46px;width:auto;min-width:0;height:auto;padding:8px;border-radius:10px;white-space:normal;font:500 12px/1.35 var(--ui-font);background:#263646;border:1px solid #d9e8f332;color:#f2f6fa}
.combat-body-turns{display:flex;grid-column:1/-1;gap:8px}.combat-body-turns button{flex:1}
:is(#hud,#matchHUD)[data-touch=false] :is(.touch-more,.touch-extra-panel){display:none!important}
:is(#hud,#matchHUD)[data-touch=true] .combat-turn-touch{position:static;inset:auto;display:flex;gap:0;pointer-events:auto}
:is(#hud,#matchHUD)[data-touch=true] .combat-turn-touch .combat-collect-touch{width:100px!important;min-width:100px;min-height:46px;height:46px;padding:6px 8px!important;background:#263c4fed;border:1px solid #b9d1e45c;border-radius:13px;font:600 12px/1.25 var(--ui-font);white-space:normal;color:#fff;touch-action:none}
:is(#hud,#matchHUD)[data-touch=true] .touch-secondary .touch-more{font-size:15px;letter-spacing:1px}
.combat-playing :is(#hud,#matchHUD) .turn-stick{visibility:hidden;pointer-events:none}
.combat-playing :is(#hud,#matchHUD) #assist{display:none!important}
:is(#hud,#matchHUD)[data-touch=true] .combat-touch-aim{position:absolute;z-index:1;top:92px;right:var(--hud-right);bottom:var(--hud-bottom);left:auto;width:min(47%,440px);height:auto;pointer-events:auto;touch-action:none}
.combat-aim-indicator{position:absolute;right:0;bottom:0;width:var(--turn-size);height:var(--turn-size);border-radius:50%;border:1px solid #d5e3ec66;background:radial-gradient(circle at center,#d9e4ef40 0 17%,transparent 18%),#14233466;display:flex;justify-content:center;align-items:flex-start;padding-top:12px;font:600 10px/1.1 var(--ui-font);color:#eaf0f5;text-shadow:0 1px 3px #000}
:is(#hud,#matchHUD)[data-touch=true] .touch-actions .fire-button{width:64px;height:64px;min-height:64px;right:calc(var(--turn-size) + 14px);bottom:0;font:600 14px/1 var(--ui-font);background:#d87549e8;border-color:#ffd9c1;box-shadow:0 3px 12px #0003}
:is(#hud,#matchHUD)[data-touch=true] .ability-hud{right:calc(var(--hud-right) + var(--turn-size) + 88px);bottom:var(--hud-bottom);z-index:4}
:is(#hud,#matchHUD)[data-touch=true] .ability-button{width:50px;height:50px;min-height:50px;background:#172b3de8}
:is(#hud,#matchHUD)[data-touch=true] #onlineSkill{right:calc(var(--hud-right) + var(--turn-size) + 88px);bottom:var(--hud-bottom);z-index:4}
:is(#hud,#matchHUD)[data-touch=true] #onlineSkill{font-size:0;border-color:#d5bd91;border-width:2px;box-shadow:inset 0 0 0 3px #172b3d;background:#172b3de8}
:is(#hud,#matchHUD)[data-touch=true] #onlineSkill:before{content:attr(data-touch-label);font:650 23px/1 var(--ui-font);color:#e9f1f6}
:is(#hud,#matchHUD)[data-touch=true] .combat-health{left:var(--hud-edge);bottom:calc(var(--move-size) + var(--hud-bottom) + 14px);padding:8px 10px;gap:3px 6px;max-width:150px}
:is(#hud,#matchHUD)[data-touch=true] .combat-health>span{font:500 10px/1.2 var(--ui-font)}
:is(#hud,#matchHUD)[data-touch=true] .combat-health>strong{font:650 16px/1.2 var(--ui-font)}
:is(#hud,#matchHUD)[data-touch=true] .combat-health meter{width:128px;height:8px}
:is(#hud,#matchHUD)[data-touch=true] .combat-shortcuts{display:none}
:is(#hud,#matchHUD)[data-touch=true] .combat-reticle span{font:500 11px/1.2 var(--ui-font);letter-spacing:.04em;top:36px}
:is(#hud,#matchHUD)[data-touch=true] .combat-killfeed{top:84px;right:50%;transform:translateX(50%);max-width:min(360px,65vw)}
:is(#hud,#matchHUD)[data-touch=true] .combat-death{font:500 15px/1.5 var(--ui-font);white-space:normal;max-width:75%;padding:12px 16px;border-radius:12px;text-align:center}
@media(max-width:699px){
 :is(#hud,#matchHUD)[data-touch=true]{--move-size:92px;--turn-size:86px}
 :is(#hud,#matchHUD)[data-touch=true] .scoreboard{width:calc(100% - 24px)}
 :is(#hud,#matchHUD)[data-touch=true] .scoreboard .alliance-score>strong{font-size:27px}
 :is(#hud,#matchHUD)[data-touch=true] :is(.view-toolbar,.telemetry){top:84px}
 :is(#hud,#matchHUD)[data-touch=true] .view-toolbar select{width:102px}
 :is(#hud,#matchHUD)[data-touch=true] .combat-health{max-width:112px;padding:7px;grid-template-columns:1fr;gap:2px}
 :is(#hud,#matchHUD)[data-touch=true] .combat-health>span{display:none}
 :is(#hud,#matchHUD)[data-touch=true] .combat-health meter{width:96px}
 :is(#hud,#matchHUD)[data-touch=true] .combat-turn-touch .combat-collect-touch{width:92px!important;min-width:92px;font-size:11px}
 :is(#hud,#matchHUD)[data-touch=true] .combat-killfeed{top:194px;max-width:90vw}
 .network-status{top:140px;left:max(12px,env(safe-area-inset-left));max-width:calc(100% - 100px);font:500 12px/1.2 var(--ui-font)}
 :is(#hud,#matchHUD)[data-touch=true] .combat-touch-aim{top:156px}
}
@media(min-width:700px) and (max-width:1180px){:is(#hud,#matchHUD):not([data-touch=true]) .view-toolbar{top:112px}}
@media(max-width:359px){
 :is(#hud,#matchHUD)[data-touch=true]{--move-size:84px;--turn-size:76px}
 :is(#hud,#matchHUD)[data-touch=true] .combat-health{max-width:100px}
 :is(#hud,#matchHUD)[data-touch=true] .combat-health meter{width:84px}
 :is(#hud,#matchHUD)[data-touch=true] .combat-turn-touch .combat-collect-touch{width:84px!important;min-width:84px}
 :is(#hud,#matchHUD)[data-touch=true] .touch-actions .fire-button{width:56px;height:56px;min-height:56px;right:calc(var(--turn-size) + 10px)}
 :is(#hud,#matchHUD)[data-touch=true] :is(.ability-hud,#onlineSkill){right:calc(var(--hud-right) + var(--turn-size) + 74px)}
 :is(#hud,#matchHUD)[data-touch=true] :is(.ability-button,#onlineSkill){width:44px;height:44px;min-height:44px}
}
@media(max-height:440px){
 :is(#hud,#matchHUD)[data-touch=true]{--move-size:84px;--turn-size:80px}
 :is(#hud,#matchHUD)[data-touch=true] .scoreboard{width:300px}
 :is(#hud,#matchHUD)[data-touch=true] .scoreboard .alliance-score>strong{font-size:27px}
 :is(#hud,#matchHUD)[data-touch=true] .scoreboard .clock-box>strong{font-size:24px}
 :is(#hud,#matchHUD)[data-touch=true] .scoreboard .alliance-score>small{font-size:9px}
 :is(#hud,#matchHUD)[data-touch=true] .view-toolbar select{width:90px}
 :is(#hud,#matchHUD)[data-touch=true] .combat-health meter{width:120px}
 .touch-extra-panel{bottom:54px;max-height:calc(100dvh - 160px);overflow:auto}
}
/* The adjacent setup pages share the same fixed navigation and readable surface. */
body.lobby:is([data-screen=event],[data-screen=controls]){--setup-header:76px;--setup-edge:clamp(18px,3vw,48px)}
body.lobby:is([data-screen=event],[data-screen=controls]) .masthead{height:var(--setup-header);padding:12px var(--setup-edge);background:#0c1118}
body.lobby:is([data-screen=event],[data-screen=controls]) .masthead .brand{font:700 20px/1.1 var(--ui-font)}
body.lobby:is([data-screen=event],[data-screen=controls]) #lobbyPanel{position:fixed;inset:var(--setup-header) var(--setup-edge) max(16px,env(safe-area-inset-bottom));width:auto;max-height:none;margin:0;padding:0;display:grid;grid-template-rows:46px auto minmax(0,1fr) 64px;gap:16px;overflow:visible;pointer-events:none;background:none}
body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-tabs{position:static;display:flex;align-items:center;gap:24px;padding:0;overflow-x:auto;flex-wrap:nowrap}
body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-tabs button{flex:none;min-height:44px;padding:8px 2px;font:500 14px var(--ui-font);white-space:nowrap}
body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-heading{position:static;width:auto;max-width:none;padding:0}
body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-heading h1{margin:0;font:650 28px/1.2 var(--ui-font);letter-spacing:-.025em}
body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-heading .intro{margin:8px 0 0;font:400 14px/1.5 var(--ui-font);color:#bfccd9}
body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-heading>.eyebrow{display:none}
body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-screens{position:static;width:100%;max-width:none;min-height:0;max-height:none;overflow:auto;padding:22px;pointer-events:auto;box-sizing:border-box;border-radius:18px;background:#141e2af5;border:1px solid #cedcea2e;scrollbar-width:thin}
body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-screen{animation:none;opacity:1;transform:none}
body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-footer{position:static;inset:auto;display:flex;align-items:center;gap:16px;width:auto;padding:0;border:0;background:none}
body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-footer #start{margin:0;min-height:50px;border-radius:13px;font:650 15px var(--ui-font);letter-spacing:0;max-width:330px}
body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-device{margin:0;font:400 12px var(--ui-font)}
body.lobby:is([data-screen=event],[data-screen=controls]) #gameMenuHint{display:none}
body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-screens :is(label,p,select,button){font-family:var(--ui-font)}
body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-screens :is(select,input){max-width:100%;box-sizing:border-box}
body.lobby:is([data-screen=event],[data-screen=controls]) .control-launch{padding:0;max-width:680px}
body.lobby:is([data-screen=event],[data-screen=controls]) .control-launch h2{font:600 24px/1.3 var(--ui-font);margin:0 0 16px}
body.lobby:is([data-screen=event],[data-screen=controls]) .controller-symbol{display:none}
@media(max-width:1180px){
 body.lobby:is([data-screen=event],[data-screen=controls]){--setup-header:64px;--setup-edge:18px}
 body.lobby:is([data-screen=event],[data-screen=controls]) .header-credits{display:none}
}
@media(max-width:699px){
 body.lobby:is([data-screen=event],[data-screen=controls]){--setup-header:58px;--setup-edge:12px}
 body.lobby:is([data-screen=event],[data-screen=controls]) .masthead .brand{font-size:17px}
 body.lobby:is([data-screen=event],[data-screen=controls]) :is(.brand-sub,#help){display:none}
 body.lobby:is([data-screen=event],[data-screen=controls]) .header-right{gap:8px}
 body.lobby:is([data-screen=event],[data-screen=controls]) #language{max-width:118px;min-height:42px;padding:8px;font-size:14px}
 body.lobby:is([data-screen=event],[data-screen=controls]) #lobbyPanel{grid-template-rows:44px auto minmax(0,1fr) 54px;gap:10px;bottom:max(10px,env(safe-area-inset-bottom))}
 body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-tabs{gap:20px}
 body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-tabs button{font-size:13px}
 body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-heading h1{font-size:24px}
 body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-heading .intro{font-size:13px;margin-top:6px}
 body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-screens{padding:16px;border-radius:16px}
 body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-device{display:none}
 body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-footer #start{width:100%;max-width:none;font-size:14px}
 body.lobby:is([data-screen=event],[data-screen=controls]) .control-launch h2{font-size:20px}
 body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-screens .setup-grid{grid-template-columns:minmax(0,1fr)}
}
@media(max-height:500px) and (min-width:600px){
 body.lobby:is([data-screen=event],[data-screen=controls]){--setup-header:44px;--setup-edge:12px}
 body.lobby:is([data-screen=event],[data-screen=controls]) .masthead{padding:5px 12px}
 body.lobby:is([data-screen=event],[data-screen=controls]) :is(.brand-sub,#help){display:none}
 body.lobby:is([data-screen=event],[data-screen=controls]) #lobbyPanel{grid-template-rows:40px auto minmax(0,1fr) 48px;gap:8px;bottom:8px}
 body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-heading h1{font-size:20px}
 body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-heading .intro{display:none}
 body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-screens{padding:16px}
 body.lobby:is([data-screen=event],[data-screen=controls]) .lobby-footer #start{min-height:44px;font-size:14px}
}
@media(prefers-reduced-motion:reduce){.garage-workbench *{animation:none!important;scroll-behavior:auto!important}}
@media(prefers-contrast:more){.garage-inspector,.garage-preview,.combat-health{border-color:#b8c8d8}:is(#hud,#matchHUD) .view-toolbar{background:#101c2a}}
