/* 0.9: tabletop staging, golden-door interludes and candlelight. */
.shadow{background:#080611;filter:blur(9px);mix-blend-mode:multiply;animation-name:paintedShadow}
.s1{left:25%;top:16%;width:18vw;height:49vh}.s2{left:69%;top:12%;width:15vw;height:48vh}.s3{left:48%;top:9%;width:11vw;height:38vh}
body[data-screen="play"] .app{max-width:none;padding:14px 4vw 10px;height:100svh;min-height:500px}
body[data-screen="play"] main{display:block;flex:1;position:relative}
.brand span{font:bold clamp(16px,2vw,28px)/1.2 Georgia,serif;letter-spacing:0;text-shadow:0 2px 8px #000}
body[data-screen="play"] .play{padding:0;height:100%}
.quest-bar{position:absolute;top:10px;left:0;right:0;align-items:flex-start;text-shadow:0 2px 6px #000}
#challengeTitle{display:none}.heart{font-size:clamp(32px,4vw,49px);color:#ffda67;text-shadow:0 0 10px #f9af3890,1px 2px #4d2b08}.hearts{gap:10px}.heart.spent{color:#62543b;opacity:.65}
.layer-count{position:static;margin:0}.layer-count strong{font-size:28px}.quest-bar .eyebrow{font-size:12px;letter-spacing:1px}
.play>.progress{position:absolute;left:0;right:0;top:98px;margin:0}
.play .table-stage,.play.sentence-stage .table-stage{position:absolute;left:6%;right:6%;width:auto;max-width:none;top:24%;height:65%;min-height:0;margin:0}
.choices{gap:28%;align-items:stretch}.choice{height:100%}.doll-wrap{width:100%;height:100%;transform-origin:50% 100%}
.doll,.inside,.doll-back{object-position:center bottom}
.answer{flex-shrink:0;min-height:65px;font-size:clamp(18px,2.15vw,28px);padding:9px;z-index:12}
.play .feedback{position:absolute;bottom:0;left:10%;right:10%;z-index:25}.play .game-bottom{position:absolute;right:0;bottom:0;margin:0}
footer{border:0;padding-top:0;text-align:center;align-items:center;font-size:12px;letter-spacing:.6px}footer span:first-child{flex:1}
.candle-effects{position:fixed;inset:0;pointer-events:none;z-index:1;display:none}body[data-screen="play"] .candle-effects{display:block}
.candle-effects i{position:absolute;top:58%;left:5.3%;width:16px;height:40px;border-radius:65% 30% 60% 25%;background:radial-gradient(ellipse at 50% 75%,#fff9c2,#ffe473 30%,#fa8a2280 65%,transparent 75%);filter:blur(1px);box-shadow:0 0 34px 17px #faad3935;transform-origin:center bottom;animation:candleFlicker 1.1s ease-in-out infinite alternate}
.candle-effects i:last-child{left:auto;right:5.3%;animation-delay:-.6s;animation-duration:.83s}
@keyframes candleFlicker{0%{transform:scale(.84,1.02) rotate(-4deg);opacity:.65}45%{transform:scale(1.07,.91) rotate(3deg);opacity:.9}100%{transform:scale(.9,1.12) rotate(-2deg);opacity:.75}}
.red-eyes{position:absolute;inset:0;z-index:10;opacity:0;pointer-events:none}.red-eyes i{position:absolute;width:7%;height:2.5%;border-radius:50%;top:22%;left:36%;background:#fff0d9;box-shadow:0 0 5px 3px #ff1515,0 0 15px 7px #eb0000}.red-eyes i:last-child{left:55%}
.angry .red-eyes,.cursed .red-eyes{opacity:1}.opened .red-eyes{opacity:0}.angry .expression,.cursed .expression{visibility:hidden}
.doll-back{position:absolute;inset:0;background:url('assets/doll-back.webp') center bottom/contain no-repeat;clip-path:inset(0 0 38%);z-index:5;pointer-events:none;opacity:0}
.turned .choice:not(.opened):not(.rescuing) .lid{animation:turnFace 1s ease forwards}.turned .choice:not(.opened):not(.rescuing) .doll-back{animation:turnBack 1s ease forwards}.turned .expression{visibility:hidden}.turned .red-eyes{z-index:6}
@keyframes turnFace{0%,20%{transform:scaleX(1);opacity:1}49%{transform:scaleX(0);opacity:1}50%,100%{transform:scaleX(0);opacity:0}}
@keyframes turnBack{0%,49%{transform:scaleX(0);opacity:0}50%{transform:scaleX(0);opacity:1}100%{transform:scaleX(1);opacity:1}}
#curseMeter{position:absolute;left:50%;top:15%;transform:translateX(-50%);display:flex;flex-direction:column;align-items:center;gap:5px;color:#ffb0a0;font:bold 21px system-ui;z-index:12;text-shadow:0 2px 6px #000}#curseTime{width:180px;height:9px;accent-color:#ef4b42}
body[data-screen="runner"] .app{max-width:none;height:100svh;padding:12px 4vw}body[data-screen="runner"] main{min-height:0}body[data-screen="runner"] .room{background-image:url('assets/story-help.webp');filter:brightness(.45)}body[data-screen="runner"] .spirit-shadows{display:none}
.runner{height:100%;display:flex;flex-direction:column;min-height:0}.run-heading{display:flex;justify-content:space-between;font:600 clamp(14px,2vw,23px) Georgia;padding:15px 0;color:#ffdfa1;text-shadow:0 2px 8px #000}.run-field{position:relative;flex:1;min-height:220px;overflow:hidden;background:linear-gradient(0deg,#090c1999,transparent);border-bottom:2px solid #ba934955;isolation:isolate}
.run-lane{position:absolute;left:0;right:0;height:5px;top:40%;background:linear-gradient(90deg,transparent,#e6bf7777,transparent);box-shadow:0 4px 7px #000;transform:skewY(-.2deg)}.run-lane.lower{top:70%}
.runner-girl{position:absolute;left:12%;top:70%;height:clamp(95px,23vh,180px);aspect-ratio:512/682;transform:translateY(-100%);z-index:8;transition:top .17s ease;filter:drop-shadow(0 8px 4px #000a)}
.walk-sprite{width:100%;height:100%;background:url('assets/girl-walk.webp') 0 0/400% 100% no-repeat;animation:walkFrames .65s steps(4) infinite}
@keyframes walkFrames{to{background-position:133.333% 0}}
.runner-girl.jumping .walk-sprite{animation:walkFrames .65s steps(4) infinite,hop .85s ease-in-out}.runner-girl.hurt{filter:drop-shadow(0 0 15px red);opacity:.5}
@keyframes hop{0%,100%{transform:translateY(0) rotate(0)}50%{transform:translateY(-95px) rotate(-7deg)}}
.run-phrase{position:absolute;left:105%;transform:translateY(-100%);white-space:nowrap;max-width:none;padding:10px 17px;background:#141a2fe8;border:1px solid #a79568;border-radius:9px;color:#fff0cf;font:600 clamp(16px,2.1vw,26px)/1.2 Georgia;box-shadow:0 4px 14px #0008;will-change:left;z-index:5}.run-phrase.collected{opacity:0;transform:translateY(-160%);transition:opacity .2s,transform .2s}
.gold-door{position:absolute;right:90%;bottom:9%;width:clamp(65px,10vw,150px);height:75%;border:8px ridge #d6aa50;border-radius:50% 50% 2px 2px;background:repeating-linear-gradient(88deg,#58350e,#b28031 8px,#d8aa55 12px,#75511f 18px);box-shadow:0 0 25px #ffd26155,inset 0 0 24px #29160a;z-index:1;opacity:.55}.gold-door span{position:absolute;top:35%;left:30%;font-size:55px;color:#ffe5a4}.gold-door.arrived{opacity:1;box-shadow:0 0 90px #ffe383;transform:scale(1.2);transition:1s}
#runFeedback{position:absolute;left:10%;right:10%;bottom:0;text-align:center;min-height:30px;font:600 clamp(14px,1.8vw,23px) Georgia;color:#ffdc9b;text-shadow:0 2px 8px #000}
.run-controls{display:flex;justify-content:center;gap:12px;padding:9px}.run-controls button{min-width:70px;font-size:22px;touch-action:manipulation}.run-hint{text-align:center;font:13px system-ui;margin:0 0 9px;color:#e8d4ac}.is-paused *{animation-play-state:paused!important}
.touch-choices{display:none!important}
@media(pointer:coarse){.play .touch-choices{display:flex!important;position:absolute;bottom:0;left:25%;right:25%;height:40px;gap:30px;margin:0;z-index:30}.touch-choices button{min-height:36px;flex:1;font-size:22px;padding:0}.play .table-stage,.play.sentence-stage .table-stage{height:61%}}
@media(max-height:550px) and (orientation:landscape){body[data-screen="play"] .app{min-height:0;padding:7px 3vw}.settings button{padding:6px}.brand span{font-size:18px}.quest-bar{top:5px}.heart{font-size:29px}.hearts{gap:5px;margin:0}.quest-bar .eyebrow{font-size:10px}.play>.progress{top:65px}.play .table-stage,.play.sentence-stage .table-stage{top:23%;height:64%;left:8%;right:8%}.answer{font-size:17px;min-height:42px;padding:5px}.choices{gap:30%}footer{font-size:10px}#curseMeter{top:12%;font-size:16px}.runner-girl{height:100px}.run-heading{padding:5px}.run-controls{padding:4px}.run-controls button{font-size:18px;padding:6px}.run-hint{font-size:11px;margin:2px}.run-field{min-height:160px}}
@media(prefers-reduced-motion:reduce){.shadow{animation:none;opacity:.13}.candle-effects i{animation:none}.turned .lid{opacity:0!important}.turned .doll-back{opacity:1!important}.runner-girl{transition:none}}
.choice{display:grid;grid-template-rows:minmax(0,1fr) auto;justify-items:center;align-items:stretch}.doll-wrap{flex:initial;width:auto;max-width:100%;height:100%;aspect-ratio:2/3}
.cursed .choice:not(.opened):not(.rescuing) .lid{animation:none;opacity:1;transform:none}.cursed .doll-back{display:none}
body[data-screen="play"] footer,body[data-screen="runner"] footer{display:flex!important;min-height:22px;position:relative;z-index:30;text-shadow:0 2px 5px #000}
@media(max-height:550px) and (orientation:landscape){.play .table-stage,.play.sentence-stage .table-stage{top:31%;height:65%}.play .game-bottom{bottom:0}.quest-bar .eyebrow{max-width:65%}body[data-screen="play"] footer{font-size:10px;min-height:16px}.answer{font-size:16px;min-height:40px}}
body[data-screen="runner"] .room{background-image:url('assets/golden-passage.webp');filter:blur(8px) brightness(.35)}
.run-field{background:linear-gradient(#07091622,#07091622),url('assets/golden-passage.webp') center/100% 100% no-repeat}.run-lane.lower{top:82%}.runner-girl{top:82%}.gold-door{bottom:17%;height:55%}
@media(pointer:coarse){.play .touch-choices{left:41%;right:41%;gap:8px;bottom:3px;height:36px}.touch-choices button{width:0;min-width:0;font-size:23px;min-height:36px}}
.turned .choice.angry:not(.opened) .lid{animation:none;opacity:1;transform:none}.turned .choice.angry .doll-back{display:none}
