/* Shared game chrome only. Gameplay art, animation and physics are untouched. */
body.ng2{--ng-cream:#fff8e5;--ng-ink:#40321f;--ng-green:#dcecb5;--ng-line:#90a96a;--ng-header-height:60px;margin:0!important;padding:0!important;background:#fff8e5;color:#40321f;font-family:system-ui,'Yu Gothic',Meiryo,sans-serif;overflow-x:clip;overflow-y:auto;height:auto;min-height:100dvh}
.ng2 [hidden]{display:none!important}.ng2 [data-ng2-hidden]{display:none!important}
.ng2-header{box-sizing:border-box;display:flex!important;align-items:center;justify-content:space-between;flex-wrap:nowrap!important;gap:8px;width:100%;min-height:60px;height:auto!important;padding:8px max(10px,env(safe-area-inset-right)) 8px max(10px,env(safe-area-inset-left))!important;background:#fff8e5!important;border:0;border-bottom:2px solid #a7bc82!important;color:#40321f!important;position:relative;z-index:20}
.ng2-title{min-width:0;flex:1;margin:0!important;font-size:clamp(13px,3.1vw,22px)!important;line-height:1.3!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap!important;color:#40321f!important;text-shadow:none!important;letter-spacing:0!important;text-align:left!important}
.ng2-header-actions{display:flex;flex:none;gap:6px;align-items:center}.ng2 .ng2-header-actions button{min-height:42px!important;padding:7px 10px!important;font-size:clamp(12px,2.9vw,15px)!important;white-space:nowrap!important;flex:none}
.ng2 button:not(.tile),.ng2 .ng2-button{box-sizing:border-box;touch-action:manipulation;font-family:inherit;font-weight:700;line-height:1.4;min-height:44px;min-width:44px;padding:9px 13px;color:#263b16!important;background:#dcecb5!important;border:2px solid #7c984e!important;border-radius:12px!important;box-shadow:0 3px 0 #69823d!important;white-space:nowrap;cursor:pointer;transition:translate 70ms,box-shadow 70ms;text-decoration:none!important}
.ng2 button:not(.tile):not(:disabled):active,.ng2 .ng2-button:active,.ng2 button.ng2-pressed{translate:0 2px;box-shadow:0 1px 0 #69823d!important}.ng2 button:disabled{color:#50554a!important;background:#e3e6db!important;border-color:#919887!important;box-shadow:none!important;cursor:not-allowed;opacity:1!important}
.ng2 :is(button,a,input,select,textarea,summary):focus-visible{outline:4px solid #185c9a!important;outline-offset:3px!important}
.ng2 button[aria-pressed=true]:not(.tile){background:#b8d27b!important;border-color:#536f24!important}
.ng2 .ng2-surface,.ng2 dialog{color:#40321f!important;background:#fff8e5!important;border:2px solid #91ac65!important;border-radius:16px!important;text-shadow:none!important}
.ng2 .ng2-surface :is(h1,h2,h3,p,small,.note,.muted,.explanation),.ng2 dialog :is(h1,h2,h3,p,small){color:#40321f!important;text-shadow:none!important}
.ng2 .ng2-surface a,.ng2 dialog a{color:#31591e!important}.ng2 dialog .bgm-row{background:#eef4dc!important;color:#40321f!important}.ng2 .ng2-surface button,.ng2 dialog button{max-width:100%}
.ng2-dialog{box-sizing:border-box;width:min(94vw,540px)!important;max-height:calc(100dvh - 24px)!important;overflow:auto!important;padding:22px!important;font:16px/1.7 system-ui,'Yu Gothic',sans-serif!important;text-align:left;overscroll-behavior:contain}
.ng2-dialog::backdrop{background:#142017b8}.ng2-dialog h2{margin:0 0 16px;font-size:24px;line-height:1.4}.ng2-dialog p{margin:8px 0 16px}.ng2-dialog .ng2-menu{display:grid;gap:10px}.ng2-dialog .ng2-menu>button{width:100%;text-align:left}.ng2-dialog .ng2-close{display:block;margin:20px 0 0 auto}.ng2-dialog img{max-width:100%;height:auto}.ng2-dialog details{margin:10px 0}.ng2-dialog summary{min-height:44px;cursor:pointer;padding:8px 0}.ng2-dialog .ng2-description :is(button,a){white-space:normal}.ng2-dialog .ng2-description{overflow-wrap:anywhere}
.ng2-dialog .ng2-confirm-actions{display:flex;flex-wrap:wrap;gap:10px}.ng2-dialog .ng2-confirm-actions>*{flex:1}.ng2-message{font-size:14px;line-height:1.6}.ng2-live{position:absolute!important;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.ng2-controls{box-sizing:border-box;display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:8px;width:min(100%,1100px);margin:10px auto;padding:0 10px}.ng2-controls button{margin:0!important}.ng2-results{width:min(100% - 20px,1000px);margin:12px auto}.ng2-result{position:static!important;inset:auto!important;width:100%!important;max-width:100%!important;height:auto!important;max-height:none!important;overflow:visible!important;box-sizing:border-box;margin:10px 0!important;padding:18px!important}
.ng2-result>div{max-width:100%}.ng2-result img{max-height:120px;object-fit:contain}.ng2-result h1{font-size:clamp(22px,4vw,32px)!important}.ng2-result .ng2-button{display:inline-flex;margin-top:12px;align-items:center;justify-content:center}
/* Slide: retain the board ratio and native data nodes; only alter their presentation. */
.ng2[data-ng2-game=slide] #slideApp{width:min(100%,1100px);box-sizing:border-box;margin:auto;padding:12px}
.ng2[data-ng2-game=slide] .course-info h2,.ng2[data-ng2-game=slide] .readout{color:#40321f!important}.ng2[data-ng2-game=slide] #difficulty,.ng2[data-ng2-game=slide] #gravityLabel{display:none!important}
.ng2[data-ng2-game=slide] #gameControls{max-width:none!important;display:block!important;margin:10px 0!important}.ng2[data-ng2-game=slide] .ng2-slide-primary{display:grid;grid-template-columns:minmax(0,3fr) minmax(0,1fr) minmax(0,1fr);gap:5px;width:100%}
.ng2[data-ng2-game=slide] .ng2-slide-primary>button{width:100%!important;min-width:0!important;height:48px!important;min-height:48px!important;aspect-ratio:auto!important;padding:8px 3px!important;background-image:none!important;filter:none!important;transform:none!important;font-size:clamp(10px,2.7vw,15px)!important;white-space:nowrap!important}
.ng2[data-ng2-game=slide] .ng2-slide-primary>button:not(#start){font-size:clamp(9px,2.7vw,14px)!important}
.ng2[data-ng2-game=slide] .ng2-slide-primary #start{background:#288b20!important;color:#fff!important;border-color:#1d6818!important;box-shadow:0 3px 0 #165412!important;font-size:clamp(16px,4vw,21px)!important}.ng2[data-ng2-game=slide] .ng2-slide-primary #start:disabled{background:#dfe3d8!important;color:#53594c!important;border-color:#959e88!important;box-shadow:none!important}
.ng2[data-ng2-game=slide] .ng2-slide-secondary{display:flex;align-items:center;justify-content:center;gap:8px;flex-wrap:wrap;margin-top:12px;font-size:13px}.ng2[data-ng2-game=slide] .ng2-slide-secondary :is(button,select){font-size:13px;min-height:44px;white-space:nowrap}.ng2[data-ng2-game=slide] #notice{display:block!important;text-align:center}.ng2[data-ng2-game=slide] #notice[hidden]{display:none!important}.ng2[data-ng2-game=slide] #notice #next{background:#288b20!important;color:#fff!important}.ng2[data-ng2-game=slide] #resultText{margin:0 0 12px;max-width:100%;font-size:20px}
.ng2[data-ng2-game=slide] .help{display:none}.ng2[data-ng2-game=slide] #hintText{color:#fff}.ng2[data-ng2-game=slide] #courseScreen :is(h2,p){color:#40321f!important}
/* Each game keeps its existing portrait or landscape field, without button overlays. */
.ng2[data-ng2-game=jump] #app{height:calc(100dvh - 130px);max-width:520px;min-height:300px;overflow:hidden}.ng2[data-ng2-game=jump] .controls{position:static!important;inset:auto!important;width:min(100% - 24px,500px);margin:10px auto;display:flex;justify-content:space-between;pointer-events:auto}.ng2[data-ng2-game=jump] .controls .control{height:50px;min-height:44px;width:90px}.ng2[data-ng2-game=jump] .hud button{min-height:36px;font-size:11px}
.ng2[data-ng2-game=run]>main{height:calc(100dvh - 124px);min-height:240px}.ng2[data-ng2-game=run] .cover button{pointer-events:auto}.ng2[data-ng2-game=run] .ng2-result{pointer-events:auto}.ng2[data-ng2-game=run] #run-paused{display:none!important}
.ng2[data-ng2-game=hockey] #frame{position:relative;inset:auto;transform:none;margin:12px auto;width:min(100%,1280px);height:auto;aspect-ratio:16/9;overflow:visible}.ng2[data-ng2-game=hockey] #frame canvas{height:auto;aspect-ratio:16/9}.ng2[data-ng2-game=hockey] #overlay.hidden{display:none!important}.ng2[data-ng2-game=hockey] #overlay{display:flex!important;gap:12px;align-items:center;text-align:center}.ng2[data-ng2-game=hockey] #overlay #hero{max-height:100px}
.ng2[data-ng2-game=gomi] main>header>span{display:none}.ng2[data-ng2-game=gomi] main>header{height:auto;padding:0;min-height:0}.ng2[data-ng2-game=gomi] #arena{overflow:visible}.ng2[data-ng2-game=gomi] #arena>canvas{border-radius:14px}.ng2[data-ng2-game=gomi] #paused{display:none!important}
.ng2[data-ng2-game=water] .overlay[hidden]{display:none!important}.ng2[data-ng2-game=water] .overlay .panel{max-width:100%}.ng2[data-ng2-game=water] .arena{overflow:visible}
.ng2[data-ng2-game=tax] main{height:calc(100dvh - 160px);min-height:320px}.ng2[data-ng2-game=tax] .ng2-controls{margin:8px auto}.ng2[data-ng2-game=tax] canvas{max-height:100%}
.ng2[data-ng2-game=quiz]>main,.ng2[data-ng2-game=english]>main,.ng2[data-ng2-game=eco]>main,.ng2[data-ng2-game=pipes]>main{margin-top:12px}.ng2 :is(.ng2-native-title){display:none!important}
.ng2 main:fullscreen{overflow:auto;padding-top:8px}.ng2 .ng2-surface .muted{color:#40321f!important}
@media(max-width:380px){.ng2-header{gap:4px;padding-left:8px!important;padding-right:8px!important}.ng2-header-actions{gap:4px}.ng2 .ng2-header-actions button{padding:7px 7px!important;font-size:12px!important}.ng2[data-ng2-game=slide] #slideApp{padding:10px}}
@media(prefers-reduced-motion:reduce){.ng2 button,.ng2 .ng2-button{transition:none!important}.ng2 button:active,.ng2 .ng2-button:active,.ng2 button.ng2-pressed{translate:none!important;box-shadow:inset 0 2px 0 #526c2c!important}}

/* Let relocated game controls and start/results remain reachable. */
html:has(>body.ng2){height:auto;min-height:100%;overflow-y:auto;overflow-x:clip}
.ng2[data-ng2-game=jump] #panel .sheet{max-height:none;overflow:visible}

/* Body grid from native games must not stretch the shared header or start panels. */
body.ng2{display:block!important}
.ng2-header{min-width:0!important;max-width:100%!important;margin:0!important}
.ng2-title{flex:1 1 0!important;width:0!important;min-width:0!important}
.ng2[data-ng2-game=water]>main{margin:12px auto;min-height:0}
.ng2[data-ng2-game=water] #player{left:50%}
.ng2[data-ng2-game=water] main>.top{display:none!important}
.ng2[data-ng2-game=gomi]>main{margin:12px auto;min-width:0;max-width:100%;box-sizing:border-box}
.ng2[data-ng2-game=gomi] #title .title-cover{max-height:160px;width:100%;object-fit:contain}
.ng2[data-ng2-game=water] .controls{position:static;min-height:68px;margin:0}

.ng2[data-ng2-game=pipes] #levels{grid-template-columns:repeat(3,minmax(0,1fr))}
.ng2[data-ng2-game=pipes] #levels .level{min-width:0;max-width:100%;white-space:normal!important;overflow-wrap:anywhere;padding:12px 8px}
.ng2[data-ng2-game=pipes] #levels .level span{white-space:normal!important;font-size:clamp(10px,2.6vw,13px);line-height:1.5;overflow-wrap:anywhere}
.ng2[data-ng2-game=pipes] #levels .level b{line-height:1.3}
.ng2[data-ng2-game=pipes] #levels .master{white-space:normal!important;overflow-wrap:anywhere;font-size:clamp(14px,3.6vw,19px)}

/* Unified game page width and persistent top-right navigation: 20261028 */
/* Use the desktop quiz area for readable content instead of long sparse rows. */
@media(min-width:900px){
 body.ng2[data-ng2-game=quiz]>main,body.ng2[data-ng2-game=english]>main{width:100%!important;max-width:1100px!important;margin:8px auto!important}
 body.ng2[data-ng2-game=quiz] main .content,body.ng2[data-ng2-game=english] main .content{padding:12px!important}
 body.ng2[data-ng2-game=quiz] main .board,body.ng2[data-ng2-game=english] main .board{padding:12px!important}
 body.ng2[data-ng2-game=quiz] main .banner,body.ng2[data-ng2-game=english] main .banner{height:180px!important;max-height:180px!important;width:auto!important;max-width:100%!important;margin:0 auto 10px!important;object-fit:contain}
 body.ng2[data-ng2-game=quiz] main .meta,body.ng2[data-ng2-game=english] main .meta{font-size:15px!important;margin-bottom:8px!important}
 body.ng2[data-ng2-game=quiz] main #board #question,body.ng2[data-ng2-game=english] main #board #question{font-size:22px!important;line-height:1.5!important;padding:14px 18px!important;min-height:64px!important;margin-bottom:8px!important}
 body.ng2[data-ng2-game=quiz] main #answers,body.ng2[data-ng2-game=english] main #answers{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
 body.ng2[data-ng2-game=quiz] main #answers button,body.ng2[data-ng2-game=english] main #answers button{font-size:20px!important;min-height:64px!important;padding:12px 16px!important;gap:12px!important}
 body.ng2[data-ng2-game=quiz] main .lifelines,body.ng2[data-ng2-game=english] main .lifelines{gap:10px!important;margin:10px 0!important}
 body.ng2[data-ng2-game=quiz] main .lifelines button,body.ng2[data-ng2-game=english] main .lifelines button{font-size:15px!important}
}
.ng2 #bgmTracks .ng2-music-name{white-space:pre-line!important;line-height:1.5;min-width:0;overflow-wrap:anywhere}
.ng2 #bgmTracks .bgm-row{gap:12px}
body.ng2{width:100%!important;max-width:1100px!important;margin:0 auto!important;box-sizing:border-box}
.ng2-header{width:100%!important;max-width:1100px!important;box-sizing:border-box}
.ng2-header-actions{justify-content:flex-end}
.ng2-results{max-width:1100px;box-sizing:border-box}
.ng2[data-ng2-game=hockey] #frame{max-width:1100px!important}
@media(max-width:700px){
 .ng2-header{flex-wrap:wrap!important;gap:4px!important}
 .ng2-title{flex:1 1 100%!important;width:100%!important;font-size:18px!important}
 .ng2-header-actions{width:100%;gap:4px;justify-content:flex-end}
 .ng2 .ng2-header-actions button{min-width:44px!important;min-height:42px!important;padding:6px!important;font-size:12px!important}
}
@media(max-width:360px){
 .ng2-header{padding-left:6px!important;padding-right:6px!important}
 .ng2-header-actions{gap:3px}
 .ng2 .ng2-header-actions button{padding:5px 4px!important;font-size:11px!important}
}
