:root {
  --sea-deep: #06161b;
  --sea-night: #0a2027;
  --sea-glass: #2f6f68;
  --sea-glass-2: #4f958a;
  --foam: #bff5e6;
  --stone: #d8cfbd;
  --stone-dim: #a79d8a;
  --clay: #b8612e;
  --bf-red: #8e2f16;
  --gold: #d4a64a;
  --gold-hi: #f0d58d;
  --ink: #efe4cc;
  --ink-dim: rgba(239, 228, 204, 0.72);
  --panel: rgba(8, 24, 29, 0.86);
  --panel-edge: rgba(212, 166, 74, 0.55);
  --display: "Cinzel", "EB Garamond", Georgia, serif;
  --body: "EB Garamond", Garamond, Georgia, serif;
  --meander: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='16' viewBox='0 0 32 16'%3E%3Cpath d='M0 15 V1 H12 V11 H4 V5 H8 M0 15 H16 V1 H28 V11 H20 V5 H24 M16 15 H32' fill='none' stroke='%23d4a64a' stroke-width='1.6' stroke-opacity='.75'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--sea-deep); color: var(--ink); font-family: var(--body); overflow: hidden; -webkit-font-smoothing: antialiased; }
body { touch-action: none; user-select: none; -webkit-user-select: none; }
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; outline: none; cursor: grab; }
#scene.dragging { cursor: grabbing; }
#scene.locked { cursor: none; }
.hidden { display: none !important; }
button { font-family: inherit; }
kbd { font-family: var(--display); font-size: 0.72em; letter-spacing: .02em; display: inline-block; min-width: 1.7em; padding: 0.12em 0.4em; margin: 0 0.12em; border: 1px solid rgba(212,166,74,.6); border-bottom-width: 2px; border-radius: 4px; background: rgba(0,0,0,.35); color: var(--gold-hi); text-align: center; line-height: 1.3; }
.display { font-family: var(--display); font-weight: 600; letter-spacing: 0.06em; }
.eyebrow { font-family: var(--display); letter-spacing: 0.34em; font-size: 0.78rem; color: var(--gold); text-transform: uppercase; }
.greek { font-style: italic; font-size: 1.35rem; color: var(--foam); opacity: .9; margin: .4rem 0 0; }

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(47,111,104,.45), transparent 60%),
    radial-gradient(ellipse at 50% -10%, rgba(142,47,22,.25), transparent 55%),
    linear-gradient(180deg, #071a20, #04100f 70%);
  transition: opacity .9s ease; }
.screen::before { content: ""; position: absolute; inset: 14px; border: 1px solid var(--panel-edge); pointer-events: none; }
.screen::after { content: ""; position: absolute; left: 14px; right: 14px; top: 14px; height: 16px; background: var(--meander) repeat-x; opacity: .7; pointer-events: none; }
.screen.fade { opacity: 0; pointer-events: none; }
.loading-inner, .intro-inner { text-align: center; max-width: 760px; position: relative; }
.loading-inner h1, .intro-inner h1 { font-size: clamp(2.2rem, 6.4vw, 4.6rem); line-height: 1.02; margin: .6rem 0 1rem;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, #8a5f22); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgba(212,166,74,.15); }
.loading-line { font-style: italic; color: var(--ink-dim); font-size: 1.15rem; min-height: 1.6em; }
.loading-hall { font-family: var(--display); letter-spacing: .2em; font-size: .75rem; color: var(--sea-glass-2); text-transform: uppercase; }
.voyage-bar { position: relative; height: 54px; margin: 1.6rem auto .6rem; width: min(560px, 86vw); }
.voyage-track { position: absolute; left: 0; right: 0; top: 34px; height: 2px; background: repeating-linear-gradient(90deg, rgba(191,245,230,.35) 0 10px, transparent 10px 18px); }
.voyage-fill { position: absolute; left: 0; top: 33px; height: 4px; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); box-shadow: 0 0 12px rgba(240,213,141,.6); transition: width .3s ease; }
.voyage-ship { position: absolute; top: 8px; left: 0; width: 40px; height: 24px; margin-left: -20px; color: #0d0907; filter: drop-shadow(0 0 6px rgba(240,213,141,.7)); transition: left .3s ease; animation: bob 2.4s ease-in-out infinite; }
.voyage-ship svg { width: 100%; height: 100%; }
.voyage-end { position: absolute; top: 42px; font-family: var(--display); font-size: .7rem; letter-spacing: .2em; color: var(--stone-dim); text-transform: uppercase; }
.voyage-end.start { left: 0; } .voyage-end.end { right: 0; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(3px) rotate(2deg); } }
.lede { font-size: 1.2rem; line-height: 1.5; color: var(--ink); max-width: 620px; margin: 1rem auto 1.6rem; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 1.6rem; }
.intro-keys { font-size: 1rem; color: var(--ink-dim); line-height: 2; }
.intro-note { margin-top: 1.2rem; font-style: italic; color: var(--sea-glass-2); font-size: .95rem; }
.touch-only { display: none; }
.touch-hint { display: none; }
@media (pointer: coarse) { .touch-only { display: block; } .touch-hint { display: inline; } .key-hint { display: none; } }

.btn { font-family: var(--display); letter-spacing: .12em; text-transform: uppercase; font-size: .82rem; padding: .9em 1.5em; border-radius: 2px; cursor: pointer;
  border: 1px solid var(--panel-edge); color: var(--ink); background: rgba(10, 32, 39, .7); transition: background .25s, border-color .25s, transform .15s, box-shadow .25s; }
.btn:hover, .btn:focus-visible { background: rgba(47,111,104,.55); border-color: var(--gold-hi); box-shadow: 0 0 0 1px rgba(240,213,141,.3), 0 0 24px rgba(191,245,230,.12); outline: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #d9ae55, #a8772c); color: #1a1006; border-color: var(--gold-hi); font-weight: 700; }
.btn.primary:hover, .btn.primary:focus-visible { background: linear-gradient(180deg, #f0cf7c, #c28d36); }
.btn.ghost { background: transparent; }
.btn.small { font-size: .68rem; padding: .6em 1em; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }
.hall-card { position: absolute; left: max(18px, env(safe-area-inset-left)); top: max(16px, env(safe-area-inset-top)); display: flex; gap: 14px; align-items: center; padding: 10px 18px 10px 12px; pointer-events: none;
  background: linear-gradient(90deg, rgba(6,22,27,.82), rgba(6,22,27,.25)); border-left: 2px solid var(--gold); }
.hall-num { font-family: var(--display); font-size: 1.7rem; color: var(--gold-hi); min-width: 2.2ch; text-align: center; text-shadow: 0 0 18px rgba(240,213,141,.3); }
.hall-name { font-family: var(--display); font-size: 1rem; letter-spacing: .08em; }
.hall-books { font-style: italic; font-size: .92rem; color: var(--ink-dim); }
.hall-pips { display: flex; gap: 5px; margin-top: 5px; }
.pip { width: 9px; height: 9px; border: 1px solid var(--gold); transform: rotate(45deg); }
.pip.on { background: var(--foam); border-color: var(--foam); box-shadow: 0 0 8px var(--foam); }
.pip.q { border-radius: 50%; transform: none; }
.pip.a { border-color: var(--sea-glass-2); }
.hud-buttons { position: absolute; right: max(14px, env(safe-area-inset-right)); top: max(14px, env(safe-area-inset-top)); display: flex; gap: 6px; }
.hud-btn { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 58px; padding: 7px 8px 6px; cursor: pointer; color: var(--ink); background: rgba(6,22,27,.72); border: 1px solid rgba(212,166,74,.35); border-radius: 2px; transition: border-color .2s, background .2s, transform .15s; }
.hud-btn:hover, .hud-btn:focus-visible { border-color: var(--gold-hi); background: rgba(47,111,104,.5); outline: none; }
.hud-btn.active { border-color: var(--foam); box-shadow: inset 0 0 0 1px rgba(191,245,230,.4); }
.hud-btn .ico { font-size: 1.1rem; line-height: 1; color: var(--gold-hi); }
.hud-btn .lbl { font-family: var(--display); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; }
.hud-btn kbd { font-size: .55rem; padding: 0 .3em; min-width: 1.4em; }
.thread-line { position: absolute; left: max(18px, env(safe-area-inset-left)); top: 96px; max-width: 360px; font-style: italic; font-size: .92rem; color: var(--ink-dim); pointer-events: none; opacity: 0; transition: opacity 1.2s; text-shadow: 0 1px 6px #000; }
.thread-line.show { opacity: 1; }
.thread-line b { font-style: normal; font-family: var(--display); font-weight: 600; font-size: .7rem; letter-spacing: .16em; color: var(--gold); display: block; }

#reticle { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; border: 1.5px solid rgba(239,228,204,.75); pointer-events: none; transition: width .2s, height .2s, margin .2s, border-color .2s, box-shadow .2s; }
#reticle.focus { width: 26px; height: 26px; margin: -13px 0 0 -13px; border-color: var(--gold-hi); box-shadow: 0 0 14px rgba(240,213,141,.55), inset 0 0 8px rgba(240,213,141,.3); }
#reticle.far { border-color: rgba(191,245,230,.8); }
#reticle.hide { opacity: 0; }
.prompt { position: absolute; left: 50%; top: calc(50% + 30px); transform: translateX(-50%); padding: 8px 16px; background: rgba(6,22,27,.8); border: 1px solid var(--panel-edge); white-space: nowrap; pointer-events: none; font-size: 1rem; text-align: center; }
.prompt .p-name { font-family: var(--display); letter-spacing: .06em; color: var(--gold-hi); }
.prompt .p-kind { font-style: italic; color: var(--ink-dim); font-size: .88rem; display: block; }
.prompt .p-done { color: var(--foam); font-size: .8rem; }
.look-hint { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); font-style: italic; color: var(--ink-dim); background: rgba(6,22,27,.7); padding: 8px 16px; border: 1px solid rgba(212,166,74,.3); pointer-events: none; text-align: center; }

.title-card { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); text-align: center; pointer-events: none; opacity: 0; transition: opacity 1.4s ease, transform 1.4s ease; width: min(90vw, 760px); }
.title-card.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }
.title-card .tc-num { font-family: var(--display); color: var(--gold); letter-spacing: .5em; font-size: .9rem; }
.title-card .tc-name { font-family: var(--display); font-size: clamp(1.6rem, 4.4vw, 3rem); letter-spacing: .07em; color: var(--ink); text-shadow: 0 2px 24px rgba(0,0,0,.9), 0 0 40px rgba(0,0,0,.6); margin: .2em 0; }
.title-card .tc-sub { font-style: italic; font-size: 1.15rem; color: var(--foam); text-shadow: 0 2px 12px #000; }
.title-card .tc-books { font-family: var(--display); font-size: .75rem; letter-spacing: .24em; color: var(--stone-dim); margin-top: .6em; text-transform: uppercase; }

#toasts { position: absolute; right: max(16px, env(safe-area-inset-right)); top: 86px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { background: rgba(6,22,27,.88); border: 1px solid var(--panel-edge); border-left: 3px solid var(--foam); padding: 8px 14px; max-width: 320px; font-size: .95rem; animation: toast-in .5s ease; }
.toast b { font-family: var(--display); font-weight: 600; font-size: .66rem; letter-spacing: .18em; color: var(--gold); display: block; text-transform: uppercase; }
.toast.out { opacity: 0; transform: translateX(20px); transition: all .6s; }
@keyframes toast-in { from { opacity: 0; transform: translateX(20px); } }

.docent-bar { position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); width: min(720px, 92vw); padding: 12px 18px 12px; background: var(--panel); border: 1px solid var(--panel-edge); box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.docent-head { display: flex; justify-content: space-between; font-family: var(--display); font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
#docent-status { color: var(--foam); }
#docent-text { font-size: 1.12rem; line-height: 1.45; margin: .4em 0 .6em; min-height: 3em; }
.docent-actions { display: flex; gap: 8px; justify-content: flex-end; }

.timeline { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); width: min(980px, 96vw); }
.timeline-strip { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; height: 46px; cursor: ew-resize; background: rgba(6,22,27,.75); border: 1px solid rgba(212,166,74,.4); padding: 3px; outline: none; touch-action: none; }
.timeline-strip:focus-visible { border-color: var(--gold-hi); box-shadow: 0 0 0 2px rgba(240,213,141,.3); }
.tl-cell { position: relative; display: grid; place-items: center; font-family: var(--display); color: var(--stone-dim); font-size: 1.05rem; border-bottom: 2px solid transparent; transition: background .2s, color .2s; }
.tl-cell small { position: absolute; bottom: 1px; font-size: .5rem; letter-spacing: .1em; opacity: .7; }
.tl-cell.here { color: var(--gold-hi); border-bottom-color: var(--gold); background: rgba(212,166,74,.12); }
.tl-cell.seen::after { content: ""; position: absolute; top: 3px; right: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--foam); }
.tl-cell.sel { background: rgba(47,111,104,.7); color: var(--ink); }
.timeline.collapsed .timeline-strip { height: 26px; }
.timeline.collapsed .tl-cell { font-size: .75rem; }
.timeline.collapsed .tl-cell small { display: none; }
.timeline-card { display: none; margin-bottom: 8px; padding: 14px 18px; background: var(--panel); border: 1px solid var(--panel-edge); }
.timeline.open .timeline-card { display: block; }
.timeline-card h3 { font-family: var(--display); font-weight: 600; margin: 0 0 .2em; letter-spacing: .06em; font-size: 1.2rem; }
.timeline-card .tl-meta { font-family: var(--display); font-size: .68rem; letter-spacing: .2em; color: var(--gold); text-transform: uppercase; }
.timeline-card p { margin: .4em 0 .7em; font-size: 1.05rem; line-height: 1.4; }
.timeline-card .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.timeline-card .hint { font-style: italic; color: var(--ink-dim); font-size: .9rem; }

/* ---------- panel ---------- */
.panel { position: fixed; right: max(14px, env(safe-area-inset-right)); top: 84px; bottom: 84px; width: min(460px, 42vw); z-index: 20; background: var(--panel); border: 1px solid var(--panel-edge); box-shadow: 0 20px 60px rgba(0,0,0,.55); display: flex; flex-direction: column; animation: panel-in .45s ease; }
.panel::before { content: ""; position: absolute; left: 10px; right: 10px; top: 8px; height: 16px; background: var(--meander) repeat-x; opacity: .6; }
@keyframes panel-in { from { opacity: 0; transform: translateX(24px); } }
.panel-close { position: absolute; top: 26px; right: 10px; width: 38px; height: 38px; border: 1px solid rgba(212,166,74,.4); background: rgba(0,0,0,.3); color: var(--ink); font-size: 1.4rem; cursor: pointer; z-index: 2; }
.panel-close:hover, .panel-close:focus-visible { border-color: var(--gold-hi); outline: none; }
.panel-body { overflow-y: auto; padding: 36px 26px 26px; user-select: text; -webkit-user-select: text; touch-action: pan-y; scrollbar-color: var(--sea-glass) transparent; }
.panel-body h2 { font-family: var(--display); font-weight: 600; font-size: 1.55rem; letter-spacing: .05em; margin: .2em 2rem .3em 0; line-height: 1.15; }
.panel-body .kicker { font-family: var(--display); font-size: .68rem; letter-spacing: .22em; color: var(--gold); text-transform: uppercase; }
.panel-body p { font-size: 1.1rem; line-height: 1.55; margin: .7em 0; }
.panel-body .meta { font-style: italic; color: var(--ink-dim); }
.quote { margin: 1.2em 0; padding: 14px 16px; border-left: 2px solid var(--gold); background: linear-gradient(90deg, rgba(212,166,74,.08), transparent); }
.quote .gr { font-size: 1.22rem; font-style: italic; line-height: 1.5; color: var(--foam); white-space: pre-line; }
.quote .en { font-size: 1.05rem; line-height: 1.5; margin-top: .5em; white-space: pre-line; }
.quote .ref { font-family: var(--display); font-size: .66rem; letter-spacing: .2em; color: var(--gold); margin-top: .5em; text-transform: uppercase; }
.panel-body .emblem { width: 96px; height: 96px; display: block; margin: .4em 0; }
.audio-play { display: flex; gap: 14px; align-items: center; margin: 1em 0; }
.wave { display: flex; gap: 3px; align-items: center; height: 34px; }
.wave i { width: 4px; background: var(--foam); height: 6px; border-radius: 2px; opacity: .5; }
.wave.on i { animation: wave 0.9s ease-in-out infinite; opacity: 1; }
.wave.on i:nth-child(2n) { animation-duration: 1.3s; } .wave.on i:nth-child(3n) { animation-duration: .7s; }
@keyframes wave { 0%,100% { height: 5px; } 50% { height: 30px; } }
.walk-note { font-style: italic; color: var(--sea-glass-2); font-size: .9rem; margin-top: 1.4em; }

/* ---------- inspect ---------- */
body.inspecting #hud > *:not(#toasts) { visibility: hidden; }
body.inspecting #panel { display: none; }
body.inspecting #toasts { right: auto; left: max(20px, env(safe-area-inset-left)); top: auto; bottom: 70px; align-items: flex-start; }
.inspect { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.inspect-stage { position: absolute; inset: 0; pointer-events: auto; cursor: grab; touch-action: none; }
.inspect-stage.dragging { cursor: grabbing; }
.inspect-label { position: absolute; right: max(20px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); width: min(400px, 36vw); max-height: 78vh; overflow-y: auto; pointer-events: auto; padding: 26px 26px 22px; background: var(--panel); border: 1px solid var(--panel-edge); animation: panel-in .5s ease; user-select: text; -webkit-user-select: text; }
.inspect-label .idx { font-family: var(--display); color: var(--gold); letter-spacing: .24em; font-size: .72rem; }
.inspect-label h2 { font-family: var(--display); font-weight: 600; font-size: 1.6rem; margin: .25em 0; letter-spacing: .04em; line-height: 1.15; }
.inspect-label .meta { font-style: italic; color: var(--ink-dim); margin-bottom: .8em; }
.inspect-label p { font-size: 1.1rem; line-height: 1.55; }
.inspect-help { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; color: var(--ink-dim); font-size: .95rem; pointer-events: none; width: min(900px, 94vw); }
.inspect-close { position: absolute; left: max(20px, env(safe-area-inset-left)); top: max(18px, env(safe-area-inset-top)); pointer-events: auto; }

/* ---------- modals ---------- */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 18px; background: rgba(3, 10, 12, .72); backdrop-filter: blur(3px); animation: fade-in .35s ease; }
@keyframes fade-in { from { opacity: 0; } }
.modal-inner { position: relative; width: min(860px, 96vw); max-height: 92vh; overflow-y: auto; background: linear-gradient(180deg, rgba(10,32,39,.97), rgba(6,20,24,.97)); border: 1px solid var(--panel-edge); padding: 40px 36px 30px; box-shadow: 0 30px 90px rgba(0,0,0,.6); user-select: text; -webkit-user-select: text; touch-action: pan-y; }
.modal-inner.wide { width: min(1180px, 97vw); }
.modal-inner::before { content: ""; position: absolute; left: 14px; right: 14px; top: 12px; height: 16px; background: var(--meander) repeat-x; opacity: .6; }
.modal-inner h2 { font-family: var(--display); font-weight: 600; font-size: 1.9rem; letter-spacing: .06em; margin: .3em 0 .2em; }
.modal-inner .kicker { padding-right: 120px; font-family: var(--display); font-size: .7rem; letter-spacing: .24em; color: var(--gold); text-transform: uppercase; }
.modal-close { position: absolute; top: 30px; right: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 1.2em 0; }
.stat { border: 1px solid rgba(212,166,74,.3); padding: 12px; text-align: center; background: rgba(0,0,0,.2); }
.stat .n { font-family: var(--display); font-size: 1.7rem; color: var(--gold-hi); }
.stat .l { font-size: .9rem; color: var(--ink-dim); font-style: italic; }
.hall-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.hall-item { display: grid; grid-template-columns: 2.6em 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid rgba(212,166,74,.22); background: rgba(0,0,0,.18); }
.hall-item .num { font-family: var(--display); color: var(--stone-dim); font-size: 1.1rem; text-align: center; }
.hall-item.visited .num { color: var(--gold-hi); }
.hall-item.complete { border-color: rgba(191,245,230,.5); }
.hall-item .nm { font-family: var(--display); font-size: .9rem; letter-spacing: .04em; }
.hall-item .sub { font-size: .88rem; color: var(--ink-dim); font-style: italic; }
.hall-item .state { font-size: .8rem; font-family: var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--stone-dim); }
.hall-item.visited .state { color: var(--gold); }
.hall-item.complete .state { color: var(--foam); }
.hall-item details { grid-column: 1 / -1; font-size: .92rem; }
.hall-item summary { cursor: pointer; color: var(--sea-glass-2); font-style: italic; }
.hall-item ul { margin: .4em 0 0; padding-left: 1.2em; }
.hall-item li.done { color: var(--foam); }
.hall-item li.todo { color: var(--ink-dim); }
.empty { text-align: center; padding: 1.6em 1em; border: 1px dashed rgba(212,166,74,.35); margin: 1em 0; }
.empty .greek { font-size: 1.1rem; }
.laurel { text-align: center; margin: 1em 0; padding: 1.2em; border: 1px solid rgba(191,245,230,.5); background: radial-gradient(ellipse at center, rgba(191,245,230,.1), transparent 70%); }
.laurel h3 { font-family: var(--display); font-weight: 600; letter-spacing: .1em; color: var(--foam); margin: .2em 0; }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 1.4em; }
.help-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 28px; }
.help-grid h3 { font-family: var(--display); font-weight: 600; font-size: .9rem; letter-spacing: .16em; color: var(--gold); text-transform: uppercase; margin: 0 0 .5em; border-bottom: 1px solid rgba(212,166,74,.3); padding-bottom: .3em; }
.help-grid table { width: 100%; border-collapse: collapse; font-size: 1.02rem; }
.help-grid td { padding: 4px 0; vertical-align: top; }
.help-grid td:first-child { white-space: nowrap; padding-right: 12px; width: 1%; }
.help-note { font-style: italic; color: var(--ink-dim); font-size: .95rem; margin-top: 1em; }
.settings { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 26px; margin-top: .6em; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid rgba(212,166,74,.15); font-size: 1rem; }
.setting label { cursor: pointer; }
.setting small { display: block; color: var(--ink-dim); font-style: italic; font-size: .85rem; }
.setting input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--gold); cursor: pointer; }
.setting input[type=range] { accent-color: var(--gold); width: 120px; }
.setting select { background: var(--sea-night); color: var(--ink); border: 1px solid var(--panel-edge); font-family: var(--body); font-size: 1rem; padding: 3px 6px; }
.map-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; align-items: start; }
.map-grid canvas { width: 100%; height: auto; display: block; border: 1px solid var(--panel-edge); background: #0a1f2c; }
.plan-wrap { position: relative; }
.plan-legend { font-size: .9rem; color: var(--ink-dim); font-style: italic; margin-top: .5em; }
.map-caption { font-size: .95rem; font-style: italic; color: var(--ink-dim); margin-top: .5em; }
.exit .modal-inner { text-align: center; background: radial-gradient(ellipse at 50% 0%, rgba(240,160,170,.16), transparent 60%), linear-gradient(180deg, rgba(10,24,34,.98), rgba(5,12,16,.98)); }
.exit h2 { font-size: 2.6rem; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.exit .quote { text-align: left; }
.exit .row-actions { justify-content: center; }

/* ---------- touch ---------- */
.touch { position: absolute; inset: auto 0 0 0; height: 0; }
.stick { position: absolute; left: max(22px, env(safe-area-inset-left)); bottom: max(78px, calc(env(safe-area-inset-bottom) + 66px)); width: 128px; height: 128px; border-radius: 50%; border: 1px solid rgba(212,166,74,.55); background: radial-gradient(circle, rgba(47,111,104,.35), rgba(6,22,27,.55)); touch-action: none; }
.stick-knob { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f0d58d, #a8772c); box-shadow: 0 0 16px rgba(240,213,141,.4); }
.stick span { position: absolute; color: var(--gold-hi); font-size: .9rem; opacity: .8; pointer-events: none; }
.stick-l { left: 8px; top: 50%; transform: translateY(-50%); } .stick-r { right: 8px; top: 50%; transform: translateY(-50%); }
.stick-u { top: 5px; left: 50%; transform: translateX(-50%); } .stick-d { bottom: 5px; left: 50%; transform: translateX(-50%); }
.touch-btn { position: absolute; right: max(20px, env(safe-area-inset-right)); width: 88px; height: 52px; font-family: var(--display); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink); background: rgba(6,22,27,.75); border: 1px solid var(--panel-edge); border-radius: 26px; touch-action: none; }
#t-examine { bottom: max(150px, calc(env(safe-area-inset-bottom) + 138px)); border-color: var(--gold-hi); }
#t-lean { bottom: max(86px, calc(env(safe-area-inset-bottom) + 74px)); }
.touch-btn.on { background: rgba(47,111,104,.8); }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .hud-btn { min-width: 44px; min-height: 44px; padding: 6px 5px; }
  .hud-btn .lbl, .hud-btn kbd { display: none; }
  .hud-btn .ico { font-size: 1.2rem; }
  .hud-buttons { top: auto; bottom: max(8px, env(safe-area-inset-bottom)); right: 50%; transform: translateX(50%); gap: 4px; }
  .hall-card { padding: 8px 12px 8px 8px; max-width: 70vw; }
  .hall-num { font-size: 1.3rem; }
  .hall-name { font-size: .86rem; }
  .thread-line { display: none; }
  .timeline { bottom: calc(max(8px, env(safe-area-inset-bottom)) + 52px); }
  .timeline.collapsed { display: none; }
  .panel { left: 8px; right: 8px; width: auto; top: auto; bottom: calc(max(8px, env(safe-area-inset-bottom)) + 56px); max-height: 52vh; }
  .inspect-label { left: 8px; right: 8px; width: auto; top: auto; bottom: 8px; transform: none; max-height: 40vh; padding: 18px; }
  .inspect-label h2 { font-size: 1.25rem; }
  .inspect-help { bottom: auto; top: 76px; font-size: .9rem; gap: 8px; }
  body.inspecting #toasts { display: none; }
  .panel { background: rgba(8, 24, 29, 0.96); }
  .docent-bar { bottom: calc(max(8px, env(safe-area-inset-bottom)) + 56px); }
  .docent-bar p { font-size: 1rem; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hall-list, .help-grid, .settings, .map-grid { grid-template-columns: 1fr; }
  .modal-inner { padding: 34px 18px 22px; }
  .prompt { white-space: normal; max-width: 80vw; }
  #toasts { top: 74px; }
  .look-hint { bottom: 150px; width: 86vw; }
  .touch-btn { width: 80px; }
}
@media (max-width: 820px) and (pointer: coarse) {
  .timeline { display: none; }
  .timeline.open { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .voyage-ship, .wave.on i { animation: none; }
}
