/* MADA V111 • no sideways/misaligned exercises. Full viewport for activities;
   lesson reading and browsing remain normally scrollable. */
html,body{max-width:100%;overflow-x:clip}
#main{min-width:0}
#main :is(.foundation-focus-page,.game-focus-page,.number-app){min-width:0;box-sizing:border-box}
#main :is(.foundation-focus-page,.game-focus-page) :is(h1,h2,p,small){overflow-wrap:break-word}
/* Landscape orientation denied by iOS/Android's browser/OS: preserve upright
   piano and touch areas. The prior rotated container caused the user's screenshot. */
@media (orientation:portrait) and (pointer:coarse){
 body.number-responsive-page.number-piano-landscape #main .number-app.number-responsive.number-landscape-performance{
   position:fixed!important;inset:0!important;top:0!important;right:0!important;bottom:0!important;left:0!important;
   display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-rows:auto minmax(0,1fr)!important;
   transform:none!important;transform-origin:center!important;
   width:100vw!important;max-width:100vw!important;height:100dvh!important;max-height:100dvh!important;
   overflow:hidden!important;box-sizing:border-box!important;z-index:51000!important;
   padding:max(6px,env(safe-area-inset-top,0px)) max(6px,env(safe-area-inset-right,0px)) max(7px,env(safe-area-inset-bottom,0px)) max(6px,env(safe-area-inset-left,0px))!important;
 }
 body.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance .number-stage{
   display:grid!important;grid-template-rows:auto auto minmax(0,1fr) auto!important;
   min-height:0!important;overflow:hidden!important;gap:4px!important;
 }
 body.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance .number-topbar{
   display:grid!important;grid-template-columns:auto minmax(0,1fr) auto!important;
   min-height:40px!important;max-height:52px!important;gap:5px!important;
 }
 body.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance .number-topbar button{
   font-size:12px!important;min-height:36px!important;max-height:42px!important;padding:5px 7px!important
 }
 body.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance .number-topbar b{
   font-size:clamp(12px,3.3vw,17px)!important
 }
 body.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance .number-piano-focus{
   min-height:0!important;height:100%!important;max-height:100%!important;overflow:hidden!important;
 }
 body.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance .number-sequence{
   min-height:34px!important;height:36px!important;max-height:36px!important;overflow-x:auto!important;overflow-y:hidden!important
 }
 body.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance :is(.practice-quickbar,.number-practice-mode-v81){
   min-height:0!important;max-height:92px!important;overflow:hidden!important
 }
 body.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance .practice-quickbar button{
   min-height:36px!important;max-height:44px!important;white-space:normal!important;font-size:clamp(10px,2.6vw,13px)!important
 }
 body.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance .number-feedback{
   min-height:24px!important;max-height:40px!important;white-space:normal!important;
   display:-webkit-box!important;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden!important
 }
 body.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance .number-rotate-overlay{display:none!important}
}
@media (max-width:430px){
 body.mada110-wide-mode #main [data-mada110-wide] :is(.foundation-stage-focus,.standalone-game-board) :is(.game-head,.foundation-stage-head){margin-bottom:4px!important}
 body.mada110-wide-mode #main [data-mada110-wide] :is(.foundation-stage-focus,.standalone-game-board) :is(.game-head p,.foundation-stage-head p){font-size:clamp(11px,2.6vw,14px)!important}
 body.mada110-wide-mode #main [data-mada110-wide] :is(.foundation-stage-focus,.standalone-game-board) .game-try-piano{max-height:28vh!important;overflow:hidden!important}
 body.mada110-wide-mode #main [data-mada110-wide] :is(.foundation-stage-focus,.standalone-game-board) :is(.game-choices,.toolbar){min-width:0!important}
 body.mada110-wide-mode #main [data-mada110-wide] :is(.foundation-stage-focus,.standalone-game-board) button{max-width:100%!important}
}
/* Musical exam review appears above the keyboard without relocating the page. */
body.number-piano-landscape .number-exam-panel.exam-finished{z-index:2147483000!important}
/* Important: old grids sometimes assigned the keyboard to a 0px auto row in
   landscape. A vertical flex transport reserves all remaining height for keys. */
body.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance .number-stage{
 display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;
 gap:4px!important;overflow:hidden!important;min-height:0!important;max-height:none!important;height:100%!important;
}
body.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance .number-stage>*:not(.number-piano-focus){flex:0 0 auto!important;min-height:0!important}
body.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance .number-piano-focus{
 display:flex!important;flex:1 1 0!important;min-height:0!important;max-height:none!important;height:auto!important;
 overflow:hidden!important;padding:0!important;margin:0!important;
}
body.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance .v108-number-return{display:none!important}
body.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance :is(.number-stage-title,.number-lyrics-panel,.number-reference-audio,.practice-extra-tools,.note-roadmap,.practice-custom-note,.number-map-details){display:none!important}
body.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance :is(.number-song-progress,.number-sequence){flex-shrink:0!important;max-height:34px!important;overflow:hidden!important}
body.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance .number-piano .keyboard-scroll,
body.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance .number-piano .keyboard{min-height:0!important;height:100%!important;max-height:100%!important}
@media (orientation:landscape) and (max-height:460px){
 body.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance .practice-quickbar.full-song-only{max-height:44px!important;overflow:hidden!important}
 body.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance .number-song-progress{display:none!important}
 body.number-responsive-page.number-piano-landscape #main .number-app.number-landscape-performance .number-feedback{max-height:27px!important;overflow:hidden!important}
}
