/* Approved mobile PNG design. This surface is used at every viewport width. */
html,body{margin:0;min-height:100%;background:#e5a758 url('assets/background_brown.png') repeat;color:#fff;font-family:'Trebuchet MS','Segoe UI',sans-serif;overscroll-behavior:none}body>header,body>main{display:none}button{font-weight:800;touch-action:manipulation}button:disabled{cursor:default}#mobileUI{display:block}.screen{min-height:100dvh;max-width:520px;margin:auto;padding:calc(24px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));display:flex;flex-direction:column;gap:18px;text-align:center}.screen[hidden]{display:none!important}.screen h1{font-size:48px;letter-spacing:-2px;color:#fff;text-shadow:0 3px #b77b32}.screen h2{font-size:30px;line-height:1.15;letter-spacing:-1px;margin:16px 0}.screen p{font-size:17px;line-height:1.6;margin:4px 0;text-shadow:0 1px #805929}.screen small{color:#513811;font-size:12px;line-height:1.6}.wordmark{letter-spacing:3px;font-size:12px;font-weight:900;color:#513811}.screen button{min-height:48px;border:2px solid #fff9;background:#155533;color:white;border-radius:12px;font-size:16px;padding:12px 16px}.screen button:hover{filter:brightness(1.08)}.screen .spriteButton{border:16px solid transparent;border-image:url('assets/block_square.png') 32 fill stretch;background:none;border-radius:0;padding:4px 10px;min-height:62px;font-size:24px;text-shadow:0 2px #057c42;box-shadow:none}.screen .spriteButton.blue{border-image-source:url('assets/block_rotate_large.png');font-size:19px;text-shadow:0 2px #287aa3}.homeBall{width:112px;height:112px;align-self:center;margin:48px 0 12px}.screen .homeBall+p{font-size:30px;font-weight:900;line-height:1.2}.setupBall{width:76px;height:76px;align-self:center;margin:20px}.mobileModes{display:flex;gap:0;padding:0;margin:12px 0;background:#759d9f;border:3px solid #fff;border-radius:24px;overflow:hidden}.mobileModes button{width:50%;border:0;background:none;border-radius:20px;font-size:21px;color:#f5faf4}.mobileModes button.active{background:#399fd8;box-shadow:inset 0 0 0 2px #a5dfff}.muted{color:#503716!important;text-shadow:none!important;font-size:14px!important}.screenHead{display:flex;gap:12px;align-items:center}.screenHead button{width:48px;padding:0;font-size:28px;flex-shrink:0}.screenHead h2{flex:1;margin:0;border:12px solid transparent;border-image:url('assets/block_square.png') 32 fill stretch;padding:2px;font-size:23px;letter-spacing:-.7px}.chapterNav{display:flex;gap:8px;align-items:center}.chapterNav h3{flex:1;color:#fff;font-size:15px;letter-spacing:1px;margin:0;border:10px solid transparent;border-image:url('assets/block_square.png') 32 fill stretch;padding:4px 0}.chapterNav button{padding:4px 10px;min-width:34px;min-height:40px;font-size:24px}.chapterNav button:disabled{opacity:.3}#levelGrid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}#levelGrid .levelTile{aspect-ratio:1;min-width:0;min-height:0;border:12px solid transparent;border-image:url('assets/block_square.png') 32 fill stretch;border-radius:0;background:none;padding:3px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px}#levelGrid strong{font-size:clamp(25px,7vw,40px);line-height:1}.levelTile>span{font-size:19px;color:#ffe05c;height:22px}.levelTile:disabled{filter:saturate(.12);opacity:.75}.levelTile.selected{outline:4px solid white;outline-offset:1px;border-image-source:url('assets/block_rotate_large.png')!important}.lockIcon{display:block;width:22px;height:22px;background:url('assets/block_locked_small.png') center/contain no-repeat;font-size:0!important}#mobileProgress{font-weight:900}#levelsScreen{gap:14px}#toControls{margin-top:auto}#sceneMenu,#sceneHUD{display:none}body.mobile-playing{overflow:hidden}body.mobile-playing>main{display:block}body.mobile-playing .play{padding:0;max-width:none}body.mobile-playing .play>*:not(.stage),body.mobile-playing aside{display:none}body.mobile-playing .stage{position:fixed;inset:0;width:100vw;height:100dvh;aspect-ratio:auto;border:0;border-radius:0;box-shadow:none;background:url('assets/background_brown.png') repeat}body.mobile-playing #sceneMenu{display:block;position:fixed;z-index:10;top:calc(12px + env(safe-area-inset-top));right:calc(12px + env(safe-area-inset-right));width:44px;height:44px;padding:0;background:#135333ed;border:2px solid white;border-radius:12px;font-size:22px}body.mobile-playing #sceneHUD{display:flex;position:fixed;z-index:8;left:calc(10px + env(safe-area-inset-left));top:calc(12px + env(safe-area-inset-top));align-items:center;gap:9px;background:#135333ed;border:2px solid #fff;border-radius:12px;padding:8px;color:white;font-weight:900;font-size:13px;max-width:calc(100vw - 78px)}#sceneStars{display:flex;gap:2px}#sceneStars img{width:20px;height:20px}#sceneKey{width:22px;height:22px;object-fit:contain}#overlay,.stagecorner{display:none!important}#toast{top:auto;bottom:calc(18px + env(safe-area-inset-bottom));background:#155333ed;font-size:12px;z-index:12;max-width:85%;white-space:normal}canvas{width:100%;height:100%;outline:none!important;touch-action:none}.screen .quiet{background:none;border:0;color:#513811;min-height:44px;text-decoration:underline}.resultStars{display:flex;justify-content:center;gap:14px;margin-top:60px}.resultStars img{width:62px;height:62px}.resultStars img:nth-child(2){transform:translateY(-14px)}#resultScreen h2{font-size:42px;margin:18px 0}#resultStats{font-weight:900;font-size:23px;color:#513811;margin:24px 0}#pauseScreen{justify-content:center}#sensorStatus{font-size:15px;min-height:72px;background:#fff4;color:#513811;padding:12px;border-radius:10px;text-shadow:none}#storageWarning{background:#fff;color:#6f3516;padding:12px;text-shadow:none;font-size:13px}[hidden]{display:none!important}@media(min-width:700px){.screen{border-left:2px solid #fff6;border-right:2px solid #fff6}#levelGrid strong{font-size:36px}}@media(max-height:700px){.screen{gap:12px}.homeBall{margin:18px 0;width:84px;height:84px}.screen h1{margin:0}.resultStars{margin-top:24px}}

#levelGrid .levelTile.selected{border-image-source:url('assets/block_square.png')!important;filter:hue-rotate(65deg)}
/* Bottom actions track the visible device viewport and its safe area. */
.screen{padding-bottom:calc(108px + env(safe-area-inset-bottom))}.screen h1{margin-top:16px}.homeBall{margin:32px 0 16px}.screen .setupBall{margin:16px}.screen #goLevels,.screen #toControls,.screen #mobilePlay,.screen #mobileResume,.screen #resultNext{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(12px + env(safe-area-inset-bottom) + var(--visible-bottom,0px));width:calc(100% - 40px);max-width:480px;z-index:20;margin:0;box-shadow:0 6px 16px #73481444}.screen #enableTilt{border-image:url('assets/button_blue.png') 24 fill stretch;text-shadow:0 1px #26769b;font-size:19px}.screen #sensorStatus{min-height:48px;font-size:14px;padding:10px;margin:0}#mobileProgress{font-size:13px;color:#513811;text-shadow:none;margin:0}.screenHead{padding-right:48px}#fullscreenToggle{position:fixed;z-index:30;top:calc(12px + env(safe-area-inset-top));right:calc(12px + env(safe-area-inset-right));width:44px;height:44px;padding:0;background:#155533ee;color:white;border:2px solid #fff;border-radius:12px;font-size:27px;font-weight:700;display:grid;place-items:center}body.mobile-playing #fullscreenToggle{top:auto;bottom:calc(12px + env(safe-area-inset-bottom) + var(--visible-bottom,0px))}#homeScreen{padding-top:calc(64px + env(safe-area-inset-top))}#pauseScreen,#resultScreen{padding-top:calc(68px + env(safe-area-inset-top))}#levelsScreen .screenHead h2{font-size:21px}#levelGrid{gap:10px}#soundToggle{margin-top:4px}#pauseScreen{justify-content:flex-start;padding-top:calc(24dvh + env(safe-area-inset-top))}
/* Raised arcade controls: game-asset palette, centered Hugeicons, tactile press. */
#mobileUI button{--face:#26cb78;--rim:#70e9a7;--base:#159451;--ink:#093e29;--press-y:0px;border-image:none!important;background:var(--face)!important;border:2px solid var(--rim)!important;color:var(--ink)!important;border-radius:18px!important;box-shadow:0 7px 0 var(--base),0 10px 8px #63461830,inset 0 -3px 0 #0000000b!important;transform:translateY(var(--press-y));transition:transform 100ms ease-out,box-shadow 100ms ease-out,filter 120ms ease-out;padding:12px 18px;min-height:52px;text-shadow:none!important;font-family:inherit;font-size:17px;font-weight:900;line-height:1.15;display:flex;align-items:center;justify-content:center;gap:0;-webkit-tap-highlight-color:transparent;user-select:none;overflow:visible}#mobileUI button:not(:disabled):hover{filter:brightness(1.04)}#mobileUI button:not(:disabled):active{--press-y:5px;box-shadow:0 2px 0 var(--base),0 3px 4px #63461825,inset 0 2px 0 #0000000a!important;filter:brightness(.98)}#mobileUI button:focus-visible{outline:3px solid #123e69;outline-offset:6px}#mobileUI button:disabled{--face:#aeb9a2;--rim:#cbd7bc;--base:#85947c;--ink:#4e614e;opacity:.8;filter:none;cursor:default}#mobileUI .buttonFace{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-width:0;pointer-events:none}#mobileUI .buttonLabel{display:block;flex:0 1 auto;text-align:center;line-height:1.2;overflow-wrap:anywhere}#mobileUI .hugeicon{display:block;width:23px;height:23px;flex:0 0 23px;object-fit:contain;filter:brightness(0) saturate(100%) opacity(.8);pointer-events:none}#mobileUI .tileIcon{width:20px;height:20px;flex-basis:20px;margin-top:5px}#mobileUI .spriteButton{min-height:64px;font-size:21px;padding:14px 18px}#mobileUI #enableTilt,#mobileUI #calibrate,#mobileUI #pauseCalibrate,#mobileUI #touchInstead,#mobileUI .levelTile.selected,#mobileUI .mobileModes button.active{--face:#42a4d5;--rim:#99d9f8;--base:#287fae;--ink:#062e4b}#mobileUI #levelGrid .levelTile{aspect-ratio:1;border-image:none!important;border-radius:15px!important;min-height:0;padding:8px;flex-direction:column;gap:0;outline:none;filter:none}#mobileUI #levelGrid .levelTile.selected{outline:3px solid #fff;outline-offset:3px}#mobileUI #levelGrid{row-gap:18px;column-gap:12px;padding:3px 3px 7px}#mobileUI .mobileModes{padding:0 0 9px;overflow:visible;border:0;background:none;gap:12px;border-radius:0;margin:10px 0}#mobileUI .mobileModes button{width:50%;border-radius:16px!important;min-height:54px;font-size:18px}#mobileUI .mobileModes button:not(.active){--face:#7fa699;--rim:#acd3be;--base:#5d8878;--ink:#143d2c}#mobileUI .chapterNav button,#mobileUI .screenHead>button{padding:0;width:44px;min-width:44px;height:44px;min-height:44px;border-radius:12px!important}#mobileUI .chapterNav button .hugeicon,#mobileUI .screenHead>button .hugeicon{width:22px;height:22px;flex-basis:22px}#mobileUI #fullscreenToggle,#mobileUI #sceneMenu{width:44px;height:44px;min-height:44px;padding:0;border-radius:12px!important}#mobileUI #fullscreenToggle{position:fixed;z-index:30}#mobileUI #sceneMenu{position:fixed}#mobileUI #goLevels,#mobileUI #toControls,#mobileUI #mobilePlay,#mobileUI #mobileResume,#mobileUI #resultNext{transform:translate(-50%,var(--press-y));bottom:calc(20px + env(safe-area-inset-bottom) + var(--visible-bottom,0px));box-shadow:0 7px 0 var(--base),0 12px 12px #63461835,inset 0 -3px 0 #0000000b!important}#mobileUI #goLevels:active,#mobileUI #toControls:active,#mobileUI #mobilePlay:active,#mobileUI #mobileResume:active,#mobileUI #resultNext:active{box-shadow:0 2px 0 var(--base),0 4px 6px #63461825!important}#mobileUI .screen{gap:20px}#mobileUI #controlsScreen{gap:22px}#mobileUI #controlsScreen #sensorStatus{margin-bottom:0}#mobileUI .quiet{font-size:15px;text-decoration:none;min-height:48px}#mobileUI #soundToggle{align-self:center;min-width:152px}#mobileUI #chapterTitle{line-height:1.4}#mobileUI .chapterNav{gap:12px}#mobileUI #pauseScreen{gap:24px}#mobileUI button[hidden]{display:none!important}@media(prefers-reduced-motion:reduce){#mobileUI button{transition:none!important}}@media(max-width:360px){#mobileUI .buttonFace{gap:7px}#mobileUI .mobileModes button{font-size:16px}#mobileUI #enableTilt{font-size:16px}#mobileUI #levelGrid{gap:16px 10px}}
#mobileUI #sceneMenu{display:none}body.mobile-playing #mobileUI #sceneMenu{display:flex}#mobileUI #sceneMenu .buttonFace,#mobileUI #fullscreenToggle .buttonFace,#mobileUI .screenHead>button .buttonFace,#mobileUI .chapterNav button .buttonFace{gap:0}#mobileUI #levelsScreen{padding-bottom:calc(120px + env(safe-area-inset-bottom))}
