:root{color-scheme:dark;font-family:"Pretendard","Apple SD Gothic Neo","Malgun Gothic",sans-serif;background:#18282b;color:#f0f1ea}*{box-sizing:border-box}[hidden]{display:none!important}html,body{margin:0;width:100%;height:100%;overflow:hidden;overscroll-behavior:none;-webkit-touch-callout:none}button,input,select{font:inherit}button,a{color:inherit;-webkit-tap-highlight-color:transparent}button{cursor:pointer;border:1px solid #d2e0d65c;background:#213639ce;border-radius:5px;padding:10px 15px;min-height:43px}button:hover{background:#385153}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid #e0c897;outline-offset:3px}.primary{color:#223537;background:#e4e7d6;border-color:#e4e7d6;font-weight:700}.primary:hover{background:#f6f4ea}.primary:active{transform:translateY(1px)}#stage{position:fixed;inset:0 auto auto 0;width:100%;height:100svh;touch-action:none;user-select:none;overflow:hidden;isolation:isolate;background:#202f31}#stage:fullscreen{width:100%;height:100%}#world,#shade,#cover{position:absolute;inset:0;width:100%;height:100%}#world{touch-action:none}#shade{background:linear-gradient(0deg,#101d1e55,transparent 22%,transparent 82%,#101d1d45);pointer-events:none}.locked #world{cursor:none}header{position:absolute;top:max(19px,env(safe-area-inset-top));left:max(5%,env(safe-area-inset-left));right:max(5%,env(safe-area-inset-right));z-index:4;display:flex;align-items:center;justify-content:space-between;pointer-events:none;text-shadow:0 2px 8px #172628}header b{font-size:18px;letter-spacing:.12em}header small{display:block;font:9px monospace;letter-spacing:.10em;margin-top:4px}.tools{display:flex;gap:7px;pointer-events:auto}.tools button{font-size:13px;padding:7px 12px}
#cover {
 position:absolute;inset:0;z-index:2;display:grid;place-items:center;
 background-color:#0e1111;
 background-image:radial-gradient(ellipse at 50% 47%,transparent 35%,#06080947 100%),url("ward-title-night.webp");
 background-size:cover;background-position:center;
}
#cover:not([hidden]) ~ header {display:none}
.coverbox {
 display:grid;justify-items:center;align-content:center;gap:clamp(1.55rem,4.4svh,2.5rem);
 max-width:90vw;padding:1rem;text-align:center;
}
.coverTitle {display:grid;gap:clamp(.7rem,1.7svh,1rem)}
.coverTitle h1 {
 margin:0;color:#a25d57;font-family:"Noto Serif CJK KR","Noto Serif KR","NanumMyeongjo","Batang",serif;
 font-size:clamp(2.75rem,min(7vw,11svh),5rem);font-weight:600;line-height:1.18;
 letter-spacing:.12em;text-indent:.12em;text-shadow:0 2px 8px #080606cf;
}
.coverIntro {
 max-width:36rem;margin:0;color:#b6b3ab;font-size:clamp(.875rem,1.5vw,1rem);line-height:1.65;
 text-wrap:balance;word-break:keep-all;text-shadow:0 1px 6px #060708;
}
.reviewMode .coverIntro {display:none}
.coverbox .kicker {margin:0;color:#d3ded8;font-size:.9rem}
.coverbox .kicker:empty {display:none}
#start {
 min-width:9.6rem;min-height:46px;padding:.7rem 1.8rem;border:1px solid #78786e;border-radius:3px;
 color:#d0cdc6;background:#111615f0;font-size:1rem;font-weight:500;letter-spacing:.06em;
}
#start:hover,#start:focus-visible {color:#ebe8e2;background:#272a27;border-color:#aaa69c}
#start:focus-visible {outline:2px solid #fff;outline-offset:4px}
.coverbox a {color:#e1e5dd;font-size:.9rem}
.coverCredit {
 position:absolute;inset-inline:1rem;bottom:max(1rem,env(safe-area-inset-bottom));
 margin:0;color:#b6b3ab;font-size:.875rem;line-height:1.4;text-align:center;
 text-wrap:balance;word-break:keep-all;text-shadow:0 1px 6px #050606;
}
#hud{position:absolute;z-index:2;left:5%;top:83px;border-left:2px solid #d9c9a1;padding:0 11px;text-shadow:0 2px 7px #102224;pointer-events:none}#hud small{font:11px monospace;letter-spacing:.12em;color:#e4e8db}#hud strong{display:block;font-size:19px;margin-top:4px}#controls{position:absolute;inset:0;z-index:3;pointer-events:none}#controls button,#stick{pointer-events:auto}#aim{position:absolute;left:50%;top:50%;width:5px;height:5px;border-radius:50%;background:#f3f2d7;box-shadow:0 0 5px #192929;transform:translate(-50%,-50%)}#targetHint{position:absolute;top:calc(50% + 25px);left:50%;transform:translateX(-50%);font-size:14px;text-shadow:0 2px 5px #172628;white-space:nowrap}#use{position:absolute;right:6%;bottom:8%;border-radius:24px;min-width:100px}kbd{font:10px monospace;color:#e2e7d6;margin-left:6px}#lockHint{display:none;position:absolute;bottom:3%;left:50%;transform:translateX(-50%);background:#1b2d30c0;padding:8px 14px;border-radius:4px;font-size:12px}.playing:not(.locked) #lockHint{display:block}#stick{position:absolute;display:none;left:6%;bottom:7%;width:96px;height:96px;border:1px solid #e1e7d78c;border-radius:50%;background:#263c3f55;align-items:center;justify-content:center;touch-action:none}#stick span{width:36px;height:36px;border-radius:50%;background:#e6ead0a0}#stance{position:absolute;display:none;right:6%;bottom:calc(8% + 54px);gap:7px}#stance button[aria-pressed=true]{background:#e0e4d0;color:#203739}#toast{position:absolute;top:36%;left:50%;transform:translate(-50%,-50%);text-align:center;font-size:14px;z-index:4;pointer-events:none}.toastActive{background:#1b2d30de;padding:10px 18px;border-radius:5px}#dialogue{position:absolute;z-index:5;left:8%;bottom:7%;right:8%;max-width:780px;padding:18px 22px;background:linear-gradient(90deg,#132628e8,#182c2db7);border-left:2px solid #d8c99a;box-shadow:0 4px 28px #13222355}#speaker{font-size:13px;font-weight:700;color:#d5c69c}#line{font-size:clamp(17px,2vw,25px);line-height:1.6;margin:5px 0 15px;word-break:keep-all}#settings,#turnDevice,#loading{position:absolute;inset:0;display:grid;place-items:center;background:#162628bc;backdrop-filter:blur(3px);z-index:12}#settings article{background:#263a3c;border:1px solid #a5b3a752;border-radius:6px;padding:24px;width:min(440px,92vw);max-height:93%;overflow:auto}#settings h2{margin:5px 0 10px}#settings p{margin:0 0 18px;color:#d7e0da}#settings label{display:flex;align-items:center;gap:10px;margin:13px 0;font-size:14px}#settings input,#settings select{flex:1;accent-color:#dfe2ce;min-width:40px}#settings select{background:#172c2e;color:#f0f1e9;border:1px solid #8fa39e;padding:8px}#settings a{display:block;font-size:13px;margin-top:16px}#turnDevice,#loading{align-content:center;gap:16px;text-align:center;background:#1d3031}#turnDevice small{color:#bbccca}#loading span{width:40px;height:3px;background:#9eb9b3;animation:load 1.3s ease-in-out infinite}@keyframes load{50%{width:95px;opacity:.3}}
@media(pointer:coarse){#stick,#stance{display:flex}#lockHint,.playing:not(.locked) #lockHint,kbd{display:none}#dialogue{left:23%;right:4%;bottom:5%;padding:10px 14px}#hud{top:47px;left:4%}#hud strong{font-size:14px}header{top:8px;left:4%;right:4%}header b{font-size:15px}header small{font-size:7px}.tools button{padding:5px 8px;min-height:36px;font-size:12px}#use{right:4%;bottom:6%;min-height:44px}#stance{right:4%;bottom:calc(6% + 52px)}#stance button{min-height:40px;padding:7px 10px;font-size:12px}#stick{left:4%;bottom:5%;width:90px;height:90px}#settings article{padding:15px 20px}}

#wardPower{position:absolute;inset:0;pointer-events:none;background:#060b0c;opacity:0;transition:opacity .13s linear;z-index:1}
#wardPower[data-light="flicker"]{opacity:.42;transition:none}
#wardPower[data-light="blackout"]{opacity:.97;transition:none}
#wardPower[data-light="failure"]{opacity:.25;background:#1c201f;transition:opacity .35s linear}
#visitObjective{margin-top:8px;display:block;font:inherit;font-size:13px;color:#e5e8d9}
#foldedNotice{position:absolute;z-index:3;width:125px;height:188px;bottom:-73px;left:9%;pointer-events:none;background:url(hand.webp) center/contain no-repeat;transform:rotate(-11deg);filter:brightness(.87)}
#noticeToggle{position:absolute;z-index:7;left:9%;bottom:6%;padding:8px 13px;background:#223332f2}
#chapterBook{position:absolute;inset:0;z-index:6;pointer-events:none}
#powerCue{position:absolute;z-index:5;top:21%;right:5%;font-size:clamp(13px,2.2vw,16px);color:#e1e7dc;background:#141f1ee6;border-radius:4px;padding:7px 10px;pointer-events:none}
#chapterResult,#returnMessage{position:absolute;inset:0;z-index:13;display:grid;place-items:center;background:#101c1bd9}
#chapterResult article,#returnMessage article{width:min(430px,91vw);padding:24px;border:1px solid #82998b80;border-radius:6px;background:#203633}
#chapterResult h2,#returnMessage h2{margin:0}
#chapterResult p,#returnMessage p{line-height:1.65;margin:12px 0 20px}
#returnMessage{background:#101c1b50;place-items:end center;padding-bottom:4svh}
#returnMessage article{word-break:keep-all;max-height:92svh;overflow:auto}
@media(pointer:coarse){
 #visitObjective{font-size:12px;margin-top:6px}
 #noticeToggle{left:19%;bottom:5%}
 #foldedNotice{left:19%}
}

#use:disabled{opacity:.5;cursor:default}

#responses{display:flex;flex-wrap:wrap;gap:8px}

#campaignChoices{display:flex;gap:8px;flex-wrap:wrap}
#resultLine{white-space:pre-line}
#suspicion{margin-top:7px;color:#efc6a9}


#openingSequence{position:absolute;inset:0;z-index:14;background:#090d0e;color:#e4e8e4}
#openingNext{display:grid;width:100%;height:100%;align-content:center;justify-items:center;gap:clamp(16px,5svh,42px);padding:30px 6vw;border:0;border-radius:0;background:transparent;color:inherit;text-align:center;touch-action:manipulation}
#openingNext:focus-visible{outline-offset:-5px}
.openingCard{font-size:clamp(16px,min(2.6vw,4.5svh),23px);line-height:1.8;word-break:keep-all;overflow-wrap:break-word;animation:visitOpening .28s ease-out both}
.openingCard span,.openingCard small{display:block}
.openingCard small{margin-bottom:.85em;color:#b6c2bb;font-size:.78em;letter-spacing:.06em}
.openingFriend{margin-top:.45em;color:#d4d8ca}
#openingHint,#openingSkip{font-size:clamp(13px,2svh,15px);color:#b6c2bb}
#openingSkip{position:absolute;right:max(4vw,env(safe-area-inset-right));bottom:max(3svh,env(safe-area-inset-bottom));background:transparent}
@keyframes visitOpening{from{opacity:0}to{opacity:1}}
@media(prefers-reduced-motion:reduce){.openingCard{animation:none}}
#suspicion{position:absolute;z-index:4;right:5%;top:79px;width:clamp(166px,20vw,245px);padding:10px 13px;border:1px solid #a8b6af82;border-radius:5px;background:#121d1bee;color:#f0eee2;pointer-events:none}
.riskLabel{display:flex;justify-content:space-between;align-items:baseline;gap:9px;font-size:14px}
#suspicionValue{font-size:21px;font-variant-numeric:tabular-nums;color:#f7efe2}
#suspicionTrack{height:9px;margin-top:6px;background:#3d4540;border-radius:8px;overflow:hidden}
#suspicionFill{display:block;width:0;height:100%;background:#c7cbb7;transition:width .13s linear}
#suspicion[data-level="raised"] #suspicionFill{background:#e8bd7c}
#suspicion[data-level="high"] #suspicionFill,#suspicion[data-level="chase"] #suspicionFill{background:#e68d80}
#suspicion[data-level="chase"]{border-color:#e68d80}
@media(pointer:coarse){#suspicion{top:48px;right:4%;padding:6px 9px;width:155px}#suspicionValue{font-size:17px}#suspicionTrack{height:7px}}

#shade::after{content:"";position:absolute;inset:0;background:linear-gradient(110deg,rgba(105,57,55,.055),rgba(85,60,60,.025));opacity:0;transition:opacity 3.4s ease}
.afterHours #shade::after{opacity:1}

#flashlight{position:absolute;z-index:5;bottom:13%;left:9%;color:#ede8d8;background:#23312fec;border:1px solid #a4aca38c}
#flashlight[aria-pressed="true"]{background:#645945}
@media(pointer:coarse){#flashlight{left:auto;right:4%;top:109px;bottom:auto;font-size:13px;padding:6px 10px}}

#chapterResult #resultRule{margin:4px 0 22px;border-left:2px solid #b6b199;padding-left:.8rem;color:#d9ddce;font-size:.95rem;word-break:keep-all}
#chapterResult article{word-break:keep-all}
#campaignChoices button{line-height:1.45}
@media(pointer:coarse) and (max-height:480px){
 #dialogue{max-height:56svh;overflow:auto;overscroll-behavior:contain}
 #campaignChoices{gap:4px}
 #campaignChoices button{min-height:40px;padding:6px 10px;font-size:14px}
}

#stage[data-ending] header>div:first-child,#stage[data-ending] #fullscreen,#stage[data-ending] #sound{visibility:hidden}
#stage[data-ending] #menu{opacity:.55}

#roomReview{position:absolute;z-index:5;top:82px;right:5%;padding:10px 12px;color:#f3f4ed;background:#152522ee;border:1px solid #81988c80;border-radius:6px}
.reviewReadout,.reviewButtons{display:flex;align-items:center;gap:6px}
.reviewReadout{justify-content:space-between;gap:15px;margin-bottom:8px}
.reviewReadout strong{font-size:13px}.reviewReadout output{font:12px/1.3 ui-monospace,monospace;color:#e1e6d7;white-space:nowrap}
.reviewButtons button{font-size:12px;min-height:31px;padding:5px 8px}
.reviewMode #flashlight{position:static}
.reviewMode #hud{max-width:35%}
.reviewMode #visitObjective{line-height:1.5;letter-spacing:normal}
@media(pointer:coarse),(max-width:720px){
 #roomReview{top:50px;right:4%;padding:5px 7px}.reviewReadout{margin-bottom:4px}
 .reviewButtons{gap:3px}.reviewButtons button{padding:3px 5px;min-height:32px;font-size:11px}
 .reviewMode #visitObjective{display:none}
}


.wardLoop #wardPower::after{content:"";position:absolute;inset:0;background:#100f10;pointer-events:none;animation:wardLoopBlink .82s both}
@keyframes wardLoopBlink{0%,18%{opacity:1}100%{opacity:0}}

/* Keep actionable text legible against exam-room lights and dark hallways. */
#visitObjective{display:table;padding:4px 7px;margin-left:-2px;color:#f6f3e9;background:#182825d9;border-radius:3px;line-height:1.42}
#targetHint:not(:empty){padding:4px 8px;background:#172522d6;border-radius:4px;max-width:84vw;white-space:normal;text-align:center}

#nightPhone{position:absolute;z-index:10;right:4%;bottom:18%;width:min(21rem,71vw);padding:1rem 1.15rem;background:#182323f5;color:#f3f0e7;border:1px solid #92a69c;border-radius:12px;box-shadow:0 8px 25px #0008;line-height:1.55}
#nightPhone .callerName{font-weight:700;font-size:1.1rem}
.callerName span{color:#bacfbf;margin-right:.35em}
#nightPhone p{margin:.3rem 0 .7rem}
#nightPhone button{font:inherit;color:#e9ede8;background:#344a44;border:1px solid #91a49b77;border-radius:5px;padding:.34em .7em;min-height:38px}
#phoneChoices:not([hidden]),#phoneRingActions:not([hidden]){display:flex;flex-wrap:wrap;gap:.35rem}
#nightPhone button:focus-visible{outline:2px solid #efdbaf}
@media(pointer:coarse){#nightPhone{bottom:4%;left:24%;width:49%;padding:.55rem .8rem}#nightPhone p{margin:.1rem 0 .28rem}#nightPhone button{font-size:.88rem;min-height:39px}}

#holdMeter{position:absolute;top:calc(50% + 58px);left:50%;transform:translateX(-50%);width:7em;height:5px;border-radius:5px;background:#1b2424;overflow:hidden;box-shadow:0 0 0 1px #bac3ad9c}
#holdFill{display:block;height:100%;background:#ebd0a0}
#use{touch-action:none}
#captureRecognition{position:absolute;z-index:9;left:50%;bottom:15%;transform:translateX(-50%);margin:0;padding:7px 13px;color:#f0ebdd;background:#151e1dde;font-size:clamp(16px,2.8vw,22px);pointer-events:none}

#chapterResult #restartChapter{margin-left:.6rem}

#suspicion[data-level=urgent] #suspicionFill{background:#e49575}



#inputGuide{position:absolute;bottom:2.6%;left:50%;transform:translateX(-50%);display:flex;gap:.65rem;align-items:center;max-width:92vw;padding:.42rem .62rem;border:1px solid #b6c6b62f;border-radius:6px;background:#101b1bea;color:#e9ede6;font-size:.83rem;white-space:nowrap;pointer-events:none}
#inputGuide span{display:inline-flex;align-items:center;gap:.26rem}
#inputGuide kbd,#dialogue kbd,#nightPhone kbd,#chapterBook kbd,#use kbd{display:inline-block;margin:0 .32em 0 0;padding:.15em .39em;border:1px solid #b2c2b877;border-radius:4px;background:#192825;color:#f6f7ef;font-family:inherit;font-weight:600;font-size:.88em;line-height:1.15;min-width:1.3em;text-align:center}
#inputGuide kbd{margin:0}
.playing:not(.locked) #lockHint{bottom:8%}
.interface-open #lockHint,.interface-open #inputGuide,.reading #noticeToggle{display:none!important}
#dialogue button,#nightPhone button,#noticePages button{touch-action:manipulation}
#bookStack{position:absolute;left:8%;bottom:4%;display:grid;grid-template-rows:minmax(0,1fr) auto;gap:.45rem;width:min(530px,70svh,68vw);height:min(93svh,780px)}
#wardPaper{position:relative;isolation:isolate}
#wardPaper::before{content:"";position:absolute;inset:0;z-index:-1;background:url(hand.webp) center/100% 100% no-repeat;filter:drop-shadow(0 12px 14px #0009)}
#wardPaper::after{content:"";position:absolute;inset:0;z-index:2;pointer-events:none;background:url(hand.webp) center/100% 100% no-repeat;clip-path:polygon(0 75%,13% 63%,13.8% 69%,16% 68%,20% 67%,22.5% 70%,22.6% 73%,20.6% 77%,19.8% 82%,17% 100%,0 100%);filter:brightness(.79) saturate(.86)}
.noticeCopy{position:absolute;inset:8% 11% 19% 22.5%;padding:0 .24rem .55rem .38rem;color-scheme:only light;forced-color-adjust:none;color:#15120d;-webkit-text-fill-color:#15120d;background:#ddd2ba;font-size:clamp(1rem,2.38svh,1.14rem);font-weight:650;line-height:1.4;overflow:auto;pointer-events:auto;touch-action:pan-y;overscroll-behavior:contain;word-break:keep-all;overflow-wrap:break-word;scrollbar-width:thin;scrollbar-color:#827660 #ddd2ba}
.noticeCopy small{font-size:.75em}
.noticeCopy h2{font-size:1.37em;line-height:1.14;margin:.25em 0 .5em}
.noticeCopy p{margin:0 0 .58em}
#noticeLead{font-weight:800;margin-bottom:.58em;padding:.35em .48em;border-left:3px solid #627761;background:#425e461c}
.noticeCopy h3{font-size:.9em;border-top:1px solid #69797065;margin:.75em 0 .45em;padding-top:.5em}
.noticeCopy ol{margin:0;padding:0;list-style:none}
#noticeIntro{white-space:pre-line}
#chapterBook .noticeCopy{font-weight:500;line-height:1.45}
#noticeRules strong{font-weight:750}
.wardRules #noticeIntro{font-weight:800;padding:.42em .54em;background:#425e461c;border-left:3px solid #627761}
#noticeRules li+li{margin-top:.52em;padding-top:.38em;border-top:1px solid #837c6b55}
#noticeRules strong{display:block;margin-bottom:.13em}
#noticeNote{margin-top:.9em}
#stage[data-ward-light="blackout"] #foldedNotice{filter:brightness(.56)}
.reading #flashlight{left:auto;right:6%;bottom:13%}
#noticePages{display:grid;grid-template-columns:auto minmax(2.6rem,1fr) auto auto;gap:.35rem;align-items:center;pointer-events:auto;margin-left:8%;padding:.32rem;background:#111e1ef2;border:1px solid #94ac9b66;border-radius:7px;font-size:.95rem}
#noticePages button{padding:.44rem .52rem;min-height:40px}
#noticePages button:disabled{opacity:.4}
#noticeNumber{text-align:center;white-space:nowrap;font-variant-numeric:tabular-nums}
@media(pointer:coarse){
 #inputGuide,#inputGuide kbd,#dialogue kbd,#nightPhone kbd,#chapterBook kbd,#returnMessage kbd,#use kbd,.playing:not(.locked) #lockHint{display:none}
 .reading #flashlight{right:4%;bottom:auto}
 #bookStack{left:18%;bottom:max(2%,env(safe-area-inset-bottom));width:min(65vw,470px);height:92svh}
 #noticePages{margin-left:2%;font-size:.9rem;grid-template-columns:auto auto minmax(0,1fr) auto}
 #noticePages button{white-space:normal;word-break:keep-all}
 #noticePages button{min-height:42px;padding:.35rem .46rem}
 .noticeCopy{inset:8% 10% 19% 22.5%;font-size:clamp(1rem,3.6svh,1.13rem)}
}
@media(pointer:fine) and (max-width:680px){
 #bookStack{left:3%;width:min(93vw,490px)}
 #inputGuide{gap:.32rem;font-size:.76rem}
}

#perfSummary{position:absolute;z-index:12;left:10px;top:175px;padding:.35em .55em;color:#e1ece6;background:#101918e8;font:13px system-ui,sans-serif;pointer-events:none}
#panelFocus{position:absolute;width:20px;height:20px;border:1px solid #f3ebc5;border-radius:50%;box-shadow:0 0 0 2px #172728;transform:translate(-50%,-50%);pointer-events:none}
.interface-open #panelFocus{display:none}

/* Once the player boards, the street is still drawn through the window. */
#stage:is(.riding,[data-ending]) :is(#hud,#controls,#foldedNotice,#flashlight,#suspicion,#noticeToggle,#nightPhone,#dialogue,#toast,#staffCaption,#powerCue),
#stage:has(> #chapterResult:not([hidden])) :is(header,#staffCaption,#controls,#foldedNotice,#flashlight,#noticeToggle,#suspicion,#toast,#powerCue,#hud),
#stage:has(> #returnMessage:not([hidden])) header,
.riding header > div:first-child,
.riding :is(#fullscreen,#sound) {
 display:none;
}
.riding header, #stage[data-ending] header {justify-content:flex-end}
#stage[data-ending] #menu {opacity:1}
#turnDevice {z-index:20}

#chapterResult, #returnMessage {
 padding-inline:max(1rem,env(safe-area-inset-left)) max(1rem,env(safe-area-inset-right));
}
#chapterResult article, #returnMessage article {
 width:min(28rem,100%);
 max-height:calc(100svh - 2rem - env(safe-area-inset-top) - env(safe-area-inset-bottom));
 overflow-y:auto;
 overscroll-behavior:contain;
 touch-action:pan-y;
}
#chapterResult article {
 padding:clamp(1rem,4svh,1.6rem);
}
#chapterResult h2, #returnMessage h2 {font-size:clamp(1.3rem,4svh,1.6rem)}
.resultActions {display:flex;flex-wrap:wrap;gap:.55rem}
.resultActions button, #returnMessage button {min-height:44px}
#chapterResult #restartChapter {margin:0}
#turnDevice {padding-inline:1rem}
#settings article {touch-action:pan-y;overscroll-behavior:contain}
#settings h2 {margin-bottom:.85rem}
#settings p {font-size:.94rem;line-height:1.55}
#settings #gameHelp {margin-bottom:.45rem}
.touchResponseHelp, .cursorHelp {display:none}
.locked #dialogue .cursorHelp {
 display:block;
 margin:.55rem 0 0;
 font-size:.85rem;
 line-height:1.4;
 color:#d5ddd5;
}

#dialogue, #nightPhone {
 overflow-y:auto;
 overscroll-behavior:contain;
 touch-action:pan-y;
}
#dialogue {max-height:65svh}
#dialogue #line, #nightPhone p {
 overflow-wrap:break-word;
 word-break:keep-all;
}
#responses, #campaignChoices {min-width:0}
#responses button, #nightPhone button {
 max-width:100%;
 text-align:start;
 line-height:1.4;
 min-height:44px;
}
#sceneMessages {
 position:absolute;
 z-index:5;
 top:clamp(9.6rem,21%,14rem);
 right:max(5vw,env(safe-area-inset-right));
 display:grid;
 justify-items:end;
 align-content:start;
 gap:.35rem;
 width:min(28rem,72vw);
 pointer-events:none;
}
#sceneMessages > * {
 position:static;
 width:fit-content;
 max-width:100%;
 margin:0;
 transform:none;
 text-align:start;
 line-height:1.45;
 overflow-wrap:break-word;
 word-break:keep-all;
}
#toast:empty {display:none}
#stage:has(> #dialogue:not([hidden])) :is(#aim,#targetHint,#panelFocus,#foldedNotice,#noticeToggle),
#stage:has(> #nightPhone:not([hidden]) > #phoneChoices:not([hidden])) :is(#aim,#targetHint,#panelFocus,#foldedNotice,#noticeToggle),
#stage:has(> #nightPhone:not([hidden])) :is(#inputGuide,#lockHint) {
 display:none;
}

@media(pointer:coarse) {
 .desktopResponseHelp, .locked #dialogue .cursorHelp {display:none}
 .touchResponseHelp {display:block}
 #dialogue, #nightPhone {
  left:max(calc(90px + 6vw),env(safe-area-inset-left));
  right:max(calc(125px + 6vw),env(safe-area-inset-right));
  bottom:max(.55rem,env(safe-area-inset-bottom));
  width:auto;
  max-height:57svh;
  padding:.65rem .85rem;
 }
 #dialogue #line {font-size:1rem;line-height:1.4;margin:.2rem 0 .45rem}
 #campaignChoices, #responses {gap:.3rem}
 #campaignChoices button, #responses button, #nightPhone button {
  padding:.38rem .62rem;
  font-size:.9rem;
  min-height:44px;
 }
 #sceneMessages {
  top:max(5.9rem,calc(env(safe-area-inset-top) + 5.6rem));
  right:auto;
  left:50%;
  width:min(31rem,57vw);
  transform:translateX(-50%);
  justify-items:center;
 }
 #sceneMessages > * {text-align:center}
 #hud {max-width:calc(91% - 160px)}
}
@media(pointer:coarse) and (max-width:620px) {
 #dialogue, #nightPhone {
  left:calc(90px + 5vw);
  right:calc(105px + 5vw);
  padding:.45rem .55rem;
 }
 #chapterResult article, #returnMessage article {padding:1rem}
}

#noticeScroll {
 position:absolute;right:11%;bottom:15%;z-index:1;
 padding:.12em .5em;background:#e2d8c2;color:#302c23;
 font-size:.78rem;line-height:1.25;pointer-events:none;
}

#noticeRules li,#chapterResult #resultRule{white-space:pre-line}
#staffCaption{background:#152321ed;color:#f4efe2;border-left:2px solid #c1ae87;padding:.45em .7em;line-height:1.45;word-break:keep-all}

/* Keep spoken lines inside the player's field of view, above the movement controls. */
#sceneMessages {
 top:auto;bottom:clamp(5.75rem,17svh,10rem);left:50%;right:auto;
 transform:translateX(-50%);width:min(39rem,74vw);justify-items:center;
}
#sceneMessages > * {
 font-size:clamp(1rem,1.35vw,1.22rem);line-height:1.52;font-weight:550;
 color:#f8f5e9;background:rgba(15,24,23,.94);padding:.4em .8em;
 border-radius:4px;text-align:center;text-wrap:pretty;
}
#sceneMessages #staffCaption{border-inline-start:3px solid #cbb48b}
#stage:has(#dialogue:not([hidden]),#nightPhone:not([hidden]),#chapterBook:not([hidden])) #sceneMessages {
 top:clamp(5.4rem,18svh,10rem);bottom:auto;
}
#transcript {margin:.6rem 0 .85rem;font-size:.95rem}
#transcript summary {cursor:pointer;color:#ece3cd}
#recentLines {max-height:25svh;overflow:auto;margin:.55em 0;padding-left:1.25em;line-height:1.55}
#recentLines li+li {margin-top:.3em}
@media(pointer:coarse) {
 #sceneMessages {width:min(34rem,57vw);bottom:clamp(4.4rem,16svh,7rem)}
 #stage:has(#dialogue:not([hidden]),#nightPhone:not([hidden]),#chapterBook:not([hidden])) #sceneMessages {top:max(4.2rem,15svh)}
}

/* Let visitors hear the closing announcement before showing the first task. */
#stage.visit-arrival :is(#inputGuide,#targetHint,#lockHint,#visitObjective){visibility:hidden}
#stage.visit-arrival #use:disabled{visibility:hidden}
@media (pointer:coarse) and (orientation:landscape) and (max-height:480px) {
 #bookStack{left:8%;width:min(78vw,610px);height:96svh}
 .wardRules .noticeCopy h2{margin:.12em 0 .25em}
 .wardRules .noticeCopy p{margin-bottom:.34em}
}

#lowerQuestionBook {display:none}
.staff-question.reading #lowerQuestionBook {display:inline-block;min-height:44px}
.staff-question.reading #dialogue {z-index:11;left:auto;right:3%;bottom:9%;width:min(34vw,24rem)}
#stage.staff-question #use:disabled,
#stage:has(> #nightPhone:not([hidden])) #use:disabled {visibility:hidden}
@media(pointer:coarse) {
 .staff-question.reading #dialogue {right:3%;bottom:auto;top:13%;max-height:68svh;width:min(39vw,20rem)}
}

#cycleTarget{position:absolute;right:6%;bottom:calc(8% + 54px);padding:.45rem .7rem;font-size:.82rem;background:#172522ed}
#panelFocus{width:12px;height:12px;border-color:#dfdcc6b8;box-shadow:0 0 0 1px #283028a8}
#stage.interface-open #cycleTarget{display:none}
@media(pointer:coarse){#cycleTarget{bottom:calc(8% + 104px);min-height:38px}}

#hud #visitObjective{display:block;width:fit-content;max-width:min(54vw,32rem);padding:.36em .68em;border-left:3px solid #d6ba82;background:#101b19ee;color:#fff7e4;font-weight:700;font-size:clamp(.86rem,1.7vh,1.05rem);line-height:1.4;letter-spacing:.015em}
#visitObjective:empty{display:none!important}
#chapterBook .noticeCopy{visibility:visible;color:#18150e;-webkit-text-fill-color:#18150e;background:#e2dac6}

#creditForm{display:grid;gap:.8em;margin-top:1.2em;color:#e7ede7}
#creditForm[hidden]{display:none}
#creditName{font:inherit;width:100%;box-sizing:border-box;color:#172521;background:#edf0e8;border:1px solid #89968b;border-radius:.25em;padding:.65em}
#creditForm .creditConsent{display:flex;align-items:center;gap:.45em;font-size:.88em}
#creditForm input[type=checkbox]{width:1.1em;height:1.1em}
#creditForm [role=status]:empty{display:none}

#stage.door-in-focus:has(> #dialogue:not([hidden])) :is(#aim,#targetHint,#panelFocus):not([hidden]){display:block}
