:root{color-scheme:dark;--night:#0b1112;--cream:#f8efdb;--gold:#dfb975;--line:#34403c;--serif:"Songti SC","STSong","Noto Serif CJK SC","SimSun","宋体",Georgia,serif;--sans:"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--night);color:var(--cream);font-family:var(--sans)}
body{background:radial-gradient(ellipse at 50% 10%,#192526 0,transparent 65%),var(--night)}
a,button{color:inherit;-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer}
button:focus-visible,a:focus-visible{outline:2px solid #ffe3a8;outline-offset:4px}
[hidden]{display:none!important}.symbols{display:none}
svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}
.shell{width:min(100%,1600px);min-height:100svh;margin:auto;padding:0 clamp(18px,4.3vw,74px);display:flex;flex-direction:column;justify-content:center}
.topbar{height:clamp(64px,9svh,92px);flex:none;display:flex;align-items:center;justify-content:space-between}
.brand,.topbar nav,.lobby,.controls,.controls>span,.menu-actions,.menu-actions button,.title-bottom,.title-bottom span,.genre,.filigree,.vitals,.hud-right,.panel-crest,.touch>div{display:flex;align-items:center}
.brand{gap:13px;text-decoration:none}.brand-mark{color:var(--gold);width:43px;height:37px;stroke:none}
.brand b,.brand small{display:block}.brand b{font:600 1.05rem/1.3 var(--serif);letter-spacing:.15em;color:#ebe6d8}.brand small{color:#a79e89;font:600 .6rem/1.2 Georgia,serif;letter-spacing:.18em;margin-top:3px}
.topbar nav{gap:10px}.lobby{gap:8px;color:#d6d5c7;text-decoration:none;font-size:.88rem;letter-spacing:.06em}.lobby svg{width:15px;height:15px}
.nav-rule{height:19px;width:1px;background:var(--line);margin:0 9px}
.icon-button{display:grid;place-items:center;width:38px;height:38px;border:1px solid transparent;background:transparent;color:#d5d7c9;border-radius:3px}.icon-button:hover,.lobby:hover{color:#ffe1a5}.icon-button:hover{background:#25312d;border-color:#445046}
.frame{position:relative;padding:4px;background:#121a19;border:1px solid #566156;box-shadow:0 15px 48px #0004}
.screen{isolation:isolate;position:relative;width:100%;height:min(calc((min(100vw,1600px) - 2 * clamp(18px,4.3vw,74px) - 10px)*.5625),calc(100svh - clamp(64px,9svh,92px) - 83px));min-height:260px;overflow:hidden;background:#081213}
#world{display:block;width:100%;height:100%;object-fit:contain;outline:none;background:#091719;touch-action:none}
.title-scene{position:absolute;inset:0;overflow:hidden;background:#102524 url(title.webp) 50% 55%/cover no-repeat}
.title-scene:before{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#03100fee 0%,#041211a1 24%,#0612133b 48%,transparent 68%),linear-gradient(0deg,#050e0feb,transparent 18%)}
.title-content{position:absolute;left:7%;right:5%;top:49%;transform:translateY(-50%);pointer-events:none}
.genre{font-size:clamp(.75rem,1vw,.95rem);letter-spacing:.22em;color:#f0ca82;font-weight:550;gap:11px}.genre span{height:1px;width:26px;background:#c99c51;position:relative}.genre span:after{content:"";width:5px;height:5px;position:absolute;right:0;top:-2px;transform:rotate(45deg);background:#e7bd72}
h1{font:600 clamp(4rem,6.95vw,7.45rem)/1.22 var(--serif);color:#fff5df;letter-spacing:.08em;margin:.18em 0 .03em;text-shadow:1px 3px 0 #302f23,0 4px 25px #001713}
.latin{font:400 clamp(.97rem,1.5vw,1.65rem)/1.25 Georgia,"Times New Roman",serif;letter-spacing:.44em;color:#f1c983}
.filigree{width:clamp(110px,13vw,226px);gap:7px;margin:clamp(15px,3.3vh,35px) 0 clamp(12px,2vh,22px)}.filigree i{height:1px;flex:1;background:linear-gradient(90deg,#bf9c60,#c9a263a1)}.filigree i:last-child{flex:2.4;background:linear-gradient(90deg,#c9a263a1,transparent)}.filigree b{width:5px;height:5px;background:#d3ab67;transform:rotate(45deg)}
.intro{font-size:clamp(.9rem,1.15vw,1.13rem);line-height:1.9;letter-spacing:.055em;color:#e1e2d5;margin:0;text-shadow:0 2px 6px #04100e}
.menu-actions{gap:13px;margin-top:clamp(19px,3.6vh,39px);pointer-events:auto;width:max-content}
.primary,.secondary{position:relative;display:inline-flex;align-items:center;justify-content:center;gap:10px;min-height:48px;padding:0 24px;border-radius:2px;font-weight:650;letter-spacing:.07em;font-size:.96rem;transition:background .15s,border-color .15s,transform .15s}
.primary{background:linear-gradient(120deg,#f3d18b,#ddb06b);border:1px solid #f6d99d;color:#242a24;box-shadow:inset 0 0 0 2px #ddb471,0 4px 14px #00100c55}
.primary:hover{background:#ffe0a4;transform:translateY(-1px)}
.secondary{border:1px solid #928b70;color:#efe7ce;background:#101e1bcb}.secondary:hover{border-color:#e3c187;background:#20312a}
.primary svg,.secondary svg{width:17px;height:17px}.primary svg{width:14px}
.title-bottom{position:absolute;bottom:4.7%;left:3.2%;right:3.2%;justify-content:space-between;color:#ded8bf;font-size:.83rem;letter-spacing:.085em}.title-bottom span{gap:9px}.title-bottom svg{color:#d8b26c;width:16px;height:16px}.title-bottom small{font-size:.73rem;color:#b0b5a5;margin-right:1px}.title-bottom #save-note{color:#c4c5b2;font-size:.74rem;letter-spacing:.07em}
.save-light{width:6px;height:6px;background:#a7c4a7;box-shadow:0 0 7px #9bb59365;transform:rotate(45deg)}
.corner{position:absolute;z-index:5;width:clamp(15px,2vw,30px);height:clamp(15px,2vw,30px);pointer-events:none;border-top:2px solid #d0ae72;border-left:2px solid #d0ae72;opacity:.88}.corner:before{content:"";position:absolute;inset:3px;border-top:1px solid #bca373;border-left:1px solid #bca373}.tl{top:7px;left:7px}.tr{top:7px;right:7px;transform:rotate(90deg)}.bl{bottom:7px;left:7px;transform:rotate(-90deg)}.br{bottom:7px;right:7px;transform:rotate(180deg)}
.motes{position:absolute;inset:0;pointer-events:none}.motes i{position:absolute;left:var(--x);top:var(--y);width:3px;height:3px;background:#e7cc7f;border-radius:50%;box-shadow:0 0 7px 2px #dcaf6099;animation:drift var(--duration) ease-in-out var(--delay) infinite alternate;opacity:0}
@keyframes drift{0%{opacity:0;transform:translate(0,5px)}40%{opacity:.73}100%{opacity:.1;transform:translate(15px,-15px)}}
.controls{gap:clamp(13px,2.25vw,39px);min-height:74px;flex-wrap:wrap;justify-content:center;color:#aab0a5;font-size:.83rem}.controls>span{gap:6px;white-space:nowrap}.control-title{color:#d0c4a8;padding-right:clamp(10px,2vw,30px);border-right:1px solid var(--line);font-weight:550}.control-title svg{width:18px;height:18px;margin-right:3px}
kbd{min-width:23px;padding:2px 5px;text-align:center;white-space:nowrap;border:1px solid #455049;border-bottom:2px solid #4e5952;border-radius:3px;background:#1a2322;color:#d5d6c7;font:500 .74rem/1.25 "Consolas",monospace}
.hud{position:absolute;inset:0;pointer-events:none;user-select:none}.vitals,.hud-right{position:absolute;top:4%;gap:10px;color:#f8e7bd;text-shadow:0 2px 5px #06100e}.vitals{left:3%;padding:7px 12px 8px 7px;border-left:2px solid #d1a762;background:linear-gradient(90deg,#061715f5,#061715a6 80%,transparent)}.crest{width:39px;height:35px;stroke:none;color:var(--gold)}#health{display:flex;gap:5px;margin:3px 0 4px}#health i{width:10px;height:10px;background:#ffca76;transform:rotate(45deg);border:1px solid #f9d59c;box-shadow:0 0 6px #d8a557}#health i.empty{background:#283734;box-shadow:none;border-color:#637269}#inventory{font:500 .72rem var(--sans);color:#d3d3bf}.hud-right{right:3%;background:#081614bf;border:1px solid #886f4655;border-radius:2px;padding-left:12px;letter-spacing:.09em;font:500 .92rem var(--serif)}.hud-right .icon-button{width:34px;height:32px;pointer-events:auto}
#boss-bar{position:absolute;top:5%;left:50%;width:min(28%,260px);text-align:center;transform:translateX(-50%);color:#ffe7ae;font:600 1rem var(--serif);letter-spacing:.16em;text-shadow:0 2px 3px #000}#boss-bar>div{height:6px;margin-top:5px;border:1px solid #c4a071;background:#191c18}#boss-bar i{display:block;height:100%;background:#db9962;transition:width .12s}
.toast,.interaction{position:absolute;left:50%;transform:translateX(-50%);border:1px solid #b99b67a8;background:#081512ee;box-shadow:0 4px 20px #0005;color:#f4e5c6;font-size:clamp(.8rem,1.1vw,1rem);padding:8px 16px;text-align:center;max-width:85%;width:max-content;line-height:1.5}.toast{top:17%;opacity:0;transition:opacity .22s;letter-spacing:.04em}.toast.visible{opacity:1}.interaction{bottom:7%;pointer-events:none}.interaction kbd{margin-right:6px}
dialog{padding:0;border:1px solid #9a8057;background:linear-gradient(145deg,#1c302b,#0b1818 75%);color:var(--cream);width:min(420px,calc(100vw - 32px));max-height:90dvh;box-shadow:0 20px 80px #000b;border-radius:3px}dialog::backdrop{background:#030a0bbd;backdrop-filter:blur(4px)}.panel-inner{padding:clamp(20px,4vh,35px) 26px;text-align:center}.panel-crest{justify-content:center;gap:15px;color:var(--gold)}.panel-crest svg{width:44px;height:35px;stroke:none}.panel-crest i{height:1px;width:48px;background:linear-gradient(90deg,transparent,#af8e52)}.panel-crest i:last-child{transform:rotate(180deg)}h2{font:600 1.8rem var(--serif);letter-spacing:.12em;margin:12px 0 16px}#panel-copy{font-size:.92rem;line-height:1.7;color:#cccfbf}#panel-copy p{margin:10px 0}#panel-actions{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin-top:19px}#panel-actions button{min-height:42px;padding:0 15px;font-size:.88rem}.guide-list{display:grid;grid-template-columns:auto 1fr;gap:6px 15px;margin:14px 0;text-align:left}.guide-list dt{color:#e5dbbc}.guide-list dd{margin:0;text-align:right}
.touch{display:none;justify-content:space-between;gap:6px;user-select:none;touch-action:none}.touch>div{gap:6px}.touch button{touch-action:none;color:#f7e7bd;border:1px solid #9e967380;border-radius:8px;background:#14211ee6;width:49px;height:49px;display:grid;place-items:center;font-weight:650}.touch button.pressed{background:#8a6933;border-color:#e7c78a}.touch button svg{width:23px;height:23px}
.shell:fullscreen,.shell.expanded{width:100%;max-width:none;background:var(--night);padding:0}.shell.expanded{position:fixed;inset:0;z-index:20;height:100dvh}.shell:is(:fullscreen,.expanded) .topbar{height:48px;padding:0 16px}.shell:is(:fullscreen,.expanded) .screen{height:calc(100dvh - 57px)}.shell:is(:fullscreen,.expanded) .controls{display:none}
@media(pointer:coarse){.touch:not([hidden]){display:flex;padding:8px}.controls{display:none}.shell{justify-content:flex-start}.touch button{width:clamp(39px,10vw,57px)}}
@media(max-width:820px){.shell{padding:0 12px}.topbar{height:58px}.controls{gap:14px;row-gap:7px;padding:13px 0;min-height:54px}.control-title{display:none!important}.screen{height:min(57vw,calc(100svh - 130px))}.title-content{left:6%}h1{font-size:clamp(3.15rem,8.2vw,4.6rem)}.filigree{margin:12px 0}.menu-actions{margin-top:16px}.primary,.secondary{min-height:41px;padding:0 16px;font-size:.86rem}.title-bottom{bottom:5%;font-size:.74rem}.title-bottom small,.title-bottom #save-note{font-size:.67rem}}
@media(max-width:600px) and (orientation:portrait){.shell{padding:0 8px;justify-content:flex-start}.topbar{height:62px;padding:0 5px}.brand{gap:6px}.brand-mark{width:35px;height:29px}.brand b{font-size:.96rem}.brand small{font-size:.52rem}.topbar nav{gap:3px}.lobby{font-size:.8rem}.nav-rule{margin:0 4px}.icon-button{width:31px}.frame{padding:3px}.screen{height: min(76svh,690px);min-height:440px}.title-scene{background-position:75% 10%;background-size:auto 70%;background-color:#081718}.title-scene:before{background:linear-gradient(0deg,#071415 5%,#081616f7 37%,#07161688 54%,transparent 71%)}.title-content{top:auto;bottom:12%;transform:none;left:8%}h1{font-size:clamp(3rem,12.5vw,4.6rem)}.intro{font-size:.86rem}.genre{font-size:.73rem}.latin{font-size:1rem}.filigree{margin:12px 0 8px}.title-bottom{left:8%;right:6%;bottom:4%}.menu-actions{gap:9px}.screen[data-mode=play]{height:auto;aspect-ratio:16/9;min-height:0}.vitals,.hud-right{top:5%;scale:.82}.vitals{transform-origin:left top}.hud-right{transform-origin:right top}.touch:not([hidden]){display:flex;padding:10px 3px}.shell:is(:fullscreen,.expanded) .screen[data-mode=play]{height:auto}.toast,.interaction{font-size:.68rem;padding:4px 7px}.toast{top:29%}}
@media(max-height:570px) and (orientation:landscape){.shell{padding:0 6px}.topbar{height:37px;padding:0 8px}.brand-mark{width:30px;height:26px}.brand b{font-size:.78rem}.brand small{display:none}.icon-button{width:29px;height:28px}.controls{display:none}.screen,.shell:is(:fullscreen,.expanded) .screen{height:calc(100dvh - 46px);min-height:0}.shell:is(:fullscreen,.expanded) .topbar{height:37px}.title-content{left:6%}.genre{font-size:.67rem}.latin{font-size:.85rem}h1{font-size:clamp(2.45rem,11vh,4.5rem)}.filigree{margin:9px 0}.intro{font-size:.78rem;line-height:1.55}.menu-actions{margin-top:12px}.primary,.secondary{min-height:35px;padding:0 14px}.title-bottom{bottom:4%;font-size:.66rem}.title-bottom #save-note,.title-bottom small{font-size:.62rem}.touch:not([hidden]){position:absolute;inset:auto 2% 5%;display:flex;padding:0;pointer-events:none}.touch button{width:45px;height:41px;background:#11211caa;pointer-events:auto}.interaction{bottom:16%}.panel-inner{padding:12px 20px}.panel-crest svg{height:24px}h2{font-size:1.35rem;margin:4px 0 7px}.guide-list{gap:2px}#panel-actions{margin-top:10px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
.map-art{width:100%;height:auto;stroke-width:2;margin:0 0 8px;background:#0a1716;border:1px solid #52635466}
.map-art .map-path{stroke:#627269;stroke-width:2;stroke-dasharray:4 4}.map-art rect{fill:#162824;stroke:#69766c}.map-art .seen rect{fill:#8b784b;stroke:#c3ac78}.map-art .here rect{fill:#e9bd75;stroke:#ffe1a0}.map-art circle{stroke:none;fill:#563b1e}.map-art text{font:15px var(--sans);fill:#a0ac9f;stroke:none}.map-art .here text{fill:#fee3a7}.location-line{color:#ebc57c}
dialog:has(.map-art){width:min(540px,calc(100vw - 32px))}.hud-right{gap:6px}
.local-map{display:block;stroke:none;width:100%;height:auto;background:#101f1c;border-bottom:1px solid #506357}.map-legend{font-size:.72rem;text-align:right;color:#c3bfa5;margin-top:3px}.field-notes{display:none}
.lamp-travel{display:flex;justify-content:center;gap:7px;margin:11px 0}.lamp-travel select{max-width:67%;min-height:36px;color:#e9dec7;border:1px solid #75775e;background:#172825;border-radius:2px;font:inherit;padding:0 6px}.lamp-travel button{min-height:36px;padding:0 10px;font-size:.82rem}
.trail{position:absolute;top:calc(4% + 57px);left:3%;max-width:55%;padding:7px 11px;text-align:left;pointer-events:auto;background:#0b1b18ec;border:1px solid #72806b;border-left:2px solid #e0ba78;border-radius:2px;color:#f5ebd4;text-shadow:0 1px 2px #060c0a}
.trail:hover{border-color:#d3b276}.trail-heading{display:flex;align-items:center;gap:7px;font-size:clamp(.8rem,1vw,1rem);line-height:1.35}.trail-heading>b{font-weight:600}.trail-heading>span{font-size:1.1em;color:#ffe29e}.trail-heading small{margin-left:auto;padding:0 4px;color:#bfd3c4;border:1px solid #4d6959;border-radius:2px;font-size:.67rem}
#trail-detail{display:block;margin:4px 0 0;font-size:clamp(.73rem,.9vw,.88rem);line-height:1.35;color:#dbdfcf}.toast{top:auto;bottom:16%}
.lesson-steps{padding-left:1.5em;text-align:left}.lesson-steps li{padding-left:3px;margin:8px 0}.lesson-steps li::marker{color:#e5bc78}.lesson-steps b,.side-notes b{color:#f1dbaa}
.lesson-diagram{display:block;width:100%;height:auto;max-height:128px;stroke:none;background:linear-gradient(#112428,#1e3731);border:1px solid #41594e}.lesson-terrain{fill:#4c685a;stroke:#92a984;stroke-width:1}.lesson-terrain .moss-bed{fill:#728c61}.lesson-terrain .bell-target{fill:#d4b168;stroke:#ffe7a3}.lesson-arc{stroke:#9ce4cc;stroke-dasharray:3 4;stroke-width:1.5}.lesson-marker,.lesson-moth{color:#f4ca78;fill:#f4ca78;stroke:none}
.side-notes{text-align:left;margin:10px 0 3px;padding:3px 8px;border-top:1px solid #36473b}.side-notes summary{cursor:pointer;color:#e0c890}.side-notes p{font-size:.85rem}
.side-notes section{display:flex;gap:9px;align-items:center;justify-content:space-between}.side-notes section+section{border-top:1px solid #38463b}.side-notes button{background:#1e3630;color:#e6cf9e;padding:6px 9px;border:1px solid #6b7561;border-radius:3px;white-space:nowrap;font-size:.78rem}.side-notes button:disabled{background:transparent;color:#a3ac9c;border-color:#4a554a;cursor:default}.map-art .wanted rect{stroke:#91efcf;stroke-width:3}.map-art .wanted text{fill:#a4ecce}
@media(prefers-reduced-motion:reduce){.lesson-moth{display:none}}
@media(max-width:600px) and (orientation:portrait){
  .trail{top:calc(5% + 41px);max-width:92%;padding:4px 8px}.trail-heading{font-size:.75rem}#trail-detail{font-size:.7rem;margin-top:2px}.toast{top:auto;bottom:17%}
  .touch button[data-action="pogo"]{color:#ffdc94;border-color:#a88e5c}
}
@media(max-width:365px) and (orientation:portrait){.touch>div{gap:3px!important}.touch:not([hidden]){padding-inline:3px!important}.touch button{width:clamp(32px,10vw,36px)!important;min-width:0}}
@media(max-height:570px) and (orientation:landscape){.trail{top:calc(4% + 47px);padding:4px 8px}.trail-heading{font-size:.73rem}#trail-detail{font-size:.68rem}.toast{bottom:27%}.lesson-diagram{max-height:80px}}
.touch button{padding:0;white-space:nowrap}.touch button.locked{color:#8e998a;border-style:dashed}
@media(max-width:600px) and (orientation:portrait){
  .screen[data-mode=play]{aspect-ratio:1/1.02}.screen[data-mode=play] #world{object-fit:cover}
  .touch:not([hidden]){padding:12px 6px}.touch button{width:clamp(38px,10.65vw,57px);height:47px;font-size:.87rem}
  .touch>div{gap:5px}.toast{top:20%}.interaction{bottom:7%}
  .field-notes:not([hidden]){display:block;margin:15px 3px 18px;padding:13px 15px;border:1px solid #3d4e43;border-left:2px solid #a38551;background:#131f1c}.field-notes span{display:flex;align-items:center;gap:8px;font:600 .92rem var(--serif);color:var(--gold)}.field-notes svg{width:16px;height:16px}.field-notes p{margin:9px 0 5px;color:#e9e5d6;font-size:.93rem}.field-notes small{color:#adb5a7}
}

/* Reserve a separate row so instructions never cover the moving character. */
.hint-dock{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:4px 7px;background:#101c19;height:58px;border-bottom:1px solid #526250}
.hint-dock .trail,.hint-dock .toast,.hint-dock .interaction{position:static;transform:none;max-width:none;margin:0;box-shadow:none}
.hint-dock .trail{min-width:0;flex:1;padding:2px 7px;background:transparent;border:0;border-left:2px solid #d6b576}
.hint-dock .trail-heading{justify-content:flex-start}.hint-dock .trail-heading small{margin-left:4px}
.hint-events{max-width:44%;display:grid;align-items:center}.hint-events>*{grid-area:1/1}
.hint-events .toast,.hint-events .interaction{padding:2px 6px;width:auto;line-height:1.25;font-size:.8rem}
.hint-events .toast{visibility:hidden}.hint-events .toast.visible{visibility:visible}.hint-events:has(.toast.visible) .interaction{visibility:hidden}
.screen[data-mode=play]{max-height:calc(100svh - 155px)}
.shell:is(:fullscreen,.expanded) .screen[data-mode=play]{max-height:calc(100dvh - 115px)}
@media(max-height:570px) and (orientation:landscape){.hint-dock{height:40px}.screen[data-mode=play],.shell:is(:fullscreen,.expanded) .screen[data-mode=play]{max-height:calc(100dvh - 88px)}}
@media(max-width:600px) and (orientation:portrait){.hint-dock{height:auto;min-height:56px;flex-wrap:wrap;gap:3px}.hint-events{max-width:100%}.touch:not([hidden]){padding-inline:1px}.touch>div{gap:2px!important}.touch button{width:clamp(30px,10vw,46px)!important}.hint-dock .trail{flex-basis:100%}}
