/* V31: one aspect ratio per viewport, same world coordinates and safe touch area. */
[hidden]{display:none!important}html,body{height:auto;min-height:100%;overflow:auto}body{padding:0!important}.scanlines{opacity:.25}
.topbar{position:relative;height:auto;min-height:64px;grid-template-columns:100px minmax(130px,1fr) auto}.actions{flex-wrap:wrap;justify-content:flex-end}.music-box{align-items:center;flex-wrap:wrap}.music-box button,.music-box select{min-height:34px}
.shell{height:auto;overflow:visible;max-width:1700px;align-items:start}.gamecol{height:auto;display:block}.stage{width:100%;aspect-ratio:16/9!important;min-height:0!important;max-height:none!important;height:auto!important}.stage canvas{width:100%;height:100%;object-fit:contain;filter:none!important}.touch-controls{display:none;position:relative!important;left:auto!important;right:auto!important;bottom:auto!important;margin:7px 0 0;padding:10px;z-index:10;height:88px;border-radius:12px}.sidepanel{min-height:0}.sidePowerIcon img,.power-info>span img{width:54px;height:60px;object-fit:contain}.power-info>span{display:block;width:54px;flex-shrink:0}
.power-timer{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);padding:7px 12px;border:1px solid #ffe399;background:#1b1534ed;color:#fff1a8;font:bold 12px Arial;z-index:8;white-space:nowrap;pointer-events:none}
.game-message{top:18%;max-width:90%;width:max-content;font:700 14px/1.4 Arial;z-index:9}.result-overlay{overflow:auto;padding:14px}.result-panel{max-height:100%;overflow:auto;padding:18px}.result-panel h2{font-size:clamp(19px,3vw,32px)}.result-panel p{font-size:14px}.result-actions button,.result-actions a{min-height:44px}.result-stats{margin:10px 0}.result-stats small{font-size:11px}.save-status{font:12px/1.4 Arial}.pause-layer{align-content:center;gap:20px}.pause-layer b{font-size:38px}
.character-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}.character-card{min-height:190px}.character-card img{height:145px!important;object-fit:contain!important;padding:5px}.character-card b{font-size:12px;line-height:1.25}.character-card small{font-size:9px;padding:5px}.character-card.op:after{font-size:11px}.character-card:focus-visible{outline:3px solid #65f1ff;outline-offset:3px}.character-card.active{border:3px solid #ffe14c}.selection-detail h2{font-size:23px}.selection-detail>img{object-fit:contain!important}.select-head p{display:block}.select-actions small{font:11px Arial}.select-overlay{z-index:95}.play-btn:disabled{opacity:.6;cursor:wait}.op-badge[hidden]{display:none!important}.pressed{filter:brightness(1.6);transform:translateY(2px)}
@media(max-width:1100px){.shell{grid-template-columns:1fr}.sidepanel{display:none}.hud-card{min-height:50px}.stage{max-width:1200px}.selection-detail{grid-template-columns:120px 1fr 220px}.selection-detail>img{width:110px;height:110px}}
@media(pointer:coarse),(max-width:760px){.touch-controls{display:flex!important}.move-pad button{width:72px;height:62px;border-radius:12px}.action-pad button{width:84px;height:62px}.playing{overscroll-behavior:none}.stage,.touch-controls{touch-action:none;-webkit-touch-callout:none;user-select:none}.desktop-help{display:none}}
@media(max-width:760px) and (orientation:portrait){
 html,body{height:auto;overflow:auto}.topbar{padding:6px 8px;min-height:58px;grid-template-columns:65px 1fr}.title{text-align:right}.title b{font-size:17px}.actions{grid-column:1/-1;justify-content:space-between;gap:3px}.actions #gameAccount{display:none}.music-box{gap:3px}.music-box select{max-width:116px;font-size:11px}.music-box button{font-size:10px}.actions>button{font-size:10px;min-height:34px}.back{font-size:11px}.shell{padding:5px;height:auto!important;overflow:visible}.gamecol{height:auto!important}.hud{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}.hud-card{padding:4px 6px;min-height:40px}.hud-card.character{grid-column:auto}.hud-card.character img{width:28px;height:28px}.hud-card.character b{font-size:9px}.hud-card small{font-size:8px}.hud-card>b{font-size:14px}.hud-card.character small{display:none}.energy-bar{gap:3px;margin-top:6px}.energy-bar i{width:14px;height:10px}.stage{aspect-ratio:1/1!important}.touch-controls{height:82px;flex:none;margin-top:5px;padding:7px}.move-pad{gap:5px}.move-pad button{width:60px;height:60px}.action-pad{gap:6px}.action-pad button{width:72px;height:60px}.power-timer{font-size:10px;bottom:7px;padding:5px}.game-message{font-size:11px}.arcade-parody{margin:5px auto!important}
 .select-overlay{padding:6px 6px calc(6px + env(safe-area-inset-bottom,0px))}.select-head{padding:12px}.select-head h1{font-size:32px}.select-head p{font-size:12px;line-height:1.4}.character-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:9px}.character-card{min-height:185px}.character-card img{height:135px!important}.character-card b{font-size:12px}.character-card small{font-size:9px}.selection-detail{grid-template-columns:70px 1fr;position:sticky;bottom:0;padding:9px;gap:8px;background:#080e24fa}.selection-detail>img{width:64px;height:64px}.selection-detail h2{font-size:17px}.selection-detail h3{font-size:11px}.selection-detail p{display:none}.selection-detail span{font-size:8px}.select-actions{grid-column:1/-1}.select-actions .nick-slot{display:none}.play-btn{padding:11px;font-size:15px}.result-panel{width:100%;padding:12px}.result-panel p{font-size:12px;line-height:1.35}.result-panel h2{margin:4px 0}.result-stats{gap:4px;margin:8px 0}.result-stats div{padding:5px}.result-stats b{font-size:17px}.result-actions{gap:5px}.result-actions button,.result-actions a{padding:8px;font-size:10px;min-height:38px}.save-status{font-size:10px}
}
@media(orientation:landscape) and (max-height:550px){
 html,body{height:auto;overflow:auto}.topbar{min-height:36px;padding:3px 8px;grid-template-columns:75px 1fr auto}.title b{font-size:15px}.title small,.title span{display:none}.actions #gameAccount{display:none}.music-box button,.music-box select,.actions>button{min-height:28px;padding:4px;font-size:9px}.shell{padding:3px;display:block;height:auto!important;overflow:visible}.gamecol{display:grid;grid-template-columns:minmax(0,1fr) 190px;grid-template-rows:auto auto;gap:4px;max-width:1100px;margin:auto;height:auto!important}.hud{position:static;grid-column:1/-1;grid-template-columns:repeat(6,minmax(0,1fr));width:auto;margin:0;pointer-events:auto}.hud-card{min-height:32px;padding:3px}.hud-card.character{display:flex;grid-column:auto}.hud-card.character img{width:25px;height:25px}.hud-card.character b{font-size:8px}.hud-card small{font-size:7px}.hud-card>b{font-size:12px;margin-top:2px}.stage{grid-column:1;aspect-ratio:16/9!important;width:min(100%,calc((100dvh - 110px)*1.77778));justify-self:center}.touch-controls{grid-column:2;display:flex!important;flex-direction:column;justify-content:center;gap:14px;position:static!important;height:100%;margin:0;background:#071025;pointer-events:auto;padding:6px}.move-pad,.action-pad{gap:7px}.move-pad button{width:72px;height:58px;opacity:1}.action-pad button{width:76px;height:58px;opacity:1}.arcade-parody{font-size:10px!important;margin:2px auto!important;padding:3px 12px!important}.select-head{padding:8px}.select-head h1{font-size:24px}.select-head p{display:none}.character-grid{grid-template-columns:repeat(5,minmax(0,1fr));padding:6px}.character-card{min-height:128px}.character-card img{height:88px!important}.character-card b{font-size:9px}.character-card small{display:none}.selection-detail{position:sticky;bottom:0;grid-template-columns:60px 1fr 220px;padding:6px}.selection-detail>img{width:54px;height:54px}.selection-detail p{display:none}.selection-detail h2{font-size:16px}.selection-detail h3{font-size:10px}.select-actions{grid-column:auto}.select-actions .nick-slot,.select-actions small{display:none}.result-panel{padding:8px}.result-panel p{font-size:11px;margin:4px}.result-panel h2{font-size:19px;margin:4px}.result-stats{margin:4px}.result-stats div{padding:4px}.result-actions button,.result-actions a{padding:6px;min-height:30px;font-size:10px}.game-message{font-size:11px;top:22%}
}

@supports(padding:max(0px)){.touch-controls,.mobile-controls{padding-bottom:max(8px,env(safe-area-inset-bottom,0px))!important}.topbar,.game-topbar{padding-left:max(8px,env(safe-area-inset-left,0px))!important;padding-right:max(8px,env(safe-area-inset-right,0px))!important}}
