:root{color-scheme:dark;font:16px 'Apple SD Gothic Neo','Malgun Gothic',sans-serif;color:#f0efe9;background:#040709}*{box-sizing:border-box}body{margin:0;height:100svh;display:grid;place-items:center;overflow:hidden}button,input{font:inherit}button{cursor:pointer;color:inherit}button:focus-visible,input:focus-visible{outline:2px solid #ebc38e;outline-offset:3px}#game{height:100svh;width:100%;max-width:460px;position:relative;overflow:hidden;display:flex;flex-direction:column;background:#080d10;isolation:isolate}#art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-3}.shade{position:absolute;inset:0;z-index:-2;background:linear-gradient(#02070a9c,transparent 25%,#01050833 48%,#04080bf5 85%)}header{display:flex;align-items:center;justify-content:space-between;padding:22px;gap:15px;background:linear-gradient(#04080bbb,transparent)}#clock{font:24px Georgia,serif;letter-spacing:3px}#place{font-size:12px;color:#c4c9c8;letter-spacing:2px}header button{border:1px solid #ffffff40;background:#090d1080;font-size:12px;padding:8px}#pins{flex:1;min-height:105px;position:relative}#pins button{position:absolute;border:1px solid #ead7b68c;border-radius:50%;width:48px;height:48px;background:#0a1116b5;color:#f7d4a1;font-size:23px;box-shadow:0 0 20px #0008}#panel{max-height:62%;overflow:auto;overscroll-behavior:contain;padding:25px 23px 22px;background:linear-gradient(transparent,#080d10ed 38px);scrollbar-width:thin}h1{font-size:26px;line-height:1.45;font-weight:500;letter-spacing:-.7px;margin:7px 0 15px}h2{font-size:21px;margin:0 0 17px}p{line-height:1.8;margin:0 0 13px;word-break:keep-all}.kicker{color:#c0a47e;font-size:12px;letter-spacing:3px}.muted{font-size:13px;color:#99a4a8}.choices{display:grid;gap:9px;margin-top:19px}.choices button,#close,.submit{background:#0e171ded;border:1px solid #a6b5b14d;padding:13px 15px;min-height:48px;text-align:left;line-height:1.5}.choices button:hover{background:#223039}.choices .primary{background:#d8c19e;color:#171b1e;border-color:#d8c19e}.choices .warn{color:#e8aa9c}.bubble{background:#213038ed;border-radius:2px 13px 13px 13px;padding:12px 14px;margin:12px 25px 13px 0;line-height:1.7;font-size:16px;border:1px solid #a6b5b128}.bubble.mine{margin:12px 0 13px 35px;background:#36362ee8}.quote{border-left:2px solid #d4b78c;padding-left:14px}nav{display:grid;grid-template-columns:repeat(4,1fr);flex-shrink:0;padding-bottom:env(safe-area-inset-bottom);border-top:1px solid #ffffff24;background:#080d10}nav button{padding:17px 2px;font-size:13px;background:none;border:0;color:#8d999f;min-height:55px}nav button.active{color:#f4d4a3;box-shadow:inset 0 2px #c9a678}dialog{width:min(91vw,425px);max-height:85svh;border:1px solid #5c6c71;background:#0c141b;color:#eee;padding:25px}dialog::backdrop{background:#000b}#close{width:100%;margin-top:20px;text-align:center}.clue{border-bottom:1px solid #ffffff28;padding:13px 0}.clue b{font-size:15px;color:#e1c49d}.clue p{font-size:14px;margin:5px 0;color:#c5ced2}.input{width:100%;padding:13px;background:#080c10;border:1px solid #72858b;color:white;letter-spacing:3px;margin:10px 0}.submit{width:100%;text-align:center}.tag{font:12px monospace;color:#aec4c8;margin-bottom:13px}.error{color:#edb4a0;font-size:14px}.end{font:13px Georgia,serif;letter-spacing:4px;color:#c7a879}.veil #art{filter:brightness(.2)}@media(min-width:600px){#game{height:min(920px,95svh);width:min(430px,47svh);min-width:350px;border:1px solid #465055;border-radius:18px;box-shadow:0 20px 100px #000}}@media(prefers-reduced-motion:no-preference){#art{transition:filter .6s}#panel{animation:arrive .3s ease}@keyframes arrive{from{opacity:.55;transform:translateY(5px)}to{opacity:1;transform:none}}body[data-view=phone] #art{filter:brightness(.38)}body[data-view=phone] #panel{max-height:78%;background:#081117e8;border-radius:18px 18px 0 0;border-top:1px solid #63727a}body[data-view=cam] #art{filter:grayscale(.6) contrast(1.15)}
nav[hidden]{display:none}h1,p{white-space:pre-line}#pins{position:absolute;inset:80px 0 43%;z-index:1;min-height:0}#panel{position:relative;margin-top:auto;z-index:2}header,nav{z-index:3}#pins button{font-size:20px;width:44px;height:44px}

/* Reserve a real inspection area above the scrollable dialogue. */
header{flex-shrink:0}#pins{position:relative;inset:auto;flex:1 0 140px;min-height:140px;z-index:1}#pins:empty{flex-basis:0;min-height:0}#pins button{transform:translate(-50%,-50%)}#panel{flex:0 1 auto;min-height:0;margin-top:0;max-height:calc(100% - 275px);overflow-y:auto;padding-bottom:22px}body[data-view=phone] #panel{max-height:calc(100% - 145px)}nav{flex-shrink:0}#game{height:100svh}@media(min-width:600px){#game{height:min(920px,95svh)}}@media(max-height:600px){header{padding:14px 20px}#pins{flex-basis:110px;min-height:110px}#panel{max-height:calc(100% - 230px)}}
body[data-view=ending] #panel{max-height:62%;background:linear-gradient(transparent,#080d10f5 35px);padding-top:35px}body[data-view=ending] #art{object-position:center top}.end-result{font-size:18px;color:#f1cf9e;border-bottom:1px solid #b19b7855;padding-bottom:15px}.end-reason{border-left:2px solid #a38d6c;background:#ffffff08;padding:15px;margin:20px 0}.end-reason b{font-size:13px;color:#c9ae84}.end-reason p{font-size:14px;color:#bac5c8;margin:8px 0 0}body[data-outcome=closet] .end-result,body[data-outcome=wait] .end-result{color:#e0a59a}body[data-view=ending] .kicker{letter-spacing:1px}

/* Startup gate: gameplay is inaccessible until every scene is ready. */
#game[hidden],#loading[hidden],#retryLoad[hidden]{display:none}
#loading{width:min(100%,430px);padding:36px 28px;color:#e5e8e7}#loading h1{font-size:27px;margin:14px 0}#loading progress{display:block;width:100%;height:4px;margin:27px 0;background:#263037;accent-color:#d8c19e}#loadingStatus{font-size:15px;color:#bfc9cc}#retryLoad{width:100%;padding:15px;background:#d8c19e;color:#171b1e;border:0;margin-bottom:20px}.inspection-art{width:100%;max-height:42svh;object-fit:cover;object-position:center 35%;display:block;margin-bottom:20px;border:1px solid #ffffff20}body[data-view=phone] #art{filter:brightness(.8)}body[data-view=phone] #panel{max-height:64%;background:linear-gradient(transparent,#081117f5 35px)}
/* Investigation: comfortable safe areas and image-first records. */
header{padding-top:calc(env(safe-area-inset-top,0px) + 16px);padding-left:max(22px,env(safe-area-inset-left,0px));padding-right:max(22px,env(safe-area-inset-right,0px))}
#panel{max-height:calc(100% - 230px - env(safe-area-inset-top,0px));margin-top:auto}
#pins:empty{flex:1 1 140px;min-height:90px}
body[data-view=phone] #panel{max-height:62%}
dialog{max-height:calc(100svh - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px) - 40px);overscroll-behavior:contain}
#dialogBody>.submit{margin-top:9px}.evidence-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:18px 0}.evidence-card{padding:0;overflow:hidden;border:1px solid #566268;background:#101b22;text-align:left}.evidence-card[aria-pressed=true]{outline:2px solid #dfc397;outline-offset:1px}.evidence-thumb{display:block;width:100%;height:104px;object-fit:cover;object-position:center 35%}.evidence-card span{display:block;padding:10px;font-size:14px;line-height:1.4}.comparison-art{width:calc(50% - 6px);height:140px;object-fit:cover;vertical-align:top;margin:0 6px 16px 0}.paper{background:#d9ceb5;color:#252725;padding:26px 20px;line-height:2.1}.inspection-art{max-height:36svh;object-fit:contain;background:#05090c}body[data-view=ending][data-ending-read=false] #panel{max-height:35%;margin-top:auto}body[data-view=ending][data-ending-read=false] .shade{background:linear-gradient(#02070a55,transparent 25%,transparent 60%,#04080bf5)}body[data-view=ending][data-ending-read=false] h1{font-size:25px}#loading{padding-top:calc(36px + env(safe-area-inset-top,0px));padding-bottom:calc(36px + env(safe-area-inset-bottom,0px))}@media(max-height:600px){#pins:empty{min-height:35px;flex-basis:35px}#panel{max-height:calc(100% - 155px - env(safe-area-inset-top,0px))}body[data-view=ending][data-ending-read=false] #panel{max-height:60%}}
