:root{color-scheme:dark;--cream:#e8dfcd;--gold:#b8a384;--muted:#9c9d94;--red:#9e3440}*{box-sizing:border-box}body{margin:0;background:#080e10;color:var(--cream);font:13px Arial,Helvetica,sans-serif;overflow:hidden;user-select:none}button,input,select{font:inherit}button{cursor:pointer}button:disabled{cursor:wait;opacity:.45}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #ebcca0;outline-offset:5px}#game,#game canvas{position:fixed;inset:0;width:100%;height:100%;display:block;outline:0}#game{z-index:0}.hide{display:none!important}.screen{position:fixed;inset:0;z-index:20;display:none}.screen.active{display:block}.film-grain{position:fixed;inset:0;z-index:4;opacity:.055;pointer-events:none;background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");background-size:170px}.edge-darken{position:fixed;inset:0;z-index:3;pointer-events:none;background:radial-gradient(ellipse at 50% 44%,transparent 35%,#01050780 100%)}#danger-vignette{position:fixed;inset:0;z-index:8;pointer-events:none;opacity:0;background:radial-gradient(ellipse,transparent 26%,#720d26bd 100%);transition:opacity .3s}#flash-screen,#cut-to-black{position:fixed;inset:0;z-index:18;pointer-events:none;opacity:0;transition:opacity .7s;background:#000}#flash-screen{background:#eee0cd}#menu{background:linear-gradient(90deg,#080e10f5 0%,#080e10dc 26%,#080e1088 49%,#080e1020 78%),linear-gradient(0deg,#070d10d9,transparent 35%,transparent 70%,#080d1088)}.menu-top{position:absolute;top:32px;left:4.5vw;right:4.5vw;display:flex;justify-content:space-between;font-size:9px;letter-spacing:.23em;color:#c9c2b2}.brand:before{content:'✳';font-size:15px;margin-right:13px;color:var(--gold)}.menu-inner{position:absolute;left:8vw;top:50%;transform:translateY(-48%);width:540px;max-width:70vw}.kicker{font-size:8px;letter-spacing:.26em;color:#b8a384;display:flex;align-items:center;gap:10px}.kicker>span{width:22px;height:1px;background:var(--gold)}h1,h2{font-family:Georgia,'Times New Roman',serif;font-weight:400}h1{font-size:clamp(58px,7vw,108px);line-height:.91;letter-spacing:-.055em;margin:28px 0 29px}h1 em{font-size:1.22em;font-weight:400;color:#e6d4b9}h1 .title-period{color:#9d2638;font-style:italic;margin-left:1px}.title-rule{display:flex;align-items:center;gap:16px;width:360px;max-width:85%;font-size:8px;letter-spacing:.22em;color:#b0a089}.title-rule i{height:1px;background:#655e4f;flex:1}.menu-description{font-family:Georgia,serif;font-size:17px;line-height:1.7;color:#b8b9ae;margin:28px 0 21px}.menu-description strong{font-weight:400;color:#ded5c1}.main-button{background:#d4c2a3;border:1px solid #d4c2a3;color:#171919;min-height:53px;min-width:320px;max-width:100%;padding:0 22px;font-size:9px;font-weight:bold;letter-spacing:.17em;display:inline-flex;align-items:center;justify-content:space-between;gap:24px;transition:background .2s,transform .2s}.main-button:hover:not(:disabled){background:#efddbf;transform:translateY(-2px)}.arrow{font-size:21px;font-weight:400}#load-progress{height:1px;background:#39403b;width:320px;max-width:100%;margin-top:9px}#load-progress span{display:block;height:100%;width:0;background:#c4ae89;transition:width .4s}#load-message{color:#91988d;font-size:9px;letter-spacing:.05em;margin:8px 0 0}.menu-note{display:flex;align-items:center;gap:13px;margin-top:23px;font-size:10px;color:#b3b7ac;line-height:1.7}.menu-note p{margin:0}.menu-note p span{color:#777f79;font-size:9px}.headphone-icon{font-size:30px;color:#ab9b82}.invite-seal{position:absolute;right:9vw;bottom:18vh;width:124px;height:124px;border:1px solid #c3ae7960;border-radius:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;transform:rotate(-14deg);color:#d2bd95;background:#171a162e;box-shadow:0 0 0 6px #0000,0 0 0 7px #c3ae7920}.invite-seal span{font-size:8px;letter-spacing:.2em}.invite-seal i{font-family:Georgia,serif;font-size:28px;margin:6px}.menu-footer{position:absolute;bottom:27px;left:4.5vw;right:4.5vw;padding-top:19px;border-top:1px solid #a3a89628;display:flex;justify-content:space-between;align-items:center;gap:15px;font-size:8px;letter-spacing:.16em;color:#a9b0a6}.menu-footer b{color:var(--gold);font-size:14px;font-family:Georgia,serif;font-weight:400}.quiet-button,.text-button{background:none;border:0;color:#c5b79e;font-size:9px;letter-spacing:.14em;padding:14px 0}.text-button{display:block;margin:8px auto}.quiet-button:hover,.text-button:hover{color:#fff1d7}#menu .text-button{margin:0;padding-bottom:0;text-align:left}#hud{position:fixed;inset:0;pointer-events:none;z-index:6}.hud-top{display:flex;justify-content:space-between;position:absolute;top:30px;left:32px;right:32px}.objective-panel{max-width:440px;text-shadow:0 2px 8px #000}.eyebrow{font-size:9px;letter-spacing:.20em;color:#b6a487}.eyebrow span{margin-left:16px;color:#7d857c}#objective{font-family:Georgia,serif;font-size:24px;margin-top:11px}#objective-meta{font-size:8px;letter-spacing:.15em;color:#a6ada2;margin-top:11px}.right-panel{width:150px;padding:10px 12px;background:#080e1059}#inventory-tag{font-size:9px;letter-spacing:.12em;margin-bottom:18px;color:#a8b0a7}#inventory-tag b{float:right;color:#d4bd97}.health-info{font-size:8px;letter-spacing:.14em;margin-top:12px;color:#b8b9ac}.health-info>span{float:right;color:#9da799}.meter{margin-top:7px;height:2px;background:#c2c5af26}.meter>div{height:100%;background:#c5c6b7;width:100%;transition:width .1s}.yellow>div{background:#ccb582}#crosshair{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-size:22px;color:#e5e4ca90}#interaction{position:absolute;left:50%;top:58%;transform:translateX(-50%);display:flex;align-items:center;gap:12px;background:#071013d9;border:1px solid #bca48266;padding:12px 17px;white-space:nowrap;font-size:9px;letter-spacing:.12em}#interaction b{font-size:12px;padding:6px 8px;border:1px solid #c3ae8b;color:#ead3ac}#subtitle{position:absolute;bottom:15%;left:50%;width:min(740px,85vw);transform:translateX(-50%);text-align:center;white-space:pre-line;font-family:Georgia,serif;font-size:22px;line-height:1.45;opacity:0;transition:opacity .4s;text-shadow:0 2px 6px #000,0 0 18px #000;background:radial-gradient(ellipse,#0004,transparent 72%)}#subtitle.shown{opacity:1}.hud-bottom{position:absolute;bottom:26px;left:32px;right:32px;display:flex;justify-content:space-between;gap:10px;font-size:8px;letter-spacing:.12em;color:#9da698;text-shadow:0 2px 6px #000}.sound-source{display:flex;gap:12px;align-items:center}.sound-source i{color:#bba17c}#distance{color:#aab1a2}#chapter-title{position:absolute;top:24%;width:100%;text-align:center;font-size:11px;letter-spacing:.4em;opacity:0;transition:opacity 1s;color:#e0cfaf;text-shadow:0 2px 14px #000}#chapter-title.shown{opacity:1}#rule-banner{position:absolute;top:29%;width:100%;text-align:center;text-shadow:0 2px 20px #000;background:linear-gradient(90deg,transparent,#130a10a6,transparent);padding:22px}#rule-banner h2{font-size:68px;margin:9px;color:#eddbd0;font-style:italic;letter-spacing:-.04em}#rule-banner p{font-size:11px;letter-spacing:.08em;color:#cba8a8}#proximity{position:absolute;top:18%;width:100%;text-align:center;font-size:9px;letter-spacing:.25em;color:#c67782}.overlay{display:flex;align-items:center;justify-content:center;background:#03090de6;text-align:center;z-index:22}.dialog{max-width:570px;padding:40px}.dialog h2{font-size:clamp(50px,7vw,86px);line-height:1;letter-spacing:-.05em;margin:22px 0}.dialog p{font-family:Georgia,serif;font-size:19px;line-height:1.7;color:#b6b7aa;margin:22px 0 28px}.dialog .controls,.controls{font:10px/1.9 Arial,sans-serif!important;color:#8b9488!important;margin-top:25px!important}#mouse-help{position:fixed;bottom:60px;left:50%;transform:translateX(-50%);z-index:12;display:flex;align-items:center;gap:15px;padding:9px 13px;background:#081216de;border:1px solid #bba48244;font-size:10px;color:#b9bdac;max-width:90vw}#mouse-help button{padding:8px;background:#c3b08d;border:0;font-size:9px;color:#181c1b;white-space:nowrap}#runtime-error{position:fixed;z-index:100;top:10px;left:10px;right:10px;background:#6e1729;color:#fff;padding:15px;font:13px monospace}dialog{color:var(--cream);background:#10191d;border:1px solid #625d4d;max-width:95vw;width:430px;padding:37px}dialog::backdrop{background:#02070be0}dialog h2{font-size:40px;margin:20px 0 30px;letter-spacing:-.04em}dialog label{display:flex;align-items:center;justify-content:space-between;gap:15px;margin:24px 0;color:#c1c5b7;font-size:12px}dialog input[type=range]{width:150px;accent-color:#c5ad84}dialog select{padding:6px;background:#0c1114;border:1px solid #6d7062;color:#ddd2bc}dialog .checkbox-label{justify-content:flex-start}dialog input[type=checkbox]{accent-color:#c5ad84}.letterbox{position:fixed;inset:0;border-top:0 solid #000;border-bottom:0 solid #000;z-index:5;pointer-events:none;transition:border-width 1.5s}body[data-stage=ceremony] .letterbox{border-width:5vh 0}body[data-stage=ceremony] .hud-top,body[data-stage=ceremony] .hud-bottom,body[data-stage=ceremony] #crosshair{opacity:0}.reduced-motion .film-grain{display:none}@media(max-height:760px){.menu-inner{transform:translateY(-46%)}h1{font-size:69px;margin:20px 0}.menu-description{margin:19px 0;font-size:15px}.menu-note{margin-top:14px}.menu-top{top:22px}.menu-footer{bottom:18px}.menu-inner .kicker{font-size:7px}}@media(max-width:700px){.menu-inner{left:8vw;max-width:86vw}.menu-top span:last-child,.menu-footer>span:nth-child(2),.invite-seal{display:none}h1{font-size:70px}.menu-description{font-size:15px}#menu{background:#080e10b8}.hud-top{top:20px;left:20px;right:20px}.objective-panel{max-width:58vw}#objective{font-size:20px}.right-panel{width:110px}.hud-bottom{left:20px;right:20px}#tip{display:none}#subtitle{font-size:18px}#mouse-help{font-size:9px}#rule-banner h2{font-size:47px}}

/* Restored original touch controls and position diagnostics. */
#touch-controls{position:fixed;z-index:10;inset:0;pointer-events:none}#joystick{position:absolute;left:35px;bottom:80px;width:120px;height:120px;border:1px solid rgba(210,200,177,.32);border-radius:100%;background:rgba(16,22,23,.3);pointer-events:auto;touch-action:none}#joystick-knob{width:48px;height:48px;border:1px solid #baae9e;border-radius:100%;position:absolute;left:36px;top:36px;background:rgba(174,158,130,.17)}#touch-actions{position:absolute;right:20px;bottom:75px;display:flex;gap:10px;pointer-events:auto}#touch-actions button{width:58px;height:58px;border-radius:50%;border:1px solid #8f8174;background:rgba(8,12,14,.75);color:#e2d8c3;font-size:13px;touch-action:none}#touch-actions button:last-child{width:67px;height:67px}#touch-actions button.on{background:rgba(196,174,137,.55);color:#14100d;border-color:#e8d2a8}.touch-hint{position:absolute;top:57%;right:22px;font-size:9px;letter-spacing:.13em;color:#a1a09a}
/* Jumpscare hit: red bloom, white flash and a violent frame jitter. */
#scare-overlay{position:fixed;inset:0;z-index:17;pointer-events:none;opacity:0;background:radial-gradient(ellipse at 50% 45%,#ffffff22 0,#9a0018b0 55%,#160004f2 100%)}
body.scare-hit #scare-overlay{animation:scareHit .95s ease-out}
body.scare-hit #game canvas{animation:scareJitter .95s steps(14)}
body.scare-hit.reduced-motion #game canvas{animation:none}
body.soft-scares.scare-hit #game canvas{animation:none}body.soft-scares.scare-hit #scare-overlay{animation:scareHitSoft .8s ease-out}
@keyframes scareHitSoft{0%{opacity:.45}100%{opacity:0}}
@keyframes scareHit{0%{opacity:1;background-color:#ffffff40}6%{opacity:.95;background-color:transparent}100%{opacity:0}}
@keyframes scareJitter{0%{filter:contrast(2.4) saturate(0) brightness(1.9);transform:translate(7px,-5px) scale(1.05)}8%{filter:contrast(1.9) saturate(1.7) hue-rotate(-20deg);transform:translate(-9px,6px) scale(1.07)}16%{filter:invert(.85) contrast(2);transform:translate(4px,4px) scale(1.04)}24%{filter:contrast(1.5) saturate(1.4);transform:translate(-5px,-3px) scale(1.03)}45%{filter:contrast(1.2);transform:translate(2px,1px) scale(1.01)}100%{filter:none;transform:none}}
#ending .dialog{max-height:100vh;overflow-y:auto}
body[data-stage=intro] .letterbox,body[data-stage=outro] .letterbox{border-width:6vh 0}body[data-stage=intro] .hud-top,body[data-stage=intro] .hud-bottom,body[data-stage=intro] #crosshair,body[data-stage=outro] .hud-top,body[data-stage=outro] .hud-bottom,body[data-stage=outro] #crosshair{opacity:0}
#skip-hint{display:none;position:fixed;right:32px;bottom:22px;z-index:19;font-size:9px;letter-spacing:.22em;color:#a9a08c;pointer-events:none}body[data-stage=intro].in-game #skip-hint,body[data-stage=outro].in-game #skip-hint{display:block}
#pause-stats{letter-spacing:.14em}#pause-stats b{color:#e0c27f;font-weight:400}
.result-card{display:block;width:min(400px,78vw);margin:0 auto 4px;border:1px solid #6d5f4c;box-shadow:0 12px 40px #000c}
a.text-button{text-decoration:none;text-align:center}
#run-timer{color:#c9b590;letter-spacing:.2em;font-variant-numeric:tabular-nums}
#menu .daily-button{margin-top:4px;padding-top:6px;color:#d9a7a7}#menu .daily-button:hover{color:#ffd9d9}#menu .daily-button b{color:#f0dcb6;font-weight:400}
.night-line{font-size:9px;letter-spacing:.2em;color:#a99a83;margin:-6px 0 18px}.night-line b{color:#e0c9a4;font-weight:400}
.run-stats{margin:-6px auto 26px;display:flex;align-items:center;gap:26px;justify-content:center;text-align:left}
.run-stats .rank{font-family:Georgia,serif;font-size:92px;line-height:1;color:#e6d3b1;min-width:70px;text-align:center;text-shadow:0 0 30px #9d263866}
#ring-tag{font-size:9px;letter-spacing:.12em;margin:-10px 0 14px;color:#a8a08a}#ring-tag b{float:right;color:#e0c27f}
.run-stats .rank-Splus{color:#ffe2a0;text-shadow:0 0 26px #ffd27a,0 0 60px #d8b26a88}
.run-stats .rank-groom{color:#d9b6bf;text-shadow:0 0 34px #9d2638cc}.run-stats .rank-S{color:#f2deb0;text-shadow:0 0 32px #f2deb0aa}.run-stats .rank-F{color:#9e3440}
.run-stats dl{display:grid;grid-template-columns:auto auto;gap:6px 18px;margin:0;font-size:9px;letter-spacing:.16em}.run-stats dt{color:#8b9488}.run-stats dd{margin:0;color:#e1d6c0}.run-stats dd b{color:#9e3440;font-weight:bold}
.run-stats .next-night{grid-column:1/-1;flex-basis:100%;text-align:center;font:12px/1.5 Georgia,serif!important;color:#b88a8a!important;margin:6px 0 0!important}
.run-stats{flex-wrap:wrap}
#game-tools{position:fixed;bottom:5px;left:12px;z-index:13;font:10px monospace;display:flex;align-items:center;gap:8px;color:#a8ad9b}#game-tools button{background:#101716;border:1px solid #424b46;color:#acac98;padding:3px 6px;font:inherit}body:not(.in-game) #game-tools{display:none}
