:root{color-scheme:dark;--accent:#b8ff5a;--line:#426b59;--panel:#0b201b}*{box-sizing:border-box}body{margin:0;background:#040c0b;color:#e5f2e9;font-family:'IBM Plex Sans KR',system-ui,sans-serif}button,input{font:inherit}button{cursor:pointer;color:inherit;background:#18352b;border:1px solid var(--line);border-radius:9px;padding:9px 15px;min-height:44px}button:focus-visible,input:focus-visible{outline:3px solid white;outline-offset:2px}button:disabled{opacity:.45;cursor:default}.primary{background:var(--accent);color:#101d14;font-weight:700;border:0}h1,h2{font-family:'Song Myung',serif;font-weight:400;margin:8px 0}h1{font-size:clamp(32px,6vw,72px);text-shadow:0 3px 18px #000}h2{font-size:clamp(24px,4vw,38px)}p{margin:6px 0;line-height:1.55}.kicker{font-size:12px;letter-spacing:.16em;color:var(--accent)}[hidden]{display:none!important}#app{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;max-width:1800px;margin:auto;padding-bottom:env(safe-area-inset-bottom)}header{display:flex;align-items:center;gap:12px;padding:8px 16px;background:#071511;border-bottom:1px solid var(--line);font-size:clamp(12px,2vw,17px);color:var(--accent);font-weight:700;flex-wrap:wrap}#progress{margin-left:auto}#sound{font-size:12px;min-height:36px}#stage{position:relative;display:flex;flex:1;min-height:0;align-items:center;justify-content:center;overflow:hidden;background:#030a09}#scene{position:relative;isolation:isolate;width:min(100%,calc(var(--scene-height,70vh)*var(--ratio,1.333)));aspect-ratio:var(--ratio,1.333);overflow:hidden;flex-shrink:0}#bg{width:100%;height:100%;object-fit:fill;display:block}#lighting,#doorfx,#markers,#firefx,#smoke{position:absolute;inset:0;pointer-events:none}#lighting{background:radial-gradient(ellipse at center,transparent 40%,#0005);z-index:2}#actor{position:absolute;z-index:3;bottom:5%;left:50%;height:var(--actor-height,65%);width:auto;max-width:88%;object-fit:contain;transform:translateX(-50%);filter:drop-shadow(0 12px 12px #0009)}#markers{z-index:5}.marker{position:absolute;transform:translate(-50%,-50%);pointer-events:auto;border:2px solid var(--accent);background:#102c24e8;color:var(--accent);border-radius:50%;width:clamp(44px,5vw,58px);height:clamp(44px,5vw,58px);padding:0;box-shadow:0 0 20px #b8ff5a66;animation:pulse 1.8s infinite;font-weight:700;font-size:20px}.marker.seen{animation:none;background:#194d30}.marker::after{content:attr(data-label);position:absolute;top:100%;left:50%;transform:translateX(-50%);white-space:nowrap;background:#081713df;border-radius:5px;padding:3px 6px;font-size:clamp(10px,1.3vw,14px);color:white;margin-top:3px}#notice{position:absolute;z-index:8;top:12%;left:50%;transform:translateX(-50%);color:var(--accent);font-weight:700;font-size:clamp(18px,4vw,42px);text-shadow:0 0 12px black;text-align:center;pointer-events:none}#home,#intro{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;background:linear-gradient(#030b0b55,#030b0bdc);padding:20px;z-index:10;overflow:auto}#home .primary{font-size:20px;padding:12px 32px;margin:15px}#brand{margin-top:14px}#intro{gap:18px;background:#02080755}#introtext{background:#06130fe8;padding:18px;border-radius:12px;font:clamp(19px,3vw,32px)/1.55 'Song Myung',serif;max-width:90%}#console,#reveal{background:var(--panel);padding:10px 16px 22px;text-align:center;border-top:1px solid var(--line);flex-shrink:0}#story{font-size:clamp(14px,2vw,18px);font-family:'Song Myung',serif;white-space:pre-line}#cluebuttons{display:flex;justify-content:center;gap:6px;flex-wrap:wrap;margin:6px 0}#cluebuttons:empty{display:none}#form{display:flex;justify-content:center;align-items:end;gap:10px;flex-wrap:wrap}#inputs{display:flex;gap:8px;justify-content:center;max-width:100%;flex-wrap:wrap}label{display:flex;flex-direction:column;align-items:center;font-size:11px;color:#a8c6b8;gap:3px}input{background:#050f0d;border:1px solid var(--line);border-radius:8px;color:var(--accent);font-size:20px;font-weight:700;text-align:center;padding:8px;width:min(48vw,300px);height:46px;min-width:0}input.digit{width:clamp(45px,8vw,64px)}#feedback{min-height:1.3em;color:#ffb3a5;font-size:13px;margin:2px}dialog{width:min(92vw,620px);max-height:85dvh;overflow:auto;background:#0c211b;color:#e5f2e9;border:1px solid var(--accent);border-radius:18px;padding:clamp(18px,4vw,36px);box-shadow:0 0 55px #b8ff5a22;text-align:center}dialog::backdrop{background:#0009}#cluetext{font-size:clamp(17px,2.5vw,22px);line-height:1.7;margin:20px 0;white-space:pre-line}#complete{border:2px solid #b8ff5a;background:#0a221bee}#complete::backdrop{background:#07140f44}.teacher{padding:16px;background:#193b2b;border-radius:10px;font-weight:700}.trophy{color:#b8ff5a;font-size:52px}#app.fire{--accent:#ff9b4a;--line:#a05b33;--panel:#29170f}#app.fire #lighting{background:radial-gradient(ellipse at center,#f63b1422,#e43a1966);animation:pulse 1.6s infinite}#firefx{z-index:4;overflow:hidden}.flame{position:absolute;bottom:5%;width:13%;height:55%;background:radial-gradient(ellipse at bottom,#fff7ae 0%,#ffb02d 20%,#ff481b 45%,transparent 70%);filter:blur(7px);transform-origin:bottom;animation:flame .7s infinite alternate;mix-blend-mode:screen}#smoke{z-index:6;background:radial-gradient(ellipse at center,#fff 0%,#e9f6e8e0 22%,#d8e7dd80 45%,transparent 72%);animation:smoke 1.4s both}.approach{animation:approach 3s ease-out both}.retreat{animation:retreat 1.5s ease-in both}.pop{animation:pop .7s cubic-bezier(.2,1.5,.5,1) both}.shake{animation:shake .35s both}.blackout{animation:blackout .8s both}.zoom{animation:zoom 1s both}.charge{animation:charge .8s both}@keyframes pulse{50%{opacity:.65}}@keyframes approach{from{transform:translateX(-50%) scale(.12);opacity:0;bottom:32%}to{transform:translateX(-50%) scale(1);opacity:1;bottom:5%}}@keyframes retreat{to{transform:translateX(-50%) scale(.12);bottom:32%;opacity:0}}@keyframes pop{from{transform:translateX(-50%) scale(.15)}to{transform:translateX(-50%) scale(1)}}@keyframes shake{25%,75%{translate:-5px 0}50%{translate:5px 0}}@keyframes blackout{50%{filter:brightness(0)}}@keyframes zoom{to{transform:scale(1.45);opacity:.3}}@keyframes charge{50%{transform:translateX(-50%) scale(1.12);filter:brightness(2)}}@keyframes flame{from{transform:scaleY(.8) skewX(-6deg);opacity:.7}to{transform:scaleY(1.15) skewX(6deg);opacity:1}}@keyframes smoke{0%{opacity:0;transform:scale(.3)}30%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(1.7)}}@media(max-width:600px){header{padding:6px 9px;gap:6px}#console{padding:8px 8px 18px}#home{padding:12px}#home .primary{margin:5px}#brand{margin-top:0}.marker::after{font-size:10px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.15s!important;animation-iteration-count:1!important}}

#home{padding-bottom:64px}#brand{position:absolute;left:0;right:0;bottom:0;margin:0;z-index:12}#brand .jh-brand-home{padding:4px 8px 8px;gap:8px;flex-wrap:nowrap}#brand .jh-brand-home img{width:clamp(100px,13vw,150px);height:auto}#brand .jh-brand-home button{min-height:28px;padding:3px 7px;font-size:10px} .introactions{display:flex;gap:12px;justify-content:center;flex-wrap:wrap}#intro.alarm{background:#40060077}#intro.alarm #introtext{border:1px solid #ff7666;color:#ffd9d2} @media(max-height:420px){#home{justify-content:flex-start;padding-top:8px}#home h1{font-size:30px}#home .primary{margin:4px;padding:6px 20px}}

/* Scene props use scene-relative coordinates, independent of viewport. */
.prop{position:absolute;transform:translate(-50%,-50%);pointer-events:auto;display:block;min-width:44px;min-height:44px;padding:0;border:0;background:transparent;filter:drop-shadow(0 0 6px #d4ffb6);z-index:1}.prop img{display:block;width:100%;height:auto;max-height:35vh;object-fit:contain}.prop span{position:absolute;top:100%;left:50%;transform:translateX(-50%);white-space:nowrap;font-size:clamp(10px,1.4vw,14px);padding:3px 6px;border-radius:4px;background:#071512ed;color:#fff;font-weight:700}.prop-cabinet span{left:auto;right:0;transform:none}.prop-panel span,.prop-book span{left:0;transform:none}.prop:hover{filter:drop-shadow(0 0 10px #e5ff99)}.prop:disabled{opacity:1}.book-dialog{background:linear-gradient(90deg,#e1bc83,#f3dfae 47%,#e5c28b 50%,#f5e3b9 54%,#e2bd83);border:9px solid #68402b;color:#382519;box-shadow:inset 0 0 30px #8b5b4155,0 10px 40px #0009;border-radius:9px}.book-dialog .kicker{color:#805039}.book-dialog .primary{background:#72452e;color:#fff1d7}.panel-dialog{border:5px solid #536b70;background:linear-gradient(140deg,#093f43,#071e24);box-shadow:inset 0 0 0 2px #38ddd3,0 0 25px #00e4d655}.panel-dialog .kicker{color:#84fff4}.panel-dialog .primary{background:#76e7db;color:#072829}

/* v2.3: particles anchored to scene, no change to mission 1. */
.spray-layer{position:absolute;inset:0;z-index:7;pointer-events:none;overflow:hidden}.spray-layer i{position:absolute;left:50%;top:65%;width:var(--size);height:var(--size);background:#fff8e7;border-radius:2px;opacity:0;box-shadow:0 0 3px #fff;animation:salt-spray .9s var(--delay) ease-out both}.spray-layer.extinguisher i{left:90%;top:55%;width:var(--cloud);height:var(--cloud);border-radius:50%;background:#eaf4f5;filter:blur(5px);animation:ext-spray 1s var(--delay) ease-out both}@keyframes salt-spray{0%{opacity:0;transform:translate(0,0)}15%{opacity:1}75%{opacity:.95}100%{opacity:0;transform:translate(var(--x),var(--y)) rotate(150deg)}}@keyframes ext-spray{0%{opacity:0;transform:scale(.2)}15%{opacity:.85}100%{opacity:0;transform:translate(calc(var(--distance) + var(--x)*.35),var(--y)) scale(2)}}


.scene-btn{position:absolute;transform:translate(-50%,-50%);z-index:6;pointer-events:auto;background:#102c24f0;border:2px solid #d5ffd1;color:#fff;padding:10px 14px;border-radius:12px;font-weight:700;box-shadow:0 0 16px rgba(0,0,0,.45);min-height:44px;white-space:nowrap}
.scene-btn.scene-left{background:#173f3ad9;border-color:#7bf2ea}
.scene-btn.scene-right{background:#314334e8;border-color:#ffb24a}
.scene-btn.danger{background:#45211ee8;border-color:#ff6f5e}
.scene-btn.open{background:#2f5b33e8;border-color:#b8ff5a;color:#f7fff2}
.scene-btn:hover{filter:brightness(1.08)}
@media(max-width:700px){.scene-btn{font-size:12px;padding:8px 10px}}

.prop.opened{filter:drop-shadow(0 0 10px #d5ffd1)}
.prop.opened span{background:#234229ed;color:#efffe9}

/* Mission 5 only: clues emerge from the shadow creature's mist. */
.final-mist{position:absolute;z-index:4;left:25%;right:25%;bottom:7%;height:26%;pointer-events:none;background:radial-gradient(ellipse at 35% 70%,#15272d 0%,#081114da 27%,transparent 65%),radial-gradient(ellipse at 70% 60%,#24383e 0%,#050a0cce 30%,transparent 68%);filter:blur(9px);animation:finalMistRise 1s ease-out both}
.final-mist.dissolve{animation:finalMistFade 1s ease-out both}
#markers.final-appear{animation:finalClueReveal .75s ease-out both}
.final-clue:not(.seen){border-color:#7ef6df;color:#b9fff0;box-shadow:0 0 22px #46ebc888;animation:finalClueGlow 1.8s ease-in-out infinite}
@keyframes finalMistRise{from{opacity:0;transform:translateY(12%) scale(.8)}to{opacity:.95;transform:translateY(-8%) scale(1.15)}}
@keyframes finalMistFade{from{opacity:.95;transform:translateY(-8%) scale(1.15)}to{opacity:0;transform:translateY(-20%) scale(1.35)}}
@keyframes finalClueReveal{from{opacity:0}to{opacity:1}}
@keyframes finalClueGlow{50%{box-shadow:0 0 32px #64ffe6cc;filter:brightness(1.15)}}


.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
#home{background-image:linear-gradient(rgba(2,7,8,.45),rgba(2,7,8,.76)),url("assets/title-stage.png");background-size:cover;background-position:center center;padding:20px 20px 76px}#home .home-inner{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;max-width:min(92vw,980px)}#home .home-kicker{font-size:clamp(11px,1.4vw,16px);letter-spacing:.28em;color:#ff9f8f;text-shadow:0 2px 10px #000}#title-art{width:min(92vw,980px);height:auto;filter:drop-shadow(0 10px 30px rgba(0,0,0,.6))}#home .home-tagline{font-size:clamp(14px,2vw,22px);font-weight:700;color:#dffbff;text-shadow:0 2px 12px #000;letter-spacing:.03em;margin-top:-2px}#home .title-start{font-size:clamp(18px,2.6vw,28px);padding:12px 34px;min-width:min(80vw,300px);background:linear-gradient(180deg,#b8ff5a,#6fe2cf);color:#102019;box-shadow:0 0 20px rgba(111,226,207,.28);margin-top:-2px}#home .title-start:hover{filter:brightness(1.05)}
@media(max-width:700px){#home{padding:14px 12px 68px}#home .home-inner{gap:10px}#title-art{width:96vw}#home .home-tagline{font-size:15px;text-align:center}#home .title-start{font-size:18px;padding:11px 24px}}

/* Title screen only: fit all controls inside the visible viewport. */
#app:has(#home:not([hidden])){height:100vh;height:100dvh;min-height:0;overflow:hidden}
#app:has(#home:not([hidden])) header{flex-shrink:0}
#app:has(#home:not([hidden])) #stage{min-height:0!important;flex:1 1 0}
#home{overflow:hidden;display:grid;grid-template-rows:minmax(0,1fr) auto;align-items:center;justify-items:center;justify-content:stretch;padding:clamp(4px,2vh,18px) 12px 6px;gap:4px}
#home .home-inner{width:100%;height:100%;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;justify-items:center;align-items:center;gap:clamp(2px,1vh,10px)}
#home #title-art{width:100%;height:100%;max-width:min(76vw,820px);min-height:0;object-fit:contain}
#home .home-kicker{margin:0;text-align:center;line-height:1.3}
#home .title-start{margin:0;padding:8px 24px;min-height:40px;line-height:1.2}
#home #brand{position:relative;inset:auto;width:100%;margin:0}
#home #brand .jh-brand-home{padding:2px 4px;gap:6px}
@media(max-height:450px){#home .home-kicker{font-size:10px}#home .home-tagline{font-size:13px}#home .title-start{font-size:16px;min-height:36px;padding:5px 20px}#home #brand .jh-brand-home img{width:100px}}

#intro.lockdown{background:#1e050866}#intro.lockdown #introtext{border:1px solid #ff9d59;color:#fff2df;box-shadow:0 0 24px #000a}#doorfx{z-index:7;overflow:hidden}#introtext{white-space:pre-line}

#home .home-inner{grid-template-rows:auto minmax(0,1fr) auto;gap:clamp(2px,.5vh,5px)}
#home .title-start{transform:translateY(-6px)}

/* Lockdown: soft emergency-light pulses across the stage, without obscuring text. */
#intro.lockdown::before{content:"";position:absolute;inset:0;pointer-events:none;background:radial-gradient(ellipse at center,#ff282815 15%,#f7191966 75%,#ed161688);box-shadow:inset 0 0 70px #ff302955;animation:lockdownGlow 1.5s ease-in-out infinite;z-index:0}
#intro.lockdown>*{position:relative;z-index:1}
@keyframes lockdownGlow{0%,100%{opacity:.12}50%{opacity:.8}}
@media(prefers-reduced-motion:reduce){#intro.lockdown::before{animation:none;opacity:.35}}

/* v7: improve readability of the mission console without changing the title screen. */
#console #story{font-size:clamp(19px,2.25vw,25px);line-height:1.48;word-break:keep-all;overflow-wrap:break-word;margin:3px 0 8px}
#console label{font-size:clamp(14px,1.55vw,17px);line-height:1.25}
#console input{font-size:clamp(21px,2.3vw,25px)}
#console #submit,#console #cluebuttons button{font-size:clamp(17px,1.9vw,21px);font-weight:700;line-height:1.25}
#console #feedback{font-size:clamp(15px,1.65vw,18px);line-height:1.35}
#console{padding:8px 16px 16px}
#reveal p{font-size:clamp(19px,2.25vw,25px);line-height:1.48;word-break:keep-all;overflow-wrap:break-word}
#reveal button{font-size:clamp(17px,1.9vw,21px)}
@media(max-width:600px){#console{padding:8px 9px 14px}#console #story{font-size:19px}#console #submit{font-size:17px}}

/* v8: title screen only — companion layout to the dental observation lab. */
#home{background-image:linear-gradient(rgba(2,7,8,.16),rgba(2,7,8,.30)),url("assets/title-stage.png");}
#home .home-inner{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:clamp(10px,2.6vh,24px);height:100%;min-height:0;max-width:100%;padding-top:0;}
#home .home-kicker{display:none}
#home #title-art{display:block;flex:0 1 auto;width:min(57%,620px);height:auto;max-height:49%;max-width:100%;object-fit:contain;min-height:0;}
#home .title-start{flex:0 0 auto;transform:none;margin:0;width:auto;min-width:0;max-width:90%;padding:0.6em 2em;min-height:44px;border:1px solid #4096a3;border-radius:999px;background:linear-gradient(180deg,#08798d,#00556a);color:#fff;font-size:clamp(14px,1.65vw,19px);font-weight:700;box-shadow:0 4px 13px #0008,0 0 14px #22c4da33;line-height:1.3;}
@media(max-width:600px){#home #title-art{width:78%;max-height:49%}}
@media(max-height:450px){#home .home-inner{gap:8px}#home #title-art{max-height:55%;width:min(57%,450px)}#home .title-start{font-size:14px;min-height:36px;padding:6px 23px}}

/* v9: compact mission controls; preserve readable type and touch targets. */
#console{padding:4px 12px 6px}
#console #story{font-size:clamp(18px,1.85vw,21px);line-height:1.26;margin:0 0 4px}
#console #form{gap:8px;align-items:end}
#console label{font-size:14px;line-height:1.1;gap:2px}
#console input{height:44px;padding:5px 8px;font-size:22px}
#console #submit{min-height:44px;padding:6px 13px;font-size:18px;line-height:1.15}
#console #feedback{min-height:0;margin:3px 0 0;font-size:15px;line-height:1.2}
#console #feedback:empty{display:none}
#console #cluebuttons{margin:3px 0}
@media(max-width:600px){#console{padding:4px 8px 6px}#console #story{font-size:18px}#console #submit{font-size:17px}}

/* v10: remove redundant single-answer caption and lift controls with balanced bottom clearance. */
#console{padding-bottom:14px}
#console #form{align-items:end}
#console label:has(input:not(.digit)){gap:0}
@media(max-width:600px){#console{padding-bottom:12px}}

#console .group-title{flex-basis:100%;text-align:center;font-size:14px;line-height:1.1;color:#a8c6b8;margin:0 0 -2px}
#console label:has(input.digit){gap:0}

/* Mission 4: label and three fields on the same row */
#console #inputs:has(.group-title){flex-wrap:nowrap;align-items:center;gap:8px}
#console .group-title{flex:0 0 auto;margin:0 3px 0 0;font-size:18px;line-height:1;color:#e5f2e9;white-space:nowrap}
