:root{color-scheme:dark;--bg:#101918;--panel:#172320;--line:#2d3c34;--text:#eeeadd;--muted:#98a99b;--gold:#dfbe77;--green:#a9c8a1}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px/1.65 system-ui,-apple-system,'Apple SD Gothic Neo','Malgun Gothic',sans-serif}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;color:inherit;border:1px solid var(--line);background:transparent;border-radius:5px;padding:8px 12px}button:hover{background:#2b3a2d;border-color:#718264}button:focus-visible,a:focus-visible{outline:2px solid var(--gold);outline-offset:4px}header{height:83px;padding:0 4%;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between}.brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--text);font-size:23px;font-family:serif;font-weight:bold}.brand small{font-family:system-ui;font-weight:400;font-size:12px;color:var(--muted);margin-left:10px}.seal{background:#ba6049;color:#ffebce;font-size:25px;width:37px;height:40px;text-align:center;line-height:40px}nav{display:flex;gap:14px;align-items:center}nav button{border:0;color:var(--muted);font-size:12px}.tag{font-size:11px;color:var(--gold);letter-spacing:2px;margin-right:15px}main{max-width:1540px;margin:auto;padding:34px 4% 18px}.heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:27px}.eyebrow{font-size:10px;letter-spacing:3px;color:var(--gold);margin:0 0 8px}h1{font-family:serif;font-size:33px;font-weight:500;letter-spacing:-1px;line-height:1.4;margin:0 0 6px}.heading p:last-child{color:var(--muted);margin:0;font-size:13px}.edition{text-align:right;font-family:serif;font-size:16px}.edition span{display:block;font:11px system-ui;color:var(--muted);margin-top:8px}.layout{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:22px}.play{overflow:hidden;border:1px solid #42503e;border-radius:8px;background:#111b18}.scene-bar{height:43px;display:flex;align-items:center;justify-content:space-between;padding:0 20px;font-size:11px;color:#c3ccba}.scene-bar>div{display:flex;align-items:center;gap:9px}.live{width:6px;height:6px;border-radius:100%;background:#b1d1a1}#realm{color:var(--gold);border:1px solid #5a563c;border-radius:3px;padding:0 7px;font-size:10px}.viewport{position:relative;aspect-ratio:1024/560;overflow:hidden;background:#1a302c}canvas{width:100%;height:100%;display:block;image-rendering:pixelated}.chapter-label{position:absolute;top:22px;left:24px;pointer-events:none;text-shadow:0 2px 5px #000}.chapter-label span{font-size:9px;letter-spacing:2px;color:#d7cdab;display:block}.chapter-label strong{font:20px/1.8 serif}.bottom-hud{position:absolute;bottom:17px;left:21px;right:21px;display:flex;justify-content:space-between;pointer-events:none}.bottom-hud>span{background:#10201ddd;border:1px solid #77805c55;border-radius:4px;padding:6px 12px;font-size:11px}.bottom-hud small{color:#9aab93;margin-left:12px}.bottom-hud>span:last-child{color:var(--gold)}.controls{display:flex;align-items:center;gap:18px;padding:13px 17px;color:var(--muted);font-size:10px}.controls span{display:flex;align-items:center;gap:4px}kbd{font:10px system-ui;border:1px solid #4e5b4a;border-radius:3px;padding:1px 5px;background:#223025;color:#c6cbb6}em{font-style:normal;margin:0 6px}.controls button{margin-left:auto;border:0;padding:0;font-size:11px;color:var(--muted)}aside{border:1px solid var(--line);border-radius:8px;background:var(--panel);overflow:hidden}.tabs{display:flex;border-bottom:1px solid var(--line);padding:0 14px;gap:15px}.tabs button{border:0;border-radius:0;font-size:12px;padding:15px 4px;color:var(--muted)}.tabs button[aria-selected=true]{color:var(--gold);border-bottom:2px solid var(--gold)}#side{padding:22px 20px;max-height:565px;overflow:auto}.overline{font-size:10px;letter-spacing:2px;color:var(--gold)}h3{font:23px/1.5 serif;margin:8px 0 13px}.objective{font-size:13px;line-height:1.9;color:#c4cebe;margin-bottom:18px}.mission{border:1px solid #46523c;background:#222f24;padding:14px;border-radius:5px;margin:18px 0;font-size:12px}.mission small{display:block;color:var(--gold);font-size:9px;letter-spacing:2px;margin-bottom:7px}.progress{height:3px;background:#354033;margin:18px 0 10px}.progress i{display:block;background:var(--gold);height:100%}.progress-label{display:flex;justify-content:space-between;color:var(--muted);font-size:10px}.chapters{margin-top:19px}.chapter-row{display:flex;gap:10px;align-items:center;width:100%;border:0;text-align:left;padding:9px 0;color:#85947f;font-size:11px}.chapter-row.active{color:#f2dfad}.chapter-row .num{border:1px solid #44513c;border-radius:50%;font-size:9px;width:23px;height:23px;display:grid;place-items:center;flex-shrink:0}.chapter-row.done .num{color:#c8d8a3;border-color:#7e8e60}.chapter-row:disabled{opacity:.45;cursor:default}footer{display:flex;justify-content:space-between;color:#71816f;font-size:10px;margin-top:19px}footer button{border:0;padding:0;margin-left:14px;font-size:10px;color:#b5b99c}.start{position:absolute;inset:0;background:linear-gradient(90deg,#10251bc9,#0d211a58);display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center}.start h2{font:clamp(28px,4vw,55px)/1.4 serif;letter-spacing:3px;margin:8px 0;color:#fff2cd;text-shadow:0 3px 0 #23331f}.start>p:not(.eyebrow){color:#d3d9be;font-size:13px}.primary{background:#dfc17e;color:#203022;border:1px solid #f0d69b;padding:12px 24px;min-width:210px;font-weight:650;margin-top:20px;box-shadow:0 4px 0 #736443}.primary:hover{background:#f0d69b;color:#1a2e21}.primary span{margin-left:24px}.start-hint{font-size:10px;color:#b9c2a5;margin-top:20px}.hidden{display:none!important}.interact{position:absolute;bottom:67px;left:50%;transform:translateX(-50%);background:#14231cec;color:#f2dfac;border:1px solid #a6aa75;padding:7px 14px;white-space:nowrap;font-size:11px;border-radius:4px;display:none}.dialog{position:absolute;bottom:16px;left:18px;right:18px;display:flex;gap:18px;padding:19px;background:#14231cf5;border:1px solid #bbab76;box-shadow:0 3px 0 #0008;border-radius:5px;min-height:147px}.portrait{width:62px;height:76px;flex-shrink:0;background:#2a3c2b;border:1px solid #586644;display:grid;place-items:center;font:30px serif;color:var(--gold)}.speech{flex:1;min-width:0}.speaker{display:flex;justify-content:space-between;align-items:center}.speaker strong{color:var(--gold);font-size:13px}.speaker span{font-size:9px;color:var(--muted)}.speech p{font-size:14px;line-height:1.8;margin:7px 0 5px}.speech button{display:block;margin-left:auto;border:0;padding:1px 0;font-size:10px;color:var(--gold)}.speech kbd{margin-left:9px}.modal{position:fixed;inset:0;background:#07120fd9;z-index:10;display:grid;place-items:center;padding:20px;backdrop-filter:blur(5px)}.modal>section{position:relative;width:min(620px,100%);max-height:88vh;overflow:hidden;background:#1a2921;border:1px solid #7e8057;border-radius:8px;padding:32px}.modal h2{font:28px serif;margin:5px 0 20px}.modal p{color:#bdcbb9;line-height:1.9;font-size:14px}#closeModal{position:absolute;right:13px;top:10px;border:0;font-size:24px;padding:0 8px}.answers{display:grid;gap:9px;margin:20px 0}.answers button{text-align:left;padding:12px 16px;font-size:13px}.answers button.correct{border-color:#bbd18c;background:#30472b}.answers button.wrong{border-color:#c77e68}.result{color:var(--gold)!important}.person{padding:12px 0;border-bottom:1px solid var(--line)}.person strong{font-size:14px}.person small{display:block;color:var(--gold);font-size:10px}.person p,.journal p{font-size:11px;color:var(--muted);line-height:1.9}.person.locked{opacity:.5}.journal{border-bottom:1px solid var(--line);padding:10px 0}.journal strong{font:15px serif}.journal small{color:var(--gold);font-size:10px}.touch{display:none;padding:10px;justify-content:space-between;border-top:1px solid var(--line)}.touch button{touch-action:none;padding:12px}.touch>div{display:flex;gap:5px}.touch>button{color:var(--gold)}body.large .heading,body.large header,body.large footer{display:none}body.large main{padding:12px;max-width:1800px}body.large .layout{grid-template-columns:minmax(0,1fr) 290px}@media(pointer:coarse){.touch{display:flex}.controls{display:none}}@media(max-width:1050px){.layout{grid-template-columns:minmax(0,1fr) 270px;gap:14px}main{padding:25px 3%}#side{padding:17px 15px}.controls{gap:7px}.controls span{font-size:9px}.controls kbd{font-size:8px}h1{font-size:29px}}@media(max-width:780px){header{height:66px;padding:0 5%}.brand{font-size:21px}.brand small,.tag,.edition{display:none}nav{gap:2px}nav button{font-size:10px;padding:8px}main{padding:23px 4%}.heading{margin-bottom:20px}h1{font-size:27px}.eyebrow{font-size:8px}.layout,body.large .layout{grid-template-columns:1fr}.viewport{aspect-ratio:4/3}canvas{object-fit:cover}.scene-bar{padding:0 12px}.chapter-label{left:14px;top:14px}.chapter-label strong{font-size:17px}.start h2{font-size:32px}.start-hint{font-size:9px}.start>p:not(.eyebrow){font-size:11px}.dialog{left:9px;right:9px;bottom:10px;padding:12px;gap:10px;min-height:145px}.portrait{width:36px;height:49px;font-size:22px}.speech p{font-size:12px}.speaker span{font-size:8px}.bottom-hud{left:12px;right:12px;bottom:13px}.bottom-hud>span{font-size:9px;padding:5px 8px}#side{max-height:350px;padding:18px 20px}.chapters{display:grid;grid-template-columns:1fr 1fr;column-gap:14px}.controls{flex-wrap:wrap}.touch{display:flex}footer{display:block;font-size:9px}footer>span{display:block;margin-top:5px}.modal>section{padding:25px}.modal h2{font-size:23px}.modal p{font-size:12px}}
.layout{align-items:start}@media(min-width:951px){#side{height:550px}}@media(min-width:781px) and (max-width:950px){.layout,body.large .layout{grid-template-columns:1fr}.edition{display:none}#side{max-height:320px}.chapters{display:grid;grid-template-columns:1fr 1fr}aside{width:100%}}@media(max-width:780px){canvas{object-fit:fill}}
/* The art stays pixel-crisp; names and dialogue use the device's full text resolution. */
.scene-labels{position:absolute;inset:0;pointer-events:none}.npc-label{position:absolute;transform:translateX(-50%);white-space:nowrap;line-height:1.4}.npc-label span{display:block;background:#13251ded;border:1px solid #d8cd9a80;box-shadow:0 2px 5px #091a1966;border-radius:4px;padding:3px 9px;color:#fff5d7;font-size:12px;font-weight:650;text-shadow:none}.fairy-label span{font-size:10px;padding:2px 4px}.portrait{width:88px;height:106px;background:radial-gradient(ellipse at center,#687960,#283d31);overflow:hidden;border-color:#9c9c6b}.cast-portrait{display:block;width:100%;height:100%;background-image:none;background-repeat:no-repeat;background-size:400% 300%;background-position:calc(var(--col)*100% / 3) calc(var(--row)*100% / 2);image-rendering:pixelated}.codex-portrait{float:left;width:72px;height:85px;margin:0 10px 6px 0;background-color:#304737;border-radius:5px;border:1px solid #5e7454}.person{min-height:100px;display:flow-root}.narrator-mark{font:36px serif;color:#e3c78b}.chapter-label{background:linear-gradient(90deg,#10251ac9,transparent);padding:7px 18px 9px 10px;border-left:2px solid #e1cb91;top:15px;left:16px}.dialog{background:linear-gradient(110deg,#122820f9,#1f3228f5);min-height:158px;align-items:center;box-shadow:0 5px 22px #08181188}.speech p{font-size:15px}.viewport{isolation:isolate}#sceneLabels{transition:opacity .2s}.viewport:has(.dialog:not(.hidden)) #sceneLabels,.viewport:has(.start:not(.hidden)) #sceneLabels{opacity:0}.start{background:linear-gradient(90deg,#0e251ae8,#0d211a45)}.start h2{text-shadow:0 3px 7px #172e21}.bottom-hud{bottom:12px}.bottom-hud>span{box-shadow:0 2px 7px #10271b66}@media(max-width:780px){.npc-label span{font-size:11px;padding:2px 6px}.fairy-label span{font-size:8px;padding:2px}.portrait{width:60px;height:80px}.speech p{font-size:13px}.dialog{min-height:158px;gap:10px}.chapter-label{top:12px;left:12px;padding:3px 10px}.scene-labels{font-smooth:auto}}@media(prefers-reduced-motion:reduce){*{transition:none!important}}
.event-orb{display:grid;place-items:center;margin:-56px auto 20px;width:32px;height:32px;border:1px solid #e7d393;background:radial-gradient(#efdda0,#806b3dcc);border-radius:50%;font:18px serif;color:#25392c;box-shadow:0 0 12px #f5dea777;animation:orbGlow 3s ease-in-out infinite}.beat-list{list-style:none;padding:0;margin:14px 0 23px;font-size:11px;color:#849880}.beat-list li{padding:6px 0 6px 12px;border-left:1px solid #40533b}.beat-list .current{color:#edcf86;border-color:#dfbe77}.beat-list .finished{color:#bfd6a7}.journal details{margin:9px 0;font-size:11px}.journal summary{cursor:pointer;color:#cfbd83}.journal h4{font-size:12px;color:#e0c893;margin:15px 0 8px}.journal details p{font-size:12px}.answers button[aria-pressed=true]{border-color:#dfbe77;background:#3c4b2c}.controls #log{margin-left:auto}.controls #focus{margin-left:0}@keyframes orbGlow{50%{box-shadow:0 0 20px #f5dea7bb}}@media(prefers-reduced-motion:reduce){.event-orb{animation:none}}
.npc-label.quest-later{opacity:.65}.npc-label.quest-current span{border-color:#f2d98d;box-shadow:0 0 9px #f5d98d55}.npc-label.quest-done span{border-color:#6d8c64;color:#cfdec6}.quest-later .event-orb{animation:none;box-shadow:none;filter:saturate(.5)}.controls{flex-wrap:wrap}.touch #touchLog{font-size:17px;color:#dbc281;padding:9px}.touch{gap:5px}@media(max-width:380px){.touch button{padding:9px}.touch>div{gap:3px}}
.cast-portrait{background-image:none!important;object-fit:contain;object-position:center;max-width:100%;padding:5px}.codex-portrait{object-fit:contain}.start-new{margin-top:14px;border-color:#c5c49a66;color:#ece8cf;font-size:12px;background:#1c3428b0;padding:7px 23px}.scene-toast{position:absolute;top:77px;left:50%;transform:translateX(-50%);max-width:90%;padding:8px 14px;border:1px solid #d4c28e77;background:#13291de8;color:#f1e6bf;font-size:12px;border-radius:5px;z-index:2;pointer-events:none;text-align:center}.dialog{transition:opacity .2s,transform .2s}.dialog:not(.hidden){animation:dialogArrive .2s ease-out}#line{min-height:3.6em}.npc-label{will-change:left;transition:opacity .2s}.chapter-label{max-width:85%}#restart{color:#e0c587}select{padding:12px;background:#20392c;color:#efe4c6;border:1px solid #b2a579;width:100%;font:inherit}@keyframes dialogArrive{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:translateY(0)}}@media(max-width:780px){nav{gap:0}nav button{padding:6px;font-size:9px}header{padding:0 3%}.brand{font-size:18px}.seal{width:29px;height:33px;line-height:33px;font-size:21px}.start h2{font-size:28px}.start-hint{margin-top:10px}.primary{margin-top:10px}.start-new{margin-top:9px}.scene-toast{top:65px;font-size:10px;padding:5px 9px}.chapter-label span{font-size:8px}.chapter-label strong{font-size:16px}}
.target-beacon{position:absolute;z-index:3;transform:translate(-50%,-100%);display:flex;align-items:center;flex-direction:column;pointer-events:none;filter:drop-shadow(0 3px 5px #071b12);white-space:nowrap}.target-beacon b{display:grid;place-items:center;width:32px;height:32px;background:#ffe49a;color:#20352a;border:2px solid #fff8d6;border-radius:50%;font:bold 24px/1 system-ui;box-shadow:0 0 20px #ffdb8688;animation:beaconPulse 1.5s ease-in-out infinite}.target-beacon span{margin-top:5px;background:#fff1c8;color:#19372b;font-size:10px;font-weight:800;padding:2px 9px;border-radius:3px 3px 0 0}.target-beacon strong{background:#10291ff5;border:1px solid #ffe5a1;padding:3px 11px;border-radius:0 0 4px 4px;color:#fff5d5;font-size:13px}.gate-notice{position:absolute;right:13px;bottom:105px;left:13px;padding:9px;background:#47341af0;border:1px solid #ffd99b;color:#fff0c9;font-size:12px;text-align:center;z-index:4;border-radius:5px}.npc-label.quest-current span{background:#102b20;border:2px solid #ffe3a0;color:#fff;font-weight:800;box-shadow:0 2px 9px #081b13}.scene-toast{z-index:5}.target-beacon:after{content:'';width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-top:7px solid #ffe49a}@keyframes beaconPulse{50%{transform:translateY(-4px);box-shadow:0 0 27px #ffe7a8cc}}@media(max-width:780px){.target-beacon b{width:25px;height:25px;font-size:19px}.target-beacon span{font-size:9px;padding:1px 6px}.target-beacon strong{font-size:11px;padding:2px 7px}.gate-notice{font-size:11px;bottom:68px}.target-beacon{z-index:2}}@media(prefers-reduced-motion:reduce){.target-beacon b{animation:none}}
/* Three explicit planes: distant painting / solid walking platform + actors / close cropped props. */
#distantWorld{position:absolute;inset:0;z-index:0;width:100%;height:100%;image-rendering:auto;filter:blur(.55px) saturate(.72) contrast(.8) brightness(1.06);transform:scale(1.005);pointer-events:none}#world{position:relative;z-index:1;background:transparent}.scene-labels{z-index:2}.chapter-label{z-index:3}.bottom-hud{z-index:3}.interact{z-index:4}.dialog{z-index:7}.start{z-index:8}.viewport{background:#718b7d}
#distantWorld{filter:blur(.9px) saturate(.65) contrast(.74) brightness(1.08)}.scene-toast{top:auto;bottom:12px;max-width:88%;font-size:11px}
/* The game owns the page; reference material opens only on demand. */
.layout,body.large .layout{display:block!important;grid-template-columns:1fr!important}main{max-width:1440px;padding-top:23px}.heading{margin-bottom:19px}.heading h1{font-size:28px}.scene-bar{height:auto;min-height:51px;gap:12px;flex-wrap:wrap;padding:9px 17px}.scene-tools{display:flex;align-items:center;gap:12px}.game-menus{display:flex;gap:6px;align-items:center}.game-menus button{border:1px solid #64745266;border-radius:4px;padding:6px 11px;font-size:11px;white-space:nowrap;color:#e3d8b5;background:#203328}.game-menus button:hover,.game-menus button[aria-expanded=true]{color:#fff0be;border-color:#c6b67b;background:#35442b}.viewport{max-height:calc(100svh - 210px);min-height:320px;aspect-ratio:1024/560}.play{width:100%}.library-overlay{position:fixed;inset:0;background:#061811b5;z-index:30;backdrop-filter:blur(3px);display:flex;justify-content:flex-end}.library-drawer{height:100%;width:min(470px,95vw);overflow:auto;background:#17271e;border-left:1px solid #9d996655;box-shadow:-15px 0 60px #07150a77;animation:drawerArrive .18s ease-out}.library-header{position:sticky;top:0;z-index:2;display:flex;align-items:center;justify-content:space-between;height:auto;min-height:100px;padding:24px;background:#17271ef7;border-bottom:1px solid #67734a55}.library-header small{font-size:10px;color:#cfbc81;letter-spacing:2px}.library-header h2{font:26px/1.5 serif;margin:4px 0 0}.library-header button{font-size:28px;border:0;padding:0 8px}#libraryOverlay #side{height:auto;max-height:none;overflow:visible;padding:24px}.library-drawer .chapters{display:block}.library-drawer .chapter-row{font-size:13px;padding:12px 0}.return-game{position:sticky;bottom:0;width:100%;border-radius:0;border-width:1px 0 0;border-color:#6b744e;background:#22392af5;padding:17px;color:#efdaa5}.library-open{overflow:hidden}.chapter-intro{position:absolute;inset:0;z-index:10;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:25px 8%;background:radial-gradient(ellipse at 50% 40%,#253d2bf2,#0b201bf9 72%);color:#f0e8ce;animation:chapterArrive .5s ease-out}.intro-overline{font-size:10px;letter-spacing:4px;color:#c9bf95}.intro-number{font:clamp(18px,2.6vw,32px)/1.5 serif;letter-spacing:6px;color:#dec68c;margin-top:24px}.intro-rule{width:55px;height:1px;background:#d5b878;margin:18px 0}.chapter-intro h2{font:clamp(27px,4vw,49px)/1.35 serif;letter-spacing:1px;margin:0 0 16px}.chapter-intro #introPlace{font-size:12px;color:#b6c6a9;letter-spacing:1px}.chapter-intro p{max-width:540px;font-size:15px;line-height:2;color:#d3d9bf;margin:20px 0 12px;word-break:keep-all}.chapter-intro small{color:#859a7b;font-size:10px;margin-top:18px}.chapter-intro .primary{margin-top:12px}.viewport:has(.chapter-intro:not(.hidden)) .target-beacon,.viewport:has(.chapter-intro:not(.hidden)) .chapter-label,.viewport:has(.chapter-intro:not(.hidden)) .bottom-hud,.viewport:has(.chapter-intro:not(.hidden)) .scene-toast{visibility:hidden}@keyframes drawerArrive{from{transform:translateX(30px);opacity:0}to{transform:translateX(0);opacity:1}}@keyframes chapterArrive{from{opacity:0}to{opacity:1}}@media(min-width:1000px){.heading{display:none}main{padding-top:22px}.viewport{max-height:calc(100svh - 200px)}}@media(max-width:780px){main{padding-top:14px}.heading{display:none}.scene-bar{padding:8px 10px;gap:6px}.scene-tools{gap:7px;margin-left:auto}.game-menus{gap:4px}.game-menus button{padding:6px;font-size:10px}.scene-bar>div:first-child{font-size:10px}#realm{font-size:9px}.viewport{min-height:290px;max-height:none;aspect-ratio:4/3}.intro-overline{font-size:8px;letter-spacing:2px}.intro-number{margin-top:8px;font-size:16px}.intro-rule{margin:11px 0}.chapter-intro h2{font-size:27px;margin-bottom:9px}.chapter-intro p{font-size:12px;line-height:1.8;margin:12px 0 8px}.chapter-intro #introPlace{font-size:10px}.chapter-intro small{margin-top:10px;font-size:9px}.chapter-intro{padding:18px 7%}.chapter-intro .primary{font-size:12px;padding:9px 17px}.library-header{min-height:83px;padding:20px}#libraryOverlay #side{padding:20px}}@media(prefers-reduced-motion:reduce){.library-drawer,.chapter-intro{animation:none}}
@media(max-width:780px){.chapter-intro{overflow-y:auto;justify-content:flex-start;padding:20px 7%}.intro-overline{display:none}.intro-number{margin:0;font-size:14px;line-height:1.4}.intro-rule{margin:9px 0}.chapter-intro h2{font-size:24px}.chapter-intro p{font-size:11px;line-height:1.75}.chapter-intro .primary{margin-top:4px}.chapter-intro small{margin-top:8px}}
/* The eight sprites form one encounter; eight overlapping ordinal nameplates obscure the bridge. */
.fairy-label{display:none!important}
.chapter-curtain{position:absolute;inset:0;z-index:12;background:#10251e;opacity:0;transition:opacity .36s ease;pointer-events:auto}.chapter-curtain.cover{opacity:1}.chapter-intro{animation:none;opacity:1;transition:opacity .42s ease,transform .42s ease;background:radial-gradient(ellipse at 50% 40%,#253d2b,#10251e 76%)}.chapter-intro.departing{opacity:0;transform:scale(1.018);pointer-events:none}@media(prefers-reduced-motion:reduce){.chapter-curtain,.chapter-intro{transition:opacity .12s ease;transform:none}}
.exile-overlay{position:absolute;inset:0;z-index:9;pointer-events:none;display:flex;align-items:flex-end;justify-content:center;padding:16px}.exile-text{width:min(90%,700px);border:1px solid #d4bd7e;background:#10271ff5;border-radius:5px;padding:13px 18px;box-shadow:0 4px 15px #08181288}.exile-text p{font-size:14px;line-height:1.8;color:#f0e4c7;margin:0}.exile-text button{pointer-events:auto;display:block;margin:8px 0 0 auto;border:0;color:#e8c77e;font-size:11px;padding:0}.viewport:has(.exile-overlay:not(.hidden)) .chapter-label,.viewport:has(.exile-overlay:not(.hidden)) .scene-labels,.viewport:has(.exile-overlay:not(.hidden)) .target-beacon,.viewport:has(.exile-overlay:not(.hidden)) .bottom-hud,.viewport:has(.exile-overlay:not(.hidden)) .interact,.viewport:has(.exile-overlay:not(.hidden)) .scene-toast{visibility:hidden}@media(max-width:780px){.exile-overlay{padding:9px}.exile-text{width:100%;padding:9px 12px}.exile-text p{font-size:11px}}

.encounter-card{text-align:center;padding:12px 10px 20px}.encounter-card>small{display:block;color:#d4bf81;letter-spacing:.08em}.encounter-card .encounter-portrait{display:block;width:170px;height:200px;object-fit:contain;margin:20px auto 8px;image-rendering:pixelated;filter:drop-shadow(0 8px 18px #0006)}.encounter-card h2{font-size:32px;margin:6px 0 10px}.encounter-card>strong{color:#dfc98c}.encounter-card p{max-width:380px;margin:16px auto;line-height:1.8}.unlock-note{opacity:.65;font-size:12px}.encounter-card button{min-width:220px}
.activity{text-align:center}.activity-kicker{color:var(--gold);letter-spacing:.06em}.activity h2{margin:12px 0}.activity p{line-height:1.8}.activity>small{display:block;color:var(--muted)}.activity button{touch-action:manipulation}.activity button:disabled{opacity:.45;cursor:default}.activity button[aria-pressed="true"]{background:#52613a;border-color:#e3c87d;box-shadow:0 0 0 2px #e3c87d55}.quest-bag,.music-keys{display:flex;gap:10px;justify-content:center;margin:22px 0}.quest-bag button{width:115px;display:grid;gap:8px}.quest-bag b{font-size:32px;color:var(--gold)}.music-keys button{font-size:22px;min-width:66px;padding:15px}.music-keys small{display:block;font-size:10px;color:var(--muted)}.music-score,.poem-draft{background:#0c1915;border:1px solid #62704c;border-radius:5px;padding:20px;margin:20px 0;color:#f3d493;font-size:20px;min-height:70px}.poem-draft{font-size:15px;line-height:2}.poem-pieces{display:grid;gap:8px;margin:14px 0}.clue-scene{position:relative;aspect-ratio:16/9;background-image:url('assets/event-settings.fb1bdb7cf398.webp');background-size:200% 200%;background-position:0 0;border:1px solid #6c7152;margin:18px 0;border-radius:5px}.clue-scene button{position:absolute;transform:translate(-50%,-50%);color:#ffe5a1;background:#13241ee8;border:2px solid #e8c780;box-shadow:0 0 15px #ffda79a0;font-size:22px;min-width:48px}.clue-scene button span{display:block;font-size:11px}.clue-list{text-align:left;background:#10231b;padding:12px;font-size:13px;line-height:1.8}.route-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:5px;max-width:335px;margin:18px auto}.route-grid button{aspect-ratio:1;background:#243c30;font-size:14px;padding:3px}.activity #activityFeedback{min-height:30px;color:#ead399}.activity-memories{margin-top:24px;border-top:1px solid var(--line)}.activity-memories button{display:block;width:100%;text-align:left;margin-bottom:8px}@media(max-width:600px){.music-keys button{min-width:48px;padding:10px}.quest-bag button{width:90px;padding:8px}.clue-scene button{font-size:16px;padding:3px}.activity h2{font-size:22px}}

.slice-board{width:min(280px,70vw);margin:12px auto;touch-action:none}.slice-board svg{display:block;width:100%;height:auto;touch-action:none;user-select:none;cursor:crosshair}.slice-tools{display:flex;gap:8px;justify-content:center}.slice-access{margin:16px auto;max-width:360px;text-align:left}.slice-access input{display:block;width:100%;margin:14px 0}.slice-access output{float:right;color:var(--gold)}

.rhythm-controls{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:7px;margin:12px 0}.rhythm-controls select{background:#17372b;color:#eee;padding:7px}.rhythm-highway{position:relative;height:min(29vh,250px);min-height:170px;max-width:360px;margin:12px auto;overflow:hidden;border:1px solid #7b8656;background:repeating-linear-gradient(90deg,#10261e 0%,#10261e 24.5%,#455441 24.5%,#455441 25%)}#rhythmNotes{position:absolute;inset:0}.rhythm-note{position:absolute;width:25%;text-align:center;font-size:29px;font-weight:bold;color:#f5d58b;transform:translateY(-50%);text-shadow:0 2px 5px #000}.lane-0{left:0}.lane-1{left:25%}.lane-2{left:50%}.lane-3{left:75%}.rhythm-target{position:absolute;top:82%;left:0;width:100%;display:grid;grid-template-columns:repeat(4,1fr);transform:translateY(-50%);border-top:2px solid #eedc9a;border-bottom:2px solid #eedc9a;background:#d2b26e22}.rhythm-target span{font-size:28px;color:#b9c3a3;line-height:1.5}.rhythm-target .struck{color:#fff;background:transparent}.rhythm-pad{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;max-width:360px;margin:0 auto 10px}.rhythm-pad button{font-size:26px;padding:4px;touch-action:manipulation}#rhythmStatus{font-size:13px;min-height:22px;color:#efd9a0}.rhythm-access{text-align:left;margin:10px auto;max-width:360px}.activity:has(.rhythm-highway) h2{margin:4px}.activity:has(.rhythm-highway)>p{margin:8px 0;font-size:13px}.activity:has(.rhythm-highway)>small:last-child{font-size:10px}

.story-cutscene .bottom-hud,.story-cutscene .target-beacon,.story-cutscene .interact{visibility:hidden}.story-cutscene .npc-label{opacity:.8}

.exam-paper{padding:18px;background:#f1e2bb;color:#3f3524;border:5px double #94764a;border-radius:4px;margin:15px 0}.exam-paper h3{font-size:18px;line-height:1.7}.exam-paper .answers button{color:#403620;border-color:#b6a178;text-align:left}.exam-paper .answers button:hover{background:#d8c58e}.exam-paper .primary{background:#476246;color:#fff}.exam-result h3{font-family:serif;color:#9e3c2e;font-size:44px;line-height:1.5}.exam-result{padding:24px 0}

.full-text-download{display:inline-block;color:#e4d39e;text-decoration:none;border:1px solid #6a7151;border-radius:4px;padding:6px 10px;margin-right:10px;font-size:11px}.full-text-download:hover{background:#31422d}

#libraryOverlay.relations-open{align-items:center;justify-content:center;padding:12px}.relations-open .library-drawer{width:min(1150px,100%);max-width:none;height:calc(100dvh - 24px);max-height:none;border:1px solid #64724d;border-radius:10px;animation:none}.relations-open .library-header{min-height:70px;padding:14px 24px}.relations-open #side{padding:12px 24px!important}.relations-intro p{margin:0;color:#d6ddc7}.relations-intro small{color:#99ae94;font-size:12px}.relation-map{position:relative;aspect-ratio:840/540;max-width:880px;margin:4px auto 12px;background:radial-gradient(ellipse at center,#2e49353d,transparent 70%)}.relation-map>svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}.relation-edge{cursor:pointer}.relation-edge line{stroke:#b5b37c;stroke-width:2}.relation-edge text{fill:#eee3be;font-size:12px;text-anchor:middle;paint-order:stroke;stroke:#13251e;stroke-width:5px;stroke-linejoin:round}.relation-edge:hover line,.relation-edge:focus line{stroke:#ffe494;stroke-width:4}.relation-node{position:absolute;transform:translate(-50%,-50%);display:flex;flex-direction:column;align-items:center;justify-content:center;width:78px;height:78px;border-radius:50%;background:#233e2d;border:2px solid #b8b27a;padding:4px;box-shadow:0 4px 12px #0005}.relation-node img{width:52px;height:55px;object-fit:contain;image-rendering:pixelated}.relation-node span{position:absolute;top:calc(100% + 3px);white-space:nowrap;color:#eee8ce;font-size:12px;background:#13251ee8;padding:1px 7px;border-radius:3px}.relation-node.unknown{background:#182b23;border-color:#465c43;opacity:.7}.relation-node.unknown b{font-size:26px;color:#6e8768}.relation-detail{max-width:880px;margin:auto;padding:16px 20px;border:1px solid #697350;border-radius:6px;background:#172e23}.relation-detail h3{margin:0;font-size:20px}.relation-detail p{margin:7px 0;line-height:1.7}.relation-detail strong{color:#d8c17f}.relation-fact{color:#c4d4b3;font-size:13px}.relations-open #returnGame{margin:14px auto;display:block}@media(min-width:1050px){.relations-open #side{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:15px}.relations-intro{grid-column:1/-1}.relation-detail{align-self:center}}@media(max-width:600px){#libraryOverlay.relations-open{padding:0}.relations-open .library-drawer{height:100dvh;border-radius:0}.relations-open #side{padding:12px!important}.relation-node{width:46px;height:46px}.relation-node img{width:32px;height:33px}.relation-node span{font-size:9px;padding:0 3px}.relation-edge text{font-size:11px}.relation-detail{padding:13px}.relations-intro p{font-size:12px}}

.defense-tools{display:flex;gap:7px;justify-content:center;margin:10px 0}.defense-field{height:240px;position:relative;overflow:hidden;margin:15px 0;background:linear-gradient(#234639bb,#173c2bcc),url('assets/moods.b1804e9c1fda.webp');background-size:auto,200% 200%;background-position:0 0,100% 0;border:1px solid #7b8555;border-radius:6px}.defense-path{position:absolute;top:44%;left:0;width:100%;height:14%;background:#a8995c77;border-block:1px dashed #d5bf83}.defense-castle{position:absolute;left:92%;top:41%;font-size:14px;color:#ffe4a2;z-index:3}.defense-pad{position:absolute;transform:translate(-50%,-50%);border:2px solid #c5b06b!important;background:#2d5134!important;color:#fff2ba;font-size:25px;line-height:1;width:44px;height:44px;border-radius:50%;padding:2px;z-index:3}.defense-pad:disabled{opacity:1!important}.defense-field>svg{position:absolute;width:100%;height:100%;inset:0;pointer-events:none;z-index:2}.defense-enemy{position:absolute;top:45%;transform:translateX(-50%);font-size:24px;color:#f0af92;line-height:1}.defense-enemy i{display:block;height:3px;background:#b9d6a2;max-width:24px}#defenseStatus{color:#edd695;font-size:13px}.route-grid{touch-action:none}.route-grid button{touch-action:none}

.bad-ending{text-align:center;padding:25px 10px}.bad-ending>small{color:#b8b1a2}.bad-ending h2{font:32px/1.6 serif;color:#d2aa9c}.bad-ending p{max-width:470px;margin:20px auto;line-height:1.9}

.chapter-intro.dream-intro{background:radial-gradient(ellipse at 50% 70%,#2a8a8ff0,#102c4bf8 65%,#091a2cff);color:#e3fff6}.dream-intro .intro-rule{background:#b1f1d7}.dream-intro h2{text-shadow:0 0 25px #9df5e379}

/* Keep the absolute-positioned graph from collapsing to its intrinsic width. */
.relation-map{width:100%;min-width:0;align-self:start;flex-shrink:0}.relations-open #side{min-width:0}.relation-node{z-index:2}.relation-map>svg{z-index:1}.relation-node .cast-portrait{max-width:52px;max-height:55px;margin:0}
/* Tactical field: illustrated units, clear staging areas and firing ranges. */
.defense-brief h3{margin:3px 0;font-size:24px;color:#f0dfaa}.defense-brief>small{letter-spacing:.15em;color:#a8c7a3}.defense-brief p{font-size:13px;margin:7px 0}#defenseStatus{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;background:#10231e;border:1px solid #596d50;border-radius:8px;padding:10px;margin:13px 0}#defenseStatus span{display:flex;flex-direction:column;text-align:center}#defenseStatus small{font-size:10px;color:#b6c5a7}#defenseStatus b{font-size:17px;color:#f0dfaa}.defense-tools{gap:8px}.defense-tools button{flex:1;display:flex;align-items:center;text-align:left;padding:7px;background:#20382b;border:1px solid #5b7150;min-width:0}.defense-tools button[aria-pressed=true]{border-color:#f0cf7b;background:#3b4930;box-shadow:inset 0 0 0 1px #f0cf7b}.defense-tools button span{display:flex;flex-direction:column}.defense-tools button small{font-size:10px;color:#bfcdb7}.defense-unit-art{width:48px;height:65px;object-fit:contain;image-rendering:pixelated;filter:drop-shadow(0 3px 2px #0008);pointer-events:none}.defense-tools .defense-unit-art{height:47px;width:34px;margin-right:7px}.defense-field{height:auto;aspect-ratio:1.8;background: none center/cover;border:2px solid #a39564;border-radius:10px;box-shadow:inset 0 0 35px #071e24aa,0 8px 22px #0004}.defense-path{background:#d1ad6720;border:0;top:45%;height:12%;pointer-events:none}.defense-entry{position:absolute;top:57%;left:1%;font-size:10px;color:#ffe5c2;padding:2px 6px;background:#4c2b28dd}.defense-castle{left:auto;right:1%;top:57%;background:#193725dd;padding:2px 6px;border:1px solid #a9ba80;font-size:11px}.defense-pad{width:58px;height:58px;background:#274434aa!important;border:1px dashed #ebd595!important;box-shadow:0 3px 0 #101e1baa;overflow:visible}.defense-pad:hover{box-shadow:0 0 16px #fbe2a4}.defense-pad.occupied{background:#263a26aa!important;border-style:solid!important}.defense-pad .defense-unit-art{position:absolute;left:50%;bottom:5px;transform:translateX(-50%);width:57px;height:75px}.unit-tag{position:absolute;top:100%;left:50%;transform:translateX(-50%);font:10px system-ui;white-space:nowrap;background:#18291ee8;border:1px solid #b5bd84;color:#eee6c8;padding:2px 6px;border-radius:3px}.empty-pad{font-size:24px}.empty-pad small{display:block;font:9px system-ui}.defense-enemy{top:50%;z-index:2;transform:translate(-50%,-75%);width:42px;height:60px;font-size:0}.defense-enemy .defense-unit-art{width:42px;height:59px;animation:troop-march .3s steps(2,end) infinite}.defense-enemy i{position:absolute;top:0;left:0;height:4px;max-width:42px;background:#e8a282;box-shadow:0 0 0 1px #251a16}.defense-range{position:absolute;transform:translate(-50%,-50%);aspect-ratio:1.6;border-radius:50%;border:1px dashed #ffe6a13b;background:#ffe7a108;pointer-events:none}.defense-range.scout{border-color:#9dc8df55;background:#83bfee0a}.defense-range.supply{border-color:#a4dc9755;background:#a4dc970a}.defense-banner{position:absolute;top:7px;left:50%;transform:translateX(-50%);padding:4px 18px;background:#172b24e6;border:1px solid #c2b378;color:#f5e0a1;font-size:13px;white-space:nowrap}.defense-banner.in-battle{background:#572b21db}.defense-orders{display:flex;gap:8px;margin-bottom:10px}#defenseShots line{filter:drop-shadow(0 0 1px #fff4bf)}@keyframes troop-march{to{transform:translateY(-2px) rotate(2deg)}}@media(prefers-reduced-motion:reduce){.defense-enemy .defense-unit-art{animation:none}}@media(max-width:600px){.defense-tools button{padding:4px}.defense-tools button small{display:none}.defense-tools .defense-unit-art{width:25px}.defense-pad{width:42px;height:42px}.defense-pad .defense-unit-art{height:55px;width:43px}.defense-enemy,.defense-enemy .defense-unit-art{width:31px;height:43px}.defense-banner{font-size:10px}#defenseStatus b{font-size:13px}}

.modal.defense-mode>section{width:min(1040px,96vw);max-width:1040px;padding:20px 28px}.defense-mode h2{margin:4px 0;font-size:24px}.defense-mode .defense-field{max-height:48dvh;min-height:250px}.defense-mode .defense-brief h3{font-size:20px}.defense-mode .defense-brief p{margin:3px 0}.defense-mode #defenseStatus{margin:8px 0;padding:6px}.defense-mode .defense-tools{margin:7px 0}.relations-open #side{max-height:none!important;overflow:visible}.relations-open .library-drawer{overflow-y:auto}.relations-open #returnGame{position:static}@media(max-width:600px){.modal.defense-mode>section{padding:16px 12px}.defense-mode .defense-field{min-height:200px}.relation-node .cast-portrait{max-width:32px;max-height:33px}}
.defense-mode .defense-field{width:100%;height:clamp(260px,43dvh,420px);aspect-ratio:auto;margin:10px 0}.defense-mode .defense-orders button{padding:9px 18px;min-height:40px}.defense-mode .defense-orders{margin:8px 0}.defense-mode #modalContent>small{font-size:11px}

/* Korean reading rhythm: keep words together, with a fallback for very long tokens. */
.speech p,.modal p,.modal h2,.relation-detail,.relations-intro,.answers button,#side p{word-break:keep-all;overflow-wrap:break-word;line-break:strict}
.encounter-card p{max-width:32em;font-size:17px;line-height:1.85;text-wrap:pretty;margin:18px auto}.encounter-card .encounter-portrait{filter:none;background:none!important;border:0;padding:0}.encounter-card>strong{font-size:16px}.encounter-card .unlock-note{font-size:14px}.modal h2{text-wrap:balance}.speech p{font-size:19px;line-height:1.85;margin:10px 0 8px}.speaker strong{font-size:17px}.speaker span{font-size:12px}.speech button{font-size:14px;padding:5px 0}.dialog{min-height:190px;padding:20px;gap:20px}.portrait{width:112px;height:132px;flex:0 0 112px;overflow:hidden;background:#243b30;border:1px solid #968e65}.portrait .cast-portrait{width:100%;height:100%;max-width:none;padding:0;object-fit:cover;object-position:center 8%;transform:scale(1.32);transform-origin:50% 25%;background:none!important}.portrait .narrator-mark{display:grid;place-items:center;height:100%;font-size:42px}.modal p,.answers button{font-size:16px}.modal p{line-height:1.85}.relation-detail p{font-size:16px;line-height:1.85}
@media(max-width:780px){.dialog{padding:14px;gap:12px;min-height:185px}.portrait{width:78px;height:100px;flex-basis:78px}.speech p{font-size:17px;line-height:1.75}.speaker strong{font-size:15px}.speaker span{font-size:10px}.speech button{font-size:13px}.encounter-card p{font-size:16px}.modal p,.answers button{font-size:16px}}
.slice-board{width:min(380px,80vw);margin:12px auto}.slice-board svg{overflow:visible}.piece-percent{text-anchor:middle;dominant-baseline:middle;font:bold 10px system-ui;fill:#fff9e9;stroke:#67384b;stroke-width:3px;paint-order:stroke;stroke-linejoin:round}.slice-meter{display:flex;justify-content:center;gap:32px;margin:15px 0;color:#cbd5bc}.slice-meter span{display:flex;flex-direction:column;font-size:12px}.slice-meter b{color:#f0d997;font-size:23px}.slice-ratios{display:flex;flex-wrap:wrap;gap:6px;justify-content:center;margin:12px auto 20px;max-width:540px}.slice-ratios>span{display:flex;flex-direction:column;min-width:58px;padding:5px 8px;border:1px solid #667253;border-radius:6px;background:#223e2e}.slice-ratios small{font-size:10px}.slice-ratios b{font-size:15px;color:#f3d6b2}.slice-ratios .balanced{border-color:#b7d19c;background:#3c5234}.slice-tools{flex-wrap:wrap}.slice-key-help{display:block;font-size:11px;color:#adc09f;margin-top:13px}
.journey-field{height:260px;position:relative;overflow:hidden;background:url('assets/jongnam-stream.659297095088.webp') center/cover;border:1px solid #a2ae78;border-radius:9px}.journey-actor{position:absolute;bottom:16%;width:90px;height:130px;transform:translateX(-50%)}.journey-actor.soyu{left:18%}.journey-actor.jeong{left:30%}.journey-actor img{height:100%;width:100%;object-fit:contain;image-rendering:pixelated}.journey-actor .cast-portrait{padding:0}#journeyCaption{min-height:4em}.diplomacy-stage{display:flex;justify-content:space-between;padding:20px 12%;height:240px;background:linear-gradient(#11241d44,#12251b66),url('assets/settings.2cd72aecc89d.webp') left top/200% 200%;border:1px solid #9d986c;border-radius:8px}.diplomacy-stage>div{height:100%;width:110px;position:relative}.diplomacy-stage img{height:100%;width:100%;object-fit:contain}.diplomacy-stage b{display:block;font-size:12px;background:#12251a;padding:3px}.diplomacy-meter{color:#e4cc8f;background:#10231a;border:1px solid #64734f;padding:10px;margin-top:15px}.modal:has(#sliceSvg)>section{width:min(820px,96vw);max-width:820px}.slice-board{width:min(320px,65vw)}
.water-crisis{height:230px;position:relative;overflow:hidden;background:linear-gradient(#5c78665c,#142c26aa),url('assets/moods.b1804e9c1fda.webp') right top/200% 200%;border:1px solid #7e8f65;border-radius:7px}.crisis-water{position:absolute;top:48%;height:33%;width:100%;background:repeating-linear-gradient(0deg,#7db6b9aa 0 3px,#416f78cc 4px 10px);transform:skewY(-4deg)}.crisis-troop{position:absolute;bottom:20%;height:90px;width:65px;transform-origin:50% 90%;animation:troop-weaken 4s ease-in-out both}.crisis-troop.first{left:22%}.crisis-troop.second{left:43%;animation-delay:.7s}.crisis-troop .defense-unit-art{width:100%;height:100%}.crisis-horse{position:absolute;left:62%;bottom:17%;width:125px;height:110px;object-fit:contain;animation:horse-weaken 4s 1s both}@keyframes troop-weaken{0%,35%{transform:rotate(0) translateY(0)}100%{transform:rotate(-65deg) translateY(14px)}}@keyframes horse-weaken{0%,40%{transform:translateY(0)}100%{transform:translateY(18px) rotate(-9deg)}}
/* Revision: reading, identity cards, song feedback and illustrated endings. */
#dialog.narrator-dialog{background:linear-gradient(115deg,#172b43f5,#243c55f2);border-color:#95b9d5}#dialog.narrator-dialog #speaker{color:#bfe1ff}.narrator-dialog .portrait{background:#37536b}
.slice-ratios{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:4px;max-width:570px;width:100%}.slice-ratios>span{min-width:0;padding:6px 2px}.slice-ratios b{font-size:clamp(11px,2.4vw,15px)}#activityFeedback{word-break:keep-all;overflow-wrap:break-word;text-wrap:pretty;line-height:1.8}.activity p{word-break:keep-all;text-wrap:pretty}
.relations-open .library-drawer{height:auto!important;max-height:calc(100dvh - 24px);display:flex;flex-direction:column}.relations-open #side{display:block!important;overflow:auto!important;min-height:0}.relations-open #returnGame{flex-shrink:0;position:static;margin:0}.dual-relations{display:grid;grid-template-columns:190px 1fr;gap:25px;align-items:center}.identity-card,.dual-card{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;background:#233c30;border:1px solid #8e9e72;border-radius:12px;padding:15px;word-break:keep-all}.identity-card img{height:150px;width:120px;object-fit:contain}.fairy-relations{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.dual-card img{height:105px;width:100%;object-fit:contain}.dual-card small{font-size:11px;line-height:1.5}.dual-card strong{font-size:16px}.dual-card.flipped{background:#3e3930;border-color:#d3b879;animation:cardFlip .3s}.dual-card:disabled{opacity:.5;min-height:165px}.dual-card>b{font-size:35px}.relation-reading{padding:14px;background:#20382d;border-radius:8px;margin-top:18px}.relation-reading h3{margin:0}.relation-reading p{margin:8px 0}.relation-help{word-break:keep-all}@keyframes cardFlip{from{transform:rotateY(90deg)}to{transform:rotateY(0)}}
.rhythm-song{padding:12px;background:linear-gradient(125deg,#312d51,#174c4b);border-radius:10px}.rhythm-song h3{margin:5px;font-size:23px}.rhythm-dashboard{display:flex;justify-content:center;gap:25px;margin:12px}.rhythm-dashboard span{display:flex;flex-direction:column;font-size:12px}.rhythm-dashboard b{font-size:24px;color:#ffe4a2;font-variant-numeric:tabular-nums}.rhythm-highway{height:260px;background:linear-gradient(#141a35,#173b47);box-shadow:inset 0 0 40px #0008}.rhythm-note{color:#9df7f2;filter:drop-shadow(0 0 5px #28c4d8);z-index:2}.rhythm-note.lane-1{color:#ffb3db}.rhythm-note.lane-2{color:#c7faa3}.rhythm-note.lane-3{color:#ffe3a0}.hold-note{background:linear-gradient(#78e9ee88,transparent);border-radius:15px;border-top:2px solid #d7ffff}.rhythm-judgment{position:absolute;top:38%;left:0;width:100%;font:bold 25px system-ui;z-index:4;pointer-events:none;text-shadow:0 0 15px #fff8}.rhythm-judgment.perfect{color:#8ef7ff}.rhythm-judgment.good{color:#baff92}.rhythm-judgment.bad{color:#ffd18b}.rhythm-judgment.miss{color:#ff97ad}.rhythm-pad button{touch-action:none;min-height:56px}#rhythmProgress{width:100%;accent-color:#83ece0}.echo-pads{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin:25px 0}.echo-pads button{min-height:100px;touch-action:manipulation}.echo-pads span{display:block;font-size:30px;color:#ecd091}.echo-pads .sounding{background:#577d66;box-shadow:0 0 18px #e9dc9b}
#worldQuestHUD{position:absolute;bottom:8px;left:8%;right:8%;padding:12px 18px;background:#122b26f2;border:1px solid #b6a773;border-radius:8px;z-index:8;text-align:center;word-break:keep-all}#worldQuestHUD p{margin:0;font-size:16px;line-height:1.6}#worldQuestHUD button{margin-top:9px;padding:9px 20px}#exileCaption{display:flex;align-items:center;gap:18px;text-align:left!important;font-size:19px;line-height:1.7;word-break:keep-all}.exile-face{width:90px;height:110px;overflow:hidden;flex-shrink:0}.exile-face img{width:100%;height:150%;object-fit:cover;object-position:top}.exile-face+div strong{color:#e9ce88}.exile-face+div p{margin:5px 0}.ending-art{width:100%;aspect-ratio:16/9;background-size:400% 200%;border-radius:10px;margin-bottom:20px}.bad-ending{max-width:760px;margin:auto}.ending-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}.ending-grid .ending-art{margin-bottom:8px}.ending-grid button{padding:8px}.ending-grid strong{display:block}.ending-gallery h2{margin-top:0}
@media(max-width:700px){.dual-relations{grid-template-columns:1fr;gap:15px}.identity-card{flex-direction:row}.identity-card img{width:65px;height:80px}.identity-card span{font-size:11px}.fairy-relations{grid-template-columns:repeat(2,1fr);gap:8px}.dual-card{padding:8px}.dual-card img{height:90px}.relation-help{font-size:13px}#worldQuestHUD{left:3%;right:3%;padding:8px}#worldQuestHUD p{font-size:12px}.rhythm-highway{height:220px}.rhythm-song p{font-size:13px}.rhythm-dashboard{gap:18px}.exile-face{width:65px;height:85px}#exileCaption{font-size:15px}}
.viewport{width:100%;max-height:none!important}#runnerControls{position:absolute;right:20px;bottom:95px;z-index:9;display:flex;gap:12px}#runnerControls button{background:#173c35e8;border-color:#d8c48c;min-width:90px;min-height:60px;touch-action:none}.viewport:has(#runnerControls) .target-beacon,.viewport:has(#runnerControls) .scene-labels,.viewport:has(#runnerControls) .chapter-label{visibility:hidden}.water-crisis{background-image:url(assets/revision-scenes.35a667a4633c.webp)!important;background-size:400% 200%!important;background-position:100% 0!important;aspect-ratio:16/9}.water-crisis .crisis-water{opacity:.15}.crisis-troop{animation:troopCollapse 2s ease-in-out both}.crisis-troop.second{animation-delay:.6s}@keyframes troopCollapse{0%{transform:rotate(0) translateY(0)}70%,100%{transform:rotate(-70deg) translateY(9px)}}
.defense-field{aspect-ratio:2/1;min-height:330px}.defense-pad{width:12%;height:29%;transition:filter .1s}.defense-pad .defense-unit-art{height:100%;width:100%;object-fit:contain}.defense-enemy{width:8%;height:24%}.defense-path{background:linear-gradient(#c3b18e,#8e8266);box-shadow:inset 0 6px 10px #594f3655,inset 0 -6px 10px #514d3855}.defense-tools button{flex:1}.defense-brief p{word-break:keep-all}
.willow-poem blockquote{font:20px/2.1 serif;padding:20px;background:#233c30;border-left:3px solid #d8bc76;text-align:left}.willow-poem #willowPieces{display:grid;gap:10px;margin:18px 0}.game-menus{flex-wrap:wrap;justify-content:flex-end}.game-menus button{padding:6px 9px}.scene-tools{flex:1;justify-content:flex-end}.scene-bar>div:first-child{flex-shrink:0}
@media(min-width:1000px){.viewport{max-height:none!important}.play{max-width:1320px;margin:auto}.scene-bar{min-height:55px}.game-menus button{font-size:12px}}
.modal.rhythm-mode>section{width:min(780px,96vw);max-width:780px;padding:16px 24px}.rhythm-mode .activity-kicker,.rhythm-mode .activity>h2{display:none}.rhythm-mode .rhythm-song{padding:8px}.rhythm-mode .rhythm-song h3{margin:2px;font-size:21px}.rhythm-mode .rhythm-song p{font-size:12px;margin:3px}.rhythm-mode .rhythm-controls{margin:8px 0}.rhythm-mode .rhythm-dashboard{margin:6px 0;flex-direction:row}.rhythm-mode .rhythm-highway{height:clamp(170px,31dvh,260px);margin:6px auto}.rhythm-mode #rhythmStatus{font-size:12px}.rhythm-mode .rhythm-access{margin:3px auto}.rhythm-mode .rhythm-pad{margin-bottom:4px}.rhythm-mode .rhythm-pad button{min-height:48px}.rhythm-mode .activity>small:last-child{font-size:9px}.hold-note{display:flex;align-items:flex-end;justify-content:center;line-height:32px;transform:translateY(calc(-100% + 16px))}.rhythm-mode #activityFeedback:empty{display:none}@media(max-height:700px){.rhythm-mode .rhythm-song p,.rhythm-mode .rhythm-access,.rhythm-mode .activity>small:last-child{display:none}.rhythm-mode .rhythm-highway{height:190px}.modal.rhythm-mode>section{padding:12px 18px}}
.relation-graph-scroll{overflow-x:auto;overscroll-behavior:contain;scrollbar-color:#8f9f6c #182f26}.relation-stage{position:relative;min-width:680px;max-width:980px;aspect-ratio:880/560;margin:0 auto;background:radial-gradient(ellipse,#45654935,transparent 70%)}.relation-stage>svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible}.relationship-link{cursor:pointer}.relationship-link path{fill:none;stroke:#c4bc7f;stroke-width:1.8}.relationship-link .relation-hit{stroke:transparent;stroke-width:18}.relationship-link text{fill:#eee5bd;text-anchor:middle;font:13px system-ui;paint-order:stroke;stroke:#193025;stroke-width:5;stroke-linejoin:round}.relationship-link:hover path:not(.relation-hit),.relationship-link:focus path:not(.relation-hit){stroke:#ffe697;stroke-width:3}.relation-person{position:absolute;transform:translate(-50%,-50%);width:82px;height:82px;border:2px solid #b4b77c;border-radius:50%;padding:3px;background:#244332;box-shadow:0 4px 13px #0006;display:grid;place-items:center;z-index:2}.relation-center{width:102px;height:102px;border-color:#f0d493;box-shadow:0 0 28px #dfca7d22}.relation-face{display:block;overflow:hidden;width:70px;height:70px;border-radius:50%}.relation-center .relation-face{width:88px;height:88px}.relation-face .cast-portrait{display:block!important;width:100%!important;height:148px!important;max-height:none!important;max-width:none!important;object-fit:cover!important;object-position:top!important;image-rendering:auto}.relation-center .relation-face .cast-portrait{height:180px!important}.relation-person strong{position:absolute;top:calc(100% + 4px);font-size:13px;line-height:1.4;white-space:nowrap;padding:2px 9px;border-radius:4px;background:#152c24f5;color:#f2e7c6}.relation-person small{position:absolute;right:-5px;bottom:0;border-radius:50%;background:#e2cf91;color:#16362b;width:22px;height:22px;font-size:17px;line-height:22px}.relation-person.unknown{opacity:.48;border-color:#657e62}.relation-person.unknown b{font-size:30px;color:#819c7c}.relation-person.is-flipped .relation-face{animation:identityTurn .35s ease-out}.relations-open .relation-reading{margin-top:14px}.relations-open .library-drawer{max-height:calc(100dvh - 24px)}@keyframes identityTurn{from{transform:rotateY(90deg)}to{transform:rotateY(0)}}@media(max-width:700px){.relation-stage{min-width:680px}.relations-open .library-drawer{max-height:100dvh}.relation-person{width:68px;height:68px}.relation-face{width:58px;height:58px}.relation-center{width:86px;height:86px}.relation-center .relation-face{width:74px;height:74px}.relation-person strong{font-size:12px}.relationship-link text{font-size:12px}.relations-intro p{font-size:14px}.relations-intro small{display:block;line-height:1.6}}
.relation-stage{width:min(100%,calc((100dvh - 330px)*1.5714));min-width:620px;margin:auto}.relation-person:not(.relation-center) .relation-face .cast-portrait{height:110px!important}.relation-person:not(.relation-center){width:70px;height:70px}.relation-person:not(.relation-center) .relation-face{width:60px;height:60px}@media(min-width:1000px){.relations-open #side:has(.relation-graph-scroll){display:grid!important;grid-template-columns:minmax(0,1fr) 240px;gap:10px 18px;align-items:center}.relations-open .relations-intro{grid-column:1/-1}.relations-open .relation-reading{margin:0;padding:16px;line-height:1.8;word-break:keep-all}.relations-open .relation-reading h3{font-size:20px}.relation-stage{max-width:720px}.relation-person strong{font-size:12px}}@media(max-width:700px){.relation-stage{width:620px;min-width:620px}.relations-open #side{padding:12px!important}}
.relation-graph-scroll{overflow-y:hidden;padding-bottom:18px}
/* Consistent portrait mat: no CSS enlargement can push a face outside its frame. */
.dialog .portrait{position:relative;display:grid;place-items:center;width:112px;height:132px;flex:0 0 112px;padding:0;overflow:hidden;border:1px solid #c1b17b;border-radius:9px;background:radial-gradient(ellipse at 50% 38%,#64816c88,#253e33 70%),linear-gradient(135deg,#426455,#1c352c);box-shadow:inset 0 0 15px #0b211d88,0 2px 6px #061b1255}.dialog .portrait:after{content:'';position:absolute;inset:5px;border:1px solid #d1c49233;border-radius:5px;pointer-events:none}.dialog .portrait .dialogue-bust,.exile-face .dialogue-bust{display:block;width:100%;height:100%;max-width:100%;object-fit:contain;object-position:center;transform:none;image-rendering:auto;background:none}.dialog.narrator-dialog .portrait{background:radial-gradient(ellipse,#66849a88,#253f57 75%);border-color:#8cabc3}.exile-face{border:1px solid #c1b17b;border-radius:9px;background:radial-gradient(ellipse,#64816c88,#253e33 70%)}@media(max-width:780px){.dialog .portrait{width:82px;height:102px;flex-basis:82px}}
/* Unframed busts; the standard and judgement captions share dialogue geometry. */
.dialog .portrait,.exile-face,.dialog.narrator-dialog .portrait{border:0;border-radius:0;background:none;box-shadow:none;overflow:visible;width:144px;height:144px;flex:0 0 144px}
.dialog .portrait:after{display:none}.dialog .portrait .dialogue-bust,.exile-face .dialogue-bust{object-fit:contain;object-position:center bottom;padding:0;filter:drop-shadow(0 2px 3px #06120c66)}
.exile-overlay{padding:0}.exile-text.dialog{width:auto;left:18px;right:18px;bottom:16px;display:grid;grid-template-columns:144px minmax(0,1fr);grid-template-rows:1fr auto;column-gap:20px;row-gap:0;pointer-events:auto}
#exileCaption{display:contents!important}.exile-face{grid-column:1;grid-row:1/3;align-self:center}.exile-text .speech{grid-column:2;min-width:0}.exile-text .speech p{font-size:19px;line-height:1.85;margin:10px 0 8px;min-height:3.6em;color:var(--text);word-break:keep-all;overflow-wrap:break-word}.exile-text .speaker strong{font-size:17px;color:var(--gold)}.exile-text #exileNext{grid-column:2;font-size:14px;padding:5px 0;margin:0 0 0 auto}
@media(max-width:780px){.dialog .portrait,.exile-face{width:100px;height:116px;flex-basis:100px}.exile-text.dialog{left:9px;right:9px;bottom:10px;grid-template-columns:100px minmax(0,1fr);column-gap:12px;padding:14px;min-height:185px}.exile-text .speech p{font-size:17px;line-height:1.75}.exile-text .speaker strong{font-size:15px}.exile-text #exileNext{font-size:13px}}
#exileCaption:not(:has(.portrait)){display:block!important;grid-column:1/-1;font-size:19px;line-height:1.85;word-break:keep-all}
@media(max-width:780px){#exileCaption:not(:has(.portrait)){font-size:17px;line-height:1.75}}
.npc-label:has(span:empty){display:none}
/* Keep complete silhouettes inside the circle; no oversized portrait crop. */
.relation-person .relation-face .cast-portrait,.relation-person:not(.relation-center) .relation-face .cast-portrait,.relation-person.relation-center .relation-face .cast-portrait{height:100%!important;width:100%!important;object-fit:contain!important;object-position:center!important;padding:7px!important;transform:none!important}
.relation-person small{pointer-events:none}.relation-person:focus-visible{outline:3px solid #ffe6a3;outline-offset:5px}
.rhythm-highway .rhythm-note,.rhythm-highway .hold-note{height:32px;display:block;line-height:32px;transform:translateY(-50%);background:none;border:0;border-radius:0;font-size:29px}
.rhythm-note b{position:relative;z-index:2;display:block;font:inherit;line-height:32px}.rhythm-note .hold-tail{display:none}.hold-note .hold-tail{display:block;position:absolute;bottom:50%;left:35%;width:30%;height:var(--hold-length,40px);background:linear-gradient(#78e9ee55,#a2ffffbb);border:1px solid #c1ffff;border-radius:7px;z-index:0}.hold-note.holding .hold-tail{background:#e7ffff;box-shadow:0 0 15px #8fffff}
.rhythm-target{height:42px;border:0;background:#efd58a19;align-items:center;z-index:3;pointer-events:none}.rhythm-target:after{content:'';position:absolute;top:50%;left:0;right:0;height:3px;background:#ffe5a0;box-shadow:0 0 9px #ffe5a0}.rhythm-target span{line-height:42px}.rhythm-line-label{position:absolute;top:calc(82% + 24px);left:0;right:0;font-size:10px;color:#ffe5a0;pointer-events:none;z-index:4}
/* Dialogue faces sit at a common head height and look toward the text. */
.dialog .portrait .dialogue-bust,.exile-face .dialogue-bust{object-position:center top}
.dialog .portrait .dialogue-bust[data-portrait-flip="yes"],.exile-face .dialogue-bust[data-portrait-flip="yes"]{transform:scaleX(-1)}
/* Character silhouettes use smooth artwork; scene and interface layout are unchanged. */
#world{image-rendering:auto}.cast-portrait,.dialogue-bust,.codex-portrait{image-rendering:auto!important}
/* Courier runner: persistent HUD, touch-safe controls and a readable briefing. */
.runner-brief{max-width:760px;margin:auto;word-break:keep-all}.runner-brief h2{margin:8px 0 12px}.runner-brief p{font-size:16px;line-height:1.8}.runner-how{display:grid;grid-template-columns:1fr 1fr;gap:12px}.runner-how p{padding:12px 16px;border:1px solid #7b8960;border-radius:9px;background:#223f32}.runner-item-guide{display:flex;flex-wrap:wrap;gap:8px 16px}.runner-item-guide>div{display:flex;align-items:center;gap:5px;min-width:180px}.runner-item-guide small{display:block;color:#b7cbb5}.runner-item-icon{width:46px;height:46px;display:inline-block;flex-shrink:0;background-image:url(assets/runner-props-v2.d7425ca4c24a.webp);background-size:400% 200%;background-repeat:no-repeat}#runnerStatus{position:absolute;z-index:10;top:12px;left:15px;right:15px;display:flex;gap:15px;align-items:center;border:1px solid #dbcf9766;border-radius:8px;background:#142e26ed;padding:8px 13px;font-size:15px;color:#ffe8ad;pointer-events:none}.runner-health{display:flex;gap:3px;font-size:20px;white-space:nowrap}.runner-health i{font-style:normal}.runner-health .full{color:#ef9383}.runner-health .empty{color:#53645a}#runnerStatus small{display:block;font-size:11px;color:#c4d6bf}.runner-progress{height:7px;flex:1;background:#3b5143;border-radius:10px;overflow:hidden}.runner-progress i{display:block;height:100%;background:#e7d093;border-radius:10px}#runnerControls{right:18px;bottom:18px;left:18px;justify-content:space-between;pointer-events:none}#runnerControls button{pointer-events:auto;min-width:112px;min-height:68px;font-size:17px;box-shadow:0 4px 8px #0004;user-select:none}#runnerControls small{display:block;font-size:11px;color:#c9d6bd}#runnerControls #runnerPause{min-width:48px;min-height:48px;order:-1;align-self:flex-end}.runner-mode .chapter-label,.runner-mode .bottom-hud,.runner-mode #prompt,.runner-mode .target-beacon,.runner-mode .scene-labels{visibility:hidden!important}.runner-mode #worldQuestHUD{bottom:20px}.runner-mode:has(#runnerControls) #worldQuestHUD{display:none}.runner-mode #worldQuestHUD p{font-size:17px;word-break:keep-all}.runner-mode #worldQuestHUD button{font-size:16px}@media(max-width:650px){#runnerStatus{top:5px;left:5px;right:5px;gap:7px;padding:5px 8px;font-size:12px}.runner-health{font-size:16px;gap:1px}#runnerControls{left:9px;right:9px;bottom:9px}#runnerControls button{min-width:90px;min-height:56px;font-size:14px}.runner-how{grid-template-columns:1fr}.runner-how p{margin:2px 0;padding:9px 12px}.runner-brief p{font-size:15px}.runner-item-guide>div{min-width:150px}.runner-mode #worldQuestHUD p{font-size:14px}}
/* Only the selected identity reacts; existing nodes keep their image and DOM. */
.relation-person.is-flipped .relation-face{animation:none!important}.relation-person.relation-emphasis:after{content:'';position:absolute;inset:-5px;border:3px solid #ffe5a0;border-radius:50%;pointer-events:none;animation:relationSelectionPulse .65s ease-out forwards}.relation-person.relation-emphasis strong{color:#fff1c5}@keyframes relationSelectionPulse{0%{transform:scale(.94);opacity:1;box-shadow:0 0 16px #ffe3a099}100%{transform:scale(1.4);opacity:0;box-shadow:0 0 24px #ffe3a000}}@media(prefers-reduced-motion:reduce){.relation-person.relation-emphasis:after{animation:none;opacity:.8}}
.diplomacy-stage.yan-hall-stage{position:relative;display:block;padding:0;height:auto;aspect-ratio:512/280;background:url(assets/yan-hall-v2.26b0a9af2fbd.webp) center/100% 100%;overflow:hidden}.diplomacy-stage.yan-hall-stage>div{position:absolute;width:13%;height:26%;left:48%;top:59%}.diplomacy-stage.yan-hall-stage>div:nth-child(2){width:12%;height:22%;left:81%;top:34%}.diplomacy-stage.yan-hall-stage img{padding:0;transform:none;object-fit:contain}.diplomacy-stage.yan-hall-stage b{font-size:10px;white-space:nowrap;position:absolute;left:50%;transform:translateX(-50%);padding:2px 5px}
.play:has(.runner-mode) .touch,.play:has(.runner-mode) .controls>span{display:none}
/* Same enlarged camera as the explorable Yan hall, trimming unused foreground. */
.diplomacy-stage.yan-hall-stage{background-size:133.333333% 133.333333%;background-position:100% 28.571429%}.diplomacy-stage.yan-hall-stage>div:first-child{left:49%;top:57.142857%;height:23.214286%;width:13%}.diplomacy-stage.yan-hall-stage>div:nth-child(2){left:77%;top:41.071429%;height:23.571429%;width:12%}
/* Keep the crisis tableau at its own image ratio on every screen. */
.water-crisis{width:100%;height:auto;aspect-ratio:16/9;max-height:none;background-size:400% 200%}
.route-grid{position:relative;background:none center/cover;gap:3px;padding:10px;border:1px solid #bcab72;border-radius:10px;isolation:isolate}
.route-grid button{position:relative;z-index:1;background:#183d2828;border:1px solid #f4e5b93b;color:#fff4c5;text-shadow:0 1px 3px #122519;min-height:58px;box-shadow:none}
.route-grid button[aria-pressed="true"]{background:#ffe59b38;border-color:#ffe29c;box-shadow:inset 0 0 10px #ffe5a74d}
.route-grid .route-trail{position:absolute;inset:10px;width:calc(100% - 20px);height:calc(100% - 20px);z-index:0;pointer-events:none}
.route-grid .route-poison{background:#3d175a99;color:#f6d7ff}
.route-grid .route-current{font-size:25px;color:#fff9c8;text-shadow:0 0 8px #fffbb2}
.defense-enemy{transform:translate(-50%,-100%);height:20%;width:8%;top:52%}
.defense-enemy .defense-unit-art{height:100%;width:100%;object-fit:contain;object-position:center bottom}
.defense-path{top:48%;height:9%;background:linear-gradient(#b19b70,#d4bb87 35%,#b69c6b);border-top:2px solid #e6d5a26b;border-bottom:3px solid #6b593b99;box-shadow:0 3px 8px #13271f55}
#defenseUnitPanel{padding:10px;border:1px solid #aa985e;border-radius:5px;margin-top:10px}#defenseUnitPanel:empty{display:none}#defenseUnitPanel button{margin:4px}
#reflectionWriting{display:grid;gap:12px;text-align:left}#reflectionText{width:100%;padding:12px;background:#11271f;color:#f8ebcd;border:1px solid #aa985e;border-radius:5px;font:inherit}
.defense-enemy .defense-unit-art{animation:none}.unit-tag{white-space:normal;line-height:1.4;min-width:95px;font-size:10px}.unit-health{position:absolute;bottom:0;left:15%;width:70%;height:4px;background:#3a2421;border:1px solid #ead5a2}.unit-health i{display:block;height:100%;background:#9ccf8b}.under-attack{animation:defense-hit .3s ease-in-out infinite}@keyframes defense-hit{0%,100%{filter:brightness(1)}50%{filter:brightness(1.8) drop-shadow(0 0 7px #ff593d)}}
@media(prefers-reduced-motion:reduce){.under-attack{animation:none;filter:drop-shadow(0 0 6px #ff593d)}}
/* Common action sizing; map cells, portrait nodes and game pads retain their geometry. */
:root{--action-height:48px;--menu-height:36px;--action-gap:10px}
.primary{min-height:var(--action-height);min-width:160px;padding:10px 20px;line-height:1.4;vertical-align:middle;box-shadow:0 3px 0 #736443}
.modal #modalContent>button:not(#closeModal),.modal .activity>button,.modal .bad-ending>button{min-height:var(--action-height);padding:10px 20px;line-height:1.4;vertical-align:middle}
.action-row{display:flex;align-items:stretch;justify-content:flex-start;flex-wrap:wrap;gap:var(--action-gap);margin-top:20px}
.action-row>button,.action-row>.primary{flex:1 1 160px;min-width:0;min-height:var(--action-height);margin:0;padding:10px 20px;line-height:1.4;font-size:14px;box-shadow:none}
.action-row>.primary{box-shadow:inset 0 -3px 0 #736443}
.answers{gap:var(--action-gap)}.answers button{min-height:var(--action-height);padding:12px 16px;line-height:1.55}
.game-menus button{min-height:var(--menu-height);padding:7px 10px;line-height:1.4}
.defense-orders{align-items:stretch;gap:var(--action-gap)}.defense-orders button,.defense-mode .defense-orders button{min-height:var(--action-height);margin:0;flex:1;padding:10px 16px;line-height:1.4}
#defenseUnitPanel button{min-height:44px;padding:9px 14px;line-height:1.4}
#closeModal,#closeLibrary{display:grid;place-items:center;width:40px;height:40px;min-width:40px;min-height:40px;padding:0;line-height:1}
@media(max-width:520px){.action-row>button{flex-basis:calc(50% - 5px);padding:10px 12px}.game-menus button{min-height:36px;padding:7px}.action-row{gap:10px}}
.dialogue-below-stage>#dialog{position:relative;left:auto;right:auto;bottom:auto;width:auto;margin:14px 18px;min-height:180px}
.dialogue-below-stage>#exileOverlay{position:relative;inset:auto;padding:0;margin:14px 18px;pointer-events:auto;display:block}
.dialogue-below-stage>#exileOverlay .exile-text.dialog{position:relative;left:auto;right:auto;bottom:auto;width:100%;min-height:180px}
.play:has(>#dialog:not(.hidden),>#exileOverlay:not(.hidden)) .viewport :is(.bottom-hud,.target-beacon,.scene-labels,.interact,.scene-toast){visibility:hidden}
@media(max-width:780px){.dialogue-below-stage>#dialog,.dialogue-below-stage>#exileOverlay{margin:10px}.dialogue-below-stage>#dialog,.dialogue-below-stage>#exileOverlay .exile-text.dialog{min-height:168px}}
.rhythm-controls{display:flex;flex-wrap:wrap;align-items:stretch;justify-content:center;gap:10px}.rhythm-controls label{flex-basis:100%}.rhythm-controls button{min-width:0;min-height:48px;flex:1 1 130px;margin:0;padding:10px 14px;line-height:1.4}.rhythm-controls .primary{box-shadow:inset 0 -3px 0 #736443}.slice-tools button,.poem-pieces button,.echo-game>#echoListen{min-height:48px}.exam-opening>img{display:block;width:100%;height:auto;aspect-ratio:16/9;object-fit:contain;border-radius:6px}.exam-opening p{font-size:15px;line-height:1.7}#rhythmAudioState{font-size:12px;color:#d8cc9b;margin:7px 0}

.dialogue-person{color:#f4d181;font-weight:750;text-decoration:underline;text-decoration-color:#f4d18166;text-underline-offset:.2em}

/* One fixed stage and one reserved dialogue row: speaking never changes the screen size. */
.immersive-game{overflow:hidden;height:100dvh;background:#0c1513}
.immersive-game>header,.immersive-game main>.heading,.immersive-game main>footer,.immersive-game .scene-bar,.immersive-game .controls{display:none}
.immersive-game main{max-width:none;padding:0;width:100%;height:100dvh}
.immersive-game .layout{display:block;height:100%}
.immersive-game .play{--dialogue-height:200px;position:relative;display:grid;grid-template-rows:minmax(0,1fr) var(--dialogue-height);justify-items:center;align-items:center;width:100%;height:100dvh;border:0;border-radius:0}
.immersive-game .viewport{grid-row:1;width:min(100vw,calc((100dvh - var(--dialogue-height))*512/280));max-height:100%;aspect-ratio:512/280}
#dialogueDock{grid-row:2;position:relative;width:100%;height:100%;padding:8px 16px;background:#101c17}
#dialogueDock>#dialog,#dialogueDock>#exileOverlay{position:absolute;inset:8px 16px;margin:0;min-height:0;width:auto;height:auto;padding:0}
#dialogueDock>#dialog{padding:18px 26px;grid-template-columns:112px minmax(0,1fr);gap:22px}
#dialogueDock>#exileOverlay .exile-text.dialog{position:absolute;inset:0;min-height:0;padding:18px 26px;grid-template-columns:112px minmax(0,1fr);gap:22px}
#dialogueDock #portrait{width:112px;height:132px;align-self:center}
#dialogueDock #line{font-size:clamp(14px,1.35vw,19px);max-height:calc(var(--dialogue-height) - 92px);overflow:auto}
#dialogueDock #nextLine{bottom:12px;right:20px}
.dialogue-idle{display:flex;align-items:center;justify-content:center;height:100%;color:#a9b3a4;font-size:13px}
#dialogueDock:has(>#dialog:not(.hidden),>#exileOverlay:not(.hidden)) .dialogue-idle{visibility:hidden}
#gameMenuButton{position:absolute;right:14px;top:12px;width:44px;height:44px;padding:0;background:#13251ce8;border-color:#9f9c69;z-index:25;font-size:22px}
.immersive-menu .action-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.immersive-menu a{display:block;margin-top:20px;color:#efcd83}
.immersive-game .touch{position:absolute;bottom:calc(var(--dialogue-height) + 8px);left:10px;right:10px;z-index:20;background:transparent;border:0}
@media(max-width:650px){#dialogueDock{padding:6px}#dialogueDock>#dialog,#dialogueDock>#exileOverlay{inset:6px}#dialogueDock>#dialog,#dialogueDock>#exileOverlay .exile-text.dialog{grid-template-columns:72px minmax(0,1fr);gap:12px;padding:12px}#dialogueDock #portrait{width:72px;height:108px}#dialogueDock #page{display:none}.chapter-label{left:12px;top:10px}.chapter-label strong{font-size:16px}}
.instrument-lesson .echo-pads small{display:block;font-size:12px;margin-top:8px}.instrument-lesson>small{display:block;margin-top:20px;color:#aab8a3}

.immersive-game main,.immersive-game .layout,.immersive-game .play{min-width:0;max-width:100vw;box-sizing:border-box}
.immersive-game .viewport{min-width:0;max-width:100%;flex-shrink:1;justify-self:center}
#examPaper #examHint{color:#3e2915;font-weight:650;line-height:1.8;background:#fff3c7;border:1px solid #9c763e;padding:12px;border-radius:4px}
#examHint:empty{display:none}
.exam-result{position:relative;background:linear-gradient(90deg,#b58c47 0%,#e5ca86 3%,#fbebbc 12%,#fff3cf 50%,#ecd397 90%,#ae803e 100%);color:#382918;border:2px solid #a78243;border-radius:8px;padding:40px 25px;margin:25px 5px;box-shadow:0 12px 30px #0006,inset 0 0 30px #aa723c44;animation:honour-unroll .8s ease-out}
.exam-result:before,.exam-result:after{content:'';position:absolute;left:-12px;right:-12px;height:17px;border:2px solid #603c23;background:linear-gradient(#bd8a4d,#f0d4a0,#8b582d);border-radius:8px}.exam-result:before{top:-9px}.exam-result:after{bottom:-9px}.exam-result h3{font-family:serif;font-size:46px;letter-spacing:.18em;color:#773c21}.exam-result .laureate-name{font-family:serif;font-size:33px;font-weight:700;letter-spacing:.25em;margin:20px}.exam-seal{display:inline-block;border:3px solid #ac382d;color:#ac382d;transform:rotate(-8deg);padding:4px 10px;font-family:serif;font-weight:700;letter-spacing:5px}@keyframes honour-unroll{from{transform:scaleY(.05);opacity:.1}to{transform:scaleY(1);opacity:1}}
.activity>#activityFeedback{color:#f5dfac;font-weight:650}.runner-mode #runnerStatus{flex-wrap:wrap}.giant-timer{color:#ffeb9b;white-space:nowrap}.immersive-game .viewport{max-height:100%!important;width:min(100vw,calc((100dvh - var(--dialogue-height))*1.8285714));overflow:hidden}

/* The dock owns the portrait rectangle; old flex-basis/overflow rules must not enlarge it. */
#dialogueDock>#dialog:not(.hidden),#dialogueDock>#exileOverlay .exile-text.dialog{display:grid;grid-template-columns:112px minmax(0,1fr);align-items:start;column-gap:32px;overflow:hidden;padding:16px 24px}
#dialogueDock #portrait,#dialogueDock .exile-face.portrait{grid-column:1;grid-row:1;display:block;width:112px;height:min(132px,calc(var(--dialogue-height) - 52px));min-width:0;min-height:0;max-height:100%;flex:none;overflow:hidden;align-self:start;padding:0;margin:0}
#dialogueDock .dialogue-bust{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;object-position:center top}
#dialogueDock .speech{grid-column:2;grid-row:1;min-height:0;min-width:0;align-self:start}
#dialogueDock #exileCaption{display:contents!important}
#dialogueDock #exileNext{grid-column:2;justify-self:end;align-self:end;margin:0}
#dialogueDock .exile-text .speech p{min-height:0;max-height:calc(var(--dialogue-height) - 88px);overflow:auto;margin:7px 0;line-height:1.75}
.portrait-settings select{width:100%;padding:10px;margin:8px 0 16px}.portrait-editor-layout{display:grid;grid-template-columns:224px minmax(0,1fr);gap:30px;text-align:left}.portrait-editor-preview{border:1px solid #bda86a;border-radius:7px;background:#20382b;overflow:hidden}.portrait-editor-preview canvas{width:224px;height:264px;touch-action:none;cursor:move;image-rendering:auto}.portrait-editor-preview>span{display:block;text-align:center;font-size:12px;padding:7px;background:#12281e}.portrait-editor-controls label{display:block;margin:12px 0 20px}.portrait-editor-controls input[type=range]{display:block;width:100%;margin-top:10px}.portrait-editor-controls output{float:right;color:#f2d18a}.portrait-settings .action-row{margin-top:20px}.portrait-settings #portraitSaved{color:#efda9c}
@media(max-width:650px){#dialogueDock>#dialog:not(.hidden),#dialogueDock>#exileOverlay .exile-text.dialog{grid-template-columns:76px minmax(0,1fr);column-gap:20px;padding:12px}#dialogueDock #portrait,#dialogueDock .exile-face.portrait{width:76px;height:110px}.portrait-editor-layout{grid-template-columns:1fr}.portrait-editor-preview{justify-self:center}.portrait-editor-controls label{margin:9px 0}}

.rhythm-combo-burst{position:absolute;top:13%;left:50%;transform:translateX(-50%);text-align:center;pointer-events:none;opacity:0;z-index:5;filter:drop-shadow(0 0 14px #fbcf7755)}.rhythm-combo-burst.visible{opacity:1}.rhythm-combo-burst b{display:block;font-size:54px;font-weight:900;line-height:1.05;letter-spacing:-2px;color:#fff0b3;text-shadow:0 3px 0 #986b38,0 0 16px #ffcf8a77}.rhythm-combo-burst span{display:block;font-size:13px;font-weight:800;letter-spacing:5px;color:#fff5d0}.rhythm-combo-burst.bump{animation:combo-pop .22s ease-out}.rhythm-combo-burst.milestone{animation:combo-milestone .65s ease-out}.rhythm-combo-burst.milestone b{color:#a9fff0;text-shadow:0 3px 0 #2b8c89,0 0 22px #8cf6ec}@keyframes combo-pop{from{transform:translateX(-50%) scale(1.22)}to{transform:translateX(-50%) scale(1)}}@keyframes combo-milestone{0%{transform:translateX(-50%) scale(1.6) rotate(-8deg)}50%{transform:translateX(-50%) scale(1.1) rotate(4deg)}100%{transform:translateX(-50%) scale(1)}}
.echo-pads .instrument-picture{display:block;width:min(100%,128px);height:110px;margin:0 auto 5px;filter:drop-shadow(0 5px 5px #0004)}.echo-pads button{min-width:0;padding:14px 10px}.echo-pads button strong{display:block;font-size:16px;color:#f6dfab}.instrument-lesson .echo-pads small{font-size:12px}.echo-pads button.sounding{background:#655b32;border-color:#ffe3a2;box-shadow:0 0 20px #f3d07866;transform:translateY(-3px)}
#examPaper .exam-opening p{color:#49351e;font-weight:600}.exam-opening #examOpeningStatus:empty{display:none}
@media(prefers-reduced-motion:reduce){.rhythm-combo-burst.bump,.rhythm-combo-burst.milestone{animation:none}.echo-pads button.sounding{transform:none}}

.willow-flight h2{margin-bottom:10px}.willow-progress{display:flex;justify-content:center;gap:16px;color:#7b876a;font-size:27px;margin:8px}.willow-progress .complete{color:#ffda8c;text-shadow:0 0 12px #efce8d88}.willow-flight-board{position:relative;aspect-ratio:2/1;border:1px solid #b2ad78;border-radius:9px;overflow:hidden;background:#496e58}.willow-flight-scenery{position:absolute;inset:0;background-image:url('assets/event-settings.fb1bdb7cf398.webp');background-size:200% 200%;background-position:left bottom;transform:scaleX(-1);filter:brightness(.76) saturate(.8)}.willow-flight-board svg{position:absolute;inset:0;width:100%;height:100%}.willow-flight-board #willowWind{position:absolute;top:9px;left:12px;background:#17352bdd;padding:4px 10px;border-radius:4px;color:#ffedb5;font-size:13px}.willow-window-label{position:absolute;top:43%;left:68%;color:#fff4c8;font-size:12px;text-shadow:0 2px 4px #000}.willow-window-glow{fill:#ffe69c33;stroke:#fff2ae;stroke-width:2;filter:drop-shadow(0 0 9px #ffe69c)}.willow-flight #willowPrompt{color:#e8d8ab;font-weight:650}.willow-flight #willowChoices{display:grid;gap:8px}.willow-flight #willowChoices button{min-height:44px;text-align:left;padding:10px 14px}.willow-aim-controls{display:grid;grid-template-columns:1fr 1fr;gap:14px;text-align:left;margin-top:18px}.willow-aim-controls label{display:block;font-size:13px}.willow-aim-controls output{float:right;color:#eed18e}.willow-aim-controls input{display:block;width:100%;margin-top:9px}.willow-aim-controls button{min-height:46px}.willow-collected{color:#f7e7bb;font-family:serif;font-size:16px;line-height:1.6;margin-top:15px}.willow-collected p{margin:3px}.willow-flight>#activityFeedback{min-height:2em;font-size:14px}
/* Activity surfaces live inside the game, with a separate reading/settings dialog. */
.play{position:relative}.stage-activity{position:absolute!important;inset:0!important;background:#14291f!important;backdrop-filter:none!important;padding:0!important;z-index:35;align-items:stretch!important;justify-items:stretch!important}.stage-activity #modalContent{width:100%!important;max-width:none!important;max-height:100%!important;height:100%;margin:0;border:0!important;border-radius:0!important;box-shadow:none!important;background:transparent!important;padding:clamp(16px,3vh,32px)!important;overflow:auto}.stage-activity .activity,.stage-activity .runner-brief,.stage-activity .bad-ending{width:min(1100px,100%);max-width:none;margin:0 auto}.play:has(.stage-activity:not(.hidden)) #dialogueDock,.play:has(.stage-activity:not(.hidden)) .viewport{visibility:hidden}.play:has(#dialog:not(.hidden)) .scene-labels,.play:has(#dialog:not(.hidden)) .target-beacon,.play:has(#dialog:not(.hidden)) #interact{visibility:hidden}
.exam-result{aspect-ratio:4/5;width:min(520px,100%);margin:0 auto;padding:22% 12% 12%;background:transparent url('assets/honourScrollV8.d620e31bf1a7.webp') center/100% 100% no-repeat;border:0;box-shadow:none;border-radius:0;color:#492b19;display:flex;flex-direction:column;justify-content:center;gap:12px}.exam-result:before,.exam-result:after{display:none}.exam-result small,.exam-result p{color:#492b19!important}.exam-result h3{margin:4px;color:#8d3421;font-size:clamp(32px,5vh,54px)}.exam-result .laureate-name{color:#422c19!important;font-size:clamp(28px,4vh,42px);margin:8px}.exam-paper:has(.exam-result){padding:0;background:transparent;border:0}.exam-result>small:first-child{display:none}
.identity-status{display:flex;gap:40px;justify-content:center;font-size:24px;color:#ffe3a0;margin:12px}.identity-pair{display:grid;grid-template-columns:1fr 1fr;gap:10px;width:min(860px,100%);margin:0 auto}.identity-panel{position:relative;aspect-ratio:1/1;overflow:hidden;background:#3d291b;border:1px solid #c4a66c}.identity-panel img{position:absolute;left:0;top:0;width:200%;height:100%;max-width:none;object-fit:fill}.identity-panel[data-side="1"] img{left:-100%}.difference-target{position:absolute;transform:translate(-50%,-50%);width:17%;height:17%;padding:0;min-height:0;min-width:0;background:transparent!important;border:3px solid transparent;border-radius:50%;box-shadow:none}.difference-target.found{border-color:#fff399;background:#ffe86d22!important;box-shadow:0 0 20px #ffdc78}.difference-target:focus-visible{outline:2px dashed white}.bed-partner-label{position:absolute;left:69%;top:76%;padding:4px 10px;background:#16362de6;color:#ffe4a3;border:1px solid #dfc48b}.stage-activity .identity-activity h2{margin:4px}.stage-activity .identity-activity p{margin:8px}
@media(max-height:700px){.identity-pair{width:min(660px,70vh)}.identity-activity h2{font-size:22px}.exam-result{max-height:68vh;width:auto;margin:auto;box-sizing:border-box;padding:9vh 9vw 5vh}.exam-result p{margin:0}}
.stage-activity>section{width:100%!important;max-width:none!important;min-width:0;max-height:100%!important;height:100%;margin:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:#14291f!important;padding:0!important;overflow:hidden}.play:has(#dialog:not(.hidden)) #prompt{visibility:hidden}.identity-activity .difference-target.found{display:block!important}.stage-activity .identity-activity #finishActivity{margin-top:12px}
.painted-instrument{display:block;flex:none;width:80px;height:80px;margin:0 auto 5px;background-image:url('assets/instrumentsV8.ecf65e8a7c5e.webp');background-size:200% 200%;background-position:calc(var(--ix)*100%) calc(var(--iy)*100%);background-repeat:no-repeat}.instrument-demo .painted-instrument{width:96px;height:96px}
/* Portrait editing uses the same visible dimensions as the live dialogue dock. */
.modal:has(.portrait-settings)>section{width:min(1120px,96vw);max-width:1120px}.portrait-settings .portrait-editor-layout{display:block}.portrait-settings .portrait-editor-preview.actual-dialog-preview{width:100%;border:0;overflow:visible;background:transparent}.portrait-preview-dialog.dialog{position:relative!important;inset:auto!important;margin:0!important;display:grid!important;grid-template-columns:112px minmax(0,1fr);column-gap:32px;padding:16px 24px!important;min-height:var(--portrait-preview-height,180px);background:#10291f;border:1px solid #bda86a;overflow:visible!important}.portrait-preview-slot{position:relative;width:112px;align-self:start}.portrait-preview-window{position:relative;width:112px;height:min(132px,calc(var(--portrait-preview-height,180px) - 52px));overflow:hidden;background:#20382b}.portrait-preview-window canvas{display:block;width:100%!important;height:100%!important;object-fit:contain;touch-action:none}.portrait-preview-speech{grid-column:2;min-width:0}.portrait-preview-speech .speaker{display:flex;gap:12px;justify-content:space-between;align-items:center}.portrait-preview-speech strong{color:var(--gold);font-size:17px}.portrait-preview-speech .speaker span{font-size:11px;color:#a9bbad}.portrait-preview-speech p{font-size:19px;line-height:1.75;margin:7px 0!important;min-height:0!important;color:var(--text)!important}.portrait-preview-speech button{float:right;border:0;color:var(--gold);font-size:13px;opacity:1}.portrait-ruler{position:absolute;z-index:6;background:#d5dec9;color:#293b2b;touch-action:none;user-select:none}.portrait-ruler-top{height:15px;left:0;top:-16px;width:112px;background-image:repeating-linear-gradient(90deg,transparent 0 9px,#50674c 9px 10px);cursor:col-resize;font-size:7px;line-height:8px;overflow:hidden}.portrait-ruler-top span{background:#d5dec9b0;white-space:nowrap}.portrait-ruler-left{width:15px;right:calc(100% + 1px);height:132px;top:0;background-image:repeating-linear-gradient(0deg,transparent 0 9px,#50674c 9px 10px);cursor:row-resize}.portrait-h-guide{position:absolute;left:0;right:0;top:var(--guide-position);height:1px;background:#59f4f0;z-index:5;cursor:row-resize;touch-action:none;box-shadow:0 0 0 3px #59f4f012}.portrait-h-guide b{position:absolute;left:1px;top:1px;font-size:7px;line-height:9px;color:#b5ffff;background:#0d2529b0;font-style:normal;white-space:nowrap}.portrait-v-guide{position:absolute;top:0;bottom:0;left:var(--guide-position);width:1px;background:#ffacd9;z-index:5;cursor:col-resize;touch-action:none;box-shadow:0 0 0 3px #ffacd912}.portrait-guide-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 20px;padding:15px 0}.portrait-guide-controls>strong{grid-column:1/-1;color:#cff8ec}.portrait-guide-controls label{font-size:12px;text-align:left}.portrait-guide-controls input[type=range]{width:100%}.portrait-guide-controls output{float:right;color:var(--gold)}.portrait-settings .portrait-editor-controls{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 20px}.portrait-editor-controls>p{grid-column:1/-1;margin:3px 0}.portrait-settings textarea{width:100%;height:140px;font:12px monospace;color:#e5ebd8;background:#12271f}.portrait-settings .portrait-editor-preview>span{display:none}#dialogueDock .exile-face.portrait{position:relative;inset:auto;grid-column:1;grid-row:1;align-self:start}#dialogueDock .exile-text #exileNext{grid-column:2;grid-row:2;justify-self:end;align-self:end;margin:0;font-size:13px}#dialogueDock .exile-text.dialog{grid-template-rows:minmax(0,1fr) auto;row-gap:4px}#dialogueDock .exile-text .speech .speaker{display:flex;align-items:center;min-height:25px}#dialogueDock .exile-text .speech p{margin:7px 0 0}
.willow-power-meter{height:24px;border:1px solid #b5a46a;border-radius:5px;background:#081d1c;overflow:hidden}.willow-power-meter i{display:block;width:0;height:100%;background:linear-gradient(90deg,#79d6b8,#f2d375 65%,#e5774b)}.willow-spoken-verse{font-family:serif;font-size:21px;letter-spacing:2px;color:#ffdf9a!important}.willow-fortress #willowVerseText{font-family:serif;font-size:18px;font-weight:700;letter-spacing:2px;fill:#fff0b7;stroke:#5d3b19;stroke-width:.6;paint-order:stroke;filter:drop-shadow(0 2px 3px #452713)}.willow-fortress #willowLaunch{touch-action:none;user-select:none;-webkit-user-select:none}.willow-charge-help{font-size:12px;color:#bfcbb7!important}.willow-fortress .willow-aim-controls{grid-template-columns:1fr 1fr auto;align-items:center}.willow-fortress .willow-flight-board{margin-top:12px}
@media(max-width:650px){.portrait-preview-dialog.dialog{grid-template-columns:76px minmax(0,1fr);gap:20px;padding:12px!important}.portrait-preview-slot,.portrait-preview-window{width:76px}.portrait-preview-window{height:110px}.portrait-ruler-top{width:76px}.portrait-ruler-left{height:110px}.portrait-preview-speech p{font-size:17px}.portrait-preview-speech .speaker{display:block}.portrait-preview-speech .speaker span{display:block;font-size:9px}.portrait-settings .portrait-editor-controls,.portrait-guide-controls{grid-template-columns:1fr}.willow-fortress .willow-aim-controls{grid-template-columns:1fr}.portrait-preview-dialog{margin-top:15px!important}}
#dialogueDock .exile-text.dialog{grid-template-rows:minmax(0,1fr)}#dialogueDock .exile-text .speech #exileNext{position:static;float:right;display:block;margin:3px 0 0 auto;padding:5px 0}
.willow-angle-controls>span{display:block;font-size:13px;margin-bottom:6px}.willow-angle-controls>div{display:flex;gap:8px}.willow-angle-controls button{flex:1;min-height:44px;padding:8px;touch-action:manipulation}
.willow-attempt-status{font-weight:700;color:#ffe3a0!important;font-variant-numeric:tabular-nums;margin:8px 0}.willow-target-cross{fill:none;stroke:#fff6b0;stroke-width:2;filter:drop-shadow(0 0 4px #ffd66e)}
/* Keep combo animation and timing judgment in disjoint fixed-height bands. */
.rhythm-combo-burst{top:8px;left:50%;height:78px;width:170px;transform-origin:50% 0}.rhythm-combo-burst b{font-size:44px;line-height:1.05}.rhythm-combo-burst span{font-size:12px;line-height:18px}.rhythm-judgment{top:112px;height:34px;line-height:34px;font-size:25px}.rhythm-combo-burst.milestone{animation:combo-milestone-separated .65s ease-out}@keyframes combo-milestone-separated{0%{transform:translateX(-50%) scale(1.24) rotate(-5deg)}50%{transform:translateX(-50%) scale(1.08) rotate(3deg)}100%{transform:translateX(-50%) scale(1)}}

/* Keep the speaker and first line at the same fixed inset in preview and play. */
#dialogueDock .speech,.portrait-preview-dialog .portrait-preview-speech{align-self:start;padding-top:26px;box-sizing:border-box}
#dialogueDock .speech .speaker,.portrait-preview-dialog .speaker{min-height:25px;align-items:center}
#dialogueDock .speech p,.portrait-preview-dialog .portrait-preview-speech p{margin:7px 0 0;min-height:0;line-height:1.75}
@media(max-width:650px){#dialogueDock .speech,.portrait-preview-dialog .portrait-preview-speech{padding-top:18px}}
@media(prefers-reduced-motion:reduce){.rhythm-combo-burst.milestone{animation:none}}
/* No answer-shaped hover/focus hint; keyboard focus highlights the whole picture. */
.identity-panel .difference-target:not(.found),.identity-panel .difference-target:not(.found):hover,.identity-panel .difference-target:not(.found):focus-visible{border-color:transparent!important;background:transparent!important;outline:none!important;box-shadow:none!important;cursor:default}
.identity-panel:focus-within{outline:2px solid #dfbe77;outline-offset:2px}
.edict-activity{max-width:820px;margin:auto}.edict-scroll{--unroll:.35;position:relative;height:140px;overflow:hidden;margin:10px auto;width:300px;transform:scaleX(var(--unroll));transition:transform .3s}.edict-scroll img{width:100%;height:100%;object-fit:cover}.edict-scroll strong{position:absolute;inset:0;display:grid;place-items:center;color:#402a16;background:#fff0c75c;text-shadow:0 1px #fff}.edict-track{height:30px;position:relative;background:#293d32;border-radius:5px;margin:15px 0}.edict-track i{position:absolute;left:36%;width:28%;height:100%;background:#b39042}.edict-track b{position:absolute;width:5px;top:-5px;bottom:-5px;background:#fff2b8;transform:translateX(-50%)}.edict-bow{transform:translateY(18px) rotate(-20deg);transition:transform .5s}
#dialogueDock .speech{padding-top:clamp(10px,calc(var(--dialogue-height) - 160px),26px)}
.portrait-preview-dialog .portrait-preview-speech{padding-top:clamp(10px,calc(var(--portrait-preview-height,180px) - 160px),26px)}
#dialogueDock #line,#dialogueDock .exile-text .speech p{max-height:max(1.75em,calc(var(--dialogue-height) - 130px));overflow:auto}
@media(max-width:650px){#dialogueDock .speech,.portrait-preview-dialog .portrait-preview-speech{padding-top:18px}}
/* Winding battlefield: sprite artwork instead of temporary word icons. */
.defense-road-v11{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible}.defense-road-v11 path{fill:none;stroke-linecap:round;stroke-linejoin:round}.road-edge{stroke:#63583c;stroke-width:10}.road-fill{stroke:#c1a16c;stroke-width:8}.road-track{stroke:#e3c99299;stroke-width:.4;stroke-dasharray:1.2 1.5}.defense-atlas{display:inline-block;background:url('assets/defense-units.d7c61b5962a6.webp') calc(var(--unit)*100% / 3) 0/400% 100% no-repeat}.defense-tools .defense-unit-art{display:block;width:58px;height:66px;flex:0 0 58px}.defense-entry{top:10%;bottom:auto;left:1%}.defense-castle{top:85%;bottom:auto;right:1%;background:#173329ed;border:1px solid #e1c179;padding:3px 9px;color:#fff2cb}.defense-pad.occupied,.defense-pad.occupied:hover{background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0}.defense-pad{width:10%;height:26%}.defense-pad .troop-v11{height:100%;width:100%;transform-origin:50% 90%}.troop-v11.scout{animation:scout-survey 2.8s ease-in-out infinite}.troop-v11.supply{animation:supply-cart 1.8s ease-in-out infinite}.troop-v11.guard.firing{animation:archer-recoil .35s ease-out}.troop-v11.resupplying{filter:drop-shadow(0 0 8px #aff7b4)}.unit-tag{background:#10281ee8;border-radius:3px;padding:1px 4px;min-width:0;white-space:nowrap;color:#fff4cc;font-size:11px}.defense-range{aspect-ratio:1;height:auto;max-height:none;border:2px dashed #ffdf8a88;background:#ffe39a14;z-index:2}.defense-range.supply{border-color:#a4eda4aa}.defense-pad{z-index:3}.defense-enemy{z-index:4;width:6%;height:18%}.enemy-step{height:100%;width:100%}.enemy-step .defense-unit-art{animation:enemy-bob .4s ease-in-out infinite alternate}.defense-damage{position:absolute;z-index:8;color:#fff1e1;font:800 18px/1 system-ui;text-shadow:0 2px 3px #5b170e,1px 0 #5b170e;transform:translate(-50%,-80px);pointer-events:none;animation:damage-rise .7s ease-out}.base-hp>i{display:block;width:100px;height:7px;border-radius:4px;background:#502f29;margin:4px auto}.base-hp em{display:block;height:100%;background:#a2da8a;border-radius:4px}.base-hit{animation:defense-hit .2s 2}.defense-field:has(.defense-road-v11){isolation:isolate}.defense-tools button{align-items:center}.defense-pad.unit-selected .troop-v11{filter:drop-shadow(0 0 6px #fff0a6)}#defenseUnitPanel{display:flex;justify-content:center;gap:12px;align-items:center;flex-wrap:wrap}#defenseUnitPanel:empty{display:none}
@keyframes scout-survey{0%,100%{transform:rotate(-4deg)}50%{transform:rotate(5deg) translateY(-3px)}}@keyframes supply-cart{0%,100%{transform:translateX(-3px)}50%{transform:translateX(4px) translateY(-2px)}}@keyframes archer-recoil{0%{transform:translateX(3px) rotate(3deg)}45%{transform:translateX(-4px) rotate(-3deg)}100%{transform:none}}@keyframes enemy-bob{to{translate:0 -3px}}@keyframes damage-rise{from{opacity:1;margin-top:5px}to{opacity:0;margin-top:-20px}}
@media(prefers-reduced-motion:reduce){.troop-v11,.enemy-step .defense-unit-art{animation:none!important}}
.defense-mode .defense-field:has(.defense-road-v11){height:auto;aspect-ratio:2/1;max-height:none;min-height:250px}.defense-field:has(.defense-road-v11) .defense-range{height:auto;aspect-ratio:1}.defense-enemy .enemy-step .defense-unit-art{height:100%;width:100%}
.defense-support-motion{display:block;background-image:url('assets/defense-animated-v11.6623c6bcf78e.webp');background-size:400% 200%;background-repeat:no-repeat;animation:support-four-frames 1.5s linear infinite}.defense-support-motion.scout{--support-row:0%}.defense-support-motion.supply{--support-row:100%;animation-duration:.95s}.troop-v11.scout,.troop-v11.supply{animation:none}.defense-tools .defense-support-motion{animation:none;background-position:33.333% var(--support-row)}
@keyframes support-four-frames{0%,24.99%{background-position:0% var(--support-row)}25%,49.99%{background-position:33.333% var(--support-row)}50%,74.99%{background-position:66.667% var(--support-row)}75%,100%{background-position:100% var(--support-row)}}
@media(prefers-reduced-motion:reduce){.defense-support-motion{animation:none!important;background-position:33.333% var(--support-row)}}
.troop-v11{display:flex;align-items:flex-end;justify-content:center}.troop-v11 .defense-support-motion{width:100%!important;height:auto!important;aspect-ratio:453/386;flex:none}.defense-tools .defense-support-motion{height:auto;aspect-ratio:453/386}

/* Legacy/plain narration must span the dock instead of occupying the portrait column. */
#dialogueDock #exileCaption:not(:has(.speech)){display:block!important;grid-column:1/-1;grid-row:1;width:100%;min-width:0}
#dialogueDock #exileCaption .speech{width:100%;min-width:0}

#worldQuestHUD:empty{display:none!important}
#worldQuestHUD.journey-control-only{background:none!important;border:0!important;box-shadow:none!important;padding:0}
.rhythm-hit-fx{position:absolute;z-index:7;top:82%;width:100px;height:100px;pointer-events:none;transform:translate(-50%,-50%);background-image:url('assets/pickupVfxV8.6b54c9c12b64.webp');background-size:400% 200%;background-repeat:no-repeat;mix-blend-mode:screen;filter:drop-shadow(0 0 9px #8cfff2);animation:rhythm-painted-hit .48s linear both}.rhythm-hit-fx.good{width:80px;height:80px;filter:drop-shadow(0 0 6px #ffd879)}.rhythm-target span.hold-active{filter:drop-shadow(0 0 12px #b1fff6);color:#fff;background:transparent}.rhythm-note.holding .hold-tail{filter:drop-shadow(0 0 7px #b7fff6)}
@keyframes rhythm-painted-hit{0%,12.49%{background-position:0 0;opacity:1}12.5%,24.99%{background-position:33.333% 0}25%,37.49%{background-position:66.667% 0}37.5%,49.99%{background-position:100% 0}50%,62.49%{background-position:0 100%}62.5%,74.99%{background-position:33.333% 100%}75%,87.49%{background-position:66.667% 100%}87.5%,100%{background-position:100% 100%;opacity:0}}
@media(prefers-reduced-motion:reduce){.rhythm-hit-fx{animation:none;background-position:66.667% 0;opacity:.7}}
.roar-activity{max-width:900px;margin:auto}.roar-stage #roarKing{transition:left .45s,top .45s,width .45s;height:22%}.roar-stage #roarKing.king-bowed{left:74%;top:49%;width:19%;height:16%;transform:none}.roar-status{display:flex;justify-content:space-between;color:#ffe7ad;font-size:22px;margin:10px 0}.roar-activity progress{width:100%;height:24px;accent-color:#edc25f}.roar-activity #roarPress{min-height:70px;width:min(420px,100%);font-size:24px;touch-action:manipulation;user-select:none}.roar-activity #roarPress:active{filter:brightness(1.35);transform:scale(.98)}.roar-stage .roar-wave{position:absolute;left:12%;top:0;width:88%;height:100%;background:url('assets/cloud-transition-v11.e069ceea53f0.webp') 0 0/400% 200%;filter:sepia(.6) saturate(1.6);pointer-events:none;animation:roar-painted-wave .8s linear both;transform:none;z-index:4}
@keyframes roar-painted-wave{0%,12.49%{background-position:0 0;opacity:0}12.5%,24.99%{background-position:33.333% 0;opacity:.9}25%,37.49%{background-position:66.667% 0}37.5%,49.99%{background-position:100% 0}50%,62.49%{background-position:0 100%}62.5%,74.99%{background-position:33.333% 100%}75%,87.49%{background-position:66.667% 100%}87.5%,100%{background-position:100% 100%;opacity:0}}
.edict-bow{transform:none!important}
@media(prefers-reduced-motion:reduce){.roar-wave{animation:none!important;display:none}.roar-stage #roarKing{transition:none}}
/* V13 — soft storybook activity surfaces; the reading interface keeps its own palette. */
.stage-activity{--text:#493a2b;--muted:#786c51;--gold:#946331;--line:#c8b68b;color:#493a2b!important;background:#f4eddc!important}
.stage-activity>section{background:#f4eddc!important}
.stage-activity #modalContent{color:#493a2b!important;background:linear-gradient(160deg,#fff9e9,#edf3d9)!important}
.stage-activity .activity,.stage-activity .runner-brief,.stage-activity .bad-ending{--text:#493a2b;--muted:#786c51;--gold:#946331;color:#493a2b;padding:12px 4px 24px}
.stage-activity h2{color:#60462e;font-weight:850;letter-spacing:-.035em;text-shadow:0 2px #fff9ec}
.stage-activity button{background:#fff9eb;color:#5a4930;border:2px solid #c8b48a;border-radius:16px;box-shadow:0 4px 0 #c9b996;font-weight:750;transition:transform .12s,box-shadow .12s}
.stage-activity button.primary{background:#cce4a2;color:#354b2d;border-color:#8ba467;box-shadow:0 4px 0 #91a773}
.stage-activity button:active{translate:0 3px;box-shadow:0 1px 0 #b5a17c}
.stage-activity button:focus-visible{outline:3px solid #ba7f4f;outline-offset:4px}
.stage-activity .activity>p,.stage-activity .activity>small,.stage-activity .activity-kicker,.stage-activity #activityFeedback,.stage-activity .roar-status{color:#776342}
.stage-activity .rhythm-stats,.stage-activity .rhythm-result,.stage-activity .willow-attempt-status{color:#775136}
.stage-activity .willow-power-meter,.stage-activity .edict-track,.stage-activity .runner-power-track{border-radius:20px;background:#e7dbc0;border:2px solid #c0ae84}
.stage-activity .willow-power-meter i{border-radius:20px;background:linear-gradient(#d7edaa,#8abd76)}
.stage-activity .defense-stats,.stage-activity .defense-summary{background:#fff9e9;border:2px solid #d6c49c;border-radius:18px;color:#6b5436}
.stage-activity .defense-stats b,.stage-activity .defense-stats strong{color:#684b2c}
.stage-activity .music-keys button,.stage-activity .quest-bag button{background:#fff9e8;border-radius:20px}
.stage-activity .runner-item-icon{filter:drop-shadow(0 2px 1px #84683633)}
.runner-cute-icon{display:inline-block;width:48px;height:48px;object-fit:contain;vertical-align:middle}
#runnerStatus{background:#fff8e9f5!important;border:2px solid #c5b28b!important;border-radius:22px!important;box-shadow:0 4px 0 #816a4033!important;color:#60492e!important;padding:9px 16px!important;gap:12px!important;align-items:center}
#runnerStatus .runner-health{display:flex;align-items:center;gap:4px}
#runnerStatus .runner-health img{width:27px;height:27px;object-fit:contain;filter:drop-shadow(0 2px 0 #9e4a4730)}
#runnerStatus .runner-health img.empty{filter:grayscale(1);opacity:.25}
#runnerStatus .runner-score{color:#655033;font-weight:850}
#runnerStatus small{color:#8a7858}
#runnerStatus .runner-progress{height:16px!important;border:2px solid #c7b180!important;border-radius:20px!important;background:#e7dcc1!important;box-shadow:inset 0 2px 2px #795b2520;position:relative;overflow:visible!important;min-width:70px}
#runnerStatus .runner-progress i{display:block;height:100%;border-radius:20px;background:linear-gradient(#d3eda4,#84b969)!important}
#runnerStatus .runner-progress img{position:absolute;top:50%;width:27px;height:27px;object-fit:contain;transform:translate(-50%,-50%)}
#runnerStatus .runner-distance{color:#745a38;font-weight:800}
#runnerControls button{background:#fff6dcf5!important;color:#655034!important;border:2px solid #bfa779!important;border-radius:18px!important;box-shadow:0 4px 0 #725b3e50!important}
#runnerControls button small{color:#8c7957!important}
@media(max-width:640px){#runnerStatus{padding:6px 9px!important;gap:7px!important}#runnerStatus .runner-health img{width:19px;height:19px}#runnerStatus .runner-health{gap:1px}#runnerStatus .runner-score{font-size:11px}#runnerStatus .runner-progress img{width:22px;height:22px}.stage-activity h2{font-size:23px}.stage-activity button{border-radius:13px}}
.stage-activity .runner-how p,.stage-activity .music-score,.stage-activity .poem-draft,.stage-activity .clue-list,.stage-activity .willow-poem blockquote{background:#fff9e9;color:#665238;border-color:#cbbb92;border-radius:18px}
.stage-activity .runner-item-guide small,.stage-activity .slice-meter,.stage-activity .slice-meter b,.stage-activity .slice-pieces{color:#786143}
.stage-activity .rhythm-dashboard,.stage-activity .rhythm-dashboard b,.stage-activity #rhythmStatus{color:#795835}
.stage-activity .rhythm-song{background:linear-gradient(110deg,#e6d8ee,#d8edcf);color:#5b4963;border-radius:22px;border:2px solid #cbb8d3}
.stage-activity .rhythm-song h3,.stage-activity .rhythm-song p{color:#5b4963}
.stage-activity .rhythm-highway{border:3px solid #b5a0c6;border-radius:20px;background:repeating-linear-gradient(90deg,#354360 0%,#354360 24.6%,#65718b 24.6%,#65718b 25%);box-shadow:0 5px 0 #cdbfe0}
.stage-activity #rhythmProgress{accent-color:#8bbf77}
.stage-activity .echo-pads .sounding{background:#d8eaba;box-shadow:0 0 0 3px #a5c27a}
.stage-activity .difference-board img,.stage-activity .difference-panel{border-radius:18px}
.stage-activity .roar-activity progress{accent-color:#9dbb6d}
/* V14: one soft, raised button family across the whole game.
   Scene hit regions and illustrated relationship cards retain their geometry. */
:root{--button-face:#cce4a2;--button-edge:#8ba467;--button-shadow:#91a773;--button-ink:#354b2d;--button-hover:#d9edba;--button-selected:#b5d58a}
:is(body,#storybook-button-theme) :is(button,.full-text-download):not(.difference-target):not(.route-cell):not(.defense-pad):not(.relation-person):not(.relation-node):not(.dual-card):not(.identity-card){
 background:var(--button-face)!important;background-image:none!important;color:var(--button-ink)!important;border:2px solid var(--button-edge)!important;border-radius:16px!important;box-shadow:0 4px 0 var(--button-shadow)!important;font-weight:750;text-shadow:none!important;padding:8px 14px;line-height:1.45;transition:background-color .12s,box-shadow .12s,translate .12s;filter:none!important;text-decoration:none
}
:is(body,#storybook-button-theme) button:not(.difference-target):not(.route-cell):not(.defense-pad):not(.relation-person):not(.relation-node):not(.dual-card):not(.identity-card) :is(small,b,strong,span){color:inherit}
:is(body,#storybook-button-theme) :is(button,.full-text-download):not(.difference-target):not(.route-cell):not(.defense-pad):not(.relation-person):not(.relation-node):not(.dual-card):not(.identity-card):hover:not(:disabled){background:var(--button-hover)!important}
:is(body,#storybook-button-theme) :is(button,.full-text-download):not(.difference-target):not(.route-cell):not(.defense-pad):not(.relation-person):not(.relation-node):not(.dual-card):not(.identity-card):active:not(:disabled){translate:0 3px;box-shadow:0 1px 0 var(--button-shadow)!important}
:is(body.keyboard-navigation,#storybook-button-theme) :is(button,.full-text-download):not(.difference-target):not(.route-cell):not(.defense-pad):not(.relation-person):not(.relation-node):not(.dual-card):not(.identity-card):focus-visible{outline:3px solid #718b52!important;outline-offset:2px}
:is(body,#storybook-button-theme) button:not(.difference-target):not(.route-cell):not(.defense-pad):not(.relation-person):not(.relation-node):not(.dual-card):not(.identity-card):is([aria-pressed="true"],[aria-selected="true"],[aria-expanded="true"],.active,.selected){background:var(--button-selected)!important;border-color:#698348!important;box-shadow:0 4px 0 #6e854f,inset 0 0 0 2px #f2f9df!important}
:is(body,#storybook-button-theme) button:not(.difference-target):not(.route-cell):not(.defense-pad):not(.relation-person):not(.relation-node):not(.dual-card):not(.identity-card):disabled{background:#dbe2cf!important;color:#7b866f!important;border-color:#adb69e!important;box-shadow:0 2px 0 #aeb89e!important;opacity:.65;cursor:default;translate:none}
:is(body,#storybook-button-theme) button.primary{padding:12px 24px;border-radius:18px!important}
:is(body,#storybook-button-theme) :is(nav,.game-menus,.scene-tools,.controls,footer,.tabs) button{padding:6px 10px;min-height:30px;border-radius:12px!important}
:is(body,#storybook-button-theme) :is(#closeModal,#closeLibrary){min-width:36px;min-height:36px;padding:2px 8px;line-height:1;font-size:24px;border-radius:13px!important}
:is(body,#storybook-button-theme) .chapter-row{padding:10px 12px!important;margin-bottom:9px;width:100%}
:is(body,#storybook-button-theme) .chapter-row .num{background:#eef6dc;border-color:#a1b880;color:#52673f}
:is(body,#storybook-button-theme) .return-game{width:calc(100% - 24px);margin:8px 12px 12px}
:is(body,#storybook-button-theme) .tabs{gap:8px;padding:10px 14px 13px;flex-wrap:wrap}
:is(body,#storybook-button-theme) :is(#confirmReset,#reset){--button-face:#efcfbd;--button-edge:#ba9277;--button-shadow:#bc967e;--button-ink:#67432f;--button-hover:#f5decc}
:is(body,#storybook-button-theme) .full-text-download{display:inline-block;vertical-align:middle;padding:6px 10px}
:is(body,#storybook-button-theme) :is(.answers,.poem-pieces,.activity-memories) button{margin-bottom:5px}
@media(max-width:650px){:is(body,#storybook-button-theme) :is(nav,.game-menus,.scene-tools,.controls,footer) button{padding:6px 8px;font-size:11px}.game-menus{gap:8px 6px}.controls{flex-wrap:wrap;row-gap:10px}}
@media(prefers-reduced-motion:reduce){:is(body,#storybook-button-theme) :is(button,.full-text-download){transition:none!important}}
:is(body,#storybook-button-theme) button:is(.sounding,.struck){--button-face:#e4eeb8;--button-edge:#94ad58;--button-shadow:#9cad6c;background:var(--button-face)!important;box-shadow:0 4px 0 var(--button-shadow),0 0 0 3px #e7f5c555!important}
:is(body,#storybook-button-theme) button.correct:is(:disabled,:enabled){background:#bddda0!important;color:#344e2a!important;border-color:#759953!important;opacity:1;box-shadow:0 3px 0 #86a76a!important}
:is(body,#storybook-button-theme) button.wrong:not(:disabled){--button-face:#f1d1bf;--button-edge:#c29b82;--button-shadow:#c29b82;--button-ink:#754b37;--button-hover:#f5dfcf}
/* V16: map cells are transparent hit areas, separate from interface buttons. */
:is(body,#storybook-button-theme) .route-grid button.route-cell,
:is(body,#storybook-button-theme) .route-grid button.route-cell:is(:hover,:active,:focus-visible){background:transparent!important;border:1px solid #fff0c63b!important;border-radius:8px!important;box-shadow:none!important;color:#fff6d7!important;text-shadow:0 1px 3px #263d20,0 0 3px #263d20!important;padding:2px!important;min-width:0;line-height:1.3;font-size:13px;translate:none!important;transform:none;filter:none!important}
:is(body,#storybook-button-theme) .route-grid button.route-cell[aria-pressed="true"]{background:#ffe9a520!important;border-color:#ffe4a384!important;box-shadow:none!important}
:is(body,#storybook-button-theme) .route-grid button.route-cell.route-current{border:2px solid #fff0ae!important;background:#ffe9a52e!important;font-size:25px}
:is(body,#storybook-button-theme) .route-grid button.route-cell.route-poison{background:#5e287148!important;color:#fff1ff!important;border-color:#dcb6e540!important}
:is(body,#storybook-button-theme) .route-grid button.route-cell:focus-visible{outline:2px solid #fff2ad!important;outline-offset:-3px}
.stage-activity #routePuzzle>p,.stage-activity #routeProgress{color:#725d3d!important}
/* V17 — the scene, speech and panels share one frame and one soft UI palette. */
:root{--ui-paper:#fff9e9;--ui-paper-deep:#f3ecd5;--ui-ink:#59452e;--ui-muted:#857151;--ui-edge:#c6b58c;--ui-leaf:#cce4a2;--ui-leaf-ink:#425d33}
.immersive-game .play{--game-stage-width:min(100vw,calc((100dvh - var(--dialogue-height))*1.8285714));background:#17251e}
.immersive-game .viewport,.immersive-game #dialogueDock{width:var(--game-stage-width)!important;max-width:100%;justify-self:center}
.immersive-game #dialogueDock{padding:8px 0;background:transparent}
.immersive-game #dialogueDock>#dialog,.immersive-game #dialogueDock>#exileOverlay{inset:8px 0;width:100%;margin:0}
.immersive-game #gameMenuButton{top:12px;right:12px;z-index:25}
.immersive-game .modal.in-game-panel:not(.viewport-panel){position:absolute;top:0;bottom:0;left:50%;right:auto;width:var(--game-stage-width);max-width:100%;transform:translateX(-50%);padding:clamp(10px,2vw,24px);z-index:40}
.immersive-game .modal.in-game-panel.viewport-panel{position:absolute;inset:0;width:100%;height:100%;padding:clamp(10px,2vw,24px);transform:none;z-index:40}
.immersive-game .library-overlay{position:absolute;top:0;bottom:0;left:50%;right:auto;width:var(--game-stage-width);max-width:100%;transform:translateX(-50%);z-index:42}
.modal,.library-drawer,#dialogueDock,.portrait-preview-dialog{--text:var(--ui-ink);--muted:var(--ui-muted);--gold:#8d6536;--line:var(--ui-edge);color:var(--ui-ink);color-scheme:light}
.modal:not(.stage-activity),.library-overlay{background:#243e2866;backdrop-filter:blur(5px)}
.modal:not(.stage-activity)>section,.library-drawer{background:linear-gradient(135deg,var(--ui-paper),#f3f1de);border:2px solid var(--ui-edge);border-radius:24px;box-shadow:0 8px 0 #a6916740,0 16px 40px #192b2530;color:var(--ui-ink)}
.modal:not(.stage-activity)>section{padding:24px;max-height:100%;overflow:hidden;scrollbar-color:#b7c58f #f2eedb}
.library-drawer{scrollbar-color:#b7c58f #f2eedb}
.library-header{background:#f9f5e5f5;border-color:#d7caa8;padding:18px 24px;border-radius:22px 22px 0 0}
.library-header h2,.library-header small,.modal h2,.modal h3{color:var(--ui-ink)}
.modal p,.modal label,.library-drawer p,.library-drawer label{color:var(--ui-ink)}
.modal small,.library-drawer small,.modal .overline,.library-drawer .overline{color:var(--ui-muted)}
.modal a,.library-drawer a{color:#6b7d3f;text-underline-offset:3px}
#dialogueDock>#dialog,.portrait-preview-dialog.dialog,#dialogueDock .exile-text.dialog{background:linear-gradient(115deg,#fff9eafc,#f4f0dbfa)!important;border:2px solid #c7b78f!important;border-radius:22px;box-shadow:0 5px 0 #a9956b40,inset 0 1px 0 #fffdf5;color:var(--ui-ink)}
#dialogueDock>#dialog.narrator-dialog{background:linear-gradient(115deg,#f3f6e5fc,#e9efdbfa)!important;border-color:#aab98c!important}
#dialogueDock #speaker,.portrait-preview-dialog .speaker strong,#dialogueDock .exile-text .speaker strong{color:#5b743b!important;font-weight:800}
#dialogueDock #page,.portrait-preview-dialog .speaker span{color:#8b7c5d}
#dialogueDock #line,#dialogueDock .speech p,.portrait-preview-dialog .portrait-preview-speech p{color:#59452e!important}
#dialogueDock .dialogue-person{color:#8a642c;text-decoration-color:#a4814866}
#dialogueDock .narrator-mark{color:#9ca95e;text-shadow:0 2px #fff}
.dialogue-idle{color:#a5ad88}
#dialogueDock :is(#portrait,.exile-face),.portrait-preview-slot .portrait-preview-window{background:radial-gradient(ellipse at 50% 35%,#f6f9df,#dce8bf)!important;border-color:#c6ce9f!important;border-radius:18px;box-shadow:none!important}
#dialogueDock .portrait:after{border-color:#fff9dc99;border-radius:13px}
kbd{background:#edf1dd;color:#53653b;border:1px solid #b7c29d;border-radius:6px;box-shadow:0 1px 0 #b7c29d}
.immersive-menu .action-row{gap:14px}
.immersive-menu>h2{margin:0 0 18px}
.immersive-menu a{padding:10px 14px;background:#f0edda;border:1px solid #cfc29f;border-radius:14px;text-align:center}
.library-drawer :is(.mission,.objective,.relation-detail,.relation-reading),.modal :is(.mission,.relation-reading){background:#f0edd9;border:1px solid #d0c09a;border-radius:18px;color:var(--ui-ink)}
.library-drawer :is(.progress-label,.relation-fact,.relation-detail strong,.relation-reading h3,.relation-reading p,.relations-intro p,.relation-help),.modal .relation-help{color:var(--ui-ink)}
.library-drawer .progress{height:8px;background:#e0d9bc;border-radius:10px;overflow:hidden}
.library-drawer .progress i{background:#a6c67b;border-radius:10px}
.library-drawer .journal :is(h4,summary,details),.library-drawer .beat-list :is(.current,.finished){color:#6a753e}
.library-drawer .beat-list>div{background:#faf7e7;border:1px solid #d6c9a7;border-radius:12px;margin:8px 0;padding:10px}
.relation-stage{background:radial-gradient(ellipse,#dfebc0aa,transparent 72%)}
.relation-graph-scroll{scrollbar-color:#aebd87 #f3efd9}
.relationship-link path:not(.relation-hit){stroke:#a4af78}
.relationship-link text{fill:#68553b;stroke:#fcf8e7;stroke-width:5px}
.relationship-link:hover path:not(.relation-hit),.relationship-link:focus path:not(.relation-hit){stroke:#73964c}
.relation-person,.relation-node{background:#e5edcb;border:2px solid #a5b77b;border-radius:50%;box-shadow:0 4px 0 #b5bd8c55,0 5px 10px #66553618}
.relation-center{background:#d8e8b6;border-color:#91aa60}
.relation-person strong,.relation-node span{background:#fff8e4;color:#625033;border:1px solid #c5b58c;border-radius:11px;padding:3px 10px;box-shadow:0 2px 0 #bca97d33}
.relation-person small{background:#d9e7ae;color:#4f6736;border:1px solid #a9bb7c}
.relation-person.unknown,.relation-node.unknown{background:#ebe9d9;border-color:#c6c7ad;opacity:.8}
.relation-person.unknown b,.relation-node.unknown b{color:#929b75}
.identity-card,.dual-card{background:#faf5e2;border:2px solid #c6b78f;border-radius:22px;box-shadow:0 4px 0 #b9a67833;color:#59452e}
.dual-card.flipped{background:#e8efcf;border-color:#aabd7f}
.modal :is(input:not([type=range]):not([type=checkbox]):not([type=radio]),select,textarea){background:#fffdf3;color:#5b4b33;border:1px solid #c7b68e;border-radius:10px;padding:7px 10px}
.portrait-settings .portrait-editor-preview,.portrait-guide-controls{background:#f2f0dc;border-color:#cbbd97;border-radius:18px}
.portrait-guide-controls{padding:14px}
.portrait-guide-controls>strong{color:#5b743b}
.modal input[type=range]{accent-color:#8da961}
.modal :is(.clue-list,.relation-reading){background:#f1edda;border-color:#cbbd97;border-radius:16px;color:#655236}
.modal .result{color:#52713a}
.modal .wrong,.modal #feedback{color:#87543c}
.immersive-game #start{background:linear-gradient(100deg,#f8f3dded,#edf2d2bb);color:#655334}
.immersive-game #start h2{color:#654a31;text-shadow:0 2px #fff9e7}
.immersive-game #start>p:not(.eyebrow),.immersive-game #start .eyebrow,.immersive-game #start .start-hint{color:#81704f}
.immersive-game .chapter-intro{background:radial-gradient(ellipse,#fff9e9f7,#ebefd8f5);color:#654c33}
.immersive-game .chapter-intro :is(.intro-overline,.intro-number,#introPlace,p,small){color:#7a724f}
.immersive-game .chapter-intro .intro-rule{background:#b6c289}
@media(max-width:650px){.immersive-game #dialogueDock{padding:6px 0}.immersive-game #dialogueDock>#dialog,.immersive-game #dialogueDock>#exileOverlay{inset:6px 0}.immersive-game #gameMenuButton{top:10px;right:10px;width:40px;height:40px}.modal:not(.stage-activity)>section{padding:18px;border-radius:20px}.library-header{padding:16px}.immersive-menu .action-row{gap:10px}.immersive-menu .action-row>button{font-size:12px}}
.immersive-game .modal.in-game-panel>section{max-width:100%;box-sizing:border-box}
.immersive-game :is(.chapter-label,.bottom-hud>span,.npc-label>span,#worldQuestHUD){border:1px solid #c9ba92;background:#fff8e5ed;color:#665033;border-radius:13px;box-shadow:0 3px 0 #99865b25;text-shadow:none}
.immersive-game .chapter-label{padding:8px 12px}
.immersive-game .chapter-label :is(span,strong){color:#675436;text-shadow:none}
.immersive-game .bottom-hud small{color:#7e8558}
.immersive-game .bottom-hud>span:last-child{color:#6d7e3f}
.immersive-game #worldQuestHUD p{color:#655035}
.immersive-game .npc-label.quest-current>span{background:#e9f0cc;border-color:#a8ba7b;color:#516632}
.relations-open .library-drawer{border:2px solid var(--ui-edge);border-radius:24px}
.portrait-editor-controls output{color:#7d633d}
@media(max-width:650px){.relations-open .library-drawer{border-radius:20px}}
/* V18: rounded stage, transparent centered portrait, comfortable speech actions. */
.immersive-game .viewport{border-radius:22px;overflow:hidden;isolation:isolate;clip-path:inset(0 round 22px)}
#dialogueDock :is(#portrait,.exile-face),.portrait-preview-slot .portrait-preview-window{background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0;align-self:center!important}
#dialogueDock .portrait:after{content:none!important}
.portrait-preview-slot{align-self:center}
:is(body:not(.keyboard-navigation),#storybook-button-theme) button:focus-visible{outline:none!important}
#dialogueDock :is(#nextLine,#exileNext),.portrait-preview-dialog button{display:inline-flex!important;align-items:center;justify-content:center;gap:7px;float:right;width:max-content!important;min-width:142px!important;max-width:100%;min-height:38px;padding:8px 14px!important;white-space:nowrap;flex-wrap:nowrap;font-size:13px;line-height:1.3;box-sizing:border-box}
#dialogueDock :is(#nextLine,#exileNext) kbd,.portrait-preview-dialog button kbd{margin:0;flex-shrink:0;white-space:nowrap}
.modal.compact-activity>section{width:min(760px,100%);height:auto;max-height:100%;border-radius:24px}
.compact-activity .activity{width:100%;max-width:none;margin:0;padding:4px 0 10px}
.compact-activity .activity>p,.compact-activity .activity>#activityFeedback{color:#725d3e}
.compact-activity .activity>small{color:#887353}
.encounter-card>p:not(.unlock-note){line-height:1.85;max-width:620px;margin:16px auto}
.encounter-card>strong{color:#71864c}
@media(max-width:650px){.immersive-game .viewport{border-radius:18px;clip-path:inset(0 round 18px)}#dialogueDock :is(#nextLine,#exileNext){min-width:112px!important;padding:7px 10px!important;font-size:12px;gap:5px}.compact-activity .answers button{font-size:14px}}
/* Exploration already marks its targets; keep only actual continuation controls. */
#prompt{display:none!important}
#worldQuestHUD.world-controls-only{background:none!important;border:0!important;box-shadow:none!important;padding:0!important}
#worldQuestHUD.world-controls-only:not(:has(button)){display:none!important}
.slice-ratios span{border-radius:14px!important;background:#e2edc5!important;color:#465936!important;border:2px solid #9bb277!important;box-shadow:0 3px 0 #94a979;padding:9px 12px!important}
.slice-ratios span.needs-adjustment{background:#f8ddd2!important;color:#8b4035!important;border-color:#cb8c7a!important;box-shadow:0 3px 0 #bb7d6b}
.slice-ratios span small{display:block;color:inherit!important}.slice-tolerance{color:#665039!important;font-weight:700}
.willow-spoken-verse,.willow-attempt-status{color:#6b5435!important}
/* V19 hand-painted maps, clear discovery marks and deliberate cinematics. */
.defense-mode .defense-field{height:auto!important;aspect-ratio:2/1;min-height:0!important;max-height:none!important;background:url('assets/defense-meadow-v19.ce5d70db517a.webp') center/100% 100%!important;border-radius:22px;border:0}
.defense-field .defense-road-v11{display:none!important}
:is(body,#storybook-button-theme) .defense-field button.defense-pad{width:9%!important;height:20%!important;min-width:0!important;min-height:0!important;background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important;padding:0!important}
.defense-field .defense-pad .empty-pad{color:#5a6c36;text-shadow:0 1px 1px #fffce7;font-size:25px}.defense-pad .empty-pad small{display:none}.defense-field .defense-pad.occupied{background:none!important}.defense-field .defense-pad .unit-tag{background:#fff6dfef;color:#56683a;border-radius:8px;font-size:10px;padding:3px}
#defenseStatus{background:#e4edc9!important;color:#4d6536!important;border:0!important;border-radius:18px!important}.defense-banner{background:#fcf6dded!important;color:#5b673a!important;border:0!important;border-radius:12px!important}
.defense-entry,.defense-castle{background:#fff5dfdc!important;color:#4d6438!important;border:0!important;border-radius:8px!important}
#routePuzzle .route-grid{width:min(720px,100%)!important;max-width:none!important;aspect-ratio:1;height:auto!important;box-sizing:border-box;background:url('assets/safe-route-v19.56e41cfdf73e.webp') center/100% 100%!important;padding:6% 3% 11%!important;gap:0!important;border:0!important;border-radius:22px!important;margin:22px auto}
:is(body,#storybook-button-theme) #routePuzzle .route-grid button.route-cell{border:0!important;background:transparent!important;box-shadow:none!important;color:#593e2a!important;text-shadow:0 1px 2px #fff8dd!important;font-size:15px!important;padding:0!important}
:is(body,#storybook-button-theme) #routePuzzle .route-grid button.route-current{background:#fff0b53d!important;border-radius:30%!important;outline:2px solid #dbbc64}.route-cell .cast-portrait{width:70%;max-height:84%;object-fit:contain}
#routePuzzle>p{max-width:850px;margin:12px auto;line-height:1.9}.water-crisis{height:auto!important;aspect-ratio:2/1!important;background:url('assets/water-crisis-v19.aa4e2c37bf12.webp') center/cover!important;border:0!important;border-radius:22px!important}.water-crisis>*{display:none!important}
.identity-status{align-items:center;color:#596b3f!important;gap:30px}.difference-clock-v19{position:relative;width:84px;height:90px;display:block}.difference-clock-v19>img:first-child{width:64px;height:64px;object-fit:contain;display:block;margin:auto}.difference-clock-v19>.clock-hand-v19{position:absolute;top:10px;left:23px;width:36px;height:33px;object-fit:contain;transform-origin:50% 85%}.difference-clock-v19 b{display:block;font-size:16px;color:#596b3f!important}
.identity-panel .difference-target.found{background:transparent!important;border:0!important;box-shadow:none!important;outline:none!important}.difference-target svg{width:100%;height:100%;overflow:visible;fill:none;pointer-events:none}.difference-target svg path{stroke:#d33e36;stroke-width:3.5;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:330;stroke-dashoffset:330;animation:red-pencil-v19 .55s ease-out forwards}.difference-target svg path+path{stroke-width:1.1;opacity:.65;animation-delay:.13s}@keyframes red-pencil-v19{to{stroke-dashoffset:0}}
#roarCinematicV19{position:absolute;inset:0;z-index:12;pointer-events:none;display:flex;align-items:center;justify-content:center;flex-direction:column;background:radial-gradient(ellipse,#ffe9a344,transparent 70%);animation:roar-reveal-v19 3.1s both}#roarCinematicV19 img{width:min(40%,380px);filter:drop-shadow(0 0 15px #ffe49a)}#roarCinematicV19 strong{font-size:clamp(24px,5vw,65px);color:#6f3d16;text-shadow:0 2px #fff6d8}.imperial-roar-v19{animation:earth-shake-v19 .12s linear 13}
@keyframes earth-shake-v19{0%,100%{translate:-4px 2px}50%{translate:4px -3px}}@keyframes roar-reveal-v19{0%{opacity:0;scale:.8}15%,65%{opacity:1;scale:1}100%{opacity:0;scale:1.1}}
@media(prefers-reduced-motion:reduce){.imperial-roar-v19{animation:none}#roarCinematicV19{animation:none}.difference-target svg path{animation:none;stroke-dashoffset:0}}
@media(max-width:650px){#routePuzzle .route-grid{width:100%!important}.defense-pad .unit-tag{font-size:8px}.difference-clock-v19{width:65px}}
.lotus-activity-v19{max-width:800px;margin:auto;padding:20px}.lotus-activity-v19 canvas{display:block;width:min(720px,100%);height:auto;aspect-ratio:3/2;margin:15px auto;border-radius:24px;background:#bde3d9}.lotus-status-v19{display:flex;align-items:center;justify-content:center;gap:30px;color:#51663f}.lotus-status-v19 img{width:27px;height:27px;object-fit:contain}.lotus-status-v19 b{font-size:23px}.lotus-activity-v19 .action-row button{min-width:105px;touch-action:none}.lotus-activity-v19>p{color:#725d3e!important}
.curtain-call-v19{padding:20px clamp(12px,3vw,42px);max-width:1400px;margin:auto}.curtain-call-v19 h2{margin:8px}.curtain-call-v19>p{color:#6b5a3f!important}.curtain-cast-v19{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:8px;max-width:1200px;margin:20px auto;background:url('assets/runner-panorama-v19.df10a2110018.webp') center/cover;border-radius:24px;padding:15px 12px}.curtain-person-v19{display:flex;flex-direction:column;align-items:center;min-width:0;animation:greeting-body-v19 2.5s var(--greeting-delay) ease-in-out infinite}.curtain-person-art-v19{position:relative;width:100%;height:85px;display:flex;justify-content:center;align-items:flex-end}.curtain-character-v19{max-width:98%;height:80px;object-fit:contain;filter:drop-shadow(0 2px 1px #536e4755)}.curtain-hand-v19{position:absolute;width:25px;height:30px;object-fit:contain;right:-1px;top:22px;transform-origin:50% 90%;animation:greeting-wave-v19 .65s var(--greeting-delay) ease-in-out infinite alternate}.curtain-person-v19>span{font-size:11px;padding:3px 6px;background:#fff8e6ec;color:#665138;border-radius:8px;margin-top:5px;white-space:nowrap}.curtain-end-v19{font-family:serif;font-size:20px}.greeting-finished .curtain-person-v19,.greeting-finished .curtain-hand-v19{animation:none}@keyframes greeting-wave-v19{from{rotate:-25deg}to{rotate:25deg}}@keyframes greeting-body-v19{50%{translate:0 -2px}}
@media(max-width:800px){.curtain-cast-v19{grid-template-columns:repeat(8,minmax(0,1fr));gap:5px}.curtain-person-art-v19{height:65px}.curtain-character-v19{height:62px}.curtain-hand-v19{width:18px;right:-2px;top:18px}.curtain-call-v19{padding:10px}.curtain-person-v19>span{font-size:9px;padding:2px}.curtain-end-v19{font-size:16px}}@media(max-width:480px){.curtain-cast-v19{grid-template-columns:repeat(5,minmax(0,1fr))}}@media(prefers-reduced-motion:reduce){.curtain-person-v19,.curtain-hand-v19{animation:none}}
.defense-field .defense-range{height:auto!important;aspect-ratio:1}
.difference-clock-v19>.clock-hand-v19{top:4px}
.curtain-call-v19 .curtain-character-v19{width:100%;max-width:100%;height:85px;object-fit:contain}.curtain-hand-v19{display:none!important}
@media(max-width:800px){.curtain-call-v19 .curtain-character-v19{height:65px}}
.roar-status{color:#596b3f!important}.roar-activity progress{accent-color:#8ca858}

/* Flower ratio chips: explicit contrast over the light chip surfaces. */
.slice-ratios>span b{color:#354829!important}.slice-ratios>span.needs-adjustment b{color:#8b3028!important}.slice-ratios>span small:empty{display:none}.slice-meter{color:#665039}.slice-meter b{color:#665039}.slice-key-help{color:#665039}

.willow-target-sparkles{pointer-events:none;fill:#fff6d1;filter:drop-shadow(0 0 3px #f5d48d)}.willow-target-sparkles path{transform-box:fill-box;transform-origin:center;animation:willowSparkleV20 2.1s ease-in-out infinite}.willow-target-sparkles path:nth-child(2){animation-delay:-.7s}.willow-target-sparkles path:nth-child(3){animation-delay:-1.4s}@keyframes willowSparkleV20{0%,100%{opacity:.35;transform:scale(.7)}50%{opacity:1;transform:scale(1.15)}}@media(prefers-reduced-motion:reduce){.willow-target-sparkles path{animation:none;opacity:.8}}
.willow-aim-controls output,.willow-spoken-verse,.willow-charge-help,.willow-collected{color:#665039!important}
/* Dedicated willow play screen: scenery leads, instructions stay optional. */
#modal.stage-activity:has(.willow-fortress){position:fixed!important;inset:0!important;width:100vw!important;height:100dvh!important;z-index:1000;padding:0!important}
#modal:has(.willow-fortress) #modalContent{height:100%;padding:0!important;box-sizing:border-box}
.stage-activity .willow-fortress{position:relative;box-sizing:border-box;max-width:none!important;width:100%;min-height:100%;padding:12px 24px!important;display:flex;flex-direction:column;align-items:center;gap:8px}
.willow-game-header{display:flex;align-items:center;justify-content:space-between;width:100%;max-width:1440px;padding:0;background:none;border:0;flex-shrink:0}.willow-game-header h2{font-size:23px;margin:2px 0!important}.willow-game-header small{font-size:11px;color:#786342}.willow-game-header button{padding:7px 14px}
.willow-fortress .willow-flight-board{width:min(100%,calc((100dvh - 225px)*2));aspect-ratio:2/1;margin:0!important;flex-shrink:0;border-radius:22px;border:2px solid #a9b889;box-shadow:0 5px 0 #a0ad87}
.willow-fortress .willow-flight-scenery{filter:none}
.willow-game-hud{position:absolute;right:12px;top:12px;z-index:2;pointer-events:none;background:#fff9e9ed;border:1px solid #d7cba7;border-radius:16px;padding:6px 14px;box-shadow:0 3px 0 #66503933}.willow-game-hud .willow-progress{font-size:20px;margin:0;gap:12px}.willow-game-hud .willow-attempt-status{font-size:12px;margin:1px 0!important}.willow-fortress #willowWind{border-radius:14px;background:#fff9e9ed;color:#5a4930;font-weight:700;border:1px solid #d7cba7}
.willow-fortress .willow-aim-controls{width:100%;max-width:1100px;margin:0;grid-template-columns:1fr 1.4fr 1fr;gap:20px;background:#fff9e9;border:1px solid #d7cba7;border-radius:18px;padding:10px 16px;box-sizing:border-box}.willow-fortress .willow-aim-controls button{min-height:40px}.willow-fortress .willow-angle-controls>span{margin-bottom:3px}
.willow-fortress #willowVersePreview{font-size:17px;line-height:1.4;margin:2px!important}.willow-fortress .willow-charge-help{font-size:11px;margin:0!important}.willow-fortress #activityFeedback{min-height:0;line-height:1.4;margin:0!important;font-size:13px}.willow-fortress #willowCollected{display:none}.willow-fortress #finishActivity{margin:4px}.willow-fortress #willowHelpText{position:absolute;top:66px;left:50%;transform:translateX(-50%);z-index:5;width:min(850px,90%);padding:16px;border-radius:18px;background:#fff9edf5;border:2px solid #a4b782;box-shadow:0 5px 16px #263b2c44;font-size:14px;line-height:1.8}
@media(max-width:650px){.stage-activity .willow-fortress{padding:10px!important}.willow-game-header h2{font-size:18px}.willow-fortress .willow-flight-board{width:100%}.willow-fortress .willow-aim-controls{grid-template-columns:1fr 1fr;gap:10px;padding:10px}.willow-fortress #willowLaunch{grid-column:1/-1}.willow-game-hud{top:7px;right:7px;padding:3px 7px}.willow-game-hud .willow-attempt-status{font-size:10px}.willow-game-hud .willow-progress{font-size:16px}.willow-fortress #willowWind{font-size:10px;top:7px;left:7px;padding:4px 6px}}
/* Clock dial centre (349,337) and hand pin (315,516) in the 640px artwork.
   Anchor relative to container centre so the narrow-screen clock stays aligned. */
.difference-clock-v19>.clock-hand-v19{width:36px;height:36px;left:calc(50% - 14.82px);top:4.675px;transform-origin:49.21875% 80.625%}
.difference-target .pencil-reveal-v23{fill:none;stroke:white;stroke-width:40;stroke-dasharray:100;stroke-dashoffset:100;animation:pencil-reveal-v23 .65s linear forwards}@keyframes pencil-reveal-v23{to{stroke-dashoffset:0}}@media(prefers-reduced-motion:reduce){.difference-target .pencil-reveal-v23{animation:none;stroke-dashoffset:0}}
/* All defense status children must follow the light-panel theme. */
#defenseStatus b,#defenseStatus strong{color:#344b2a!important}#defenseStatus small{color:#52663e!important}.defense-brief h3{color:#60462e!important}.defense-brief>small{color:#6c654c!important}.defense-brief>p,.defense-summary,.defense-summary :is(b,strong,small){color:#55472f!important}#defenseUnitPanel{color:#4a5d35!important}
:is(body,#storybook-button-theme) #routePuzzle .route-grid button.route-cell:is(.route-current,[aria-pressed="true"]){outline:0!important;border:0!important;background:transparent!important;box-shadow:none!important;border-radius:0!important}
#routePuzzle .route-grid .route-footprints-v23{position:absolute;inset:6% 3% 11%;pointer-events:none;z-index:0}.route-footprints-v23 img{position:absolute;width:3.3%;height:4.7%;object-fit:contain;transform:translate(-50%,-50%) rotate(var(--foot-angle));opacity:.95}.route-cell{z-index:1}
.troop-v11.guard.firing{animation:none!important}.defense-pad .unit-tag small{font-size:9px;color:#665039}
.lotus-activity-v19 canvas{image-rendering:auto!important;max-width:100%}

/* Content-sized flower chips: centre the group and every text row. */
#sliceRatios.slice-ratios{display:flex;flex-wrap:wrap;justify-content:center;align-items:stretch;gap:8px;max-width:760px;margin:12px auto;width:100%}#sliceRatios.slice-ratios>span{box-sizing:border-box;flex:0 0 auto;min-width:82px;padding:10px 12px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}#sliceRatios.slice-ratios>span :is(b,small){display:block;width:100%;margin:0;padding:0;text-align:center;white-space:nowrap}#sliceRatios.slice-ratios b{font-size:15px;font-variant-numeric:tabular-nums}
/* Painted willow gauge; the inner window only clips the painted energy texture. */
.willow-fortress #willowPowerMeter{position:relative;aspect-ratio:5.12;height:auto;min-height:56px;background:transparent url('assets/willow-gauge-frame-v24.8a828f30ad71.webp') center/100% 100% no-repeat;border:0;border-radius:0;overflow:visible;box-shadow:none}.willow-energy-window-v24{position:absolute;left:13.87%;top:34.67%;width:72.27%;height:28.33%;overflow:hidden;border-radius:999px}.willow-fortress #willowPowerFill{height:100%;background:url('assets/willow-gauge-fill-v24.0e2d4a6a7bbf.webp') left center/auto 100% repeat-x;border-radius:0;box-shadow:none}.willow-fortress #willowVersePreview{display:none}.willow-full-poem-v24{position:absolute;z-index:8;left:50%;top:50%;transform:translate(-50%,-50%);width:min(580px,83%);box-sizing:border-box;padding:24px 18px;background:#fff8e8f5;border-radius:18px;color:#59432c;text-align:center;box-shadow:0 8px 30px #31281755;animation:willow-poem-open-v24 .7s ease both}.willow-full-poem-v24 h3{font-family:serif;font-size:30px;margin:3px 0 16px}.willow-full-poem-v24 p{font-family:serif;font-size:clamp(14px,2.1vw,25px);line-height:1.8;margin:6px 0;word-break:keep-all}.willow-full-poem-v24 small{color:#69774c}@keyframes willow-poem-open-v24{from{opacity:0;transform:translate(-50%,-43%)}to{opacity:1;transform:translate(-50%,-50%)}}
#quickToolsV28{position:absolute;right:12px;top:12px;z-index:25;display:flex;align-items:center;gap:7px}#quickToolsV28>button{display:block;position:static;min-width:64px;height:44px;min-height:0;margin:0;padding:6px 10px;font-size:13px;line-height:1.1;white-space:nowrap}#quickToolsV28>button small{display:inline;color:inherit;font-size:10px;font-weight:400}#quickToolsV28>button[aria-pressed=false]{background:#e2dfcd!important;color:#686852!important;box-shadow:0 3px 0 #b8b49e!important}#quickToolsV28>#gameMenuButton{position:static;width:44px;min-width:44px;padding:0;font-size:22px}
@media(max-width:650px){#quickToolsV28{top:10px;right:10px;gap:5px}#quickToolsV28>button{min-width:42px;width:42px;height:40px;padding:3px 1px;font-size:10px}#quickToolsV28>button small{display:block;font-size:9px;margin-top:3px}#quickToolsV28>#gameMenuButton{min-width:40px;width:40px;height:40px}.immersive-game .chapter-label{max-width:calc(100% - 210px);padding:7px 9px}.immersive-game .chapter-label strong{font-size:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.immersive-game .chapter-label>span{font-size:8px}}
/* Keep the action anchored while the typewriter changes line height. */
#dialogueDock #nextLine{position:static!important;bottom:12px;right:20px;margin:0!important;translate:0 0!important;transform:none!important;transition:translate .08s ease,box-shadow .08s ease!important}#dialogueDock #line{padding-bottom:46px;box-sizing:border-box}#dialogueDock #nextLine:active:not(:disabled){translate:0 1px!important;box-shadow:0 3px 0 var(--button-shadow)!important}@media(max-width:650px){#dialogueDock #nextLine{right:12px;bottom:9px}}
#modal.willow-in-scene-v31{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;z-index:40;padding:0!important;background:transparent!important;backdrop-filter:none!important;display:block!important}#modal.willow-in-scene-v31>section{width:100%!important;max-width:none!important;height:100%!important;max-height:none!important;margin:0!important;padding:0!important;background:transparent!important;border:0!important;border-radius:0!important;overflow:hidden!important;box-shadow:none!important}#modal.willow-in-scene-v31 #modalContent{width:100%;height:100%;padding:0!important}#modal.willow-in-scene-v31 #closeModal{display:none}#modal.willow-in-scene-v31 .willow-fortress{width:100%;height:100%;min-height:0!important;padding:0!important;max-width:none!important;position:relative}#modal.willow-in-scene-v31 .willow-flight-board{position:absolute;inset:0;width:100%!important;height:100%!important;aspect-ratio:auto;margin:0!important;border:0;border-radius:0;box-shadow:none}#modal.willow-in-scene-v31 .willow-game-header{position:absolute;top:48px;left:12px;z-index:4;width:auto}#modal.willow-in-scene-v31 .willow-game-header>div{display:none}#modal.willow-in-scene-v31 .willow-game-header button{min-height:26px;font-size:11px;padding:4px 9px!important}#modal.willow-in-scene-v31 .willow-aim-controls{position:absolute;z-index:5;bottom:10px;left:12px;right:12px;width:auto;max-width:none;display:grid;grid-template-columns:1fr 1.3fr 1.2fr;align-items:center;gap:12px;padding:5px 12px;background:#fff9e8e8;border-radius:16px;min-height:62px}#modal.willow-in-scene-v31 .willow-angle-controls>div{display:flex;gap:6px}#modal.willow-in-scene-v31 .willow-angle-controls button{min-height:26px;padding:3px 8px!important;font-size:11px}#modal.willow-in-scene-v31 #willowLaunch{font-size:12px;min-height:38px;grid-column:auto}#modal.willow-in-scene-v31 #willowPowerMeter{min-height:0;height:42px;aspect-ratio:auto}#modal.willow-in-scene-v31 .willow-aim-controls label,#modal.willow-in-scene-v31 .willow-angle-controls>span{font-size:11px;line-height:1.1}#modal.willow-in-scene-v31 .willow-charge-help,#modal.willow-in-scene-v31 #willowCollected{display:none}#modal.willow-in-scene-v31 #activityFeedback{position:absolute;left:15%;right:15%;bottom:83px;z-index:6;text-align:center;color:#463923;font-weight:750;font-size:12px;text-shadow:0 1px 2px #fff8e7}#modal.willow-in-scene-v31 #finishActivity{position:absolute;bottom:16px;left:50%;transform:translateX(-50%);z-index:10;font-size:13px;white-space:nowrap}#modal.willow-in-scene-v31 .willow-complete-v31 .willow-aim-controls,#modal.willow-in-scene-v31 .willow-complete-v31 #activityFeedback{display:none}#modal.willow-in-scene-v31 .willow-progress{align-items:center;gap:5px;color:#344d2b}#modal.willow-in-scene-v31 .willow-progress img{width:28px;height:22px;object-fit:contain}#modal.willow-in-scene-v31 .willow-progress img.pending{filter:grayscale(.9);opacity:.45}#modal.willow-in-scene-v31 .willow-progress b{font-size:18px;margin-left:7px;color:#344d2b}#modal.willow-in-scene-v31 .willow-attempt-status{color:#57432c;font-weight:700}.willow-full-poem-v24{display:flex;flex-direction:column;align-items:center;justify-content:center;background:transparent url('assets/willow-parchment-v31.4332e20462b8.webp') center/100% 100% no-repeat!important;border:0!important;border-radius:0!important;box-shadow:none!important;height:78%;width:auto;aspect-ratio:1.5;max-width:92%;padding:0!important;z-index:9}.willow-full-poem-v24>:is(small,h3,p){width:73%;flex-shrink:0;text-align:center}.willow-full-poem-v24 h3{font-size:clamp(16px,2.4vw,29px);margin:3px 0 9px}.willow-full-poem-v24 small{font-size:clamp(8px,1vw,12px);margin:0}.willow-full-poem-v24 p{font-size:clamp(11px,1.7vw,23px);line-height:1.7;margin:3px 0;letter-spacing:0;word-break:keep-all}.willow-playing-v31 .chapter-label{visibility:hidden}
#modal.rhythm-popup-v31{position:absolute!important;inset:0!important;z-index:30;background:#14221924!important;backdrop-filter:none!important;padding:10px!important}#modal.rhythm-popup-v31>section{width:min(600px,86%)!important;max-width:600px!important;height:auto!important;max-height:96%!important;padding:12px 16px!important;border-radius:22px!important;overflow:hidden!important;background:#fbf7e6f5!important}#modal.rhythm-popup-v31 #closeModal{display:none}#modal.rhythm-popup-v31 .activity>h2,#modal.rhythm-popup-v31 .activity>.activity-kicker{display:none}#modal.rhythm-popup-v31 .rhythm-song{padding:4px;background:none}#modal.rhythm-popup-v31 .rhythm-song p{display:none}#modal.rhythm-popup-v31 .rhythm-song h3{font-size:20px;margin:3px}#modal.rhythm-popup-v31 .rhythm-controls{display:flex;gap:5px;margin:5px 0;flex-wrap:wrap}#modal.rhythm-popup-v31 .rhythm-controls button{flex:1;font-size:10px;padding:6px!important;min-height:32px}#modal.rhythm-popup-v31 .rhythm-dashboard{margin:5px 0;gap:20px}#modal.rhythm-popup-v31 .rhythm-dashboard b{font-size:22px}#modal.rhythm-popup-v31 .rhythm-highway{height:clamp(150px,32dvh,260px);margin:5px auto}#modal.rhythm-popup-v31 .rhythm-pad{margin:3px auto}#modal.rhythm-popup-v31 .rhythm-pad button{min-height:36px;padding:5px!important}#modal.rhythm-popup-v31 #rhythmAudioState,#modal.rhythm-popup-v31 #rhythmStatus{font-size:11px;margin:4px 0}#modal.rhythm-popup-v31 .rhythm-access,#modal.rhythm-popup-v31 .activity>small:last-child{font-size:10px}.encounter-departing-v31{background:transparent!important;backdrop-filter:none!important}.encounter-departing-v31 .encounter-card{pointer-events:none}
@media(max-width:650px){#modal.willow-in-scene-v31 .willow-aim-controls{left:5px;right:5px;bottom:5px;padding:4px 6px;gap:5px;min-height:54px;grid-template-columns:1fr 1fr 1fr}#modal.willow-in-scene-v31 .willow-angle-controls button{font-size:9px;padding:3px 5px!important}#modal.willow-in-scene-v31 #willowLaunch{font-size:9px;padding:5px!important;min-height:34px;white-space:normal}#modal.willow-in-scene-v31 #willowPowerMeter{height:30px}#modal.willow-in-scene-v31 .willow-game-hud{padding:4px 7px;right:6px;top:6px}#modal.willow-in-scene-v31 .willow-attempt-status{font-size:9px}#modal.willow-in-scene-v31 .willow-progress img{width:19px;height:16px}#modal.willow-in-scene-v31 #activityFeedback{bottom:66px;font-size:10px}#modal.rhythm-popup-v31>section{width:83%!important;padding:10px!important}.willow-full-poem-v24 p{font-size:clamp(9px,2.6vw,15px)}.willow-full-poem-v24 h3{font-size:16px;margin:1px 0 3px}}
#modal.bad-panel-v31{position:absolute!important;inset:8px 16px!important;z-index:20!important;width:auto!important;height:auto!important;padding:0!important;background:transparent!important;backdrop-filter:none!important;display:block!important}#modal.bad-panel-v31>section{width:100%!important;max-width:none!important;height:100%!important;max-height:none!important;box-sizing:border-box;padding:12px 20px!important;overflow:hidden!important}#modal.bad-panel-v31 #closeModal{display:none}#modal.bad-panel-v31 .bad-ending{display:grid;grid-template-columns:1fr auto;gap:4px 14px;text-align:left;align-items:center;height:100%}#modal.bad-panel-v31 .bad-ending>small{grid-column:1;font-size:10px;color:#806449}#modal.bad-panel-v31 .bad-ending>h2{grid-column:1;margin:0;font-size:20px;line-height:1.3}#modal.bad-panel-v31 .bad-ending>p{grid-column:1;margin:0;font-size:13px;line-height:1.6}#modal.bad-panel-v31 #retryBranch{grid-column:2;grid-row:1/3;font-size:12px;margin:0;padding:8px 12px!important}#modal.bad-panel-v31 #endingGallery{grid-column:2;grid-row:3;font-size:11px;margin:0;padding:6px 12px!important}.bad-scene-v31 #world{filter:saturate(.65) brightness(.86)}@media(max-width:650px){#modal.bad-panel-v31{inset:6px 0!important}#modal.bad-panel-v31>section{padding:10px!important}#modal.bad-panel-v31 .bad-ending{gap:3px 7px}#modal.bad-panel-v31 .bad-ending>h2{font-size:15px}#modal.bad-panel-v31 .bad-ending>p{font-size:11px}#modal.bad-panel-v31 #retryBranch{font-size:10px;white-space:normal;max-width:110px}}
#modal.rhythm-popup-v31 .rhythm-highway{height:clamp(170px,32dvh,290px);max-width:460px}
#modal.rhythm-popup-v31 .rhythm-pad{max-width:460px}
#modal.rhythm-popup-v31 .activity>#activityFeedback{color:#57432f;font-weight:750;font-size:14px;line-height:1.6}
@media(max-height:600px){#modal.rhythm-popup-v31 .rhythm-highway{height:clamp(140px,28dvh,190px)}}#modal.rhythm-popup-v31 .activity>small:last-child{display:none}
.encounter-flight-v31{box-sizing:border-box;background:#fbf7e7;border:2px solid #b5bd94;border-radius:22px;padding:18px;text-align:center;box-shadow:0 7px 24px #1c251c33;transform-origin:center center}.encounter-flight-v31 h2{font:28px serif;margin:8px}.encounter-flight-v31 p{font-size:14px;line-height:1.7;color:#66533a}.encounter-departing-v31>section{background:transparent!important;border-color:transparent!important;box-shadow:none!important;overflow:visible!important}

/* The audience scene is the roar game's stage; only its controls are overlaid. */
#modal.roar-in-scene-v33{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;padding:0!important;background:transparent!important;backdrop-filter:none!important;pointer-events:none;z-index:40;display:flex!important;align-items:flex-end!important;justify-content:center!important}
#modal.roar-in-scene-v33>section{pointer-events:auto;width:min(540px,90%)!important;max-width:90%!important;max-height:45%!important;margin:0 0 12px!important;padding:10px 18px!important;overflow:hidden;background:#fff9e8f5!important;box-shadow:0 4px 12px #34291825}
#modal.roar-in-scene-v33 #closeModal,#modal.roar-in-scene-v33 .roar-stage{display:none!important}
#modal.roar-in-scene-v33 .roar-activity{max-width:none;padding:0!important;display:grid;grid-template-columns:1fr auto;gap:4px 14px;align-items:center}
#modal.roar-in-scene-v33 h2{font-size:18px;margin:0;text-align:left}
#modal.roar-in-scene-v33 .roar-activity>p:first-of-type{grid-column:1/-1;font-size:12px;line-height:1.5;margin:0;color:#665137}
#modal.roar-in-scene-v33 .roar-status{grid-column:2;grid-row:1;gap:15px;font-size:16px;margin:0;color:#3e572c!important}
#modal.roar-in-scene-v33 progress{grid-column:1;height:18px;margin:2px 0;width:100%}
#modal.roar-in-scene-v33 #activityFeedback{grid-column:1;font-size:11px;line-height:1.4;margin:0;color:#665137}
#modal.roar-in-scene-v33 #roarStart,#modal.roar-in-scene-v33 #roarPress,#modal.roar-in-scene-v33 #finishActivity{grid-column:2;grid-row:3/5;width:auto;min-width:130px;min-height:42px;font-size:14px;margin:0;padding:6px 12px;transform:none}
#modal.roar-in-scene-v33 #roarPress:active{translate:0 1px;filter:brightness(.96);transform:none}
@media(max-width:600px){#modal.roar-in-scene-v33>section{margin-bottom:6px!important;padding:7px 10px!important;max-height:49%!important}#modal.roar-in-scene-v33 h2{font-size:15px}#modal.roar-in-scene-v33 .roar-activity{gap:3px 8px}#modal.roar-in-scene-v33 #roarStart,#modal.roar-in-scene-v33 #roarPress{min-width:100px;font-size:12px}#modal.roar-in-scene-v33 .roar-activity>p:first-of-type{font-size:11px}}
#modal.roar-in-scene-v33.hidden{display:none!important}

/* Portrait comparison stays in a popup, with the story visible around it. */
#modal.difference-popup-v34{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;padding:12px!important;background:#17261e55!important;backdrop-filter:none!important;z-index:40;display:flex!important;align-items:center!important;justify-content:center!important;color:#57432f}
#modal.difference-popup-v34.hidden{display:none!important}
#modal.difference-popup-v34>section{width:min(860px,94%)!important;max-width:94%!important;height:auto!important;max-height:95%!important;margin:0!important;padding:12px 18px!important;border-radius:24px!important;background:#fbf7e7!important;overflow:hidden}
#modal.difference-popup-v34 #modalContent{padding:0!important;width:100%;height:auto!important;background:transparent!important}
#modal.difference-popup-v34 #closeModal{display:none}
#modal.difference-popup-v34 .identity-activity{padding:0!important;max-width:none;width:100%;margin:0;text-align:center}
#modal.difference-popup-v34 h2{font-size:20px;margin:2px 0;color:#60462e}
#modal.difference-popup-v34 .identity-activity>small{display:none}
#modal.difference-popup-v34 .identity-activity>p{font-size:12px;line-height:1.5;margin:5px 0;color:#69563d}
#modal.difference-popup-v34 .identity-status{font-size:20px;gap:24px;margin:5px 0;color:#465c33;align-items:center}
#modal.difference-popup-v34 .difference-clock-v19{width:46px;height:60px;margin:0}
#modal.difference-popup-v34 .identity-pair{width:min(100%,calc((100dvh - 250px)*2));gap:8px}
#modal.difference-popup-v34 .identity-panel{border-radius:8px}
#modal.difference-popup-v34 #activityFeedback:empty{display:none}
#modal.difference-popup-v34 #differenceStart,#modal.difference-popup-v34 #finishActivity{min-height:34px;margin:5px 0 0;padding:5px 18px}
@media(max-height:540px){#modal.difference-popup-v34>section{padding:6px 12px!important}#modal.difference-popup-v34 h2{font-size:16px}#modal.difference-popup-v34 .identity-status{margin:2px;font-size:16px}#modal.difference-popup-v34 .difference-clock-v19{width:32px;height:43px}#modal.difference-popup-v34 .identity-pair{width:min(100%,calc((100dvh - 175px)*2))}#modal.difference-popup-v34 .identity-activity>p{margin:2px;font-size:11px}}
#modal.difference-popup-v34 .difference-clock-v19{width:84px;height:90px;scale:.65;margin:-15px -12px}
@media(max-height:540px){#modal.difference-popup-v34 .difference-clock-v19{width:84px;height:90px;scale:.5;margin:-23px -20px}}

/* Health fill must not inherit prose em margins. Troop boxes keep explicit anchors. */
#defenseStatus .base-hp>i{overflow:hidden;padding:0;border:0;box-sizing:border-box}
#defenseStatus .base-hp>i>em{margin:0;padding:0;max-width:100%;height:100%;box-sizing:border-box}
.defense-field .defense-pad .troop-v11{position:absolute;inset:0;width:100%;height:100%;display:block;overflow:visible}
.defense-field .defense-pad .troop-v11>.defense-unit-art{display:block;position:absolute;left:0;bottom:5px;width:100%;height:100%;max-width:none;max-height:none;object-fit:contain;object-position:center bottom;transform:none;image-rendering:auto;opacity:1;visibility:visible}
.defense-field .defense-enemy .enemy-step{position:relative;width:100%;height:100%}
.defense-field .defense-enemy .defense-unit-art{display:block;width:100%;height:100%;object-fit:contain;object-position:center bottom;image-rendering:auto}

/* V38: reserve readable dialogue space and keep stage/dock edges identical. */

.immersive-game #dialogueDock{width:var(--game-stage-width);max-width:100%;padding:6px 0;box-sizing:border-box}
#dialogueDock .speech{padding-top:12px;min-height:0}
#dialogueDock #line{max-height:none!important;min-height:0!important;overflow:auto!important;padding:0!important;margin:0!important;line-height:1.6}
#modal.bad-panel-v31{inset:6px 0!important;width:100%!important;max-width:100%!important;height:calc(100% - 12px)!important}
#modal.bad-panel-v31.hidden{display:none!important}
#modal.bad-panel-v31>section{padding:14px 24px!important;overflow:visible!important;height:100%!important;max-height:100%!important}
#modal.bad-panel-v31 #modalContent{padding:0!important;height:100%;max-height:none;overflow:visible}
#modal.bad-panel-v31 .bad-ending{width:100%;max-width:none;margin:0;display:grid;grid-template-columns:minmax(0,1fr) minmax(160px,240px);grid-template-rows:auto auto 1fr;align-content:center;gap:5px 24px;height:100%}
#modal.bad-panel-v31 .bad-ending>small{grid-column:1;grid-row:1}
#modal.bad-panel-v31 .bad-ending>h2{grid-column:1;grid-row:2}
#modal.bad-panel-v31 .bad-ending>p{grid-column:1;grid-row:3;align-self:start}
#modal.bad-panel-v31 #retryBranch{grid-column:2;grid-row:1/3;align-self:end;white-space:normal;max-width:none}
#modal.bad-panel-v31 #endingGallery{grid-column:2;grid-row:3;align-self:start}
#badEndingStageV38{position:absolute;inset:0;z-index:9;overflow:hidden;background:#1d2523;pointer-events:none}
#badEndingStageV38>.ending-art{width:100%;height:100%;aspect-ratio:auto;margin:0;border-radius:0;background-size:400% 200%;background-repeat:no-repeat}
.bad-scene-v31 .scene-labels,.bad-scene-v31 .target-beacon,.bad-scene-v31 #interact{visibility:hidden!important}
@media(max-width:650px){#dialogueDock .speech{padding-top:4px}#modal.bad-panel-v31>section{padding:12px!important}#modal.bad-panel-v31 .bad-ending{grid-template-columns:minmax(0,1fr) 120px;gap:4px 10px}}

#badEndingStageV38>.ending-art{position:absolute;left:0;top:50%;width:100%;height:auto;aspect-ratio:1;transform:translateY(-50%)}
@media(max-width:650px){}
#modal.lotus-inline-v39{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;padding:0!important;background:transparent!important;backdrop-filter:none!important;z-index:35;display:block!important}#modal.lotus-inline-v39.hidden{display:none!important}#modal.lotus-inline-v39>section{width:100%!important;max-width:none!important;height:100%!important;max-height:none!important;margin:0!important;padding:0!important;background:transparent!important;border:0!important;overflow:hidden!important;box-shadow:none!important}#modal.lotus-inline-v39 #modalContent,#modal.lotus-inline-v39 .lotus-activity-v39{width:100%;height:100%;padding:0!important;position:relative}#modal.lotus-inline-v39 #closeModal{display:none}#lotusCanvasV19{touch-action:none;user-select:none;-webkit-user-select:none}#modal.lotus-inline-v39 #lotusCanvasV19{position:absolute;inset:0;width:100%;height:100%;max-width:none;border:0;border-radius:0;aspect-ratio:512/280;cursor:grab}#modal.lotus-inline-v39 #lotusCanvasV19:active{cursor:grabbing}#modal.lotus-inline-v39 .lotus-status-v19{position:absolute;top:55px;left:50%;transform:translateX(-50%);width:max-content;max-width:85%;background:#fff8e7e8;border-radius:14px;padding:5px 12px;font-size:14px;gap:14px;pointer-events:none}#modal.lotus-inline-v39 .lotus-status-v19 img{width:22px;height:22px}#boatGuideV39{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:min(520px,85%);padding:18px;background:#fff9eaf5;border:2px solid #c7b78f;border-radius:22px;text-align:center;color:#57432f}#boatGuideV39 h2{font-size:22px;margin:0 0 10px}#boatGuideV39 p{font-size:14px;line-height:1.8}#modal.lotus-inline-v39 #activityFeedback{position:absolute;bottom:16px;left:10%;right:10%;text-align:center;background:#fff8e7e8;border-radius:14px;color:#57432f;font-size:13px}#modal.lotus-inline-v39 #activityFeedback:empty{display:none}#modal.lotus-inline-v39 #finishActivity{position:absolute;bottom:12px;left:50%;transform:translateX(-50%);font-size:13px;white-space:nowrap}#modal.lotus-inline-v39:has(#finishActivity:not(.hidden)) #activityFeedback{bottom:65px}
#dreamVeilV39{position:absolute;inset:0;z-index:90;pointer-events:auto;display:flex;align-items:center;justify-content:center;text-align:center;background:#101d2b;color:#fff7dc;animation:dream-veil-v39 3.1s ease-in-out both}#dreamVeilV39.waking-up{background:#fff8e6;color:#59432f}#dreamVeilV39 p{max-width:75%;font-family:serif;font-size:clamp(18px,2.5vw,32px);line-height:1.8;animation:dream-caption-v39 3.1s ease both}#dreamVeilV39.falling-asleep:before,#dreamVeilV39.falling-asleep:after{content:'';position:absolute;left:0;right:0;height:50%;background:#07101a;animation:dream-eyes-v39 3.1s ease both}#dreamVeilV39.falling-asleep:before{top:0;transform-origin:top}#dreamVeilV39.falling-asleep:after{bottom:0;transform-origin:bottom}#dreamVeilV39 p{position:relative;z-index:2}@keyframes dream-veil-v39{0%{opacity:0}30%,65%{opacity:1}100%{opacity:0}}@keyframes dream-caption-v39{0%,15%{opacity:0}35%,75%{opacity:1}100%{opacity:0}}@keyframes dream-eyes-v39{0%{scale:1 0}32%,60%{scale:1 1}100%{scale:1 0}}@media(prefers-reduced-motion:reduce){#dreamVeilV39:before,#dreamVeilV39:after{animation:none!important}#dreamVeilV39{animation:dream-veil-v39 3.1s linear both}}
#dreamVeilV39.falling-asleep{animation:dream-sleep-v39 3.1s ease both;background:#101d2b}#dreamVeilV39 .sleep-scene-v39{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;animation:sleep-scene-v39 3.1s ease both}@keyframes dream-sleep-v39{0%,65%{opacity:1}100%{opacity:0}}@keyframes sleep-scene-v39{0%,12%{opacity:1}40%,100%{opacity:0}}

/* V50: one 200px dock; speaker, text and action use separate rows. */
#dialogueDock>#dialog:not(.hidden){align-items:stretch;grid-template-rows:minmax(0,1fr);padding:14px 24px;overflow:hidden}
#dialogueDock>#dialog>.speech{display:grid;grid-template-rows:26px minmax(0,1fr) 38px;gap:2px;height:100%;min-height:0;padding:0!important;align-self:stretch}
#dialogueDock #line{grid-row:2;scrollbar-width:thin}
#dialogueDock #nextLine{position:static!important;grid-row:3;justify-self:end;align-self:end;float:none;inset:auto;margin:0!important}
#dialogueDock #portrait{align-self:center!important}
@media(max-width:650px){#dialogueDock>#dialog:not(.hidden){padding:10px 12px}#dialogueDock>#dialog>.speech{grid-template-rows:22px minmax(0,1fr) 34px;gap:3px}}
/* Press inside the fixed action row; no layout shift or upward bounce. */
#dialogueDock #nextLine{transform-origin:center;transition:translate .08s ease,transform .08s ease,box-shadow .08s ease,filter .08s ease!important}
#dialogueDock #nextLine:is(:active,.continue-pressed-v43):not(:disabled){translate:0 2px!important;transform:scale(.985)!important;box-shadow:0 1px 0 var(--button-shadow,#91a773)!important;filter:brightness(.96)}
@media(prefers-reduced-motion:reduce){#dialogueDock #nextLine:is(:active,.continue-pressed-v43):not(:disabled){translate:0 1px!important;transform:none!important}}
/* V45: compact controls, no surrounding panel, intrinsic painted gauge ratio. */
#modal.willow-in-scene-v31 .willow-flight-board{container-type:inline-size}
#modal.willow-in-scene-v31 .willow-aim-controls{left:50%;right:auto;bottom:14px;transform:translateX(-50%);width:max-content;max-width:calc(100% - 24px);min-height:0;margin:0;padding:0;background:none;border:0;box-shadow:none;border-radius:0;display:grid;grid-template-columns:136px 240px 148px;gap:16px;align-items:end}
#modal.willow-in-scene-v31 .willow-angle-controls>span,#modal.willow-in-scene-v31 .willow-aim-controls label{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 5px;font-size:13px;line-height:18px;color:#493d2c;text-shadow:0 1px 2px #fff9eb,0 0 4px #fff9eb}
#modal.willow-in-scene-v31 .willow-aim-controls output{float:none;color:#493d2c!important;font-weight:750}
#modal.willow-in-scene-v31 .willow-angle-controls>div{display:grid;grid-template-columns:64px 64px;gap:8px}
#modal.willow-in-scene-v31 .willow-angle-controls button{width:64px!important;min-width:0!important;height:44px;min-height:44px;padding:6px 4px!important;font-size:12px;line-height:1.2;margin:0}
#modal.willow-in-scene-v31 #willowLaunch{width:148px!important;min-width:0!important;max-width:148px;height:44px;min-height:44px;padding:6px 10px!important;margin:0 0 2px;font-size:14px;line-height:1.2;white-space:normal;grid-column:auto}
#modal.willow-in-scene-v31 #willowPowerMeter{width:240px;max-width:100%;height:auto!important;min-height:0;aspect-ratio:1536/300;background-size:contain}
#modal.willow-in-scene-v31 #activityFeedback{bottom:100px;left:8%;right:8%;font-size:12px}
@container(max-width:600px){#modal.willow-in-scene-v31 .willow-aim-controls{grid-template-columns:116px 200px 124px;gap:10px;bottom:10px}#modal.willow-in-scene-v31 .willow-angle-controls>div{grid-template-columns:54px 54px}#modal.willow-in-scene-v31 .willow-angle-controls button{width:54px!important;font-size:11px}#modal.willow-in-scene-v31 #willowLaunch{width:124px!important;max-width:124px;font-size:12px}#modal.willow-in-scene-v31 #willowPowerMeter{width:200px}}
@container(max-width:490px){#modal.willow-in-scene-v31 .willow-aim-controls{grid-template-columns:116px 124px;gap:7px 18px;max-width:calc(100% - 16px)}#modal.willow-in-scene-v31 .willow-aim-controls>div:nth-child(2){grid-column:1/-1;grid-row:1;justify-self:center;width:220px}#modal.willow-in-scene-v31 #willowPowerMeter{width:220px}#modal.willow-in-scene-v31 .willow-angle-controls{grid-row:2}#modal.willow-in-scene-v31 #willowLaunch{grid-row:2}#modal.willow-in-scene-v31 #activityFeedback{bottom:153px}}
/* V48: four distinct direction colors and painted score glyphs. */
.rhythm-arrow-v48{width:32px;height:32px;object-fit:contain;vertical-align:middle;pointer-events:none}.rhythm-note{filter:none}.rhythm-note b{height:32px}.rhythm-pad button .rhythm-arrow-v48{width:38px;height:38px}.rhythm-target span{position:relative;z-index:2}.rhythm-target .rhythm-arrow-v48{opacity:.65}.rhythm-target .struck .rhythm-arrow-v48,.rhythm-target .hold-active .rhythm-arrow-v48{opacity:1}.rhythm-dashboard{gap:22px}.rhythm-dashboard span{color:#405832;font-weight:700;align-items:center;gap:4px}.rhythm-dashboard b,.rhythm-digits-v48{display:flex;justify-content:center;align-items:center;gap:0}.rhythm-dashboard b img{width:18px;height:25px;object-fit:contain}.rhythm-digits-v48 img{width:24px;height:32px;object-fit:contain}.rhythm-judgment{color:#fff4d9;text-shadow:0 2px 2px #263042,1px 0 #263042,-1px 0 #263042}.rhythm-controls{margin:8px 0}.rhythm-controls #rhythmStart{min-width:140px}#rhythmStatus{color:#60492f}.rhythm-line-label{color:#fff3d9}
.rhythm-target{background:none}.rhythm-target:after{height:24px;top:50%;transform:translateY(-50%);background:url('assets/rhythm-v48/line.7db990d1e037.webp') center/contain no-repeat;box-shadow:none;z-index:0}.rhythm-note.lane-0 .hold-tail{background:#69cee8aa}.rhythm-note.lane-1 .hold-tail{background:#f497bbaa}.rhythm-note.lane-2 .hold-tail{background:#afe57caa}.rhythm-note.lane-3 .hold-tail{background:#ffc56eaa}
/* V49: press feedback belongs to the arrow, never a rectangular lane overlay. */
.rhythm-target span.struck,.rhythm-target span.hold-active{background:transparent;box-shadow:none;filter:none}.rhythm-target span.struck .rhythm-arrow-v48,.rhythm-target span.hold-active .rhythm-arrow-v48{opacity:1;transform:translateY(2px) scale(.94);filter:brightness(1.2) drop-shadow(0 0 3px #fff8)}.rhythm-target .rhythm-arrow-v48{transition:transform .08s ease,filter .08s ease,opacity .08s ease}

.rhythm-target:after{height:12px;background-image:url('assets/rhythm-v48/line-v49.38e7898bae25.webp')}

/* V50: fixed dialogue baseline and compact rhythm start. */
#dialogueDock>#dialog>.speech{padding-top:32px!important}
@media(max-width:650px){#dialogueDock>#dialog>.speech{padding-top:22px!important}}
#modal.rhythm-popup-v31 .rhythm-controls #rhythmStart{flex:0 0 auto;width:132px;min-width:132px;max-width:132px;font-size:13px;padding:8px 18px!important;min-height:36px}
#modal.rhythm-popup-v31 #rhythmAudioState{display:none!important}

/* V52: the runner HUD has its own row below the persistent menu controls. */
.runner-mode #runnerStatus{top:68px!important;left:12px;right:12px;flex-wrap:wrap}
@media(max-width:650px){.runner-mode #runnerStatus{top:60px!important;left:8px;right:8px}.runner-mode #runnerStatus .runner-progress{min-width:80px}}

/* V53: reserve the right-side menu width within the original HUD row. */
.runner-mode #runnerStatus{top:12px!important;right:310px;left:12px;gap:8px!important;font-size:12px}
@media(max-width:650px){.runner-mode #runnerStatus{top:10px!important;right:208px;left:8px;padding:6px!important;gap:4px!important;display:grid;grid-template-columns:auto 1fr}.runner-mode #runnerStatus .runner-progress{min-width:32px;grid-column:1/-1}.runner-mode #runnerStatus .runner-distance{display:none}}
/* V54: identical closed/open picture dimensions and a compact centered start. */
#modal.difference-popup-v34 #differenceStart{display:block;width:132px!important;min-width:132px;max-width:132px;flex:none;margin:10px auto 0!important}#modal.difference-popup-v34 #differenceStart.hidden{display:none!important}
.identity-panel{perspective:1000px;background:none;overflow:visible}.identity-flip-v54{position:absolute;inset:0;transform-style:preserve-3d;transition:transform .7s cubic-bezier(.3,.1,.25,1)}.identity-front-v54,.identity-back-v54{position:absolute;inset:0;backface-visibility:hidden;border-radius:12px;overflow:hidden}.identity-front-v54{transform:rotateY(180deg)}.identity-back-v54{background:url('assets/identity-back-v54.b312f8690bbd.webp') center/cover no-repeat}.revealed-v54 .identity-flip-v54{transform:rotateY(180deg)}
@media(prefers-reduced-motion:reduce){.identity-flip-v54{transition-duration:.15s}}
/* V57: two centered groups, with no implicit stretched rows between title and copy. */
#modal.bad-panel-v31 .bad-ending{grid-template-columns:minmax(0,1fr) 240px;grid-template-rows:minmax(0,1fr);gap:24px;align-items:center;align-content:stretch;min-height:0}
#modal.bad-panel-v31 .bad-copy-v57{grid-column:1;grid-row:1;min-width:0;max-height:100%;overflow:auto;align-self:center;text-align:left;scrollbar-width:thin}
#modal.bad-panel-v31 .bad-copy-v57>small{display:block;color:#806449;font-size:10px;line-height:1.4;margin:0 0 7px}
#modal.bad-panel-v31 .bad-copy-v57>h2{font-size:20px;line-height:1.4;margin:0 0 8px;color:#59452e}
#modal.bad-panel-v31 .bad-copy-v57>p{font-size:13px;line-height:1.65;margin:0;max-width:none;color:#59452e}
#modal.bad-panel-v31 .bad-copy-v57>p+p{margin-top:5px}
#modal.bad-panel-v31 .bad-actions-v57{grid-column:2;grid-row:1;display:flex;flex-direction:column;justify-content:center;align-self:center;gap:10px}
#modal.bad-panel-v31 .bad-actions-v57 :is(#retryBranch,#endingGallery){width:100%;max-width:none;margin:0!important;min-height:42px;padding:8px 12px!important;font-size:12px;line-height:1.4;white-space:normal}
@media(max-width:650px){#modal.bad-panel-v31 .bad-ending{grid-template-columns:minmax(0,1fr) 120px;gap:12px}#modal.bad-panel-v31 .bad-copy-v57>h2{font-size:16px}#modal.bad-panel-v31 .bad-copy-v57>p{font-size:12px}#modal.bad-panel-v31 .bad-actions-v57 :is(#retryBranch,#endingGallery){font-size:10px;min-height:38px}}
.auto-descent-v59 :is(.target-beacon,.scene-labels,#sceneLabels,#prompt,#interact,#gateNotice){display:none!important}
/* V59: painted open scroll with live, readable chapter text. */
.immersive-game .chapter-label{width:258px;max-width:calc(100% - 320px);min-height:86px;padding:22px 28px 16px!important;background:transparent url('assets/chapter-scroll-v59.2ed5d1176bf1.webp') center/100% 100% no-repeat!important;border:0!important;border-radius:0!important;box-shadow:none!important}
.immersive-game .chapter-label>span{display:block;font-size:9px;line-height:13px;letter-spacing:1px;color:#675436}
.immersive-game .chapter-label strong{display:block;font-size:16px;line-height:23px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#59452d}
@media(max-width:650px){.immersive-game .chapter-label{width:192px;min-height:64px;max-width:calc(100% - 210px);padding:16px 22px 12px!important}.immersive-game .chapter-label>span{font-size:8px;line-height:11px;letter-spacing:0}.immersive-game .chapter-label strong{font-size:12px;line-height:18px}}
/* V60: tight-cropped bold sprite; visible top aligns with quick tools. */
.immersive-game .chapter-label{top:12px;left:12px;width:258px;height:82px;min-height:82px;padding:0 36px!important;display:flex;flex-direction:column;justify-content:center;gap:1px;background-image:url('assets/chapter-scroll-v60.0366965253cf.webp')!important}
.immersive-game .chapter-label>span{margin:0;line-height:13px;flex:none}.immersive-game .chapter-label strong{margin:0;line-height:23px;flex:none}
@media(max-width:650px){.immersive-game .chapter-label{top:10px;left:10px;width:192px;height:60px;min-height:60px;padding:0 26px!important}.immersive-game .chapter-label>span{line-height:11px}.immersive-game .chapter-label strong{line-height:18px}}
/* V61: airy illustrated paper in the outer margins, never over the game art. */
body.immersive-game{background:#faf3e5 url('assets/outer-paper-v61.0fd2e0d797fb.webp') center/cover fixed no-repeat}
.immersive-game .play{background:transparent}
/* V62: portrait guidance; desktop's fixed dialogue dimensions stay intact. */
#orientationGuideV62[hidden]{display:none!important}#orientationGuideV62{position:fixed;inset:0;z-index:10000;display:flex;align-items:center;justify-content:center;padding:24px;background:#faf3e5 url('assets/outer-paper-v61.0fd2e0d797fb.webp') center/cover;color:#59452e;text-align:center}#orientationGuideV62>section{max-width:420px}#orientationGuideV62 h2{font-size:24px;line-height:1.5}#orientationGuideV62 p{font-size:15px;line-height:1.8}#orientationGuideV62 #orientationHelpV62{font-size:12px;color:#756348}#landscapeStartV62{width:160px;margin:14px auto}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){.immersive-game .play{--mobile-dock-v62:clamp(110px,30dvh,160px);--game-stage-width:min(100vw,calc((100dvh - var(--mobile-dock-v62))*1.8285714));grid-template-rows:minmax(0,1fr) var(--mobile-dock-v62)}.immersive-game .viewport{width:var(--game-stage-width)!important}.immersive-game .touch{bottom:calc(var(--mobile-dock-v62) + 6px)}#dialogueDock>#dialog:not(.hidden){grid-template-columns:64px minmax(0,1fr);gap:10px;padding:7px 12px}#dialogueDock #portrait{width:64px;height:86px}#dialogueDock>#dialog>.speech{padding-top:0!important;grid-template-rows:18px minmax(0,1fr) 30px;gap:2px}#dialogueDock #speaker{font-size:13px}#dialogueDock #page{display:none}#dialogueDock #line{font-size:13px;line-height:1.5}#dialogueDock #nextLine{min-height:28px;min-width:110px!important;padding:4px 9px!important;font-size:11px}}
/* V63: unmistakable audio state, and centered scroll lettering. */
#quickToolsV28>button:is(#bgmToggleV28,#sound)[aria-pressed=true]{--button-face:#387b69;--button-edge:#235648;--button-shadow:#1f5346;background:#387b69!important;color:#fff9e9!important;border-color:#235648!important;box-shadow:0 4px 0 #1f5346!important}
#quickToolsV28>button:is(#bgmToggleV28,#sound)[aria-pressed=true] small{color:#fff9e9;font-weight:750}
#quickToolsV28>button:is(#bgmToggleV28,#sound)[aria-pressed=false]{background:#e4dfd3!important;color:#746a5b!important;border-color:#b6aa94!important;box-shadow:0 3px 0 #b7ab94!important}
.immersive-game .chapter-label{text-align:center;align-items:stretch}
.immersive-game .chapter-label>:is(span,strong){text-align:center;width:100%;min-width:0}
/* V64: permanent resting dialogue card, same bounds as the active dialogue. */
#dialogueDock>.dialogue-idle{position:absolute;inset:8px 0;height:auto;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:9px;padding:24px 36px;background:linear-gradient(115deg,#fff9eafc,#f4f0dbfa);border:2px solid #c7b78f;border-radius:22px;box-shadow:0 5px 0 #a9956b40,inset 0 1px 0 #fffdf5;color:#59452e;text-align:left}
#dialogueDock>.dialogue-idle strong{font-size:17px;line-height:1.5;color:#5b743b}#dialogueDock>.dialogue-idle p{font-size:15px;line-height:1.7;margin:0}
#dialogueDock:has(>#dialog:not(.hidden),>#exileOverlay:not(.hidden),>#modal.bad-panel-v31:not(.hidden))>.dialogue-idle{visibility:hidden}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){#dialogueDock>.dialogue-idle{padding:12px 22px;gap:3px}#dialogueDock>.dialogue-idle strong{font-size:14px}#dialogueDock>.dialogue-idle p{font-size:12px}}
/* Painted nine-slice overlay: no center fill and no change to canvas bounds. */
.immersive-game .viewport::after{content:'';position:absolute;inset:0;z-index:80;pointer-events:none;box-sizing:border-box;border:10px solid transparent;border-image:url('assets/rpg-frame-v64.44d17b5686e2.webp') 80 stretch}
/* V65: independent foreground frame, untouched by viewport clip-path. */
.immersive-game .viewport::after{display:none}
#stageFrameV65{position:fixed;z-index:200;pointer-events:none;box-sizing:border-box;border:28px solid transparent;border-image:url('assets/rpg-frame-v64.44d17b5686e2.webp') 80 stretch}
body:has(.stage-activity:not(.hidden)) #stageFrameV65{display:none}
#quickToolsV28{top:22px;right:22px}.immersive-game .chapter-label{top:22px;left:22px}
.runner-mode #runnerStatus{top:22px!important;left:22px;right:320px}
@media(max-width:650px){#stageFrameV65{border-width:22px}#quickToolsV28{top:18px;right:18px}.immersive-game .chapter-label{top:18px;left:18px}.runner-mode #runnerStatus{top:18px!important;left:18px;right:216px}}
/* V66: the frame is a native viewport foreground layer, never JS-dependent. */
#stageFrameV65{display:none!important}
.immersive-game .viewport{clip-path:none!important;overflow:visible!important}
.immersive-game .viewport>canvas{clip-path:inset(0 round 22px)}
.immersive-game .viewport>:is(#start,#chapterIntro,#chapterCurtain){border-radius:22px;overflow:hidden}
.immersive-game .viewport::after{display:block!important;content:'';position:absolute;inset:0;z-index:900;pointer-events:none;box-sizing:border-box;border:28px solid transparent;border-image-source:url('assets/rpg-frame-v64.44d17b5686e2.webp');border-image-slice:80;border-image-width:1;border-image-repeat:stretch}
@media(max-width:650px){.immersive-game .viewport::after{border-width:22px}.immersive-game .viewport>canvas{clip-path:inset(0 round 18px)}.immersive-game .viewport>:is(#start,#chapterIntro,#chapterCurtain){border-radius:18px}}
/* V67: overlap the cropped picture edge with the actual inner wooden rim. */
.immersive-game .viewport{background:transparent!important}
.immersive-game .viewport>canvas,.immersive-game .viewport>:is(#start,#chapterIntro,#chapterCurtain,#badEndingStageV38,#dreamVeilV39,#modal){clip-path:inset(12px round 14px)}
.immersive-game .viewport>#distantWorld{transform:none}
.immersive-game .viewport::after{border-width:40px;filter:saturate(.52) brightness(.93)}
@media(max-width:650px){.immersive-game .viewport>canvas,.immersive-game .viewport>:is(#start,#chapterIntro,#chapterCurtain,#badEndingStageV38,#dreamVeilV39,#modal){clip-path:inset(10px round 12px)}.immersive-game .viewport::after{border-width:32px}}
/* V68: keep both bottom chips clear of the thick rim and corner ornaments. */
.immersive-game .bottom-hud{bottom:30px;left:38px;right:38px}
@media(max-width:650px){.immersive-game .bottom-hud{bottom:25px;left:30px;right:30px}}
/* V69: readable keycaps in the control briefing and help text. */
.controls-intro kbd,.opening-keys-v189 kbd,#modalContent p .keycaps-v69 kbd,#modalContent .runner-brief kbd,#modalContent .roar-activity kbd{display:inline-flex;align-items:center;justify-content:center;min-width:29px;height:30px;margin:3px 2px;padding:2px 7px;border:1.5px solid #a99c7c;border-radius:7px;background:#fffdf2;color:#59452e;box-shadow:0 3px 0 #c4b695;font:bold 14px/1 system-ui;vertical-align:middle}
.controls-intro .space-key-v69,.opening-keys-v189 .space-key-v69{min-width:76px}.controls-intro p{line-height:2.4}.keycaps-v69{white-space:nowrap}
/* V70: art arrow follows the downward-right direction of the mountain steps. */
#descentCueV70{position:absolute;left:76%;top:71%;width:clamp(28px,4vw,56px);height:auto;transform:translate(-50%,-50%) rotate(35deg);pointer-events:none;z-index:5;animation:descent-cue-v70 1.4s ease-in-out infinite}
#descentCueV70[hidden]{display:none!important}@keyframes descent-cue-v70{0%,100%{opacity:.4}50%{opacity:1}}@media(prefers-reduced-motion:reduce){#descentCueV70{animation:none;opacity:1}}
/* V71: the inline menu sample matches the real default menu button. */
.controls-intro .menu-key-v71{display:inline-flex;align-items:center;justify-content:center;width:34px;height:32px;margin:0 4px 4px;vertical-align:middle;background:var(--button-face,#cfe4a6);color:var(--button-ink,#425d33);border:2px solid var(--button-edge,#91a773);border-radius:11px;box-shadow:0 3px 0 var(--button-shadow,#9cad79);font:20px/1 system-ui}
/* V72: chapter summaries break at sentence boundaries before natural wrapping. */
.chapter-intro #introSynopsis{white-space:pre-line;word-break:keep-all;overflow-wrap:normal;max-width:min(90%,780px);text-wrap:pretty}
/* V74: reserve the full synopsis column, rather than shrink-wrapping each line. */
.chapter-intro #introSynopsis{width:100%;max-width:960px;min-width:0;flex:none;white-space:pre-line;word-break:keep-all;overflow-wrap:normal;text-wrap:wrap}
/* V76: one frame-safe inset for all scene HUDs and willow controls. */
.immersive-game .viewport{--frame-safe-x:44px;--frame-safe-y:36px}
#quickToolsV28{top:var(--frame-safe-y);right:var(--frame-safe-x)}.immersive-game .chapter-label{top:var(--frame-safe-y);left:var(--frame-safe-x)}
.immersive-game .bottom-hud{bottom:var(--frame-safe-y);left:var(--frame-safe-x);right:var(--frame-safe-x)}
.runner-mode #runnerStatus{top:var(--frame-safe-y)!important;left:var(--frame-safe-x);right:calc(var(--frame-safe-x) + 300px)}
#modal.willow-in-scene-v31 .willow-game-hud{top:var(--frame-safe-y);right:var(--frame-safe-x)}
#modal.willow-in-scene-v31 #willowWind{top:var(--frame-safe-y);left:var(--frame-safe-x)}
#modal.willow-in-scene-v31 .willow-game-header{left:var(--frame-safe-x);top:calc(var(--frame-safe-y) + 48px)}
#modal.willow-in-scene-v31 .willow-aim-controls{bottom:var(--frame-safe-y);max-width:calc(100% - 2 * var(--frame-safe-x))}
#modal.willow-in-scene-v31 #activityFeedback{bottom:calc(var(--frame-safe-y) + 100px)}
#modal.willow-in-scene-v31 #finishActivity{bottom:var(--frame-safe-y)}
#modal.willow-in-scene-v31 .willow-aim-controls :is(label,.willow-angle-controls>span){min-height:28px;line-height:28px;gap:6px;margin-bottom:7px;text-shadow:none}
.willow-caption-v76{height:26px;width:auto;max-width:100%;object-fit:contain;display:block;filter:drop-shadow(0 1px 1px #fff9e9)}
.willow-digits-v76{display:inline-flex;align-items:center;justify-content:flex-end;gap:0;vertical-align:middle;white-space:nowrap;filter:drop-shadow(0 1px 1px #fff9e9)}
.willow-digits-v76 img{position:static!important;display:block;width:20px;height:28px;object-fit:contain;max-width:none}
.willow-digits-v76 img.degree{width:11px;height:13px;align-self:flex-start;margin-top:2px}.willow-digits-v76 img.percent{width:22px;height:28px;margin-left:2px}
@media(max-width:650px){.immersive-game .viewport{--frame-safe-x:32px;--frame-safe-y:28px}.runner-mode #runnerStatus{right:calc(var(--frame-safe-x) + 190px)}}

/* V78: 안내는 하단 대화창에서 제공한다. 장면 위 중복 안내 상자는 표시하지 않는다. */
#sceneToast,#gateNotice{display:none!important}

/* V79: 양끝 장식은 고정하고 제목 길이에 따라 종이 부분만 늘린다. */
.immersive-game .chapter-label{isolation:isolate;box-sizing:border-box;width:max-content;min-width:258px;max-width:calc(100% - 2 * var(--frame-safe-x) - 300px);height:auto;min-height:82px;padding:14px 40px!important;background:none!important}
.immersive-game .chapter-label::before{content:'';position:absolute;inset:0;z-index:-1;pointer-events:none;border-style:solid;border-color:transparent;border-width:0 40px;border-image-source:url('assets/chapter-scroll-v60.0366965253cf.webp');border-image-slice:0 120 fill;border-image-repeat:stretch}
.immersive-game .chapter-label strong{white-space:normal;overflow:visible;text-overflow:clip;word-break:keep-all;overflow-wrap:anywhere}
.immersive-game .chapter-label>span{white-space:nowrap}
@media(max-width:650px){.immersive-game .chapter-label{min-width:0;max-width:calc(100% - 2 * var(--frame-safe-x) - 190px);min-height:60px;padding:10px 30px!important}.immersive-game .chapter-label::before{border-left-width:30px;border-right-width:30px}.immersive-game .chapter-label>span{white-space:normal}}

/* V80: 악기 게임 팝업과 작은 악기 칩 */
#modal.echo-popup-v80{position:absolute!important;inset:0!important;z-index:40;padding:24px!important;display:grid!important;place-items:center;background:#14221924!important;backdrop-filter:none!important}
#modal.echo-popup-v80.hidden{display:none!important}
#modal.echo-popup-v80>section{width:min(620px,100%)!important;max-width:620px!important;height:auto!important;max-height:100%!important;overflow:hidden!important;padding:22px 24px!important;border-radius:22px!important;background:#fbf7e6fa!important;border:2px solid #c7b78f!important}
#modal.echo-popup-v80 #closeModal{display:none}
#modal.echo-popup-v80 h2{font-size:23px;margin:8px 0 12px}
#modal.echo-popup-v80 .activity>small,#modal.echo-popup-v80 .activity>p{color:#725d3e}
#modal.echo-popup-v80 .echo-pads{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:18px auto;max-width:500px}
#modal.echo-popup-v80 .echo-pads button{min-height:112px;padding:8px 6px!important}
#modal.echo-popup-v80 .instrument-picture{width:78px;height:64px;max-width:100%;margin:0 auto 4px}
#modal.echo-popup-v80 .echo-pads strong{font-size:14px;color:#354b2d}
#modal.echo-popup-v80 .echo-pads small{font-size:11px;margin-top:4px}
#modal.echo-popup-v80 #activityFeedback{color:#57432f}
@media(max-height:500px){#modal.echo-popup-v80{padding:20px!important}#modal.echo-popup-v80>section{padding:12px 18px!important}#modal.echo-popup-v80 h2{font-size:20px;margin:4px 0 8px}#modal.echo-popup-v80 .echo-pads{margin:10px auto}#modal.echo-popup-v80 .echo-pads button{min-height:94px}#modal.echo-popup-v80 .instrument-picture{height:48px}#modal.echo-popup-v80 .activity>p{margin:8px 0}}

.instrument-v81{object-fit:contain;filter:none!important}

/* V83: 악기 칩은 그림과 이름만 담은 정방형 */
#modal.echo-popup-v80 .echo-pads{max-width:430px}
#modal.echo-popup-v80 .echo-pads button{aspect-ratio:1;min-height:0;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:4px;padding:8px!important}
#modal.echo-popup-v80 .instrument-picture{width:70px;height:58px;margin:0}
@media(max-height:500px){#modal.echo-popup-v80 .echo-pads{max-width:382px}#modal.echo-popup-v80 .instrument-picture{height:48px}}

/* V84: 가락 듣기는 악기 아래의 분홍 버튼 */
#modal.echo-popup-v80 #echoListen{--button-face:#f2b8c7;--button-edge:#bb7f91;--button-shadow:#bc8395;--button-ink:#643b4c;--button-hover:#f7c8d4;display:block;width:160px;margin:30px auto 0}
#modal.echo-popup-v80 #echoListen:hover{background:#f7c8d4}
#modal.echo-popup-v80 #echoListen:active{box-shadow:0 1px 0 #bc8395;transform:translateY(3px)}

/* V85: 빈 피드백 행은 버튼 아래 공간을 차지하지 않는다. */
#modal.echo-popup-v80 .echo-game>#activityFeedback:empty{display:none}
#modal.echo-popup-v80 .echo-game{padding-bottom:0;min-height:0}

/* V86: 연주 중인 악기만 눌림과 밝기로 알려준다. */
#modal.echo-popup-v80 [data-echo].echo-playing-v86{background:#f5ccd8!important;border-color:#bb7f91!important;box-shadow:0 1px 0 #bc8395!important;translate:0 3px;transform:scale(.97);filter:brightness(1.06)!important}
#modal.echo-popup-v80 [data-echo].echo-playing-v86 .instrument-picture{transform:scale(1.08)}
@media(prefers-reduced-motion:reduce){#modal.echo-popup-v80 [data-echo].echo-playing-v86{translate:none;transform:none}#modal.echo-popup-v80 [data-echo].echo-playing-v86 .instrument-picture{transform:none}}

/* V87: 선택 가능한 내장 한글 서체 */
@font-face{font-family:DancingPeoples;src:url('assets/fonts/dancing-peoples-v87.7abb1bb015f5.woff2') format('woff2');font-display:swap}
@font-face{font-family:Boardmarker;src:url('assets/fonts/boardmarker-v87.01e1649a0664.ttf') format('truetype');font-display:swap;unicode-range:U+0-B17E,U+B180-C876,U+C878-10FFFF}
:root{--game-font-v87:DancingPeoples,system-ui,sans-serif}
body,body *{font-family:var(--game-font-v87)!important;font-variation-settings:"DANC" 50}
.font-options-v87{border:0;margin:20px 0 0;padding:16px 0 0;border-top:1px solid #c7b78f;display:flex;flex-wrap:wrap;gap:8px;justify-content:center}
.font-options-v87 legend{font-size:17px;color:#59452e}
.font-options-v87 button{min-width:140px}
html[data-font-v87="dance"] .chapter-intro:not(.hidden) h2{animation:font-dance-v87 1.2s ease-in-out 2}
@keyframes font-dance-v87{0%,100%{font-variation-settings:"DANC" 50}50%{font-variation-settings:"DANC" 72}}
@media(prefers-reduced-motion:reduce){html[data-font-v87="dance"] .chapter-intro h2{animation:none!important}}
/* V88: 글자별 제목 춤과 대화 가독성. 대화창/계속 버튼 크기는 유지한다. */
html[data-font-v87="dance"] .chapter-intro:not(.hidden) h2{animation:none}
.dance-word-v88{display:inline-block;white-space:nowrap}
.dance-letter-v88{display:inline-block}
html[data-font-v87="dance"] .chapter-intro:not(.hidden) .dance-letter-v88{animation:dance-letter-v88 var(--dance-time-v88) ease-in-out var(--dance-delay-v88) 2}
@keyframes dance-letter-v88{0%,100%{font-variation-settings:"DANC" 50}30%{font-variation-settings:"DANC" var(--dance-high-v88)}68%{font-variation-settings:"DANC" var(--dance-low-v88)}}
#dialogueDock #speaker,#dialogueDock .exile-text .speaker strong{font-size:20px}
#dialogueDock #line,#dialogueDock .exile-text .speech p{font-size:clamp(18px,1.6vw,22px)}
#dialogueDock>.dialogue-idle strong{font-size:20px}
#dialogueDock>.dialogue-idle p{font-size:18px}
#dialogueDock #page,#dialogueDock .speaker>span{display:none!important}
@media(max-width:650px){#dialogueDock #speaker,#dialogueDock .exile-text .speaker strong{font-size:18px}#dialogueDock #line,#dialogueDock .exile-text .speech p{font-size:18px}}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){#dialogueDock #speaker,#dialogueDock .exile-text .speaker strong{font-size:15px}#dialogueDock #line,#dialogueDock .exile-text .speech p{font-size:15px}#dialogueDock>.dialogue-idle strong{font-size:16px}#dialogueDock>.dialogue-idle p{font-size:14px}}
@media(prefers-reduced-motion:reduce){html[data-font-v87="dance"] .chapter-intro .dance-letter-v88{animation:none!important}}
/* V89: 답안은 장식 서체에 합성 볼드를 더하지 않는다. */
#modal .answers button{font-weight:400!important;font-synthesis:none;text-shadow:none!important}

/* V90: 작은 급제 결과 팝업과 도장 찍기 */
#modal:has(.exam-result){position:absolute!important;inset:0!important;display:grid!important;place-items:center;padding:20px!important;background:#14221938!important;backdrop-filter:none!important}
#modal:has(.exam-result)>section{width:min(470px,94%)!important;height:auto!important;max-height:96%!important;overflow:hidden!important;padding:18px 22px!important;border-radius:22px!important}
#modal:has(.exam-result) #modalContent{height:auto!important;padding:0!important}
#modal:has(.exam-result) .activity{width:100%;margin:0}
#modal:has(.exam-result) .activity>h2,#modal:has(.exam-result) .activity>.activity-kicker{display:none}
#modal .exam-result{position:relative;width:min(290px,47dvh);height:auto;max-height:none;aspect-ratio:4/5;margin:0 auto;padding:18% 12% 14%;gap:8px;animation:honour-unroll .55s ease-out}
#modal .exam-result h3{font-size:34px;margin:0;letter-spacing:.1em;color:#59452e}
#modal .exam-result .laureate-name{font-size:28px;margin:0;letter-spacing:.18em}
#modal .exam-stamp-v90{position:absolute;width:56px;height:56px;object-fit:contain;left:56%;top:62%;transform:rotate(-9deg);animation:seal-impact-v90 .32s cubic-bezier(.25,.7,.3,1) .65s both}
#modal:has(.exam-result) #activityFeedback{color:#59452e;font-weight:400;font-size:15px;margin:12px 0;min-height:0;line-height:1.6}
#modal:has(.exam-result) #finishActivity{margin:4px auto 0}
@keyframes seal-impact-v90{0%{opacity:0;transform:scale(2.8) rotate(-18deg)}64%{opacity:1;transform:scale(.88) rotate(-9deg)}82%{transform:scale(1.08) rotate(-9deg)}100%{opacity:1;transform:scale(1) rotate(-9deg)}}
@media(prefers-reduced-motion:reduce){#modal .exam-result,#modal .exam-stamp-v90{animation:none}}


/* V98: 기존 translateX(-50%) 잔류를 제거하고 실제 게임 영역에 맞춘다. */
#modal.exam-popup-v98{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-width:none!important;transform:none!important;translate:none!important;display:grid!important;place-items:center;align-items:center!important;justify-items:center!important;z-index:40}
#modal.exam-popup-v98.hidden{display:none!important}
#modal.exam-popup-v98>section{margin:0!important;transform:none!important;align-self:center;justify-self:center}
#modal.exam-popup-v98 .activity>small{display:none}
#modal .exam-result .laureate-name{position:relative}
#modal .exam-result .laureate-name .exam-stamp-v90{left:calc(50% + 12px);top:55%;width:48px;height:48px;z-index:1}
/* V99: 문제 해설도 원래 서체 굵기로 읽는다. */
#modal #examPaper #examHint,#modal #persuadeReply,#modal #reflectionReply,#modal .activity>#activityFeedback{font-weight:400!important;font-synthesis:none;text-shadow:none!important}
/* V100: 결과 내용이 DOM에 남아도 닫힌 모달은 표시하지 않는다. */
#modal.hidden{display:none!important}

/* V103: 손글씨 서체에는 합성 볼드/이탤릭을 입히지 않는다. */
html:is([data-font-v87="dance"],[data-font-v87="board"]) body,html:is([data-font-v87="dance"],[data-font-v87="board"]) body *{font-weight:400!important;font-synthesis:none}
#quickToolsV28>button:is(#bgmToggleV28,#sound){display:inline-flex;justify-content:center;align-items:center;gap:4px;min-width:82px;font-size:15px;padding:6px 8px!important}
#quickToolsV28>button:is(#bgmToggleV28,#sound) small{font-size:12px;margin:0;line-height:1.2}
#quickToolsV28>button:is(#bgmToggleV28,#sound)[aria-pressed=false]{color:#514739!important}
@media(max-width:650px){#quickToolsV28>button:is(#bgmToggleV28,#sound){display:flex;flex-direction:column;gap:2px;width:46px;min-width:46px;font-size:12px;padding:3px 2px!important}#quickToolsV28>button:is(#bgmToggleV28,#sound) small{font-size:11px}}
/* V104: 상호작용 대상은 발밑 표시로만 안내한다. */
#targetBeacon{display:none!important}

/* V105: 스토리를 가리지 않는 러너 시작 안내 */
#modal.runner-brief-popup-v105{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;transform:none!important;translate:none!important;padding:24px!important;display:grid!important;place-items:center;align-items:center!important;justify-items:center!important;background:#14221938!important;backdrop-filter:none!important;z-index:40}
#modal.runner-brief-popup-v105.hidden{display:none!important}
#modal.runner-brief-popup-v105>section{width:min(660px,100%)!important;max-width:660px!important;height:auto!important;max-height:100%!important;margin:0!important;padding:22px 26px!important;overflow:hidden!important;background:#fbf7e6fa!important;border:2px solid #c7b78f!important;border-radius:22px!important}
#modal.runner-brief-popup-v105 #modalContent{height:auto!important;padding:0!important}
#modal.runner-brief-popup-v105 #closeModal{display:none}
#modal.runner-brief-popup-v105 .runner-brief{width:100%;max-width:none;color:#59452e}
#modal.runner-brief-popup-v105 h2{font-size:25px;text-align:center;margin:6px 0 12px}
#modal.runner-brief-popup-v105 p{font-size:14px;line-height:1.65;margin:12px 0;color:#59452e}
#modal.runner-brief-popup-v105 .runner-how{grid-template-columns:1fr 1fr;gap:10px}
#modal.runner-brief-popup-v105 .runner-how p{padding:10px 12px;margin:0;background:#f8f2de;border-color:#c7b78f}
#modal.runner-brief-popup-v105 .runner-item-guide{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 10px;margin:16px 0}
#modal.runner-brief-popup-v105 .runner-item-guide>div{min-width:0;gap:5px;font-size:13px}
#modal.runner-brief-popup-v105 .runner-item-guide small{font-size:11px;color:#725d3e;line-height:1.4}
#modal.runner-brief-popup-v105 .runner-item-icon,#modal.runner-brief-popup-v105 .runner-item-guide img{width:36px;height:36px;object-fit:contain}
#modal.runner-brief-popup-v105 :is(#runnerStartV2,#runnerResume){display:block;width:max-content;max-width:100%;margin:18px auto 0}
@media(max-width:650px){#modal.runner-brief-popup-v105{padding:20px!important}#modal.runner-brief-popup-v105>section{padding:14px 16px!important}#modal.runner-brief-popup-v105 .runner-item-guide{grid-template-columns:repeat(2,minmax(0,1fr))}#modal.runner-brief-popup-v105 h2{font-size:22px}}
/* V106: 비교 시작 버튼 위아래 여백 균형 */
#modal.difference-popup-v34 #differenceStart{margin:2px auto 10px!important}

/* V107: 그림 앞뒤와 패널의 모서리를 동일한 12px로 맞춘다. */
#modal.difference-popup-v34 .identity-panel{border:0;border-radius:12px;box-shadow:inset 0 0 0 1px #c4a66c}
#modal.difference-popup-v34 .identity-flip-v54,#modal.difference-popup-v34 .identity-front-v54,#modal.difference-popup-v34 .identity-back-v54{border-radius:inherit}
.difference-digits-v107{display:inline-flex;align-items:center;justify-content:center;gap:2px;vertical-align:middle;white-space:nowrap}
.difference-digits-v107>img{width:22px;height:29px;object-fit:contain}
.difference-total-v107{font-size:20px;color:#725d3e;margin:0 5px}
#differenceTime .difference-digits-v107>img{width:21px;height:28px}
.difference-unit-v107{font-size:17px;color:#59452e;margin-left:2px}
/* V110: 계속 키캡은 선택 서체와 분리한 얇은 키보드 글꼴이다. */
#dialogueDock :is(#nextLine,#exileNext) kbd,.portrait-preview-dialog button kbd{font-family:Arial,system-ui,sans-serif!important;font-weight:400!important;font-synthesis:none;font-size:11px;line-height:1.15;display:inline-flex;align-items:center;justify-content:center;min-height:22px;padding:3px 7px;background:#f7f9eb;border:1px solid #aab68f;border-bottom:2px solid #9da981;border-radius:5px;box-shadow:0 3px 0 #aab68d,inset 0 1px 0 #fff;transform:translateY(-1px);letter-spacing:0}
#dialogueDock :is(#nextLine,#exileNext):active kbd,#dialogueDock #nextLine.continue-pressed-v43 kbd{box-shadow:0 1px 0 #aab68d,inset 0 1px 0 #fff;transform:translateY(1px)}
/* V111: 새 인물 알림은 내용에 맞춘 작은 카드로 표시한다. */
#modal:has(.encounter-card)>section{width:min(420px,94%)!important;max-width:420px!important;height:auto!important;padding:20px 24px!important}
#modal .encounter-card{padding:0;text-align:center}
#modal .encounter-card .encounter-portrait{width:170px;height:200px;margin:10px auto 0}
#modal .encounter-card h2{font-size:30px;margin:4px 0 6px;line-height:1.3}
#modal .encounter-card>strong{display:block;line-height:1.4}
#modal .encounter-card>p:not(.unlock-note){margin:10px auto 14px;line-height:1.65;font-size:16px}
#modal .encounter-card .unlock-note{margin:8px 0;font-size:13px}
#modal .encounter-card button{min-width:164px;margin:0 auto;padding:8px 16px}
@media(max-height:500px){#modal:has(.encounter-card)>section{padding:12px 18px!important}#modal .encounter-card .encounter-portrait{width:128px;height:140px;margin:4px auto 0}#modal .encounter-card h2{font-size:25px}}
/* V113: 배드엔딩 대화창은 설명 왼쪽/고정 폭 행동 오른쪽 한 행이다. */
#modal.bad-panel-v31{transform:none!important;translate:none!important;left:0!important;right:0!important;width:100%!important;display:block!important}
#modal.bad-panel-v31.hidden{display:none!important}
#modal.bad-panel-v31>section{display:block!important;overflow:hidden!important;padding:18px 26px!important}
#modal.bad-panel-v31 #modalContent{display:block!important;height:100%!important;overflow:hidden!important}
#modal.bad-panel-v31 .bad-ending.bad-layout-v113{display:grid!important;grid-template-columns:minmax(0,1fr) 220px!important;grid-template-rows:minmax(0,1fr)!important;gap:24px!important;align-items:center!important;padding:0!important;height:100%!important;min-height:0;overflow:hidden}
#modal.bad-panel-v31 .bad-layout-v113>.bad-copy-v57{display:block;grid-area:1/1;min-height:0;max-height:100%;overflow:auto;align-self:center;padding:0 6px 0 0;scrollbar-width:thin}
#modal.bad-panel-v31 .bad-layout-v113>.bad-actions-v57{display:flex!important;flex-direction:column!important;grid-area:1/2;align-self:center;justify-content:center;gap:10px;width:220px;min-width:0;padding:0}
#modal.bad-panel-v31 .bad-copy-v57>small{font-size:11px;margin:0 0 5px;line-height:1.35}
#modal.bad-panel-v31 .bad-copy-v57>h2{font-size:22px;line-height:1.35;margin:0 0 7px}
#modal.bad-panel-v31 .bad-copy-v57>p{font-size:16px;line-height:1.6;margin:0}
#modal.bad-panel-v31 .bad-actions-v57>button{flex:0 0 auto;width:100%!important;min-width:0;min-height:40px;margin:0!important;font-size:13px;grid-area:auto;align-self:stretch}
@media(max-width:650px){#modal.bad-panel-v31>section{padding:12px 16px!important}#modal.bad-panel-v31 .bad-ending.bad-layout-v113{grid-template-columns:minmax(0,1fr) 130px!important;gap:12px!important}#modal.bad-panel-v31 .bad-layout-v113>.bad-actions-v57{width:130px}#modal.bad-panel-v31 .bad-copy-v57>h2{font-size:18px}#modal.bad-panel-v31 .bad-copy-v57>p{font-size:14px}#modal.bad-panel-v31 .bad-actions-v57>button{font-size:11px;min-height:36px}}
/* V116: 키캡은 얇게, 확인 퀴즈 제목은 명시적인 줄 간격으로 표시한다. */
#dialogueDock :is(#nextLine,#exileNext) kbd,.portrait-preview-dialog button kbd{min-height:20px;padding:2px 6px;border:1px solid #b1ba9e;box-shadow:0 1px 0 #b9c3a5;transform:none;background:#f5f7eb}
#dialogueDock :is(#nextLine,#exileNext):active kbd,#dialogueDock #nextLine.continue-pressed-v43 kbd{box-shadow:none;transform:translateY(1px)}
#modalContent:has(>.answers)>h2{line-height:1.35;margin:14px 0 20px;white-space:normal;word-break:keep-all}

/* V118: 설명과 전장을 분리하되 스토리 프레임의 크기는 유지한다. */
#modal:is(.defense-guide-popup-v118,.defense-stage-v118){position:absolute!important;inset:0!important;translate:none!important;transform:none!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;box-sizing:border-box;display:grid!important;place-items:center;z-index:700}
#modal:is(.defense-guide-popup-v118,.defense-stage-v118).hidden{display:none!important}
#modal.defense-guide-popup-v118{background:#202b2555;padding:20px}
#modal.defense-guide-popup-v118>section{width:min(540px,100%);max-width:540px;max-height:100%;height:auto;padding:22px 26px;overflow:hidden}
.defense-guide-v118{text-align:center}.defense-guide-v118 h2{font-size:25px;line-height:1.35;margin:12px 0 18px}.defense-guide-v118 p{font-size:16px;line-height:1.65;margin:12px 0}.defense-guide-v118 button{margin:8px auto 0}
#modal.defense-stage-v118{background:transparent;padding:var(--frame-safe-y) var(--frame-safe-x)}
#modal.defense-stage-v118>section{width:100%;max-width:none;height:100%;max-height:none;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;overflow:visible}
#modal.defense-stage-v118 #modalContent{height:100%;padding:0;overflow:auto}
#modal.defense-stage-v118 .activity{display:flex;flex-direction:column;height:100%;min-height:0;padding:0;gap:6px}
#modal.defense-stage-v118 .activity>:is(.activity-kicker,h2,.defense-brief,small){display:none}
#modal.defense-stage-v118 #defenseStatus{flex:none;margin:0;padding:4px 8px;border-radius:14px;background:#f8f3dfed;font-size:11px}
#modal.defense-stage-v118 #defenseStatus b{font-size:15px}
#modal.defense-stage-v118 .defense-tools{flex:none;gap:8px;margin:0}
#modal.defense-stage-v118 .defense-tools button{min-height:42px;padding:3px 8px;font-size:13px}
#modal.defense-stage-v118 .defense-tools .defense-unit-art{width:35px;height:38px;flex-basis:35px}
#modal.defense-stage-v118 .defense-tools small{font-size:10px}
#modal.defense-stage-v118 .defense-field{flex:1 0 160px;width:100%;height:auto;min-height:160px;max-height:none;aspect-ratio:auto;margin:0;border-radius:14px}
#modal.defense-stage-v118 .defense-orders{flex:none;margin:0;gap:8px}
#modal.defense-stage-v118 .defense-orders button{min-height:34px;padding:5px 12px;font-size:13px}
#modal.defense-stage-v118 #activityFeedback:empty{display:none}
#modal.defense-stage-v118 #activityFeedback{flex:none;margin:0;padding:4px 8px;background:#faf4e5;color:#57432f;border-radius:10px;line-height:1.4;font-size:14px}
#modal.defense-stage-v118 #finishActivity:not(.hidden){flex:none;align-self:center;margin:0}
@media(max-height:600px){#modal.defense-stage-v118 .defense-tools small{display:none}#modal.defense-stage-v118 .defense-tools button{min-height:32px}#modal.defense-stage-v118 .defense-tools .defense-unit-art{height:28px;width:28px;flex-basis:28px}#modal.defense-stage-v118 #defenseStatus{font-size:10px}#modal.defense-stage-v118 #defenseStatus b{font-size:13px}#modal.defense-stage-v118 .defense-field{min-height:120px;flex-basis:120px}}

/* V119: 상태 정보는 전장 그림 안에 둔다. */
#modal.defense-stage-v118 .defense-money-v119{position:absolute;top:12px;right:16px;display:flex;align-items:center;gap:7px;z-index:12;pointer-events:none;filter:drop-shadow(0 1px 2px #fff8e5)}
.defense-coin-v119{width:40px;height:30px;object-fit:contain}
.defense-map-digits-v119{display:inline-flex;align-items:center;gap:2px}
.defense-map-digits-v119>img{width:23px;height:30px;object-fit:contain}
#modal.defense-stage-v118 .defense-castle{position:absolute;top:50%;right:2%;width:78px;background:none;border:0;padding:0;z-index:12;pointer-events:none}
.defense-base-track-v119{display:block;height:11px;background:#684a35;border:2px solid #f9e7b7;border-radius:8px;box-shadow:0 1px 3px #47332099;overflow:hidden}
.defense-base-track-v119>em{display:block;height:100%;background:linear-gradient(#cbdf8d,#81b65e);border-radius:5px;transition:width .2s}
#modal.defense-stage-v118 #defenseBanner{position:absolute;left:50%;top:47%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;gap:14px;width:min(70%,450px);height:auto;background:none;border:0;box-shadow:none;padding:0;z-index:20;pointer-events:none;opacity:0}
#defenseBanner .defense-deploy-v119{display:block;width:100%;height:auto}
#defenseBanner .defense-wave-v119{display:block;width:56%;height:auto}
#defenseBanner .defense-map-digits-v119>img{width:36px;height:48px}
.defense-wave-slash-v119{font:400 36px/1 system-ui;color:#ffdf95;text-shadow:2px 2px #6b3419;padding:0 3px}
#modal.defense-stage-v118 #defenseBanner.defense-turn-intro-v119{animation:defense-turn-v119 1.9s ease-out both}
.defense-intro-lock-v119 .defense-pad{pointer-events:none}
@keyframes defense-turn-v119{0%{opacity:0;scale:.9}12%,34%,58%,80%{opacity:1;scale:1}23%,46%{opacity:.4}100%{opacity:0;scale:1.04}}
@media(prefers-reduced-motion:reduce){#modal.defense-stage-v118 #defenseBanner.defense-turn-intro-v119{animation:none;opacity:1}}
@media(max-height:600px){#modal.defense-stage-v118 .defense-money-v119{top:6px;right:10px}.defense-coin-v119{width:30px;height:24px}.defense-map-digits-v119>img{width:18px;height:24px}#modal.defense-stage-v118 .defense-castle{width:60px}.defense-base-track-v119{height:8px}#defenseBanner .defense-map-digits-v119>img{width:26px;height:35px}.defense-wave-slash-v119{font-size:27px}}

/* V120: 그림 진입 표식, 장수, 처치 코인. */
#modal.defense-stage-v118 .defense-entry{top:7%;left:1%;width:76px;padding:0;border:0;background:none;z-index:10}
.defense-entry img{display:block;width:100%;height:auto}
#modal.defense-stage-v118 .defense-enemy.defense-boss-v120{width:9%;height:27%;z-index:6}
.defense-boss-v120>i{height:5px;background:#d87655;border:1px solid #f8dca6;max-width:none;width:100%;border-radius:3px}
#defenseLootV120{position:absolute;inset:0;z-index:15;pointer-events:none;overflow:hidden}
.defense-loot-v120{position:absolute;display:flex;align-items:center;gap:2px;transform:translate(-50%,-100%);animation:defense-coin-rise-v120 .85s ease-out both}
.loot-coin-v120{width:28px;height:24px;object-fit:contain}.defense-loot-v120 .defense-map-digits-v119>img{width:17px;height:23px}
@keyframes defense-coin-rise-v120{0%{opacity:0;translate:0 0}15%,60%{opacity:1}100%{opacity:0;translate:0 -35px}}
@media(prefers-reduced-motion:reduce){.defense-loot-v120{animation:none}}
@media(max-height:600px){#modal.defense-stage-v118 .defense-entry{width:56px}}

/* V121: 진지 클릭 영역은 유지하고 아군 그림만 약 22% 작게 표시한다. */
#modal.defense-stage-v118 .defense-pad .troop-v11>.defense-unit-art{width:78%;height:78%;left:11%;bottom:5px;transform-origin:center bottom}

/* V122: 부대 공통 강화는 전투 조작 줄에 두고 개별 강화는 없앤다. */
#modal.defense-stage-v118 .defense-orders{flex-wrap:nowrap}
#modal.defense-stage-v118 .defense-orders button{min-width:0;font-size:12px;line-height:1.35;padding:5px 7px}
#modal.defense-stage-v118 :is(#defenseSpeedV122,#defensePowerV122)[data-level="2"]{background:#efcf9f!important;border-color:#b78c52!important}
#modal.defense-stage-v118 :is(#defenseSpeedV122,#defensePowerV122)[data-level="3"]{background:#efb5aa!important;border-color:#ba7d6d!important}
@media(max-width:650px){#modal.defense-stage-v118 .defense-orders button{font-size:10px;padding:4px}}

/* V124: 짧은 문답과 행동 선택은 글 길이에 맞는 작은 팝업으로 표시한다. */
#modal:has(.answers):not(:has(#examPaper))>section{width:min(560px,100%)!important;max-width:560px!important;height:auto!important;min-height:0!important;max-height:100%!important;padding:22px 24px!important;overflow:hidden!important}
#modal:has(.answers):not(:has(#examPaper)) #modalContent{height:auto;min-height:0}
#modal:has(.answers):not(:has(#examPaper)) .answers{width:100%;max-width:512px;margin:18px auto;gap:10px}
#modal:has(.answers):not(:has(#examPaper)) .answers button{width:100%;min-width:0;white-space:normal;word-break:keep-all;overflow-wrap:break-word;padding:10px 14px;line-height:1.5}
#modal:has(.answers):not(:has(#examPaper)) .activity>#activityFeedback:empty{display:none}
@media(max-width:650px){#modal:has(.answers):not(:has(#examPaper))>section{padding:18px!important}}

/* V126: 반사곡 안내·경로 퍼즐 팝업 */
#modal.route-popup-v126{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;transform:none!important;translate:none!important;display:grid!important;place-items:center;padding:20px!important;background:#202b2555!important;z-index:700}
#modal.route-popup-v126.hidden{display:none!important}
#modal.route-popup-v126>section{width:min(600px,100%)!important;max-width:600px!important;height:auto!important;max-height:100%!important;padding:20px 24px!important;overflow:hidden!important;border-radius:22px!important}
#modal.route-popup-v126 #modalContent{height:auto;min-height:0;padding:0}
#modal.route-popup-v126 .activity{padding:0}
#modal.route-popup-v126 .activity>.activity-kicker{display:none}
#modal.route-popup-v126 h2{font-size:24px;line-height:1.35;margin:0 0 14px}
#modal.route-popup-v126 p{font-size:15px;line-height:1.6;margin:12px 0}
#modal.route-popup-v126 .water-crisis{border-radius:14px!important}
#modal.route-popup-v126 #activityFeedback:empty{display:none}
#modal.route-popup-v126 #routePuzzle .route-grid{width:min(340px,100%)!important;max-width:340px!important;margin:14px auto!important}
#modal.route-popup-v126 #routePuzzle>small{display:none}
#modal.route-popup-v126 #routeProgress{color:#57432f}
#modal.route-popup-v126 #finishActivity{margin:10px auto 0}
@media(max-height:500px){#modal.route-popup-v126{padding:18px!important}#modal.route-popup-v126>section{padding:14px 18px!important}#modal.route-popup-v126 h2{font-size:21px}#modal.route-popup-v126 .water-crisis{max-width:420px;margin:auto}#modal.route-popup-v126 p{font-size:13px;margin:8px 0}}

/* V127: 길 찾기 지도는 스토리 프레임에 맞춰 표시하고 캐릭터는 연속 이동한다. */
#modal.route-world-v127{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;translate:none!important;transform:none!important;padding:0!important;display:block!important;background:transparent!important;z-index:700}
#modal.route-world-v127.hidden{display:none!important}
#modal.route-world-v127>section{width:100%!important;max-width:none!important;height:100%!important;max-height:none!important;margin:0!important;padding:0!important;overflow:hidden!important;background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important}
#modal.route-world-v127 #modalContent,#modal.route-world-v127 .route-activity-v127,#routeStageV127{width:100%;height:100%;padding:0!important;position:relative}
#routeCanvasV127{position:absolute;inset:0;width:100%;height:100%;touch-action:none;image-rendering:auto;outline:none}
.route-top-v127{position:absolute;left:var(--frame-safe-x);top:var(--frame-safe-y);display:flex;gap:12px;align-items:center;pointer-events:none;background:#fff7e9ed;color:#57432f;border-radius:14px;padding:5px 10px;font-size:13px;max-width:calc(100% - 300px)}
#routeCountV127{display:flex;gap:8px;align-items:center;font-size:11px;white-space:nowrap}
.route-count-digits-v127{display:inline-flex;align-items:center;gap:1px}.route-count-digits-v127 img{width:16px;height:22px;object-fit:contain}.route-count-digits-v127>span{margin:0 3px;font-size:18px}
.route-bottom-v127{position:absolute;bottom:var(--frame-safe-y);left:var(--frame-safe-x);right:var(--frame-safe-x);display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:12px;color:#57432f;pointer-events:none}.route-bottom-v127>span{background:#fff7e9ed;padding:5px 10px;border-radius:10px}.route-bottom-v127 button{pointer-events:auto;min-height:32px;padding:5px 10px;font-size:12px}
#modal.route-world-v127 #activityFeedback{position:absolute;left:12%;right:12%;bottom:calc(var(--frame-safe-y) + 48px);margin:0;padding:7px 12px;border-radius:12px;background:#fff7e9ed;color:#57432f;font-size:14px;line-height:1.5}
#modal.route-world-v127 #activityFeedback:empty{display:none}
#modal.route-world-v127 #finishActivity{position:absolute;bottom:var(--frame-safe-y);left:50%;transform:translateX(-50%);margin:0;font-size:13px}
.viewport:has(.route-world-v127:not(.hidden)) .chapter-label{visibility:hidden}
@media(max-width:650px){.route-top-v127{font-size:11px;gap:6px;max-width:calc(100% - 180px);padding:4px 6px}.route-top-v127 #routeNameV127{display:none}.route-bottom-v127{font-size:10px}.route-bottom-v127 button{font-size:10px}.route-count-digits-v127 img{width:13px;height:18px}#modal.route-world-v127 #activityFeedback{font-size:12px}}
#modal.route-world-v127 .route-top-v127,#modal.route-world-v127 .route-bottom-v127{display:none}
.route-idle-actions-v127{display:flex;align-items:center;gap:12px;font-size:13px}.route-idle-actions-v127 button{min-height:30px;padding:4px 10px;font-size:12px}
#modal.route-world-v127 #activityFeedback{pointer-events:none}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){.route-idle-actions-v127{font-size:11px;gap:8px}.route-idle-actions-v127 button{min-height:26px;padding:3px 8px;font-size:10px}}

/* V128: 기존 경로 화면에서도 발자국의 기준과 잘림은 지도 자체다. */
#routePuzzle .route-grid{position:relative;overflow:hidden}
.route-footprints-v23{overflow:hidden}
.route-footprints-v23 img{transform:translate(-50%,-50%) rotate(var(--foot-angle)) scaleX(var(--foot-side,1))}

/* V129: 계속 버튼 위의 세로 영역을 비워 대사가 먼저 줄바꿈되게 한다. */
#dialogueDock>#dialog>.speech{grid-template-columns:minmax(0,1fr) max-content;column-gap:20px}
#dialogueDock #speaker,#dialogueDock #line{grid-column:1;min-width:0}
#dialogueDock #line{display:block;grid-row:2 / 4;align-self:stretch;width:100%;height:auto;white-space:pre-wrap;word-break:keep-all;overflow-wrap:break-word;line-height:1.45;overflow-x:hidden!important;overflow-y:auto!important}
#dialogueDock>#dialog>.speech>.speaker{grid-column:1;grid-row:1;min-width:0}
#dialogueDock #nextLine{grid-column:2;grid-row:3;position:relative!important;top:-8px}
@media(max-width:650px){#dialogueDock>#dialog>.speech{column-gap:12px}}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){#dialogueDock>#dialog>.speech{column-gap:8px}}
/* V130: 미니게임 공통 HUD·키캡·안전한 클리어 카드 */
.viewport:has(#runnerStatus,#modal:not(.hidden) .activity,#modal:not(.hidden) .runner-brief) #quickToolsV28{display:none!important}
.viewport #runnerStatus{right:var(--frame-safe-x)!important;left:var(--frame-safe-x)!important;width:auto!important}
.hud-digits-v130{display:inline-flex;align-items:center;gap:1px;vertical-align:middle}.hud-digits-v130 img{width:17px;height:23px;object-fit:contain}.hud-digits-v130>span{margin:0 2px}
#lotusTimeV19{display:flex;align-items:center;gap:3px}#runnerStatus .runner-score .hud-digits-v130 img{width:13px;height:18px}

.runner-health .full,#lotusHeartsV19 img[style*="opacity:1"]{animation:heart-pulse-v130 1.4s ease-in-out infinite}
@keyframes heart-pulse-v130{0%,40%,100%{scale:1}12%{scale:1.1}24%{scale:1}32%{scale:1.06}}
#modal.lotus-inline-v39 .boat-result-v130{position:absolute;left:50%;bottom:var(--frame-safe-y);transform:translateX(-50%);width:min(480px,calc(100% - 2 * var(--frame-safe-x)));padding:14px 18px;background:#fbf7e6f5;border:2px solid #c7b78f;border-radius:18px;text-align:center;z-index:20}
#modal.lotus-inline-v39 .boat-result-v130 #activityFeedback{position:static;inset:auto;margin:0 0 12px;padding:0;background:none;font-size:15px;line-height:1.6;color:#57432f}
#modal.lotus-inline-v39 .boat-result-v130 #finishActivity{position:static;inset:auto;transform:none;margin:0 auto;font-size:13px;white-space:normal}
#modal.lotus-inline-v39 .lotus-status-v19{top:var(--frame-safe-y);max-width:calc(100% - 2 * var(--frame-safe-x))}
@media(prefers-reduced-motion:reduce){.runner-health .full,#lotusHeartsV19 img{animation:none!important}}
#dreamVeilV39.dream-focus-v131{z-index:850;display:flex;flex-direction:column;gap:18px;padding:var(--frame-safe-y) var(--frame-safe-x);background:#e9e9e466;backdrop-filter:blur(5px);color:#443f3c;animation:focus-veil-v131 1.8s ease both}
#dreamVeilV39.dream-focus-v131:before,#dreamVeilV39.dream-focus-v131:after{display:none!important}
#dreamVeilV39.dream-focus-v131 p{font-size:clamp(18px,2vw,28px);line-height:1.8;max-width:78%;margin:0;padding:14px 22px;background:#fbf7e6db;border-radius:18px;animation:none;text-shadow:none}
#dreamVeilV39.dream-focus-v131 button{position:relative;z-index:3;font-size:14px}#dreamVeilV39.dream-focus-v131 kbd{font:400 11px Arial}
#dreamVeilV39.dream-focus-v131.dream-focus-leaving-v131{animation:focus-leave-v131 .9s ease both}
@keyframes focus-veil-v131{from{opacity:0;backdrop-filter:blur(0)}to{opacity:1;backdrop-filter:blur(5px)}}@keyframes focus-leave-v131{to{opacity:0;backdrop-filter:blur(0)}}
#dreamVeilV39.dream-focus-v131 .dream-snapshot-v131{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;animation:dream-snapshot-v131 1.8s ease both;z-index:0}
#dreamVeilV39.dream-focus-v131 p{position:relative;z-index:2}
@keyframes dream-snapshot-v131{0%,15%{opacity:1;filter:blur(0);transform:scale(1)}60%{opacity:.7;filter:blur(6px);transform:scale(1.04) skewX(.35deg)}100%{opacity:0;filter:blur(10px);transform:scale(1.06) skewX(-.35deg)}}
#lotusHeartsV19 .empty{animation:none!important}
@media(prefers-reduced-motion:reduce){#dreamVeilV39.dream-focus-v131 .dream-snapshot-v131{animation:none;opacity:0}}

/* Chapter quiz progression follows the dialogue action alignment. */
#modalContent:has(.answers)>#continue{display:block;width:max-content;max-width:100%;margin-left:auto;margin-right:0}

#targetBeacon.bridge-fairies-v135:not(.hidden){display:flex!important}

/* Willow result feedback stays readable over detailed scenery. */
#modal.willow-in-scene-v31 #activityFeedback{position:absolute;left:50%;right:auto;top:44%;bottom:auto;transform:translate(-50%,-50%);width:max-content;max-width:calc(100% - 2*var(--frame-safe-x));margin:0;padding:12px 20px;background:#fff8e9f5;border:1px solid #c5ae80;border-radius:14px;color:#57402b!important;font-size:clamp(18px,2vw,26px);line-height:1.55;text-align:center;z-index:12;pointer-events:none;text-shadow:none}
#modal.willow-in-scene-v31 #activityFeedback:empty{display:none}

.rhythm-guide-v31>#rhythmGuideContinueV31{display:block;width:max-content;max-width:100%;margin-left:auto;margin-right:0}

#modal.rhythm-popup-v31 #finishActivity{position:relative;top:-8px}

#examPaper>h3{text-align:center;word-break:keep-all;overflow-wrap:break-word;line-height:1.6;text-wrap:wrap}
#examPaper>h3>.exam-question-sentence{display:block}

#modal.roar-in-scene-v33 :is(#roarStart,#roarPress,#finishActivity){position:relative;top:-8px}
#modal.roar-in-scene-v33 .roar-status> b{display:inline-flex;align-items:center;gap:2px}
.roar-digits-v139{display:inline-flex;align-items:center;gap:0}.roar-digits-v139 img{width:17px;height:24px;object-fit:contain}

#modal.difference-popup-v34 #finishActivity{display:block;width:132px!important;min-width:132px;max-width:100%;margin:10px 0 14px auto;position:relative;top:-4px}

#persuadeBoard .answers button.persuade-muted-v141{background:#dedfd7!important;border-color:#b9bcb0!important;color:#777b70!important;box-shadow:0 3px 0 #b9bcb0!important;opacity:1;cursor:default}
#persuadeBoard .answers button.persuade-correct-v141{background:#b8d88b!important;border-color:#648344!important;color:#304b24!important;box-shadow:0 3px 0 #789453!important;opacity:1;cursor:default}

/* V142: controls never consume battlefield height. */
body.defense-docked-v142 #modal.defense-stage-v118{padding:12px!important}
body.defense-docked-v142 #modal.defense-stage-v118 #modalContent{overflow:hidden!important}
body.defense-docked-v142 #modal.defense-stage-v118 .defense-field{position:absolute;inset:0;width:100%;height:100%!important;min-height:0;aspect-ratio:auto;border:0;border-radius:0;box-shadow:none;flex:none}
body.defense-docked-v142 #dialogueDock>.dialogue-idle{display:none}
#defenseDockV142{position:absolute;inset:8px 16px;display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:44px 36px minmax(0,1fr);gap:7px 12px;padding:12px 20px;background:#fbf7e6;border:1px solid #bdad83;border-radius:20px;color:#57432f;overflow:hidden}
#defenseDockV142 .defense-tools{grid-column:1;grid-row:1;display:flex;gap:8px;margin:0}
#defenseDockV142 .defense-tools button{flex:0 1 150px;padding:3px 10px;font-size:15px;min-width:0;gap:5px;border-radius:12px}
#defenseDockV142 .defense-tools .defense-unit-art{width:30px;height:36px;flex:0 0 30px;margin:0}
#defenseDockV142 .defense-tools small{display:none}
#defenseDockV142 .defense-orders{display:contents}
#defenseDockV142 #defenseWave{grid-column:2;grid-row:1;margin:0;min-width:130px}
#defenseDockV142 #defenseReset{grid-column:2;grid-row:2;margin:0;font-size:13px;padding:4px 10px}
#defenseDockV142 :is(#defenseSpeedV122,#defensePowerV122){grid-row:2;width:max-content;font-size:13px;padding:4px 10px;margin:0;max-width:49%}
#defenseDockV142 #defenseSpeedV122{grid-column:1;justify-self:start}
#defenseDockV142 #defensePowerV122{grid-column:1;justify-self:end}
#defenseDockV142 .defense-detail-v142{grid-column:1;grid-row:3;margin:0;font-size:14px;line-height:1.45;align-self:center}
#defenseDockV142 #defenseUnitPanel{grid-column:2;grid-row:3;display:flex;gap:6px;padding:0;margin:0;border:0;background:none;align-self:center;min-height:0}
#defenseDockV142 #defenseUnitPanel strong{display:none}
#defenseDockV142 #defenseUnitPanel button{padding:3px 9px;font-size:13px;margin:0}
#defenseDockV142 #activityFeedback{position:absolute;bottom:8px;left:20px;right:20px;margin:0;padding:5px 10px;background:#fbf7e6;color:#57432f;font-size:14px;text-align:center;pointer-events:none;z-index:5}
#defenseDockV142 #activityFeedback:empty{display:none}
#defenseDockV142 #finishActivity:not(.hidden){grid-column:2;grid-row:1/3;margin:0;align-self:center}
body.defense-docked-v142 .defense-base-track-v119>em{margin:0;padding:0}
body.defense-docked-v142 .defense-range{border:3px solid #386e83;background:#61c6df26;box-shadow:0 0 0 2px #fff5ddaa}
body.defense-docked-v142 .defense-range.supply{border-color:#537a31;background:#a1cf6b30}
.defense-deploy-text-v142{color:#f3b65c;font-size:clamp(24px,4vw,50px);-webkit-text-stroke:1px #68401f;paint-order:stroke fill;text-shadow:0 2px 1px #fff6dc;background:none}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){#defenseDockV142{inset:4px 10px;padding:5px 10px;grid-template-rows:34px 30px minmax(0,1fr);gap:3px 8px}#defenseDockV142 .defense-tools button{font-size:13px;min-height:32px;padding:2px 5px}#defenseDockV142 .defense-tools .defense-unit-art{width:23px;height:28px;flex-basis:23px}#defenseDockV142 #defenseWave{min-width:105px;font-size:13px}#defenseDockV142 .defense-detail-v142{font-size:12px}#defenseDockV142 :is(#defenseSpeedV122,#defensePowerV122){font-size:11px}body.defense-docked-v142 #modal.defense-stage-v118{padding:10px!important}}

/* V143: dock aligns with viewport, no backing behind phase lettering. */
#defenseDockV142{left:0;right:0}
#modal.defense-stage-v118 #defenseBanner{background:transparent!important;border:0!important;box-shadow:none!important}
#defenseDockV142 #defenseMoneyV119{position:absolute;top:10px;right:20px;display:flex;align-items:center;gap:7px;z-index:6;pointer-events:none}
#defenseDockV142 .defense-tools{justify-content:flex-start;margin-right:110px}
#defenseDockV142 .defense-tools button{flex:0 1 150px}
#modal.defense-stage-v118 .defense-field>#defenseWave{position:absolute;left:50%;top:47%;transform:translate(-50%,-50%);z-index:22;width:clamp(160px,28%,340px);min-width:0;min-height:48px;padding:0;margin:0;background:none!important;border:0!important;box-shadow:none!important}
#modal.defense-stage-v118 .defense-field>#defenseWave img{display:block;width:100%;height:auto;filter:drop-shadow(0 3px 2px #fff4ce88)}
#modal.defense-stage-v118 .defense-field>#defenseWave:active:not(:disabled){transform:translate(-50%,-50%) scale(.96)}
#modal.defense-stage-v118 .defense-field>#defenseWave:disabled{opacity:.5}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){#defenseDockV142{left:0;right:0}#defenseDockV142 #defenseMoneyV119{top:6px;right:10px}#defenseDockV142 .defense-tools{margin-right:90px}#defenseDockV142 .defense-coin-v119{width:26px;height:25px}#defenseDockV142 .defense-map-digits-v119>img{width:18px;height:25px}}
/* Three troop portraits with adjacent readable descriptions. */
#defenseDockV142{grid-template-columns:minmax(0,1fr) auto;grid-template-rows:28px minmax(0,1fr) 30px;padding:8px 18px;gap:4px 10px}
#defenseDockV142 .defense-tools{grid-row:2;grid-column:1/-1;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:0;gap:12px}
#defenseDockV142 .defense-tools button{width:100%;min-width:0;max-width:none;display:flex;gap:10px;padding:4px 10px;border-radius:12px;text-align:left}
#defenseDockV142 .defense-tools .defense-unit-art{width:64px;height:78px;flex:0 0 64px;object-fit:contain}
#defenseDockV142 .defense-tools span{min-width:0;display:flex;flex-direction:column;gap:3px}
#defenseDockV142 .defense-tools b{font-size:16px}
#defenseDockV142 .defense-tools small{display:block;font-size:13px;line-height:1.4;white-space:normal;word-break:keep-all}
#defenseDockV142 .defense-detail-v142{display:none}
#defenseDockV142 :is(#defenseSpeedV122,#defensePowerV122){grid-row:3;grid-column:1;max-width:48%;font-size:12px}
#defenseDockV142 #defenseReset{grid-column:2;grid-row:3}
body.defense-docked-v142 #modal.defense-stage-v118 #defenseUnitPanel{position:absolute;z-index:24;transform:translateX(-50%);display:flex;gap:6px;align-items:center;width:max-content;max-width:90%;padding:7px 10px;margin:0;background:#fbf7e6f5;border:1px solid #b8a47d;border-radius:12px;box-shadow:0 2px 5px #59432e40}
body.defense-docked-v142 #modal.defense-stage-v118 #defenseUnitPanel[hidden]{display:none}
#modal.defense-stage-v118 #defenseUnitPanel strong{font-size:12px}
#modal.defense-stage-v118 #defenseUnitPanel button{font-size:14px;padding:6px 12px}
body.defense-docked-v142 .defense-pad{transform:translate(-50%,-100%)}
#modal.defense-stage-v118 .defense-pad .troop-v11>.defense-unit-art{bottom:0}
body.defense-docked-v142 .defense-pad .empty-pad{position:absolute;left:50%;bottom:0;transform:translate(-50%,50%)}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){#defenseDockV142{grid-template-rows:21px minmax(0,1fr) 27px;padding:3px 8px;gap:2px 6px}#defenseDockV142 .defense-tools{margin:0;gap:5px}#defenseDockV142 .defense-tools button{padding:2px 4px;gap:5px}#defenseDockV142 .defense-tools .defense-unit-art{width:38px;height:50px;flex-basis:38px}#defenseDockV142 .defense-tools b{font-size:13px}#defenseDockV142 .defense-tools small{font-size:11px;line-height:1.25}#defenseDockV142 .defense-tools span{gap:1px}#defenseDockV142 :is(#defenseSpeedV122,#defensePowerV122){font-size:11px;padding:2px 5px}}
/* Compact portrait buttons; text is not part of the button. */
#defenseDockV142{grid-template-columns:minmax(0,1fr) minmax(180px,23%);grid-template-rows:34px minmax(0,1fr);gap:4px 16px;padding:8px 18px}
#defenseDockV142 .defense-tools{grid-column:1;grid-row:1/3;align-self:center;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
#defenseDockV142 .defense-choice-v146{display:flex;align-items:center;gap:10px;min-width:0}
#defenseDockV142 .defense-choice-v146>button{flex:0 0 74px;width:74px;height:94px;min-height:0;padding:4px;justify-content:center;gap:0}
#defenseDockV142 .defense-choice-v146>button .defense-unit-art{flex:0 0 62px;width:62px;height:82px;margin:0}
#defenseDockV142 .defense-copy-v146{display:flex;flex-direction:column;gap:5px;min-width:0;color:#57432f}
#defenseDockV142 .defense-copy-v146 b{font-size:18px;line-height:1.4}
#defenseDockV142 .defense-copy-v146 small{display:block;font-size:15px;line-height:1.4;word-break:keep-all}
#defenseDockV142 .defense-orders{grid-column:2;grid-row:2;display:flex;flex-direction:column;justify-content:center;align-items:stretch;gap:6px;min-width:0}
#defenseDockV142 :is(#defenseSpeedV122,#defensePowerV122,#defenseReset){width:100%;max-width:none;min-height:30px;font-size:13px;margin:0;padding:4px 8px}
#defenseDockV142 #defenseMoneyV119{top:7px;right:20px;gap:6px}
#defenseDockV142 .defense-coin-v119{width:48px;height:36px}
#defenseDockV142 .defense-map-digits-v119>img{width:30px;height:38px}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){#defenseDockV142{grid-template-columns:minmax(0,1fr) minmax(135px,24%);grid-template-rows:26px minmax(0,1fr);gap:2px 8px;padding:3px 8px}#defenseDockV142 .defense-tools{grid-column:1;grid-row:1/3;gap:5px}#defenseDockV142 .defense-choice-v146{gap:5px}#defenseDockV142 .defense-choice-v146>button{flex-basis:44px;width:44px;height:62px;padding:2px}#defenseDockV142 .defense-choice-v146>button .defense-unit-art{flex-basis:38px;width:38px;height:54px}#defenseDockV142 .defense-copy-v146{gap:2px}#defenseDockV142 .defense-copy-v146 b{font-size:13px}#defenseDockV142 .defense-copy-v146 small{font-size:11px;line-height:1.3}#defenseDockV142 .defense-orders{gap:3px}#defenseDockV142 :is(#defenseSpeedV122,#defensePowerV122,#defenseReset){min-height:22px;font-size:11px;padding:2px 5px}#defenseDockV142 .defense-coin-v119{width:32px;height:27px}#defenseDockV142 .defense-map-digits-v119>img{width:22px;height:28px}}
/* Larger portraits and icon-led research controls. */
#defenseDockV142 .defense-choice-v146>button{width:88px;height:112px;flex-basis:88px}
#defenseDockV142 .defense-choice-v146>button .defense-unit-art{width:76px;height:100px;flex-basis:76px}
#defenseDockV142 .defense-copy-v146 b{font-size:21px}
#defenseDockV142 .defense-copy-v146 small{font-size:17px;line-height:1.45}
#defenseDockV142 .defense-orders{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;gap:10px}
#defenseDockV142 :is(#defenseSpeedV122,#defensePowerV122,#defenseReset){flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;min-width:0;max-width:120px;height:100px;min-height:0;padding:6px}
.research-name-v147{font-size:16px}.research-arrow-v147{width:80px;height:36px;object-fit:contain}.research-speed-v147{display:flex;align-items:center;justify-content:center;gap:1px;height:36px;font-size:22px}.research-speed-v147 img{width:22px;height:30px;object-fit:contain}.research-cost-v147{display:flex;align-items:center;justify-content:center;gap:2px;font-size:14px}.research-cost-v147 img{width:17px;height:23px;object-fit:contain}.research-cost-v147 img:first-child{width:24px}
#defenseDockV142 #defenseReset>img{width:42px;height:42px;object-fit:contain}#defenseDockV142 #defenseReset>span{font-size:13px}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){#defenseDockV142 .defense-choice-v146>button{width:50px;height:70px;flex-basis:50px}#defenseDockV142 .defense-choice-v146>button .defense-unit-art{width:44px;height:62px;flex-basis:44px}#defenseDockV142 .defense-copy-v146 b{font-size:14px}#defenseDockV142 .defense-copy-v146 small{font-size:12px}#defenseDockV142 .defense-orders{gap:4px}#defenseDockV142 :is(#defenseSpeedV122,#defensePowerV122,#defenseReset){height:70px;padding:2px;gap:1px}.research-name-v147{font-size:11px}.research-arrow-v147{width:40px;height:25px}.research-speed-v147{height:25px;font-size:15px}.research-speed-v147 img{width:13px;height:21px}.research-cost-v147 img{width:12px;height:17px}.research-cost-v147 img:first-child{width:17px}#defenseDockV142 #defenseReset>img{width:28px;height:28px}#defenseDockV142 #defenseReset>span{font-size:10px}}

/* V148: field information is visual, commands have no surrounding panel. */
body.defense-docked-v142 .unit-tag{display:none!important}
body.defense-docked-v142 .unit-health{height:10px;bottom:-5px;left:10%;width:80%;border:2px solid #fff4d7;border-radius:6px;background:#714634;overflow:hidden;box-shadow:0 1px 2px #49342180}
body.defense-docked-v142 .unit-health i{background:linear-gradient(#c4e99a,#75b25b);border-radius:3px}
.unit-ammo-v148{position:absolute;top:calc(100% + 9px);left:50%;transform:translateX(-50%);display:flex;align-items:center;justify-content:center;gap:4px;pointer-events:none;filter:drop-shadow(0 1px 1px #fff4d8)}
.unit-ammo-v148>img{position:static!important;width:18px;height:25px;object-fit:contain}
.unit-ammo-v148>.ammo-arrow-v148{width:40px;height:20px}
body.defense-docked-v142 #modal.defense-stage-v118 #defenseUnitPanel{padding:0;background:transparent;border:0;box-shadow:none;gap:8px}
body.defense-docked-v142 #modal.defense-stage-v118 #defenseUnitPanel strong{display:none}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){body.defense-docked-v142 .unit-health{height:8px}.unit-ammo-v148>img{width:14px;height:21px}.unit-ammo-v148>.ammo-arrow-v148{width:30px;height:16px}}
#defenseGuideFieldV149{position:absolute;inset:12px;width:calc(100% - 24px);height:calc(100% - 24px);object-fit:fill;z-index:26;pointer-events:none;border-radius:10px}
body.defense-guide-field-v149 .viewport :is(#quickToolsV28,.chapter-label,.bottom-hud,#sceneLabels,#targetBeacon,#prompt){visibility:hidden!important}
body.defense-guide-field-v149 #modal.defense-guide-popup-v118{z-index:35!important}
@media(max-width:650px){#defenseGuideFieldV149{inset:10px;width:calc(100% - 20px);height:calc(100% - 20px)}}
/* Same square dimensions and shared vertical alignment for the five controls. */
#defenseDockV142{--defense-control-size:96px;grid-template-columns:minmax(0,1fr) calc(var(--defense-control-size)*2 + 8px);column-gap:12px}
#defenseDockV142 .defense-tools{gap:6px}
#defenseDockV142 .defense-choice-v146{gap:8px}
#defenseDockV142 .defense-choice-v146>button{width:var(--defense-control-size);height:var(--defense-control-size);flex:0 0 var(--defense-control-size);padding:4px}
#defenseDockV142 .defense-choice-v146>button .defense-unit-art{width:82px;height:86px;flex:0 0 82px}
#defenseDockV142 .defense-orders{grid-row:1/3;align-self:center;gap:8px}
#defenseDockV142 :is(#defenseSpeedV122,#defensePowerV122){width:var(--defense-control-size);height:var(--defense-control-size);min-width:var(--defense-control-size);max-width:var(--defense-control-size);flex:0 0 var(--defense-control-size)}
body.defense-docked-v142 #modal.defense-stage-v118 .defense-field>#defenseReset{position:absolute;right:var(--frame-safe-x);bottom:var(--frame-safe-y);z-index:25;width:64px;height:64px;min-width:0;min-height:0;padding:5px;margin:0;display:flex;align-items:center;justify-content:center;border-radius:14px}
body.defense-docked-v142 #modal.defense-stage-v118 .defense-field>#defenseReset>img{width:48px;height:48px;object-fit:contain}
body.defense-docked-v142 #modal.defense-stage-v118 .defense-field>#defenseReset>span{display:none}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){#defenseDockV142{--defense-control-size:64px;grid-template-columns:minmax(0,1fr) calc(var(--defense-control-size)*2 + 5px);column-gap:7px}#defenseDockV142 .defense-tools{gap:4px}#defenseDockV142 .defense-choice-v146{gap:5px}#defenseDockV142 .defense-choice-v146>button .defense-unit-art{width:52px;height:56px;flex-basis:52px}#defenseDockV142 .defense-orders{gap:5px}body.defense-docked-v142 #modal.defense-stage-v118 .defense-field>#defenseReset{width:44px;height:44px;padding:3px}body.defense-docked-v142 #modal.defense-stage-v118 .defense-field>#defenseReset>img{width:34px;height:34px}}

/* V151: center the whole troop and empty-pad cross in the painted clearing. */
body.defense-docked-v142 .defense-pad{transform:translate(-50%,-50%)}
#modal.defense-stage-v118 .defense-pad .troop-v11>.defense-unit-art{bottom:11%;object-position:center center}
body.defense-docked-v142 .defense-pad .empty-pad{left:50%;top:50%;bottom:auto;transform:translate(-50%,-50%);line-height:1}
body.defense-docked-v142 #modal.defense-stage-v118 #defenseUnitPanel{transform:none;gap:5px;align-items:center}
body.defense-docked-v142 #modal.defense-stage-v118 #defenseUnitPanel button{height:30px;min-height:30px;padding:3px 10px;font-size:13px;line-height:1.3;border-radius:9px;white-space:nowrap}
body.defense-docked-v142 #modal.defense-stage-v118 #defcmd-repair:not(:disabled){background:#337b72!important;color:#fff9e9!important;border-color:#225b54!important;box-shadow:0 2px 0 #225b54!important}
body.defense-docked-v142 #modal.defense-stage-v118 #defcmd-sell:not(:disabled){background:#edbe80!important;color:#593a22!important;border-color:#ac7d47!important;box-shadow:0 2px 0 #ac7d47!important}
#defenseDockV142{grid-template-columns:minmax(0,1fr);column-gap:0}
#defenseDockV142 .defense-tools{grid-column:1;grid-template-columns:minmax(0,1.65fr) minmax(0,1fr) minmax(0,1fr);gap:18px;padding-right:0}
#defenseDockV142 .defense-choice-v146{gap:9px}
#defenseDockV142 .defense-choice-v146>.defense-orders{display:flex;flex-direction:row;gap:7px;flex:0 0 auto;margin:0 0 0 8px;align-self:center}
#defenseDockV142 .defense-choice-v146>.defense-copy-v146{flex:0 1 auto}
body.defense-docked-v142 #modal.defense-stage-v118 .defense-field>#defenseReset{width:86px;height:78px;flex-direction:column;gap:1px;padding:4px}
body.defense-docked-v142 #modal.defense-stage-v118 .defense-field>#defenseReset>img{width:43px;height:43px}
body.defense-docked-v142 #modal.defense-stage-v118 .defense-field>#defenseReset>span{display:block;font-size:13px;line-height:1.3;white-space:nowrap}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){#defenseDockV142{grid-template-columns:minmax(0,1fr)}#defenseDockV142 .defense-tools{grid-template-columns:minmax(0,1.7fr) minmax(0,1fr) minmax(0,1fr);gap:7px}#defenseDockV142 .defense-choice-v146{gap:4px}#defenseDockV142 .defense-choice-v146>.defense-orders{gap:4px;margin-left:3px}body.defense-docked-v142 #modal.defense-stage-v118 .defense-field>#defenseReset{width:62px;height:59px}body.defense-docked-v142 #modal.defense-stage-v118 .defense-field>#defenseReset>img{width:31px;height:31px}body.defense-docked-v142 #modal.defense-stage-v118 .defense-field>#defenseReset>span{font-size:11px}}
/* V153: troop-label layout must not stack the research icon's digits. */
#defenseDockV142 .defense-tools button :is(.research-speed-v147,.research-cost-v147){display:flex;flex-direction:row;align-items:center;justify-content:center;flex-wrap:nowrap;flex-shrink:0;gap:2px;min-width:0;white-space:nowrap}
#defenseDockV142 .defense-tools button .research-speed-v147>span{display:inline;flex:none;font-size:22px;line-height:1}
#defenseDockV142 .defense-tools button .research-name-v147{display:block;flex:none;font-size:16px;line-height:1.2;white-space:nowrap}
#defenseDockV142 .defense-tools button .research-speed-v147>img{flex:0 0 22px;width:22px;height:30px;object-fit:contain}
#defenseDockV142 .defense-tools button .research-cost-v147>img{flex:0 0 17px;width:17px;height:23px;object-fit:contain}
#defenseDockV142 .defense-tools button .research-cost-v147>img:first-child{flex-basis:24px;width:24px}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){#defenseDockV142 .defense-tools button .research-name-v147{font-size:11px}#defenseDockV142 .defense-tools button .research-speed-v147>span{font-size:15px}#defenseDockV142 .defense-tools button .research-speed-v147>img{flex-basis:13px;width:13px;height:21px}#defenseDockV142 .defense-tools button .research-cost-v147>img{flex-basis:12px;width:12px;height:17px}#defenseDockV142 .defense-tools button .research-cost-v147>img:first-child{flex-basis:17px;width:17px}}
/* V154: health, ammunition and commands form a compact vertical group. */
body.defense-docked-v142 .unit-health{bottom:8%;height:10px}
body.defense-docked-v142 .unit-ammo-v148{top:calc(92% + 3px);gap:3px}
body.defense-docked-v142 #modal.defense-stage-v118 #defenseUnitPanel{transform:translateX(-50%);gap:7px}
body.defense-docked-v142 #modal.defense-stage-v118 #defcmd-repair:not(:disabled){background:#2564a0!important;color:#fff!important;border-color:#123e6b!important;box-shadow:0 2px 0 #123e6b!important}
body.defense-docked-v142 #modal.defense-stage-v118 #defcmd-sell:not(:disabled){background:#9b4265!important;color:#fff!important;border-color:#65263f!important;box-shadow:0 2px 0 #65263f!important}
body.defense-docked-v142 #modal.defense-stage-v118 #defenseUnitPanel button{font-size:14px;font-weight:400;padding:3px 11px}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){body.defense-docked-v142 .unit-health{height:8px}body.defense-docked-v142 .unit-ammo-v148{top:calc(92% + 2px)}}

/* V156: final defense result stays at the center of the story field. */
#defenseResultV156{position:absolute;z-index:70;left:50%;top:50%;transform:translate(-50%,-50%);width:min(520px,82%);box-sizing:border-box;padding:28px 30px;text-align:center;background:#fbf7e6;border:2px solid #bca779;border-radius:24px;box-shadow:0 7px 0 #675b3e55;color:#57432f}
#defenseResultV156 h2{margin:0 0 16px;font-size:28px}
#defenseResultV156 p{margin:10px 0;line-height:1.65;color:#57432f}
#defenseResultV156 #activityFeedback{display:block!important;position:static!important;background:none!important;margin:14px 0!important}
#defenseResultV156 #finishActivity{display:inline-block;position:static!important;width:auto;max-width:100%;margin:14px auto 0;padding:12px 22px}
@media(max-height:600px){#defenseResultV156{padding:16px 22px}#defenseResultV156 h2{font-size:23px;margin-bottom:8px}#defenseResultV156 p{margin:5px 0}#defenseResultV156 #finishActivity{margin-top:8px}}

/* V158: routine defense notices do not cover the command dock. */
#defenseDockV142 #activityFeedback{display:none!important}

/* V160: keep information legible without changing the story/dialogue bounds. */
.defense-field .defense-enemy>i{top:calc(100% + 2px);left:0;height:7px;max-width:none;border-radius:5px;box-shadow:0 0 0 2px #fff3d9;background:#a8ce7c}
#dialogueDock #line,#dialogueDock .exile-text .speech p{font-size:clamp(21px,1.8vw,24px);line-height:1.6}
#dialogueDock>.dialogue-idle strong{font-size:22px}#dialogueDock>.dialogue-idle p{font-size:20px}
#dialogueDock>.dialogue-idle:has(.route-idle-actions-v127){display:grid;grid-template-columns:minmax(0,1fr) minmax(250px,30%);grid-template-rows:auto auto;align-content:center;align-items:center;column-gap:24px;row-gap:8px}
#dialogueDock .dialogue-idle:has(.route-idle-actions-v127)>strong{grid-column:1;grid-row:1}
#dialogueDock .dialogue-idle:has(.route-idle-actions-v127)>p{grid-column:1;grid-row:2;word-break:keep-all}
#dialogueDock .route-idle-actions-v127{grid-column:2;grid-row:1/3;display:flex;flex-wrap:wrap;justify-content:center;gap:8px 14px;font-size:20px}
#dialogueDock .route-idle-actions-v127 .route-count-digits-v127 img{width:24px;height:32px}
#dialogueDock .route-idle-actions-v127 button{font-size:18px;min-height:42px;padding:6px 18px}
#modal.route-world-v127 #activityFeedback{font-size:clamp(18px,1.6vw,23px);left:8%;right:8%;padding:12px 18px;line-height:1.65}
.activity-result-v160{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:50;width:min(570px,84%);max-height:84%;overflow:auto;padding:28px;text-align:center;background:#fbf7e6;border:2px solid #bca779;border-radius:24px;box-shadow:0 7px 0 #675b3e55;color:#57432f}
.activity-result-v160 h2{font-size:27px;margin:0 0 14px}.activity-result-v160>p{font-size:20px;line-height:1.65}
#modal.route-world-v127 .activity-result-v160 #activityFeedback{position:static;display:block;margin:14px 0;padding:0;background:none;font-size:20px}
#modal.route-world-v127 .activity-result-v160 #finishActivity{position:static;transform:none;width:auto;margin:14px auto 0;padding:10px 24px;font-size:19px}
#boatGuideV39{width:min(620px,86%);max-height:84%;overflow:auto;padding:24px}
#boatGuideV39 h2{font-size:27px}#boatGuideV39 p{font-size:21px;line-height:1.75}#boatGuideV39 button{font-size:20px}
#modal.lotus-inline-v39{clip-path:inset(12px round 14px)}
.viewport:has(.lotus-inline-v39:not(.hidden))>:is(.chapter-label,.bottom-hud,.game-menu-v28){visibility:hidden}
#dreamVeilV39.dream-eyelids-v160{inset:0;z-index:850;overflow:hidden;clip-path:inset(12px round 14px);animation:none;background:transparent;backdrop-filter:none;display:flex;align-items:center;justify-content:center;padding:var(--frame-safe-y) var(--frame-safe-x)}
#dreamVeilV39.dream-eyelids-v160:before,#dreamVeilV39.dream-eyelids-v160:after{display:none}
.dream-snapshot-v160{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;image-rendering:auto}
.dream-lid-v160{position:absolute;left:0;right:0;height:51%;background:#080d12;z-index:1;transform:scaleY(0);animation:dream-close-v160 1.65s ease-in-out forwards}
.dream-lid-v160.top{top:0;transform-origin:top}.dream-lid-v160.bottom{bottom:0;transform-origin:bottom}
#dreamVeilV39.dream-covered-v160{background:#080d12}
.dream-copy-v160{position:relative;z-index:2;opacity:0;display:flex;flex-direction:column;align-items:center;gap:20px;max-width:85%;pointer-events:none}
#dreamVeilV39 .dream-copy-v160 p{font-size:clamp(20px,2vw,28px);line-height:1.7;max-width:100%;margin:0;animation:none;color:#fff5df}
.dream-copy-v160 button{font-size:19px}.dream-covered-v160 .dream-copy-v160{opacity:1;pointer-events:auto;transition:opacity .35s}
#dreamVeilV39.dream-opening-v160{background:transparent}.dream-opening-v160 .dream-copy-v160{opacity:0;pointer-events:none}.dream-opening-v160 .dream-lid-v160{animation:dream-open-v160 .85s ease-in-out forwards}
@keyframes dream-close-v160{0%{transform:scaleY(0)}28%{transform:scaleY(.8)}44%{transform:scaleY(.12)}100%{transform:scaleY(1)}}
@keyframes dream-open-v160{from{transform:scaleY(1)}to{transform:scaleY(0)}}
@media(max-width:650px){#dreamVeilV39.dream-eyelids-v160,#modal.lotus-inline-v39{clip-path:inset(10px round 12px)}}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){#dialogueDock #line,#dialogueDock .exile-text .speech p{font-size:17px;line-height:1.5}#dialogueDock>.dialogue-idle strong{font-size:18px}#dialogueDock>.dialogue-idle p{font-size:16px}#dialogueDock>.dialogue-idle:has(.route-idle-actions-v127){grid-template-columns:minmax(0,1fr) minmax(210px,32%);column-gap:14px;padding:9px 20px;row-gap:3px}#dialogueDock .route-idle-actions-v127{font-size:16px;gap:4px 10px}#dialogueDock .route-idle-actions-v127 .route-count-digits-v127 img{width:19px;height:25px}#dialogueDock .route-idle-actions-v127 button{font-size:16px;min-height:34px;padding:4px 12px}#boatGuideV39{padding:14px 20px}#boatGuideV39 h2{font-size:22px;margin:0 0 8px}#boatGuideV39 p{font-size:17px;line-height:1.65;margin:8px 0}#boatGuideV39 button{font-size:17px}.activity-result-v160{padding:16px 22px}.activity-result-v160 h2{font-size:23px}.activity-result-v160>p,#modal.route-world-v127 .activity-result-v160 #activityFeedback{font-size:17px}#modal.route-world-v127 .activity-result-v160 #finishActivity{font-size:17px;margin-top:7px}#modal.route-world-v127 #activityFeedback{font-size:18px;padding:8px 12px}.dream-copy-v160{gap:12px}#dreamVeilV39 .dream-copy-v160 p{font-size:19px}}
@media(prefers-reduced-motion:reduce){.dream-lid-v160{animation: dream-close-v160 .35s linear forwards}.dream-opening-v160 .dream-lid-v160{animation-duration:.25s}}
/* V160: explanation copy uses the same readable scale as play feedback. */
#modal .route-activity-v127 #waterCrisis p,#modal .runner-brief>p,#modal .runner-brief .runner-how p{font-size:20px;line-height:1.7;word-break:keep-all}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){#modal .route-activity-v127 #waterCrisis p,#modal .runner-brief>p,#modal .runner-brief .runner-how p{font-size:17px;line-height:1.6}}

/* V161: existing painted arrow, anchored above only the active interaction. */
#targetBeacon.interaction-arrow-v161:not(.hidden){display:block!important;position:absolute;width:clamp(32px,4vw,60px);height:auto;padding:0;background:none;border:0;box-shadow:none;transform:translate(-50%,-100%);pointer-events:none;z-index:8;opacity:1;animation:interaction-bounce-v168 1.2s ease-in-out infinite}
#targetBeacon.interaction-arrow-v161>:not(.interaction-art-v161){display:none!important}
#targetBeacon.interaction-arrow-v161 .interaction-art-v161{display:block;width:100%;height:auto;transform:rotate(90deg);filter:drop-shadow(0 2px 2px #49341c66)}
#targetBeacon.interaction-arrow-v161.hidden{display:none!important}
#targetBeacon.interaction-arrow-v161::before,#targetBeacon.interaction-arrow-v161::after{content:none!important;display:none!important}
@keyframes interaction-bounce-v168{0%,100%{transform:translate(-50%,-100%)}50%{transform:translate(-50%,calc(-100% - 6px))}}
@media(prefers-reduced-motion:reduce){#targetBeacon.interaction-arrow-v161:not(.hidden){animation:none;opacity:1}}
/* V163: keep the thematic question and explanation readable in the existing popup. */
.worldly-reflection-v163 h2{font-size:clamp(23px,2vw,29px);line-height:1.6;text-align:center;word-break:keep-all}
.worldly-reflection-v163>p{font-size:19px;line-height:1.75;text-align:center;word-break:keep-all}
.worldly-reflection-v163 .answers button{font-size:19px;line-height:1.55;white-space:normal;word-break:keep-all}
.worldly-reflection-v163 #activityFeedback{color:#57432f;font-size:19px;line-height:1.75}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){.worldly-reflection-v163 h2{font-size:22px}.worldly-reflection-v163>p,.worldly-reflection-v163 .answers button,.worldly-reflection-v163 #activityFeedback{font-size:17px;line-height:1.6}}

/* V167: the automatic ending uses the framed story area and the existing dialogue height. */
#modal.ending-journey-v167{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;padding:0!important;transform:none!important;translate:none!important;background:transparent!important;backdrop-filter:none!important;z-index:850;display:block!important;clip-path:inset(12px round 14px)}
#modal.ending-journey-v167.hidden{display:none!important}
#modal.ending-journey-v167>section{width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;padding:0!important;margin:0!important;background:transparent!important;border:0!important;box-shadow:none!important;overflow:hidden!important}
#modal.ending-journey-v167 #closeModal{display:none}
#modal.ending-journey-v167 #modalContent,.ending-film-v167{position:relative;width:100%;height:100%;padding:0!important}
#endingCanvasV167{position:absolute;inset:0;width:100%;height:100%;image-rendering:auto;pointer-events:none}

.ending-progress-v167{position:absolute;left:var(--frame-safe-x);right:var(--frame-safe-x);bottom:var(--frame-safe-y);height:4px;background:#fff8e977;border-radius:8px;overflow:hidden;pointer-events:none}.ending-progress-v167>i{display:block;height:100%;background:#3f8275;width:0}
#endingThanksV167{position:absolute;left:50%;top:42%;transform:translate(-50%,-50%);width:min(620px,82%);padding:22px;background:#fff8e9f2;border:2px solid #bca779;border-radius:22px;text-align:center;color:#57432f}
#endingThanksV167 h2{font-size:clamp(23px,2vw,30px);margin:0 0 10px}#endingThanksV167 p{font-size:20px;line-height:1.6;margin:0}
body.ending-journey-active-v167 .viewport>:is(.chapter-label,.bottom-hud,#sceneLabels,#targetBeacon,#prompt){visibility:hidden!important}
body.ending-journey-active-v167 #dialogueDock>:is(.dialogue-idle,#dialog){display:none!important}
#endingDockV167{position:absolute;inset:8px 0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:22px;padding:20px 30px;background:#fbf7e6;border:2px solid #c7b78f;border-radius:22px;color:#57432f}
#endingDockV167 strong{font-size:23px;color:#5b743b}#endingDockV167 p{font-size:20px;line-height:1.65;margin:7px 0 0}
.ending-actions-v167{display:grid;grid-template-columns:auto auto;gap:9px}.ending-actions-v167 button{font-size:17px;min-height:42px;padding:6px 16px;white-space:nowrap}
@media(max-width:650px){#modal.ending-journey-v167{clip-path:inset(10px round 12px)}}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){#endingDockV167{padding:8px 16px;gap:10px;grid-template-columns:minmax(0,1fr) auto}#endingDockV167 strong{font-size:18px}#endingDockV167 p{font-size:16px;line-height:1.45;margin-top:3px}.ending-actions-v167{gap:5px}.ending-actions-v167 button{font-size:14px;min-height:32px;padding:4px 9px}#endingSceneV167{font-size:17px;padding:4px 12px}#endingThanksV167{padding:14px 18px}#endingThanksV167 h2{font-size:23px}#endingThanksV167 p{font-size:17px}}
body.ending-journey-active-v167 .viewport>#quickToolsV28{visibility:visible!important;z-index:890}

/* V170: familiar chapter scroll, grounded cast, and equal ending controls. */
#endingScrollV170{position:absolute;left:var(--frame-safe-x);top:var(--frame-safe-y);transform:none;pointer-events:none;color:#57432f;z-index:2}
#endingScrollV170 #endingSceneV167{position:static;display:block;transform:none;background:none;border:0;border-radius:0;margin:0;padding:0;max-width:none;font-size:16px;line-height:1.4;white-space:normal;text-align:center}
#endingScrollV170>span{font-size:10px;letter-spacing:1px;line-height:1.4}
#endingDockV167 .ending-actions-v167{grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-rows:48px;align-items:stretch}
#endingDockV167 .ending-actions-v167>button{box-sizing:border-box;width:100%;height:100%;min-height:0;margin:0;padding:6px 16px;display:flex;align-items:center;justify-content:center}
@media(max-width:650px){#endingScrollV170 #endingSceneV167{font-size:12px}#endingScrollV170>span{font-size:8px}}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){#endingDockV167 .ending-actions-v167{grid-auto-rows:36px}#endingDockV167 .ending-actions-v167>button{padding:4px 9px}}

/* V175: illustrations match the 512:280 story frame, without square atlas crops. */
.ending-art.ending-illustration-v175{position:relative;aspect-ratio:512/280;background:none;overflow:hidden}
.ending-illustration-v175>img{display:block;width:100%;height:100%;object-fit:cover;object-position:center}
#badEndingStageV38>.ending-art.ending-illustration-v175{position:absolute;inset:0;top:0;width:100%;height:100%;aspect-ratio:auto;transform:none;margin:0;border-radius:0;background:none}
.ending-grid .ending-art.ending-illustration-v175{aspect-ratio:512/280;height:auto}

/* V178: compact collection cards, with a narrow neutral scrollbar. */
#modal:has(.ending-gallery-v178)>section{width:min(920px,100%)!important;max-width:920px!important;max-height:100%!important;padding:22px!important;overflow:hidden!important;scrollbar-width:thin;scrollbar-color:#aa9d82 transparent}
#modal:has(.ending-gallery-v178) :is(section,#modalContent)::-webkit-scrollbar{width:4px;height:4px}
#modal:has(.ending-gallery-v178) :is(section,#modalContent)::-webkit-scrollbar-track{background:transparent}
#modal:has(.ending-gallery-v178) :is(section,#modalContent)::-webkit-scrollbar-thumb{background:#aa9d82;border-radius:6px}
.ending-gallery-v178{width:100%;min-width:0;color:#57432f}
.ending-gallery-v178 header{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 14px;padding:0;border:0;background:none}
.ending-gallery-v178 header h2{font-size:25px;line-height:1.3;margin:3px 0 0}
.ending-gallery-v178 header>span{font-size:14px;white-space:nowrap}
.ending-gallery-v178 .ending-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.ending-gallery-v178 .ending-grid>button{min-width:0;width:100%;padding:7px;margin:0;align-self:stretch}
.ending-gallery-v178 .ending-grid .ending-art{width:100%;height:auto;aspect-ratio:512/280!important;margin:0 0 6px;border-radius:9px;overflow:hidden}
.ending-gallery-v178 .ending-art>img{display:block;width:100%;height:100%;object-fit:cover}
.ending-gallery-v178 .ending-grid strong{display:flex;align-items:center;justify-content:center;min-height:2.6em;font-size:14px;line-height:1.3;word-break:keep-all}
.ending-gallery-v178 .ending-grid>.ending-locked-v178:disabled{opacity:1;filter:none;background:#e6e2d6;border-color:#b6ad96;color:#766c59;box-shadow:0 3px 0 #a99e83;cursor:default}
.ending-gallery-v178 #endingDescription{font-size:16px;line-height:1.6;margin:16px 0 8px;word-break:keep-all}
.ending-gallery-v178 #galleryBack{display:block;margin:10px auto 0;font-size:15px;min-height:38px;padding:7px 22px}
@media(max-width:650px),(max-height:500px){#modal:has(.ending-gallery-v178)>section{padding:14px!important}.ending-gallery-v178 header{margin-bottom:10px}.ending-gallery-v178 header h2{font-size:21px}.ending-gallery-v178 header>span{font-size:12px}.ending-gallery-v178 .ending-grid{gap:7px}.ending-gallery-v178 .ending-grid>button{padding:5px}.ending-gallery-v178 .ending-grid strong{font-size:12px}.ending-gallery-v178 #endingDescription{font-size:14px}}

/* V179: scrolling belongs to the inset content, never the rounded popup shell. */
*{scrollbar-width:thin;scrollbar-color:#aa9d82 transparent}
*::-webkit-scrollbar{width:4px;height:4px}
*::-webkit-scrollbar-track{background:transparent;margin:8px 0}
*::-webkit-scrollbar-thumb{background:#aa9d82;border-radius:8px}
*::-webkit-scrollbar-corner{background:transparent}
#modal{min-width:0;min-height:0}
#modal:not(.stage-activity):not(:has(.bad-ending,.ending-film-v167,.defense-field,.lotus-activity-v39,.route-activity-v127,.willow-fortress)){grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
#modal:not(.stage-activity):not(:has(.bad-ending,.ending-film-v167,.defense-field,.lotus-activity-v39,.route-activity-v127,.willow-fortress))>section{display:flex;flex-direction:column;min-height:0;min-width:0;overflow:hidden!important}
#modal:not(.stage-activity):not(:has(.bad-ending,.ending-film-v167,.defense-field,.lotus-activity-v39,.route-activity-v127,.willow-fortress)) #modalContent{flex:1 1 auto;min-height:0;min-width:0;height:auto!important;max-height:100%;overflow:auto!important;overscroll-behavior:contain;scrollbar-gutter:stable;padding-bottom:8px!important}
.library-drawer{display:flex;flex-direction:column;min-height:0;min-width:0;overflow:hidden!important}
.library-drawer>.library-header,.library-drawer>#returnGame{flex-shrink:0}
.library-drawer #side{flex:1 1 auto;min-height:0;max-height:none!important;overflow:auto!important;overscroll-behavior:contain;scrollbar-gutter:stable}
.relation-graph-scroll{min-width:0;max-width:100%;overflow-y:hidden;overscroll-behavior:contain}
:is(#dialogueDock #line,#dialogueDock .exile-text .speech p,.bad-copy-v57,.activity-result-v160,#boatGuideV39){min-height:0;min-width:0;overscroll-behavior:contain}
:is(.activity-result-v160,#boatGuideV39)::-webkit-scrollbar-track{margin:16px 0}
*::-webkit-scrollbar-button{display:none;width:0;height:0}
*::-webkit-scrollbar-track:horizontal{margin:0 8px}
/* A story play area can extend below the visible window; popup scrolling must still fit the window. */
#modal.in-game-panel:not(.stage-activity):not(:has(.bad-ending,.ending-film-v167,.defense-field,.lotus-activity-v39,.route-activity-v127,.willow-fortress)){max-height:min(100%,calc(100svh - 40px))}
/* V181: short instructions inside the story frame, and matching quest arrows. */
#miniGuideV181{position:absolute;inset:12px;z-index:880;display:grid;place-items:center;padding:22px;background:#18252165;border-radius:14px}
#miniGuideV181>section{width:min(540px,100%);max-height:100%;min-height:0;display:flex;flex-direction:column;padding:24px;background:#fbf7e6;border:2px solid #c7b78f;border-radius:22px;overflow:hidden;color:#57432f;text-align:center;box-shadow:0 5px 0 #66533433}
#miniGuideV181 .mini-guide-copy-v181{min-height:0;overflow:auto;overscroll-behavior:contain;font-size:18px;line-height:1.65}
#miniGuideV181 h2{font-size:25px;line-height:1.4;margin:8px 0 16px}#miniGuideV181 p{margin:12px 0}#miniGuideV181 small{font-size:12px}
#miniGuideV181 kbd{font:13px system-ui,sans-serif;padding:2px 6px;background:#fffdf6;border:1px solid #b8b093;border-bottom-width:3px;border-radius:5px}
#miniGuideV181 #miniGuideStartV181{flex-shrink:0;width:132px;min-height:40px;margin:16px auto 0;padding:8px 18px;font-size:17px}
#questArrowsV181{position:absolute;inset:0;pointer-events:none;z-index:8}
.quest-arrow-v181{position:absolute;display:block;width:clamp(32px,4vw,60px);height:auto;transform:translate(-50%,-100%);animation:interaction-bounce-v168 1.2s ease-in-out infinite;pointer-events:none}
.quest-arrow-v181>img{display:block;width:100%;height:auto;transform:rotate(90deg);filter:drop-shadow(0 2px 2px #49341c66)}
#questArrowsV181.hidden,.quest-arrow-v181.hidden{display:none!important}
@media(prefers-reduced-motion:reduce){.quest-arrow-v181{animation:none}}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){#miniGuideV181{inset:10px;padding:12px}#miniGuideV181>section{padding:14px 18px}#miniGuideV181 .mini-guide-copy-v181{font-size:16px;line-height:1.5}#miniGuideV181 h2{font-size:21px;margin:5px 0 10px}#miniGuideV181 p{margin:8px 0}#miniGuideV181 #miniGuideStartV181{margin-top:10px;min-height:36px;font-size:16px}}
#miniGuideV181{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
/* V182: timer digits sit beside the clock at exactly the count digits' size. */
#modal.difference-popup-v34 .difference-clock-v19{display:inline-flex;align-items:center;justify-content:center;gap:9px;width:auto;height:auto;scale:1;transform:none;margin:0;flex-shrink:0}
.difference-clock-art-v182{position:relative;display:block;width:46px;height:46px;flex-shrink:0}
.difference-clock-art-v182>img:first-child{display:block;width:46px;height:46px;object-fit:contain;margin:0}
.difference-clock-art-v182>.clock-hand-v19{position:absolute;left:12.35px;top:3.36px;width:25.875px;height:25.875px;object-fit:contain;transform-origin:49.21875% 80.625%}
#modal.difference-popup-v34 #differenceTime{display:inline-flex;align-items:center;margin:0;padding:0;line-height:1}
#modal.difference-popup-v34 #differenceTime .difference-digits-v107>img{width:22px;height:29px;opacity:1;filter:none}
@media(max-height:540px){.difference-clock-art-v182,.difference-clock-art-v182>img:first-child{width:36px;height:36px}.difference-clock-art-v182>.clock-hand-v19{left:9.666px;top:2.63px;width:20.25px;height:20.25px}}
/* V183: this picture game fits as a whole, with no scrolling on either axis. */
#modal.difference-popup-v34 #modalContent{overflow:hidden!important;scrollbar-gutter:auto!important;padding:0!important;width:100%;min-width:0;min-height:0}
#modal.difference-popup-v34 .identity-activity{display:flex;flex-direction:column;align-items:center;gap:0;min-width:0;min-height:0;overflow:hidden}
#modal.difference-popup-v34 .identity-activity>:not(.identity-pair){flex-shrink:0;max-width:100%}
#modal.difference-popup-v34 .identity-pair{grid-template-columns:repeat(2,minmax(0,1fr));min-width:0;max-width:100%;flex-shrink:0;gap:8px}
#modal.difference-popup-v34 .identity-panel{min-width:0;max-width:100%;overflow:hidden}
#modal.difference-popup-v34 :is(#differenceStart,#finishActivity){width:132px!important;min-width:0!important;max-width:100%;align-self:center;margin:8px auto 0!important;padding:5px 16px!important}
#modal.difference-popup-v34 .pencil-reveal-v23{stroke-width:26;animation-duration:.65s}
@media(max-height:420px){#modal.difference-popup-v34 .identity-activity>p{font-size:11px;line-height:1.35;margin:2px 0}#modal.difference-popup-v34 .identity-status{margin:3px 0}#modal.difference-popup-v34 h2{font-size:16px;margin:0}#modal.difference-popup-v34 :is(#differenceStart,#finishActivity){min-height:30px;margin-top:4px!important}}
#modal.difference-popup-v34 .pencil-reveal-v23{animation-timing-function:cubic-bezier(.55,.02,.85,.45)}
/* V184: leave space inside the clipped activity for the button's lower face and shadow. */
#modal.difference-popup-v34 .identity-activity{padding:0 0 8px!important}
/* V185: only the on-field scout is reduced; the visible body, rather than transparent canvas, is centered. */
#modal.defense-stage-v118 .defense-pad .troop-v11.scout>.defense-unit-art.scout-balanced-v185{width:69%;height:69%;left:15.5%;bottom:15.5%;translate:var(--scout-shift-v185,0%) 0}
/* V189: illustrated title and a readable prelude within the existing story frame. */
.immersive-game #start{isolation:isolate;align-items:flex-start;text-align:left;padding:7% 8%;background:#f2e9cb;color:#57432f}
#start .opening-art-v189{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:-2;pointer-events:none}
.immersive-game #start::before{content:'';position:absolute;inset:0;background:linear-gradient(90deg,#fff8e8df 0%,#fff8e89c 32%,#fff8e800 64%);z-index:-1;pointer-events:none}
.immersive-game #start h2{font-size:clamp(30px,4.5vw,66px);margin:8px 0 12px;line-height:1.25;color:#513b29;text-shadow:0 2px 5px #fff8e8}
.immersive-game #start>.eyebrow{font-size:clamp(12px,1.4vw,19px);color:#69533b}
.immersive-game #start>p:not(.eyebrow){font-size:clamp(14px,1.5vw,21px);color:#57432f}
.immersive-game #start .start-hint{color:#69533b;font-size:clamp(11px,1.1vw,15px);max-width:45%}
.immersive-game #start .start-new{color:#57432f;background:#fff8e8d9;border-color:#b9a47c}
.immersive-game #chapterIntro.opening-prelude-v189{background:linear-gradient(#fff8e8e8,#fff8e8e8),url('assets/opening-hyeongsan-v189.ec3213d26c63.webp') center/cover;gap:12px;padding:5% 8%}
#chapterIntro.opening-prelude-v189 .intro-overline,#chapterIntro.opening-prelude-v189 .intro-rule{display:none}
#chapterIntro.opening-prelude-v189 #introTitle{font-size:clamp(24px,3vw,40px);line-height:1.3;margin:4px 0}
#chapterIntro.opening-prelude-v189 #introSynopsis{max-width:900px;font-size:clamp(18px,1.8vw,25px);line-height:1.8;white-space:pre-line;word-break:keep-all;overflow-wrap:break-word;text-wrap:initial;margin:8px auto}
#chapterIntro.opening-prelude-v189 #enterChapter{width:auto;min-width:164px;flex-shrink:0;margin-top:10px}
.opening-keys-v189{display:inline-block;margin-bottom:12px;line-height:2}
@media(max-height:600px){.immersive-game #start{padding:4% 7%}.immersive-game #start h2{font-size:36px}.immersive-game #start .start-hint{margin-top:10px}.immersive-game #chapterIntro.opening-prelude-v189{gap:5px;padding:28px 7%}#chapterIntro.opening-prelude-v189 #introSynopsis{font-size:16px;line-height:1.55;margin:4px auto}#chapterIntro.opening-prelude-v189 #introTitle{font-size:25px}#chapterIntro.opening-prelude-v189 #enterChapter{margin-top:5px}.opening-keys-v189{margin-bottom:5px}}
/* V191: the same compact flower workspace on desktop and landscape tablets. */
#modal:has(.slice-layout-v191)>section{width:min(1100px,calc(100vw - 48px));max-width:1100px;max-height:calc(100% - 32px);padding:22px 28px!important;overflow:hidden!important}
#modal:has(.slice-layout-v191) #modalContent{overflow:hidden!important;scrollbar-gutter:auto;padding:0!important}
.activity:has(>.slice-layout-v191){min-width:0;text-align:center}
.activity:has(>.slice-layout-v191)>h2{margin:4px 0 14px;font-size:clamp(22px,2.4vw,30px);line-height:1.25}
.slice-layout-v191{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:24px;align-items:center;min-width:0}
.slice-layout-v191 .slice-board{width:min(100%,420px,calc(100svh - 210px));margin:0 auto;align-self:center}
.slice-details-v191{display:flex;flex-direction:column;align-items:center;gap:8px;min-width:0;text-align:center}
.slice-details-v191>p{margin:0;font-size:16px;line-height:1.6}
.slice-details-v191 .slice-meter{margin:4px 0;gap:26px}
.slice-details-v191 #sliceRatios{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;margin:3px 0;width:100%}
.slice-details-v191 #sliceRatios>span{min-width:0;padding:5px 7px!important;border-radius:10px!important;box-shadow:0 2px 0 #94a979}
.slice-details-v191 #sliceRatios b{font-size:15px}
.slice-details-v191 .slice-tools{gap:8px}
.slice-details-v191 .slice-tools button{min-height:40px;margin:0;padding:7px 12px}
.slice-details-v191 .slice-key-help{margin:0;line-height:1.5}
.slice-details-v191 #activityFeedback:empty{display:none}
.slice-details-v191 #activityFeedback{font-size:15px;line-height:1.5}
.slice-details-v191 #finishActivity{width:auto;min-width:164px;margin:3px 0 5px;padding:9px 16px}
@media(orientation:landscape) and (max-height:600px){
 #modal:has(.slice-layout-v191)>section{width:calc(100vw - 48px);padding:14px 22px!important}
 .activity:has(>.slice-layout-v191)>h2{font-size:22px;margin:2px 0 7px}
 .activity:has(>.slice-layout-v191)>.activity-kicker{display:none}
 .slice-layout-v191{gap:18px;grid-template-columns:minmax(0,.9fr) minmax(0,1.2fr)}
 .slice-layout-v191 .slice-board{width:min(100%,calc(100svh - 130px))}
 .slice-details-v191{gap:5px}
 .slice-details-v191>p{font-size:14px;line-height:1.4}
 .slice-details-v191 .slice-meter{margin:0}.slice-details-v191 .slice-meter b{font-size:20px}
 .slice-details-v191 #sliceRatios>span{padding:3px 5px!important}.slice-details-v191 #sliceRatios b{font-size:13px}
 .slice-details-v191 .slice-key-help{display:none}
 .slice-details-v191 .slice-tools button{min-height:34px;padding:5px 10px;font-size:13px}
 .slice-details-v191 #activityFeedback{font-size:13px}
 .slice-details-v191 #finishActivity{padding:6px 12px;font-size:13px}
}
/* V192: fit full dialogue using its available height; preserve the dock and action rows. */
#dialogueDock>#dialog>.speech{padding-top:var(--dialogue-top-v192,32px)!important}
#dialogueDock #line{margin:0;min-height:0}
@media(max-width:650px){#dialogueDock>#dialog>.speech{padding-top:var(--dialogue-top-v192,22px)!important}}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px){#dialogueDock>#dialog>.speech{padding-top:var(--dialogue-top-v192,0px)!important}}
/* V193: paginate only when the complete line exceeds the text area. */
#dialogueDock #line{overflow-y:hidden!important;scrollbar-width:none}
/* Paginated lines use the same measured inset as ordinary dialogue. */

/* V194: every dialogue page is at most two rendered lines, on all screen widths. */
#dialogueDock #line{max-height:2lh;align-self:start}

/* V195: an explicit pixel cap also supports browsers without the lh unit. */
#dialogueDock #line{max-height:var(--dialogue-page-height-v195,2lh)!important}
/* V196: content-sized flower popup; no inherited full-stage panel sizing. */
#modal:has(#sliceSvg):not(.hidden){position:absolute!important;inset:0!important;width:100%!important;height:100%!important;display:flex!important;align-items:center!important;justify-content:center!important;padding:20px!important;background:#243e2866!important;backdrop-filter:blur(5px)!important;transform:none!important;translate:none!important;z-index:880}
#modal:has(#sliceSvg)>section{position:relative!important;inset:auto!important;transform:none!important;translate:none!important;width:min(1000px,100%)!important;max-width:1000px!important;height:auto!important;min-height:0!important;max-height:100%!important;margin:0!important;padding:22px 26px!important;flex:0 1 auto;align-self:center!important;border:2px solid var(--ui-edge)!important;border-radius:24px!important;background:linear-gradient(135deg,var(--ui-paper),#f3f1de)!important;box-shadow:0 8px 0 #a6916740,0 16px 40px #192b2530!important;overflow:hidden!important}
#modal:has(#sliceSvg) #modalContent{height:auto!important;min-height:0!important;max-height:none!important;flex:0 1 auto!important;padding:0!important;overflow:hidden!important}
.slice-details-v191 #sliceRatios{display:flex;flex-wrap:wrap;justify-content:center;max-width:440px;gap:7px}
.slice-details-v191 #sliceRatios>span{flex:0 0 calc(25% - 5.25px);min-width:0}
@media(orientation:landscape) and (max-height:600px){#modal:has(#sliceSvg):not(.hidden){padding:14px!important}#modal:has(#sliceSvg)>section{padding:12px 20px!important}.slice-layout-v191 .slice-board{width:min(100%,calc(100svh - 140px))}}
/* V197: reserve every control inside a measured, uniformly scaled popup. */
#modal:has(.flower-fit-shell-v197)>section{padding:16px!important;max-height:calc(100% - 24px)!important;max-width:calc(100% - 24px)!important}
.flower-fit-shell-v197{position:relative;flex:none;margin:auto;min-width:0;overflow:visible}
.flower-fit-content-v197{position:absolute;left:0;top:0;transform-origin:top left;max-width:none!important;margin:0!important}
.flower-fit-content-v197 .slice-layout-v191{grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:20px}
.flower-fit-content-v197 .slice-board{width:min(100%,360px)!important;margin:0 auto!important}
.flower-fit-content-v197 .slice-details-v191{gap:7px}
.flower-fit-content-v197 .slice-details-v191>p{font-size:16px;line-height:1.45}
.flower-fit-content-v197 .slice-meter b{font-size:22px}
.flower-fit-content-v197 #sliceRatios{min-height:112px;align-content:center}
.flower-fit-content-v197 #sliceRatios>span{height:52px;padding:3px 5px!important;justify-content:center}
.flower-fit-content-v197 #sliceRatios>span b{font-size:15px}
.flower-fit-content-v197 #sliceRatios>span small{font-size:10px;line-height:1.2}
.flower-fit-content-v197 .slice-tools button{min-height:38px;font-size:14px;padding:6px 10px}
.flower-fit-content-v197 .slice-key-help{display:block;font-size:10px}
/* V200: rules live in the opening guide; the workspace shows only actionable state. */
.flower-fit-content-v197 .slice-meter,.flower-fit-content-v197 #sliceCount,.flower-fit-content-v197 .slice-tolerance{display:none!important}
/* V201: short flower instructions, no scrolling or inline keycap clipping. */
#miniGuideV181.flower-guide-v201{padding:16px}
#miniGuideV181.flower-guide-v201>section{width:min(600px,100%);padding:20px 22px;overflow:hidden}
#miniGuideV181.flower-guide-v201 .mini-guide-copy-v181{overflow:hidden;flex:none;font-size:18px;line-height:1.65;word-break:keep-all;overflow-wrap:break-word;text-wrap:initial}
#miniGuideV181.flower-guide-v201 h2{font-size:24px;margin:8px 0 14px}
#miniGuideV181.flower-guide-v201 p{margin:10px 0;text-wrap:initial;word-break:keep-all}
#miniGuideV181.flower-guide-v201 kbd{display:inline-flex;align-items:center;justify-content:center;flex:none;min-width:29px;height:30px;margin:3px 2px;padding:2px 7px;border:1.5px solid #a99c7c;border-radius:7px;background:#fffdf2;color:#59452e;box-shadow:0 3px 0 #c4b695;font-family:Arial,system-ui,sans-serif!important;font-size:14px!important;font-weight:400!important;line-height:1!important;white-space:nowrap;vertical-align:middle}
.flower-guide-keys-v201{display:flex;flex-direction:column;align-items:center;gap:7px;padding:4px 0 6px}
.flower-guide-keys-v201>div{display:flex;align-items:center;justify-content:center;gap:12px;white-space:nowrap}
#miniGuideV181.flower-guide-v201.flower-guide-low-v201{padding:8px}
#miniGuideV181.flower-guide-low-v201>section{padding:12px 18px}
#miniGuideV181.flower-guide-low-v201 .mini-guide-copy-v181{font-size:15px;line-height:1.45}
#miniGuideV181.flower-guide-low-v201 h2{font-size:20px;margin:4px 0 8px}
#miniGuideV181.flower-guide-low-v201 p{margin:7px 0}
#miniGuideV181.flower-guide-low-v201 #miniGuideStartV181{margin-top:8px;min-height:34px;padding:5px 14px;font-size:15px}
#miniGuideV181.flower-guide-low-v201 .flower-guide-keys-v201{gap:2px}

/* V202: border-safe content box and concise live state, without duplicated goals. */
#modal:has(.flower-fit-shell-v197)>section{padding:16px!important}
#modal:has(.flower-fit-shell-v197) #modalContent{width:100%!important;box-sizing:border-box!important;overflow:visible!important}
.flower-fit-shell-v197{margin:0 auto!important;box-sizing:content-box}
.flower-fit-content-v197 .slice-board{padding:8px;box-sizing:border-box}
.flower-fit-content-v197 .slice-board svg{overflow:visible}
.flower-fit-content-v197 .slice-meter{display:flex!important;gap:0;margin:0}
.flower-fit-content-v197 .slice-meter>span:last-child{display:none!important}
.flower-fit-content-v197 .slice-meter>span:first-child{flex-direction:row;align-items:center;gap:10px;font-size:17px}
.flower-fit-content-v197 .slice-meter b{font-size:23px}
.flower-fit-content-v197 #sliceCount,.flower-fit-content-v197 .slice-tolerance{display:block!important;font-size:16px;line-height:1.4;margin:0}
.flower-fit-content-v197 .slice-details-v191{padding:6px 10px;box-sizing:border-box;gap:8px}
.flower-fit-content-v197 #sliceRatios{width:100%;max-width:100%;box-sizing:border-box;padding:3px 4px 5px;gap:7px}
.flower-fit-content-v197 #sliceRatios>span{flex:0 0 calc(25% - 5.25px);min-width:0!important;box-sizing:border-box!important}
.flower-fit-content-v197 #activityFeedback{color:#57432f!important;line-height:1.55;font-size:16px;margin:14px 0 4px!important;padding:0 6px;min-height:0}
.flower-fit-content-v197 #activityFeedback:empty{display:none!important}
.flower-fit-content-v197 .slice-tools{margin-bottom:4px}

#modal:has(.flower-fit-shell-v197)>section{max-width:100%!important;max-height:100%!important}
/* V203: align the visible flower and status block at the top of their shared row. */
.flower-fit-content-v197 .slice-layout-v191{align-items:start}
.flower-fit-content-v197 .slice-board{align-self:start}
.flower-fit-content-v197 .slice-details-v191{align-self:start;padding-top:26px;justify-content:flex-start}
/* V204: four bounded grid tracks; no percentage flex bases or inherited minimum chip width. */
#modal .flower-fit-content-v197 #sliceRatios.slice-ratios{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;width:100%!important;max-width:100%!important;min-width:0!important;justify-content:center;justify-items:stretch;padding:4px 8px 6px!important;gap:7px!important;overflow:visible!important;box-sizing:border-box!important}
#modal .flower-fit-content-v197 #sliceRatios.slice-ratios>span{width:100%!important;max-width:100%!important;min-width:0!important;margin:0!important;box-sizing:border-box!important}
#modal .flower-fit-content-v197 #sliceRatios.slice-ratios:has(>span:only-child){grid-template-columns:minmax(0,100px)!important}
#modal .flower-fit-content-v197 #sliceRatios.slice-ratios:has(>span:nth-child(2):last-child){grid-template-columns:repeat(2,minmax(0,100px))!important}
#modal .flower-fit-content-v197 #sliceRatios.slice-ratios:has(>span:nth-child(3):last-child){grid-template-columns:repeat(3,minmax(0,100px))!important}
