:root{--scene-tone:1}
.room{transition:filter 1.4s}
.game[data-phase="2"] .room{filter:brightness(.9) saturate(.83)}
.game[data-phase="3"] .room{filter:brightness(.84) saturate(.72)}
.game[data-ending="outside"] .room{filter:sepia(.22) brightness(1.16)}
.game[data-ending="stay"] .room{filter:brightness(.53) saturate(.5)}
.game.scene-dimming .room{animation:light-dip 2.5s ease-in-out}
@keyframes light-dip{0%,100%{filter:brightness(.95)}45%,64%{filter:brightness(.38)}80%{filter:brightness(.78)}}
.hotspot[data-place="desk"]{flex-direction:row-reverse;transform:translate(calc(-100% + 16px),-16px)}
.hotspot.ringing .target-dot{animation:phone-ring 2.8s ease-in-out infinite;background:#dbe4c2;color:#173d33}
.hotspot.ringing .target-label{border-color:#dae6ad95}
@keyframes phone-ring{0%,35%,100%{transform:rotate(0);box-shadow:0 0 0 0 #d3e5c53d}5%,15%,25%{transform:rotate(14deg)}10%,20%,30%{transform:rotate(-14deg)}50%{box-shadow:0 0 0 12px #d3e5c500}}
.chapter-toast{position:absolute;top:22px;left:50%;transform:translate(-50%,-10px);opacity:0;pointer-events:none;display:flex;align-items:center;gap:18px;border-bottom:1px solid #d0dfc67a;padding:16px 21px;color:#e7ebdc;transition:opacity .5s,transform .5s;white-space:nowrap;background:#173e3436;backdrop-filter:blur(8px)}
.chapter-toast.visible{opacity:1;transform:translate(-50%,0)}
#chapter-index{font:20px Georgia,serif;color:#c6d5b9}#chapter-name{font-size:14px;letter-spacing:3px}
.story-dialog{position:fixed;inset:0;width:100vw;max-width:none;height:100svh;max-height:none;border:0;margin:0;background:transparent;box-shadow:none;color:#e6ecdb;padding:0;overflow:auto}
.story-dialog::backdrop{background:linear-gradient(180deg,#092b2b30,#0a2a2470 55%,#07241ddb);backdrop-filter:blur(1px)}
.letterbox-top{position:absolute;top:0;left:0;right:0;height:7vh;background:#071b18d9;border-bottom:1px solid #bcd3ba15}
.story-skip{position:absolute;top:22px;right:4.7%;color:#d4ddca;background:#18352f99;border:1px solid #bdcfb638;padding:10px 15px;font-size:13px;letter-spacing:1px;z-index:4}.story-skip:hover{background:#315647}
.story-panel{position:absolute;left:50%;bottom:max(6vh,30px);transform:translateX(-50%);width:min(880px,88vw);background:#112c25ed;border:1px solid #9db18c60;box-shadow:0 20px 80px #08231b66;padding:27px 34px 21px;animation:story-enter .4s ease-out;backdrop-filter:blur(20px)}
.story-person{display:flex;align-items:center;gap:16px;border-bottom:1px solid #baceb025;padding-bottom:18px}.story-person>div{flex:1}
#story-avatar{font:21px Georgia,serif;letter-spacing:1px;border:1px solid #c2d7b257;display:grid;place-items:center;width:52px;height:52px;color:#cbdcbe;background:#aec6a408;flex-shrink:0}
.story-speaker{font-size:16px;letter-spacing:3px}.story-scene{font-size:12px;letter-spacing:1.5px;color:#9ab69b;margin-top:8px}.story-count{font:12px 'Courier New',monospace;color:#9bb69a}
.story-text{font-family:"Songti SC",SimSun,serif;font-size:25px;letter-spacing:1.3px;line-height:1.85;min-height:94px;margin:22px 0 19px;color:#e4ead7}.story-text.typing:after{content:"";display:inline-block;width:2px;height:25px;background:#b6c8a5;vertical-align:-3px;margin-left:5px;animation:cursor-breathe 1s infinite}
.story-controls{display:flex;align-items:center;justify-content:space-between;gap:20px}.story-controls>span{font-size:12px;color:#90aa91;line-height:1.7}#story-next{background:transparent;border:1px solid #afc8a15c;color:#dce7ce;min-width:112px;padding:11px 18px;font-size:14px;letter-spacing:2px}#story-next span{margin-left:15px}#story-next:hover{background:#99bc8721}
.story-choices{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin:0 0 16px}.story-choices:empty{display:none}.story-choice{background:#abc89412;color:#e0e9d5;border:1px solid #b9d0a85c;text-align:left;padding:17px 18px;font-size:15px;line-height:1.6}.story-choice:hover{background:#b1cb99;color:#1b3b2a}.story-choice:before{content:"›";margin-right:12px;color:#a8c29b}.story-choice:hover:before{color:#1b3b2a}
.sr-only{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.cinematic{position:fixed;inset:0;width:100vw;max-width:none;height:100svh;max-height:none;border:0;padding:0;margin:0;overflow:hidden;background:transparent;box-shadow:none;color:#dae5d2}.cinematic::backdrop{background:#08241e1f;backdrop-filter:none}
.door-panel{position:absolute;top:0;bottom:0;width:50%;overflow:hidden;transition:transform 1.45s cubic-bezier(.7,0,.25,1);background:#213d37}.door-left{left:0}.door-right{right:0}.door-panel img{position:absolute;top:0;height:100svh;width:100vw;max-width:none;object-fit:cover;filter:saturate(.6) brightness(.65)}.door-left img{left:0}.door-right img{right:0}
.cinematic.opening .door-left{transform:translateX(-100%)}.cinematic.opening .door-right{transform:translateX(100%)}
.floor-indicator{position:absolute;top:15%;left:50%;transform:translateX(-50%);text-align:center;padding:24px 34px;color:#dce8d5;transition:opacity .5s;background:#142a2585;border:1px solid #bdceba35;min-width:210px;backdrop-filter:blur(9px)}
.floor-indicator>span{font:58px 'Courier New',monospace;letter-spacing:5px;text-shadow:0 0 17px #c0e0b34d}.floor-indicator p{font-size:14px;letter-spacing:4px;margin:12px 0}.floor-indicator small{font-size:12px;color:#b4c7ad;letter-spacing:2px}.opening .floor-indicator{opacity:0}
.cinematic.outside .door-panel img{filter:sepia(.16) brightness(1.05)}
.terminal-modal .number-grid{overflow:hidden}.terminal-modal .number-grid:before{content:"";position:absolute;left:0;right:0;top:-20px;height:30px;background:linear-gradient(transparent,#bfdda711,transparent);pointer-events:none;animation:terminal-scan 6s linear infinite}
.number{transition:background .14s,transform .2s,text-shadow .2s}.number.selected{animation:number-select .22s ease-out}
.receipt.printing .receipt-line{display:block;animation:line-print .4s ease-out both;animation-delay:calc(var(--line) * .23s)}.receipt-line{display:block;min-height:1em}.reveal-all{border:0;border-bottom:1px solid #a8bfa25c;padding:2px 0;background:none;font-size:12px;color:#a9bfa6;margin-bottom:4px}.record.archived{border-left-color:#76908d}.record.choice-record{border-left-color:#a09a72}.note-count-up{animation:number-select .3s ease-out}.paper-note{background:#e5e6d6;padding:25px;transform:rotate(-1deg);border:1px solid #afbd9a;box-shadow:4px 6px 0 #c8d0bc;margin:22px 0;font-family:"Songti SC",serif;font-size:21px;line-height:1.9;color:#394f39}.ending-memory{border-top:1px solid #637b4b40;padding-top:16px;font-family:"Songti SC",serif;font-size:17px;color:#557052;line-height:1.8}
@keyframes story-enter{from{opacity:0;translate:0 14px}to{opacity:1;translate:0 0}}
@keyframes cursor-breathe{0%,100%{opacity:.25}50%{opacity:1}}
@keyframes terminal-scan{to{top:110%}}
@keyframes number-select{0%{transform:scale(.88)}65%{transform:scale(1.06)}100%{transform:scale(1)}}
@keyframes line-print{from{opacity:0;transform:translateY(7px);filter:blur(2px)}to{opacity:1;transform:none;filter:none}}
@media(max-width:900px){.chapter-toast{top:153px;font-size:12px;padding:12px 18px}.story-panel{width:90vw}.hotspot[data-place="desk"] .target-label{font-size:12px}}
@media(max-width:600px){
  .story-panel{width:calc(100vw - 24px);padding:19px 21px;bottom:max(22px,env(safe-area-inset-bottom));max-height:80svh;overflow:auto}
  .story-person{gap:12px;padding-bottom:14px}#story-avatar{width:43px;height:43px;font-size:18px}.story-speaker{font-size:15px;letter-spacing:2px}.story-scene{font-size:12px;letter-spacing:.3px}.story-count{font-size:11px}.story-text{font-size:22px;line-height:1.8;min-height:130px;margin:20px 0}
  .story-controls{align-items:flex-end;gap:12px}.story-controls>span{max-width:55%;font-size:11px}#story-next{min-width:94px;font-size:13px;padding:10px 12px}.story-choices{grid-template-columns:1fr;gap:9px}.story-choice{font-size:14px;padding:12px}.story-skip{top:20px;font-size:12px}
  .chapter-toast{top:133px;padding:10px 16px;max-width:90vw}#chapter-name{font-size:13px;letter-spacing:2px}
  .hotspot[data-place="desk"]{flex-direction:column-reverse;transform:translate(-50%,calc(-100% + 16px));gap:5px}.hotspot[data-place="desk"] .target-label{font-size:12px}
  .floor-indicator{top:18%;min-width:180px;padding:20px}.floor-indicator>span{font-size:48px}
}
@media(prefers-reduced-motion:reduce){.room,.door-panel,.floor-indicator{transition:none}.room,.hotspot .target-dot,.number-grid:before,.number,.receipt-line,.story-panel,.story-text:after{animation:none!important}.receipt.printing .receipt-line{opacity:1;transform:none;filter:none}}

/* Emergency exit uses steady amber light and one restrained door movement. */
.force-choice{border-color:#a38c5d;color:#745329}
.force-choice:hover{background:#ddd8c5}
.force-modal{background:#e5e6d9;border-color:#9c946e}
.force-heading{display:flex;align-items:center;gap:16px;margin-bottom:20px}
.force-heading h2{margin:0}
.force-symbol{display:grid;place-items:center;width:40px;height:40px;border:1px solid #9b7d49;border-radius:50%;color:#88612f;font:26px Georgia,serif;flex-shrink:0}
.force-steps{list-style:none;display:flex;justify-content:space-between;gap:10px;margin:0 0 25px;padding:17px 0;border-top:1px solid #7b785330;border-bottom:1px solid #7b785330}
.force-steps li{display:flex;align-items:center;gap:8px;color:#7a8273;font-size:13px;white-space:nowrap}
.force-steps li>span{display:grid;place-items:center;width:23px;height:23px;border:1px solid #92978055;font:12px 'Courier New',monospace}
.force-steps li.current{color:#795426}.force-steps li.current>span{background:#8c6535;color:#f2eddc;border-color:#8c6535}.force-steps li.done{color:#43604c}
.force-modal .note-quote{border-color:#ab8750;background:#d9dccb;font-size:19px}
.force-primary{background:#785b36;border-color:#785b36}.force-primary:hover{background:#947244}
.game[data-ending="forced"] .room{filter:brightness(1.1) saturate(.7)}
.cinematic.forced{background:#101a16}
.cinematic.forced .door-panel img{filter:sepia(.28) brightness(.73)}
.cinematic.forced .floor-indicator{border-color:#c19c6380;color:#f0d8b5;background:#31291ec9}
.cinematic.forced .floor-indicator small{color:#d3b989}
.cinematic.forced .door-panel{transition:transform .75s cubic-bezier(.24,.02,.48,1)}
.cinematic.forced.straining .door-left{transform:translateX(-1.5%)}
.cinematic.forced.straining .door-right{transform:translateX(1.5%)}
.cinematic.forced.released .door-left{transform:translateX(-13%)}
.cinematic.forced.released .door-right{transform:translateX(13%)}
.cinematic.forced.opening .door-left{transform:translateX(-100%)}
.cinematic.forced.opening .door-right{transform:translateX(100%)}
@media(max-width:600px){.force-heading{gap:12px}.force-heading h2{font-size:23px}.force-steps{gap:5px}.force-steps li{gap:5px;font-size:12px}.force-modal .modal-actions{flex-direction:column}.force-modal .note-quote{font-size:18px}}
@media(prefers-reduced-motion:reduce){.cinematic.forced .door-panel{transition:none}}
