/* Fit the stage and controls to the visible viewport; each picker is its own panel. */
.studio-title-tools{display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:7px}
html[data-sos-studio] :is([data-single-screen=game],[data-single-screen=story]) .studio-panel-trigger{min-height:44px;border-radius:10px;padding:6px 11px;font-size:.88rem}
html[data-sos-studio] .app-shell:has([data-single-screen]:not([hidden])){min-height:calc(100dvh - 59px);padding-top:6px;padding-bottom:max(4px,env(safe-area-inset-bottom,4px))}
html[data-sos-studio] .app-shell:has([data-single-screen]:not([hidden]))>footer{display:none}
html[data-sos-studio] [data-single-screen] :is(.arcade-heading,.bucket-heading,.creative-title){margin:0 0 6px;padding:0;min-height:44px;gap:6px}
html[data-sos-studio] [data-single-screen] :is(.arcade-heading,.bucket-heading,.creative-title) h1{font-size:clamp(1.35rem,3.05vw,2.4rem);line-height:1.08}
html[data-sos-studio] [data-single-screen=game] :is(.arcade-heading h1 span,.bucket-heading p,.creative-title p){display:none}
/* Size from the actual header and footer chrome, including zoom and wrapped titles. */
html[data-sos-studio] body:has(#sections-view[data-single-screen=game]:not([hidden])){min-height:100dvh;display:flex;flex-direction:column}
html[data-sos-studio] body:has(#sections-view[data-single-screen=game]:not([hidden]))>.sos-mast{flex:none}
html[data-sos-studio] .app-shell:has(#sections-view[data-single-screen=game]:not([hidden])),
html[data-sos-studio] #sections-view[data-single-screen=game]:not([hidden]),
html[data-sos-studio] #sections-view[data-single-screen=game]:not([hidden])>:has(>.studio-single-game),
html[data-sos-studio] #sections-view[data-single-screen=game] .studio-single-game{display:flex;flex-direction:column;flex:1 0 auto;min-height:0}
html[data-sos-studio] #sections-view[data-single-screen=game]:not([hidden])>:has(>.studio-single-game){padding-bottom:0;margin-bottom:0}
html[data-sos-studio] .studio-single-game>[data-room-layout]{height:auto;min-height:290px;max-height:none;flex:1 0 auto;display:flex;flex-direction:column;overflow:visible}
html[data-sos-studio] .studio-single-game :is(.arcade-hud,.bucket-hud,.piano-hud){flex:none;min-height:42px;padding-block:4px}
html[data-sos-studio] .studio-single-game :is(.arcade-stage,.bucket-stage){height:auto;min-height:128px;flex:1 1 0}
html[data-sos-studio] .studio-single-game .arcade-hud :is(small,.arcade-track-info>span),html[data-sos-studio] .studio-single-game .bucket-hud small{margin:0}
html[data-sos-studio] .studio-single-game :is(.arcade-bottom,.bucket-transport,.piano-toolbar){padding:4px 7px;gap:5px;margin:0;flex:none}
html[data-sos-studio] .studio-single-game .arcade-bottom{justify-content:center;flex-wrap:wrap}
html[data-sos-studio] .studio-single-game :is(.arcade-timing,.road-swipe-hint){display:none}
html[data-sos-studio] .studio-single-game .arcade-transport:not(:has(button:not([hidden]))){display:none}
html[data-sos-studio] .studio-single-game .arcade-transport{flex:0 1 auto;min-width:0}
html[data-sos-studio] .studio-single-game .arcade-controls{flex:1 1 140px;min-width:0;display:flex;gap:5px;padding:0}
html[data-sos-studio] .studio-single-game .arcade-pad{width:auto;flex:1 1 0;min-width:0;max-width:94px;min-height:46px;height:clamp(46px,9dvh,76px);padding:2px 3px}
html[data-sos-studio] .studio-single-game .arcade-pad svg{max-width:100%;height:min(5dvh,32px)}
html[data-sos-studio] .studio-single-game :is(#arcade-message,#arcade-audio-status,#bucket-status,#piano-status){margin:0;padding:2px 6px;font-size:.8rem;line-height:1.28;flex:none;text-wrap:pretty;min-height:0}
html[data-sos-studio] .studio-single-game .bucket-pads{flex:none;padding:4px 7px;gap:5px}
html[data-sos-studio] .studio-single-game .bucket-pads button{min-height:clamp(44px,8dvh,76px);padding:2px 3px;gap:2px}
html[data-sos-studio] .studio-single-game .bucket-pads svg{width:clamp(18px,4dvh,30px);height:auto}
html[data-sos-studio] .studio-single-game .bucket-pads strong{font-size:clamp(.8rem,2.3dvh,1.18rem)}
html[data-sos-studio] .studio-single-game .bucket-pads span{font-size:.68rem}
html[data-sos-studio] .studio-single-game .bucket-overlay{padding:10px;justify-content:center}
html[data-sos-studio] .studio-single-game .piano-console{padding:5px}
html[data-sos-studio] .studio-single-game .piano-board,
html[data-sos-studio] .studio-single-game .piano-stage-area,
html[data-sos-studio] .studio-single-game .piano-track{display:flex;flex:1 1 0;min-height:0;min-width:0;flex-direction:column;gap:0;padding:0}
html[data-sos-studio] .studio-single-game .sky-landing #piano-sky{height:auto;flex:1 1 0;min-height:105px}
html[data-sos-studio] .studio-single-game .piano-keyboard{flex:none;min-height:0}
html[data-sos-studio] .studio-single-game .piano-white{height:clamp(53px,13dvh,109px);min-height:0}
html[data-sos-studio] .studio-single-game .piano-black-key{height:clamp(29px,7dvh,62px);min-height:0}
html[data-sos-studio] .studio-single-game .piano-mascot{display:none}
html[data-sos-studio] .studio-single-game .piano-precision{flex:none;margin:4px 12px}
html[data-sos-studio] .studio-single-game .piano-precision-labels{margin:1px 0}
html[data-sos-studio] .studio-single-game .piano-toolbar button{flex:0 1 auto;min-height:44px;padding:5px 10px}
html[data-sos-studio] .studio-single-game .piano-hud img{height:32px;width:32px}
html[data-sos-studio] .studio-single-game .piano-hud>div{grid-template-columns:32px minmax(0,1fr);min-width:0}
html[data-sos-studio] .studio-single-game .piano-hud strong{font-size:.94rem}
html[data-sos-studio] .studio-single-game .piano-hud small{font-size:.68rem}
html[data-sos-studio] .studio-single-game .arcade-results{padding:6px;gap:4px}
html[data-sos-studio] .studio-single-game .arcade-results h2{margin:2px 0;font-size:clamp(1.35rem,4dvh,2.15rem)}
html[data-sos-studio] .studio-single-game .arcade-ready{padding:clamp(10px,3vw,34px)}
html[data-sos-studio] .studio-single-game .arcade-ready p{margin-bottom:6px}
html[data-sos-studio] .studio-sheet-panel{width:min(580px,calc(100% - 18px));max-height:calc(100dvh - 18px);padding:0;border:1px solid var(--ui-border);border-radius:15px}
.studio-sheet-panel .studio-sheet-header{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 12px;border-bottom:1px solid var(--ui-border)}
.studio-sheet-header h2{font-size:clamp(1.18rem,4vw,1.55rem);margin:0}
.studio-sheet-body{padding:10px;overflow-wrap:anywhere}
html[data-sos-studio] .studio-sheet-panel :is(.arrow-journey,.bucket-journey,.piano-missions){padding:0;margin:0;border:0;background:none!important}
.studio-sheet-panel :is(.journey-heading h2,.journey-heading .eyebrow,.piano-missions>h2,.piano-missions>p,.bucket-journey h2,.bucket-journey .eyebrow,.music-adventure>summary){display:none}
.studio-sheet-panel :is(.arrow-journey .journey-heading,.bucket-journey>div:first-child){margin:5px 0}
.studio-sheet-panel :is(#arrow-journey-grid,#bucket-levels,.piano-levels){margin:5px 0;padding:0;display:block}
.studio-sheet-panel .music-adventure{margin:0;padding:0;border:0}
.studio-sheet-panel .adventure-level-grid{margin:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
.studio-sheet-panel .adventure-level-grid>button{min-width:0;margin:0;padding:8px;min-height:44px}
.studio-sheet-panel :is(.adventure-level-grid>button[hidden],.music-adventure[hidden],.studio-page-nav[hidden]){display:none!important}
.studio-sheet-panel :is(.journey-footer,.studio-level-summary){margin:4px 0}
.studio-sheet-panel .journey-footer>small{display:none}
.studio-chapter-nav label{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:7px;font-size:.88rem}
.studio-chapter-nav select{min-height:44px;min-width:0;max-width:100%;width:100%;padding:4px;color:var(--ui-text)}
.studio-page-nav{display:flex;justify-content:center;align-items:center;gap:8px;padding-top:5px;font-size:.85rem}
.studio-page-nav button{min-height:44px}
html[data-sos-studio] .studio-sheet-panel .studio-play-settings{grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr));border:0}
html[data-sos-studio] .studio-sheet-panel .studio-play-settings :is(.piano-help,.classroom-note){margin:0;font-size:.86rem;grid-column:1/-1}
html[data-sos-studio] .studio-sheet-panel .studio-play-settings :is(.arcade-help,.bucket-instructions){grid-column:1/-1}
html[data-sos-studio] [data-single-screen=story] .simple-story-stage{margin:0;padding:clamp(9px,2.9dvh,24px)}
[data-single-screen=story] .simple-story-stage h2{margin:3px 0;font-size:clamp(1.22rem,4dvh,2.2rem);line-height:1.12}
[data-single-screen=story] .simple-story-stage p{margin:5px 0;font-size:clamp(.8rem,2.5dvh,1rem);line-height:1.35}
[data-single-screen=story] .simple-beats{margin:7px 0}
[data-single-screen=story] .simple-beat{min-height:clamp(38px,10dvh,66px);padding:2px}
[data-single-screen=story] .simple-beat strong{font-size:clamp(1rem,4dvh,1.65rem)}
[data-single-screen=story] .simple-story-buttons{gap:5px}
[data-single-screen=story] .simple-story-buttons button{padding:4px 7px;min-width:0;font-size:.8rem}
[data-single-screen=story] .simple-story-cards{margin:0}
html[data-sos-studio] body.playing .app-shell:has(#play-view:not([hidden])){height:auto;min-height:100dvh;padding:5px 8px}
html[data-sos-studio] body.playing #play-view .game-console{min-height:0;height:clamp(286px,calc(100dvh - 74px),900px);grid-template-rows:auto auto minmax(105px,1fr) auto auto auto auto auto}
html[data-sos-studio] body.playing #play-view .lane{min-height:105px}
html[data-sos-studio] body.playing #play-view .tap-pad{min-height:45px;padding:4px}
html[data-sos-studio] body.playing .app-shell:has(#play-view:not([hidden])) .mission-header{min-height:40px;margin:0 0 4px}
html[data-sos-studio] body.playing #play-view .console-top p{margin:0;font-size:.78rem}
html[data-sos-studio] body.playing #play-view :is(.flight-hud,.energy-row){margin:0;padding:3px 7px}
html[data-sos-studio] body.playing #play-view .play-footer{margin:0;font-size:0}
html[data-sos-studio] body.playing #play-view .play-footer :is(#song-credit,#timing-help){display:none}
html[data-sos-studio] body.playing #play-view #rhythm-song{font-size:.8rem;min-height:32px;padding:2px}
@media(max-width:540px){
 html[data-sos-studio] [data-single-screen] :is(.arcade-heading,.bucket-heading,.creative-title)>div:first-child{flex:1 1 95px}
 html[data-sos-studio] [data-single-screen=story] .creative-title p{display:none}
 html[data-sos-studio] [data-single-screen=story] .story-mode-tabs button{padding:5px 7px;min-height:44px;font-size:.79rem}
 html[data-sos-studio] .studio-single-game .arcade-transport #arcade-stop{padding:4px 6px;font-size:.8rem}
}
@media(max-height:520px) and (min-width:620px){
 html[data-sos-studio] .sos-game-mast .sos-mast-inner{min-height:44px}
 html[data-sos-studio] .studio-single-game>[data-room-layout]{min-height:235px}
 html[data-sos-studio] .studio-single-game .bucket-pads svg{display:none}
 html[data-sos-studio] .studio-single-game .piano-precision{display:none}
 html[data-sos-studio] .studio-single-game .arcade-results :is(.result-stars,.result-stats){font-size:.73rem}
 html[data-sos-studio] .studio-single-game .arcade-results p{margin:1px 0;font-size:.78rem}
 html[data-sos-studio] .studio-single-game .arcade-results button{padding:4px 7px;min-height:38px}
}
.studio-practice-guide{grid-column:1/-1}
.studio-practice-guide>summary{display:flex;min-height:44px;align-items:center;font-weight:750;cursor:pointer}
.studio-sheet-panel .studio-practice-guide .piano-song-guide{margin:0;padding:8px;min-width:0}
@media print{
 html[data-sos-studio] body:has(.studio-practice-guide[open]) :is(.sos-mast,.creative-title,.sky-landing,.studio-sheet-header){display:none!important}
 html[data-sos-studio] .studio-sheet-panel:has(.studio-practice-guide[open]){position:static;max-height:none;width:100%;color:#222;background:white!important;overflow:visible}
 html[data-sos-studio] .studio-sheet-panel:has(.studio-practice-guide[open]) .studio-play-settings>*:not(.studio-practice-guide){display:none}
}
/* Keep the navigation legible when the title and controls share a phone-width row. */
@media(max-width:540px){
 html[data-sos-studio] [data-single-screen=game] .studio-title-tools{flex:0 1 auto;gap:4px}
 html[data-sos-studio] [data-single-screen=game] .studio-panel-trigger{padding-inline:8px}
}
.studio-sheet-header>button{min-height:44px}
