/* The established top status row and upper-right Pause stay in place. */
body.compact-play .game-layout { padding: max(2px, var(--sat, 0px)) max(4px, var(--sar, 0px)) max(2px, var(--sab, 0px)) max(4px, var(--sal, 0px)) !important; gap: 3px !important; }
body.compact-play #game-hud { position: relative !important; width: 100% !important; max-width: none !important; min-height: 48px !important; padding: 2px 8px !important; transform: none !important; }
body.compact-play #game-hud #btn-pause { width: 44px !important; height: 44px !important; min-height: 44px; border-radius: 6px !important; }
body.compact-play #btn-boost-desktop, body.compact-play #btn-power-desktop { display: none !important; }
body.compact-play #boost-status { position: relative !important; inset: auto !important; display: flex !important; align-items: center; gap: 8px; width: min(var(--android-board-size), 480px) !important; height: 12px !important; min-height: 12px !important; margin: 0 auto !important; }
body.compact-play #boost-status::before { content: 'BURST'; display: block; color: #a4b3bf; font: 700 9px var(--ui-font); letter-spacing: 1px; }
body.compact-play #boost-gauge-track { flex: 1; height: 5px !important; margin: 0 !important; padding: 0; }
body.compact-play #boost-gauge-fill { height: 100%; box-shadow: none !important; }
body.compact-play .game-stage { width: 100%; min-height: 0; flex: 1; margin: 0 !important; }
body.has-touch-controls .game-stage { grid-template-columns: var(--grip-size, 138px) minmax(0, 1fr) var(--action-width, 140px) !important; }
body #action-cluster { width: var(--action-width, 140px) !important; }
body.compact-play #game-container { border: 0 !important; box-shadow: none !important; border-radius: 5px !important; }
/* Chase view fills its available region; touch controls keep their own slots. */
body[data-game-view="angled"] .game-stage #game-container.mode-3d, body.phone-play.controller-connected[data-game-view="angled"] .game-stage #game-container.mode-3d { width:var(--chase-view-width,100%)!important;height:var(--chase-view-height,100%)!important;max-width:100%!important;max-height:100%!important;aspect-ratio:auto!important;justify-self:center;align-self:center; }
body.phone-play[data-game-view] .game-stage{position:relative;isolation:isolate}
body.phone-play[data-game-view] .game-stage #game-container.mode-3d,body.phone-play.controller-connected[data-game-view] .game-stage #game-container.mode-3d{position:absolute!important;inset:0!important;grid-column:1/-1!important;grid-row:1/-1!important;width:100%!important;height:100%!important;border-radius:0!important}
body.phone-play[data-game-view] :is(#joystick-zone,#dpad-zone,#action-cluster){z-index:35;align-self:end;margin-bottom:8px}
body.phone-play[data-game-view] #joystick-zone{opacity:.82}
body.compact-play.controller-connected .game-stage #game-container.mode-3d { width: 100% !important; height: 100% !important; border-radius: 0 !important; }
/* A phone controller changes input, not the GPU framebuffer's aspect ratio. */
body.phone-play.controller-connected .game-stage #game-container.mode-3d { width: var(--android-board-size) !important; height: var(--android-board-size) !important; }
body.phone-play .game-stage { padding: 0 !important; }
body.compact-play #game-hud #boss-health, body.compact-play #game-hud #boss-warning { font-size: 10px !important; padding: 1px 0 !important; line-height: 1.4 !important; }
body.compact-play #game-toast { top: max(70px, calc(var(--sat, 0px) + 64px)) !important; max-width: calc(100% - 32px); font-size: 11px !important; }
body.compact-play .control-label { font-size: 9px; }
body.compact-play .control-icon { width: 24px; height: 24px; }
@media (orientation: landscape) {
    body.compact-play #game-hud { grid-template-columns: minmax(48px, 1fr) minmax(105px, 1.8fr) minmax(42px, 1fr) minmax(42px, 1fr) minmax(55px, 1fr) 44px !important; column-gap: 6px !important; }
    body.compact-play #game-hud .hud-item { flex-direction: column !important; align-items: center; gap: 1px; }
    body.compact-play #game-hud .hud-score { grid-column: 1; grid-row: 1; }
    body.compact-play #game-hud .hud-power { grid-column: 2 !important; grid-row: 1 !important; flex-direction: row !important; justify-content: center; gap: 8px; min-height: 0; border: 0 !important; padding: 0 !important; }
    body.compact-play #game-hud .hud-wave { grid-column: 3; grid-row: 1; }
    body.compact-play #game-hud .hud-bombs { grid-column: 4; grid-row: 1; }
    body.compact-play #game-hud .hud-best { grid-column: 5; grid-row: 1; }
    body.compact-play #game-hud #btn-pause { grid-column: 6; grid-row: 1; }
    body.compact-play #game-hud .hud-item > span:not(.hud-label) { font-size: 18px !important; }
    body.compact-play #game-hud .hud-label { font-size: 8px !important; letter-spacing: .7px !important; margin: 0; }
    body.compact-play .hud-power-content { flex-direction: column; align-items: flex-start; gap: 0; }
    body.compact-play #power-up { font-size: 11px !important; }
    body.compact-play #power-up-timer { font-size: 9px !important; }
    body.compact-play #boss-health, body.compact-play #boss-warning { grid-row: 2 !important; }
    body.phone-play #game-hud { min-height: 36px !important; height: 36px; grid-template-columns: minmax(40px, 1fr) minmax(105px, 1.8fr) minmax(36px, 1fr) minmax(36px, 1fr) minmax(50px, 1fr) !important; padding-right: 56px !important; }
    body.phone-play #game-hud #btn-pause { position: fixed !important; top: max(2px, var(--sat, 0px)); right: max(6px, var(--sar, 0px)); }
    body.phone-play #game-hud #boss-health, body.phone-play #game-hud #boss-warning { position: fixed !important; top: max(52px, calc(var(--sat, 0px) + 50px)); right: max(8px, var(--sar, 0px)); width: min(var(--action-width), calc((100vw - var(--android-board-size)) / 2 - 20px)); box-sizing: border-box; margin: 0; text-align: center; justify-content: center; }
    body.phone-play #boost-status { position: fixed !important; left: max(8px, var(--sal, 0px)) !important; bottom: max(10px, var(--sab, 0px)) !important; width: min(var(--grip-size), calc((100vw - var(--android-board-size)) / 2 - 20px)) !important; }
}
@media (orientation: portrait) {
    body.has-touch-controls .game-stage { grid-template-columns: 1fr 1fr !important; grid-template-rows: minmax(0, 1fr) var(--touch-row-size, 144px) !important; }
}
