:root{--ink:#f7efe2;--muted:#c7baa9;--panel:rgba(8,14,16,.94);--line:rgba(240,214,169,.35);--font:"Noto Serif CJK JP","Hiragino Mincho ProN","Yu Mincho","YuMincho","Hiragino Mincho Pro",serif}*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overflow:hidden;background:#07170f;color:var(--ink);font-family:var(--font);font-weight:800;touch-action:none;-webkit-text-size-adjust:100%}body{position:fixed;inset:0}button{color:inherit;cursor:pointer;font-family:var(--font);font-weight:900;border:1px solid var(--line);border-radius:13px;background:rgba(18,28,25,.90);font-size:clamp(15px,4vw,19px);padding:12px 15px;min-height:44px;touch-action:manipulation}button:active{background:#6f483e}button:focus-visible{outline:2px solid #ffdb9d}button:disabled{opacity:.5;cursor:default}#scene{position:fixed;inset:0;width:100vw;height:100dvh;touch-action:none;display:block;background:#15572b}#vignette{pointer-events:none;position:fixed;inset:0;background:radial-gradient(ellipse at center,transparent 42%,rgba(2,5,8,.53) 100%)}.hud{position:fixed;z-index:5;pointer-events:none}#topbar{top:0;left:0;right:0;display:flex;justify-content:space-between;padding:calc(env(safe-area-inset-top) + 11px) 13px 0;align-items:center;gap:8px}#topdecor{font-size:20px;letter-spacing:7px;color:rgba(251,215,155,.88);text-shadow:0 2px 6px black}.topright{display:flex;gap:7px;pointer-events:auto}.smallbtn{font-size:13px;border-radius:12px;min-height:43px;padding:8px 10px;background:rgba(7,17,14,.78)}#aim{top:49%;left:50%;transform:translate(-50%,-50%);font-family:system-ui;font-size:18px;font-weight:300;color:#ffffffa5;text-shadow:0 1px 3px black}#toast{top:24%;left:50%;transform:translateX(-50%);width:88vw;max-width:460px;text-align:center;font-size:clamp(17px,4.5vw,23px);text-shadow:1px 2px 5px #000,0 0 15px #000;line-height:1.6;opacity:0;transition:opacity .2s;color:white;white-space:pre-line}#toast.on{opacity:1}#interact{bottom:calc(180px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);pointer-events:auto}#interact .action{background:#ecd6af;color:#1e1914;font-size:21px;border:2px solid white;box-shadow:0 3px 25px #0008;min-width:150px;border-radius:18px}#bottomcontrols{bottom:calc(22px + env(safe-area-inset-bottom));left:20px;right:17px;height:144px;display:flex;justify-content:space-between;align-items:center}#joystick{pointer-events:auto;width:142px;height:142px;border-radius:100%;touch-action:none;display:grid;place-items:center}.joyring{width:124px;height:124px;border-radius:100%;border:2px solid #fff6;background:rgba(9,17,20,.32);box-shadow:0 0 0 8px #0002,inset 0 0 25px #fff1;position:relative}#knob{width:56px;height:56px;position:absolute;top:32px;left:32px;border-radius:100%;background:#d8e1d9a8;border:2px solid #fff8;box-shadow:0 3px 12px #0008;pointer-events:none}#buttonwell{pointer-events:auto;margin-right:12px}#dropButton{width:91px;height:75px;border:2px solid #f0d6a6b0;background:#12251bdf;font-size:21px;border-radius:20px;line-height:1.1}#dropButton span{display:block;color:#eccb9e;font-size:17px}#hintText{font-size:11px;bottom:calc(8px + env(safe-area-inset-bottom));width:100%;text-align:center;opacity:.7;text-shadow:0 0 8px black}.overlay{position:fixed;inset:0;z-index:20;display:flex;align-items:center;justify-content:center;padding:calc(16px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom));background:rgba(1,5,7,.85);touch-action:pan-y}.overlay.hidden,.hidden{display:none!important}.storypane{position:relative;width:100%;max-width:540px;min-height:260px;padding:38px 25px 30px;border:1px solid #dfc6a67d;border-radius:14px;background:linear-gradient(155deg,#112019ee,#080d12f5);box-shadow:0 16px 50px #000a;display:flex;flex-direction:column;justify-content:center;gap:16px;max-height:90dvh}.storypane:before{content:'✦  ☾  ✦';font-size:14px;letter-spacing:.5rem;color:#dbbe83;position:absolute;top:11px;left:24px}.speaker{color:#f3c88b;font-size:12px;min-height:10px;margin-top:3px;letter-spacing:.12rem}.storytext{font-size:clamp(22px,5.45vw,29px);line-height:1.85;white-space:pre-line;overflow-wrap:anywhere;min-height:100px;text-shadow:0 1px 2px #000;font-weight:900}.storytext.dead{color:#ffd1c5}.storyfoot{display:flex;align-items:center;justify-content:space-between;font-size:12px;color:#b6aea3;min-height:17px}.skip{position:absolute;top:0;right:9px;padding:4px 8px;font-size:11px;min-height:44px;border:0;background:transparent;color:#ddd0bb}.panel{background:linear-gradient(160deg,#131d1cf7,#080c13fa);border:1px solid var(--line);border-radius:19px;box-shadow:0 22px 65px #000c;padding:21px;max-height:94%;overflow:auto;overscroll-behavior:contain;width:100%;max-width:560px;touch-action:pan-y}.panel h1,.panel h2{font-size:clamp(23px,6vw,32px);line-height:1.4;margin:9px 0 20px;font-weight:900}.panel p{line-height:1.8}.menupanel{display:grid;gap:11px}.eyebrow{font-size:11px;color:#e8bd8b;letter-spacing:.18rem}.wide{width:100%;display:block;min-height:50px}.primary{background:#e4cdac;color:#18181a;border-color:#fff2da}.buttonrow{display:flex;gap:9px;margin-top:10px}.buttonrow>*{flex:1}.smallnote{font-size:12px!important;color:#beb4a5;line-height:1.6!important;font-weight:600}.endpanel{text-align:center}.endpicture{display:block;width:100%;max-width:280px;aspect-ratio:4/5;object-fit:cover;margin:5px auto;border-radius:12px;box-shadow:0 0 15px #0009;border:1px solid #dfb38588;cursor:zoom-in;touch-action:manipulation}.rowhead{display:flex;align-items:center;justify-content:space-between;gap:8px}.rowhead h2{margin:0 0 14px}.closebtn{font-size:29px;min-height:42px;min-width:42px;padding:2px 11px}.recordsPanel{max-width:620px}.endgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:16px 0}.recordTile{border:1px solid #d8bc8c75;border-radius:14px;background:#0c1717;padding:8px;cursor:pointer;text-align:center;min-height:160px;touch-action:manipulation}.recordTile img{width:100%;aspect-ratio:4/5;object-fit:cover;border-radius:9px;max-height:200px}.recordTile.locked{cursor:default;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;color:#9eaaad;background:linear-gradient(130deg,#162c24,#162021);font-size:25px}.recordTile .recordtitle{font-size:12px;line-height:1.6;margin-top:7px}.deathstats{font-size:13px;line-height:1.9;padding:10px;border-top:1px solid #fff2;margin:7px 0 16px;color:#d0c8bf}.zoomLayer{background:#020608f5;padding:28px 15px;z-index:35}.zoomLayer img{max-width:min(90vw,620px);max-height:87dvh;object-fit:contain;box-shadow:0 0 45px #000;border:1px solid #fff6;touch-action:pan-y}.zoomClose{position:absolute;top:calc(env(safe-area-inset-top) + 8px);right:14px;z-index:1;font-size:29px}.sharepanel{max-width:500px}.sharepanel canvas{display:block;width:auto;height:auto;max-height:50dvh;max-width:100%;aspect-ratio:4/5;margin:auto;border:1px solid #ffffff5c;border-radius:8px}.debug-panel{position:fixed;inset:calc(env(safe-area-inset-top) + 3px) 5px calc(env(safe-area-inset-bottom) + 3px);z-index:70;background:#090d13f9;color:#e6f1e9;border:2px solid #69b19b;border-radius:12px;display:flex;flex-direction:column;padding:10px;font-family:system-ui,sans-serif;font-weight:400;touch-action:pan-y}.debugtabs{display:flex;gap:5px;overflow-x:auto;padding:9px 0;flex:none}.debugtabs button,.debugcontent button{font-family:system-ui,sans-serif;font-weight:600;font-size:12px;border-radius:7px;min-height:32px;padding:5px 8px}.debugcontent{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:4px;line-height:1.6}.debugcontent .dbgitem{border-bottom:1px solid #52615d;padding:9px 2px;display:flex;flex-direction:column;gap:6px}.debugcontent .dbgitem button{max-width:200px}.debugcontent img{max-width:120px;max-height:155px;object-fit:cover}.debugcontent input{font-size:16px;width:76px;padding:7px;border-radius:5px;color:#111;background:#fff}.debugcontent canvas{max-width:100%;border:1px solid #777}.debugcontent pre{white-space:pre-wrap;word-break:break-all;font-size:11px}.debugcontent .dbgrow{display:flex;flex-wrap:wrap;gap:5px;margin:8px 0}#fatal{z-index:100}#fatal .panel{font-size:17px}@media(max-height:710px){#bottomcontrols{bottom:calc(8px + env(safe-area-inset-bottom));height:115px}#joystick{width:120px;height:120px}.joyring{width:108px;height:108px}#knob{top:26px;left:26px}#interact{bottom:calc(135px + env(safe-area-inset-bottom))}.storypane{min-height:210px;padding:32px 18px 20px}.storytext{font-size:clamp(19px,4.85vw,25px)}.endpicture{max-width:190px}.panel{padding:16px}.panel h1{margin:3px 0 7px}}@media(min-width:800px){#bottomcontrols{max-width:680px;margin:auto;left:0;right:0}#hintText{font-size:12px}.storypane{min-height:340px}.endpicture{max-width:260px}}
@media(max-width:430px){.storypane{padding-left:15px;padding-right:15px}.storytext{font-size:clamp(19px,4.85vw,21px);line-height:1.90;letter-spacing:-.02em}.storypane{min-height:255px}} 

/* Halloween picture-book design pass: purely presentational; fog and game rules untouched. */
:root{--ink:#f5ebd8;--muted:#c8b9a4;--panel:rgba(13,26,24,.96);--line:rgba(205,173,120,.48);--gold:#c8a575;--cream:#f3e7ce;--deep:#101b1b}
button{border-color:var(--line);background:linear-gradient(155deg,rgba(25,45,38,.94),rgba(12,25,25,.96));box-shadow:inset 0 1px 0 #fff1,0 3px 10px #0003;transition:background-color .16s,filter .16s,transform .16s,border-color .16s}
button:active{transform:scale(.975);filter:brightness(1.13);background-color:#314937}
button:disabled:active{transform:none;filter:none}
.smallbtn{min-width:46px;min-height:48px;padding:9px 11px;font-size:13px;border-radius:13px;background:linear-gradient(155deg,#14291eda,#081613e8);border:1px solid #d9bb8585}
.topright{gap:8px}#topdecor{font-size:19px;letter-spacing:6px;color:#eacb9c;text-shadow:0 1px 7px #0008}
#aim{font-size:20px;color:#f3e7ceb9;text-shadow:0 1px 4px #000b,0 0 9px #0009;transition:color .15s}
#aim.target{color:#ffe0ac}#aim.target:after{content:"";position:absolute;left:50%;top:50%;width:24px;height:24px;transform:translate(-50%,-50%);border:1.5px solid #ffe6b4cc;border-radius:50%;box-shadow:0 0 10px #f6c68a55;pointer-events:none}
#interact .action{min-height:56px;min-width:150px;padding:12px 20px;background:linear-gradient(165deg,#fff2d6,#e7c995);color:#271d13;font-size:21px;border:2px solid #fff4d3;box-shadow:0 4px 20px #0008,inset 0 2px 1px #fff8;letter-spacing:.055em}
#interact .action:active{background:#d4b47c}
.joyring{border-color:#e6ecd08a;background:radial-gradient(circle,#10241b35,#0b201c75);box-shadow:0 0 0 8px #040c0920,inset 0 0 23px #fff1}
#knob{background:radial-gradient(circle at 30% 26%,#f3f6e6c9,#a9bcbaad 73%);border-color:#fff9;box-shadow:0 2px 14px #0008,inset 0 2px 6px #fff4;transition:transform .075s linear}
#dropButton{background:linear-gradient(160deg,#224632ec,#102a25f0);border-color:#d3b17aba;color:#f7e5c5;box-shadow:inset 0 1px 0 #fff2,0 4px 16px #0008;letter-spacing:.05em}
#dropButton span{color:#e4ba82}
.overlay{background:rgba(4,9,11,.84)}
.storypane,.panel{border:1px solid #bba079a3;background:linear-gradient(160deg,#182923f7 0%,#0c1b1af9 53%,#091016fb 100%);box-shadow:0 18px 56px #000c,inset 0 1px 0 #fff1;position:relative}
.storypane{padding:41px 25px 28px;gap:14px;min-height:260px;max-height:min(90dvh,720px);border-radius:15px}
.storypane:before{content:'✦  ☾  ✦';font-size:13px;letter-spacing:.42rem;color:#d3b586;position:absolute;top:11px;left:23px}
.storypane:after{content:'✧';position:absolute;right:20px;bottom:12px;font-size:13px;color:#c4a57599;pointer-events:none}
.speaker{color:#e6bf88;font-size:12px;letter-spacing:.14em}
.storytext{color:#f4ead8;text-shadow:0 1px 3px #000a;line-height:1.85}
.storytext.notice{color:#eed8b0}
.storytext.ghostvoice{color:#ffd0c6;text-shadow:0 0 12px #8e2f2c60,0 1px 3px black}
.storytext.secretvoice{color:#e4edf0;text-shadow:0 1px 8px #90a5c633}
.storyfoot{color:#b6ae9f;gap:8px}.storyfoot>span:last-child{white-space:nowrap}
.skip{min-height:44px;padding:6px 11px;top:2px;right:6px;color:#ddceb9}
.panel{border-radius:18px;padding:21px}
.panel h1,.panel h2{color:#f6e8ce;letter-spacing:.015em}
.eyebrow{color:#d4af77;letter-spacing:.16em}
.primary{background:linear-gradient(150deg,#fae9cf,#dfc299);color:#1b2722;border-color:#f9e4be;box-shadow:0 3px 15px #0005,inset 0 1px 0 #fff9}
.primary:active{background:#c9ad83}
.wide{min-height:50px}
.menupanel{gap:11px}
.menupanel .eyebrow{text-align:center;font-size:12px}
.menupanel h2{text-align:center;margin:1px 0 12px}
.menupanel .smallnote{text-align:center;margin:5px 0 0}
.endpanel{max-width:540px}
.endpicture{border:2px solid #bca075;border-radius:10px;box-shadow:0 0 0 4px #55422a77,0 0 18px #000b;object-fit:cover}
.endpanel .eyebrow{display:inline-block;padding:5px 13px;border-top:1px solid #b89a6c77;border-bottom:1px solid #b89a6c77}
.recordsPanel{max-width:620px}
.rowhead h2{margin:0 0 14px}
.closebtn{min-width:44px;min-height:44px;border-color:#bca47a88}
.endgrid{gap:12px;margin:16px 0}
.recordTile{border:1px solid #c1a375b2;border-radius:13px;background:linear-gradient(150deg,#2d3328,#101b1b);padding:8px;text-align:center;min-height:160px;box-shadow:inset 0 1px #fff1,0 4px 10px #0004}
.recordTile img{display:block;width:100%;aspect-ratio:4/5;max-height:200px;object-fit:cover;border:1px solid #bca074b0;border-radius:6px;box-shadow:0 0 0 3px #43352266}
.recordTile.locked{background:linear-gradient(150deg,#20352f,#0f211e);color:#e0ceb0;gap:13px;min-height:205px;cursor:default;box-shadow:inset 0 0 0 6px #172720,inset 0 0 0 7px #b7a0754a}
.recordTile.locked:before{content:'☾';display:flex;align-items:center;justify-content:center;color:#b7a17c78;font-size:42px;min-height:60px}
.recordTile .recordtitle{color:#e9d5b6;line-height:1.6;margin-top:9px;font-size:12px}
.recordTile.locked:active{filter:none;transform:none}
#secretEntry .wide{margin-top:8px}
.deathstats{border-top-color:#bfa57755;color:#d1c0a8}
.sharepanel canvas{border:2px solid #bfa377;border-radius:7px;box-shadow:0 0 0 3px #312920,0 4px 15px #0008}
.sharepanel .buttonrow{margin-top:14px}
.zoomLayer img{border:2px solid #c1a074;box-shadow:0 0 0 4px #252018,0 0 45px #000}
@media(max-height:710px){.storypane{min-height:210px;padding:34px 18px 20px}.menupanel{gap:7px}.menupanel h2{margin:0 0 5px}.endpicture{max-width:190px}.panel{padding:16px}}
@media(max-width:430px){.storypane{min-height:245px;padding:38px 16px 23px}.storytext{font-size:clamp(19px,4.85vw,21px);line-height:1.86}.topright{gap:7px}#topbar{padding-left:12px;padding-right:12px}.smallbtn{padding-left:9px;padding-right:9px}#topdecor{font-size:17px;letter-spacing:4px}}
@media(max-width:360px){.storytext{font-size:19px}.panel{padding:15px}.recordTile{padding:6px}.buttonrow{gap:7px}.buttonrow button{padding-inline:8px;font-size:14px}#hintText{font-size:10px}#bottomcontrols{left:12px;right:8px}}
@media(prefers-reduced-motion:reduce){button,#aim,#knob{transition:none!important}.storytext.ghostvoice{text-shadow:0 1px 3px #000}}
.storytext.dead:not(.ghostvoice){color:var(--cream)}

/* Keep the initial control hint clear of the joystick, home indicator and the pickup action. */
#hintText{top:calc(env(safe-area-inset-top) + 69px);bottom:auto;left:0;right:0;width:auto;padding:0 14px;line-height:1.5;text-shadow:0 1px 6px #000,0 0 4px #000}

/* Debug-only: prevent decorative header from squeezing controls on narrow screens. */
@media(max-width:360px){#topbar:has(#debugOpen:not([hidden])) #topdecor{display:none}}
