/* ═══════════════════════════════════════════════════════════════════════
   THE MUSEUM OF THE ODYSSEY — interface skin
   Palette: night marble, sea-glass, fired clay, gold leaf, foam.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  /* stone */
  --marble-100: #efe9db;
  --marble-200: #ded6c4;
  --marble-300: #c3baa5;
  --marble-400: #9a927f;
  --stone-600:  #5d5a4f;
  --stone-800:  #2b2c28;

  /* night & sea */
  --night-900:  #05090c;
  --night-800:  #08121a;
  --night-700:  #0b1a22;
  --night-600:  #10262e;
  --sea-700:    #0e3b3c;
  --sea-600:    #14524f;
  --sea-500:    #1c6f66;
  --seaglass:   #79c7b6;
  --foam:       #bff2e2;

  /* clay & fire */
  --clay-700:   #7c3620;
  --clay-600:   #a8452a;
  --clay-500:   #c25a33;
  --clay-400:   #d98551;
  --slip:       #e3a06a;
  --figure:     #17110d;

  /* gold */
  --gold-700:   #8a6a22;
  --gold-500:   #c8a24a;
  --gold-400:   #dfbc6b;
  --gold-200:   #f2e0ad;

  --ink:        #efe7d6;
  --ink-dim:    #b6ae9c;
  --ink-faint:  #7d7768;

  --ui-bg:      rgba(9, 18, 22, 0.90);
  --ui-bg-solid:#0a161b;
  --ui-line:    rgba(200, 162, 74, 0.30);
  --ui-line-soft: rgba(222, 214, 196, 0.14);

  --display: 'Inscription', 'Optima', 'Trajan Pro', Georgia, serif;
  --text: 'Scholar', 'EB Garamond', 'Iowan Old Style', Georgia, 'Times New Roman', serif;

  --shadow-deep: 0 30px 90px rgba(0,0,0,.72), 0 4px 18px rgba(0,0,0,.5);
  --ease: cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; width: 100%;
  background: var(--night-900);
  color: var(--ink);
  font-family: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
  touch-action: none;
}
body { cursor: default; }
body.pointer-locked { cursor: none; }
body.grabbing { cursor: grabbing; }

.hidden { display: none !important; }
button { font-family: inherit; color: inherit; }

/* ── stage ─────────────────────────────────────────────────────────── */
#stage { position: fixed; inset: 0; }
#scene { display: block; width: 100%; height: 100%; }

#vignette {
  position: fixed; inset: 0; pointer-events: none; z-index: 2;
  background:
    radial-gradient(130% 100% at 50% 45%, rgba(0,0,0,0) 42%, rgba(0,0,0,.42) 78%, rgba(0,0,0,.72) 100%);
  mix-blend-mode: multiply;
  transition: opacity .8s var(--ease);
}
#grain {
  position: fixed; inset: -50%; pointer-events: none; z-index: 3; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  animation: grainshift 5s steps(5) infinite;
}
@keyframes grainshift {
  0%{transform:translate(0,0)} 20%{transform:translate(-3%,2%)} 40%{transform:translate(2%,-3%)}
  60%{transform:translate(-2%,-2%)} 80%{transform:translate(3%,1%)} 100%{transform:translate(0,0)}
}

/* ── veil (loader, fatal) ──────────────────────────────────────────── */
.veil {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background:
    radial-gradient(120% 90% at 50% 20%, #10262e 0%, #08131a 45%, #04080b 100%);
}
.veil::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(80% 60% at 50% 110%, rgba(28,111,102,.20), transparent 60%);
}
.loader-inner {
  position: relative; z-index: 1;
  width: min(760px, 88vw); text-align: center; padding: 4vh 0;
}
.loader-rule {
  height: 1px; margin: 0 auto 22px;
  width: 62%;
  background: linear-gradient(90deg, transparent, var(--gold-700) 12%, var(--gold-400) 50%, var(--gold-700) 88%, transparent);
  opacity: .75;
}
.loader-rule.bottom { margin: 26px auto 30px; }
.loader-kicker {
  font-family: var(--text); font-style: italic; font-size: 15px; letter-spacing: .04em;
  color: var(--ink-faint); margin: 0 0 18px;
}
.loader-title {
  font-family: var(--display); font-weight: 600;
  font-size: clamp(30px, 6.4vw, 66px); line-height: 1.02;
  letter-spacing: .1em; margin: 0; color: var(--marble-100);
  text-shadow: 0 0 44px rgba(121,199,182,.20), 0 3px 0 rgba(0,0,0,.5);
  display: flex; flex-direction: column; align-items: center; gap: .12em;
}
.loader-title.small { font-size: clamp(22px,4vw,34px); letter-spacing: .08em; }
.loader-title .of {
  font-family: var(--text); font-style: italic; font-size: .34em;
  letter-spacing: .22em; color: var(--gold-400); text-transform: lowercase;
}
.loader-greek {
  font-family: var(--text); font-size: clamp(11px, 1.5vw, 15px);
  letter-spacing: .42em; color: var(--seaglass); opacity: .68; margin: 22px 0 0;
  padding-left: .42em;
}
.loader-bar {
  width: min(430px, 74vw); height: 2px; margin: 0 auto;
  background: rgba(222,214,196,.12); overflow: hidden;
}
.loader-bar span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--sea-500), var(--gold-400));
  transition: width .35s var(--ease);
  box-shadow: 0 0 12px rgba(200,162,74,.6);
}
.loader-status {
  font-size: 14px; color: var(--ink-dim); letter-spacing: .05em;
  margin: 16px 0 0; min-height: 1.4em; font-style: italic;
}
.loader-manifest {
  margin: 12px auto 0; width: min(520px, 84vw); height: 54px;
  font-size: 11.5px; line-height: 1.5; color: var(--ink-faint);
  letter-spacing: .06em; text-transform: lowercase; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-start;
  opacity: .8;
}
.loader-manifest span { opacity: 0; animation: manifestin .5s forwards; }
@keyframes manifestin { to { opacity: 1; } }
.loader-foot {
  margin: 30px 0 0; font-size: 11px; letter-spacing: .28em;
  text-transform: uppercase; color: var(--ink-faint); opacity: .6;
}

.enter-btn {
  margin: 30px auto 0; display: block; position: relative;
  background: transparent; border: 1px solid var(--ui-line);
  padding: 18px 54px 15px; cursor: pointer;
  transition: all .45s var(--ease); opacity: 0; pointer-events: none;
  transform: translateY(8px);
}
.enter-btn:not([disabled]) { opacity: 1; pointer-events: auto; transform: none; }
.enter-btn .enter-label {
  display: block; font-family: var(--display); font-size: 18px;
  letter-spacing: .28em; color: var(--gold-200);
}
.enter-btn .enter-sub {
  display: block; margin-top: 8px; font-size: 11px; font-style: italic;
  letter-spacing: .14em; color: var(--ink-faint);
}
.enter-btn:hover:not([disabled]) {
  border-color: var(--gold-400);
  background: rgba(200,162,74,.07);
  box-shadow: 0 0 40px rgba(200,162,74,.16) inset, 0 0 26px rgba(200,162,74,.10);
}
.enter-btn:hover:not([disabled]) .enter-label { color: #fff3d2; }

#loader.leaving { opacity: 0; pointer-events: none; transition: opacity 1.5s var(--ease); }

/* ── HUD ───────────────────────────────────────────────────────────── */
#hud { position: fixed; inset: 0; z-index: 20; pointer-events: none; }
#hud > * { pointer-events: auto; }

#reticle {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 26px; height: 26px; pointer-events: none;
  display: grid; place-items: center; z-index: 21;
}
#reticle .dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: rgba(239,231,214,.62);
  transition: all .25s var(--ease);
  box-shadow: 0 0 4px rgba(0,0,0,.8);
}
#reticle .ring {
  position: absolute; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid rgba(200,162,74,0); transform: scale(.6);
  transition: all .3s var(--ease);
}
#reticle.hot .dot { width: 4px; height: 4px; background: var(--gold-200); }
#reticle.hot .ring { border-color: rgba(223,188,107,.85); transform: scale(1); }
#reticle.hot .ring::after {
  content:''; position:absolute; inset:-5px; border-radius:50%;
  border:1px solid rgba(223,188,107,.22);
}

#place {
  position: fixed; left: 26px; top: 22px; max-width: 330px;
  text-shadow: 0 2px 10px rgba(0,0,0,.9);
  transition: opacity .5s var(--ease);
}
.place-eyebrow {
  font-size: 10px; letter-spacing: .34em; text-transform: uppercase;
  color: var(--gold-500); opacity: .9; margin-bottom: 6px;
}
.place-name {
  font-family: var(--display); font-size: 21px; letter-spacing: .1em;
  color: var(--marble-100); line-height: 1.2;
}
.place-books {
  font-size: 12.5px; font-style: italic; color: var(--ink-faint);
  margin-top: 5px; letter-spacing: .06em;
}
#place.shift { animation: placein .9s var(--ease); }
@keyframes placein { from { opacity: 0; transform: translateY(-8px); } }

#progress-cluster {
  position: fixed; right: 22px; top: 20px;
  display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end;
}
.chip {
  background: rgba(8,18,24,.62); border: 1px solid var(--ui-line-soft);
  color: var(--ink-dim); font-size: 11.5px; letter-spacing: .13em;
  text-transform: uppercase; padding: 7px 11px 6px; cursor: pointer;
  transition: all .25s var(--ease); backdrop-filter: blur(7px);
  display: inline-flex; align-items: center; gap: 7px;
}
.chip em {
  font-style: normal; color: var(--gold-400); font-size: 11px;
  letter-spacing: .06em;
}
.chip .chip-key {
  display: inline-grid; place-items: center; width: 15px; height: 15px;
  border: 1px solid var(--ui-line); color: var(--gold-500);
  font-size: 9px; letter-spacing: 0; line-height: 1;
}
.chip:hover { color: var(--marble-100); border-color: var(--ui-line); background: rgba(20,45,52,.72); }
.chip.active { border-color: var(--gold-400); color: var(--gold-200); }

#prompt {
  position: fixed; left: 50%; bottom: 21vh; transform: translateX(-50%);
  text-align: center; min-width: 260px; pointer-events: none;
  animation: promptin .28s var(--ease);
}
@keyframes promptin { from { opacity: 0; transform: translate(-50%, 6px); } }
.prompt-kind {
  font-size: 9.5px; letter-spacing: .38em; text-transform: uppercase;
  color: var(--gold-500); margin-bottom: 7px;
}
.prompt-name {
  font-family: var(--display); font-size: 19px; letter-spacing: .08em;
  color: var(--marble-100); text-shadow: 0 2px 16px rgba(0,0,0,.95);
}
.prompt-action {
  margin-top: 9px; font-size: 12.5px; font-style: italic; color: var(--ink-dim);
  letter-spacing: .1em;
}
.key {
  display: inline-grid; place-items: center; min-width: 19px; height: 19px;
  padding: 0 5px; border: 1px solid var(--ui-line); color: var(--gold-300, var(--gold-400));
  font-family: var(--text); font-style: normal; font-size: 11px;
  letter-spacing: .04em; vertical-align: middle; background: rgba(0,0,0,.35);
}

/* narration */
#narration {
  position: fixed; left: 50%; bottom: 12vh; transform: translateX(-50%);
  width: min(760px, 86vw); text-align: center;
  background: linear-gradient(180deg, rgba(6,14,18,.0), rgba(6,14,18,.82) 24%, rgba(6,14,18,.86));
  padding: 20px 30px 16px; border-top: 1px solid var(--ui-line-soft);
  animation: narrin .5s var(--ease);
}
@keyframes narrin { from { opacity: 0; transform: translate(-50%, 12px); } }
.narration-speaker {
  font-size: 9.5px; letter-spacing: .4em; text-transform: uppercase;
  color: var(--gold-500); margin-bottom: 9px;
}
.narration-text {
  margin: 0; font-size: clamp(15px, 1.9vw, 19px); line-height: 1.62;
  color: var(--marble-100); text-shadow: 0 2px 14px rgba(0,0,0,.9);
}
.narration-text .grc { color: var(--seaglass); font-style: italic; }
.narration-progress { height: 1px; background: rgba(222,214,196,.13); margin-top: 15px; }
.narration-progress span { display: block; height: 100%; background: var(--gold-500); width: 0%; }
.narration-hint {
  margin-top: 10px; font-size: 10.5px; letter-spacing: .16em;
  color: var(--ink-faint); text-transform: lowercase;
}

/* toasts */
#toasts {
  position: fixed; right: 24px; bottom: 108px; width: 320px;
  display: flex; flex-direction: column; gap: 9px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  background: rgba(8,20,25,.90); border-left: 2px solid var(--gold-500);
  padding: 11px 15px 10px; width: 100%;
  box-shadow: 0 12px 34px rgba(0,0,0,.55);
  animation: toastin .5s var(--ease), toastout .6s var(--ease) 5.2s forwards;
  backdrop-filter: blur(6px);
}
@keyframes toastin { from { opacity: 0; transform: translateX(26px); } }
@keyframes toastout { to { opacity: 0; transform: translateX(26px); } }
.toast-kind {
  font-size: 9px; letter-spacing: .32em; text-transform: uppercase;
  color: var(--gold-500); margin-bottom: 5px;
}
.toast-name { font-size: 14.5px; color: var(--marble-100); line-height: 1.35; }
.toast-note { font-size: 12px; font-style: italic; color: var(--ink-faint); margin-top: 3px; }
.toast.seal { border-left-color: var(--seaglass); }
.toast.seal .toast-kind { color: var(--seaglass); }

/* compass */
#compass {
  position: fixed; left: 50%; top: 16px; transform: translateX(-50%);
  width: 156px; height: 22px; overflow: hidden; opacity: .45;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 22%, #000 78%, transparent);
}
.compass-rose { position: absolute; inset: 0; }
#compass-needle {
  position: absolute; top: 3px; width: 1px; height: 9px; background: var(--gold-400);
  left: 50%;
}
.compass-cardinals {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--display); font-size: 10px; letter-spacing: .3em;
  color: var(--ink-faint); padding-top: 8px;
}

/* ── timeline ──────────────────────────────────────────────────────── */
#timeline {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(1120px, 96vw);
  background: linear-gradient(180deg, rgba(7,16,20,.0), rgba(7,16,20,.92) 40%);
  transition: transform .5s var(--ease);
}
#timeline.collapsed .tl-body { display: none; }
#timeline.collapsed { background: none; }
.tl-head {
  display: flex; align-items: center; gap: 16px; justify-content: center;
  padding: 8px 14px;
}
.tl-toggle {
  background: rgba(8,18,24,.62); border: 1px solid var(--ui-line-soft);
  color: var(--ink-dim); font-size: 11px; letter-spacing: .18em;
  text-transform: uppercase; padding: 7px 13px 6px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; backdrop-filter: blur(6px);
  transition: all .25s var(--ease);
}
.tl-toggle:hover { color: var(--marble-100); border-color: var(--ui-line); }
.tl-readout { font-size: 12.5px; color: var(--ink-faint); letter-spacing: .05em; }
#timeline.collapsed .tl-readout { opacity: 0; }
.tl-readout em { font-style: italic; color: var(--seaglass); opacity: .85; }
.tl-body { padding: 4px 26px 20px; }
.tl-track {
  position: relative; display: grid; grid-template-columns: repeat(24, 1fr);
  gap: 2px; height: 44px; align-items: end;
}
.tl-tick {
  position: relative; height: 100%; cursor: pointer;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  gap: 4px; padding-bottom: 2px;
}
.tl-tick .bar {
  width: 100%; background: rgba(222,214,196,.16); transition: all .3s var(--ease);
}
.tl-tick .num {
  font-family: var(--display); font-size: 9px; letter-spacing: .04em;
  color: var(--ink-faint); transition: color .3s var(--ease);
}
.tl-tick:hover .bar { background: rgba(223,188,107,.6); }
.tl-tick.visited .bar { background: linear-gradient(180deg, var(--sea-500), rgba(28,111,102,.35)); }
.tl-tick.active .bar { background: linear-gradient(180deg, var(--gold-200), var(--gold-700)); box-shadow: 0 0 14px rgba(223,188,107,.55); }
.tl-tick.active .num { color: var(--gold-200); }
.tl-scrub { margin-top: 6px; }
#tl-range {
  width: 100%; -webkit-appearance: none; appearance: none; height: 2px;
  background: linear-gradient(90deg, var(--gold-700), rgba(222,214,196,.15));
  outline: none; cursor: pointer;
}
#tl-range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: var(--gold-200); box-shadow: 0 0 12px rgba(223,188,107,.8); cursor: grab;
}
#tl-range::-moz-range-thumb {
  width: 13px; height: 13px; border: none; border-radius: 50%;
  background: var(--gold-200); box-shadow: 0 0 12px rgba(223,188,107,.8);
}
.tl-detail {
  display: grid; grid-template-columns: 1fr 190px; gap: 26px; margin-top: 14px;
  border-top: 1px solid var(--ui-line-soft); padding-top: 13px;
}
.tl-detail h4 {
  margin: 0 0 6px; font-family: var(--display); font-size: 13.5px;
  letter-spacing: .14em; color: var(--gold-200); font-weight: 500;
}
.tl-detail p {
  margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-dim);
  max-height: 4.9em; overflow: hidden;
}
.tl-detail-right { text-align: right; }
.tl-hall-label {
  font-size: 9px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 5px;
}
#tl-hall { font-size: 13px; color: var(--seaglass); line-height: 1.4; margin-bottom: 9px; font-style: italic; }
.ghost-btn {
  background: transparent; border: 1px solid var(--ui-line);
  color: var(--gold-200); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; padding: 8px 14px 7px; cursor: pointer;
  transition: all .25s var(--ease); font-family: var(--text);
}
.ghost-btn:hover:not([disabled]) { background: rgba(200,162,74,.1); border-color: var(--gold-400); }
.ghost-btn[disabled] { opacity: .32; cursor: default; }
.ghost-btn.danger { color: var(--clay-400); border-color: rgba(194,90,51,.35); }
.ghost-btn.danger:hover { background: rgba(194,90,51,.12); border-color: var(--clay-500); }

/* ── inspector ─────────────────────────────────────────────────────── */
#inspector {
  position: fixed; inset: 0; z-index: 40; display: grid;
  grid-template-columns: 1fr minmax(340px, 33vw);
  background: radial-gradient(90% 80% at 32% 50%, rgba(6,16,20,.72), rgba(3,7,9,.94));
  backdrop-filter: blur(3px);
  animation: fadein .45s var(--ease);
}
@keyframes fadein { from { opacity: 0; } }
#inspector.closing { animation: fadeout .3s var(--ease) forwards; }
@keyframes fadeout { to { opacity: 0; } }
#inspect-stagewrap { position: relative; }
#inspect-canvas { width: 100%; height: 100%; display: block; cursor: grab; }
#inspect-canvas:active { cursor: grabbing; }
.inspect-turn-hint {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  display: flex; gap: 22px; font-size: 11px; letter-spacing: .16em;
  color: var(--ink-faint); text-transform: lowercase; pointer-events: none;
  align-items: center;
}
#inspect-panel {
  background: linear-gradient(180deg, rgba(10,22,27,.97), rgba(6,14,18,.99));
  border-left: 1px solid var(--ui-line);
  padding: 46px 40px; overflow-y: auto;
  box-shadow: -30px 0 80px rgba(0,0,0,.6);
  animation: panelin .55s var(--ease);
}
@keyframes panelin { from { transform: translateX(40px); opacity: 0; } }
.lab-cat {
  font-size: 10px; letter-spacing: .34em; color: var(--gold-500);
  text-transform: uppercase; margin-bottom: 14px;
}
.lab-title {
  font-family: var(--display); font-size: 25px; line-height: 1.22;
  letter-spacing: .05em; color: var(--marble-100); margin: 0 0 10px; font-weight: 500;
}
.lab-greek {
  font-size: 17px; color: var(--seaglass); font-style: italic;
  letter-spacing: .02em; margin-bottom: 12px;
}
.lab-meta {
  font-size: 12px; color: var(--ink-faint); line-height: 1.75; font-style: italic;
}
.lab-meta b { font-style: normal; font-weight: 400; color: var(--ink-dim); letter-spacing: .04em; }
.lab-rule { height: 1px; background: linear-gradient(90deg, var(--gold-700), transparent 78%); margin: 22px 0; }
.lab-body { font-size: 15.5px; line-height: 1.78; color: var(--ink-dim); }
.lab-body p { margin: 0 0 15px; }
.lab-body p:first-child::first-letter {
  font-family: var(--display); font-size: 2.9em; float: left; line-height: .84;
  padding: .07em .12em 0 0; color: var(--gold-400);
}
.lab-body em { color: var(--marble-200); }
.lab-body .grc { color: var(--seaglass); font-style: italic; }
.lab-quote {
  margin: 26px 0 0; padding: 18px 0 4px 20px; border-left: 1px solid var(--ui-line);
}
.lab-quote .grc {
  font-size: 16px; line-height: 1.72; color: var(--seaglass);
  font-style: italic; margin: 0 0 10px;
}
.lab-quote .eng {
  font-size: 14.5px; line-height: 1.7; color: var(--ink-dim); margin: 0 0 9px;
}
.lab-quote cite {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--gold-500); font-style: normal;
}
.lab-foot { margin-top: 30px; display: flex; flex-direction: column; gap: 16px; }
.lab-gift {
  font-size: 11.5px; font-style: italic; color: var(--ink-faint);
  line-height: 1.6; border-top: 1px solid var(--ui-line-soft); padding-top: 14px;
}

/* ── reader (wall texts) ───────────────────────────────────────────── */
#reader {
  position: fixed; inset: 0; z-index: 42; display: grid; place-items: center;
  background: rgba(3,8,10,.80); backdrop-filter: blur(6px);
  animation: fadein .4s var(--ease);
}
.reader-sheet {
  position: relative; width: min(880px, 92vw); max-height: 86vh;
  background:
    linear-gradient(180deg, rgba(16,30,35,.98), rgba(9,19,24,.99));
  border: 1px solid var(--ui-line); box-shadow: var(--shadow-deep);
  padding: 46px 54px 40px; overflow: hidden;
  display: flex; flex-direction: column;
  animation: sheetin .5s var(--ease);
}
@keyframes sheetin { from { transform: translateY(18px) scale(.99); opacity: 0; } }
.reader-head { flex: none; }
.reader-eyebrow {
  font-size: 10px; letter-spacing: .38em; text-transform: uppercase;
  color: var(--gold-500); margin-bottom: 13px;
}
.reader-head h2 {
  font-family: var(--display); font-size: clamp(23px, 3vw, 31px);
  letter-spacing: .07em; margin: 0 0 9px; color: var(--marble-100); font-weight: 500;
}
.reader-greek { font-size: 17px; color: var(--seaglass); font-style: italic; margin-bottom: 20px; }
.reader-scroll {
  overflow-y: auto; padding-right: 22px; margin-right: -14px;
  border-top: 1px solid var(--ui-line-soft); padding-top: 24px;
  font-size: 16px; line-height: 1.82; color: var(--ink-dim);
  columns: 2; column-gap: 42px; column-rule: 1px solid var(--ui-line-soft);
}
.reader-scroll p { margin: 0 0 16px; break-inside: avoid; }
.reader-scroll p:first-child::first-letter {
  font-family: var(--display); font-size: 3.1em; float: left; line-height: .82;
  padding: .06em .1em 0 0; color: var(--gold-400);
}
.reader-scroll h4 {
  font-family: var(--display); font-size: 12.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--gold-500); margin: 22px 0 10px; font-weight: 500;
  break-after: avoid;
}
.reader-scroll blockquote {
  margin: 0 0 18px; padding-left: 16px; border-left: 1px solid var(--ui-line);
  break-inside: avoid;
}
.reader-scroll blockquote .grc { color: var(--seaglass); font-style: italic; margin: 0 0 8px; }
.reader-scroll blockquote cite {
  font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--gold-500); font-style: normal; display: block; margin-top: 6px;
}
.close-x {
  position: absolute; right: 18px; top: 14px; width: 34px; height: 34px;
  background: none; border: none; color: var(--ink-faint); font-size: 26px;
  cursor: pointer; line-height: 1; transition: color .25s var(--ease);
}
.close-x:hover { color: var(--gold-200); }

/* ── overlays (journal / plan / help) ──────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 44; display: grid; place-items: center;
  background: rgba(3,8,10,.84); backdrop-filter: blur(7px);
  animation: fadein .35s var(--ease); padding: 3vh 2vw;
}
.overlay-sheet {
  position: relative; width: min(1080px, 95vw); max-height: 94vh;
  background: linear-gradient(180deg, rgba(15,29,34,.98), rgba(8,17,21,.99));
  border: 1px solid var(--ui-line); box-shadow: var(--shadow-deep);
  display: flex; flex-direction: column; overflow: hidden;
  animation: sheetin .45s var(--ease);
}
.ov-head { padding: 34px 44px 20px; border-bottom: 1px solid var(--ui-line-soft); flex: none; }
.ov-eyebrow {
  font-size: 10px; letter-spacing: .38em; text-transform: uppercase;
  color: var(--gold-500); margin-bottom: 11px;
}
.ov-head h2 {
  font-family: var(--display); font-size: clamp(22px,2.8vw,29px); letter-spacing: .08em;
  margin: 0; color: var(--marble-100); font-weight: 500;
}
.ov-sub { margin: 10px 0 0; font-size: 14px; font-style: italic; color: var(--ink-faint); }

.journal-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px; background: var(--ui-line-soft); border-bottom: 1px solid var(--ui-line-soft);
  flex: none;
}
.jstat { background: rgba(8,17,21,.9); padding: 16px 20px; }
.jstat b {
  display: block; font-family: var(--display); font-size: 22px;
  color: var(--gold-200); font-weight: 500; letter-spacing: .04em;
}
.jstat span {
  display: block; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--ink-faint); margin-top: 5px;
}
.jstat .jbar { height: 2px; background: rgba(222,214,196,.12); margin-top: 10px; }
.jstat .jbar i { display: block; height: 100%; background: var(--sea-500); }

.journal-grid {
  overflow-y: auto; padding: 26px 44px 30px; display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px;
}
.jhall {
  border: 1px solid var(--ui-line-soft); padding: 17px 19px 15px;
  background: rgba(255,255,255,.012); transition: all .3s var(--ease);
}
.jhall.visited { border-color: rgba(28,111,102,.42); background: rgba(20,82,79,.07); }
.jhall.complete { border-color: rgba(200,162,74,.42); background: rgba(200,162,74,.05); }
.jhall.locked { opacity: .5; }
.jhall-num {
  font-family: var(--display); font-size: 10px; letter-spacing: .28em;
  color: var(--gold-500); margin-bottom: 7px;
}
.jhall h3 {
  font-family: var(--display); font-size: 15.5px; letter-spacing: .05em;
  margin: 0 0 4px; color: var(--marble-100); font-weight: 500; line-height: 1.3;
}
.jhall .jgreek { font-size: 13px; color: var(--seaglass); font-style: italic; opacity: .8; margin-bottom: 10px; }
.jhall ul { list-style: none; margin: 10px 0 0; padding: 0; }
.jhall li {
  font-size: 13px; line-height: 1.6; color: var(--ink-faint);
  display: flex; align-items: baseline; gap: 8px; padding: 2px 0;
}
.jhall li .mark {
  width: 9px; flex: none; color: var(--stone-600); font-size: 10px;
}
.jhall li.done { color: var(--ink-dim); }
.jhall li.done .mark { color: var(--gold-400); }
.jhall .jmeta {
  margin-top: 11px; padding-top: 9px; border-top: 1px solid var(--ui-line-soft);
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint);
  display: flex; justify-content: space-between; align-items: center;
}
.jhall .jgo {
  background: none; border: none; color: var(--gold-500); cursor: pointer;
  font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; padding: 0;
  font-family: var(--text);
}
.jhall .jgo:hover { color: var(--gold-200); text-decoration: underline; }
.journal-empty {
  grid-column: 1/-1; text-align: center; padding: 40px 20px;
  color: var(--ink-faint); font-style: italic; font-size: 15px; line-height: 1.8;
}
.journal-empty .big {
  font-family: var(--display); font-size: 19px; letter-spacing: .1em;
  color: var(--marble-300); display: block; margin-bottom: 14px; font-style: normal;
}
.journal-foot {
  flex: none; padding: 18px 44px 22px; border-top: 1px solid var(--ui-line-soft);
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
}
.journal-completion { font-size: 13px; font-style: italic; color: var(--ink-faint); line-height: 1.6; }
.journal-completion.done { color: var(--gold-200); font-style: normal; letter-spacing: .06em; }

/* plan */
.plan-wrap { padding: 18px 30px; overflow: auto; flex: 1; display: grid; place-items: center; }
#plan-svg { width: 100%; height: 100%; max-height: 62vh; }
#plan-svg .room { fill: rgba(222,214,196,.045); stroke: rgba(222,214,196,.22); stroke-width: .7; cursor: pointer; transition: all .3s; }
#plan-svg .room:hover { fill: rgba(223,188,107,.20); stroke: var(--gold-400); }
#plan-svg .room.visited { fill: rgba(28,111,102,.28); stroke: rgba(121,199,182,.5); }
#plan-svg .room.complete { fill: rgba(200,162,74,.24); stroke: var(--gold-400); }
#plan-svg .room.here { fill: rgba(223,188,107,.34); stroke: var(--gold-200); stroke-width: 1.4; }
#plan-svg .conn { fill: rgba(222,214,196,.03); stroke: rgba(222,214,196,.13); stroke-width: .5; }
#plan-svg .lbl { fill: var(--ink-faint); font-size: 3.1px; font-family: var(--display); letter-spacing: .12px; pointer-events: none; text-anchor: middle; }
#plan-svg .lbl.big { fill: var(--marble-200); font-size: 4.4px; }
#plan-svg .you { fill: var(--gold-200); }
#plan-svg .route { fill: none; stroke: rgba(121,199,182,.55); stroke-width: .8; stroke-dasharray: 2 2; }
.plan-legend {
  flex: none; padding: 14px 30px 22px; display: flex; gap: 26px; flex-wrap: wrap;
  border-top: 1px solid var(--ui-line-soft); font-size: 11.5px; color: var(--ink-faint);
  letter-spacing: .1em;
}
.plan-legend i { display: inline-block; width: 11px; height: 11px; margin-right: 7px; vertical-align: -1px; }

/* help */
.help-sheet { width: min(1000px, 94vw); }
.help-cols {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 34px; padding: 30px 44px; overflow-y: auto;
}
.help-cols h3 {
  font-family: var(--display); font-size: 12px; letter-spacing: .26em;
  text-transform: uppercase; color: var(--gold-500); margin: 0 0 14px; font-weight: 500;
}
.help-cols dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; align-items: baseline; }
.help-cols dt { font-size: 12px; color: var(--ink-faint); letter-spacing: .1em; white-space: nowrap; }
.help-cols dd { margin: 0; font-size: 13.5px; color: var(--ink-dim); line-height: 1.5; }
.help-note p { font-size: 14px; line-height: 1.8; color: var(--ink-dim); margin: 0 0 13px; }
.help-note .sig { font-style: italic; color: var(--gold-500); font-size: 12.5px; letter-spacing: .05em; }
.help-foot {
  flex: none; border-top: 1px solid var(--ui-line-soft); padding: 16px 44px 20px;
  display: flex; gap: 30px; flex-wrap: wrap; align-items: center;
}
.toggle {
  display: inline-flex; align-items: center; gap: 9px; font-size: 12.5px;
  color: var(--ink-dim); cursor: pointer; letter-spacing: .06em;
}
.toggle input[type=range] { width: 110px; accent-color: var(--gold-500); }
.toggle input[type=checkbox] { accent-color: var(--sea-500); width: 15px; height: 15px; }

/* ── finale ────────────────────────────────────────────────────────── */
#finale {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: radial-gradient(100% 80% at 50% 46%, rgba(10,32,36,.90), rgba(3,7,9,.97));
  animation: fadein 2.4s var(--ease);
}
.finale-inner { width: min(720px, 90vw); text-align: center; }
.finale-rule {
  height: 1px; background: linear-gradient(90deg, transparent, var(--gold-500), transparent);
  margin: 0 auto 34px; width: 70%;
}
.finale-rule:last-child { margin: 34px auto 0; }
.finale-eyebrow {
  font-size: 10.5px; letter-spacing: .42em; text-transform: uppercase;
  color: var(--gold-500); margin-bottom: 20px;
}
#finale-title {
  font-family: var(--display); font-size: clamp(38px, 7vw, 68px);
  letter-spacing: .16em; margin: 0 0 22px; color: var(--marble-100); font-weight: 500;
  text-shadow: 0 0 60px rgba(121,199,182,.28);
}
.finale-grc { font-size: clamp(15px,2vw,19px); color: var(--seaglass); font-style: italic; line-height: 1.75; margin: 0 0 14px; }
.finale-eng { font-size: clamp(14px,1.7vw,17px); color: var(--ink-dim); line-height: 1.8; margin: 0 0 28px; }
.finale-stats {
  display: flex; gap: 34px; justify-content: center; flex-wrap: wrap;
  padding: 22px 0; border-top: 1px solid var(--ui-line-soft);
  border-bottom: 1px solid var(--ui-line-soft); margin-bottom: 28px;
}
.finale-stats div { text-align: center; }
.finale-stats b {
  display: block; font-family: var(--display); font-size: 24px; color: var(--gold-200); font-weight: 500;
}
.finale-stats span {
  display: block; font-size: 10px; letter-spacing: .24em; text-transform: uppercase;
  color: var(--ink-faint); margin-top: 6px;
}
.finale-actions { display: flex; gap: 16px; justify-content: center; }

/* ── touch ─────────────────────────────────────────────────────────── */
#touch-ui { position: fixed; inset: 0; z-index: 22; pointer-events: none; }
#touch-ui > * { pointer-events: auto; }
.stick {
  position: fixed; left: 26px; bottom: 34px; width: 120px; height: 120px;
  border: 1px solid rgba(222,214,196,.20); border-radius: 50%;
  background: rgba(8,18,24,.30); backdrop-filter: blur(4px);
  display: grid; place-items: center;
}
.stick-knob {
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(223,188,107,.28); border: 1px solid rgba(223,188,107,.55);
  transition: transform .06s linear;
}
.touch-buttons { position: fixed; right: 22px; bottom: 34px; display: flex; flex-direction: column; gap: 12px; }
.tbtn {
  background: rgba(8,18,24,.6); border: 1px solid var(--ui-line);
  color: var(--gold-200); font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  padding: 16px 18px; backdrop-filter: blur(4px); font-family: var(--text);
}
.tbtn.small { font-size: 10.5px; padding: 11px 14px; }
#touch-look-hint {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  font-size: 11px; letter-spacing: .2em; color: var(--ink-faint); text-transform: lowercase;
}

/* ── responsive ────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  #inspector { grid-template-columns: 1fr; grid-template-rows: 44vh 1fr; }
  #inspect-panel { border-left: none; border-top: 1px solid var(--ui-line); padding: 26px 24px; }
  .reader-scroll { columns: 1; }
  .reader-sheet { padding: 34px 26px 28px; }
  .ov-head, .journal-grid, .journal-foot, .help-cols, .help-foot { padding-left: 22px; padding-right: 22px; }
  #place { left: 16px; top: 14px; max-width: 46vw; }
  .place-name { font-size: 17px; }
  #progress-cluster { right: 12px; top: 12px; gap: 5px; }
  .chip { font-size: 10px; padding: 6px 8px 5px; }
  .chip .chip-key { display: none; }
  #timeline { width: 100vw; }
  .tl-body { padding: 4px 14px 14px; }
  .tl-detail { grid-template-columns: 1fr; gap: 12px; }
  .tl-detail-right { text-align: left; }
  #toasts { width: 60vw; right: 12px; bottom: 150px; }
  #compass { display: none; }
  .journal-foot { flex-direction: column; align-items: flex-start; }
}
@media (max-height: 560px) {
  #timeline { display: none; }
}

/* ── scrollbars ────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,.03); }
::-webkit-scrollbar-thumb { background: rgba(200,162,74,.28); }
::-webkit-scrollbar-thumb:hover { background: rgba(200,162,74,.5); }

/* ── accessibility ─────────────────────────────────────────────────── */
:focus-visible { outline: 1px solid var(--gold-400); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) {
  #grain { animation: none; }
  * { animation-duration: .01ms !important; }
}
