/* Athenaion Journey
   Layout: the station picture fills the screen; a navy banner (like the city's own banners) names the
   station at the top left; round gold-rimmed "shield" buttons sit top right; Daphne speaks from a cloth
   strip along the bottom. Cards are marble tablets, postcards are paper, the map is parchment.
   One deliberate look in both themes: the picture is always the light source, the UI is cloth and stone. */

@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url("./eb-garamond-latin-500-normal-DehAIUv0.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url("./eb-garamond-latin-600-normal-DHwxsLHv.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "EB Garamond"; font-style: italic; font-weight: 500; font-display: swap; src: url("./eb-garamond-latin-500-italic-FSVaZR0V.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 500; font-display: swap; src: url("./eb-garamond-greek-500-normal-BtA0fbXC.woff2") format("woff2"); unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF; }
@font-face { font-family: "EB Garamond"; font-style: normal; font-weight: 600; font-display: swap; src: url("./eb-garamond-greek-600-normal--vWuDlyL.woff2") format("woff2"); unicode-range: U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400; font-display: swap; src: url("./nunito-latin-400-normal-r8SDr6Up.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400; font-display: swap; src: url("./nunito-latin-ext-400-normal-i-8OOpdj.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 600; font-display: swap; src: url("./nunito-latin-600-normal-Br8yIETf.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 600; font-display: swap; src: url("./nunito-latin-ext-600-normal-Dd9Zuxh1.woff2") format("woff2"); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 700; font-display: swap; src: url("./nunito-latin-700-normal-Dort48En.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 800; font-display: swap; src: url("./nunito-latin-800-normal-Dz8SOQK_.woff2") format("woff2"); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Caveat"; font-style: normal; font-weight: 500; font-display: swap; src: url("./caveat-latin-500-normal-B9SDL8cy.woff2") format("woff2"); }
@font-face { font-family: "Caveat"; font-style: normal; font-weight: 600; font-display: swap; src: url("./caveat-latin-600-normal-zlTlWIYU.woff2") format("woff2"); }

:root {
  --cloth: #131b3a;          /* banner navy */
  --cloth-2: #1d2954;        /* raised cloth */
  --cloth-glass: rgba(16, 23, 50, 0.86);
  --gold: #c9a24e;           /* embroidered gold */
  --gold-hi: #ecd28f;        /* lit gold, focus */
  --gold-deep: #8a6a25;
  --marble: #f1ece2;         /* tablet surface */
  --marble-2: #e2dacb;
  --ink: #1a2142;            /* text on stone and paper */
  --ink-soft: #545b7c;
  --cream: #f3ecda;          /* text on cloth */
  --cream-soft: rgba(243, 236, 218, 0.74);
  --olive: #6f8a3c;          /* right */
  --olive-hi: #a9c46a;
  --rust: #b25a3a;           /* try again */
  --paper: #f7f1e3;
  --parchment: #e9dcbc;
  --shadow: 0 14px 40px rgba(4, 7, 18, 0.5);

  --font-display: "EB Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-body: "Nunito", "EB Garamond", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
  --font-zh: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.4375rem;
  --step-3: 1.875rem;
  --step-4: 2.625rem;
  --radius: 14px;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --sub-scale: 1;
  color-scheme: dark;
}

html, body { height: 100%; }
body {
  margin: 0;
  background: #070a14;
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
#app { position: fixed; inset: 0; overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }
:where(.ico) > svg { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.zh, .zh-inline { font-family: var(--font-zh); }
.zh-inline { font-size: 0.85em; opacity: 0.78; margin-left: 0.4em; font-weight: 400; }

/* ---------------------------------------------------------------- stage */
.stage { position: absolute; inset: 0; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.stage.dragging { cursor: grabbing; }
.stage.find-mode { cursor: crosshair; }
.plate { position: absolute; inset: 0; width: 100%; height: 100%; display: block; background: #070a14; }
.flash { position: absolute; inset: 0; background: #fff8e6; opacity: 0; pointer-events: none; }
.flash.go { animation: flash 520ms ease-out; }
@keyframes flash { 0% { opacity: 0.85; } 100% { opacity: 0; } }

.hotspots { position: absolute; inset: 0; pointer-events: none; }
.spot { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
.spot-ring {
  position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--gold-hi); background: rgba(19, 27, 58, 0.35);
  box-shadow: 0 0 0 3px rgba(19, 27, 58, 0.35), 0 0 14px rgba(236, 210, 143, 0.55);
  pointer-events: auto; cursor: pointer; transition: transform 180ms ease, opacity 200ms ease;
}
.spot-ring::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--gold-hi); opacity: 0.9; }
.spot.collected .spot-ring::after { background: var(--olive-hi); }
.spot-ring:hover, .spot.hot .spot-ring { transform: scale(1.25); }
.spot.pulse .spot-ring { animation: spotPulse 1.1s ease-out 2; }
@keyframes spotPulse {
  0% { box-shadow: 0 0 0 0 rgba(236, 210, 143, 0.9), 0 0 14px rgba(236, 210, 143, 0.55); }
  100% { box-shadow: 0 0 0 26px rgba(236, 210, 143, 0), 0 0 14px rgba(236, 210, 143, 0.55); }
}
.spot-label {
  position: absolute; left: 16px; top: -15px; white-space: nowrap;
  padding: 3px 10px 4px; border-radius: 999px;
  background: var(--cloth-glass); color: var(--cream); border: 1px solid var(--cloth-line, rgba(201,162,78,.55));
  font-weight: 700; font-size: 0.95rem; letter-spacing: 0.01em;
  opacity: 0; transform: translateY(4px); transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}
.spot.left .spot-label { left: auto; right: 16px; }
.spot.show-label .spot-label, .spot.hot .spot-label, .spot.pulse .spot-label { opacity: 1; transform: none; }
.hotspots.markers-off .spot:not(.pulse):not(.reveal) .spot-ring { opacity: 0; pointer-events: none; }
.hotspots.markers-off .spot:not(.pulse):not(.reveal) .spot-label { opacity: 0; }
.spot.ghost .spot-ring { opacity: 0; pointer-events: none; }
.spot.ghost.pulse .spot-ring, .spot.ghost.reveal .spot-ring { opacity: 1; }
/* during a listen-and-find task taps belong to the task: a ring revealed under the finger must not take the click */
.hotspots.markers-off .spot .spot-ring { pointer-events: none !important; }
.spot.found .spot-ring { border-color: var(--olive-hi); box-shadow: 0 0 0 3px rgba(19,27,58,.35), 0 0 18px rgba(169,196,106,.8); }

.edge-arrow {
  position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  background: var(--cloth-glass); border: 2px solid var(--gold-hi); pointer-events: none;
  display: grid; place-items: center; animation: edgeBob 900ms ease-in-out infinite alternate;
}
.edge-arrow svg { width: 16px; height: 16px; fill: var(--gold-hi); }
@keyframes edgeBob { from { scale: 1; } to { scale: 1.15; } }

.reticle { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 1.5px solid rgba(243,236,218,.7); pointer-events: none; box-shadow: 0 0 0 1px rgba(10,14,30,.4); }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: absolute; left: 0; right: 0; top: 0; z-index: 20;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 0px) var(--gutter-r) 0 var(--gutter-l);
  pointer-events: none;
}
.station-banner {
  pointer-events: auto; position: relative; display: flex; align-items: center; gap: 12px;
  padding: 12px 18px 22px 16px; max-width: min(460px, 62vw);
  background: linear-gradient(180deg, var(--cloth-2), var(--cloth));
  border: 1.5px solid var(--gold); border-top: 0; color: var(--cream); text-align: left;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), 50% 100%, 0 calc(100% - 12px));
  box-shadow: var(--shadow);
}
.station-banner::before { content: ""; position: absolute; inset: 4px 4px 16px 4px; border: 1px solid rgba(201,162,78,.45); pointer-events: none; }
.banner-numeral { font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; color: var(--gold-hi); min-width: 1.6em; text-align: center; }
.banner-text { display: flex; flex-direction: column; min-width: 0; }
.banner-title { font-family: var(--font-display); font-weight: 600; font-size: var(--step-2); line-height: 1.1; letter-spacing: 0.01em; text-wrap: balance; }
.banner-sub { font-size: var(--step--1); color: var(--cream-soft); letter-spacing: 0.04em; text-transform: uppercase; margin-top: 3px; }

.toolbar { pointer-events: auto; display: flex; gap: 10px; padding-top: 12px; }
.shield-btn {
  position: relative; width: 48px; height: 48px; border-radius: 50%;
  background: radial-gradient(circle at 50% 38%, #26346a 0%, var(--cloth) 70%);
  border: 2px solid var(--gold); box-shadow: inset 0 0 0 3px rgba(19,27,58,.9), inset 0 0 0 4px rgba(201,162,78,.5), var(--shadow);
  display: grid; place-items: center; color: var(--gold-hi); transition: transform 140ms ease, border-color 140ms ease;
}
.shield-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.shield-btn:hover { transform: translateY(-1px); border-color: var(--gold-hi); }
.shield-btn[aria-pressed="false"] { color: var(--cream-soft); border-color: var(--gold-deep); }
.shield-btn.attention { animation: attention 1.4s ease-in-out infinite; }
@keyframes attention { 50% { box-shadow: inset 0 0 0 3px rgba(19,27,58,.9), inset 0 0 0 4px rgba(201,162,78,.5), 0 0 0 6px rgba(236,210,143,.35); } }
.badge {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--gold-hi); color: var(--cloth); font-weight: 800; font-size: 12px; line-height: 20px; text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- guide (Daphne) */
.guide {
  position: absolute; z-index: 20;
  left: max(var(--gutter-l), calc(50% - 490px)); right: max(var(--gutter-r), calc(50% - 490px));
  bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px;
  padding: 14px 18px 14px 14px;
  background: linear-gradient(180deg, rgba(29,41,84,.94), rgba(16,23,50,.95));
  border: 1.5px solid var(--gold); border-radius: 18px; box-shadow: var(--shadow);
}
.guide::before { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(201,162,78,.35); border-radius: 13px; pointer-events: none; }
.guide-medallion {
  width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, #2b3a75, var(--cloth));
  border: 2px solid var(--gold); box-shadow: inset 0 0 0 4px var(--cloth), inset 0 0 0 5px rgba(201,162,78,.6);
}
.guide-owl { width: 34px; height: 34px; display: block; }
.guide.speaking .guide-medallion { animation: speak 1.6s ease-in-out infinite; }
@keyframes speak { 50% { box-shadow: inset 0 0 0 4px var(--cloth), inset 0 0 0 5px rgba(236,210,143,.9), 0 0 18px rgba(236,210,143,.45); } }
.guide-body { min-width: 0; }
.guide-head { display: flex; align-items: baseline; gap: 10px; }
.guide-name { font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); color: var(--gold-hi); letter-spacing: 0.02em; }
.guide-level { font-size: 11px; font-weight: 800; letter-spacing: 0.08em; padding: 1px 7px; border-radius: 6px; border: 1px solid var(--gold-deep); color: var(--gold); }
.guide-progress { font-size: var(--step--1); color: var(--cream-soft); font-variant-numeric: tabular-nums; margin-left: auto; }
.guide-line { margin: 4px 0 0; font-size: calc(1.35rem * var(--sub-scale)); line-height: 1.42; font-weight: 600; color: var(--cream); text-wrap: pretty; min-height: 1.42em; }
.guide-line .w { transition: color 120ms ease, background-color 120ms ease; border-radius: 4px; }
.guide-line .w.now { color: #fff; background: rgba(236,210,143,.18); }
.guide-line .w.said { color: var(--cream); }
.guide-line .w.todo { color: var(--cream-soft); }
.guide-line .kw { color: var(--gold-hi); border-bottom: 2px solid rgba(236,210,143,.55); cursor: pointer; }
.guide-line .kw.glow { text-shadow: 0 0 14px rgba(236,210,143,.95); }
.guide-zh { margin: 6px 0 0; font-family: var(--font-zh); font-size: calc(1.05rem * var(--sub-scale)); color: var(--cream-soft); }
.guide-controls { display: flex; align-items: center; gap: 8px; }
.round-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--gold-deep); color: var(--gold-hi); background: rgba(19,27,58,.6);
}
.round-btn svg { width: 18px; height: 18px; fill: currentColor; }
.round-btn.primary { width: 50px; height: 50px; border-color: var(--gold); background: var(--gold); color: var(--cloth); }
.round-btn.primary svg { width: 22px; height: 22px; }
.round-btn:hover { border-color: var(--gold-hi); }
.zh-btn {
  width: 40px; height: 40px; border-radius: 10px; font-family: var(--font-zh); font-weight: 700; font-size: 1.05rem;
  color: var(--gold-hi); border: 1.5px dashed var(--gold-deep); background: rgba(19,27,58,.6); touch-action: none;
}
.zh-btn.held { background: var(--gold); color: var(--cloth); border-style: solid; }
.guide.collapsed .guide-line, .guide.collapsed .guide-zh { display: none; }

/* ---------------------------------------------------------------- drawers (tasks) */
.drawer {
  position: absolute; z-index: 30; top: calc(env(safe-area-inset-top, 0px) + 74px); right: var(--gutter-r);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 140px);
  width: min(400px, calc(100% - 32px));
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(29,41,84,.97), rgba(16,23,50,.97));
  border: 1.5px solid var(--gold); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden;
}
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; border-bottom: 1px solid rgba(201,162,78,.35); }
.drawer-title { font-family: var(--font-display); font-weight: 600; font-size: var(--step-2); color: var(--gold-hi); margin: 0; flex: 1; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 16px 16px; overscroll-behavior: contain; }
.close-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--cream-soft); }
.close-btn:hover { color: var(--gold-hi); background: rgba(201,162,78,.12); }
.close-btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }

.grammar-spot { padding: 12px 14px; border-radius: 12px; background: rgba(201,162,78,.1); border: 1px solid rgba(201,162,78,.35); margin-bottom: 14px; }
.grammar-spot h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: var(--step-1); color: var(--gold-hi); font-weight: 600; }
.grammar-spot ul { margin: 0; padding-left: 1.1em; color: var(--cream); }
.grammar-spot li { margin: 2px 0; }
.grammar-spot .zh-hold { margin-top: 8px; }

.task-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.task-item {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; width: 100%;
  padding: 10px 12px; border-radius: 12px; text-align: left;
  background: rgba(243,236,218,.06); border: 1px solid rgba(243,236,218,.12);
}
.task-item:hover { border-color: var(--gold); background: rgba(201,162,78,.1); }
.task-item .task-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--gold-deep); color: var(--gold); }
.task-item .task-icon svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.task-item.done .task-icon { background: var(--olive); border-color: var(--olive-hi); color: #fff; }
.task-item .task-name { font-weight: 700; }
.task-item .task-meta { font-size: var(--step--1); color: var(--cream-soft); }
.task-item .task-level { font-size: 11px; font-weight: 800; color: var(--gold); border: 1px solid var(--gold-deep); border-radius: 6px; padding: 0 6px; }
.task-item.postcard-task { border-style: dashed; border-color: rgba(201,162,78,.5); }

.quest { display: grid; gap: 14px; }
.quest-back { justify-self: start; color: var(--cream-soft); font-size: var(--step--1); display: inline-flex; align-items: center; gap: 4px; }
.quest-back:hover { color: var(--gold-hi); }
.quest h3 { margin: 0; font-family: var(--font-display); font-size: var(--step-2); color: var(--gold-hi); font-weight: 600; }
.quest-clue { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 12px; background: rgba(243,236,218,.08); font-size: var(--step-1); font-weight: 700; line-height: 1.35; }
.quest-clue .say-btn { flex: none; }
.quest-feedback { min-height: 1.5em; font-weight: 700; }
.quest-feedback.ok { color: var(--olive-hi); }
.quest-feedback.no { color: #e3a184; }
.quest-hint { color: var(--cream-soft); font-size: var(--step-0); }
.say-btn { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--gold); color: var(--cloth); }
.say-btn svg { width: 16px; height: 16px; fill: currentColor; }
.say-btn.light { background: transparent; color: var(--gold); border: 1.5px solid var(--gold-deep); }
.opt-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  padding: 9px 14px; border-radius: 10px; font-weight: 700; background: rgba(243,236,218,.1); border: 1.5px solid rgba(243,236,218,.22);
  color: var(--cream); transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.opt:hover { border-color: var(--gold); }
.opt.right { background: var(--olive); border-color: var(--olive-hi); color: #fff; }
.opt.wrong { border-color: var(--rust); color: #f0c0ab; animation: shake 300ms ease; }
.opt.chosen { background: var(--gold); border-color: var(--gold-hi); color: var(--cloth); }
.opt:disabled { cursor: default; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.sentence { font-size: var(--step-1); font-weight: 700; line-height: 1.5; }
.sentence .blank { display: inline-block; min-width: 4.2em; border-bottom: 2px solid var(--gold); text-align: center; color: var(--gold-hi); padding: 0 4px; }
.sentence .blank.filled { color: #fff; }
.step-dots { display: flex; gap: 6px; }
.step-dots span { width: 9px; height: 9px; border-radius: 50%; background: rgba(243,236,218,.2); }
.step-dots span.done { background: var(--olive-hi); }
.step-dots span.now { background: var(--gold-hi); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border-radius: 12px; border: 1.5px solid transparent; min-width: 76px; }
.swatch i { width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(243,236,218,.6); display: block; }
.swatch span { font-weight: 700; font-size: var(--step--1); }
.swatch.chosen { border-color: var(--gold-hi); background: rgba(201,162,78,.15); }
.num-pad { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.num-pad .opt { padding: 10px 0; text-align: center; font-variant-numeric: tabular-nums; }
.order-list { display: grid; gap: 8px; }
.order-list .opt { text-align: left; display: flex; gap: 10px; align-items: baseline; }
.order-list .opt b { color: var(--gold); min-width: 1.2em; font-variant-numeric: tabular-nums; }
.chat { display: grid; gap: 10px; }
.bubble { max-width: 88%; padding: 10px 14px; border-radius: 16px; line-height: 1.4; font-weight: 600; }
.bubble.npc { background: rgba(243,236,218,.1); border-top-left-radius: 4px; justify-self: start; }
.bubble.me { background: var(--gold); color: var(--cloth); border-top-right-radius: 4px; justify-self: end; }
.bubble .who { display: block; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.7; margin-bottom: 2px; }
.text-area {
  width: 100%; min-height: 120px; resize: vertical; padding: 10px 12px; border-radius: 12px; box-sizing: border-box;
  background: rgba(243,236,218,.08); border: 1.5px solid rgba(243,236,218,.25); color: var(--cream); line-height: 1.5;
}
.word-count { font-size: var(--step--1); color: var(--cream-soft); font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

.gold-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; font-weight: 800; letter-spacing: 0.02em;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: var(--cloth);
  box-shadow: 0 2px 0 var(--gold-deep), 0 8px 22px rgba(201,162,78,.25);
}
.gold-btn:hover { filter: brightness(1.05); }
.gold-btn:disabled { opacity: 0.45; cursor: default; filter: none; }
.ghost-btn { padding: 10px 16px; border-radius: 999px; font-weight: 700; border: 1.5px solid var(--gold-deep); color: var(--gold-hi); }
.ghost-btn:hover { border-color: var(--gold-hi); }
.ink-btn { padding: 10px 16px; border-radius: 999px; font-weight: 800; background: var(--ink); color: var(--marble); }
.ink-btn:hover { background: #262f5c; }

/* ---------------------------------------------------------------- word card (marble tablet) */
.card-layer { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.word-card {
  position: absolute; pointer-events: auto; width: min(360px, calc(100vw - 32px));
  color: var(--ink); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow);
  background:
    radial-gradient(120% 80% at 10% 0%, rgba(255,255,255,.65), transparent 60%),
    linear-gradient(115deg, transparent 40%, rgba(150,140,125,.12) 41%, transparent 44%),
    linear-gradient(160deg, var(--marble), var(--marble-2));
  border: 1px solid #fff8; animation: cardIn 200ms ease-out;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.word-card .thumb { width: 100%; aspect-ratio: 16 / 9; background: #ccc center / cover no-repeat; display: block; }
.word-card .card-body { padding: 14px 18px 16px; display: grid; gap: 8px; }
.word-card .card-top { display: flex; align-items: center; gap: 10px; }
.word-card .word { font-family: var(--font-display); font-weight: 600; font-size: var(--step-4); line-height: 1; letter-spacing: 0.01em; margin: 0; }
.word-card .level-chip { margin-left: auto; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; padding: 2px 8px; border-radius: 6px; background: var(--ink); color: var(--marble); }
.word-card .ipa-row { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: var(--step-1); }
.word-card .pos { font-style: italic; font-family: var(--font-display); }
.word-card .say-btn { background: var(--ink); color: var(--marble); }
.word-card .example { margin: 0; padding: 10px 12px; border-radius: 10px; background: rgba(26,33,66,.06); font-size: var(--step-1); line-height: 1.4; display: flex; gap: 10px; align-items: flex-start; }
.word-card .example mark { background: none; color: inherit; font-weight: 800; border-bottom: 2px solid var(--gold); }
.word-card .card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hold-zh {
  position: relative; padding: 9px 14px; border-radius: 999px; font-family: var(--font-zh); font-weight: 700; font-size: 0.95rem;
  border: 1.5px dashed var(--ink-soft); color: var(--ink); touch-action: none; user-select: none;
}
.hold-zh.held { background: var(--ink); color: var(--marble); border-style: solid; }
.zh-reveal { font-family: var(--font-zh); font-size: var(--step-1); font-weight: 700; color: var(--ink); min-height: 1.4em; }
.collect-btn { margin-left: auto; }
.collected-note { margin-left: auto; font-weight: 800; color: var(--olive); font-size: var(--step--1); display: inline-flex; gap: 6px; align-items: center; }
.word-card .card-close { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; background: rgba(19,27,58,.65); color: var(--cream); display: grid; place-items: center; }
.word-card .card-close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; }

/* ---------------------------------------------------------------- modals */
.modal-layer { position: absolute; inset: 0; z-index: 50; pointer-events: none; }
.modal-veil { position: absolute; inset: 0; background: rgba(5,8,18,.55); backdrop-filter: blur(2px); pointer-events: auto; animation: fade 200ms ease; }
@keyframes fade { from { opacity: 0; } }
.modal {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(960px, calc(100vw - 32px)); max-height: calc(100% - 48px);
  display: flex; flex-direction: column; pointer-events: auto; overflow: hidden;
  border-radius: 20px; box-shadow: var(--shadow); animation: modalIn 220ms ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)); } }
.modal.cloth { background: linear-gradient(180deg, var(--cloth-2), var(--cloth)); border: 1.5px solid var(--gold); color: var(--cream); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px 12px; }
.modal-title { margin: 0; flex: 1; font-family: var(--font-display); font-weight: 600; font-size: var(--step-3); color: var(--gold-hi); line-height: 1.1; }
.modal.paper .modal-title { color: var(--ink); }
.modal-body { flex: 1; overflow-y: auto; padding: 4px 20px 20px; overscroll-behavior: contain; }
.tabs { display: flex; gap: 6px; padding: 0 20px 10px; flex-wrap: wrap; }
.tab { padding: 8px 14px; border-radius: 999px; font-weight: 800; color: var(--cream-soft); border: 1.5px solid transparent; }
.tab[aria-selected="true"] { color: var(--cloth); background: var(--gold); }
.tab:hover:not([aria-selected="true"]) { border-color: var(--gold-deep); color: var(--gold-hi); }

/* journal */
.word-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.word-tile { display: grid; gap: 0; border-radius: 12px; overflow: hidden; text-align: left; background: var(--marble); color: var(--ink); border: 1px solid #fff6; }
.word-tile .tile-img { aspect-ratio: 1; background: #999 center / cover no-repeat; }
.word-tile .tile-word { padding: 8px 10px 2px; font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); }
.word-tile .tile-meta { padding: 0 10px 8px; font-size: 12px; color: var(--ink-soft); display: flex; gap: 6px; align-items: center; }
.word-tile.locked { background: rgba(243,236,218,.06); color: var(--cream-soft); border: 1px dashed rgba(243,236,218,.25); }
.word-tile.locked .tile-img { background: rgba(243,236,218,.05); }
.box-pips { display: inline-flex; gap: 2px; }
.box-pips i { width: 6px; height: 6px; border-radius: 50%; background: rgba(26,33,66,.2); }
.box-pips i.on { background: var(--olive); }
.station-group { margin: 0 0 18px; }
.station-group h3 { margin: 0 0 8px; font-family: var(--font-display); font-weight: 600; color: var(--gold-hi); font-size: var(--step-1); display: flex; gap: 8px; align-items: baseline; }
.station-group h3 small { font-family: var(--font-body); font-size: var(--step--1); color: var(--cream-soft); font-weight: 600; }
.empty-note { color: var(--cream-soft); padding: 24px 0; text-align: center; }

.review { display: grid; gap: 16px; justify-items: center; text-align: center; padding: 8px 0 12px; }
.review .review-img { width: min(420px, 100%); aspect-ratio: 16 / 9; border-radius: 14px; background: #888 center / cover no-repeat; border: 2px solid var(--gold-deep); }
.review .review-q { font-size: var(--step-2); font-weight: 800; }
.review .opt-grid { justify-content: center; }
.review-progress { font-size: var(--step--1); color: var(--cream-soft); font-variant-numeric: tabular-nums; }
.review input[type="text"] { padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--gold-deep); background: rgba(243,236,218,.08); color: var(--cream); font-size: var(--step-1); text-align: center; width: min(320px, 100%); }

.passport { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.stamp-slot { aspect-ratio: 1; border-radius: 14px; border: 1.5px dashed rgba(243,236,218,.25); display: grid; place-items: center; text-align: center; padding: 10px; color: var(--cream-soft); font-size: var(--step--1); }
.stamp-slot.earned { border: 0; padding: 8px; background: radial-gradient(circle at 40% 35%, #fbf6ea, var(--paper) 60%, #eadfc6); box-shadow: inset 0 0 0 1px rgba(26,33,66,.08); }
.stamp-slot svg { width: 100%; height: 100%; }
.stamp-slot.just { animation: thump 600ms cubic-bezier(.2,1.6,.4,1); }
@keyframes thump { 0% { transform: scale(1.8) rotate(-12deg); opacity: 0; } 100% { transform: none; opacity: 1; } }

.postcard-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.pc-thumb { border-radius: 10px; overflow: hidden; background: var(--paper); color: var(--ink); text-align: left; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.pc-thumb .pc-img { aspect-ratio: 16 / 9; background: #999 center / cover no-repeat; }
.pc-thumb .pc-text { padding: 10px 12px 12px; font-family: var(--font-hand); font-size: 1.25rem; line-height: 1.15; max-height: 6.5em; overflow: hidden; }

.progress-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.progress-table th, .progress-table td { padding: 8px 10px; border-bottom: 1px solid rgba(243,236,218,.12); text-align: left; }
.progress-table th { color: var(--gold); font-size: var(--step--1); letter-spacing: 0.06em; text-transform: uppercase; }
.table-wrap { overflow-x: auto; }

/* postcard composer */
.modal.postcard-modal { width: min(1040px, calc(100vw - 32px)); background: #2a2216; border: 1.5px solid var(--gold-deep); }
.postcard-modal .modal-title { color: var(--paper); }
.postcard {
  display: grid; grid-template-columns: 1.15fr 1fr; gap: 0; border-radius: 6px; overflow: hidden;
  background: var(--paper); color: var(--ink); box-shadow: 0 16px 40px rgba(0,0,0,.45);
}
.postcard .pc-front { position: relative; background: #777 center / cover no-repeat; min-height: 280px; }
.postcard .pc-front .pc-caption { position: absolute; left: 12px; bottom: 10px; padding: 4px 10px; border-radius: 4px; background: rgba(19,27,58,.75); color: var(--cream); font-family: var(--font-display); font-size: var(--step-0); letter-spacing: 0.04em; }
.postcard .pc-front .retake { position: absolute; right: 10px; top: 10px; }
.postcard .pc-back { position: relative; padding: 18px 18px 16px 20px; display: grid; gap: 10px; align-content: start; border-left: 1px solid #d9cfb8;
  background: repeating-linear-gradient(180deg, transparent 0 33px, rgba(26,33,66,.12) 33px 34px) 0 74px / 100% 100% no-repeat, var(--paper); }
.pc-stamp { position: absolute; right: 16px; top: 14px; width: 74px; height: 74px; }
.pc-to { font-family: var(--font-hand); font-size: 1.6rem; line-height: 1; margin-right: 90px; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.pc-to input { font-family: var(--font-hand); font-size: 1.6rem; border: 0; border-bottom: 1.5px dashed #b6a985; background: transparent; color: var(--ink); width: 9em; padding: 0 2px; }
.pc-lines { display: grid; gap: 6px; font-family: var(--font-hand); font-size: 1.55rem; line-height: 1.1; margin-top: 8px; }
.pc-line { display: block; }
.pc-line .blank { display: inline-block; min-width: 3.5em; border-bottom: 1.5px solid var(--gold-deep); color: #7b5a12; padding: 0 3px; cursor: pointer; }
.pc-line .blank.active { background: rgba(201,162,78,.2); }
.pc-free.pc-own { min-height: 2.6em; }
.pc-free { width: 100%; box-sizing: border-box; min-height: 7em; resize: vertical; border: 1px dashed #c7b98f; border-radius: 6px; background: rgba(255,255,255,.4); font-family: var(--font-hand); font-size: 1.5rem; line-height: 1.15; color: var(--ink); padding: 6px 8px; }
.pc-sign { font-family: var(--font-hand); font-size: 1.5rem; text-align: right; }
.pc-tools { display: grid; gap: 10px; margin-top: 14px; color: var(--paper); }
.pc-tools > .row:last-child { position: sticky; bottom: -20px; padding: 10px 0 14px; background: linear-gradient(180deg, rgba(42,34,22,0), #2a2216 30%); }
.paper-disc { width: min(240px, 60vw); aspect-ratio: 1; margin: 0 auto; padding: 12px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fbf6ea, var(--paper) 60%, #e6d9bd); box-shadow: 0 10px 30px rgba(0,0,0,.35); box-sizing: border-box; }
.pc-tools .opt { background: rgba(247,241,227,.12); }
.pc-tools .label { font-size: var(--step--1); text-transform: uppercase; letter-spacing: 0.08em; color: var(--gold); font-weight: 800; }
.pc-prompts { margin: 0; padding-left: 1.1em; color: rgba(247,241,227,.85); }

/* map */
.modal.map-modal { width: min(1180px, calc(100vw - 24px)); background: #3b2f1c; border: 1.5px solid var(--gold-deep); }
.map-wrap { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: var(--parchment); }
.map-wrap canvas, .map-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-pin { cursor: pointer; }
.map-pin.hl circle.pin-ring { stroke: #fff; stroke-width: 4; }
.map-pin text { font-family: var(--font-display); font-weight: 600; }
.map-pin.locked { cursor: not-allowed; opacity: 0.55; }
.map-pin:focus-visible { outline: none; }
.map-pin:focus-visible circle.pin-ring { stroke: #fff; stroke-width: 4; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 14px; align-items: start; }
.map-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 100%; overflow-y: auto; }
.map-list button { width: 100%; display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 10px; text-align: left; color: var(--paper); background: rgba(247,241,227,.06); border: 1px solid rgba(247,241,227,.12); }
.map-list button:hover:not(:disabled), .map-list button.hl { border-color: var(--gold); background: rgba(201,162,78,.14); }
.map-list button:disabled { opacity: .55; cursor: not-allowed; }
.map-list .num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; color: var(--gold-hi); background: var(--cloth); border: 2px solid var(--gold); font-size: 0.85rem; }
.map-list .num.done { background: var(--olive); }
.map-list .num.here { box-shadow: 0 0 0 3px rgba(236,210,143,.45); }
.map-list .name { font-weight: 700; line-height: 1.2; }
.map-list .meta { font-size: 12px; color: rgba(247,241,227,.7); }
.map-list .state { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
@media (max-width: 860px) { .map-layout { grid-template-columns: 1fr; } }
.map-legend { display: flex; gap: 14px; flex-wrap: wrap; color: var(--paper); font-size: var(--step--1); padding-top: 10px; align-items: center; }
.map-legend .gold-btn { margin-left: auto; }

/* settings */
.settings-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.setting { display: grid; gap: 8px; align-content: start; }
.setting .label { font-weight: 800; color: var(--gold-hi); }
.setting .help { font-size: var(--step--1); color: var(--cream-soft); }
.seg { display: inline-flex; border: 1.5px solid var(--gold-deep); border-radius: 999px; overflow: hidden; flex-wrap: wrap; }
.seg button { padding: 8px 14px; font-weight: 800; color: var(--cream-soft); }
.seg button[aria-pressed="true"] { background: var(--gold); color: var(--cloth); }
.setting select, .setting input[type="text"] { padding: 9px 12px; border-radius: 10px; border: 1.5px solid var(--gold-deep); background: var(--cloth); color: var(--cream); max-width: 100%; }
.setting input[type="range"] { accent-color: var(--gold); width: 100%; }
.switch { display: inline-flex; gap: 10px; align-items: center; font-weight: 700; }
.switch input { accent-color: var(--gold); width: 20px; height: 20px; }

/* toasts */
.toast-layer { position: absolute; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 86px); transform: translateX(-50%); z-index: 60; display: grid; gap: 8px; pointer-events: none; width: min(520px, calc(100vw - 32px)); }
.toast { padding: 10px 16px; border-radius: 12px; background: var(--cloth-glass); border: 1.5px solid var(--gold); color: var(--cream); font-weight: 700; box-shadow: var(--shadow); text-align: center; animation: toastIn 260ms ease-out; }
.toast.ok { border-color: var(--olive-hi); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

/* ---------------------------------------------------------------- start screen */
.start { position: absolute; inset: 0; z-index: 80; display: grid; place-items: center; overflow-y: auto;
  padding-block: calc(env(safe-area-inset-top, 0px) + 24px) calc(env(safe-area-inset-bottom, 0px) + 40px);
  padding-left: var(--gutter-l); padding-right: var(--gutter-r);
  background: #0b1020 center / cover no-repeat; }
.start-veil { position: fixed; inset: 0; background: radial-gradient(90% 80% at 30% 50%, rgba(12,17,38,.86), rgba(12,17,38,.45) 70%, rgba(12,17,38,.2)); pointer-events: none; }
.start-panel { position: relative; width: min(560px, 100%); display: grid; gap: 14px; justify-self: start; margin-left: max(0px, 6vw); }
.start-greek { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: 0.42em; color: var(--gold-hi); font-size: var(--step-1); }
.start-title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 0.98; color: #fff; text-wrap: balance; text-shadow: 0 4px 24px rgba(0,0,0,.45); }
.start-lede { margin: 0; font-size: var(--step-1); line-height: 1.45; color: var(--cream); max-width: 34em; }
.start-lede-zh { margin: -6px 0 0; font-family: var(--font-zh); color: var(--cream-soft); }
.start-form { display: grid; gap: 14px; margin-top: 8px; padding: 18px; border-radius: 18px; background: rgba(16,23,50,.82); border: 1.5px solid var(--gold); }
.field { display: grid; gap: 6px; }
.field-label { font-weight: 800; color: var(--gold-hi); font-size: var(--step-0); }
.field input { padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--gold-deep); background: rgba(243,236,218,.08); color: #fff; font-size: var(--step-1); }
.level-pick { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.level-pick legend { margin-bottom: 6px; padding: 0; }
.level-opt { display: block; cursor: pointer; }
.level-opt input { position: absolute; opacity: 0; pointer-events: none; }
.level-opt span { display: grid; grid-template-columns: 3.2em 1fr; align-items: baseline; column-gap: 8px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid rgba(243,236,218,.2); }
.level-opt span b { font-family: var(--font-display); font-size: var(--step-2); color: var(--gold-hi); grid-row: span 2; }
.level-opt span em { font-style: normal; font-family: var(--font-zh); font-size: var(--step--1); color: var(--cream-soft); }
.level-opt input:checked + span { border-color: var(--gold-hi); background: rgba(201,162,78,.16); }
.level-opt input:focus-visible + span { outline: 2px solid var(--gold-hi); outline-offset: 2px; }
.start-note { margin: 0; color: var(--cream-soft); font-size: var(--step--1); }
.start-credit { position: absolute; right: var(--gutter-r); bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); margin: 0; font-size: 12px; color: rgba(243,236,218,.7); text-align: right; max-width: 70vw; }
.start-credit a { color: var(--gold-hi); }
.start.leaving { animation: leave 700ms ease forwards; }
@keyframes leave { to { opacity: 0; visibility: hidden; } }

.loading-bar { height: 3px; border-radius: 2px; background: rgba(243,236,218,.15); overflow: hidden; }
.loading-bar i { display: block; height: 100%; width: 0; background: var(--gold-hi); transition: width 200ms ease; }

/* the picture makes room for the task drawer, so nothing a task asks about is hidden under it */
@media (min-width: 761px) {
  #app.drawer-open .stage { right: calc(min(400px, 100vw - 32px) + var(--gutter-r) + 16px); }
  #app.drawer-open .guide { left: var(--gutter-l); right: calc(min(400px, 100vw - 32px) + var(--gutter-r) + 16px); }
}
/* ---------------------------------------------------------------- responsive */
@media (max-width: 760px) {
  .station-banner { padding: 9px 14px 18px 12px; max-width: calc(100vw - 32px - 4 * 44px); }
  .banner-numeral { font-size: 1.25rem; }
  .banner-title { font-size: var(--step-1); }
  .banner-sub { display: none; }
  .toolbar { gap: 6px; padding-top: 8px; }
  .shield-btn { width: 40px; height: 40px; }
  .shield-btn svg { width: 19px; height: 19px; }
  #btn-labels { display: none; }
  .guide { grid-template-columns: 1fr auto; gap: 10px; padding: 10px 12px; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); }
  .guide-medallion { display: none; }
  .guide-line { font-size: calc(1.08rem * var(--sub-scale)); }
  .guide-controls { flex-direction: column; gap: 6px; }
  .guide-controls .round-btn:not(.primary) { display: none; }
  .round-btn.primary { width: 44px; height: 44px; }
  .drawer { left: var(--gutter-l); right: var(--gutter-r); width: auto; top: auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 10px); height: 62%; max-height: none; background: linear-gradient(180deg, #1d2954, #131b3a); }
  #app.drawer-open .guide { display: none; }
  #app.drawer-open .stage { bottom: calc(62% + 10px); }
  #app.drawer-open.drawer-compact .drawer { height: 42%; }
  #app.drawer-open.drawer-compact .stage { bottom: calc(42% + 10px); }
  .postcard { grid-template-columns: 1fr; }
  .postcard .pc-front { min-height: 180px; }
  .modal { width: calc(100vw - 20px); max-height: calc(100% - 20px); }
  .modal-title { font-size: var(--step-2); }
  .start-panel { margin-left: 0; justify-self: center; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .guide { left: max(var(--gutter-l), calc(100% - 760px)); right: var(--gutter-r); }
  .guide-line { font-size: calc(1rem * var(--sub-scale)); }
  .drawer { top: calc(env(safe-area-inset-top, 0px) + 60px); bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}
/* live 3D version: the 3D canvas sits under the picture; the picture fades away when the world is ready */
.live-canvas { z-index: 0; }
#plate { z-index: 1; transition: opacity 1200ms ease; }
#plate.faded { opacity: 0; pointer-events: none; }
.hotspots, .reticle, .flash { z-index: 2; }

.live-pill {
  pointer-events: auto; align-self: flex-start; margin-top: 14px; margin-right: auto; margin-left: 4px;
  display: inline-grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; row-gap: 5px;
  padding: 8px 14px 9px 10px; border-radius: 14px; max-width: min(360px, 40vw);
  background: var(--cloth-glass); border: 1.5px solid var(--gold-deep); color: var(--cream);
  box-shadow: var(--shadow); text-align: left; font-size: var(--step--1); line-height: 1.25;
}
.live-pill:hover { border-color: var(--gold); }
.live-pill .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); grid-row: span 2; box-shadow: 0 0 0 3px rgba(201,162,78,.2); }
.live-pill.building .dot { animation: livePulse 1.2s ease-in-out infinite; }
.live-pill.live .dot { background: var(--olive-hi); box-shadow: 0 0 0 3px rgba(169,196,106,.25); }
.live-pill.off .dot { background: var(--cream-soft); box-shadow: none; }
.live-pill.error .dot { background: var(--rust); }
@keyframes livePulse { 50% { box-shadow: 0 0 0 6px rgba(201,162,78,.05); } }
.live-pill .t1 { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-pill .t2 { color: var(--cream-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.live-pill .bar { grid-column: 2; height: 3px; border-radius: 2px; background: rgba(243,236,218,.15); overflow: hidden; }
.live-pill .bar i { display: block; height: 100%; width: 0; background: var(--gold-hi); transition: width 400ms ease; }
.live-pill:not(.building) .bar { display: none; }

.start-3d { margin-top: -2px; }
.live-info { font-size: var(--step--1); color: var(--cream-soft); font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .live-pill { max-width: calc(100vw - 32px - 4 * 44px); margin-top: 8px; padding: 6px 10px; }
  .live-pill .t2 { display: none; }
}
