/* Preserve V31 mobile controls and square portrait stage. Fit desktop to viewport. */
.hud{grid-template-columns:1.6fr .8fr .9fr 1.2fr .9fr 1.4fr .7fr}.hud-card{min-width:0}#hudTime.urgent{color:#ff7d82}.result-panel #resultBonus{color:#ffe477;font:bold 13px/1.4 Arial}.result-panel #resultCharacterBest{color:#8ee6ff;font:11px/1.4 Arial}
@media(min-width:761px) and (min-height:551px){
 html{height:100%;overflow:hidden}body{height:100vh;height:100dvh;min-height:0;overflow:hidden;display:flex;flex-direction:column}.topbar{flex:none;min-height:46px;height:auto;padding:5px 10px;grid-template-columns:85px minmax(120px,1fr) auto}.title b{font-size:20px}.title span,.title small{font-size:7px}.actions{flex-wrap:nowrap}.music-box{flex-wrap:nowrap}.music-box select{max-width:130px}.music-box button,.music-box select,.actions>button{min-height:30px;padding:5px;font-size:10px}.player-chip{font-size:10px}.shell{flex:1;min-height:0;height:auto!important;overflow:hidden;width:100%;padding:6px;align-items:stretch;grid-template-columns:minmax(0,1fr) 240px}.gamecol{display:flex;flex-direction:column;min-height:0;height:100%!important;gap:5px}.hud{flex:none;margin:0;gap:5px}.hud-card{min-height:45px;height:45px;padding:4px 7px}.hud-card>b{font-size:18px}.hud-card small{font-size:7px}.hud-card.character b{font-size:10px}.hud-card.character img{width:30px;height:34px}.energy-bar{margin-top:7px;gap:3px}.energy-bar i{width:20px;height:11px}.stage{flex:1 1 0;height:auto!important;aspect-ratio:auto!important;min-height:0!important;max-width:none!important;margin:0}.desktop-help{flex:none;font-size:9px;margin:0;height:14px}.sidepanel{min-height:0;max-height:100%;overflow:auto}.side-title,.mission,.power-info,.progress{padding:10px}.side-title b{font-size:16px}.mission p,.power-info p{font-size:12px}.touch-controls{flex:none}.arcade-parody{flex:none;margin:0!important;padding:3px 8px!important;font:9px/1.2 Arial!important}.select-overlay{overflow:auto}.result-panel{max-height:100%}
}
@media(min-width:761px) and (max-width:1100px) and (min-height:551px){.shell{grid-template-columns:1fr}.sidepanel{display:none}.actions #gameAccount{display:none}.hud-card.character b{font-size:9px}}
@media(max-width:760px) and (orientation:portrait){.hud{grid-template-columns:repeat(6,minmax(0,1fr));gap:3px}.hud-card.character{grid-column:1/-1;min-height:23px;height:23px;padding:1px 6px;gap:6px}.hud-card.character img{width:22px;height:22px}.hud-card.character b{font-size:10px}.hud-card{min-height:34px;padding:3px}.hud-card>b{font-size:12px}.hud-card small{font-size:7px}.energy-bar{gap:2px;margin-top:5px}.energy-bar i{width:7px;height:9px}}
@media(orientation:landscape) and (max-height:550px){.hud{grid-template-columns:1.4fr repeat(6,1fr)}.hud-card.character b{font-size:7px}.hud-card.character img{width:20px}.energy-bar i{width:10px}.result-panel #resultBonus{font-size:10px}.result-panel #resultCharacterBest{font-size:9px}}

@media(max-width:430px){.music-box select,.music-box input[type=range],.music-box label{display:none!important}.topbar .title b{font-size:11px!important}.topbar .actions{gap:3px}.topbar .actions>button{padding:6px 4px!important}.game-topbar .top-actions{gap:3px}}

/* V36: spend the portrait viewport on the playfield, not an empty footer. */
@media(max-width:760px) and (orientation:portrait){
 html,body{height:100%;height:100dvh;min-height:0;overflow:hidden}body{display:flex;flex-direction:column;padding-bottom:env(safe-area-inset-bottom)!important}.topbar{flex:none;min-height:58px;padding:3px 7px;row-gap:2px}.topbar .title span,.topbar .title small{display:none}.topbar .actions{flex-wrap:nowrap}.music-box select,.music-box [data-music-prev],.music-box [data-music-next],.music-volume{display:none!important}.shell{flex:1;min-height:0;height:auto!important;overflow:hidden;width:100%;padding:4px}.gamecol{display:flex;flex-direction:column;height:100%!important;min-height:0;gap:4px}.hud{flex:none;margin:0}.stage{flex:1 1 0;min-height:0!important;height:auto!important;aspect-ratio:auto!important}.touch-controls{height:78px;min-height:78px;margin:0;padding:6px}.desktop-help,.sidepanel{display:none}.select-overlay{overflow:auto}.select-head{flex-wrap:wrap}.selector-install{margin:3px 0}.arcade-parody{min-height:18px}
}
