/* 我和三毛的一天 · visitor app — paper, ink lines, yellow and blue (张乐平 ink comics).
   Loaded after /shared/tokens.css and /shared/world.css: re-skins their components and adds the stage UI. */

@font-face { font-family: "SerifBlack"; src: url("/assets/fonts/serif-black.woff2?v=7") format("woff2"); font-display: swap; }
@font-face { font-family: "SerifSemi"; src: url("/assets/fonts/serif-semibold.woff2?v=7") format("woff2"); font-display: swap; }
@font-face { font-family: "WenKai"; src: url("/assets/fonts/wenkai.woff2?v=7") format("woff2"); font-display: swap; }
@font-face { font-family: "WenKaiM"; src: url("/assets/fonts/wenkai-medium.woff2?v=7") format("woff2"); font-display: swap; }

:root {
  --paper: #F9F5D8;
  --paper-2: #F2EACB;
  --paper-3: #E9DFB8;
  --card: #FFFDF3;
  --ink: #1E2230;
  --ink-2: #3A4256;
  --muted: #6E7486;
  --ink-4: #A9ADB8;
  --line: rgba(30, 34, 48, .14);
  --line-strong: rgba(30, 34, 48, .32);
  --sun: #F2E44F;
  --sun-soft: #F8F0A0;
  --sun-deep: #E2C93A;
  --sky: #4681BD;
  --sky-soft: #DCE8F4;
  --sky-deep: #2C5D93;
  --brick: #C8473A;
  --brick-soft: #F4D6D0;
  --leaf: #4E9A78;
  --leaf-soft: #D8EDDF;
  --ochre: #C98A3C;
  --f-title: "SerifBlack", "Sanmao Serif", "Noto Serif SC", "Songti SC", serif;
  --serif: "SerifSemi", "Sanmao Serif", "Noto Serif SC", "Songti SC", serif;
  --sans: "WenKai", "LXGW WenKai", "Kaiti SC", "STKaiti", -apple-system, "PingFang SC", sans-serif;
  --hand-m: "WenKaiM", "WenKai", "LXGW WenKai", "Kaiti SC", serif;
  --shadow-1: 2px 2px 0 rgba(70, 129, 189, .55);
  --shadow-2: 3px 3px 0 var(--sky), 0 10px 28px rgba(30, 34, 48, .12);
  /* hierarchy: the bold ink outline + blue offset is reserved for the one primary action; everything else is paper */
  --glass: rgba(255, 253, 243, .86);
  --hair: rgba(30, 34, 48, .1);
  --lift-1: 0 1px 2px rgba(30, 34, 48, .06), 0 4px 14px rgba(30, 34, 48, .08);
  --lift-2: 0 2px 6px rgba(30, 34, 48, .05), 0 16px 40px rgba(30, 34, 48, .14);
  --blur: saturate(1.3) blur(14px);
  --ease: cubic-bezier(.2, .9, .25, 1);
  --ease-out-back: cubic-bezier(.34, 1.56, .64, 1);
  --r-m: 14px;
  --r-l: 18px;
}

html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; }
body { background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 15px; touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
h1, h2, h3, .title { font-family: var(--f-title); font-weight: 400; letter-spacing: .06em; }
b, strong { font-weight: 700; }
img { -webkit-user-drag: none; }

/* ---- layers ------------------------------------------------------------------------------------ */
.app { position: fixed; inset: 0; overflow: hidden; background: var(--paper); isolation: isolate; }
#stage, #stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#stage { z-index: 0; }
#stage canvas { touch-action: none; outline: none; }
.world-host { position: absolute; inset: 0; z-index: 1; }
.world-host:empty { display: none; }
#labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
#labels > * { pointer-events: auto; }
.screen-host { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
#boot-title { position: absolute; inset: 0; z-index: 4; }
.screen-host > .screen { position: absolute; inset: 0; pointer-events: auto; }
.screen-host > .screen.table, .screen-host > .screen.greet, .screen-host > .screen.complete, .screen-host > .screen.roam { pointer-events: none; }
.screen-host > .screen.table > *, .screen-host > .screen.greet > *, .screen-host > .screen.complete > *, .screen-host > .screen.roam > * { pointer-events: auto; }
#ui { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
#fx { position: absolute; inset: 0; z-index: 7; pointer-events: none; overflow: hidden; }
#desk { display: none; }
.scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ---- shared components, re-skinned --------------------------------------------------------------- */
.btn {
  --bg: var(--sky); --fg: #fff; --bd: var(--ink); --sh: var(--ink);
  position: relative; min-height: 48px; padding: 0 20px; border-radius: 16px; border: 2px solid var(--bd);
  background: var(--bg); color: var(--fg); box-shadow: 3px 3px 0 var(--sh);
  font-family: var(--serif); font-weight: 400; font-size: 16px; letter-spacing: .05em;
  transition: transform .14s var(--ease), box-shadow .14s var(--ease), background .2s, opacity .2s;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--sh); }
.btn.sun { --bg: var(--sun); --fg: var(--ink); --sh: var(--sky); }
.btn.light { --bg: rgba(255, 253, 243, .92); --fg: var(--ink); border: 1px solid rgba(30, 34, 48, .16); box-shadow: var(--lift-1); }
.btn.light:active { transform: translateY(1px) scale(.99); box-shadow: 0 1px 2px rgba(30, 34, 48, .08); }
.btn.ghost { --bg: transparent; --fg: var(--ink-2); --bd: rgba(30, 34, 48, .35); box-shadow: none; border-width: 1.5px; }
.btn.ghost:active { transform: translateY(1px); }
.btn.brick { --bg: var(--brick); --fg: #fff; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 12px; box-shadow: 2px 2px 0 var(--sh); }
.btn.ghost.small { box-shadow: none; }
.btn.light.small { box-shadow: var(--lift-1); }
.btn.icon { width: 44px; min-height: 44px; padding: 0; border-radius: 14px; }
.btn.big { min-height: 56px; font-size: 18px; font-family: var(--f-title); letter-spacing: .08em; }
.btn svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn .arrow { transition: transform .3s var(--ease-out-back); }
.btn:hover .arrow { transform: translateX(4px); }
.btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.pulse { animation: btn-pulse 1.2s ease-in-out 3; }
@keyframes btn-pulse { 50% { box-shadow: 0 0 0 6px rgba(242, 228, 79, .65), 3px 3px 0 var(--sh); } }
.link-btn { color: var(--ink-2); font-family: var(--sans); text-decoration-color: rgba(30, 34, 48, .3); }

.chip {
  height: 28px; padding: 0 11px; gap: 5px; border-radius: 999px; font-family: var(--serif); font-weight: 400; font-size: 12.5px;
  background: var(--card); color: var(--ink-2); border: 1.2px solid rgba(30, 34, 48, .45);
}
.chip svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.chip { border: 1px solid rgba(30, 34, 48, .14); }
button.chip { color: var(--ink); background: rgba(255, 253, 243, .94); box-shadow: var(--lift-1); transition: transform .15s, box-shadow .15s, opacity .2s; }
button.chip:active { transform: translateY(1px) scale(.97); box-shadow: none; }
button.chip[disabled] { opacity: .4; pointer-events: none; }
.chip.ink { background: var(--ink); color: var(--card); border-color: var(--ink); }
.chip.sun { background: var(--sun); color: var(--ink); border-color: var(--ink); }
.chip.sky { background: var(--sky-soft); color: var(--sky-deep); border-color: rgba(70, 129, 189, .6); }
.chip.brick { background: var(--brick-soft); color: #8E2E24; border-color: rgba(200, 71, 58, .5); }
.chip.leaf { background: var(--leaf-soft); color: #2D6A4F; border-color: rgba(78, 154, 120, .5); }

/* content labels: colour + shape (史料 ■ / 体验改编 ● / 剧情演绎 ▲ / 示例作品 ◆ / 交互示意 ⬡) */
.label { height: 21px; padding: 0 7px 0 6px; gap: 4px; border-radius: 6px; font-family: var(--serif); font-weight: 400; font-size: 11px; letter-spacing: .04em; border: 1.2px solid currentColor; background: rgba(255, 253, 243, .92); }
.label::after { content: none; }
.label::before { content: ""; width: 8px; height: 8px; flex: none; background: currentColor; }
.label[data-kind="史料"] { color: var(--sky-deep); }
.label[data-kind="史料"]::before { border-radius: 1px; }
.label[data-kind="体验改编"] { color: #8A6D0E; background: var(--sun-soft); }
.label[data-kind="体验改编"]::before { border-radius: 50%; }
.label[data-kind="剧情演绎"] { color: var(--brick); }
.label[data-kind="剧情演绎"]::before { clip-path: polygon(50% 0, 100% 100%, 0 100%); width: 9px; }
.label[data-kind="示例作品"] { color: var(--ochre); }
.label[data-kind="示例作品"]::before { transform: rotate(45deg) scale(.82); }
.label[data-kind="交互示意"] { color: #5B6CB8; }
.label[data-kind="交互示意"]::before { clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }

.card { background: var(--card); border: 1px solid var(--hair); border-radius: var(--r-l); box-shadow: var(--lift-1); padding: 14px; }
.card.soft { border: 1px solid var(--hair); box-shadow: none; background: rgba(242, 234, 203, .35); }
.paper-card {
  position: relative; background: var(--card); border: 1px solid var(--hair); border-radius: 24px; box-shadow: var(--lift-2);
  background-image: radial-gradient(rgba(201, 138, 60, .05) 1px, transparent 1px); background-size: 6px 6px;
}

.scrim { background: rgba(30, 34, 48, .3); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet {
  background: var(--card); border-top: 0; border-radius: 26px 26px 0 0; box-shadow: 0 -10px 40px rgba(30, 34, 48, .18);
  padding: 8px 18px calc(20px + var(--safe-b)); scrollbar-width: none;
  background-image: radial-gradient(rgba(201, 138, 60, .045) 1px, transparent 1px); background-size: 6px 6px;
}
.sheet::-webkit-scrollbar { display: none; }
.sheet .grip { background: rgba(30, 34, 48, .2); margin: 2px auto 10px; }
.sheet .sheet-title h2 { font-size: 20px; letter-spacing: .08em; }
.sheet h4 { margin: 14px 0 8px; font-family: var(--serif); font-weight: 400; font-size: 13px; color: var(--sky); letter-spacing: .2em; }
.toasts { top: calc(var(--safe-t) + 74px); }
.toast { border-radius: 999px; padding: 9px 16px; background: rgba(30, 34, 48, .92); color: var(--card); box-shadow: var(--lift-2); font-size: 14px; backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.toast.warn { background: var(--brick); }
.toast.ok { background: var(--sky-deep); }
.input { border: 1px solid rgba(30, 34, 48, .2); border-radius: 12px; background: #fff; font-family: var(--sans); }
.input:focus { border-color: var(--sky); box-shadow: 0 0 0 3px rgba(70, 129, 189, .22); }
.switch span { background: var(--paper-3); }
.switch input:checked + span { background: var(--sky); }
:focus-visible { outline-color: var(--sky); }

.sources { margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.sources summary { cursor: pointer; color: var(--muted); font-size: 12.5px; font-family: var(--serif); }
.sources ul { margin: 8px 0 0; padding-left: 18px; }
.sources li { margin: 6px 0; }
.sources a { color: var(--sky-deep); }
.sources p { margin: 3px 0 0; }

/* the screens' hint bubble (docked above the bottom bar) */
.bubble {
  position: absolute; left: 16px; right: 16px; bottom: calc(var(--safe-b) + var(--task-h, 0px) + 14px); z-index: 6; margin: 0 auto; max-width: 380px;
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 18px;
  background: var(--glass); border: 1px solid var(--hair); box-shadow: var(--lift-2); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  font-family: var(--hand-m); font-size: 15.5px; line-height: 1.5;
  opacity: 0; transform: translateY(10px); transition: opacity .25s var(--ease), transform .45s var(--ease), bottom .4s var(--ease); pointer-events: auto;
}
.bubble::before { content: "三毛"; flex: none; align-self: flex-start; font-family: var(--f-title); font-size: 12px; letter-spacing: .1em; color: #fff; background: var(--sky); border-radius: 6px; padding: 1px 6px; margin-top: 2px; }
.bubble.in { opacity: 1; transform: none; }
.bubble.ok { background: rgba(248, 240, 160, .94); }
.bubble > span { flex: 1; }
.hunt .bubble { bottom: calc(var(--safe-b) + 150px); }
.draw-stage .bubble { left: 8px; right: 8px; bottom: 8px; font-size: 14px; padding: 8px 12px; }
.greet .bubble { bottom: calc(var(--safe-b) + var(--task-h, 0px) + 54px); }
.hall .bubble { bottom: 34px; }

/* ---- loader, busy veil, fatal -------------------------------------------------------------------- */
#loader { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: var(--paper); transition: opacity .9s ease, visibility .9s; }
#loader.done { opacity: 0; visibility: hidden; pointer-events: none; }
.ld-inner { position: relative; width: 74%; max-width: 320px; text-align: center; }
.ld-drop { position: relative; height: 90px; }
.ld-drop span { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px; border-radius: 50%; background: var(--ink); animation: ink-drop 2.4s infinite cubic-bezier(.2, .7, .3, 1); }
.ld-drop span:nth-child(2) { animation-delay: .8s; background: var(--sky); }
.ld-drop span:nth-child(3) { animation-delay: 1.6s; background: var(--sun-deep); }
@keyframes ink-drop {
  0% { transform: translateY(-40px) scale(.4); opacity: 0; }
  25% { transform: translateY(0) scale(.6); opacity: 1; }
  100% { transform: translateY(0) scale(4.2, 1.2); opacity: 0; filter: blur(2px); }
}
.ld-brush { width: 100%; height: 34px; overflow: visible; }
.ld-brush path { fill: none; stroke-linecap: round; }
.ld-track { stroke: rgba(30, 34, 48, .08); stroke-width: 9; }
.ld-ink { stroke: var(--ink); stroke-width: 9; stroke-dasharray: 300; stroke-dashoffset: 300; transition: stroke-dashoffset .4s var(--ease); }
.ld-text { margin: 16px 0 2px; font-family: var(--serif); font-size: 16px; letter-spacing: .12em; }
.ld-pct { display: inline-block; min-width: 2.2em; text-align: right; color: var(--sky); font-variant-numeric: tabular-nums; }
.ld-sub { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: .1em; }
.ld-sub span { display: inline-block; white-space: nowrap; }

.veil { position: absolute; inset: 0; z-index: 9; display: grid; place-content: center; justify-items: center; gap: 12px; background: rgba(249, 245, 216, .72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.veil-ink { position: relative; width: 60px; height: 60px; }
.veil-ink i { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px; border-radius: 50%; background: var(--ink); animation: ink-drop 1.8s infinite cubic-bezier(.2, .7, .3, 1); }
.veil-ink i:nth-child(2) { animation-delay: .6s; background: var(--sky); }
.veil-ink i:nth-child(3) { animation-delay: 1.2s; background: var(--sun-deep); }
.veil-text { margin: 0; font-family: var(--serif); font-size: 15px; letter-spacing: .1em; }
.fatal { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: var(--paper); }
.fatal-card { padding: 22px 20px; display: grid; gap: 12px; text-align: center; max-width: 340px; }

/* ---- HUD: slim top bar + one task card ---------------------------------------------------------- */
.hud { position: absolute; inset: 0; pointer-events: none; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; position: relative; padding: 0;
  background: transparent; border: 0; color: var(--ink); transition: background .15s, transform .15s;
}
.icon-btn:active { background: rgba(30, 34, 48, .07); transform: scale(.94); }
.icon-btn svg { width: 21px; height: 21px; stroke: var(--ink); stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 11px; }
.icon-btn.sm svg { width: 19px; height: 19px; }
.icon-btn.off svg { stroke: var(--muted); }
.icon-btn .badge {
  position: absolute; right: 1px; top: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--sun); color: var(--ink); font-size: 10.5px; line-height: 15px; font-family: var(--serif); border: 1px solid var(--ink);
}
.badge.bump { animation: bump .5s var(--ease-out-back); }
@keyframes bump { 0% { transform: scale(.4); } 70% { transform: scale(1.3); } 100% { transform: scale(1); } }
.burger, .burger::before, .burger::after { display: block; width: 16px; height: 1.8px; background: var(--ink); border-radius: 1px; position: relative; content: ""; }
.burger::before { position: absolute; top: -5px; }
.burger::after { position: absolute; top: 5px; }

.hud-top {
  position: absolute; left: 12px; right: 12px; top: calc(var(--safe-t) + 10px); max-width: 480px; height: 54px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px; padding: 0 6px 0 10px; pointer-events: auto;
  border-radius: 18px; background: var(--glass); border: 1px solid var(--hair); box-shadow: var(--lift-1);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  transform: translateY(-140%); transition: transform .7s var(--ease);
}
.hud.on .hud-top { transform: none; }
.hud-top.pulse .ch-seal { animation: seal-stamp .7s var(--ease-out-back); }
.ch-seal {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 7px;
  background: var(--brick); color: #FFF6EA; font-family: var(--f-title); font-size: 18px; line-height: 1;
  box-shadow: inset 0 0 0 1.5px rgba(255, 246, 234, .55), inset 0 0 0 3px var(--brick), inset 0 0 0 4px rgba(255, 246, 234, .45);
  transform: rotate(-4deg);
}
@keyframes seal-stamp { 0% { transform: rotate(-4deg) scale(1.9); opacity: 0; } 60% { transform: rotate(-4deg) scale(.9); opacity: 1; } 100% { transform: rotate(-4deg) scale(1); } }
.ch-meta { flex: 1; min-width: 0; display: grid; gap: 1px; }
.ch-line { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; overflow: hidden; }
.ch-name { font-family: var(--serif); font-size: 11px; color: var(--sky); letter-spacing: .06em; flex: none; }
.ch-title { font-family: var(--f-title); font-weight: 400; font-size: 16px; letter-spacing: .06em; overflow: hidden; text-overflow: ellipsis; }
.ch-place { display: flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.ch-place svg { width: 11px; height: 11px; stroke: var(--brick); fill: none; stroke-width: 2.2; flex: none; }
.ch-place span { overflow: hidden; text-overflow: ellipsis; }
.ch-right { display: flex; align-items: center; gap: 0; }
.day-track { position: absolute; left: 20px; right: 20px; bottom: 0; height: 2px; border-radius: 1px; overflow: hidden; pointer-events: none; background: rgba(30, 34, 48, .06); }
.day-fill { display: block; height: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--sun-deep), var(--sun) 55%, var(--sky)); transition: transform 1.2s var(--ease); }
.hud-offline { position: absolute; left: 50px; top: calc(100% + 6px); padding: 2px 9px; border-radius: 999px; font-size: 11px; background: var(--brick-soft); color: #8E2E24; }
.hud-offline[hidden] { display: none; }
.hud-book.glow { animation: book-glow 1s var(--ease); }
@keyframes book-glow { 0% { box-shadow: 0 0 0 0 rgba(242, 228, 79, 1); transform: scale(1.15); } 100% { box-shadow: 0 0 0 16px rgba(242, 228, 79, 0); transform: scale(1); } }

.hud-task {
  position: absolute; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 12px); max-width: 480px; margin: 0 auto;
  padding: 11px 14px 14px; border-radius: 22px; pointer-events: auto;
  background: var(--glass); border: 1px solid var(--hair); box-shadow: var(--lift-2);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  opacity: 0; visibility: hidden; transform: translateY(24px);
  transition: opacity .35s var(--ease), transform .6s var(--ease), visibility 0s .6s;
}
.hud.on .hud-task.show { opacity: 1; visibility: visible; transform: none; transition: opacity .35s var(--ease), transform .6s var(--ease), visibility 0s; }
.tk-row { display: flex; align-items: center; gap: 8px; min-height: 22px; font-family: var(--serif); font-size: 11.5px; color: var(--sky-deep); letter-spacing: .05em; }
.hud-dots { display: flex; gap: 3px; list-style: none; margin: 0; padding: 0; flex: none; }
.hud-dots li { width: 6px; height: 6px; border-radius: 3px; background: rgba(30, 34, 48, .14); transition: background .4s, width .4s var(--ease); }
.hud-dots li.done { background: var(--sky); }
.hud-dots li.now { width: 16px; background: var(--sun-deep); }
.tk-step { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-right { display: flex; align-items: center; gap: 3px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.tk-right > svg { width: 13px; height: 13px; stroke: var(--sun-deep); fill: none; stroke-width: 2.2; }
.tk-help { display: inline-flex; align-items: center; gap: 3px; margin-left: 8px; height: 24px; padding: 0 9px 0 6px; border-radius: 999px; border: 1px solid var(--hair); background: rgba(255, 255, 255, .55); font: inherit; color: var(--ink-2); letter-spacing: .04em; }
.tk-help:active { background: rgba(30, 34, 48, .06); }
.tk-help svg { width: 14px; height: 14px; stroke: var(--sky); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.task-t { margin: 7px 2px 0; font-family: var(--hand-m); font-size: 17px; line-height: 1.5; color: var(--ink); text-wrap: pretty; }
.task-t:empty { display: none; }
.task-t.flash { animation: task-in .7s var(--ease); }
@keyframes task-in { from { opacity: 0; transform: translateY(6px); filter: blur(2px); } }
.prompt-extra:empty, .task-main:empty { display: none; }
.task-main { margin-top: 12px; }
.task-btn { min-height: 50px; opacity: 0; transform: translateY(8px); transition: opacity .35s, transform .5s var(--ease), box-shadow .14s; }
.task-btn.in { opacity: 1; transform: none; }
.task-btn.in:active { transform: translateY(1px) scale(.99); }
.task-btn svg:not(.arrow) { display: none; }

/* which parts of the HUD each screen wants */
[data-screen="newspaper"] .hud-task, [data-screen="draw"] .hud-task, [data-screen="hall"] .hud-task { display: none; }
/* hunt & finale: the task is a slim caption under the top bar, out of the way of the scene's own controls */
[data-screen="hunt"] .hud-task, [data-screen="complete"] .hud-task {
  top: calc(var(--safe-t) + 74px); bottom: auto; left: 50%; right: auto; width: max-content; max-width: calc(100% - 40px);
  padding: 7px 16px 8px; border-radius: 999px; transform: translate(-50%, -10px);
}
[data-screen="hunt"] .hud.on .hud-task.show, [data-screen="complete"] .hud.on .hud-task.show { transform: translate(-50%, 0); }
[data-screen="hunt"] .tk-row, [data-screen="complete"] .tk-row, [data-screen="hunt"] .task-main, [data-screen="complete"] .task-main { display: none; }
[data-screen="hunt"] .task-t, [data-screen="complete"] .task-t { margin: 0; font-size: 14.5px; text-align: center; }
.hud-flags, .hud-mode { display: none; }

/* ---- stage overlays: anchored labels, pins, speech, cards, wipes -------------------------------- */
.anchored { position: absolute; left: 0; top: 0; translate: -50% -50%; opacity: 0; scale: .6; transition: opacity .3s, scale .45s var(--ease-out-back); will-change: transform; }
.anchored.in { opacity: 1; scale: 1; }
.anchored.off { opacity: 0 !important; pointer-events: none !important; }
.anchored.out { opacity: 0 !important; scale: .7; pointer-events: none !important; }

.pin.stage-pin { margin: 0; }
.pin-dot { background: var(--card); border: 2px solid var(--ink); box-shadow: 0 0 0 3px rgba(255, 253, 243, .7), 0 2px 6px rgba(30, 34, 48, .25); }
.pin-card { padding: 5px 11px 4px; background: var(--glass); border: 1px solid var(--hair); border-radius: 11px; box-shadow: var(--lift-1); bottom: calc(50% + 22px); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.pin-card::after { height: 12px; width: 1.5px; background: rgba(30, 34, 48, .5); }
.pin-label { font-family: var(--f-title); font-weight: 400; font-size: 15px; letter-spacing: .06em; }
.pin-sub { font-size: 11.5px; color: var(--ink-2); }
/* the one thing to tap: bold ink, sun yellow, blue offset — the same voice as the primary button */
.pin[data-state="active"] .pin-dot { background: var(--sun); border-width: 2.5px; }
.pin[data-state="active"] .pin-card { background: var(--sun); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--sky); padding: 6px 13px 5px; animation: pin-bob 2.2s ease-in-out infinite; backdrop-filter: none; -webkit-backdrop-filter: none; }
.pin[data-state="active"] .pin-card::after { width: 2px; background: var(--ink); }
.pin[data-state="active"] .pin-label { font-size: 16px; }
@keyframes pin-bob { 50% { transform: translate(-50%, -4px); } }
@keyframes pin-pulse { 0%, 100% { box-shadow: 0 0 0 3px rgba(255, 253, 243, .8), 0 0 0 3px rgba(242, 228, 79, .9); } 60% { box-shadow: 0 0 0 3px rgba(255, 253, 243, .8), 0 0 0 22px rgba(242, 228, 79, 0); } }
.pin[data-state="done"] .pin-dot { background: var(--sky); }

.blabel { translate: -50% -100%; z-index: 1; cursor: pointer; }
.blabel .bl-in {
  display: flex; align-items: center; gap: 4px; padding: 4px 10px 4px 7px; border-radius: 999px; white-space: nowrap;
  background: var(--glass); border: 1px solid var(--hair); box-shadow: var(--lift-1); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  font-family: var(--serif); font-size: 12.5px; transition: transform .2s var(--ease-out-back);
}
.blabel .bl-in svg { width: 13px; height: 13px; stroke: var(--brick); fill: none; stroke-width: 2.2; }
.blabel::after { content: ""; display: block; width: 1.5px; height: calc(14px + var(--lift, 0px)); margin-left: calc(50% - .75px + var(--tail, 0px)); background: rgba(30, 34, 48, .45); }
.blabel.main .bl-in { background: var(--sun); border: 1.5px solid var(--ink); box-shadow: 2px 2px 0 var(--sky); }
.blabel:active .bl-in { transform: scale(.94); }

.say {
  width: min(78vw, 300px); padding: 11px 15px; border-radius: 20px; cursor: pointer;
  background: var(--card); border: 1.5px solid var(--ink); box-shadow: 0 10px 30px rgba(30, 34, 48, .18);
  translate: -50% -100%; transform-origin: 50% 100%; z-index: 5;
}
.say::before, .say::after { content: ""; position: absolute; left: calc(50% + var(--tail, 0px)); top: 100%; width: 0; height: 0; border-style: solid; transform: translateX(-50%); }
.say::before { border-width: 14px 9px 0 9px; border-color: var(--ink) transparent transparent; }
.say::after { border-width: 12px 7.2px 0 7.2px; border-color: var(--card) transparent transparent; margin-top: -1.6px; }
.say.below { translate: -50% 0; transform-origin: 50% 0; }
.say.below::before { top: auto; bottom: 100%; border-width: 0 9px 14px 9px; border-color: transparent transparent var(--ink); }
.say.below::after { top: auto; bottom: 100%; border-width: 0 7.2px 12px 7.2px; border-color: transparent transparent var(--card); margin-top: 0; margin-bottom: -1.6px; }
.say.docked { position: absolute; left: 50%; bottom: calc(var(--safe-b) + var(--task-h, 0px) + 14px); translate: -50% 0; width: min(calc(100% - 24px), 380px); opacity: 0; transform: translateY(16px); transition: opacity .3s, transform .45s var(--ease-out-back); }
.say.docked::before, .say.docked::after { display: none; }
.say.docked.in { opacity: 1; transform: none; }
.bb-head { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.bb-who { font-family: var(--f-title); font-size: 14px; letter-spacing: .08em; color: var(--sky-deep); font-weight: 400; }
.bb-text { margin: 0; font-size: 17px; line-height: 1.55; min-height: 1.55em; font-family: var(--hand-m); }
.bb-foot { display: flex; justify-content: flex-end; margin-top: 6px; }
.bb-foot.choices { display: block; }
.bb-next { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.bb-next i { width: 0; height: 0; border-style: solid; border-width: 6px 5px 0 5px; border-color: var(--sky) transparent transparent; animation: bb-bob 1s ease-in-out infinite; }
@keyframes bb-bob { 50% { transform: translateY(3px); } }

.chapter-card { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; pointer-events: none; background: radial-gradient(closest-side, rgba(249, 245, 216, .96), rgba(249, 245, 216, .78) 70%, rgba(249, 245, 216, 0)); opacity: 0; transition: opacity .6s; }
.chapter-card.in { opacity: 1; }
.chapter-card.out { opacity: 0; transition-duration: .7s; }
.cc-inner { text-align: center; transform: scale(.94); transition: transform 2.6s var(--ease); }
.chapter-card.in .cc-inner { transform: scale(1); }
.cc-seal { width: 74px; height: 74px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 12px; background: var(--brick); color: #FFF6EA; font-family: var(--f-title); font-size: 42px; box-shadow: inset 0 0 0 3px rgba(255, 246, 234, .55), inset 0 0 0 6px var(--brick), inset 0 0 0 7.5px rgba(255, 246, 234, .5); transform: rotate(-5deg); opacity: 0; }
.chapter-card.in .cc-seal { animation: seal-stamp .8s .15s var(--ease-out-back) forwards; }
.cc-name { font-family: var(--serif); color: var(--sky); letter-spacing: .5em; font-size: 14px; margin-right: -.5em; }
.cc-title { font-family: var(--f-title); font-size: 38px; letter-spacing: .12em; line-height: 1.25; margin-right: -.12em; }
.cc-rule { width: 0; height: 3px; margin: 10px auto; background: var(--ink); border-radius: 2px; transition: width 1.2s .3s var(--ease); }
.chapter-card.in .cc-rule { width: 120px; }
.cc-meta { display: flex; gap: 14px; justify-content: center; font-family: var(--serif); font-size: 13px; color: var(--ink-2); letter-spacing: .08em; }

.inkwipe { position: absolute; inset: 0; width: 100%; height: 100%; display: none; z-index: 20; pointer-events: none; }
.inkwipe.on { display: block; pointer-events: auto; }
.inkwipe.on.passive { pointer-events: none; }
.wipe-text { position: absolute; left: 50%; top: 50%; z-index: 21; transform: translate(-50%, -40%); font-family: var(--f-title); font-size: 26px; letter-spacing: .3em; color: var(--card); opacity: 0; transition: opacity .4s, transform .6s var(--ease); pointer-events: none; white-space: nowrap; }
.wipe-text.in { opacity: 1; transform: translate(-50%, -50%); }
.fly-item { position: absolute; z-index: 40; pointer-events: none; }
.item-glyph {
  flex: none; width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%;
  font-family: var(--f-title); font-size: 34px; color: var(--ink); background: var(--sun);
  border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--sky), inset 0 0 0 5px rgba(255, 253, 243, .6);
}
.fly-item .item-glyph { width: 56px; height: 56px; font-size: 30px; }
.skip { position: absolute; right: 14px; bottom: calc(var(--safe-b) + 18px); z-index: 19; height: 32px; padding: 0 14px; border-radius: 999px; font-size: 13px; letter-spacing: .1em; color: var(--ink-2); background: var(--glass); border: 1px solid var(--hair); box-shadow: var(--lift-1); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); opacity: 0; transition: opacity .4s; }
.greet-skip { top: calc(var(--safe-t) + 74px); bottom: auto; }
.skip.in { opacity: 1; }

/* ---- welcome (title) ----------------------------------------------------------------------------- */
.title-screen {
  display: flex; flex-direction: column; align-items: center; overflow: hidden;
  padding: calc(var(--safe-t) + 22px) 18px calc(var(--safe-b) + 14px);
  background:
    radial-gradient(120% 60% at 50% 102%, rgba(249, 245, 216, .98) 30%, rgba(249, 245, 216, 0) 70%),
    linear-gradient(to bottom, rgba(249, 245, 216, .98) 0%, rgba(249, 245, 216, .92) 34%, rgba(249, 245, 216, .52) 58%, rgba(249, 245, 216, .2) 74%);
}
.title-screen::before { content: ""; position: absolute; left: -20%; right: -20%; top: 44%; height: 34%; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgba(70, 129, 189, .28), rgba(70, 129, 189, 0)); filter: blur(6px); }
.t-head { position: relative; display: grid; justify-items: start; line-height: .86; margin-top: 1vh; white-space: nowrap; }
.t-with { font-family: "Georgia", "Times New Roman", var(--f-title); font-weight: 900; font-size: clamp(60px, 24vw, 108px); letter-spacing: -.03em; color: var(--sun); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--sky); opacity: 0; transform: translateX(-30px) rotate(-6deg); transition: opacity .6s .15s, transform .8s .15s var(--ease-out-back); }
.t-name { justify-self: end; margin: -.12em -.2em 0 0; font-family: var(--f-title); font-size: clamp(54px, 21vw, 96px); letter-spacing: .02em; color: var(--sun); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--sky); opacity: 0; transform: translateY(20px) scale(.8); transition: opacity .5s .4s, transform .8s .4s var(--ease-out-back); }
.t-band { position: relative; margin-top: 16px; padding: 9px 26px 10px; color: #fff; background: var(--sky); font-family: var(--f-title); font-size: clamp(20px, 7.4vw, 30px); letter-spacing: .14em; white-space: nowrap; clip-path: polygon(3% 8%, 99% 0, 97% 92%, 0 100%); transform: scaleX(0); transform-origin: 0 50%; transition: transform .7s .7s var(--ease); }
.t-band::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .35; background: repeating-linear-gradient(100deg, transparent 0 7px, rgba(255, 255, 255, .25) 7px 8px); }
.t-sub { margin: 10px 0 0; max-width: 340px; font-family: var(--serif); font-size: clamp(11px, 3.6vw, 14px); color: var(--sky-deep); letter-spacing: .04em; text-align: center; opacity: 0; transition: opacity .8s 1.1s; }
.t-sanmao {
  position: relative; flex: 1; min-height: 0; max-height: 34vh; width: auto; margin: 2vh 0 0; object-fit: contain; cursor: pointer;
  filter: drop-shadow(2px 0 0 #FFFDF4) drop-shadow(-2px 0 0 #FFFDF4) drop-shadow(0 2px 0 #FFFDF4) drop-shadow(0 -2px 0 #FFFDF4) drop-shadow(1.5px 0 0 var(--ink)) drop-shadow(-1.5px 0 0 var(--ink)) drop-shadow(0 1.5px 0 var(--ink)) drop-shadow(0 -1.5px 0 var(--ink)) drop-shadow(6px 8px 0 rgba(30, 34, 48, .16));
  opacity: 0; transform: translateY(28px); transition: opacity .7s 1.2s, transform 1.1s 1.2s var(--ease);
}
.t-sanmao.hop { animation: t-hop .6s var(--ease); }
@keyframes t-hop { 35% { translate: 0 -22px; } 70% { translate: 0 0; } 85% { translate: 0 -4px; } 100% { translate: 0 0; } }
.t-actions { width: min(100%, 340px); display: flex; flex-direction: column; gap: 10px; margin-top: 2vh; opacity: 0; transform: translateY(20px); transition: opacity .6s 1.6s, transform .7s 1.6s var(--ease); }
.t-actions .btn { padding: 0 14px; white-space: nowrap; }
.t-actions .btn.ghost { background: rgba(255, 253, 243, .7); }
.t-more { --gap: 8px; }
.t-more .btn { padding: 0 10px; min-width: 0; text-decoration: none; }
.t-station { margin: 0; text-align: center; font-family: var(--serif); font-size: 13.5px; color: var(--ink-2); }
.t-station b { font-weight: 400; color: #fff; background: var(--brick); border-radius: 5px; padding: 1px 7px; margin-right: 2px; font-size: 12px; letter-spacing: .1em; }
.t-route { align-self: center; padding: 2px 4px; font-size: 13px; }
.resume-card { display: grid; gap: 1px; padding: 10px 14px; border-radius: 16px; background: var(--glass); border: 1px solid var(--hair); box-shadow: var(--lift-1); }
.resume-k { font-family: var(--serif); font-size: 11px; letter-spacing: .3em; color: var(--sky); }
.resume-card b { font-family: var(--f-title); font-weight: 400; font-size: 17px; letter-spacing: .04em; }
.resume-n { font-size: 12.5px; color: var(--muted); }
.t-foot { margin-top: 10px; font-family: var(--serif); font-size: 10px; color: var(--muted); letter-spacing: .04em; text-align: center; opacity: 0; transition: opacity 1s 2s; }
.t-foot span { display: inline-block; white-space: nowrap; margin: 0 .3em; }
.title-screen.in .t-with, .title-screen.in .t-name { opacity: 1; transform: none; }
.title-screen.in .t-with { transform: rotate(-4deg); }
.title-screen.in .t-band { transform: none; }
.title-screen.in .t-sub, .title-screen.in .t-foot { opacity: 1; }
.title-screen.in .t-sanmao { opacity: 1; transform: none; }
.title-screen.in .t-actions { opacity: 1; transform: none; }
.title-screen.out { opacity: 0; transition: opacity .5s; pointer-events: none; }
@media (max-height: 640px) { .t-sanmao { max-height: 22vh; } .t-band { margin-top: 10px; } .t-foot { display: none; } }

.mode-pick { --gap: 10px; }
.mode-option { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px; border-radius: 18px; border: 1px solid var(--hair); background: var(--card); box-shadow: var(--lift-1); font: inherit; color: inherit; transition: transform .14s, box-shadow .14s; }
.mode-option:first-child { border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--sky); }
.mode-option:active { transform: translateY(1px) scale(.99); box-shadow: none; }
.mode-option[disabled] { opacity: .5; }
.mode-option .grow { display: grid; gap: 2px; }
.mode-option b { font-family: var(--f-title); font-weight: 400; font-size: 17px; letter-spacing: .04em; }
.mode-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--sun-soft); }
.mode-icon svg { width: 22px; height: 22px; stroke: var(--ink); stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.warn-text { color: var(--brick); margin: 0; }
.warn-text a { color: var(--sky-deep); }
.station-card { padding: 12px 14px; border-radius: 18px; background: var(--card); border: 1px solid var(--hair); box-shadow: var(--lift-1); }
.station-card .row { align-items: flex-start; }
.station-card p { margin: 10px 0 0; line-height: 1.6; }
.station-chapter { width: 42px; height: 42px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--brick); color: #FFF6EA; font-family: var(--f-title); font-weight: 400; font-size: 17px; transform: rotate(-4deg); }
.day-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 2px; }
.day-list li { display: grid; grid-template-columns: 92px 34px 1fr; align-items: center; gap: 6px; padding: 7px 0; border-top: 1px dashed rgba(70, 129, 189, .35); font-size: 14px; }
.day-list li:first-child { border-top: 0; }
.day-list li.planned { color: var(--muted); }
.day-time { font-family: var(--serif); font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.day-chapter { font-family: var(--f-title); font-weight: 400; }
.day-title { font-family: var(--serif); }
.day-place { grid-column: 3; font-size: 12px; color: var(--muted); margin-top: -4px; }
.day-list li .chip { grid-column: 4; grid-row: 1 / span 2; }

/* ---- table (camera mode) ------------------------------------------------------------------------- */
.locate-guide { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); width: min(78vw, 360px); display: grid; justify-items: center; gap: 10px; text-align: center; color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); pointer-events: none; }
.locate-guide > button { pointer-events: auto; text-shadow: none; }
.locate-card { width: 100%; aspect-ratio: 104 / 62; border: 3px dashed rgba(255, 255, 255, .92); border-radius: 16px; display: flex; justify-content: space-evenly; align-items: center; animation: breathe 2.6s ease-in-out infinite; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .18); }
.locate-card i { width: 32%; aspect-ratio: 1; border: 3px solid #fff; background: repeating-conic-gradient(rgba(255, 255, 255, .85) 0 25%, transparent 0 50%) 0 0 / 34% 34%; }
.locate-text { margin: 4px 0 0; font-family: var(--f-title); font-size: 19px; }
.locate-sub { margin: 0; opacity: .92; }
.locate-guide[data-state="lost"] .locate-card { border-color: var(--sun); }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: .95; } 50% { transform: scale(.94); opacity: .7; } }

/* ---- newspaper --------------------------------------------------------------------------------- */
.newspaper-screen { display: flex; flex-direction: column; background: rgba(30, 34, 48, .28); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); opacity: 0; transition: opacity .35s; }
.np-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: calc(var(--safe-t) + 80px) 14px 22px; scrollbar-width: none; }
.np-scroll::-webkit-scrollbar { display: none; }
.newspaper-screen.in { opacity: 1; }
.news { margin: 0 auto; max-width: 400px; padding: 16px; background-color: #F6F0D8; border: 0; box-shadow: 0 2px 4px rgba(30, 34, 48, .08), 0 24px 50px rgba(30, 34, 48, .28); transform-origin: 50% 80%; transform: translateY(60px) rotate(8deg) scale(.6); transition: transform .7s var(--ease-out-back); }
.newspaper-screen.in .news { transform: rotate(-1.2deg); }
.newspaper-screen.fold-away { opacity: 0; transition: opacity .45s .1s; }
.newspaper-screen.fold-away .news { transform: translateY(-40px) rotate(-6deg) scale(.7); transition: transform .45s ease-in; }
.news-mast { text-align: center; border-bottom: 3px double var(--ink); padding-bottom: 6px; }
.news-ed { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-family: var(--serif); font-size: 11px; color: var(--muted); }
.news-title { margin: 4px 0 0; font-size: clamp(30px, 10.5vw, 42px); letter-spacing: .26em; margin-right: -.26em; line-height: 1.15; }
.news-date { display: flex; justify-content: space-between; gap: 8px; font-family: var(--serif); font-size: 11.5px; color: var(--ink-2); border-top: 1px solid var(--ink); margin-top: 4px; padding-top: 3px; letter-spacing: .06em; }
.news-head { margin: 10px 0 8px; font-size: clamp(19px, 6.4vw, 25px); line-height: 1.3; letter-spacing: .02em; text-wrap: balance; }
.news-body { display: flex; gap: 10px; align-items: flex-start; }
.news-fig { margin: 0; flex: 0 0 32%; border: 1.5px solid var(--ink); background: #fff; padding: 4px; transform: rotate(-2deg); box-shadow: 2px 2px 0 var(--sky); }
.news-fig img { display: block; width: 100%; height: auto; }
.news-line { margin: 0; font-size: 14.5px; line-height: 1.7; text-align: justify; }
.news-line::first-letter { font-family: var(--f-title); font-size: 2.1em; float: left; line-height: 1; margin: 2px 5px 0 0; }
.np-facts { list-style: none; margin: 12px 0 0; padding: 8px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.np-facts li { display: grid; gap: 1px; }
.np-facts b { font-family: var(--f-title); font-weight: 400; font-size: 22px; color: var(--brick); line-height: 1.1; }
.np-facts span { font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.news-task { margin: 12px 0 10px; padding: 8px 12px; border: 2px dashed var(--sky); border-radius: 12px; background: rgba(220, 232, 244, .55); display: flex; gap: 8px; align-items: baseline; }
.news-task b { flex: none; font-family: var(--serif); font-weight: 400; color: #fff; background: var(--sky); padding: 1px 8px; border-radius: 6px; font-size: 13px; }
.news-task span { font-size: 15px; line-height: 1.5; font-family: var(--hand-m); }
/* a solid bar under the scrolling paper: the button never sits on top of text */
.np-actions { flex: none; position: relative; z-index: 1; padding: 12px 14px calc(var(--safe-b) + 14px); background: var(--paper); border-radius: 20px 20px 0 0; box-shadow: 0 -10px 30px rgba(30, 34, 48, .22); }
.np-actions .btn { display: flex; max-width: 400px; margin: 0 auto; }

/* ---- hunt (studio panorama) ---------------------------------------------------------------------- */
.hunt-top { position: absolute; left: 14px; right: 14px; bottom: calc(var(--safe-b) + 106px); display: flex; gap: 8px; align-items: center; z-index: 3; pointer-events: none; }
.hunt-top > * { pointer-events: auto; }
.scene-chip { background: var(--ink); color: var(--card); border-color: var(--ink); }
.scene-chip svg { stroke: var(--sun); }
.spark { width: 0; height: 0; pointer-events: none; }
.spark i { position: absolute; left: -10px; top: -10px; width: 20px; height: 20px; background: radial-gradient(circle, #fff 0 20%, rgba(255, 246, 200, .9) 30%, rgba(242, 228, 79, 0) 70%); border-radius: 50%; animation: twinkle 2.2s ease-in-out infinite; }
.spark i::before, .spark i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 30px; height: 2px; margin: -1px 0 0 -15px; background: linear-gradient(90deg, transparent, #fff, transparent); }
.spark i::after { transform: rotate(90deg); }
.spark:nth-child(2) i { animation-delay: .7s; }
.spark:nth-child(3) i { animation-delay: 1.4s; }
.spark-label { position: absolute; left: 0; top: 30px; transform: translateX(-50%); white-space: nowrap; background: var(--ink); color: var(--card); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; opacity: 0; transition: opacity .3s; }
.spark.ring::before { content: ""; position: absolute; left: -46px; top: -46px; width: 92px; height: 92px; border-radius: 50%; border: 3px dashed var(--sun); box-shadow: 0 0 0 3px rgba(30, 34, 48, .25); animation: spin 8s linear infinite; }
.spark.named .spark-label { opacity: 1; }
.spark.found { display: none; }
@keyframes twinkle { 0%, 100% { transform: scale(.6); opacity: .55; } 50% { transform: scale(1.2); opacity: 1; } }
.ripple { position: absolute; width: 0; height: 0; pointer-events: none; z-index: 2; }
.ripple::before { content: ""; position: absolute; left: -28px; top: -28px; width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--sun); animation: ripple .8s var(--ease) forwards; }
.ripple.miss::before { border-color: rgba(255, 255, 255, .6); }
.ripple.dim::before { border-color: var(--sky); }
@keyframes ripple { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.toolbar { position: absolute; left: 12px; right: 12px; bottom: calc(var(--safe-b) + 12px); z-index: 3; max-width: 420px; margin: 0 auto; display: flex; align-items: stretch; gap: 8px; padding: 8px; border-radius: 22px; background: var(--glass); border: 1px solid var(--hair); box-shadow: var(--lift-2); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.slot { flex: 1; display: grid; justify-items: center; gap: 3px; padding: 6px 4px 5px; border-radius: 15px; border: 1px dashed rgba(30, 34, 48, .22); background: rgba(242, 234, 203, .35); transition: background .3s, transform .3s var(--ease-out-back); }
.slot-glyph { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 1.5px dashed rgba(30, 34, 48, .3); font-family: var(--f-title); font-size: 22px; color: rgba(30, 34, 48, .25); transition: background .3s, color .3s; }
.slot-clue { font-size: 11px; color: var(--muted); line-height: 1.2; text-align: center; }
.slot.got { border: 1px solid rgba(226, 201, 58, .7); background: rgba(248, 240, 160, .55); }
.slot.got .slot-glyph { background: var(--sun); border: 1.5px solid var(--ink); color: var(--ink); }
.slot.got .slot-clue { color: var(--ink-2); }
.slot.pop { transform: scale(1.14); }
.slot-count { display: grid; place-items: center; min-width: 50px; font-family: var(--f-title); font-size: 20px; color: var(--sky); }
.toolbar.complete { animation: glow 1.2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 6px rgba(242, 228, 79, .8), var(--lift-2); } }
.gyro-btn { background: var(--card); }
.gyro-btn.drag { background: var(--sun); border-color: var(--ink); }
.gc-phone { position: relative; width: 34px; height: 54px; border: 2px solid var(--ink); border-radius: 8px; background: var(--card); box-shadow: 3px 3px 0 var(--sky); animation: phone-turn 2.4s ease-in-out infinite; }
.gc-phone i { position: absolute; left: 50%; bottom: 4px; width: 8px; height: 2px; margin-left: -4px; border-radius: 1px; background: var(--ink); }
.gc-phone::before, .gc-phone::after { content: ""; position: absolute; top: 50%; width: 12px; height: 12px; margin-top: -6px; border: 2px solid var(--brick); border-width: 2px 2px 0 0; opacity: .8; }
.gc-phone::before { left: -22px; transform: rotate(-135deg); }
.gc-phone::after { right: -22px; transform: rotate(45deg); }
@keyframes phone-turn { 0%, 100% { transform: perspective(200px) rotateY(-28deg); } 50% { transform: perspective(200px) rotateY(28deg); } }
.gyro-coach { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; padding: 24px; background: rgba(30, 34, 48, .38); opacity: 0; transition: opacity .3s; }
.gyro-coach.in { opacity: 1; }
.gc-card { width: min(320px, 100%); display: grid; justify-items: center; gap: 10px; padding: 26px 20px 14px; border: 2px solid var(--ink); border-radius: 22px; background: var(--paper); box-shadow: 5px 5px 0 var(--ink); text-align: center; }
.gc-card .gc-phone { margin-bottom: 6px; }
.gc-card b { font-family: var(--f-title); font-weight: 400; font-size: 20px; }
.gc-card .btn { margin-top: 6px; }
.tilt-hint { position: absolute; left: 50%; top: 42%; z-index: 4; display: grid; justify-items: center; gap: 12px; padding: 18px 26px; border-radius: 20px; background: rgba(255, 253, 243, .9); border: 1.5px solid var(--ink); box-shadow: var(--lift-2); transform: translate(-50%, -50%) scale(.9); opacity: 0; transition: opacity .35s, transform .35s var(--ease-out-back); pointer-events: none; }
.tilt-hint.in { opacity: 1; transform: translate(-50%, -50%); }
.tilt-hint span { font-family: var(--hand-m); font-size: 16px; white-space: nowrap; }

/* ---- story / artwork sheets ---------------------------------------------------------------------- */
.story-head { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.story-head .item-glyph { width: 72px; height: 72px; font-size: 40px; animation: glyph-in .8s var(--ease-out-back); }
@keyframes glyph-in { 0% { transform: scale(0) rotate(-90deg); } 100% { transform: none; } }
.item-count { font-family: var(--serif); font-size: 12px; color: var(--sky); letter-spacing: .12em; }
.story-head h2 { margin-top: 2px; font-size: 20px; }
.story-body { font-size: 15.5px; line-height: 1.75; margin: 4px 0 10px; }
.story .btn { margin-top: 14px; }
.artwork-frame { background: var(--ink); padding: 8px; border-radius: 10px; margin-bottom: 12px; box-shadow: 4px 4px 0 var(--sky); }
.artwork-frame img { display: block; width: 100%; max-height: 52vh; object-fit: contain; background: #fff; border-radius: 3px; }
.artwork h2 { font-size: 20px; }
.artwork p { margin: 6px 0; line-height: 1.6; }
.artwork .btn { margin-top: 12px; }

/* ---- draw (the paper on the desk) ---------------------------------------------------------------- */
.draw { overflow-y: auto; padding: calc(var(--safe-t) + 78px) 12px calc(var(--safe-b) + 14px); display: grid; align-content: start; justify-items: center; background: rgba(249, 245, 216, .32); scrollbar-width: none; }
.draw::-webkit-scrollbar { display: none; }
.drawpad { width: 100%; max-width: 400px; padding: 12px 12px 10px; display: grid; gap: 8px; transform: translateY(18px); opacity: 0; transition: transform .35s var(--ease), opacity .3s; }
.draw.in .drawpad { transform: none; opacity: 1; }
.dp-head { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; }
.dp-head h3 { font-size: clamp(17px, 5.4vw, 20px); white-space: nowrap; }
.dp-sub { margin: -2px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.draw-stage {
  position: relative; overflow: hidden; border-radius: 16px; border: 1px solid rgba(30, 34, 48, .18); box-shadow: inset 0 1px 3px rgba(30, 34, 48, .06); background: #FFFDF4; touch-action: none;
  background-image: linear-gradient(rgba(70, 129, 189, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(70, 129, 189, .09) 1px, transparent 1px);
  background-size: 22px 22px;
}
.draw-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.draw-base { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; mix-blend-mode: multiply; }
.guides { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.guide { fill: none; stroke: var(--sky); stroke-width: 3; stroke-dasharray: 7 7; stroke-linecap: round; opacity: .8; }
.guide-covered { fill: none; stroke: var(--leaf); stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; opacity: .38; }
.guide-num circle { fill: var(--sky); stroke: #fff; stroke-width: 2; }
.guide-num text { fill: #fff; font-size: 11px; font-weight: 800; text-anchor: middle; font-family: var(--serif); }
.guide-start { fill: var(--sky); stroke: #fff; stroke-width: 1.5; }
.guide-g.passed .guide { stroke: var(--leaf); opacity: .5; }
.guide-g.passed .guide-num circle, .guide-g.passed .guide-start { fill: var(--leaf); }
.guides.missing .guide-g.want .guide { stroke: var(--brick); stroke-width: 4.5; animation: want .9s ease-in-out 3; }
@keyframes want { 50% { opacity: .25; } }
.demo-path { fill: none; stroke: rgba(30, 34, 48, .5); stroke-width: 6; stroke-linecap: round; }
.demo-path.fade { opacity: 0; transition: opacity .6s; }
.ink-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.dp-badge { position: absolute; left: 8px; top: 8px; display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px 3px 6px; border-radius: 999px; background: var(--ink); color: var(--card); font-family: var(--serif); font-size: 12px; pointer-events: none; }
.dp-badge svg { width: 14px; height: 14px; stroke: var(--sun); fill: none; stroke-width: 2; }
.dp-tip { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); margin: 0; white-space: nowrap; pointer-events: none; padding: 4px 12px; border-radius: 999px; background: var(--sun); border: 1.5px solid var(--ink); font-size: 13px; animation: tip-bob 1.6s ease-in-out infinite; transition: opacity .3s; }
.dp-tip.gone { opacity: 0; }
@keyframes tip-bob { 50% { transform: translate(-50%, -4px); } }
.draw.accepted .guides { opacity: 0; transition: opacity .8s; }
.draw.accepted .draw-stage { animation: dry 1.4s ease-in-out; }
@keyframes dry { 40% { box-shadow: 0 0 0 8px var(--sun); } }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.legend li { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 6px; padding: 6px 8px; border-radius: 12px; background: rgba(242, 234, 203, .4); border: 1px solid transparent; font-size: 12.5px; transition: background .3s, border-color .3s; }
.legend-n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--sky); color: #fff; font-size: 11px; font-family: var(--serif); }
.legend-bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--paper-3); overflow: hidden; }
.legend-bar i { display: block; height: 100%; width: 0; background: var(--leaf); transition: width .2s; }
.legend li.passed { border: 1px solid rgba(78, 154, 120, .45); background: var(--leaf-soft); }
.legend li.passed .legend-n { background: var(--leaf); }
.legend li.passed .legend-label::after { content: " ✓"; color: var(--leaf); font-weight: 900; }
.draw-controls { display: flex; gap: 8px; align-items: center; }
.draw-controls .chip { height: 40px; padding: 0 12px; }
.draw-help { justify-self: center; font-size: 13px; padding: 0 4px; }

/* ---- greet (the desk) ---------------------------------------------------------------------------- */
.greet-beats { position: absolute; left: 12px; right: 12px; bottom: calc(var(--safe-b) + var(--task-h, 0px) + 12px); list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; transition: opacity .4s, bottom .4s var(--ease); pointer-events: none; }
/* a comic narration box: one beat at a time, square-cornered so it never reads as a button */
.greet-beats li { display: none; padding: 5px 14px 6px; border: 1.5px solid var(--ink); border-radius: 2px; background: #FFF6CF; font-family: var(--serif); font-size: 15px; letter-spacing: .3em; color: var(--ink); transform: rotate(-1.5deg); }
.greet-beats li.now { display: block; animation: caption-in .45s var(--ease-out-back); }
@keyframes caption-in { from { opacity: 0; transform: rotate(-1.5deg) translateY(6px) scale(.96); } }
.greet-beats.over { opacity: 0; pointer-events: none; }
.say.greet-line { width: min(82vw, 310px); }
.greet-foot { display: grid; gap: 4px; width: 100%; margin-top: 4px; }
.greet-foot .sources { margin-top: 2px; font-size: 12px; }

/* ---- hall (ground-floor panorama + route choice) ------------------------------------------------- */
.hall { display: grid; grid-template-rows: 1fr auto; }
.hall.looking { grid-template-rows: 1fr auto; }
.hall.looking .hall-prompt, .hall.looking .option-list, .hall.looking .choose-note, .hall.looking .hall-panel > .btn { display: none; }
.hall-peek { display: none; }
.hall.looking .hall-peek { display: grid; gap: 2px; }
.hall-peek p { margin: 2px 0 0; font-family: var(--hand-m); font-size: 16px; line-height: 1.45; }
.hall-peek .row { align-items: center; gap: 6px; }
.peek-count { font-family: var(--serif); font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.peek-count b { color: var(--brick); font-weight: 400; font-size: 14px; }
.hall-peek .link-btn { display: inline-flex; align-items: center; gap: 2px; font-size: 13px; padding: 4px 0; }
.hall-peek .link-btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.hall-view { position: relative; overflow: hidden; }
.hall-view .hunt-top { bottom: 30px; }
.hall-panel {
  position: relative; overflow-y: auto; padding: 12px 12px calc(var(--safe-b) + 14px); display: grid; align-content: start; gap: 10px;
  background: var(--paper); border-radius: 24px 24px 0 0; margin-top: -20px; box-shadow: 0 -10px 30px rgba(30, 34, 48, .18);
  transform: translateY(30px); opacity: 0; transition: transform .6s var(--ease), opacity .4s; scrollbar-width: none;
}
.hall-panel::-webkit-scrollbar { display: none; }
.hall-panel.in { transform: none; opacity: 1; }
.hall-ask { display: flex; align-items: center; gap: 10px; }
.hall-who { font-family: var(--serif); font-size: 11px; letter-spacing: .3em; color: var(--sky); }
.hall-prompt { margin: 0; font-family: var(--f-title); font-size: 17px; line-height: 1.35; letter-spacing: .03em; }
.buddy { position: relative; width: 52px; height: 70px; flex: none; overflow: hidden; border-radius: 14px; background: var(--card); border: 1px solid var(--hair); box-shadow: var(--lift-1); }
.buddy > * { position: absolute; left: -6px; top: 2px; width: calc(100% + 12px); height: auto; }
.buddy svg path { fill: none; stroke: var(--ink); stroke-width: 7; stroke-linecap: round; }
.option-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option-card {
  min-width: 0; display: flex; flex-direction: column; text-align: left; overflow: hidden; padding: 0; border-radius: 16px;
  background: var(--card); border: 1px solid var(--hair); box-shadow: var(--lift-1); font: inherit; color: inherit;
  transition: transform .3s var(--ease-out-back), box-shadow .2s, opacity .4s, border-color .2s;
}
.option-card:active { transform: scale(.98); }
.sc-img { position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden; border-bottom: 1px solid var(--hair); background: #fff; }
.option-art { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-key { position: absolute; left: 7px; top: 7px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--sun); border: 1.5px solid var(--ink); font-family: "Georgia", serif; font-weight: 900; font-size: 16px; }
.option-card[data-branch="B"] .sc-key { background: var(--sky); color: #fff; }
.option-body { padding: 10px 10px 12px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.option-k { font-family: var(--serif); font-size: 11px; color: var(--brick); letter-spacing: .06em; }
.option-title { font-family: var(--f-title); font-weight: 400; font-size: 17px; line-height: 1.25; letter-spacing: .03em; }
.option-sub { font-size: 13px; color: var(--ink-2); font-family: var(--hand-m); }
.option-text { font-size: 12px; line-height: 1.45; color: var(--muted); }
.sc-place { display: flex; align-items: flex-start; gap: 3px; font-size: 11px; color: var(--sky-deep); line-height: 1.35; }
.sc-place svg { width: 12px; height: 12px; flex: none; margin-top: 1px; stroke: var(--brick); fill: none; stroke-width: 2.2; }
.option-card.selected { transform: translateY(-4px); border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--sun-deep); background: #FFFBE0; }
.option-list:has(.selected) .option-card:not(.selected) { opacity: .55; transform: scale(.97); }
.hall-panel.chosen .option-card.selected { animation: stamp-card .6s var(--ease-out-back); }
@keyframes stamp-card { 40% { transform: translateY(-10px) rotate(-2deg) scale(1.04); } }
.choose-note { margin: 0; text-align: center; font-size: 12px; color: var(--muted); }
.frame-spot { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); display: grid; justify-items: center; gap: 4px; padding: 0; border: 0; background: none; pointer-events: auto; font: inherit; }
.frame-spot img { width: 70px; height: 86px; object-fit: cover; border: 4px solid var(--ink); outline: 3px solid var(--sun); background: #fff; box-shadow: 0 8px 20px rgba(0, 0, 0, .4); animation: frame-call 2.4s ease-in-out infinite; }
.frame-title { max-width: 120px; padding: 2px 8px; border-radius: 8px; background: var(--ink); color: var(--card); font-size: 11.5px; text-align: center; font-family: var(--serif); }
.frame-tick { display: none; position: absolute; right: -6px; top: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--sky); color: #fff; font-size: 13px; line-height: 22px; text-align: center; font-weight: 900; border: 1.5px solid var(--ink); }
.frame-spot.seen img { animation: none; outline-color: var(--sky); }
.frame-spot.seen .frame-tick { display: block; }
.hotspot.frame-spot { margin: -50px 0 0 -35px; transform: none; }
@keyframes frame-call { 50% { outline-offset: 4px; } }

/* ---- complete ------------------------------------------------------------------------------------ */
.complete-panel {
  position: absolute; left: 10px; right: 10px; bottom: calc(var(--safe-b) + 10px); max-width: 440px; margin: 0 auto;
  max-height: calc(100% - var(--safe-t) - var(--safe-b) - 84px); overflow-y: auto; padding: 0 18px 18px; display: grid; gap: 14px;
  transform: translateY(115%); transition: transform .8s var(--ease); scrollbar-width: none; overscroll-behavior: contain;
}
.complete-panel::-webkit-scrollbar { display: none; }
.complete-panel.in { transform: none; }
.complete-panel.in.collapsed { transform: translateY(calc(100% - 96px)); overflow: hidden; }
.panel-grip { display: block; width: 100%; height: 20px; padding: 0; border: 0; background: none; }
.panel-grip i { display: block; width: 40px; height: 4px; margin: 8px auto 0; border-radius: 2px; background: rgba(30, 34, 48, .18); }
.complete-head { display: flex; align-items: center; gap: 12px; }
.cd-seal { width: 50px; height: 50px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--brick); color: #FFF6EA; font-family: var(--f-title); font-size: 28px; transform: rotate(-6deg); box-shadow: inset 0 0 0 2.5px rgba(255, 246, 234, .55), inset 0 0 0 4.5px var(--brick), inset 0 0 0 5.5px rgba(255, 246, 234, .5); }
.complete-panel.in .cd-seal { animation: seal-stamp .8s .3s var(--ease-out-back) both; }
.cd-sub { margin: 0; font-family: var(--serif); color: var(--sky); font-size: 11.5px; letter-spacing: .08em; }
.cd-title { margin: 2px 0 0; font-size: 22px; letter-spacing: .08em; line-height: 1.25; }
.complete-text { margin: -4px 0 0; line-height: 1.7; color: var(--ink-2); font-size: 14.5px; }
.keepsake { margin: 0; }
.keepsake-frame { position: relative; overflow: hidden; aspect-ratio: 1 / 1; transition: aspect-ratio .4s; border-radius: 14px; background: #FFFDF4; box-shadow: 0 1px 2px rgba(30, 34, 48, .1), 0 12px 30px rgba(30, 34, 48, .16); }
.keepsake-frame::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(30, 34, 48, .08); pointer-events: none; }
.keepsake-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; transition: opacity .6s var(--ease); -webkit-touch-callout: default; -webkit-user-select: auto; user-select: auto; }
.keepsake-img.ok { opacity: 1; }
.keepsake-img.draft { padding: 8%; mix-blend-mode: multiply; }
.keepsake-note { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--glass); font-size: 12px; color: var(--muted); white-space: nowrap; transition: opacity .4s; }
.keepsake-note i { width: 7px; height: 7px; border-radius: 50%; background: var(--sun-deep); animation: pulse-dot 1s ease-in-out infinite alternate; }
@keyframes pulse-dot { to { opacity: .25; } }
.keepsake-frame.ready .keepsake-note { opacity: 0; }
.keepsake figcaption { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.consent { display: grid; gap: 10px; padding: 14px 0 0; border-top: 1px solid var(--hair); }
.switch-row { display: flex; align-items: center; gap: 12px; }
.switch-row .grow { display: grid; gap: 2px; }
.switch-row b { font-family: var(--serif); font-weight: 400; }
.cd-next { display: grid; gap: 2px; padding: 12px 14px; border-radius: 16px; background: rgba(220, 232, 244, .45); }
.cd-next.held { background: rgba(242, 234, 203, .72); }
.cd-next > b { font-family: var(--serif); font-weight: 400; font-size: 11px; letter-spacing: .3em; color: var(--sky); }
.cd-next.held > b { color: var(--muted); }
.cd-next strong { font-family: var(--f-title); font-weight: 400; font-size: 17px; letter-spacing: .04em; }
.cd-next span { font-size: 13px; color: var(--ink-2); }
.cd-next p { margin: 4px 0 0; }
.cd-next em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.cd-next .row { margin-top: 6px; --gap: 6px; }
.complete-actions { display: grid; gap: 8px; }
.fb { display: grid; gap: 4px; }
.fb-lead, .fb-fresh, .fb-anon, .fb-past { margin: 0; line-height: 1.6; }
.fb-lead { font-size: 13.5px; color: var(--ink-2); }
.fb-fresh { margin-top: 8px; font-family: var(--serif); font-size: 13px; color: var(--brick); }
.fb-group { margin: 14px 0 0; font-family: var(--serif); font-size: 12px; letter-spacing: .18em; color: var(--sky); }
.fb-part { display: grid; gap: 8px; padding: 12px 0 4px; border-top: 1px dashed var(--hair); }
.fb-part .fb-group { border: 0; padding: 0; margin: 0; }
.fb-ask { margin: 0; font-size: 15px; line-height: 1.45; word-break: keep-all; text-wrap: balance; }
.fb-new { display: inline-block; margin-left: 8px; padding: 0 6px; border-radius: 999px; background: rgba(184, 92, 56, .12); color: var(--brick); font-family: var(--serif); font-size: 11px; letter-spacing: .08em; vertical-align: 1px; }
.fb-scale { display: grid; gap: 4px; }
.fb-pips { display: flex; gap: 6px; }
.fb-pips label { position: relative; flex: 1; }
.fb-pips input { position: absolute; opacity: 0; }
.fb-pips span { display: grid; place-items: center; min-height: 42px; border-radius: 12px; border: 1.5px solid rgba(30, 34, 48, .22); background: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }
.fb-pips input:checked + span { background: var(--ink); color: var(--card); border-color: var(--ink); }
.fb-pips input:focus-visible + span { outline: 3px solid var(--sky); outline-offset: 2px; }
.fb-ends { display: flex; justify-content: space-between; font-family: var(--serif); font-size: 11px; color: var(--muted); }
.fb-note-row { display: grid; gap: 8px; }
.fb-more { justify-self: start; padding: 0; border: 0; background: none; color: var(--sky); font: inherit; font-size: 13px; }
.fb-note, .fb-suggest { font-size: 16px; }
.fb-suggest-label { margin: 12px 0 6px; font-family: var(--serif); font-size: 14px; }
.fb-anon { margin: 8px 0 12px; font-size: 12px; color: var(--muted); }
.fb-past { font-size: 12.5px; color: var(--muted); }
.complete-actions a.btn, .menu-more a.btn { text-decoration: none; }
.wall-link { justify-self: start; display: inline-flex; align-items: center; gap: 5px; padding: 2px 0; font-size: 13px; color: var(--sky); text-decoration: none; }
.wall-link svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.menu-more { display: grid; gap: 8px; padding: 4px 0; }
.menu-more .btn { justify-content: flex-start; gap: 10px; }
.menu-more svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.complete-actions .row { --gap: 8px; }
.complete-actions .btn.ghost { border: 0; min-height: 42px; color: var(--ink-2); }

/* ---- roam ---------------------------------------------------------------------------------------- */
.roam-bar { position: absolute; left: 12px; right: 12px; top: calc(var(--safe-t) + 10px); max-width: 480px; height: 54px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 0 6px 0 10px; border-radius: 18px; background: var(--glass); border: 1px solid var(--hair); box-shadow: var(--lift-1); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); transform: translateY(-150%); transition: transform .6s var(--ease); }
.roam.in .roam-bar { transform: none; }
.roam-bar .ch-seal { background: var(--sky-deep); box-shadow: inset 0 0 0 2px rgba(255, 246, 234, .55), inset 0 0 0 3.5px var(--sky-deep), inset 0 0 0 4.5px rgba(255, 246, 234, .5); }
.roam-bar h2 { flex: 1; min-width: 0; margin: 0; font-size: 16px; line-height: 1.15; letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roam-bar h2 small { display: block; font-family: var(--sans); font-size: 11.5px; letter-spacing: .04em; color: var(--muted); }
.roam-time { position: absolute; left: 14px; right: 14px; bottom: calc(var(--safe-b) + 82px); max-width: 420px; margin: 0 auto; display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--hair); box-shadow: var(--lift-1); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); opacity: 0; transform: translateY(20px); transition: opacity .4s, transform .5s var(--ease); }
.roam.in .roam-time { opacity: 1; transform: none; }
.roam-time svg { width: 18px; height: 18px; stroke: var(--ink); fill: none; stroke-width: 2; flex: none; }
.roam-time input { flex: 1; accent-color: var(--sky); }
.roam-time span { font-family: var(--serif); font-size: 13px; font-variant-numeric: tabular-nums; min-width: 3.2em; text-align: right; }
.roam-dock { position: absolute; left: 14px; right: 14px; bottom: calc(var(--safe-b) + 14px); max-width: 420px; margin: 0 auto; }
.roam.out { opacity: 0; transition: opacity .4s; }
.bc-photo { position: relative; margin: 0 0 12px; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; box-shadow: var(--lift-1); }
.bc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bc-photo, .shimmer { background: linear-gradient(100deg, var(--paper-2) 30%, #FBF6DF 50%, var(--paper-2) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
img.fade { opacity: 0; transition: opacity .5s var(--ease); }
img.fade.ok { opacity: 1; }
.bc-cap { position: absolute; right: 8px; bottom: 6px; font-size: 11px; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.bc-head { display: flex; align-items: center; gap: 8px; }
.bc-addr { display: flex; align-items: center; gap: 4px; margin: 4px 0; font-size: 13px; color: var(--sky-deep); }
.bc-addr svg { width: 14px; height: 14px; stroke: var(--brick); fill: none; stroke-width: 2.2; }
.bc-blurb { margin: 6px 0 12px; font-size: 15px; line-height: 1.6; }

/* ---- book, help, menu ---------------------------------------------------------------------------- */
.tk-step:empty { display: none; }
.book { display: grid; gap: 14px; }
.book-count { font-family: var(--serif); color: var(--sky); font-size: 13px; }
.bslots { display: grid; gap: 8px; }
.bslots.tools { grid-template-columns: repeat(3, 1fr); }
.bslots.works { grid-template-columns: repeat(2, 1fr); }
.bslot { position: relative; padding: 8px; border-radius: 14px; border: 1.5px dashed rgba(30, 34, 48, .3); background: rgba(242, 234, 203, .45); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.bslot-art { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 50%; border: 1.5px dashed rgba(30, 34, 48, .25); font-family: var(--f-title); font-size: 25px; color: rgba(30, 34, 48, .22); overflow: hidden; }
.bslot.wide .bslot-art { width: 100%; height: 70px; border-radius: 10px; }
.bslot-art img { width: 100%; height: 100%; object-fit: contain; background: #FFFDF4; }
.bslot-name { font-family: var(--serif); font-size: 13px; color: var(--muted); }
.bslot-sub { font-size: 11px; color: var(--ink-4); line-height: 1.3; }
.bslot.got { border: 1px solid var(--hair); background: var(--card); box-shadow: var(--lift-1); }
.bslot.got .bslot-art { background: var(--sun); border: 1px solid rgba(30, 34, 48, .25); color: var(--ink); }
.bslot.got.wide .bslot-art { background: #FFFDF4; }
.bslot.got .bslot-name { color: var(--ink); }
.bslot.got .bslot-sub { color: var(--ink-2); }
.book-note { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.help-task { padding: 10px 14px; border-radius: 16px; background: var(--sky-soft); color: var(--ink); }
.help-task b { font-family: var(--serif); font-weight: 400; font-size: 11px; letter-spacing: .2em; color: var(--sky-deep); }
.help-task p { margin: 2px 0 0; font-size: 16px; line-height: 1.55; font-family: var(--hand-m); }
.help-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.help-list li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.help-list svg { width: 22px; height: 22px; flex: none; stroke: var(--sky); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.help-list b { font-family: var(--serif); font-weight: 400; color: var(--sky-deep); }
.label-legend { display: grid; gap: 8px; padding: 12px; background: rgba(242, 234, 203, .5); border-radius: var(--r-m); border: 1.5px dashed rgba(30, 34, 48, .25); }
.credits { margin: 4px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; font-size: 13.5px; }
.credits dt { font-family: var(--serif); color: var(--sky); }
.credits dd { margin: 0; color: var(--ink-2); }

/* ---- camera-mode transitions --------------------------------------------------------------------- */
.transition { position: fixed; inset: 0; z-index: 50; pointer-events: none; display: grid; place-items: center; }
.transition-text { font-family: var(--f-title); font-size: 24px; letter-spacing: .2em; opacity: 0; transform: translateY(8px); transition: opacity .4s .15s, transform .5s .15s var(--ease); }
.transition.run .transition-text { opacity: 1; transform: none; }
.transition.out { opacity: 0; transition: opacity .45s var(--ease); }
.transition.dive { overflow: hidden; }
.transition.dive::before { content: ""; position: absolute; left: 50%; top: 45%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; background: var(--ink); transform: scale(0); transition: transform .7s cubic-bezier(.5, 0, .2, 1); }
.transition.dive.run::before { transform: scale(220); }
.transition.dive .transition-text { position: relative; color: var(--card); }
.transition.paper { background: var(--card); transform: translateY(100%); transition: transform .7s var(--ease); }
.transition.paper.run { transform: none; }
.transition.fold { perspective: 900px; }
.transition.fold::before { content: ""; position: absolute; inset: 0; background: var(--card); transform-origin: 50% 100%; transition: transform 1.3s cubic-bezier(.6, 0, .3, 1), opacity 1.3s; }
.transition.fold.run::before { transform: rotateX(88deg); opacity: .2; }
.transition.fold .transition-text { position: relative; z-index: 1; background: var(--ink); color: var(--card); padding: 10px 18px; border-radius: 14px; }

/* ---- calibration (operator, camera mode) --------------------------------------------------------- */
.calib-gate { display: grid; place-items: center; padding: 20px; }
.calib-login { width: 100%; max-width: 360px; display: grid; gap: 12px; }
.calib-panel { position: absolute; left: 10px; right: 10px; bottom: calc(var(--safe-b) + 10px); z-index: 8; max-width: 460px; margin: 0 auto; display: grid; gap: 10px; padding: 12px; border-radius: var(--r-l); background: rgba(255, 253, 243, .95); border: 2px solid var(--ink); box-shadow: var(--shadow-2); pointer-events: auto; }
.calib-status { color: var(--ink-2); word-break: break-all; }
.calib-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.calib-grid label, .calib-panel > label { display: grid; gap: 4px; font-size: 12px; color: var(--ink-2); }
.calib-nudge { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.input.num { padding: 8px 10px; }

/* ---- desktop: the phone on a poster -------------------------------------------------------------- */
@media (min-width: 820px) and (min-aspect-ratio: 1/1) {
  :root { --fh: min(calc(100vh - 56px), 900px); --fw: calc(var(--fh) * .462); }
  #desk { display: block; position: fixed; inset: 0; overflow: hidden; background: radial-gradient(1200px 700px at 72% 40%, rgba(255, 253, 243, .9), transparent 70%), var(--paper); }
  #desk::before { content: ""; position: absolute; inset: 0; opacity: .35; pointer-events: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .3  0 0 0 0 .2  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
  .desk-with { position: absolute; left: 3vw; top: 4vh; font-family: "Georgia", var(--f-title); font-weight: 900; font-size: clamp(90px, 15vw, 240px); line-height: .9; color: var(--sun); letter-spacing: -.02em; }
  .desk-with b { display: block; font-family: var(--f-title); font-weight: 400; font-size: 1.12em; letter-spacing: .04em; }
  .desk-side { position: absolute; right: 4vw; top: 50%; transform: translateY(-50%); width: min(300px, 22vw); color: var(--sky); }
  .desk-at { margin: 0 0 10px; font-family: var(--serif); font-size: 15px; display: inline-block; border-bottom: 2px solid var(--sky); }
  .desk-side h2 { font-size: clamp(20px, 2vw, 28px); line-height: 1.45; margin: 6px 0 22px; }
  .desk-side ul { list-style: none; padding: 0; margin: 0 0 22px; color: var(--ink-2); font-size: 14px; }
  .desk-side li { padding: 6px 0; border-bottom: 1px dashed rgba(70, 129, 189, .35); }
  .desk-side li i { font-style: normal; display: inline-block; min-width: 3.2em; color: var(--sky); font-family: var(--serif); }
  .desk-side .chip { cursor: pointer; }
  .desk-foot { position: absolute; left: 3vw; bottom: 3vh; font-family: var(--serif); color: var(--muted); font-size: 13px; letter-spacing: .08em; }
  body:not(.wide) #app {
    inset: auto; left: 50%; top: 50%; width: var(--fw); height: var(--fh); transform: translate(-50%, -50%);
    border-radius: 46px; border: 9px solid var(--ink);
    box-shadow: 0 0 0 1.5px #3a4256, 0 30px 80px rgba(40, 50, 80, .28), 0 8px 18px rgba(40, 50, 80, .18), 14px 14px 0 rgba(70, 129, 189, .22);
  }
  body.wide #desk { display: none; }
  body.wide #ui .hud-top, body.wide #ui .hud-task, body.wide #ui .hud-dock { max-width: 460px; }
  /* sheets and toasts belong to the phone, not the poster */
  body:not(.wide) .scrim { left: calc(50% - var(--fw) / 2); width: var(--fw); top: calc(50% - var(--fh) / 2); height: var(--fh); right: auto; bottom: auto; border-radius: 37px; }
  body:not(.wide) .sheet {
    left: calc(50% - var(--fw) / 2 + 9px); right: auto; width: calc(var(--fw) - 18px); bottom: calc(50% - var(--fh) / 2 + 9px); max-height: calc(var(--fh) * .8);
    border: 0; border-top: 2px solid var(--ink); border-radius: 22px 22px 37px 37px; transform: translateY(30px); opacity: 0; transition: transform .35s var(--ease), opacity .25s;
  }
  body:not(.wide) .sheet.open { transform: none; opacity: 1; }
  body:not(.wide) .toasts { top: calc(50% - var(--fh) / 2 + 128px); }
}

@media (prefers-reduced-motion: reduce) {
  .t-sanmao, .spark i, .spark.ring::before, .locate-card, .pin[data-state="active"] .pin-dot, .pin[data-state="active"] .pin-card, .frame-spot img, .dp-tip { animation: none !important; }
}
