:root{color-scheme:dark;--bg:#101426;--panel:#20263c;--ink:#f8f3f8;--muted:#c0bad0;--rose:#efb9ce;--line:#555c78}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,'Yu Gothic',Meiryo,sans-serif}button,a{touch-action:manipulation}button{font:inherit;cursor:pointer;border:1px solid #65708b;background:#292f46;color:var(--ink);border-radius:11px;min-height:44px;padding:9px 13px}button:disabled{cursor:default;opacity:.55}button:hover:not(:disabled){background:#3d405c}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #fff0c5;outline-offset:3px}a{color:inherit;text-decoration:none}.nav{max-width:1100px;margin:auto;display:flex;justify-content:space-between;gap:14px;padding:22px 16px;font-size:13px}.brand{font-weight:850;letter-spacing:.06em}.wrap{max-width:1080px;margin:auto;padding:0 14px 34px}.heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:22px}h1{font-size:clamp(22px,3.4vw,35px);margin:8px 0;letter-spacing:.02em}.eyebrow{font-size:10px;color:#efbdcf;font-weight:800;letter-spacing:.15em;margin:0}.badge{border:1px solid #78718b;border-radius:99px;padding:7px 12px;font-size:11px;white-space:nowrap;color:#e5d8eb}.stage-tabs{display:flex;gap:8px;margin-bottom:12px}.stage-tabs button{flex:1;text-align:left;font-size:13px;padding:11px 13px}.stage-tabs button[aria-current=true]{border-color:#e7bed0;background:#43344d}.stage-tabs small{display:block;color:#d1bbcf;font-size:10px;margin-top:4px}.hud{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:12px 14px;background:#20263c;border:1px solid #5c5872;border-bottom:0;border-radius:14px 14px 0 0;font-size:12px}.hud span:first-child{color:#edc7d5;font-weight:bold}.hud b{color:#fff4d7;margin-left:4px}.stage{position:relative;isolation:isolate;border:2px solid #766c8b;border-radius:0 0 15px 15px;overflow:hidden;background:#d8c7ad;box-shadow:0 14px 40px #0004}canvas{display:block;width:100%;aspect-ratio:16/9;touch-action:none}.overlay{position:absolute;inset:0;z-index:2;background:#111627ba;display:grid;place-items:center;padding:15px}.overlay[hidden]{display:none}.panel{width:min(580px,98%);max-height:100%;overflow:auto;background:#20243bef;border:1px solid #b9a1b8;border-radius:18px;padding:clamp(17px,3.2vw,30px);text-align:center;box-shadow:0 18px 45px #0008}.panel h2{font-size:clamp(20px,3.3vw,30px);margin:10px 0}.panel p{white-space:pre-line;color:#e0d5e1;font-size:14px;line-height:1.85}.panel-details{font-size:12px;line-height:1.8;color:#ffe8bd}.panel-actions{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:17px}.primary{background:#efb9ce!important;border-color:#efb9ce;color:#2b2035;font-weight:bold;min-width:130px;border-radius:99px}.secondary{background:#ffffff12;border-radius:99px}.hint{padding:12px 14px;margin:9px 0;background:#212b3b;border-left:3px solid #c9adc5;border-radius:5px;font-size:13px;line-height:1.65;min-height:44px}.toolbar{display:flex;justify-content:space-between;flex-wrap:wrap;gap:9px;margin:14px 0}.toolbar>div{display:flex;gap:7px;flex-wrap:wrap}.toolbar button{font-size:12px}.controls{display:flex;justify-content:space-between;align-items:center;gap:12px;user-select:none;-webkit-user-select:none}.controls>div{display:flex;gap:9px}.controls button{height:60px;min-width:66px;touch-action:none;font-weight:bold;font-size:14px}.movement button{font-size:23px}.controls .jump{background:#74546d;border-color:#d6aec3;min-width:95px}.controls button.pressed{background:#a5748e}.controls button.cooldown{opacity:.5}.help,.credits{color:var(--muted);font-size:12px;line-height:1.85;margin:17px 3px}.journal{margin-top:35px;padding:24px;border:1px solid #626177;border-radius:19px;background:linear-gradient(135deg,#21263a,#292137)}.journal-heading{display:flex;justify-content:space-between;align-items:center;gap:14px}.journal h2{font-size:24px;margin:8px 0 0}.journal-intro{color:#d0c3d7;font-size:13px;line-height:1.8}.records{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px;margin:22px 0}.record{border:1px solid #706278;background:#161e30;padding:17px;border-radius:13px}.record h3{font-size:14px;margin:0 0 13px}.record p{font-size:12px;color:#c9c0d2;line-height:1.8;margin:4px 0}.record b{color:#fff0c5}.record button{width:100%;margin-top:11px;font-size:12px}.achievements{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:22px}.achievement{border:1px solid #544e66;padding:9px 12px;border-radius:99px;color:#a79ab5;font-size:11px}.achievement.done{background:#49344a;color:#ffe4bf;border-color:#b894aa}.journal>h3{font-size:15px}.journal details{border-top:1px solid #5b516b;padding-top:17px;font-size:13px}.journal summary{cursor:pointer;font-weight:bold;min-height:32px}.memory-list p{padding:13px 0;border-bottom:1px solid #ffffff18;color:#d2c8dd;line-height:1.9}.memory-list b{display:block;color:#f0c3d5}.epilogue{margin-top:20px;padding:20px;border:1px solid #d2b68c;border-radius:13px;background:#453347;font-size:14px;line-height:1.9;color:#fff0d2}footer{text-align:center;color:#a69ab5;font-size:12px;padding:15px 0 30px}@media(max-width:650px){.heading{display:block}.heading .badge{display:inline-block;margin-top:5px}.hud{gap:6px;padding:10px;font-size:11px}.hud span:first-child{width:100%}.stage-tabs button{font-size:11px;padding:8px}.stage-tabs small{font-size:9px}.controls{gap:6px}.controls>div{gap:5px}.controls button{min-width:43px;height:57px;padding:6px 8px;font-size:11px}.movement button{font-size:18px}.controls .jump{min-width:68px}.journal{padding:17px}.journal-heading{display:block}.journal-heading .badge{display:inline-block;margin-top:10px}.records{grid-template-columns:1fr}.record{display:grid;grid-template-columns:1fr 1fr;gap:2px 10px}.record h3{grid-column:1/-1;margin-bottom:8px}.record button{grid-column:1/-1}.panel{padding:12px}.panel h2{margin:6px 0;font-size:19px}.panel p{font-size:11px;margin:6px 0}.panel-details{font-size:10px}.panel-actions{margin-top:8px}.panel-actions button{padding:7px 12px;min-height:38px;font-size:12px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}

/* Keep native selection, callouts and browser panning out of the game controls. */
.stage,.controls,.controls *,.toolbar button{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}
.controls,.controls *,.stage canvas{touch-action:none}
.controls button{position:relative;-webkit-appearance:none;appearance:none;}
.controls{overscroll-behavior:none}
.play-area{position:relative}
.toolbar .view-tools{display:flex;gap:7px;flex-wrap:wrap}
body.game-mode{position:fixed;inset:0;overflow:hidden;overscroll-behavior:none;touch-action:none}
body.game-mode .play-area{position:fixed;inset:0;z-index:1000;height:100dvh;height:var(--game-viewport-height,100dvh);width:100%;display:grid;grid-template-rows:auto minmax(0,1fr) auto auto auto;gap:6px;padding:max(8px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left));background:#101426;overflow:hidden;touch-action:none;overscroll-behavior:none}
body.game-mode .hud{border:1px solid #5c5872;border-radius:10px;padding:8px 11px}
body.game-mode .stage{min-height:0;width:100%;height:100%;border-radius:12px;background:#1c2031;box-shadow:none}
body.game-mode canvas{width:100%;height:100%;aspect-ratio:auto;object-fit:contain}
body.game-mode .hint{margin:0;padding:7px 10px;font-size:11px;min-height:30px}
body.game-mode .toolbar{margin:0;gap:5px;align-items:center}
body.game-mode .toolbar>div{gap:5px}
body.game-mode .toolbar button{min-height:36px;padding:6px 10px;font-size:11px}
body.game-mode .controls{padding:2px 0}
body.game-mode #playView{background:#514055;border-color:#d2acc8}
@media(pointer:coarse), (max-width:650px){
 .controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:12px;align-items:end}
 .controls .movement{display:grid;grid-template-columns:1fr 1fr;gap:7px;align-items:end}
 .controls .abilities{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);grid-template-rows:44px 44px;gap:7px}
 .controls button{min-width:0;width:100%;height:72px;min-height:44px;padding:8px;font-size:13px;border-radius:15px}
 .controls .movement button{font-size:26px}
 .controls #interact{grid-column:1;grid-row:1;height:44px;font-size:12px}
 .controls #dash{grid-column:1;grid-row:2;height:44px;font-size:12px}
 .controls #jump{grid-column:2;grid-row:1 / span 2;height:95px;min-width:0;font-size:15px}
}
@media(orientation:landscape) and (max-height:520px){
 body.game-mode .play-area{grid-template-rows:auto minmax(0,1fr);gap:4px}
 body.game-mode .hud{font-size:10px;padding:6px 9px;flex-wrap:nowrap}
 body.game-mode .hud span:first-child{width:auto;max-width:170px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
 body.game-mode .hint{display:none}
 body.game-mode .toolbar{position:absolute;z-index:4;right:max(14px,env(safe-area-inset-right));top:max(46px,calc(env(safe-area-inset-top) + 42px));justify-content:flex-end}
 body.game-mode .toolbar button{background:#252a41e8;min-height:32px;padding:4px 8px;font-size:10px}
 body.game-mode .controls{position:absolute;z-index:3;left:max(14px,env(safe-area-inset-left));right:max(14px,env(safe-area-inset-right));bottom:max(12px,env(safe-area-inset-bottom));display:flex;justify-content:space-between;pointer-events:none;align-items:end}
 body.game-mode .controls>div{pointer-events:auto}
 body.game-mode .controls .movement{width:155px}
 body.game-mode .controls .abilities{width:190px;grid-template-rows:36px 36px;gap:6px}
 body.game-mode .controls button{height:65px;background:#30314be8}
 body.game-mode .controls #interact,body.game-mode .controls #dash{height:36px}
 body.game-mode .controls #jump{height:78px;background:#74546dee}
}

.bgm-volume{display:flex;align-items:center;gap:5px;font-size:11px}.bgm-volume input{width:64px;min-height:36px;accent-color:#efb9ce;touch-action:pan-x}.bgm-volume output{min-width:3em}
@media(orientation:landscape) and (max-height:520px){body.game-mode .bgm-volume{padding:0 6px;border-radius:8px;background:#252a41e8}body.game-mode .bgm-volume input{width:50px;min-height:32px}}

.mode-select{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:14px}.mode-select button[aria-pressed=true]{background:#6c425d;border-color:#efb9ce}.mode-select span{color:#c9bfd2;font-size:12px;line-height:1.7}.controls .kick{background:#886947;border-color:#f1cf9a;min-width:74px}.controls .abilities{flex-wrap:wrap}.rank-form{padding:13px;background:#11182e;border:1px solid #b797a8;border-radius:12px;margin-top:12px;text-align:left}.rank-form[hidden]{display:none}.rank-form label{font-size:12px;display:block;margin-bottom:8px}.rank-form>div{display:flex;gap:8px;flex-wrap:wrap}.rank-form input{flex:1;min-width:130px;width:160px;border:1px solid #8e7b96;border-radius:9px;background:#fff7f8;color:#272036;font:inherit;font-size:16px;padding:9px;touch-action:manipulation}.rank-form p{font-size:11px;margin-bottom:0;line-height:1.6}.leaderboard{margin-top:28px;background:#202338;border:1px solid #6c607c;border-radius:18px;padding:24px}.leaderboard h2{font-size:25px;margin:10px 0 18px}.leaderboard p{font-size:12px;color:#d2c5d8;line-height:1.8}.ranking-filters{display:flex;gap:12px;flex-wrap:wrap;align-items:center}.ranking-filters label{font-size:12px;display:flex;gap:7px;align-items:center}.ranking-filters select{font:inherit;border:1px solid #89758e;background:#151d30;border-radius:8px;color:white;padding:10px;min-height:44px;max-width:170px}.ranking-scroll{overflow-x:auto}.leaderboard table{border-collapse:collapse;width:100%;min-width:330px;text-align:left;font-size:13px}.leaderboard th{color:#e9b9cf;font-size:11px}.leaderboard td,.leaderboard th{padding:13px 8px;border-bottom:1px solid #54455c}.leaderboard tbody tr:first-child{color:#ffe0a7}.leaderboard td:nth-child(2){max-width:140px;overflow-wrap:anywhere}
@media(pointer:coarse),(max-width:650px){.controls{grid-template-columns:minmax(0,.8fr) minmax(0,1.4fr);gap:8px}.controls .abilities{grid-template-columns:1fr 1fr;grid-template-rows:56px 56px;gap:6px}.controls #jump{grid-column:1;grid-row:1;height:56px;font-size:13px}.controls #dash{grid-column:2;grid-row:1;height:56px;font-size:13px}.controls #interact{grid-column:1;grid-row:2;height:56px;font-size:12px}.controls #kick{grid-column:2;grid-row:2;height:56px;min-width:0;font-size:15px}.controls .movement button{height:80px}.leaderboard{padding:16px}.mode-select span{width:100%}.rank-form{padding:9px}.rank-form input{min-width:105px}.rank-form p{font-size:10px}}
@media(orientation:landscape) and (max-height:520px){body.game-mode .controls .abilities{width:210px;grid-template-rows:38px 38px}body.game-mode .controls #jump,body.game-mode .controls #dash,body.game-mode .controls #interact,body.game-mode .controls #kick{height:38px}body.game-mode .controls #kick{background:#886947ee}body.game-mode .controls .movement{width:145px}}
/* Fixed positioning locks the page; menus may still scroll inside the game. */
body.game-mode,body.game-mode .play-area{touch-action:auto}.overlay .panel{touch-action:pan-y;overscroll-behavior:contain}.rank-form input{user-select:text;-webkit-user-select:text;-webkit-touch-callout:default}
