:root{color-scheme:dark;--ink:#172c38;--paper:#efe4c8;--muted:#b3bfb8;--gold:#e7c48a;--line:#e8dab52b;font-family:Georgia,'Songti SC','Noto Serif CJK SC','Source Han Serif SC',serif;background:#101f31;color:var(--paper)}
*{box-sizing:border-box}html,body{margin:0;width:100%;height:100%;overscroll-behavior:none}body{overflow:hidden}button,a{-webkit-tap-highlight-color:transparent}button{font:inherit;cursor:pointer;color:inherit}button:disabled{cursor:default}a{color:inherit;text-decoration:none}button:focus-visible,a:focus-visible,canvas:focus-visible{outline:2px solid var(--gold);outline-offset:5px}button{touch-action:manipulation}button,[role=button]{min-height:44px}[hidden]{display:none!important}#scene{position:fixed;inset:0;width:100%;height:100%;touch-action:none;outline:none}#scene:focus-visible{outline:2px solid #e7c48a55;outline-offset:-6px}
.topbar{position:fixed;z-index:4;top:max(21px,env(safe-area-inset-top));left:4%;right:4%;display:flex;justify-content:space-between;align-items:center;gap:12px;font-family:system-ui,sans-serif;font-size:11px;letter-spacing:.035em}.top-left{display:flex;align-items:center;gap:22px}.top-left a{display:inline-flex;align-items:center;min-height:44px;border-bottom:1px solid var(--line)}.brand{opacity:.56;letter-spacing:.14em}.top-actions{display:flex;gap:7px}.top-actions button{background:transparent;border:1px solid transparent;border-radius:30px;padding:0 13px;font-size:11px}.top-actions button:hover{border-color:var(--line);background:#e5d5b609}#language{border-color:var(--line);min-width:44px}#menu{border-color:var(--line)}
.masthead{position:absolute;z-index:2;left:7.2%;right:6%;top:105px;pointer-events:none}.edition{font:10px/1.6 system-ui,sans-serif;letter-spacing:.23em;color:var(--gold);margin:0 0 17px}.masthead h1{font-size:clamp(27px,4vw,44px);font-weight:400;letter-spacing:.08em;line-height:1.35;margin:0 0 14px;text-wrap:balance}.masthead .subtitle{font-size:13px;line-height:1.8;letter-spacing:.05em;margin:0;max-width:510px;color:#c7c8bb}.english-title{font:9px/1.7 system-ui,sans-serif;letter-spacing:.23em;opacity:.32;margin-top:18px}html[data-language=en] .masthead h1{letter-spacing:-.025em;font-size:clamp(26px,3.8vw,44px)}html[data-language=en] .english-title{display:none}
.speech{position:fixed;z-index:3;width:246px;pointer-events:none;filter:drop-shadow(0 5px 12px #08172224);padding:12px 15px;background:#e9dfbd;color:#2b454c;border-radius:3px 8px 4px 8px;font-size:13px;line-height:1.7}.speech::after{content:"";position:absolute;left:var(--tail,50%);bottom:-8px;width:0;height:0;border-left:6px solid transparent;border-right:2px solid transparent;border-top:9px solid #e9dfbd}.speech small{display:block;font:9px/1.3 system-ui,sans-serif;letter-spacing:.15em;color:#737665;margin-bottom:4px}.speech p{margin:0}
.controls{position:fixed;z-index:4;bottom:max(20px,env(safe-area-inset-bottom));left:5%;right:5%;display:flex;align-items:center;flex-direction:column;pointer-events:none}.hint{font-size:13px;color:#d6d7c5;letter-spacing:.045em;line-height:1.7;text-align:center;margin:0 0 14px;max-width:610px;text-wrap:balance;text-shadow:0 2px 8px #102732}.control-row{display:flex;align-items:center;justify-content:center;gap:14px;width:100%;max-width:610px}.control-row button{pointer-events:auto;min-height:51px;border:1px solid #ddd8b441;border-radius:6px;background:#142f3bde;box-shadow:0 3px 20px #0a233629;backdrop-filter:blur(10px);transition:background .15s}.control-row button:hover,.control-row button.held{background:#315059}.move-controls{display:flex;gap:6px}.move-controls button{width:48px;font:22px Georgia,serif;touch-action:none;user-select:none}.action{padding:8px 17px;min-width:240px;display:flex;align-items:center;justify-content:center;gap:15px;color:#f1dbac!important}.action:disabled{color:#a0aca4!important;background:#14303ba8;box-shadow:none}.action span{font-size:13px;letter-spacing:.025em}.action small{font:10px/1.5 system-ui,sans-serif;color:#adbbad;white-space:nowrap}.jump{padding:6px 14px;min-width:94px;display:flex;align-items:center;gap:8px}.jump b{font:22px Georgia,serif;font-weight:400}.jump span{font-size:12px}.controls-hint{font:10px/1.5 system-ui,sans-serif;opacity:.48;letter-spacing:.05em;margin:10px 0 0}.narration{position:fixed;z-index:3;left:20%;right:20%;bottom:184px;text-align:center;opacity:0;font-size:14px;line-height:1.85;color:#f0d6a8;text-wrap:balance;text-shadow:0 2px 10px #15303e;transition:opacity .25s;pointer-events:none}.narration.is-visible{opacity:1}.after-tools{position:fixed;right:4%;bottom:160px;z-index:4;max-width:220px;text-align:right}.after-tools button{font-size:11px;letter-spacing:.08em;background:transparent;border:0;border-bottom:1px solid #dfc39255;padding:8px 0;color:var(--gold)}.after-tools p{color:#b2bdb2;font:10px/1.7 system-ui,sans-serif;max-width:180px}.storage-warning{position:fixed;z-index:8;bottom:4px;left:5%;right:5%;font:11px/1.5 system-ui,sans-serif;background:#122a35f0;color:#ebcf9a;padding:8px;text-align:center}
.dialog{border:1px solid #ddceb666;background:#efe5cc;color:var(--ink);padding:35px 32px 29px;border-radius:5px;max-width:470px;width:calc(100% - 36px);max-height:calc(100dvh - 45px);overflow-y:auto;box-shadow:0 25px 80px #03151c99}.dialog::backdrop{background:#0c1c29b5;backdrop-filter:blur(7px)}.dialog-mark{font:10px/1.6 system-ui,sans-serif;color:#687d77;letter-spacing:.22em;margin:0 0 12px}.dialog h2{font-weight:400;font-size:25px;line-height:1.5;letter-spacing:.025em;margin:0 0 21px}.dialog button,.dialog a.next{border:1px solid #57726a44;background:transparent;border-radius:3px;padding:12px 14px;text-align:left;width:100%;margin-top:9px;line-height:1.6;font-size:13px;color:#25404a}.dialog button:hover,.dialog a.next:hover{background:#ddd7bd}.dialog .primary{background:#294a54;color:#f1e0bc;border-color:#294a54}.dialog .primary:hover{background:#365f68}.dialog p:not(.dialog-mark){font-size:13px;line-height:1.9}.dialog .quiet{font-size:10px!important;opacity:.65;margin-bottom:0}.dialog .danger{border-color:#97665177;color:#714432}.dialog:focus-visible{outline:0}.places{display:grid;grid-template-columns:1fr 1fr;gap:6px}.places button{font-size:12px;min-height:52px;margin-top:0}.dialog .next{display:block;background:#294a54!important;color:#f1e0bc!important}.postcard-heading{font-size:20px!important;color:#375951;margin-top:26px}.postcard-text{white-space:pre-line;line-height:2.2!important}.postcard-rule{width:45px;border:0;border-top:1px solid #708c8088;margin:25px 0}.fallback{position:fixed;z-index:9;inset:20% 10%;max-width:600px;padding:30px;background:#172f3f;border:1px solid var(--line);font-size:16px;line-height:2}.fallback a{display:inline-block;border-bottom:1px solid var(--gold);margin-top:20px}.no-script{position:fixed;z-index:10;inset:25% 8%;background:#172f3f;padding:28px;line-height:1.8}
@media(min-width:1100px){.masthead{top:115px}.controls{bottom:26px}.hint{margin-bottom:17px}.after-tools{bottom:76px}.narration{bottom:183px}}
@media(max-width:680px){.topbar{left:18px;right:18px;top:max(12px,env(safe-area-inset-top));font-size:10px}.brand{display:none}.top-actions{gap:2px}.top-actions button{padding:0 10px;font-size:10px}.masthead{left:25px;right:22px;top:89px}.edition{font-size:9px;margin-bottom:14px}.masthead h1{font-size:29px;letter-spacing:.08em;margin-bottom:11px}.masthead .subtitle{font-size:12px;max-width:282px;line-height:1.8}.english-title{font-size:8px;letter-spacing:.16em;margin-top:13px}.speech{font-size:12px;padding:9px 13px;line-height:1.7}.controls{left:18px;right:18px;bottom:max(16px,env(safe-area-inset-bottom))}.control-row{gap:9px;flex-wrap:wrap}.action{order:-1;width:100%;min-height:45px!important;max-width:320px}.move-controls{margin-right:auto}.jump{margin-left:auto;min-width:100px}.move-controls button{width:56px;min-height:49px}.jump{min-height:49px!important}.hint{font-size:11px;max-width:310px;line-height:1.6;margin-bottom:9px}.controls-hint{font-size:8px;letter-spacing:0;margin:7px 0 0}.narration{left:27px;right:27px;bottom:220px;font-size:12px;line-height:1.7;margin:0}.after-tools{left:24px;right:auto;bottom:177px;max-width:300px}.after-tools p{display:none}.after-tools button{font-size:10px;min-height:34px}.dialog{padding:25px 23px}.dialog h2{font-size:22px}html[data-language=en] .masthead h1{max-width:315px;font-size:29px}html[data-language=en] .hint{font-size:10px}html[data-language=en] .action span{font-size:12px}}
@media(max-height:600px) and (min-width:600px){.topbar{top:6px}.masthead{top:65px;left:4%}.masthead h1{font-size:23px;margin-bottom:5px}.masthead .subtitle{max-width:300px;font-size:11px}.edition{margin-bottom:8px}.english-title{display:none}.controls{bottom:10px}.hint{font-size:11px;margin-bottom:6px}.controls-hint{display:none}.control-row button{min-height:43px}.narration{bottom:112px;font-size:12px}.after-tools{bottom:80px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}html[data-reduced-motion=true] *{transition:none!important}

/* Storage failures must not cover the two-thumb controls. */
.storage-warning{bottom:0;margin:0;padding:2px 8px;font-size:9px;line-height:1.3;pointer-events:none}

/* A jump must remain a game input while the other thumb is walking. */
.control-row button{touch-action:none;user-select:none}

/* Story-scale view: captions belong to the scene; controls only contain verbs. */
.topbar { z-index: 8; }
.masthead { transition: opacity .3s; }
body.reading .masthead { top: 87px; }
body.reading .masthead h1 { font-size: 23px; margin: 0; }
body.reading .edition { margin-bottom: 5px; font-size: 9px; }
body.reading .subtitle, body.reading .english-title { display: none; }
.hint { position: fixed; top: 152px; left: 7.2%; right: auto; width: min(430px, 85.6%); margin: 0; text-align: left; font: 14px/1.8 system-ui,sans-serif; color: #ede5cf; letter-spacing: 0; text-wrap: pretty; }
body:not(.reading) .hint { top: 270px; }
.speech, .narration { width: min(290px, calc(100vw - 32px)); font-size: 15px; line-height: 1.75; box-shadow: 0 8px 28px #05182635; }
.narration { right: auto; bottom: auto; margin: 0; padding: 12px 16px; background: #182f39f2; border: 1px solid #e8d2a967; border-radius: 8px; color: #f5e6bd; text-align: left; text-shadow: none; }
.scene-guide { position: fixed; z-index: 5; transform: translateX(-50%); max-width: min(260px, calc(100vw - 40px)); min-height: 44px; display: flex; gap: 9px; align-items: center; padding: 10px 15px; border: 1px solid #e6c992a6; border-radius: 24px; background: #17343eec; box-shadow: 0 4px 22px #05232c38; color: #f7e1b5; font: 13px/1.5 system-ui,sans-serif; text-align: left; }
.scene-guide:hover { background: #355660; }
.scene-guide:disabled { opacity: .7; }
#guideArrow { font-size: 18px; }
.chapter-end { position: fixed; z-index: 6; right: 4%; top: 190px; width: 280px; padding: 22px; border-top: 1px solid #e0c28c88; background: #102c35ed; border-radius: 5px; box-shadow: 0 15px 40px #09212c29; }
.chapter-end p { margin: 0; }
#endHeading { color: #f4d5a4; font-size: 18px; line-height: 1.65; }
#endLine { margin: 8px 0 16px; color: #d1d6c4; font-size: 13px; line-height: 1.75; }
.chapter-next { display: block; padding: 13px 15px; min-height: 48px; background: #e4c694; color: #243e46; border-radius: 4px; font: 13px/1.65 system-ui,sans-serif; }
#endMap { display: inline-flex; align-items: center; min-height: 44px; font-size: 12px; color: #cbd1c3; text-decoration: underline; text-underline-offset: 4px; }
body.has-ending .hint { visibility: hidden; }
.after-tools { bottom: 135px; }
@media(max-width:679px) {
  .top-actions { gap: 1px; } .top-actions button { padding: 0 8px; font-size: 10px; }
  #cameraToggle { max-width: 96px; }
  body.reading .masthead { top: 84px; left: 22px; }
  body.reading .masthead h1, html[data-language=en] body.reading .masthead h1 { font-size: 19px; }
  .hint { top: 138px; left: 22px; width: calc(100% - 44px); font-size: 13px; line-height: 1.65; }
  html[data-language=en] .hint { font-size: 12px; }
  body:not(.reading) .hint { top: 235px; }
  .speech, .narration { width: min(280px, calc(100vw - 32px)); font-size: 14px; padding: 11px 14px; }
  .controls { bottom: max(15px,env(safe-area-inset-bottom)); }
  .scene-guide { font-size: 12px; padding: 9px 13px; max-width: 255px; }
  .chapter-end { top: 143px; right: 22px; left: 22px; width: auto; padding: 13px 16px 5px; }
  #endHeading { font-size: 16px; } #endLine { margin: 4px 0 9px; font-size: 12px; }
  .chapter-next { min-height: 44px; padding: 10px 12px; font-size: 12px; }
  #endMap { font-size: 11px; }
  .after-tools { bottom: 145px; left: 22px; }
}
@media(max-height:540px) {
  body.reading .masthead { top: 55px; } body.reading .masthead h1 { font-size: 17px; }
  body.reading .edition { display: none; }
  .hint, body:not(.reading) .hint { top: 82px; font-size: 11px; width: 280px; }
  .speech, .narration { width: 250px; padding: 8px 11px; font-size: 12px; }
  .chapter-end { top: 80px; padding: 12px; width: 240px; }
  #endHeading { font-size: 15px; } #endLine { font-size: 11px; margin: 4px 0 8px; }
  .after-tools { bottom: 72px; }
}

.control-row .action.charging{background:linear-gradient(90deg,#796947 var(--charge),#142f3b var(--charge));border-color:#e7c48a}
