:root{color-scheme:dark;font-family:Arial,'Hiragino Kaku Gothic ProN','Noto Sans JP',sans-serif;background:#101719;color:#edf3f2;font-synthesis:none}*{box-sizing:border-box}body{margin:0;overscroll-behavior:none}button{font:inherit;cursor:pointer;color:inherit}button:focus-visible{outline:3px solid #c2f970;outline-offset:5px}#app{width:min(100%,540px);height:100svh;min-height:480px;margin:auto;padding:max(24px,env(safe-area-inset-top)) 24px max(20px,env(safe-area-inset-bottom));display:flex;flex-direction:column}header{flex:none}.brand{font-size:14px;letter-spacing:2.5px;font-weight:700;display:flex;justify-content:space-between;align-items:center}.brand span{color:#8caaa9;font-size:12px;letter-spacing:1.5px}.stage-row{display:flex;justify-content:space-between;align-items:center;margin-top:34px}#stage-number{color:#c2f970;letter-spacing:2px;font-size:14px;font-weight:700;margin:0 0 9px}h1{font-size:23px;line-height:1.35;margin:0;font-weight:500}#restart{width:46px;height:46px;border:1px solid #415153;background:transparent;border-radius:50%;display:grid;place-items:center}#restart svg{width:23px;height:23px}#play-area{flex:1;position:relative;display:flex;align-items:center;justify-content:center;min-height:120px;touch-action:none;user-select:none;-webkit-user-select:none}#board{position:relative;--cell:60px;width:calc(var(--cols)*var(--cell));height:calc(var(--rows)*var(--cell))}#tiles{display:grid;grid-template-columns:repeat(var(--cols),var(--cell));grid-auto-rows:var(--cell)}.tile{margin:3px;border-radius:8px;background:#28373a;border:1px solid #445457;position:relative;display:grid;place-items:center}.tile.wall{background:#182225;border:1px solid #253236}.tile.wall:after{content:'';width:22%;height:2px;background:#344447}.tile.memory{background:#33474a;border-color:#638080}.arrow{position:absolute;font-size:calc(var(--cell)*.48);line-height:1;color:#e8f3ef;transition:transform 180ms ease,opacity 180ms;opacity:0}.memory .arrow{opacity:1}.tile.changed{animation:remember 360ms ease}.tile.goal{border:2px solid #c2f970;background:#25382a}.tile.goal:after{content:'';width:33%;height:33%;border:2px solid #c2f970;transform:rotate(45deg)}#player{position:absolute;left:0;top:0;width:var(--cell);height:var(--cell);pointer-events:none;z-index:2;display:grid;place-items:center;will-change:transform}#player:after{content:'';width:62%;height:62%;border:3px solid #c2f970;border-radius:50%;background:#c2f97022;box-shadow:0 0 0 2px #10171980}.moving #player:after{border-color:#e7ffbf}#toast{position:absolute;top:12%;letter-spacing:5px;font-size:25px;font-weight:700;color:#c2f970;opacity:0;pointer-events:none;transition:opacity 120ms}#toast.show{opacity:1}footer{text-align:center;flex:none}#status{font-size:15px;color:#c2f970;min-height:22px;letter-spacing:1px}#hint{font-size:14px;color:#b1c1c1;line-height:1.7;margin:12px 0 24px}.legend{display:flex;justify-content:center;gap:22px;color:#b1c1c1;font-size:12px}.legend span{display:flex;align-items:center;gap:7px}.legend i{display:inline-block;width:14px;height:14px}.player-key{border:2px solid #c2f970;border-radius:50%}.memory-key{font-style:normal;font-size:20px;line-height:14px;color:#e8f3ef}.goal-key{border:1px solid #c2f970;transform:rotate(45deg);width:11px!important;height:11px!important}.keyboard{color:#809797;font-size:12px;margin-top:22px;margin-bottom:0}#clear-panel{position:absolute;z-index:5;background:#101719ef;border:1px solid #64776e;border-radius:16px;padding:28px 24px;text-align:center;width:min(100%,350px);box-shadow:0 12px 55px #0005}#clear-panel[hidden]{display:none}#clear-title{font-size:23px;letter-spacing:2px;color:#c2f970;line-height:1.5;margin:0 0 24px}#next{background:#c2f970;color:#172013;border:0;border-radius:8px;padding:15px 20px;width:100%;font-size:15px}#next span{margin-left:12px}@keyframes remember{50%{border-color:#c2f970;background:#51684a}}@media(max-height:650px){.stage-row{margin-top:18px}#hint{margin:6px 0 12px}.keyboard{margin-top:14px}#app{padding-top:18px;padding-bottom:16px}}@media(prefers-reduced-motion:reduce){.tile.changed{animation:none}.arrow{transition:none}}
.scores{display:flex;justify-content:space-between;gap:12px;margin-top:22px;padding:14px 0;border-top:1px solid #344447;border-bottom:1px solid #344447;font-size:13px;letter-spacing:1px;color:#a9bdbb}.scores b{font-size:20px;font-weight:500;letter-spacing:0;color:#edf3f2;margin-left:7px;font-variant-numeric:tabular-nums}#clear-panel{max-height:calc(100svh - 40px);overflow:auto}#clear-title{font-size:21px;margin-bottom:16px}#clear-steps{font-size:30px;margin:8px 0 14px;font-variant-numeric:tabular-nums}#clear-scores{font-size:14px;color:#b1c1c1}#awards{font-size:14px;color:#c2f970;line-height:1.8}#awards:empty{display:none}#chapter-summary{white-space:pre-line;font-size:15px;line-height:1.9;border-top:1px solid #415153;padding-top:14px}#save-notice{font-size:13px;color:#f3d295;line-height:1.6}.clear-actions{display:flex;gap:10px;margin-top:20px}.clear-actions button{flex:1;min-height:48px}#retry{border:1px solid #728678;border-radius:8px;background:transparent;font-size:15px}#next{width:auto;padding:14px 10px;font-size:14px}@media(max-width:370px){.brand{letter-spacing:1px}.brand span{font-size:11px;letter-spacing:.5px}}@media(max-height:650px){.scores{margin-top:12px;padding:9px 0}}
[hidden]{display:none!important}.screen{display:flex;flex-direction:column;min-height:0;flex:1}.screen:not(#game-screen){overflow-y:auto}.home-screen{justify-content:center;text-align:center}.home-title h1{font-size:clamp(44px,12vw,66px);font-weight:700;letter-spacing:5px;line-height:1.04;margin:20px 0}.home-title>p:not(.eyebrow){font-size:14px;color:#adc0bc;line-height:1.8}.eyebrow{font-size:12px;letter-spacing:1.5px;color:#8ca5a0}.home-actions{width:min(100%,300px);margin:42px auto 0}.primary,.secondary{display:block;border-radius:8px;min-height:48px;padding:14px 18px;font-size:15px;width:100%}.primary{background:#c2f970;border:1px solid #c2f970;color:#172013}.secondary{background:transparent;border:1px solid #50615d}.primary span{float:right}.text-button{background:none;border:0;padding:10px 0;font-size:14px;letter-spacing:1px}.home-foot,#continue-label{color:#8ca5a0;font-size:12px;letter-spacing:1px}.home-foot{margin-top:40px}#continue-label{margin:10px 0 22px}.screen-top{display:flex;justify-content:space-between;align-items:center;gap:12px;flex:none}.screen-title{font-size:25px;letter-spacing:2px;margin:22px 0 24px;flex:none}.chapter-list{display:grid;gap:12px;padding-bottom:8px}.chapter-card{position:relative;background:#182225;border:1px solid #3b4d47;text-align:left;padding:17px 18px;border-radius:10px}.chapter-meta{display:block;color:#93aaa3;font-size:12px;letter-spacing:1px}.chapter-card strong{display:block;font-size:24px;letter-spacing:2px;margin:9px 0 13px;font-weight:500}.chapter-stats{display:flex;gap:22px;font-size:13px;color:#bdcec8}.chapter-access{position:absolute;right:18px;top:45px;color:#c2f970;font-size:20px}.chapter-card:disabled .chapter-access{font-size:11px;top:52px}.chapter-card:disabled,.stage-card:disabled{opacity:.48;cursor:default}.select-progress{font-size:14px;color:#adbfba;margin:0 0 24px}.stage-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.stage-card{display:flex;flex-direction:column;gap:5px;text-align:left;background:#1b2828;border:1px solid #3d514b;border-radius:9px;padding:15px}.stage-card strong{font-size:27px;font-weight:500}.stage-card>span{font-size:13px;color:#b5c5c0}.stage-card .stage-mark{font-size:11px;letter-spacing:1px;margin:2px 0 8px;color:#9bb2a9}.stage-card.achieved{border-color:#96bd63}.stage-card.achieved .stage-mark{color:#c2f970}.selection-legend{font-size:12px;color:#9bb2a9;margin-top:24px}.result-screen{justify-content:center;text-align:center}.result-body{padding:24px 6px;max-width:360px;width:100%;margin:auto}.result-actions{display:grid;gap:12px;margin-top:26px}.result-actions #next{width:100%;font-size:15px}.result-actions #retry{min-height:48px}#result-stage{font-size:13px;color:#94a99f;letter-spacing:2px}#auto-label{font-size:12px;color:#94a99f;margin-top:20px}#menu-panel{position:fixed;inset:0;z-index:20;background:#101719ee;display:grid;place-items:center;padding:24px;overflow:auto}.menu-body{width:min(100%,320px);display:grid;gap:12px;text-align:center}.menu-body h2{font-size:27px;letter-spacing:3px;margin:0 0 16px}.menu-body .eyebrow{margin:0}#game-screen .stage-row{margin-top:16px}#game-screen .brand{min-height:36px}#game-screen #hint{margin:8px 0 15px}#game-screen .keyboard{margin-top:14px}.tile{margin:calc(var(--cell)*.045);border-radius:calc(var(--cell)*.12)}#player:after{border-width:clamp(2px,.5vw,3px)}@media(min-width:450px){.stage-list{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-height:700px){#game-screen h1{font-size:19px}#game-screen .scores{margin-top:12px;padding:9px 0}#game-screen .stage-row{margin-top:8px}#game-screen #hint{font-size:12px;margin:5px 0 8px}#game-screen .keyboard{margin-top:8px}#game-screen .legend{gap:16px}}@media(prefers-reduced-motion:reduce){.tile.changed{animation:none}}
#language-panel{position:fixed;inset:0;z-index:30;background:#101719f5;display:grid;place-items:center;padding:24px;overflow:auto}.language-body{width:min(100%,360px);display:grid;gap:22px;text-align:center}.language-body h2{font-size:23px;line-height:1.5;margin:0}#language-options{display:grid;grid-template-columns:1fr 1fr;gap:12px}#readability-group{border:1px solid #50615d;border-radius:9px;margin:0;padding:16px 12px}#readability-group legend{padding:0 8px;font-size:15px}.readability-options{display:flex;gap:12px}.language-body [aria-pressed="true"]{border-color:#c2f970;background:#26392b;color:#c2f970}.chapter-description{font-size:14px;line-height:1.6;color:#bdcec8;margin:0 0 14px}.chapter-card .chapter-access{position:static;display:block;margin-top:9px;font-size:14px}.chapter-card:disabled .chapter-access{font-size:12px}.chapter-stats{flex-wrap:wrap;gap:8px 20px}#hint{white-space:pre-line}#target-missed,#all-clear{font-size:16px;line-height:1.7;color:#c2f970}#home-language{margin:14px auto 0}.home-foot{margin-top:18px}.stage-card .stage-mark{line-height:1.5;overflow-wrap:anywhere}#stage-title{overflow-wrap:anywhere}.scores{flex-wrap:wrap}.scores span{white-space:nowrap}#chapter{letter-spacing:1px}@media(max-height:700px){#hint{font-size:12px!important;line-height:1.5}.home-actions{margin-top:22px}.home-title h1{margin:12px 0}}
#home-settings{margin:0 auto}#settings-panel,#reset-panel{position:fixed;inset:0;z-index:30;background:#101719f5;display:grid;place-items:center;padding:24px;overflow:auto}.data-body{width:min(100%,380px);margin:auto;display:grid;gap:20px}.data-body h2{font-size:23px;line-height:1.5;margin:0;text-align:center}.data-body h3{font-size:15px;color:#b1c1c1;font-weight:500;margin:0}.data-body p{font-size:15px;line-height:1.75;margin:0}#reset-body{white-space:pre-line}.reset-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px}.danger-button{border-color:#d99987;color:#ffd4c8}#reset-error{color:#ffd4c8}
.home-copyright{font-size:12px;line-height:1.5;color:#92a7a2;text-align:center;margin:8px 0 0;flex-shrink:0}.creator-credit{margin-top:12px;padding-top:20px;border-top:1px solid #344447;text-align:center;display:grid;gap:8px;color:#a3b7b0}.creator-credit p,.creator-credit a{font-size:13px;line-height:1.5;margin:0}.creator-credit .credit-title{font-size:14px;letter-spacing:2px;color:#bfcec9}.creator-credit a{color:#b2c7bf;text-underline-offset:3px;justify-self:center;padding:8px 12px}.creator-credit a:focus-visible{outline:2px solid #c2f970;outline-offset:3px}@media(max-height:700px){.home-copyright{margin-top:4px}.home-screen .home-foot{margin-bottom:0}}
.help-screen{overflow-x:hidden;overflow-y:auto;min-width:0;scrollbar-gutter:stable}.help-screen .screen-top{position:sticky;top:0;background:#101719;z-index:1}.help-screen .screen-title{font-size:23px;line-height:1.45;letter-spacing:1px}.help-content{width:100%;max-width:440px;margin:0 auto;min-width:0}.help-content section{margin:0 0 32px;padding-bottom:28px;border-bottom:1px solid #344447}.help-content h2{font-size:18px;line-height:1.55;font-weight:500;margin:0 0 16px;color:#edf3f2;overflow-wrap:anywhere}.help-content h3{font-size:16px;letter-spacing:2px;color:#c2f970;margin:26px 0 12px}.help-content p{font-size:16px;line-height:1.8;white-space:pre-line;overflow-wrap:anywhere;margin:0;color:#bdcec8}.help-screen .creator-credit{margin:0 0 12px;padding:0 0 12px;border:0;flex-shrink:0}#home-help{margin:12px auto 0}
.sound-setting{border:1px solid #50615d;border-radius:9px;margin:0;padding:12px}.sound-setting legend{padding:0 8px;font-size:15px}.sound-options{display:flex;gap:12px}.sound-options [aria-pressed="true"]{border-color:#c2f970;background:#26392b;color:#c2f970}

/* Release finishing: preserve the visual controls while respecting device edges. */
#app{padding-top:calc(24px + env(safe-area-inset-top,0px));padding-bottom:calc(20px + env(safe-area-inset-bottom,0px));padding-left:calc(24px + env(safe-area-inset-left,0px));padding-right:calc(24px + env(safe-area-inset-right,0px))}
@media(max-height:650px){#app{padding-top:calc(18px + env(safe-area-inset-top,0px));padding-bottom:calc(16px + env(safe-area-inset-bottom,0px))}}
#menu-panel,#language-panel,#settings-panel,#reset-panel{padding:calc(24px + env(safe-area-inset-top,0px)) calc(24px + env(safe-area-inset-right,0px)) calc(24px + env(safe-area-inset-bottom,0px)) calc(24px + env(safe-area-inset-left,0px))}
.menu-body,.language-body,.data-body{margin:auto}
.home-screen{justify-content:flex-start}.home-screen>*{flex-shrink:0}.home-screen .home-title{margin-top:auto}.home-screen .home-copyright{margin-bottom:auto}
.result-screen{justify-content:flex-start}.result-body{flex-shrink:0}
.text-button{min-width:44px;min-height:44px;flex-shrink:0;touch-action:manipulation}
.creator-credit a{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;touch-action:manipulation}
.creator-credit .version{font-size:12px;color:#92a7a2;letter-spacing:.5px}

/* HOME hierarchy: PLAY remains primary; all other actions share the existing secondary outline treatment. */
.home-screen #home-help,.home-screen #home-language,.home-screen #home-settings{display:block;width:min(100%,300px);min-height:48px;margin:12px auto 0;padding:14px 18px;border:1px solid #50615d;border-radius:8px;background:transparent;font-size:15px;letter-spacing:0;color:inherit;touch-action:manipulation}
.home-screen #home-help:hover,.home-screen #home-language:hover,.home-screen #home-settings:hover,.home-screen #home-help:active,.home-screen #home-language:active,.home-screen #home-settings:active{background:#26392b;border-color:#728f78}
.home-screen #home-help:focus-visible,.home-screen #home-language:focus-visible,.home-screen #home-settings:focus-visible{outline:3px solid #c2f970;outline-offset:4px}
.home-screen #home-language,.home-screen #home-settings{margin-top:12px}

/* Keep every secondary action on the normal Stage Clear result screen equally tappable. */
.result-actions #result-stages,.result-actions #result-chapters,.result-actions #result-home{display:block;width:100%;min-height:48px;padding:14px 18px;border:1px solid #50615d;border-radius:8px;background:transparent;font-size:15px;letter-spacing:0;color:inherit;touch-action:manipulation}
.result-actions #result-stages:hover,.result-actions #result-chapters:hover,.result-actions #result-home:hover,.result-actions #result-stages:active,.result-actions #result-chapters:active,.result-actions #result-home:active{background:#26392b;border-color:#728f78}
