:root{font-family:"Noto Serif TC",serif;color:#dedec8;background:#141811;color-scheme:dark;font-synthesis:none}*{box-sizing:border-box}body{margin:0;overflow:hidden}#viewport,#viewport canvas{position:fixed;top:0;right:0;bottom:0;left:0;width:100%;height:100%;display:block}#viewport{touch-action:none}.masthead{position:fixed;left:5vw;top:5vh;pointer-events:none;text-shadow:0 2px 15px #000}.school{font-size:11px;letter-spacing:.25em;color:#b2b69c}h1{font-size:clamp(30px,5vw,62px);letter-spacing:.22em;margin:10px 0;font-weight:600}.masthead p{font-size:12px;letter-spacing:.2em;color:#a5aa8d}.monitor{position:fixed;right:28px;top:28px;padding:16px 20px;border:1px solid #777e4d55;background:#141912df;min-width:205px;font:11px/1.9 monospace}.live{display:block;color:#b5c779;letter-spacing:.1em}output{display:block;white-space:pre-line;color:#bbc1a6}.toolbar{position:fixed;bottom:52px;left:5vw;display:flex;gap:10px;flex-wrap:wrap}button,select{font:inherit}button{color:#dddfc8;background:#23291fe8;border:1px solid #737b505c;padding:12px 17px;cursor:pointer;transition:background .15s}button:hover{background:#414a32}button:focus-visible,select:focus-visible{outline:2px solid #ced58e;outline-offset:4px}kbd{font:10px monospace;padding:2px 5px;border:1px solid #737b5066;margin-left:12px;color:#a6b086}.caption{position:fixed;bottom:14px;left:5vw;font-size:10px;letter-spacing:.1em;color:#a4aa8d}#message{position:fixed;bottom:115px;left:5vw;max-width:70vw;background:#161b13bb;color:#d4c99f;font-size:12px}#message:empty{display:none}dialog{width:min(460px,92vw);max-height:90dvh;overflow:auto;padding:32px;border:1px solid #777f50;background:linear-gradient(150deg,#292f22,#171d16);color:#dfe1c8;box-shadow:0 28px 120px #000c}dialog::backdrop{background:#060b06a8;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px)}.panel-heading{display:flex;justify-content:space-between;align-items:center;font:10px monospace;letter-spacing:.2em;color:#9da77c}.close{border:0;background:none;font:24px sans-serif;padding:0 5px}h2{margin:15px 0 8px;font-weight:600;font-size:30px;letter-spacing:.18em}.subtitle{font-size:11px;color:#a1a889;letter-spacing:.1em;margin-bottom:30px}label{display:flex;justify-content:space-between;align-items:center;margin:24px 0 10px;font-size:14px}label span{font:9px monospace;color:#98a27b;letter-spacing:.08em}select{width:100%;padding:12px;background:#11180f;border:1px solid #65714a;color:#e1e5ca;border-radius:0}.hint{font-size:10px;color:#a6ae8d;line-height:1.8}.description{font-size:12px;line-height:1.9;padding:16px 0;color:#c1caa5;min-height:84px}.panel-note{border-top:1px solid #56613a66;padding-top:18px;font-size:10px;line-height:1.9;color:#98a481}.primary{display:flex;justify-content:space-between;width:100%;background:#b7c185;color:#17200e;margin-top:24px;font-weight:700}.primary:hover{background:#d1dba2}@media(max-width:600px){.monitor{top:auto;bottom:155px;right:16px;min-width:170px;font-size:10px;padding:10px}.toolbar{left:16px;right:16px;bottom:55px}.toolbar button{font-size:11px;padding:10px}.caption{left:16px;right:16px;font-size:9px}.masthead{left:24px}.masthead p{font-size:10px}dialog{padding:24px}}.crosshair{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);font:16px monospace;color:#d5e6b68c;pointer-events:none}.interaction-prompt{position:fixed;top:calc(50% + 26px);left:50%;transform:translate(-50%);font-size:12px;text-align:center;text-shadow:0 2px 8px #000;pointer-events:none}.touch-controls{position:fixed;right:28px;bottom:40px;text-align:center;display:flex;flex-direction:column;gap:5px;align-items:center}.touch-controls button{padding:8px 13px;touch-action:none;-webkit-user-select:none;user-select:none}.touch-controls div{display:flex;gap:5px}.toolbar{max-width:calc(100vw - 260px)}#message{padding:10px;line-height:1.9;max-width:min(570px,70vw);pointer-events:none}@media(max-width:600px){.monitor{top:20px;right:12px;bottom:auto;min-width:145px;padding:8px;font-size:9px}.masthead{top:20px;left:16px}.masthead h1{font-size:28px}.masthead .school{font-size:8px}.masthead p{max-width:150px;line-height:1.8}.toolbar{left:12px;bottom:40px;max-width:calc(100vw - 145px);gap:4px}.toolbar button{padding:8px;font-size:10px}.toolbar kbd{display:none}.touch-controls{right:10px;bottom:40px}.caption{font-size:8px;line-height:1.5}#message{bottom:170px;max-width:85vw;left:12px;font-size:11px}}@media(max-width:350px){.monitor{display:none}}[hidden]{display:none!important}.combat-hud{position:fixed;top:28px;left:50%;transform:translate(-50%);text-align:center;pointer-events:none;text-shadow:0 2px 8px #000;display:grid;gap:6px}.combat-hud output{font-size:15px;letter-spacing:.3em}.combat-hud span,.combat-hud small{font:10px monospace;color:#a3af8e}body[data-game-state=hunted] .combat-hud output{color:#e9b5a3}body[data-game-state=hunted] #viewport:after{content:"";position:fixed;top:0;right:0;bottom:0;left:0;box-shadow:inset 0 0 90px #58191599;pointer-events:none}.green-light{position:fixed;z-index:60;bottom:40px;left:50%;transform:translate(-50%);background:#586b3be8;color:#e3efc5;border-color:#9ba874;padding:16px 22px;touch-action:none;user-select:none;-webkit-user-select:none}.green-light:active{background:#86965a}.blackout{position:fixed;top:0;right:0;bottom:0;left:0;z-index:50;background:#000;color:#c4ceb1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;touch-action:none}.blackout h2{font-size:34px;letter-spacing:.5em;margin:16px 0}.blackout p{font-size:12px;color:#88937b;letter-spacing:.1em}.blackout output{font:14px monospace;color:#a4b393}.breath-ring{width:110px;height:110px;border:1px solid #3e4934;border-radius:50%;box-shadow:0 0 25px #45533418;animation:breathing 1.5s ease-in-out infinite alternate}.blackout.paused .breath-ring{animation-play-state:paused}@keyframes breathing{0%{transform:scale(.85);opacity:.35}to{transform:scale(1);opacity:.85}}.game-over{position:fixed;top:0;right:0;bottom:0;left:0;z-index:100;background:#030705;display:flex;align-items:center;justify-content:center;overflow:hidden}.scare-face{position:absolute;height:120vh;width:100vw;max-width:900px;top:-12vh;filter:contrast(1.4);opacity:.8;animation:face-lunge .5s cubic-bezier(.1,.8,.1,1) both}.death-copy{z-index:1;position:absolute;bottom:6vh;left:50%;transform:translate(-50%);width:min(600px,90vw);text-align:center;text-shadow:0 2px 8px #000;background:linear-gradient(transparent,#020503ed 38%);padding:35px 15px 10px}.death-copy span{font-size:12px;letter-spacing:.6em;color:#b2bfa2}.death-copy h2{font-size:44px;letter-spacing:.25em;margin:12px}.death-copy p{font-size:13px;line-height:1.8;color:#c4cbb5}.death-copy button{margin-top:12px;background:#a3b17c;color:#172014}@keyframes face-lunge{0%{transform:scale(.18) rotate(-12deg);opacity:0}35%{transform:scale(1.1) rotate(4deg);opacity:1}to{transform:scale(1) rotate(-2deg);opacity:.8}}@media(max-width:900px){.green-light{bottom:148px;padding:10px 16px}.combat-hud{top:125px}.combat-hud small{font-size:8px}}@media(max-width:600px){.combat-hud{top:155px}.combat-hud output{font-size:13px}.green-light{bottom:150px}.toolbar{bottom:42px;max-width:calc(100vw - 150px)}.blackout p{font-size:11px}.scare-face{height:100vh;top:0}}@media(prefers-reduced-motion:reduce){.scare-face,.breath-ring{animation:none}}[data-game-state=frozen] .green-light{bottom:20px}@media(max-height:500px){.blackout{padding-bottom:65px}.blackout .breath-ring{width:60px;height:60px}.blackout h2{font-size:25px;margin:10px 0}.blackout p{margin:8px 0}.blackout output{margin-top:6px}}:root{--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px)}body{overscroll-behavior:none}#viewport,#viewport canvas{height:100dvh}.masthead,.monitor,.toolbar,.touch-controls,.caption,.combat-hud,#input-status,#message{z-index:5}.monitor{pointer-events:none}.touch-controls [data-move],.touch-controls>div{display:none}#look-zone,#joystick{display:none}#input-status{position:fixed;left:5vw;top:160px;color:#c8d0af;font-size:10px;text-shadow:0 2px 6px #000;pointer-events:none}button,select{min-height:44px}dialog{overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin}#settings .description{min-height:0}#settings .panel-note{margin-top:16px}body[data-controls=touch] #look-zone{display:block;position:fixed;z-index:2;top:0;right:0;bottom:0;width:55%;touch-action:none;user-select:none;-webkit-user-select:none}body[data-controls=touch] #joystick{display:block;position:fixed;z-index:65;left:calc(22px + var(--safe-left));bottom:calc(18px + var(--safe-bottom));width:clamp(96px,26dvh,138px);aspect-ratio:1;border:1px solid #c7d7a55c;background:radial-gradient(#c6d5aa18,#12211322);border-radius:50%;touch-action:none;user-select:none;-webkit-user-select:none;box-shadow:inset 0 0 25px #0b150e55}.joystick-knob{position:absolute;width:42px;height:42px;left:calc(50% - 21px);top:calc(50% - 21px);border-radius:50%;background:#c4d0ab55;border:1px solid #dae5be88;pointer-events:none;will-change:transform}.joystick-label{position:absolute;top:-22px;left:0;width:100%;text-align:center;font-size:10px;letter-spacing:.25em;color:#c5d3b1;pointer-events:none}body[data-controls=touch] .green-light{left:auto;right:calc(22px + var(--safe-right));bottom:calc(18px + var(--safe-bottom));transform:none;width:clamp(94px,25dvh,130px);height:clamp(94px,25dvh,130px);padding:8px;border-radius:50%;background:#576c3bd9;border:2px solid #b5c68d;font-size:20px;font-weight:700;z-index:65;line-height:1.3}body[data-controls=touch] .green-light kbd{display:none}body[data-controls=touch] .touch-controls{right:calc(35px + var(--safe-right));bottom:calc(clamp(94px,25dvh,130px) + 30px + var(--safe-bottom));z-index:6}body[data-controls=touch] #interact{padding:6px 18px;min-width:70px}body[data-controls=touch] .touch-controls kbd{display:none}body[data-controls=touch] .toolbar{left:calc(12px + var(--safe-left));right:auto;top:calc(8px + var(--safe-top));bottom:auto;max-width:70%;gap:5px}body[data-controls=touch] .toolbar button{font-size:11px;padding:6px 10px;min-height:44px}body[data-controls=touch] #rebuild,body[data-controls=touch] .toolbar kbd{display:none}body[data-controls=touch] .masthead{top:calc(60px + var(--safe-top));left:calc(16px + var(--safe-left))}body[data-controls=touch] .masthead h1{font-size:24px;margin:4px 0}body[data-controls=touch] .masthead p{display:none}body[data-controls=touch] .school{font-size:9px}body[data-controls=touch] .monitor{top:calc(8px + var(--safe-top));right:calc(10px + var(--safe-right));bottom:auto;min-width:140px;max-width:23vw;padding:7px;font-size:8px}body[data-controls=touch] .combat-hud{top:calc(64px + var(--safe-top));left:50%}body[data-controls=touch] .combat-hud small{display:none}body[data-controls=touch] .caption{left:calc(168px + var(--safe-left));right:calc(165px + var(--safe-right));bottom:calc(3px + var(--safe-bottom));text-align:center;font-size:9px;line-height:1.7}body[data-controls=touch] #input-status{display:none}body[data-controls=touch] #message{bottom:calc(80px + var(--safe-bottom));left:24%;max-width:52%;font-size:11px;padding:8px}body[data-controls=touch] .interaction-prompt{top:calc(50% + 20px);z-index:5;font-size:11px}.orientation-gate{position:fixed;top:0;right:0;bottom:0;left:0;z-index:200;background:repeating-linear-gradient(0deg,#1d3029 0,#1d3029 3px,#20332b,#20332b 5px);display:flex;align-items:center;justify-content:center;padding:calc(24px + var(--safe-top)) calc(22px + var(--safe-right)) calc(24px + var(--safe-bottom)) calc(22px + var(--safe-left));color:#d2d4b1;touch-action:none}.rotation-card{max-width:420px;text-align:center;border:1px solid #b4ba8e88;padding:28px 24px;box-shadow:0 0 0 5px #b4ba8e11,inset 0 0 50px #09171166}.rotation-card>span{font-size:11px;letter-spacing:.2em}.rotation-card h2{font-size:21px;line-height:1.9;letter-spacing:.12em;font-weight:400}.rotation-card p{font-size:12px;line-height:1.8;color:#aab592}.rotate-phone{margin:28px auto 10px;width:45px;height:76px;line-height:68px;font:40px/68px serif;border:2px solid #c0c59b;border-radius:8px;transform:rotate(-90deg)}.rotation-card button{margin-top:12px;min-height:48px;padding:10px 18px;background:#a7b581;color:#15241a}body[data-portrait=true] #game-shell,body[data-portrait=true] #green-light{visibility:hidden;pointer-events:none}@media(orientation:landscape)and (max-height:600px){dialog{width:min(620px,92vw);max-height:calc(100dvh - 20px - var(--safe-top) - var(--safe-bottom));padding:16px 22px}dialog h2{font-size:23px;margin:5px 0}dialog .subtitle{margin:5px 0 12px}dialog label{margin:12px 0 6px}dialog .description{padding:8px 0;font-size:11px}dialog select{min-height:44px;padding:8px}dialog .primary{margin-top:14px}dialog .panel-note{padding-top:8px}body[data-controls=touch] .blackout{padding-bottom:15px}body[data-controls=touch] .blackout .breath-ring{height:55px;width:55px}body[data-controls=touch] .blackout h2{font-size:24px;margin:10px 0}}@media(max-height:350px)and (orientation:landscape){body[data-controls=touch] .monitor,body[data-controls=touch] .school{display:none}body[data-controls=touch] .masthead{top:54px}.death-copy{bottom:10px;padding-top:10px}.death-copy h2{font-size:28px}.death-copy p{font-size:11px}}.asset-status{position:fixed;z-index:5;left:5vw;bottom:32px;font:10px monospace;color:#afb79d;pointer-events:none}body[data-mobile=true] .asset-status{display:none}body[data-grade=css] #viewport:before{content:"";position:fixed;top:0;right:0;bottom:0;left:0;z-index:1;pointer-events:none;background:radial-gradient(ellipse at center,transparent 32%,#03090635 64%,#0207048f 100%)}.monitor,#asset-status,#render-count,#combat-progress,.caption,.debug-tools{display:none!important}body.debug-visible .monitor,body.debug-visible #asset-status,body.debug-visible #render-count,body.debug-visible #combat-progress,body.debug-visible .debug-tools{display:block!important}.masthead{top:5vh;left:4vw;opacity:.65}.masthead h1{font-size:clamp(22px,2.8vw,38px);font-weight:400;letter-spacing:.3em;margin:8px 0}.masthead .school{font-size:9px;letter-spacing:.2em}.masthead p{display:none}.combat-hud{top:9vh;opacity:0;transition:opacity .3s}body[data-game-state=hunted] .combat-hud,body.debug-visible .combat-hud{opacity:1}body[data-game-state=hunted] .combat-hud output{font-family:DFKai-SB,BiauKai,KaiTi,serif;font-size:25px;letter-spacing:.35em}#input-status{top:auto;bottom:24px;left:50%;transform:translate(-50%);margin:0;font-size:11px;letter-spacing:.18em;color:#c5c4a3;white-space:nowrap;opacity:.7}body[data-pointer-locked=true] #input-status{display:none}body[data-paused=true] #green-light,body[data-paused=true] #input-status{visibility:hidden}.pause-tab{display:none;position:fixed;top:calc(14px + var(--safe-top));right:calc(16px + var(--safe-right));z-index:8;padding:8px 12px;background:#14201888;border:1px solid #b2b59955;color:#d3d4b5;font-family:DFKai-SB,KaiTi,serif}body[data-controls=touch] .pause-tab{display:block}body[data-controls=desktop] .touch-controls{display:none}.crosshair{font-size:11px;opacity:.65}.green-light{left:50%;bottom:15vh;transform:translate(-50%) rotate(-2deg);padding:16px 30px 13px;border:1px solid #a9b58e66;border-radius:0;box-shadow:0 6px 35px #0007;background-color:#172a20bf;background-image:linear-gradient(#a5bc8020 1px,transparent 1px),linear-gradient(90deg,#a5bc8020 1px,transparent 1px);background-size:27px 27px;color:#d9dfba;font:clamp(25px,3.4vw,40px)/1.3 "DFKai-SB","BiauKai","KaiTi",cursive;letter-spacing:.12em;text-shadow:1px 2px 4px #0008}.green-light kbd{font:10px/1.5 monospace;letter-spacing:.12em;border:0;border-bottom:1px solid #b4c29788;border-radius:0;padding:3px 0;margin-left:18px;vertical-align:middle;color:#b4c297}body[data-controls=desktop] .green-light{pointer-events:none;-webkit-user-select:none;user-select:none}body[data-game-state=hunted] .green-light{color:#e6e7c1;border-color:#c2c687;box-shadow:0 0 35px #546c3540}body[data-game-state=frozen] .green-light{bottom:24px;background:#050b07;border-color:#283a28;font-size:22px}#message{left:50%;bottom:6vh;transform:translate(-50%);text-align:center;background:transparent;max-width:min(650px,80vw);font-size:13px;text-shadow:0 2px 8px #000;margin:0}#settings{width:min(570px,92vw);max-height:90dvh;padding:28px 38px 28px 46px;color-scheme:light;color:#303e32;border:1px solid #b0a889;border-radius:2px;box-shadow:0 30px 120px #000d,inset 0 0 65px #695b2620;background-color:#dcd7b9;background-image:linear-gradient(90deg,transparent 29px,#a964584d 30px,#a964584d 31px,transparent 32px),repeating-linear-gradient(0deg,transparent 0,transparent 27px,#51775226 28px,#51775226 29px)}#settings::backdrop{background:#040805c9;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}#settings form{margin:0}#settings .panel-heading{font:10px/1.5 serif;color:#52614d;letter-spacing:.12em}#settings .close{color:#4c5945;min-width:44px;min-height:44px;padding:4px;background:transparent}.book-number{display:flex;justify-content:space-between;font:11px/1.8 serif;border-bottom:2px solid #56715388;padding-bottom:9px;margin:8px 0 18px;color:#536349}.book-number span{color:#925445;transform:rotate(-8deg);border:1px solid #925445;padding:0 5px;letter-spacing:.12em}#settings h2{font:38px/1.3 DFKai-SB,BiauKai,KaiTi,serif;letter-spacing:.2em;color:#2f4937;margin:10px 0}#settings .subtitle{font:12px/1.8 serif;color:#62715b;margin:0 0 22px;letter-spacing:.1em}.notebook-entry{border:1px solid #6a7f5b66;display:grid;grid-template-columns:46px 1fr;margin-bottom:20px;background:#ede8cb55}.notebook-entry>span{writing-mode:vertical-rl;letter-spacing:.25em;font:12px/1.5 serif;padding:13px 12px;border-right:1px solid #6a7f5b66;color:#687653}.notebook-entry p{font:19px/1.8 DFKai-SB,BiauKai,KaiTi,serif;margin:9px 16px;color:#344a39}.notebook-actions{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px;margin-bottom:18px}#settings button{color:#384f3a;border-color:#6c805e88;background:#dedcc155;font-size:12px;min-height:44px;padding:9px}#settings button:hover{background:#a9b58c55}#settings button:focus-visible,#settings summary:focus-visible,#settings select:focus-visible{outline:2px solid #536b47;outline-offset:3px}.book-settings{margin:8px 0;border-top:1px solid #70836455;padding-top:12px}.book-settings summary{cursor:pointer;min-height:40px;font-size:13px;letter-spacing:.12em;color:#40593e}#settings label{font-size:13px;margin-top:16px;color:#40563c}#settings label span{color:#6a765b;font-size:8px}#settings select{background:#ede9d0b3;color:#344a34;border-color:#89947388;font-size:13px;min-height:44px}#settings .description,#settings .hint{font-size:11px;color:#647156;line-height:1.8;padding:8px 0}#settings .panel-note{font:11px/1.9 serif;color:#687358;border-top:1px solid #6e815655;padding-top:15px;margin-top:12px}#settings .primary{position:sticky;bottom:0;z-index:1;background:#435b3f;color:#e9e6cd;font:17px/1.5 DFKai-SB,BiauKai,KaiTi,serif;margin-top:18px;padding:13px 16px;letter-spacing:.12em;box-shadow:0 -8px 18px #dcd7b980}#settings .primary:hover{background:#314c33}body[data-controls=touch] .masthead{top:calc(18px + var(--safe-top));left:calc(20px + var(--safe-left))}body[data-controls=touch] .green-light{background-color:#203b27c9;background-image:linear-gradient(#a5bc8020 1px,transparent 1px),linear-gradient(90deg,#a5bc8020 1px,transparent 1px);font-family:DFKai-SB,BiauKai,KaiTi,serif;font-size:25px;border-radius:4px;border-width:1px}body[data-controls=touch] #message{left:50%;bottom:6vh;max-width:50%;font-size:12px}body[data-controls=touch] .combat-hud{top:5vh}@media(max-height:600px){#settings{max-height:94dvh;padding:18px 28px 20px 38px}#settings h2{font-size:30px}.book-number{margin:0 0 8px}.notebook-entry{margin-bottom:12px}.notebook-entry p{font-size:17px;margin:5px 12px}.green-light{bottom:16vh;font-size:28px;padding:10px 22px}.masthead{top:6vh}#input-status{bottom:12px;font-size:10px}}@media(max-width:420px){#settings{padding:18px 20px 22px 34px}#settings h2{font-size:31px}.notebook-actions{gap:5px}#settings .notebook-actions button{font-size:11px}.book-number{font-size:10px}}body[data-chapter="3"] :is(#campaign-hud,#combat-state,#input-status,#message){display:none!important}#viewport canvas:focus{outline:none}.notebook-entry p,#settings .panel-note{white-space:pre-line}.campaign-hud{position:fixed;z-index:6;left:4vw;bottom:5vh;max-width:50vw;color:#c6c8a6;font:12px/1.8 DFKai-SB,KaiTi,serif;letter-spacing:.08em;text-shadow:0 2px 8px #000;pointer-events:none}.campaign-hud:empty{display:none}.puzzle-panel{position:fixed;z-index:30;color:#d9d5b4;background:#1d291eeb;border:1px solid #7b8960;box-shadow:0 20px 90px #000a;padding:24px;max-height:86dvh;overflow:auto;font:13px/1.8 serif;overscroll-behavior:contain}.puzzle-panel h2{font:28px/1.4 DFKai-SB,KaiTi,serif;letter-spacing:.18em;margin:10px 0}.puzzle-panel>span,.puzzle-panel small{font-size:10px;color:#a9b08e;letter-spacing:.08em}.puzzle-panel p{white-space:pre-line}.puzzle-close{position:absolute;right:7px;top:7px;padding:5px 12px;min-height:40px;border:0;background:transparent;font-size:23px}.lottery-panel{width:min(380px,90vw);top:50%;left:50%;transform:translate(-50%,-50%);background-color:#382b21;background-image:repeating-linear-gradient(0deg,transparent 0,transparent 26px,#bbab7030 27px)}.lottery-grid,.keypad-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.lottery-grid button{background:#aa976c;color:#332d22;border:2px dashed #68583d;min-height:60px;font:25px DFKai-SB,KaiTi,serif}.lottery-grid button.selected{outline:1px solid #dfcf99;outline-offset:2px}.lottery-grid button:disabled{opacity:.35;cursor:default}.keypad-panel{right:calc(18px + var(--safe-right));top:50%;transform:translateY(-50%);width:270px;padding:18px;background:#152019ed}#keypad-code{font:22px/2 monospace;letter-spacing:.12em;color:#dce4b4;border-block:1px solid #596b4777;white-space:nowrap}.keypad-grid button{min-height:44px;padding:7px;background:#384737;color:#e0e0bb}.keypad-panel p{font-size:11px;line-height:1.7}.ghost-hand{position:fixed;top:0;right:0;bottom:0;left:0;z-index:95;background:#341c1c99;display:grid;place-items:center;pointer-events:none}.ghost-hand svg{height:90dvh;filter:drop-shadow(0 0 25px #000);transform:rotate(-16deg);animation:hand-grab .3s ease-out both}@keyframes hand-grab{0%{transform:translateY(65%) rotate(-22deg) scale(.5)}to{transform:translateY(0) rotate(-16deg) scale(1)}}.ending{position:fixed;top:0;right:0;bottom:0;left:0;z-index:150;background:radial-gradient(at 50% 0%,#56624a,#111c16 70%);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;color:#d9ddbf;padding:30px}.ending>span{font:11px serif;letter-spacing:.5em;color:#a9b697}.ending h2{font:clamp(27px,5vw,48px) "DFKai-SB","KaiTi",serif;letter-spacing:.2em}.ending p{font:14px/2.1 serif;color:#b8c0a7}.ending button{margin-top:25px;background:#bcc49c;color:#243522}body[data-paused=true] .puzzle-panel{visibility:hidden}body[data-controls=touch] .campaign-hud{left:calc(170px + var(--safe-left));bottom:calc(16px + var(--safe-bottom));max-width:45vw;font-size:10px}body[data-controls=touch] .touch-controls{gap:4px;right:calc(20px + var(--safe-right));bottom:calc(18px + var(--safe-bottom))}body[data-controls=touch] .touch-controls button{font-size:11px;padding:6px 10px}body[data-controls=touch] .keypad-panel{right:calc(16px + var(--safe-right));width:clamp(150px,30vw,220px);padding:12px;max-height:90dvh}body[data-chapter="3"][data-controls=touch] .touch-controls{left:calc(18px + var(--safe-left));right:auto;bottom:calc(clamp(96px,26dvh,138px) + 30px + var(--safe-bottom));flex-direction:row;max-width:48vw;flex-wrap:wrap}body[data-puzzle=lottery] #joystick,body[data-puzzle=lottery] .touch-controls{visibility:hidden}body[data-controls=touch] .keypad-panel h2{font-size:20px;margin:3px 0}.keypad-grid{gap:5px}@media(max-height:500px){.puzzle-panel{padding:16px;max-height:92dvh}.lottery-panel{width:320px}.lottery-panel h2{font-size:23px;margin:4px 0}.lottery-panel p{margin:8px 0}.lottery-grid button{min-height:42px;font-size:19px}.keypad-panel small{font-size:9px}.keypad-panel p{margin:6px 0}.keypad-grid button{min-height:38px;padding:4px}.campaign-hud{bottom:5vh;font-size:10px}}@media(prefers-reduced-motion:reduce){.ghost-hand svg{animation:none}}#school-puzzle{color-scheme:light;width:min(520px,92vw);max-height:88dvh;overflow:auto;padding:30px 34px;background-color:#dfd8b9;background-image:repeating-linear-gradient(0deg,transparent,transparent 28px,#66806126 29px);color:#304633;border:1px solid #9d9c73;box-shadow:0 20px 100px #000b;overscroll-behavior:contain}#school-puzzle::backdrop{background:#07100cbd;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}#close-school-puzzle{position:absolute;right:8px;top:6px;min-width:44px;min-height:44px;padding:5px;background:transparent;border:0;font:25px serif;color:#526247}.school-paper-meta{font:10px/2 serif;letter-spacing:.2em;color:#6a755a}#school-puzzle h2{font:28px/1.5 DFKai-SB,KaiTi,serif;letter-spacing:.1em;margin:16px 0}#school-puzzle p{font-size:13px;line-height:2}#school-puzzle hr{border:0;border-top:1px solid #7a8a6288}#school-puzzle .math-question{font:clamp(22px,4vw,31px)/1.8 "DFKai-SB","KaiTi",serif;white-space:nowrap;margin:24px 0}#school-puzzle .math-working{padding:14px;border:1px solid #81906966;background:#e9e6cc66}#school-puzzle strong{font-size:26px;color:#7c4535}#school-puzzle .teacher-note{font-family:DFKai-SB,KaiTi,serif;line-height:1.8;color:#7c5441}#cabinet-form label{display:block;font-size:14px}#cabinet-code{display:block;width:100%;min-height:56px;letter-spacing:.5em;font:30px/1.6 monospace;padding:5px 15px;background:#eeead2;color:#31452e;border:1px solid #89966c;border-radius:0}#cabinet-form button{width:100%;margin:16px 0;min-height:48px;background:#435b3f;color:#eae7cd;border-color:#667857}#cabinet-feedback{font-size:13px;line-height:1.8;color:#864a3b}#school-puzzle button:focus-visible,#school-puzzle input:focus-visible{outline:2px solid #506d45;outline-offset:3px}@media(max-height:500px){#school-puzzle{padding:18px 26px;max-height:94dvh}#school-puzzle h2{font-size:23px;margin:8px 0}#school-puzzle .math-question{margin:12px 0}#school-puzzle p{margin:8px 0}#school-puzzle .math-working{padding:8px}}@media(max-width:360px){#school-puzzle{padding:20px}#school-puzzle h2{font-size:22px}#school-puzzle .math-question{font-size:21px}}#scare-overlay{position:fixed;top:0;right:0;bottom:0;left:0;width:100%;height:100%;z-index:90;pointer-events:none}#scare-caption{position:fixed;bottom:15%;left:5%;width:90%;z-index:91;text-align:center;pointer-events:none;color:#e3dfc4;font:bold clamp(22px,4vw,48px) "DFKai-SB",serif;text-shadow:0 3px 8px #000;letter-spacing:.08em}#scare-caption:empty{display:none}body[data-play-state=JUMPSCARE] .game-over .scare-face,body[data-play-state=GAMEOVER] .game-over .scare-face{display:none}body[data-play-state=CUTSCENE] #green-light,body[data-play-state=JUMPSCARE] #green-light{visibility:hidden}body:is([data-play-state=CUTSCENE],[data-play-state=JUMPSCARE]) :is(.masthead,.combat-hud,.crosshair,#message,#input-status,.touch-controls,#joystick,#interaction-prompt){visibility:hidden}body[data-play-state=JUMPSCARE] #campaign-hud{visibility:hidden}#model-loading{position:fixed;top:0;right:0;bottom:0;left:0;z-index:140;background:#080e0b;display:grid;place-items:center;color:#bec4ab;padding:24px;text-align:center;font:20px DFKai-SB,serif}
