:root{color-scheme:dark;--ink:#f6f0de;--mint:#5cf2c4;--muted:#afc7c4;--panel:#08191add;--edge:#56d5b56d;font-family:system-ui,sans-serif}*{box-sizing:border-box}body{margin:0;min-height:100svh;color:var(--ink);background:radial-gradient(circle at 69% 23%,#244138 0,#0e1820 46%,#090b12 85%)}button,input{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible{outline:3px solid #e9d284;outline-offset:3px}[hidden]{display:none!important}.app{min-height:100svh;max-width:1500px;margin:auto;display:flex;flex-direction:column;padding:18px clamp(18px,4vw,62px) 16px}.masthead{display:flex;justify-content:space-between;align-items:center;min-height:44px;gap:20px;position:relative;z-index:3}.brand{display:flex;align-items:center;gap:12px;color:#d5c58e;font-size:29px;line-height:1}.brand span{font:700 11px/1.4 system-ui,sans-serif;letter-spacing:2.3px}.outline,.primary{border-radius:9px;padding:11px 18px;font-weight:750;letter-spacing:.2px}.outline{border:1px solid #a5d8c688;background:#102529aa;color:#e2efea}.outline:hover{background:#24544ccc}.primary{border:1px solid #e8f7d2;background:#98f4c6;color:#142821;box-shadow:0 4px 22px #72ebaf38}.primary:hover{background:#c7ffdc}.primary span{margin-left:30px}kbd{border:1px solid #aecabb8a;border-radius:3px;padding:2px 4px;font-size:11px}main{width:100%;flex:1;display:flex;align-items:center}.screen{width:100%}.eyebrow{color:#aef4c8;font-size:11px;font-weight:850;letter-spacing:2.5px;margin:0}.intro-screen{min-height:calc(100svh - 130px);position:relative;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;padding:45px 0;isolation:isolate}.intro-screen::before{content:"";position:absolute;z-index:-2;inset:0 -4vw;background:linear-gradient(90deg,#071318 1%,#081719e2 38%,#0d1a192a 74%),url('assets/spider-witch-clean.webp') right center/auto 112% no-repeat}.intro-screen::after{content:"";position:absolute;z-index:-1;inset:0 -4vw;background:linear-gradient(0deg,#0b1017,transparent 20%,#0c121850);pointer-events:none}h1,h2{font-family:Georgia,'Times New Roman',serif;font-weight:400}h1{font-size:clamp(54px,7.8vw,112px);line-height:1;letter-spacing:-3px;margin:17px 0 24px;text-shadow:0 6px 25px #000}h1 em{color:#a5f1c5;font-style:italic}.intro-copy{max-width:510px;font-size:clamp(19px,2.1vw,26px);line-height:1.55;text-shadow:0 2px 12px #000;margin:0 0 25px}.legend{display:flex;align-items:center;gap:8px;flex-wrap:wrap;max-width:560px;color:#e6ead7;background:#0a1a19d9;border:1px solid #5684777d;border-radius:10px;padding:12px 17px;margin-bottom:25px;font-size:14px}.legend-dot,.legend-comma{font-size:25px;color:#87ffd1;margin:0 8px}.intro-small{font-size:12px;letter-spacing:.6px;color:#cedbd1;margin:15px 0}footer{position:relative;display:flex;justify-content:space-between;gap:15px;flex-wrap:wrap;border-top:1px solid #b7dbca42;padding-top:12px;color:#9fb7ad;font-size:10px;letter-spacing:1px}.game-screen{padding:17px 0 20px}.hud{display:flex;align-items:end;justify-content:space-between;gap:24px;margin-bottom:12px}.chapter{display:flex;flex-direction:column;gap:5px}.chapter strong{font-family:Georgia,serif;font-size:clamp(24px,2.5vw,34px);font-weight:400}.web-status{min-width:min(370px,45%);margin-bottom:3px}.web-label{display:flex;justify-content:space-between;gap:16px;align-items:baseline;font-size:11px;font-weight:800;letter-spacing:1.3px;color:#d5ecde}.web-label strong{font-size:23px;color:#a5f7cc}.web-meter{position:relative;height:15px;border-radius:99px;border:1px solid #bff4db9e;background:#06161ad9;overflow:hidden;box-shadow:0 2px 12px #000a}.web-meter #webFill{width:25%;height:100%;background:linear-gradient(90deg,#45e0b8 0%,#d4e99b 62%,#fa835f 100%);border-radius:inherit;transition:width .22s ease}.danger-mark{position:absolute;top:0;bottom:0;right:12%;border-left:2px dashed #fff5c8aa}.web-status.danger .web-label strong{color:#ff9987}.scene{position:relative;height:clamp(330px,48vh,500px);border:1px solid #7bd2b78a;border-radius:18px;box-shadow:0 18px 45px #0008,0 0 30px #2fdaa02b;overflow:hidden;background:#0b1720}.scene-art,.scene-shade{position:absolute;inset:0}.scene-art{background-image:url('assets/spider-witch-clean.webp');background-repeat:no-repeat;background-size:auto 140%;background-position:right 42%;filter:brightness(1.65) saturate(1.3)}.scene-shade{background:linear-gradient(90deg,#0a1820 0%,#103a35a1 25%,#00191808 70%,#0711198a 100%),linear-gradient(0deg,#051319c5,transparent 45%)}.scene-svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}.kid{transform-origin:365px 412px;animation:breath 2.4s ease-in-out infinite}.scene.danger .kid{animation:shake .26s ease-in-out infinite alternate}.scene.release .kid{animation:liberated .85s ease-out both}#webLayer path{fill:none;stroke:url(#thread);stroke-width:2;stroke-linecap:round;opacity:0;transition:opacity .35s ease,stroke-width .25s;filter:drop-shadow(0 0 3px #74fdd2)}#webLayer path.woven{opacity:.85}#webLayer path.snapping{stroke:#eefff2;stroke-width:4;opacity:0}#spiderSilk{animation:silkTravel 2.4s linear infinite}.scene.weaving #spiderSilk{stroke-width:5;opacity:1;filter:drop-shadow(0 0 5px #6ef8d1)}#cocoon{transition:opacity 1.2s ease}.scene.cocooned #cocoon{opacity:1}.scene.cocooned #webLayer path{opacity:1}.scene-caption{position:absolute;bottom:14px;left:18px;padding:7px 11px;border-radius:7px;background:#07191dda;border:1px solid #aeffdb75;color:#e5ffe9;font-size:13px;font-weight:700;letter-spacing:.4px;max-width:calc(100% - 36px)}.spider-voice{position:absolute;top:12%;right:13%;padding:11px 15px;background:#d6f8dc;color:#214138;border-radius:20px 20px 4px 20px;border:2px solid #113b34;opacity:0;transform:translateY(9px);pointer-events:none;font:italic 16px Georgia,serif}.scene.weaving .spider-voice{animation:voice .8s ease forwards}.spell-panel{position:relative;z-index:2;background:linear-gradient(135deg,#0b1a21f2,#082022f3);border:1px solid #8bddc3a0;border-radius:15px;box-shadow:0 12px 35px #000a;padding:20px 22px;margin:-10px 18px 0}.prompt-row,.answer-heading,.answer-bottom{display:flex;justify-content:space-between;align-items:center;gap:12px}.key-small{font-size:12px;color:#d0f6e2}.tangle{display:block;min-height:62px;padding:10px 3px 16px;font:600 clamp(23px,3vw,41px)/1.4 Georgia,serif;color:#fff9e7;letter-spacing:.4px;overflow-wrap:anywhere}.tangle .char{display:inline}.tangle .punctuation-mark{display:inline-flex;vertical-align:middle;align-items:center;justify-content:center;width:28px;height:30px;margin:0 2px;color:#9ffbd1;filter:drop-shadow(0 0 7px #32f6ac)}.tangle .punctuation-mark svg{width:26px;height:26px;overflow:visible}.answer-heading{font-size:13px;color:#a9d6c4;font-weight:800;letter-spacing:.5px;margin:0 0 7px}#letterProgress{font-weight:500;color:#d3e6d8}#answer{width:100%;height:67px;padding:12px 18px;border:2px solid #b8dec6;border-radius:10px;background:#f6f5e9;color:#15242b;caret-color:#29594d;font:600 clamp(21px,2.5vw,32px)/1.2 Georgia,serif;box-shadow:0 0 15px #7de6b255}#answer.wrong{border-color:#ff8d7c;background:#fff1ea;box-shadow:0 0 18px #f15e6366}#answer::placeholder{color:#667879;opacity:.85}.answer-bottom{min-height:36px;font-size:12px;color:#c5d6d3}.answer-bottom p{margin:8px 0 0}.answer-bottom #feedback{text-align:right;margin-top:8px;color:#a9ffcf;font-weight:800}.answer-bottom #feedback.warning{color:#ffb89c}.touch-keyboard{margin-top:12px}.key-row{display:flex;justify-content:center;gap:5px;margin:5px 0}.key-row button{min-height:43px;min-width:0;flex:1;max-width:46px;border:1px solid #afe7c9;border-radius:6px;background:#203b3a;color:#f8f7e9;font-weight:700}.key-row button:active{background:#4b9d81}.key-row.special button{max-width:none}.outcome-screen{max-width:750px;margin:auto;text-align:center;background:#0b2222e8;border:1px solid #6ad2af;border-radius:18px;padding:45px 30px;box-shadow:0 12px 35px #0009}.outcome-screen h2{font-size:clamp(41px,5vw,67px);margin:12px 0}.outcome-screen p:not(.eyebrow){font-size:19px;line-height:1.6;color:#d6e9df}.outcome-actions{display:flex;justify-content:center;gap:12px;flex-wrap:wrap;margin-top:26px}dialog{max-width:560px;width:calc(100% - 28px);padding:32px;border:1px solid #a6f0ce;border-radius:14px;background:#0c2425;color:#f5f0e0;box-shadow:0 15px 70px #000}dialog::backdrop{background:#040b0ad9;backdrop-filter:blur(5px)}dialog h2{font-size:35px;margin:8px 0}dialog p:not(.eyebrow){font-size:15px;line-height:1.65}.close{position:absolute;right:12px;top:8px;background:transparent;border:0;color:#e5f7ea;font-size:30px}@keyframes breath{50%{transform:scale(1.015)}}@keyframes shake{to{transform:translateX(3px) rotate(1deg)}}@keyframes liberated{0%{transform:scale(1)}50%{transform:scale(1.08) translateY(-8px)}100%{transform:scale(1)}}@keyframes silkTravel{to{stroke-dashoffset:-46}}@keyframes voice{25%,80%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(-10px)}}
@media(max-width:750px){.app{padding:12px 12px 14px}.brand span{font-size:8px;letter-spacing:1.2px}.brand{font-size:24px}.masthead .outline{font-size:11px;padding:8px}.intro-screen{min-height:calc(100svh - 100px);justify-content:flex-end;padding:38px 4px 25px}.intro-screen::before{inset:0 -12px;background:linear-gradient(0deg,#071318 0%,#071318d9 43%,#0b161700 100%),url('assets/spider-witch-clean.webp') right top/auto 73% no-repeat}.intro-screen::after{inset:0 -12px;background:linear-gradient(90deg,#0714173a,transparent)}h1{font-size:clamp(44px,11vw,72px)}.intro-copy{font-size:18px;line-height:1.4}.legend{font-size:11px;padding:8px 10px}.legend-dot,.legend-comma{font-size:19px;margin:0 2px}.hud{align-items:center;gap:10px}.chapter .eyebrow{font-size:9px;letter-spacing:1px}.chapter strong{font-size:18px}.web-status{min-width:43%}.web-label{font-size:8px;letter-spacing:.3px}.web-label strong{font-size:15px}.web-meter{height:12px}.scene{height:clamp(230px,35svh,350px)}.scene-art{background-size:auto 120%;background-position:right 40%}.spell-panel{margin:-6px 4px 0;padding:14px 13px}.prompt-row .eyebrow{font-size:9px;letter-spacing:1px}.key-small{font-size:10px}.tangle{font-size:clamp(22px,6vw,29px);min-height:60px;padding:9px 2px}.tangle .punctuation-mark{width:24px;margin:0}.tangle .punctuation-mark svg{width:22px}.answer-heading{font-size:12px}#letterProgress{font-size:10px}#answer{height:58px;font-size:24px}.answer-bottom{display:block}.answer-bottom p,.answer-bottom #feedback{font-size:11px;text-align:left}.scene-caption{bottom:8px;left:9px;font-size:10px}.spider-voice{right:8%;font-size:12px;padding:7px}footer{font-size:8px;letter-spacing:.2px}}
@media(max-width:450px) and (max-height:740px){.scene{height:210px}.tangle{font-size:21px}.spell-panel{padding:10px}.answer-bottom p{display:none}.touch-keyboard .key-row button{min-height:38px}.intro-screen{padding-bottom:10px}}
@media(max-width:750px){.game-screen{align-self:flex-start}.app:has(.touch-keyboard:not([hidden])) .scene{height:clamp(195px,28svh,265px)}}
.header-actions{display:flex;align-items:center;gap:8px}#kid,#webLayer,#cocoon{display:none}#childWebFrame{filter:drop-shadow(0 9px 13px #001a18a8)}
@media(max-width:750px){.header-actions{gap:5px}.header-actions .outline{font-size:10px;padding:8px 7px;white-space:nowrap}}
.scene{height:clamp(410px,61svh,660px)}.scene-art{background-size:cover;background-position:center 49%;filter:brightness(1.52) saturate(1.17)}.scene-shade{background:linear-gradient(0deg,#051416b5 0%,#04171622 32%,#07161725 100%)}#childWebFrame{filter:drop-shadow(0 12px 13px #031510eb) drop-shadow(0 0 16px #13b98955)}
@media(max-width:750px){.scene{height:clamp(280px,40svh,410px)}.scene-art{background-size:cover;background-position:center 49%}.app:has(.touch-keyboard:not([hidden])) .scene{height:clamp(245px,33svh,320px)}}
/* The game is one immersive viewport; controls float over the witch's room. */
.app:has(#game:not([hidden])){position:relative;width:100%;max-width:none;height:100svh;min-height:100svh;padding:0;overflow:hidden}
.app:has(#game:not([hidden])) .masthead{position:absolute;inset:14px clamp(14px,2.4vw,44px) auto;z-index:8;min-height:40px;pointer-events:none}
.app:has(#game:not([hidden])) .masthead button{pointer-events:auto}
.app:has(#game:not([hidden])) main{display:block;height:100%;min-height:0}
.app:has(#game:not([hidden])) footer{display:none}
.game-screen{position:relative;height:100%;overflow:hidden}
.game-screen .scene{position:absolute;inset:0;width:100%;height:100%;border:0;border-radius:0;box-shadow:none;background:#07120f}
.game-screen .scene-art{background-size:cover;background-position:center 48%;filter:brightness(1.45) saturate(1.12)}
.game-screen .scene-shade{background:linear-gradient(180deg,#071411ab 0%,#0617171f 25%,#04120f00 50%,#03100fd4 100%),linear-gradient(90deg,#05100c66,transparent 23%,transparent 78%,#05100c66)}
.game-screen .scene-svg{position:absolute;inset:0;z-index:1}
.game-screen .hud{position:absolute;top:clamp(72px,10svh,106px);left:clamp(14px,2.5vw,50px);right:clamp(14px,2.5vw,50px);z-index:4;display:flex;align-items:center;gap:28px;padding:12px 18px;border:1px solid #a1dfc473;border-radius:13px;background:#071c1bc9;backdrop-filter:blur(13px);box-shadow:0 12px 30px #0007}
.game-screen .chapter strong{font-size:clamp(20px,2vw,30px)}
.game-screen .web-status{width:min(34vw,510px);flex:0 1 auto}
.game-screen .spell-panel{position:absolute;left:50%;bottom:clamp(10px,2svh,26px);transform:translateX(-50%);width:min(1120px,calc(100% - 54px));margin:0;z-index:5;padding:15px 20px;background:#061b1bdc;backdrop-filter:blur(17px);box-shadow:0 15px 50px #000b}
.game-screen .tangle{font-size:clamp(25px,2.45vw,38px);min-height:50px;padding:5px 2px 9px}
.game-screen #answer{height:60px;font-size:clamp(23px,2.1vw,30px)}
.game-screen .scene-caption{z-index:2;bottom:clamp(260px,29svh,325px);left:clamp(20px,3vw,55px);font-size:12px}
.game-screen .spider-voice{z-index:2}
@media(max-width:750px){
 .app:has(#game:not([hidden])) .masthead{top:9px;left:10px;right:10px}
 .game-screen .hud{top:63px;left:9px;right:9px;padding:8px 10px;gap:7px}
 .game-screen .chapter strong{font-size:16px}.game-screen .chapter .eyebrow{font-size:8px}
 .game-screen .web-status{width:45%;min-width:0}.game-screen .web-label strong{font-size:13px}
 .game-screen .spell-panel{bottom:max(5px,env(safe-area-inset-bottom));width:calc(100% - 16px);padding:10px 11px}
 .game-screen .scene-art{background-position:center 46%}
 .game-screen #childWebFrame{transform:scale(.7);transform-origin:500px 145px}
 .game-screen .scene-caption{bottom:clamp(315px,45svh,430px);left:12px;font-size:10px}
 .game-screen .tangle{font-size:clamp(21px,5.8vw,27px);min-height:44px}
 .game-screen #answer{height:51px;font-size:23px}
 .game-screen .answer-bottom p{display:none}
}
#plasmaBurst{transform-origin:505px 350px}
@media(max-width:750px){.game-screen #childWebFrame,.game-screen #childFullWeb{transform:scale(.7);transform-origin:500px 145px}}
.game-screen #childWebFrame,.game-screen #childFullWeb{transform:none}
@media(max-width:750px) and (max-height:700px){.game-screen .scene-caption{display:none}.game-screen .hud{top:50px}.game-screen .spell-panel{padding:8px}.game-screen .tangle{min-height:35px;padding:2px}}
body:has(#intro:not([hidden])),body:has(#outcome:not([hidden])){background:linear-gradient(90deg,#06100fe8 0%,#071715c3 35%,#07151153 74%),url('assets/spider-witch-clean.webp') center 48%/cover fixed no-repeat}
.intro-screen::before,.intro-screen::after{display:none}
/* Compact game HUD, centered web meter, readable pace and points. */
.app:has(#game:not([hidden])) .masthead .brand{display:none}
.app:has(#game:not([hidden])) .masthead{justify-content:flex-end;top:8px}
.game-screen .hud{left:50%;right:auto;transform:translateX(-50%);width:min(1080px,calc(100% - 32px));top:55px;display:grid;grid-template-columns:minmax(150px,1fr) minmax(280px,1.65fr) minmax(190px,1.15fr);gap:18px;padding:10px 17px;min-width:0}
.game-screen .chapter{min-width:0}.game-screen .chapter .eyebrow{font-size:9px;letter-spacing:1.1px}.game-screen .chapter strong{font:500 clamp(20px,2vw,28px)/1.1 Georgia,serif}
.game-screen .web-status{width:100%;min-width:0;margin:0}.game-screen .web-label{font-size:10px;letter-spacing:.9px}.game-screen .web-label strong{font-size:19px}.game-screen .web-meter{height:15px}
.play-stats{display:flex;align-items:center;justify-content:space-around;gap:10px;min-width:0}.play-stats>div{display:flex;flex-direction:column;gap:3px;min-width:0}.play-stats span{color:#abdec9;font:800 10px system-ui,sans-serif;letter-spacing:1.5px}.play-stats strong{color:#f3f5dc;font:700 18px system-ui,sans-serif;white-space:nowrap}
.game-screen .spell-panel{width:min(980px,calc(100% - 36px));padding:13px 18px 12px;background:#051d1ddc}
.game-screen .prompt-row .eyebrow{font-size:10px;letter-spacing:1.5px}.word-stage{position:relative}.game-screen .tangle{font-size:clamp(25px,2.8vw,40px);min-height:46px;padding:4px 0 7px;line-height:1.25}
.game-screen .answer-heading{height:0;margin:0;overflow:hidden;position:absolute;clip-path:inset(50%)}.game-screen #answer{height:57px}.game-screen .answer-bottom{min-height:0}.game-screen #answerTip{display:none}.game-screen .answer-bottom #feedback{margin:5px 0 0;font-size:11px}
.game-screen .scene-caption{display:none}.game-screen .spell-panel .prompt-row{min-height:16px}
.score-float{position:absolute;left:45%;top:0;color:#b0ffbd;opacity:0;pointer-events:none;font:900 clamp(27px,3.3vw,46px) system-ui,sans-serif;text-shadow:0 0 14px #3cff9a,0 3px 10px #001b0b;transform:translateY(10px) scale(.8)}.score-float.negative{color:#ffb78d;text-shadow:0 0 14px #ff6936}.score-float.show{animation:scoreRise 1s ease-out forwards}
@keyframes scoreRise{0%{opacity:0;transform:translateY(15px) scale(.7)}20%{opacity:1;transform:translateY(-8px) scale(1.1)}85%{opacity:1}100%{opacity:0;transform:translateY(-50px) scale(1)}}
#plasmaBurst{fill:none;stroke:#49fcb0;stroke-width:2;filter:drop-shadow(0 0 9px #31ff9e) drop-shadow(0 0 22px #16ff7a);animation:plasmaThrob 2.8s ease-in-out infinite;transform-origin:505px 416px}#plasmaBurst path{stroke-dasharray:13 8;animation:plasmaFlow 1.6s linear infinite}#plasmaBurst .plasma-ring{fill:none;stroke:#a3ffcd;stroke-width:2;stroke-dasharray:18 14;animation:plasmaFlow 2.7s linear infinite}#plasmaBurst .plasma-ring.delay{opacity:.55;animation-duration:4s;animation-direction:reverse}
@keyframes plasmaFlow{to{stroke-dashoffset:-128}}@keyframes plasmaThrob{50%{opacity:.55;transform:scale(1.16)}}
@media(max-width:750px){
 .game-screen .hud{top:43px;left:50%;right:auto;width:calc(100% - 16px);display:grid;grid-template-columns:1fr auto;gap:6px 10px;padding:7px 10px}
 .game-screen .chapter{grid-column:1}.game-screen .chapter strong{font-size:17px}.game-screen .chapter .eyebrow{font-size:8px}
 .game-screen .play-stats{grid-column:2;grid-row:1;gap:9px}.play-stats span{font-size:8px;letter-spacing:.5px}.play-stats strong{font-size:13px}
 .game-screen .web-status{grid-column:1/-1;grid-row:2;width:100%;min-width:0}.game-screen .web-label{font-size:8px}.game-screen .web-label strong{font-size:12px}.game-screen .web-meter{height:10px}
 .game-screen .spell-panel{width:calc(100% - 14px);padding:9px 10px}.game-screen .tangle{font-size:clamp(21px,5.7vw,28px);min-height:34px}.game-screen #answer{height:48px;font-size:22px}
 .score-float{left:45%;font-size:25px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}.scene.danger .kid{animation:none}}
/* The web responds continuously inside the current level's twenty percent band. */
.game-screen .web-status{display:flex;flex-direction:column;gap:6px}
.game-screen #threadFill{display:block;height:100%;width:100%;border-radius:inherit;background:linear-gradient(90deg,#296d59,#6cf9c7 70%,#e6ffce);box-shadow:0 0 12px #70ffd28f}
.game-screen .pressure-status{width:100%;min-width:0}
.game-screen .pressure-label{display:flex;align-items:center;justify-content:space-between;color:#e6baab;font:750 9px system-ui,sans-serif;letter-spacing:.8px}
.game-screen .pressure-label strong{color:#f7c8a5;font-size:11px}
.game-screen .pressure-status .web-meter{height:6px;border-color:#d5896b88}
.game-screen .pressure-status .web-meter #webFill{width:25%;height:100%;border-radius:inherit;background:linear-gradient(90deg,#d8ad75,#ed704f);transition:width .16s linear}
.game-screen .pressure-status.danger .pressure-label strong{color:#ff776e}
@media(max-width:750px){.game-screen .web-status{gap:4px}.game-screen .pressure-label{font-size:7px}.game-screen .pressure-label strong{font-size:9px}.game-screen .pressure-status .web-meter{height:5px}}
/* The same sentence thread remains mounted across all five levels. */
.game-screen .thread-window{position:relative;overflow:hidden;width:100%;mask-image:linear-gradient(90deg,#000 0%,#000 88%,transparent 100%);-webkit-mask-image:linear-gradient(90deg,#000 0%,#000 88%,transparent 100%);border-bottom:1px solid #6be5b75c}
.game-screen .thread-window::before{content:"";position:absolute;z-index:2;top:7px;bottom:5px;left:1px;width:2px;background:#b2ffe3;box-shadow:0 0 8px #3dffac;pointer-events:none}
.game-screen .tangle{position:relative;display:block;width:max-content;max-width:none;white-space:nowrap;overflow:visible;overflow-wrap:normal;transform:translate3d(8px,0,0);transition:transform .11s ease-out;will-change:transform}
.game-screen .tangle .thread-char{display:inline-block;vertical-align:middle;white-space:pre;transition:opacity .12s linear}
.game-screen .tangle .thread-char.released{opacity:.3}
.game-screen .tangle .thread-char.punctuation-mark{display:inline-flex}
.game-screen .tangle .silent-space{width:0;min-width:0;overflow:hidden}

/* v0.16: phosphorescent title, unframed status, and a compact touch layout. */
.game-title{margin:0;line-height:0;letter-spacing:0;width:clamp(220px,23vw,340px);flex:none}
.game-title img{display:block;width:100%;height:auto;filter:drop-shadow(0 2px 8px #001c0ce0)}
.masthead{align-items:flex-start}.header-actions{padding-top:9px}
.app:has(#game:not([hidden])) .masthead{justify-content:space-between;align-items:flex-start;inset:10px 22px auto;gap:14px}
.app:has(#game:not([hidden])) .game-title{width:clamp(210px,21vw,290px)}
.intro-screen{min-height:calc(100svh - 235px);padding:30px 0;max-width:590px}
.intro-screen .eyebrow{margin-bottom:18px}.intro-copy{max-width:480px}
.game-screen .hud{top:clamp(118px,12vw,142px);padding:0;gap:24px;border:0;border-radius:0;background:none;backdrop-filter:none;box-shadow:none;text-shadow:0 2px 4px #000,0 0 14px #00150e}
.game-screen .web-meter{border:0;height:11px;box-shadow:0 2px 10px #0008;background:#071d16a6}
.game-screen .pressure-status .web-meter{height:5px;border:0}
.game-screen .chapter strong{font:650 19px/1.3 system-ui,sans-serif}
.game-screen .web-status{gap:7px}.game-screen .play-stats strong{font-size:19px}
.game-screen .web-label strong{font-size:18px}
.game-screen .word-color{color:var(--word-color);text-shadow:0 0 10px color-mix(in srgb,var(--word-color) 22%,transparent)}
#cocoonThreads .cocoon-body{fill:#b1e7c5;opacity:.12;transition:opacity 1s ease}
#cocoonThreads .silk{fill:none;stroke:#90e5bb;stroke-width:.65;opacity:.6;stroke-linecap:round}
#cocoonThreads .silk.bright{stroke:#dbffe2;stroke-width:.9;opacity:.84}
#cocoonThreads .cross-thread{stroke:#67d995;stroke-width:.8;opacity:.7}
.scene.cocooned #cocoonThreads .cocoon-body{opacity:.95}
.scene.cocooned #cocoonThreads .silk{stroke-width:1.5;opacity:1}
.key-row button{touch-action:manipulation;-webkit-tap-highlight-color:transparent;user-select:none}
.key-row.special [data-key="space"]{flex:3}
.key-row [aria-pressed="true"]{background:#8fe7b4;color:#10251b}
button:focus-visible{outline:3px solid #d4ff7b;outline-offset:4px;box-shadow:0 0 16px #a2ff785c}
.game-screen.compact-scene .scene-svg{top:calc(var(--hud-bottom,190px) + 8px);bottom:auto;left:50%;width:min(52vw,230px);height:calc(100% - var(--panel-height,305px) - var(--hud-bottom,190px) - 28px);transform:translateX(-50%);overflow:visible}
.game-screen.compact-scene #plasmaBurst{opacity:.35;animation:none}
@supports(height:100dvh){.app:has(#game:not([hidden])){height:100dvh;min-height:100dvh}}
@media(max-width:750px){
 .app{padding:10px 12px 12px}.masthead{flex-direction:column;align-items:center;gap:2px}
 .game-title,.app:has(#game:not([hidden])) .game-title{width:min(225px,60vw)}
 .header-actions{padding:0;gap:16px}.header-actions .outline{font-size:11px;padding:5px 9px;background:#061c18b0}
 .app:has(#game:not([hidden])) .masthead{inset:max(5px,env(safe-area-inset-top)) 10px auto;align-items:center;gap:2px}
 .intro-screen{min-height:calc(100svh - 190px);padding:25px 4px;justify-content:flex-end;align-items:center;text-align:center}
 .intro-copy{font-size:18px;max-width:380px}.legend{justify-content:center;background:none;border:0;padding:8px 0}
 .intro-small{font-size:10px}.intro-screen .eyebrow{font-size:9px}
 .game-screen .hud{top:137px;width:calc(100% - 32px);gap:5px 16px;padding:0;grid-template-columns:1fr auto}
 .game-screen .chapter strong{font-size:14px}.game-screen .chapter .eyebrow{font-size:10px;letter-spacing:1px}
 .game-screen .play-stats strong{font-size:14px}.game-screen .play-stats{gap:17px}
 .game-screen .web-label strong{font-size:12px}.game-screen .web-label{font-size:8px}
 .game-screen .web-meter{height:8px}.game-screen .web-status{gap:3px}
 .game-screen .pressure-label{font-size:8px}.game-screen .pressure-status .web-meter{height:4px}
 .game-screen .spell-panel{width:calc(100% - 16px);padding:8px;border-color:#87db9d55;border-radius:13px;background:#061910c7;backdrop-filter:blur(8px);bottom:max(6px,env(safe-area-inset-bottom))}
 .game-screen .prompt-row{display:none}.game-screen .tangle{min-height:34px;font-size:24px;padding:3px 0 5px}
 .game-screen #answer{height:44px;font:600 20px/1.2 system-ui,sans-serif;padding:7px 10px}
 .game-screen .answer-bottom #feedback{font-size:10px;line-height:1.2;margin:3px 0 0}
 .touch-keyboard{margin-top:6px}.key-row{gap:4px;margin:4px 0}
 .touch-keyboard .key-row button{min-height:36px;max-width:none;font-size:16px;padding:0;border-color:#a4d9b75c;border-radius:5px}
 .touch-keyboard .key-row.special button{font-size:16px;min-height:37px}
 .touch-keyboard .key-row.special [data-key="space"]{font-size:12px}
}
@media(max-width:750px) and (max-height:700px){
 .game-title,.app:has(#game:not([hidden])) .game-title{width:172px}
 .app:has(#game:not([hidden])) .masthead{gap:0;top:3px}
 .header-actions .outline{padding:3px 7px;font-size:10px}
 .game-screen .hud{top:106px}.game-screen .web-status{gap:1px}
 .game-screen .chapter strong{font-size:12px}.game-screen .play-stats strong{font-size:12px}
 .touch-keyboard .key-row button,.touch-keyboard .key-row.special button{min-height:32px}
 .game-screen .tangle{font-size:21px;min-height:30px}.game-screen #answer{height:39px;font-size:19px}
}
@media(min-width:751px) and (max-width:1024px){
 .touch-mode .touch-keyboard{max-width:650px;margin:6px auto 0}
 .touch-mode .key-row button{max-width:60px;min-height:35px}
 .touch-mode .game-screen .hud{top:116px}
}
@media(orientation:landscape) and (max-height:500px){
 .app:has(#game:not([hidden])) .masthead{inset:4px 12px auto;flex-direction:row;align-items:flex-start}
 .app:has(#game:not([hidden])) .game-title{width:140px}
 .game-screen.compact-scene .hud{top:73px;left:23%;width:40%;gap:4px 9px;grid-template-columns:1fr auto}
 .game-screen.compact-scene .web-status{grid-column:1/-1;grid-row:2}
 .game-screen.compact-scene .play-stats{grid-column:2;grid-row:1;gap:8px}
 .game-screen.compact-scene .chapter strong,.game-screen.compact-scene .play-stats strong{font-size:12px}
 .game-screen.compact-scene .spell-panel{left:auto;right:8px;transform:none;width:51%;bottom:max(5px,env(safe-area-inset-bottom));padding:7px}
 .game-screen.compact-scene .scene-svg{left:23%;top:155px;width:30vw;height:calc(100% - 170px)}
 .game-screen.compact-scene .tangle{font-size:22px;min-height:30px}.game-screen.compact-scene #answer{height:38px;font-size:18px}
 .game-screen.compact-scene .prompt-row{display:none}
 .touch-keyboard{margin-top:4px}.touch-keyboard .key-row button,.touch-keyboard .key-row.special button{min-height:32px;font-size:15px}
}

/* v0.17: larger title, uninterrupted escape, and personal scores. */
.game-title{width:clamp(330px,34vw,480px)}
.app:has(#game:not([hidden])) .game-title{width:clamp(290px,29vw,420px)}
.game-screen .hud{top:var(--header-bottom,190px)}
.game-screen .proper-name{color:#e7adff!important;text-shadow:0 0 9px #c64aff7a;font-weight:800}
.game-screen .thread-char.recaptured{animation:recapture .65s ease-out}
@keyframes recapture{0%{color:#fff;filter:drop-shadow(0 0 10px #dcff60);transform:translateY(-4px)}50%{color:#b7ff4b}100%{transform:none}}
.game-screen .tangle{transition:transform .065s ease-out}
.name-label{display:block;font:700 13px system-ui,sans-serif;letter-spacing:.6px;color:#c8f7d3;margin:0 0 8px}
.player-name{display:block;width:min(370px,100%);border:1px solid #a3e5b7;background:#071c17d9;color:#f1ffe8;border-radius:8px;padding:12px 14px;font-size:22px;box-shadow:0 2px 14px #0004}
.player-name::placeholder{font-size:17px;color:#b3c8bd}.player-name[aria-invalid="true"]{border-color:#ffb589}
.name-note{font-size:11px;color:#bcd1c2;margin:7px 0 18px}
#nameKeyboardHost{width:min(470px,100%);margin-bottom:12px}#nameKeyboardHost:empty{display:none}
.intro-screen{min-height:0;flex:1;padding:28px 0 34px}
.player-label{color:#e9ffc7;font:750 13px/1.2 system-ui,sans-serif;max-width:240px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}
.app:has(#game:not([hidden])) #scoresButton{display:none}
.escape-flash{position:fixed;inset:0;z-index:30;pointer-events:none;opacity:0;background:radial-gradient(ellipse at 50% 55%,#daff9f99,#75ff3dcc 70%);mix-blend-mode:screen}
.escape-flash.celebrate{animation:escapeGlow .6s ease-out both}
@keyframes escapeGlow{0%{opacity:0}15%{opacity:.55}100%{opacity:0}}
.witch-cry{position:fixed;z-index:31;top:42%;left:50%;transform:translate(-50%,-50%);pointer-events:none;opacity:0;color:#c7ff50;font:900 italic clamp(28px,4.5vw,68px)/1 Georgia,serif;white-space:nowrap;text-shadow:0 3px 2px #061907,0 0 15px #51ff23,0 0 35px #54ff2466}
.witch-cry.celebrate{animation:witchProtest 1.2s ease-out both}
@keyframes witchProtest{0%{opacity:0;transform:translate(-50%,-50%) scale(.8) rotate(-5deg)}15%,60%{opacity:1;transform:translate(-50%,-50%) scale(1) rotate(2deg)}100%{opacity:0;transform:translate(-50%,-80%) scale(1.1) rotate(-2deg)}}
#scoresDialog{max-width:650px}.score-note{color:#c5d7cb}.score-table-wrap{max-height:48svh;overflow:auto;margin:16px 0 24px}
#scoreTable{width:100%;border-collapse:collapse;font-size:14px;text-align:left}#scoreTable th{color:#c6fcac;position:sticky;top:0;background:#0c2425}
#scoreTable th,#scoreTable td{padding:11px 8px;border-bottom:1px solid #a7dcb833;overflow-wrap:anywhere}
#scoreTable td:nth-child(2){max-width:200px}#scoreTable td:nth-child(3),#scoreTable td:nth-child(4){white-space:nowrap}
#scoreTable .current-player{background:#66ff9420;color:#d9ffbf;font-weight:750}
@media(max-width:750px){
 .game-title,.app:has(#game:not([hidden])) .game-title{width:min(300px,78vw)}
 .intro-screen{min-height:0;padding:24px 4px}.intro-copy{font-size:16px;margin-bottom:14px}
 .intro-screen .eyebrow{margin-bottom:12px}.legend{margin-bottom:16px}
 .player-name{font-size:20px;text-align:center;max-width:340px}.name-note{margin-bottom:10px}
 .player-label{font-size:11px;max-width:160px}.game-screen .hud{top:var(--header-bottom,172px)}
 .witch-cry{top:43%;font-size:clamp(28px,7.5vw,45px)}
 .score-table-wrap{margin:12px 0 18px}#scoreTable{font-size:12px}#scoreTable th,#scoreTable td{padding:10px 4px}
}
@media(max-width:750px) and (max-height:700px){
 .game-title,.app:has(#game:not([hidden])) .game-title{width:205px}
 .game-screen .hud{top:var(--header-bottom,123px)}
 .touch-mode .intro-copy,.touch-mode .intro-screen .eyebrow,.touch-mode .intro-screen .legend,.touch-mode .intro-small{display:none}
 .touch-mode .intro-screen{padding:12px 4px}.touch-mode .name-note{margin-bottom:4px}
}
@media(orientation:landscape) and (max-height:500px){
 .app:has(#game:not([hidden])) .game-title{width:175px}
 .game-screen.compact-scene .hud{top:var(--header-bottom,88px)}
 .game-screen.compact-scene .scene-svg{top:calc(var(--hud-bottom,160px) + 8px);height:calc(100% - var(--hud-bottom,160px) - 20px)}
 .witch-cry{left:24%;top:55%;font-size:30px}
 .touch-mode .intro-screen{display:grid;grid-template-columns:1fr 1fr;gap:5px 22px;max-width:none;padding:5px 0}
 .touch-mode .intro-screen .intro-copy,.touch-mode .intro-screen .legend,.touch-mode .intro-screen .eyebrow,.touch-mode .intro-small{display:none}
 .touch-mode .name-label,.touch-mode .player-name,.touch-mode .name-note,.touch-mode #startButton{grid-column:1}
 .touch-mode #nameKeyboardHost{grid-column:2;grid-row:1/5}
 .touch-mode .masthead .game-title{width:175px}.touch-mode .masthead{flex-direction:row;align-items:center}
}
@media(prefers-reduced-motion:reduce){
 .escape-flash.celebrate{animation:none;opacity:.06}
 .witch-cry.celebrate{animation:none;opacity:1;transform:translate(-50%,-50%)}
 .game-screen .thread-char.recaptured{animation:none;color:#b7ff4b}
}
/* v0.18: the witch's lies become a connected story. */
.story-chapter{font-size:11px;color:#d4e8c3;font-style:italic;text-align:right}
.child-cry{position:absolute;z-index:7;left:50%;bottom:calc(var(--panel-height,150px) + 28px);max-width:90%;transform:translateX(-50%);pointer-events:none;opacity:0;color:#efffcb;font:900 clamp(25px,3.2vw,48px)/1.1 system-ui,sans-serif;text-align:center;text-shadow:0 3px 2px #001c10,0 0 13px #6dff8c}
.child-cry.celebrate{animation:childDefiance 1.3s ease-out both}
@keyframes childDefiance{0%{opacity:0;transform:translateX(-50%) scale(.88)}12%,82%{opacity:1;transform:translateX(-50%) scale(1)}100%{opacity:0;transform:translateX(-50%) translateY(-8px)}}
.witch-cry{white-space:normal;width:min(620px,88vw);text-align:center;font-size:clamp(25px,4vw,57px);line-height:1.1}
.witch-cry.celebrate{animation-duration:var(--cry-duration,1.8s)}
.scene.impact{animation:roomShudder .34s ease-out both}
@keyframes roomShudder{0%,100%{transform:translate(0,0)}18%{transform:translate(-3px,1px)}36%{transform:translate(3px,-2px)}54%{transform:translate(-2px,1px)}72%{transform:translate(2px,0)}}
@media(max-width:750px){.child-cry{font-size:25px;bottom:calc(var(--panel-height,270px) + 17px)}.witch-cry{font-size:clamp(25px,6.5vw,36px)}}
@media(orientation:landscape) and (max-height:500px){.child-cry{left:23%;bottom:10px;width:42%;font-size:22px}.witch-cry{width:42%;left:23%;font-size:26px}}
@media(prefers-reduced-motion:reduce){.scene.impact{animation:none}.child-cry.celebrate{animation:none;opacity:1;transform:translateX(-50%)}}
/* The child's reply is a silent comic balloon near his face. */
.child-cry{top:42%;bottom:auto;left:calc(50% + 96px);width:max-content;max-width:min(250px,68vw);padding:9px 15px;border:2px solid #d2ffad;border-radius:19px 19px 19px 5px;background:#102b23ec;color:#efffcb;font:850 clamp(17px,1.8vw,24px)/1.15 system-ui,sans-serif;letter-spacing:.1px;box-shadow:0 4px 16px #00180caa,0 0 17px #67f78574;transform:translate(-50%,-100%);white-space:nowrap}
.child-cry::after{content:"";position:absolute;bottom:-8px;left:17%;width:12px;height:12px;background:#102b23;border-right:2px solid #d2ffad;border-bottom:2px solid #d2ffad;transform:rotate(45deg)}
.child-cry.celebrate{animation:faceBubble .96s ease-out both}
@keyframes faceBubble{0%{opacity:0;transform:translate(-50%,-83%) scale(.88)}13%,82%{opacity:1;transform:translate(-50%,-100%) scale(1)}100%{opacity:0;transform:translate(-50%,-107%) scale(1)}}
@media(max-width:750px){.child-cry{top:calc(var(--hud-bottom,190px) + 45px);bottom:auto;left:calc(50% + 54px);font-size:16px;padding:7px 10px;max-width:210px}}
@media(orientation:landscape) and (max-height:500px){.child-cry{top:calc(var(--hud-bottom,160px) + 40px);bottom:auto;width:max-content;left:calc(23% + 54px);font-size:15px}}
@media(prefers-reduced-motion:reduce){.child-cry.celebrate{animation:none;opacity:1;transform:translate(-50%,-100%)}}
/* v0.20: quiet cover and a living title. */
.app:has(#intro:not([hidden])) .masthead{justify-content:center;align-items:center}
.app:has(#intro:not([hidden])) .header-actions,.app:has(#intro:not([hidden])) footer{display:none}
.app:has(#intro:not([hidden])) .intro-screen{max-width:460px;margin:auto;align-items:center;justify-content:center;gap:12px;text-align:center;padding:24px 0 60px}
.app:has(#intro:not([hidden])) .intro-screen .name-label{margin:0;font-size:15px}
.app:has(#intro:not([hidden])) .player-name{text-align:center;margin:0 auto}
.app:has(#intro:not([hidden])) #nameNote:not(.error){display:none}
.app:has(#intro:not([hidden])) #nameNote.error{display:block;color:#ffd1a4;margin:0}
.app:has(#intro:not([hidden])) #startButton{min-width:200px;font-size:19px}
.app:has(#intro:not([hidden])) #nameKeyboardHost{margin:0}
.game-title{position:relative;isolation:isolate;overflow:visible}
.game-title img{animation:titlePulse 4.6s ease-in-out infinite alternate}
.title-spider{position:absolute;z-index:2;top:2%;left:10%;width:32px;height:100px;pointer-events:none;filter:drop-shadow(0 0 4px #70ff47)}
.title-spider.second{left:auto;right:13%;top:0%;width:27px}
.title-spider::before{content:"";position:absolute;top:0;left:50%;height:66px;border-left:1.5px solid #9eff81;box-shadow:0 0 5px #74ff67;animation:silkLength 4.4s ease-in-out infinite alternate}
.title-spider svg{position:absolute;top:0;left:0;width:100%;height:auto;overflow:visible;animation:spiderClimb 4.4s ease-in-out infinite alternate}
.title-spider.second::before,.title-spider.second svg{animation-duration:5.3s;animation-delay:-1.7s}
.title-spider svg path{fill:none;stroke:#27db65;stroke-width:2.5;stroke-linecap:round}
.title-spider svg ellipse,.title-spider svg circle:not(:nth-last-child(-n+2)){fill:#06100f;stroke:#49e371;stroke-width:1.5}
.title-spider svg circle:nth-last-child(-n+2){fill:#cbff72;filter:drop-shadow(0 0 3px #bcff51)}
@keyframes titlePulse{0%,100%{filter:brightness(.88) saturate(1.04) drop-shadow(0 2px 7px #30c9508c)}47%{filter:brightness(1.25) saturate(1.3) drop-shadow(0 0 16px #81ff57cf)}72%{filter:brightness(1.04) saturate(1.13) drop-shadow(0 0 9px #61ff50a3)}}
@keyframes spiderClimb{from{transform:translateY(48px)}to{transform:translateY(19px)}}
@keyframes silkLength{from{height:69px}to{height:40px}}
@media(max-width:750px){
 .title-spider{width:22px}.title-spider.second{width:19px}
 .app:has(#intro:not([hidden])) .intro-screen{padding:14px 2px 25px;gap:9px}
 .app:has(#intro:not([hidden])) #nameKeyboardHost{width:100%}
}
@media(orientation:landscape) and (max-height:500px){
 .app:has(#intro:not([hidden])) .masthead{justify-content:center}
 .app:has(#intro:not([hidden])) .intro-screen{max-width:620px;padding:3px 0;gap:5px}
 .app:has(#intro:not([hidden])) .name-label,.app:has(#intro:not([hidden])) .player-name,.app:has(#intro:not([hidden])) #startButton{grid-column:1;justify-self:center}
 .app:has(#intro:not([hidden])) #nameKeyboardHost{grid-column:2;grid-row:1/4}
}
@media(prefers-reduced-motion:reduce){.game-title img,.title-spider svg,.title-spider::before{animation:none}.title-spider svg{transform:translateY(34px)}}

/* v0.21: the room appears first, then the title and name arrive. */
.app:has(#intro:not([hidden])) .masthead{display:none}
.app:has(#intro:not([hidden])) .intro-screen{max-width:720px;width:100%;padding:22px 12px;gap:12px}
.app:has(#intro:not([hidden])) .cover-title{width:min(620px,86vw);margin:0 auto 9px}
.intro-screen .cover-title{animation:coverAppear .9s .55s ease-out both}
.intro-screen .name-label{animation:coverAppear .7s .95s ease-out both}
.intro-screen .player-name{animation:coverAppear .7s 1.12s ease-out both}
.intro-screen #nameKeyboardHost,.intro-screen #nameNote{animation:coverAppear .7s 1.2s ease-out both}
.intro-screen #startButton{animation:coverAppear .7s 1.32s ease-out both,beginBlink 3.6s 2.02s ease-in-out infinite}
@keyframes beginBlink{0%,100%{opacity:1}50%{opacity:.5}}
@keyframes coverAppear{from{opacity:0;transform:translateY(20px) scale(.97)}to{opacity:1;transform:translateY(0) scale(1)}}
.title-spider.third{left:29%;top:-4%;width:23px}
.title-spider.fourth{left:auto;right:32%;top:7%;width:24px}
.title-spider.fifth{left:51%;top:-9%;width:21px}
.title-spider.third::before,.title-spider.third svg{animation-duration:5.8s;animation-delay:-2.8s}
.title-spider.fourth::before,.title-spider.fourth svg{animation-duration:4.7s;animation-delay:-1.2s}
.title-spider.fifth::before,.title-spider.fifth svg{animation-duration:6.2s;animation-delay:-3.5s}
@media(max-width:750px){
 .app:has(#intro:not([hidden])) .intro-screen{max-width:100%;padding:14px 5px 30px;gap:9px}
 .app:has(#intro:not([hidden])) .cover-title{width:min(500px,87vw);margin:0 auto 10px}
 .title-spider.third,.title-spider.fourth{width:17px}.title-spider.fifth{width:15px}
}
@media(orientation:landscape) and (max-height:500px){
 .app:has(#intro:not([hidden])) .intro-screen{max-width:96vw;padding:2px 0;gap:3px}
 .app:has(#intro:not([hidden])) .cover-title{width:min(280px,42vw);margin:0 auto 0;grid-column:1/-1;grid-row:1}
 .touch-mode #nameKeyboardHost{grid-column:2;grid-row:2/6}
 .touch-mode .name-label{grid-row:2}.touch-mode .player-name{grid-row:3}.touch-mode #startButton{grid-row:4}
}

/* The first two seconds show just the witch's room, the child, and their plea. */
body:has(.game-screen.opening) .masthead{display:none}
.game-screen.opening .scene{position:fixed;inset:0;z-index:12;width:100vw;height:100svh}
.game-screen.opening .scene-art{animation:roomArrival .85s ease-out both}
.game-screen.opening .scene-shade{background:linear-gradient(90deg,#06120a55,transparent 38%,#06120a44)}
.game-screen.opening .hud,.game-screen.opening .spell-panel,.game-screen.opening .spider-voice,.game-screen.opening .scene-caption{display:none}
.game-screen.opening #plasmaBurst{opacity:0}
.cutscene-help{display:none;position:absolute;z-index:8;left:calc(50% + 96px);top:42%;width:max-content;max-width:70vw;transform:translate(-50%,-100%);padding:10px 16px;border:2px solid #e0ffaf;border-radius:19px 19px 19px 5px;background:#102b23ed;color:#f7ffdb;font:850 clamp(18px,2.5vw,30px)/1.15 system-ui,sans-serif;text-shadow:0 0 9px #75ff83;box-shadow:0 4px 18px #0009,0 0 20px #7bfa6777;pointer-events:none}
.cutscene-help::after{content:"";position:absolute;bottom:-8px;left:17%;width:12px;height:12px;background:#102b23;border-right:2px solid #e0ffaf;border-bottom:2px solid #e0ffaf;transform:rotate(45deg)}
.game-screen.opening .cutscene-help{display:block;animation:pleaArrival 1.2s .45s ease-out both}
@keyframes roomArrival{from{opacity:0;filter:brightness(.35)}to{opacity:1;filter:brightness(1.45) saturate(1.12)}}
@keyframes pleaArrival{from{opacity:0;transform:translate(-50%,-85%) scale(.8)}to{opacity:1;transform:translate(-50%,-100%) scale(1)}}
@media(max-width:750px){
 .game-screen.opening.compact-scene .scene-svg{inset:12% auto auto 50%;width:min(80vw,450px);height:75%;transform:translateX(-50%)}
 .cutscene-help{font-size:clamp(16px,5vw,24px);padding:7px 10px}
}
@media(prefers-reduced-motion:reduce){.intro-screen .cover-title,.intro-screen .name-label,.intro-screen .player-name,.intro-screen #nameKeyboardHost,.intro-screen #nameNote,.intro-screen #startButton,.game-screen.opening .scene-art,.game-screen.opening .cutscene-help{animation:none;opacity:1}}

/* Classroom identity, difficulty choice, readable meters, and writing badges. */
.cover-brand,.game-brand{color:#e5ffd7;font:800 clamp(13px,1.4vw,18px)/1.2 system-ui,sans-serif;letter-spacing:.09em;text-shadow:0 2px 8px #000,0 0 13px #47fa7b;text-align:center}
.cover-brand{margin:0 0 10px;animation:coverAppear .7s .86s ease-out both}
.app:has(#intro:not([hidden])) .intro-screen{gap:10px}
.difficulty-picker{border:0;padding:0;margin:6px auto 9px;display:flex;justify-content:center;align-items:stretch;gap:9px;flex-wrap:wrap;animation:coverAppear .7s 1.25s ease-out both}
.difficulty-picker legend{width:100%;color:#d8f1dc;text-align:center;font:700 13px system-ui,sans-serif;letter-spacing:.04em;margin-bottom:7px}
.difficulty-option{min-width:110px;padding:8px 13px;color:#e8f6e6;background:#0a2521dc;border:1px solid #66af8f;border-radius:9px;font-weight:800}
.difficulty-option small{display:block;font:650 11px system-ui,sans-serif;margin-top:2px}
.difficulty-option[aria-pressed="true"]{color:#092118;background:#9cf3c1;border-color:#efffd4;box-shadow:0 0 16px #6efb9d81}
.app:has(#game:not([hidden])) .masthead{justify-content:center;align-items:center;flex-direction:column;top:7px;left:10px;right:10px;gap:2px}
.app:has(#game:not([hidden])) .masthead .game-title{width:clamp(250px,26vw,365px)}
.app:has(#game:not([hidden])) .game-brand{font-size:clamp(10px,.85vw,13px)}
.app:has(#game:not([hidden])) .header-actions{position:absolute;top:0;right:clamp(8px,2vw,30px);padding:0}
.app:has(#game:not([hidden])) .hud{top:var(--header-bottom,167px)}
.game-screen .web-meter{height:20px;background:#031810d4;box-shadow:0 0 12px #0009,0 0 10px #60e7af66}
.game-screen .pressure-status .web-meter{height:12px;background:#1d1615dd;box-shadow:0 0 10px #0009,0 0 8px #fc9b6177}
.game-screen .web-label,.game-screen .pressure-label{font-size:11px}
.game-screen .pressure-label strong{font-size:13px}
.badge-section{margin:22px 0 8px}.badge-section h3{font:800 15px system-ui,sans-serif;color:#c5fad7;letter-spacing:.07em;margin:0 0 10px}
.badge-rack{display:flex;justify-content:center;flex-wrap:wrap;gap:10px}
.skill-badge{display:flex;flex-direction:column;align-items:center;gap:2px;min-width:126px;border:1px solid #6b9178;border-radius:10px;padding:9px 12px;background:#142a25a8;color:#abc5b7}
.skill-badge>span{width:37px;height:37px;border:2px solid currentColor;border-radius:50%;font:900 22px/33px Georgia,serif}
.skill-badge strong{font-size:12px}.skill-badge small{font-size:11px}
.skill-badge.earned{background:#1a4833;color:#d9ff94;border-color:#a3ff92;box-shadow:0 0 17px #7dff554c}
.badge-toast{position:absolute;z-index:10;left:50%;bottom:calc(var(--panel-height,170px) + 22px);opacity:0;pointer-events:none;transform:translate(-50%,12px);padding:9px 17px;border:1px solid #d9ff96;border-radius:30px;background:#17432aea;color:#efffc6;font:900 clamp(15px,2vw,22px) system-ui,sans-serif;text-shadow:0 0 11px #b8ff75;white-space:nowrap}
.badge-toast.show{animation:badgePop 2.2s ease-out both}
@keyframes badgePop{0%{opacity:0;transform:translate(-50%,14px) scale(.82)}12%,75%{opacity:1;transform:translate(-50%,0) scale(1)}100%{opacity:0;transform:translate(-50%,-15px)}}
@media(max-width:750px){
 .app:has(#game:not([hidden])) .masthead .game-title{width:min(250px,48vw)}
 .app:has(#game:not([hidden])) .game-brand{font-size:9px;letter-spacing:.03em}
 .app:has(#game:not([hidden])) .header-actions{right:0;top:3px}
 .app:has(#game:not([hidden])) .header-actions .outline{width:37px;height:34px;padding:4px;font-size:0;line-height:1}
 .app:has(#game:not([hidden])) .header-actions kbd{display:none}
 .app:has(#game:not([hidden])) #musicButton::before{content:"♫";font-size:19px}
 .app:has(#game:not([hidden])) #helpButton::before{content:"?";font-size:19px}
 .game-screen .web-meter{height:15px}.game-screen .pressure-status .web-meter{height:9px}
 .game-screen .web-label,.game-screen .pressure-label{font-size:9px}.game-screen .pressure-label strong{font-size:11px}
 .skill-badge{min-width:92px;padding:7px 5px}.skill-badge strong{font-size:10px}
}
@media(max-width:450px){
 .app:has(#game:not([hidden])) .masthead .game-title{width:min(205px,52vw)}
 .app:has(#game:not([hidden])) .game-brand{font-size:8px}
 .app:has(#game:not([hidden])) .hud{top:var(--header-bottom,132px)}
}
@media(orientation:landscape) and (max-height:500px){
 .touch-mode .intro-screen .cover-title{grid-column:1;grid-row:1;width:min(210px,33vw)}
 .touch-mode .cover-brand{grid-column:1;grid-row:2;font-size:10px;margin:0}
 .touch-mode .player-name{grid-column:1;grid-row:3}
 .touch-mode .difficulty-picker{grid-column:1;grid-row:4;margin:0}.touch-mode #startButton{grid-column:1;grid-row:5}
 .touch-mode #nameKeyboardHost{grid-column:2;grid-row:2/6}
 .app:has(#game:not([hidden])) .masthead{left:0;right:0;top:3px}
 .app:has(#game:not([hidden])) .masthead .game-title{width:170px}
 .app:has(#game:not([hidden])) .hud{top:var(--header-bottom,93px)}
}
@media(prefers-reduced-motion:reduce){.cover-brand,.difficulty-picker{animation:none;opacity:1}}

/* Difficulty-aware spacebar defense between chapters. */
.game-screen.defending .spell-panel,.game-screen.defending .badge-toast{display:none}
.defense-panel{position:absolute;z-index:12;left:50%;bottom:clamp(15px,4svh,48px);transform:translateX(-50%);width:min(700px,calc(100% - 32px));padding:18px 22px 20px;border:1px solid #9bffbc;border-radius:16px;background:#071c1ce8;color:#f6ffe4;text-align:center;box-shadow:0 15px 48px #000c,0 0 30px #54fb8870;backdrop-filter:blur(11px)}
.defense-panel h2{font:800 clamp(27px,4vw,43px)/1.1 Georgia,serif;margin:4px 0;color:#ddffb0;text-shadow:0 0 18px #59ed72}
.defense-panel p:not(.eyebrow){font:650 clamp(14px,1.5vw,17px)/1.35 system-ui,sans-serif;margin:4px auto 12px;max-width:580px}
.defense-readout{display:flex;justify-content:center;align-items:baseline;gap:clamp(12px,3vw,32px);font:750 13px system-ui,sans-serif}
.defense-readout strong{font-size:clamp(23px,3vw,33px);color:#fff2bd;font-variant-numeric:tabular-nums}
.defense-meter{width:100%;height:16px;margin:10px auto 14px;border:1px solid #fcb0a9;border-radius:20px;background:#172c2c;overflow:hidden;box-shadow:0 0 9px #f8685888}
.defense-meter #defenseFill{height:100%;width:0;background:linear-gradient(90deg,#f49050,#ff484c);border-radius:inherit;transition:width .08s linear}
.defense-tap{min-width:min(320px,100%);min-height:62px;font-size:clamp(17px,2.3vw,23px);touch-action:manipulation;user-select:none;box-shadow:0 0 25px #6affab8a;transition:transform .08s ease,background-color .08s ease}
.defense-tap:active{transform:scale(.97);background-color:#b5ffd4}
.scene.reclaiming .scene-shade{background:linear-gradient(0deg,#07140d75,transparent 55%)}
.scene.reclaiming #plasmaBurst{animation-duration:.85s}
.scene.reclaiming .spider-voice{opacity:1;animation:defenseVoice 2.8s ease-in-out infinite alternate}
@keyframes defenseVoice{from{transform:translateY(5px) scale(.96)}to{transform:translateY(-3px) scale(1.04)}}
@media(max-width:750px){
 .defense-panel{bottom:max(10px,env(safe-area-inset-bottom));padding:13px 12px 15px}
 .defense-readout{gap:9px;font-size:11px;flex-wrap:wrap}
 .defense-readout strong{font-size:25px}
 .defense-meter{height:14px;margin:8px auto 12px}
 .defense-tap{min-height:66px;width:100%}
}
@media(orientation:landscape) and (max-height:500px){
 .defense-panel{left:auto;right:8px;bottom:8px;transform:none;width:min(50%,480px);padding:8px 10px}
 .defense-panel h2{font-size:23px}.defense-panel p:not(.eyebrow){font-size:11px;margin:1px 0 4px}
 .defense-readout strong{font-size:18px}.defense-meter{height:9px;margin:4px auto 6px}
 .defense-tap{min-height:40px;font-size:16px}
}
@media(prefers-reduced-motion:reduce){.scene.reclaiming .spider-voice{animation:none}}
@media(max-width:750px){.difficulty-option{min-width:90px;padding:7px 8px;font-size:12px}.difficulty-option small{font-size:10px}}

/* v0.25: two illustrated story beats before the child reaches the witch's room. */
.app:has(#prologue:not([hidden])){position:relative;width:100%;max-width:none;height:100svh;min-height:100svh;padding:0;overflow:hidden}
.app:has(#prologue:not([hidden])) .masthead,.app:has(#prologue:not([hidden])) footer{display:none}
.app:has(#prologue:not([hidden])) main{display:block;height:100%;min-height:0}
.prologue-screen{position:relative;height:100svh;overflow:hidden;background:#050b12;isolation:isolate}
.prologue-art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center center;animation:porchApproach 2.7s ease-out both}
.prologue-screen[data-beat="pull"] .prologue-art{animation:doorTug 2.4s ease-out both}
.prologue-tint{position:absolute;inset:0;background:linear-gradient(0deg,#02070ef0,transparent 32%,transparent 74%,#04101b72);pointer-events:none}
.prologue-narration{position:absolute;z-index:1;bottom:clamp(38px,8svh,110px);left:50%;width:min(92%,920px);margin:0;transform:translateX(-50%);text-align:center;color:#f5f0d6;font:750 clamp(21px,2.8vw,34px)/1.25 Georgia,serif;text-shadow:0 3px 13px #000,0 0 18px #002e25}
.prologue-speech{position:absolute;z-index:1;top:clamp(55px,7svh,120px);left:29%;margin:0;padding:10px 17px;border:2px solid #b4ffd7;border-radius:18px 18px 18px 3px;background:#0d2e2af0;color:#f8ffe8;font:800 clamp(17px,2vw,27px)/1.15 system-ui,sans-serif;box-shadow:0 0 24px #4ffbb063;text-shadow:0 0 10px #6dffb1}
.prologue-screen[data-beat="pull"] .prologue-speech{left:35%;top:7%}
.prologue-skip{position:absolute;z-index:2;top:max(18px,env(safe-area-inset-top));right:max(20px,env(safe-area-inset-right));background:#091a1bdc;font-size:14px}
@keyframes porchApproach{from{opacity:.12;transform:scale(1.04)}to{opacity:1;transform:scale(1)}}
@keyframes doorTug{from{opacity:.2;transform:scale(1) translateX(-.6%)}to{opacity:1;transform:scale(1.035) translateX(.5%)}}
@media(max-width:750px){.prologue-art{object-position:42% center}.prologue-speech{left:15%;top:15%;padding:7px 10px;font-size:16px}.prologue-screen[data-beat="pull"] .prologue-speech{left:16%;top:13%}.prologue-narration{bottom:max(60px,10svh);font-size:clamp(19px,5vw,27px)}.prologue-skip{top:max(42px,env(safe-area-inset-top));padding:7px 10px;font-size:12px}}
@media(prefers-reduced-motion:reduce){.prologue-art,.prologue-screen[data-beat="pull"] .prologue-art{animation:none;opacity:1;transform:none}}

/* v0.26: a grounded character, visible floor, and a readable defense beat. */
.game-screen .scene-art{
  background-image:url('assets/spider-witch-floor.webp');
  background-position:center center;
  background-size:cover;
  filter:brightness(1.16) saturate(1.08);
}
.game-screen .scene-shade{
  background:linear-gradient(180deg,#0714118f 0%,#06171716 26%,transparent 53%,#03100f6e 100%),
    linear-gradient(90deg,#05100c44,transparent 20%,transparent 80%,#05100c44);
}
#childFloorShadow{filter:blur(4px)}
.game-screen .prompt-row{display:none!important}
.game-screen .answer-bottom #feedback{
  position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;
  overflow:hidden!important;clip-path:inset(50%)!important;white-space:nowrap!important;
}
.game-screen .answer-bottom{min-height:0;height:0}
.game-screen .answer-bottom #answerTip{display:none}
.window-cheer{
  position:absolute;z-index:4;right:12%;top:19%;padding:9px 15px;
  border-radius:22px 22px 6px 22px;border:2px solid #caffb4;
  background:#112d20eb;color:#f7ffe9;font:850 clamp(16px,2.4vw,29px)/1.1 system-ui,sans-serif;
  box-shadow:0 0 18px #53f7ae88,0 5px 20px #000b;pointer-events:none;
  animation:windowEncourage 9s ease-in-out infinite;
}
.window-cheer::after{content:"";position:absolute;right:16px;bottom:-9px;width:13px;height:13px;background:#112d20;transform:rotate(45deg);border-right:2px solid #caffb4;border-bottom:2px solid #caffb4}
@keyframes windowEncourage{0%,16%,54%,100%{opacity:0;transform:translateY(8px)}21%,48%{opacity:1;transform:translateY(0)}}
.defense-echoes{position:absolute;z-index:3;inset:0;overflow:hidden;pointer-events:none;transition:opacity .12s linear}
.defense-echoes .echo-line{
  position:absolute;left:50%;top:calc(27% + var(--line) * 7%);width:max-content;max-width:75%;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  padding:6px 14px;border:1px solid #baffab70;border-radius:18px;
  background:#07140dbb;color:#d9ffbd;text-shadow:0 0 11px #79ffae;
  font:750 clamp(13px,1.55vw,21px)/1.2 Georgia,serif;
  animation:echoReturn 4.2s ease-in-out infinite;animation-delay:calc(var(--line) * -.55s);
}
@keyframes echoReturn{
  0%,100%{opacity:.25;transform:translate(-85%,12px) rotate(-2deg) scale(.94)}
  40%,75%{opacity:1;transform:translate(-45%,-7px) rotate(1deg) scale(1)}
}
.defense-cue{
  position:absolute;z-index:8;left:50%;top:18%;width:max-content;max-width:95%;
  padding:11px 24px;transform:translateX(-50%);border:2px solid #dcff9e;border-radius:14px;
  background:#0a251bdc;color:#f8ffc9;text-align:center;
  font:950 clamp(22px,4vw,54px)/1.05 system-ui,sans-serif;text-shadow:0 0 18px #81ff6a;
  box-shadow:0 0 35px #7bfa7c8f;pointer-events:none;
  animation:defenseCall 1.65s ease-in-out infinite;
}
@keyframes defenseCall{0%,100%{opacity:.27;filter:brightness(.8)}43%{opacity:1;filter:brightness(1.4)}}
.interlude{position:absolute;z-index:20;inset:0;overflow:hidden;background:#07130e}
.interlude img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center}
.interlude-shade{position:absolute;inset:0;background:linear-gradient(0deg,#04100cc4,transparent 44%),linear-gradient(90deg,#020b096e,transparent 42%,#020b096e)}
.interlude h2{
  position:absolute;left:50%;bottom:17%;width:max-content;max-width:90%;margin:0;transform:translateX(-50%);
  font:900 clamp(47px,9vw,116px)/1 Georgia,serif;color:#dcffb5;
  text-shadow:0 0 25px #2cff72,0 8px 25px #000;animation:interludeTitle 1.05s .9s both;
}
.interlude-cheer{
  position:absolute;right:12%;top:18%;margin:0;padding:10px 17px;
  color:#efffcb;background:#123423ed;border:2px solid #ceffb4;border-radius:22px 22px 5px 22px;
  font:850 clamp(17px,2.6vw,30px) system-ui,sans-serif;box-shadow:0 0 24px #80ff9c;
  animation:interludeTitle .8s 1.4s both;
}
.interlude-continue{position:absolute;right:clamp(12px,4vw,50px);bottom:clamp(15px,4svh,48px);z-index:2;background:#09271bd9;color:#f5ffe9}
@keyframes interludeTitle{from{opacity:0;filter:blur(12px)}to{opacity:1;filter:blur(0)}}
@media(max-width:750px){
  .game-screen .scene-art{background-position:54% center}
  .window-cheer{right:5%;top:26%;font-size:16px;padding:6px 9px}
  .defense-cue{top:25%;font-size:clamp(21px,6vw,32px);padding:8px 11px}
  .defense-echoes .echo-line{top:calc(38% + var(--line) * 7%);max-width:93%;font-size:12px;padding:4px 8px}
  .interlude img{object-position:53% center}
  .interlude h2{bottom:24%}.interlude-cheer{right:5%;top:25%;font-size:17px}
}
@media(prefers-reduced-motion:reduce){.window-cheer,.defense-cue,.defense-echoes .echo-line,.interlude h2,.interlude-cheer{animation:none;opacity:1}}

/* v0.27: letter defenses and a real pause overlay. */
.defense-keys{display:flex;justify-content:center;flex-wrap:wrap;gap:clamp(6px,1.1vw,13px);margin:12px auto 0}
.defense-keys button{min-width:clamp(42px,6vw,72px);min-height:clamp(46px,7svh,68px);padding:6px;
  font:900 clamp(20px,3vw,31px) system-ui,sans-serif;color:#d9e6d8;
  border:2px solid #638b7a;background:#092920dd;touch-action:manipulation;user-select:none}
.defense-keys button.needed{color:#102c1a;background:#baff9c;border-color:#f1ffca;box-shadow:0 0 24px #75ff96}
.defense-keys button:active{transform:scale(.93)}
.game-screen.paused .scene,.game-screen.paused .hud,.game-screen.paused .spell-panel,.game-screen.paused .defense-panel{
  filter:brightness(.45);pointer-events:none}
.pause-panel{position:absolute;inset:0;z-index:30;display:flex;flex-direction:column;justify-content:center;align-items:center;
  gap:15px;padding:25px;text-align:center;background:#04100dcc;backdrop-filter:blur(10px)}
.pause-panel h2{margin:0;color:#c9ffb8;font:900 clamp(46px,8vw,92px) Georgia,serif;text-shadow:0 0 25px #45ee83}
.pause-panel p{margin:0 0 12px;font:650 clamp(16px,2vw,23px) system-ui,sans-serif}
.pause-panel button{min-width:min(330px,90vw);min-height:52px;font-size:18px}
@media(max-width:750px){
  .defense-keys{gap:5px;margin:7px auto 0}
  .defense-keys button{min-width:40px;min-height:52px;font-size:20px}
  .app:has(#game:not([hidden])) .masthead .header-actions{gap:5px}
  .app:has(#game:not([hidden])) #pauseButton{font-size:12px;padding:7px 9px}
}
@media(orientation:landscape) and (max-height:500px){.defense-keys button{min-width:36px;min-height:36px;font-size:18px}}
.app:has(#game:not([hidden])) #scoresButton{display:none}
.game-screen .defense-cue{top:31%}
@media(max-width:750px){.game-screen .defense-cue{top:29%}}

/* v0.28: a ten-second tap race, readable HELP slots, and the escape illustration. */
.defense-panel.tap-rush .defense-meter{border-color:#a9ffc9;box-shadow:0 0 12px #55ffab9c}
.defense-panel.tap-rush #defenseFill{background:linear-gradient(90deg,#35ba8c,#9eff78,#f4ffb3);box-shadow:0 0 12px #b2ff91}
.defense-panel.tap-rush #defenseCount{font-weight:900;color:#e7ff9a;font-variant-numeric:tabular-nums}
.help-sequence{display:flex;justify-content:center;align-items:center;gap:clamp(9px,2vw,22px);margin:9px auto 14px}
.help-sequence span{display:grid;place-items:center;width:clamp(50px,6vw,78px);height:clamp(57px,7svh,80px);
  border:2px solid #7ac99b;border-radius:14px;background:#0c251ef2;color:#c9e9ca;
  font:950 clamp(35px,4vw,54px)/1 system-ui,sans-serif;box-shadow:0 0 9px #39cf7a55;
  animation:helpLetterCycle 2.8s infinite}
.help-sequence span:nth-child(2){animation-delay:.7s}
.help-sequence span:nth-child(3){animation-delay:1.4s}
.help-sequence span:nth-child(4){animation-delay:2.1s}
.help-sequence span.collected{animation:none;color:#123019;background:#b9ff91;border-color:#f2ffc6;box-shadow:0 0 26px #7afa86}
@keyframes helpLetterCycle{0%,22%{color:#102d19;background:#d7ff84;border-color:#f6ffbb;box-shadow:0 0 30px #8fff77;transform:translateY(-5px)}24%,100%{color:#c9e9ca;background:#0c251ef2;border-color:#7ac99b;box-shadow:0 0 9px #39cf7a55;transform:none}}
.outcome-screen.won{position:fixed;inset:0;z-index:20;max-width:none;width:100vw;height:100svh;overflow:auto;
  display:flex;flex-direction:column;align-items:flex-end;justify-content:center;gap:0;
  padding:clamp(20px,4vw,60px);border:0;border-radius:0;box-shadow:none;background:#081322;text-align:left;isolation:isolate}
.outcome-screen.won .ending-art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center;z-index:0}
.outcome-screen.won::before{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;
  background:linear-gradient(90deg,#07161d04 21%,#06131a70 53%,#06151ee9 100%)}
.outcome-screen.won > :not(.ending-art){position:relative;z-index:2;width:min(540px,44vw);margin-right:clamp(12px,3vw,50px)}
.outcome-screen.won h2{color:#e9ffd2;text-shadow:0 0 23px #6eff96,0 4px 15px #000;margin-top:8px;margin-bottom:8px}
.outcome-screen.won p:not(.eyebrow){color:#f5ffe9;text-shadow:0 2px 9px #000;font-size:clamp(16px,1.4vw,20px);line-height:1.45}
.outcome-screen.won .badge-section{margin-top:12px}
.outcome-screen.won .outcome-actions{justify-content:flex-start;margin-top:12px}
@media(max-width:750px){
  .help-sequence{gap:7px;margin:4px auto 8px}
  .help-sequence span{width:48px;height:54px;font-size:34px}
  .outcome-screen.won{align-items:center;justify-content:flex-end;text-align:center;padding:18px 14px max(20px,env(safe-area-inset-bottom))}
  .outcome-screen.won .ending-art{object-position:20% center}
  .outcome-screen.won::before{background:linear-gradient(0deg,#031015f5 0%,#031015e4 37%,#04131b12 82%)}
  .outcome-screen.won > :not(.ending-art){width:min(540px,100%);margin-right:0}
  .outcome-screen.won h2{font-size:clamp(37px,9vw,62px)}
  .outcome-screen.won p:not(.eyebrow){font-size:15px;margin:5px 0}
  .outcome-screen.won .badge-section{margin:7px 0}
  .outcome-screen.won .skill-badge{min-width:90px;padding:4px 6px}
  .outcome-screen.won .outcome-actions{justify-content:center}
}
@media(prefers-reduced-motion:reduce){.help-sequence span{animation:none}}

/* v0.31: two sequential full-screen escape illustrations. */
.escape-screen{position:fixed;inset:0;z-index:20;width:100vw;height:100svh;overflow:hidden;background:#080e17;isolation:isolate}
.escape-screen img{width:100%;height:100%;object-fit:cover;object-position:center;animation:escapeRun 3.4s ease-out both}
.escape-screen::after{content:"";position:absolute;inset:0;background:linear-gradient(0deg,#03120f8c,transparent 25%);pointer-events:none}
.escape-continue{position:absolute;right:clamp(16px,4vw,60px);bottom:clamp(18px,5vh,55px);z-index:2;background:#09231ddc;color:#f2fff0;font-size:18px}
.outcome-screen.won{animation:escapeResult .7s ease-out both}
@keyframes escapeRun{from{transform:scale(1.035) translateX(1%)}to{transform:scale(1) translateX(-.5%)}}
@keyframes escapeResult{from{opacity:0}to{opacity:1}}
@media(max-width:750px){.escape-screen img{object-position:47% center}.escape-continue{bottom:max(24px,env(safe-area-inset-bottom));right:20px;font-size:15px}}
@media(prefers-reduced-motion:reduce){.escape-screen img,.outcome-screen.won{animation:none}}
