/* Final layout authority: bounded rows, one action row, secondary tools in a dialog. */
button,[data-race-action],.raceAction{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
#raceMore{display:none}#raceTools{max-width:460px;width:calc(100vw - 28px)}.raceToolsGrid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.raceToolsGrid button{min-height:48px;font-size:17px;white-space:normal;word-break:normal;overflow-wrap:normal}
body:is(.raceFullscreen,.theater) .stage{grid-template-rows:28px minmax(0,1fr) 3px auto auto!important;gap:0;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)!important}
body:is(.raceFullscreen,.theater) .nextRaceQueue,body:is(.raceFullscreen,.theater) .rules,body:is(.raceFullscreen,.theater) .hostIdentity{display:none!important}
body:is(.raceFullscreen,.theater) .hostControls{display:block;padding:5px 6px!important}
body:is(.raceFullscreen,.theater) .hostActions{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px!important}
body:is(.raceFullscreen,.theater) .hostActions>button{display:none;min-width:0;max-width:none!important;min-height:44px!important;height:44px!important;padding:4px 2px!important;font-size:clamp(12px,3.3vw,17px)!important;line-height:1.05;overflow:hidden;word-break:normal;overflow-wrap:normal!important}
body:is(.raceFullscreen,.theater) .hostActions>:is(#hostJoin,#hostSpin,#hostBoss,#hostGuard,#hostRush,#raceMore){display:block}
body:is(.raceFullscreen,.theater) .controls{height:44px!important;min-height:44px;display:flex!important;flex-wrap:nowrap!important;gap:6px!important;padding:3px 6px!important;overflow:hidden!important}
body:is(.raceFullscreen,.theater) .controls>div{flex:1;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
body:is(.raceFullscreen,.theater) .controls small,body:is(.raceFullscreen,.theater) #demo{display:none!important}
body:is(.raceFullscreen,.theater) .controls button{min-height:36px!important;height:36px;padding:4px 9px!important;white-space:nowrap!important;font-size:13px!important}
body:is(.raceFullscreen,.theater) .racebar{padding:4px 8px!important;overflow:hidden;flex-wrap:nowrap!important;gap:8px;font-size:11px}
body:is(.raceFullscreen,.theater) #stageLabel{display:none}
html.phoneUI body:is(.raceFullscreen,.theater) .canvaswrap{--hud-height:52px!important;min-height:0!important}
html.phoneUI body:is(.raceFullscreen,.theater) #game{top:52px!important;inset:52px 0 0!important;height:calc(100% - 52px)!important;object-fit:contain}
html.phoneUI body.raceLive:is(.raceFullscreen,.theater) #game{object-fit:cover}
html.phoneUI body:is(.raceFullscreen,.theater) #mobileHUD{height:52px!important;--hud-height:52px!important;padding:0!important;overflow:hidden}
html.phoneUI body:is(.raceFullscreen,.theater) #mobileLeg{left:8px;right:8px;top:3px;height:18px;font-size:13px}
html.phoneUI body:is(.raceFullscreen,.theater) #mobileInfo{left:8px;right:8px;top:24px;height:22px;font-size:11px}
html.phoneUI body:is(.raceFullscreen,.theater) :is(#mobileEvent,#mobileComment,#mobileSpeech){display:none!important}
html.phoneUI body:is(.raceFullscreen,.theater) #splash{height:52px!important;padding:4px!important}html.phoneUI body:is(.raceFullscreen,.theater) #splash span{display:none}
@media(pointer:coarse) and (orientation:landscape){
 body:is(.raceFullscreen,.theater) .stage{grid-template-rows:22px minmax(0,1fr) 2px 50px!important;padding-bottom:env(safe-area-inset-bottom)!important}
 body:is(.raceFullscreen,.theater) .hostControls{padding-right:140px!important}
 body:is(.raceFullscreen,.theater) .controls{position:absolute;bottom:env(safe-area-inset-bottom);right:env(safe-area-inset-right);width:138px;height:50px!important;justify-content:flex-end}
 body:is(.raceFullscreen,.theater) .controls>div{display:none}
 html.phoneUI body:is(.raceFullscreen,.theater) .canvaswrap{--hud-height:0px!important}
 html.phoneUI body:is(.raceFullscreen,.theater) #game{inset:0!important;top:0!important;height:100%!important;object-fit:contain}
 html.phoneUI body:is(.raceFullscreen,.theater) #mobileHUD{display:none!important}
}
/* Embedded online host has no duplicate UI; its parent owns the lobby and controls. */
body.onlineEngine .stage{position:fixed;inset:0;width:100%;height:100%;padding:0!important;border:0;border-radius:0;display:block!important}
body.onlineEngine .stage>:not(.canvaswrap){display:none!important}body.onlineEngine>header,body.onlineEngine .headline,body.onlineEngine .layout>aside,body.onlineEngine .bottom,body.onlineEngine footer,body.onlineEngine .commandbar,body.onlineEngine #activity{display:none!important}
body.onlineEngine main,body.onlineEngine .layout{margin:0;padding:0;max-width:none}
body.onlineEngine .canvaswrap{position:absolute;inset:0;min-height:0!important;padding:0!important}
body.onlineEngine #game{position:absolute;inset:0!important;top:0!important;width:100%;height:100%!important;max-height:none;object-fit:contain!important}
body.onlineEngine #mobileHUD,body.onlineEngine #splash{display:none!important}body.onlineEngine{overflow:hidden;background:#16111e}

.modeLink,.ownerSignIn{font-size:13px;padding:8px 10px;border:1px solid #8b6a99;border-radius:7px}.modeLabel{font-size:12px;letter-spacing:1px;color:#b49ac2}.ownerSignIn{font-size:11px}

/* Reveal layout measures the visible playfield, so every unlock clears the action row. */
#pullGrid.mobilePullGrid{inset:var(--pull-center-y,50dvh) auto auto var(--pull-center-x,50vw);transform:translate(-50%,-50%);transform-origin:center;max-width:none;max-height:none;pointer-events:none}
