/* SurvivalStack expeditions: an illustrated survival story. Dark and cold; one warm accent. */
:root {
  --bg: #07090d;
  --bg-2: #0c1016;
  --panel: rgba(13, 17, 24, 0.94);
  --ink: #e8ecf1;
  --ink-2: #c4ccd6;
  --dim: #8d99a7;
  --faint: #5b6674;
  --line: rgba(232, 236, 241, 0.09);
  --line-2: rgba(232, 236, 241, 0.16);
  --accent: #ff9a3c;
  --accent-hi: #ffc46b;
  --accent-deep: #c4561f;
  --cold: #8fc4ff;
  --good: #9cd08a;
  --bad: #ff7a66;
  --f-story: "Alegreya", Georgia, "Times New Roman", serif;
  --f-ui: "Alegreya Sans", "Segoe UI", system-ui, sans-serif;
  --f-px: "Silkscreen", "Courier New", monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.eyebrow {
  font-family: var(--f-px);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-hi);
  margin: 0 0 8px;
}

.btn {
  border: 0;
  cursor: pointer;
  border-radius: 10px;
  padding: 13px 22px;
  font-family: var(--f-ui);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.02em;
  transition: transform 0.1s var(--ease), background 0.2s, color 0.2s, border-color 0.2s;
}
a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .opt:focus-visible, .tool:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; }
.btn-primary { background: var(--accent); color: #1a0e05; }
.btn-primary:hover { background: var(--accent-hi); }
.btn-ghost { background: transparent; color: var(--ink-2); border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--dim); color: var(--ink); }

/* ---------- screens ---------- */
.screen { display: none; min-height: 100%; }
.screen.is-on { display: block; }
#play.is-on { display: grid; }

/* ---------- episode card ---------- */
#card.is-on { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.card-art { position: relative; overflow: hidden; background: #000; }
.card-art canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.card-body {
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(28px, 6vw, 72px);
  background: linear-gradient(180deg, #0b0f15, #07090d);
}
.back-camp {
  align-self: flex-start; margin: 0 0 28px; font-size: 16.8px; color: var(--dim); text-decoration: none;
  border-bottom: 1px solid transparent;
}
.back-camp:hover { color: var(--ink); border-bottom-color: var(--line-2); }
.back-camp:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 3px; }
.card-title {
  font-family: var(--f-px);
  font-weight: 700;
  font-size: clamp(36px, 4.6vw, 64px);
  line-height: 0.95;
  margin: 4px 0 18px;
  overflow-wrap: anywhere;
  letter-spacing: 0.02em;
  text-shadow: 0 0 30px rgba(143, 196, 255, 0.18);
}
.card-premise { font-family: var(--f-story); font-size: clamp(18px, 1.6vw, 21px); line-height: 1.55; color: var(--ink-2); margin: 0 0 14px; max-width: 34em; }
.card-meta { font-family: var(--f-px); font-size: 12px; letter-spacing: 0.12em; color: var(--dim); margin: 0 0 26px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.card-record { font-size: 14px; color: var(--dim); margin: 18px 0 0; }
.card-record b { color: var(--ink-2); font-weight: 700; }
.card-note { font-size: 13px; color: var(--faint); margin: 26px 0 0; }

/* ---------- play ---------- */
#play { grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr); height: 100vh; height: 100dvh; }
.scene { position: relative; overflow: hidden; background: #000; }
.scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hud {
  position: absolute; left: 0; right: 0; top: 0;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(0,0,0,.55), transparent);
  pointer-events: none;
}
.hud-place { font-family: var(--f-px); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-2); }
.hud-clock { text-align: right; display: flex; flex-direction: column; gap: 2px; }
#hudClock { font-family: var(--f-px); font-size: 16px; color: var(--accent-hi); letter-spacing: 0.06em; }
#hudTemp { font-size: 13px; color: var(--ink-2); }
.play-back-camp {
  position: absolute; left: 18px; bottom: 19px; z-index: 1;
  padding: 6px 0; color: var(--ink); font-size: 15px; text-decoration: none;
  text-shadow: 0 1px 6px #000, 0 1px 14px #000;
  transition: color 0.2s;
}
.play-back-camp:hover { color: var(--accent-hi); }
.play-back-camp:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 4px; }
.hud-tools { position: absolute; right: 14px; bottom: 14px; display: flex; gap: 8px; }
.map-tool { position: relative; }
.map-tool:has(#btnMap[hidden]) { display: none; }
.map-coach { position: fixed; inset: 0; z-index: 40; overflow: hidden; }
.map-coach[hidden] { display: none; }
.tool.map-coach-target { position: absolute; left: var(--map-x); top: var(--map-y); width: var(--map-w); height: var(--map-h); outline: 3px solid var(--accent-hi); outline-offset: 5px; box-shadow: 0 0 0 100vmax rgba(3,7,10,.78); background: #202b26; }
.map-coach-target:focus-visible { outline: 3px solid #fff0bd; }
.map-coach-arrow { position: absolute; width: 52px; height: 70px; bottom: calc(100% + 20px); left: 50%; margin-left: -26px; fill: none; stroke: var(--accent-hi); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; filter: drop-shadow(0 3px 8px #000); animation: map-coach-bounce 1.2s ease-in-out infinite; }
.map-coach-card { position: absolute; left: var(--coach-x); top: var(--coach-y); width: min(310px, calc(100vw - 32px)); padding: 22px 24px; border: 1px solid var(--line-2); border-radius: 16px; background: #19231f; color: var(--ink); box-shadow: 0 16px 50px #0007; }
.map-coach-title { font-family: var(--f-ui); font-size: 20px; margin: 0 0 10px; color: var(--accent-hi); }
#mapCoachText { font-family: var(--f-ui); font-size: 15px; line-height: 1.65; margin: 0; }
@keyframes map-coach-bounce { 0%, 100% { transform: translateY(-7px); } 50% { transform: translateY(3px); } }
@media (prefers-reduced-motion: reduce) { .map-coach-arrow { animation: none; } }
.tool {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line-2); background: rgba(7, 9, 13, 0.6);
  cursor: pointer; font-size: 18px; line-height: 1;
  backdrop-filter: blur(4px);
}
.tool:hover { border-color: var(--dim); }
.tool[aria-pressed="false"] { opacity: 0.55; }

/* No smooth scroll-behavior here: the story glides itself (ui.js), and stops when the player scrolls */
.reader { min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--bg); border-left: 1px solid var(--line); }
.story { overflow-y: auto; flex: 1; min-height: 0; background: var(--bg); }
.story-scene { margin-bottom: 28px; }
/* Preserve the original per-paragraph fade; Continue only gates the next scene. */
/* Space below lets the latest line settle 30% above the pane's bottom. */
.story::after { content: ""; display: block; height: 30vh; }
.log { max-width: 600px; margin: 0 auto; padding: 40px clamp(20px, 4vw, 44px) 24px; }
.hint { text-align: center; font-size: 14px; color: var(--ink-2); margin: 0 auto 14px; padding: 0 24px; max-width: 480px; transition: opacity 0.4s; }
.hint.is-hidden { opacity: 0; }
/* The way back down to the newest line, when the player has scrolled up to reread */
.jump-wrap { position: sticky; bottom: 18px; height: 0; display: flex; justify-content: center; align-items: flex-end; pointer-events: none; z-index: 2; }
.jump {
  pointer-events: auto; cursor: pointer;
  font-family: var(--f-ui); font-size: 14px; color: var(--ink);
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid var(--line-2); background: rgba(16, 21, 28, 0.92);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
}
.jump:hover { border-color: var(--accent); }
.jump[hidden] { display: none; }

.step { margin: 0 0 34px; }
.step + .step { border-top: 1px solid var(--line); padding-top: 30px; }
.chosen { margin: 0 0 18px; }
.chosen .eyebrow { margin-bottom: 4px; }
.chosen p { margin: 0; font-family: var(--f-ui); font-size: 15px; color: var(--ink-2); }
.chosen b { color: var(--ink); }

.beat {
  font-family: var(--f-story);
  font-size: 19px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0 0 12px;
  opacity: 0;
  transform: translateY(10px);
  filter: blur(3px);
  /* a slow, even fade, so lines come in softly instead of popping up */
  transition: opacity 1.55s ease-in-out, transform 1.55s cubic-bezier(0.25, 0.6, 0.3, 1), filter 1.3s ease-out;
}
.beat.is-in { opacity: 1; transform: none; filter: none; }
.beat.t { font-family: var(--f-px); font-size: 13px; letter-spacing: 0.1em; color: var(--accent-hi); margin-top: 22px; }
.beat.s { font-weight: 700; font-size: 21px; }
.beat .story-emphasis { font-size: 1.12em; font-weight: 700; }
.beat.q { font-style: italic; color: var(--ink-2); border-left: 2px solid var(--accent-deep); padding: 2px 0 2px 14px; }
.beat.sign { white-space: pre-line; font-style: normal; color: var(--ink-2); border-left: 2px solid var(--accent-deep); padding: 10px 16px; background: rgba(255,255,255,.025); }
.beat.hr { text-align: center; color: var(--faint); letter-spacing: 0.6em; font-size: 14px; margin: 22px 0; }
.beat.sms { font-family: var(--f-ui); font-size: 16px; line-height: 1.45; }
.sms-bubble {
  display: inline-block; max-width: 92%;
  background: #1b2430; border: 1px solid var(--line-2);
  border-radius: 16px 16px 16px 4px; padding: 9px 13px 10px;
}
.sms-bubble.mine { background: #24324a; border-radius: 16px 16px 4px 16px; }
.sms-who { display: block; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); margin-bottom: 2px; }
.beat.sms.mine-row { text-align: right; }

.panel { margin: 22px 0 0; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); opacity: 0; transition: opacity 1.2s ease-in-out; }
.panel.is-in { opacity: 1; }
.panel .eyebrow { color: var(--dim); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 14px; margin: 0 0 14px; }
.stat { font-size: 15px; display: flex; align-items: baseline; gap: 6px; min-width: 0; }
/* A long value wraps inside its cell instead of running into the next one. */
.stat > span:not(.v) { white-space: nowrap; }
.stat .v { font-weight: 700; min-width: 0; }
.stat.wide { grid-column: 1 / -1; }
.stat .arrow { font-size: 12px; color: var(--dim); }
.stat .arrow.down { color: var(--bad); }
.stat .arrow.up { color: var(--good); }
.stat .new { font-family: var(--f-px); font-size: 9px; color: var(--accent); letter-spacing: 0.1em; }
.bar { display: inline-block; width: 46px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; vertical-align: middle; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cold), var(--accent)); }
.time-lines { display: grid; gap: 3px; font-size: 15px; color: var(--ink-2); }

.decision { margin: 26px 0 0; opacity: 0; transition: opacity 1.2s ease-in-out; }
.decision.is-in { opacity: 1; }
.decision h2 { font-family: var(--f-story); font-weight: 700; font-size: 23px; margin: 0 0 14px; }
.opts { display: grid; gap: 10px; }
.opt {
  display: grid; grid-template-columns: 34px 1fr; gap: 4px 12px; text-align: left;
  width: 100%; padding: 14px 16px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line-2); background: #0f141b;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.opt:hover:not(:disabled) { border-color: var(--accent); background: #141a22; }
.opt:active:not(:disabled) { transform: translateY(1px); }
.opt:disabled { cursor: default; opacity: 0.32; }
.opt.is-picked { opacity: 1; border-color: var(--accent); background: #18120c; }
.opt .key {
  grid-row: span 3; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  font-family: var(--f-px); font-size: 14px; color: var(--accent-hi); border: 1px solid var(--line-2);
}
.opt .lbl { font-weight: 700; font-size: 17px; color: var(--ink); line-height: 1.3; }
.opt .line { font-size: 14.5px; color: var(--dim); line-height: 1.4; }
.opt .costs { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 13.5px; color: var(--ink-2); }

.continue { margin: 28px 0 0; text-align: center; opacity: 0; transition: opacity 0.9s ease-in-out; }
.continue.is-in { opacity: 1; }

/* ---------- ending ---------- */
#end { background: var(--bg); }
.end-wrap { max-width: 760px; margin: 0 auto; padding: clamp(32px, 6vw, 72px) clamp(20px, 4vw, 40px) 80px; }
.end-hero { text-align: center; margin: 0 0 40px; }
.end-tag { display: inline-block; font-family: var(--f-px); font-size: 11px; letter-spacing: 0.2em; padding: 6px 10px; border-radius: 6px; margin: 0 0 16px; }
.end-tag.alive { color: #10200b; background: var(--good); }
.end-tag.dead { color: #fff; background: #5a2620; }
.end-title { font-family: var(--f-px); font-weight: 700; font-size: clamp(32px, 6vw, 58px); line-height: 1; margin: 0 0 18px; }
.end-line { font-family: var(--f-story); font-size: 20px; line-height: 1.55; color: var(--ink-2); margin: 0 auto; max-width: 34em; }
.end-sec { margin: 0 0 36px; }
.end-sec h3 { font-family: var(--f-px); font-size: 12px; letter-spacing: 0.18em; color: var(--accent-hi); margin: 0 0 12px; font-weight: 400; }
.end-sec p { margin: 0 0 8px; }
.final { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 15px; color: var(--ink-2); }
.final b { color: var(--ink); }
.route { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 15px; }
.route .stop { background: #121821; border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; }
.route .stop small { color: var(--dim); margin-left: 6px; }
.route .sep { color: var(--faint); }
.signals { display: grid; gap: 10px; }
.sig { display: grid; grid-template-columns: 76px 1fr auto; gap: 2px 12px; padding: 10px 12px; border-radius: 10px; background: #0f141b; border: 1px solid var(--line); }
.sig .tm { font-family: var(--f-px); font-size: 11px; color: var(--accent-hi); padding-top: 3px; }
.sig .tx { font-family: var(--f-story); font-size: 16px; }
.sig .mn { grid-column: 2 / 4; font-size: 14px; color: var(--dim); }
.sig .ok { font-size: 12px; font-family: var(--f-px); letter-spacing: 0.08em; align-self: start; padding-top: 3px; }
.sig .ok.yes { color: var(--good); }
.sig .ok.no { color: var(--bad); }
.mattered { padding: 14px 16px; border-left: 3px solid var(--accent); background: #15110c; border-radius: 0 10px 10px 0; }
.lessons li, .questions li { margin: 0 0 8px; }
.lessons, .questions { padding-left: 20px; margin: 0; }
.questions li { font-family: var(--f-story); font-size: 18px; font-style: italic; color: var(--ink-2); }
.map-box { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #0a0e13; }
.map-box svg { display: block; width: 100%; height: auto; }
.counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.count { font-family: var(--f-px); font-size: 11px; letter-spacing: 0.08em; color: var(--ink-2); border: 1px dashed var(--line-2); border-radius: 8px; padding: 7px 10px; }
.count b { color: var(--accent-hi); font-weight: 400; }
.split { margin: 0 0 14px; }
.split-head { font-size: 14px; color: var(--dim); margin: 0 0 6px; }
.split-head b { color: var(--ink); font-weight: 700; }
.split-row { display: grid; grid-template-columns: 24px 1fr 46px; align-items: center; gap: 8px; font-size: 13px; margin: 0 0 4px; }
.split-row .k { font-family: var(--f-px); color: var(--dim); }
.split-row .track { height: 8px; border-radius: 4px; background: rgba(255,255,255,.06); overflow: hidden; }
.split-row .fill { display: block; height: 100%; background: #3a4a5e; }
.split-row.mine .fill { background: var(--accent); }
.split-row.mine .k, .split-row.mine .pc { color: var(--accent-hi); }
.split-row .pc { text-align: right; color: var(--dim); }
.share { font-family: var(--f-story); font-size: 20px; margin: 4px 0 18px; }
.collect { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.collect .box { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #0f141b; }
.collect .big { font-family: var(--f-px); font-size: 26px; color: var(--accent-hi); }
.endings-list { list-style: none; padding: 0; margin: 10px 0 0; font-size: 14px; color: var(--dim); columns: 2; }
.endings-list li.got { color: var(--ink); }
.end-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 44px 0 0; }

/* ---------- sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(0,0,0,.6); padding: 20px; }
.sheet-card { width: min(440px, 100%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; padding: 22px 22px 18px; }
.sheet-card ul { margin: 0 0 16px; padding-left: 18px; }
.sheet-card li { margin: 0 0 4px; }
.sheet-card .wearing { color: var(--dim); font-size: 14px; margin: 0 0 12px; }

/* ---------- official runs and today's expedition ---------- */
.today { margin: 26px 0 0; padding: 18px 20px; border: 1px solid var(--line-2); border-radius: 14px; background: rgba(255, 154, 60, 0.04); max-width: 34em; }
.today .eyebrow { margin: 0 0 6px; }
.today h2 { font-family: var(--f-story); font-weight: 700; font-size: 22px; margin: 0 0 10px; }
.today .conds { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 16px; font-size: 14px; color: var(--ink-2); }
.today .note { font-size: 13px; color: var(--dim); margin: 12px 0 0; }
.today .result { font-size: 15px; color: var(--ink-2); margin: 0 0 14px; }
.today .result b.alive { color: var(--good); }
.today .result b.dead { color: var(--bad); }
.today.locked { background: transparent; }
.today.locked h2 { color: var(--dim); }
.today .actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.run-tag { font-family: var(--f-px); font-size: 10px; letter-spacing: 0.16em; color: var(--accent-hi); margin-top: 6px; }
.run-tag.practice { color: var(--dim); }
.end-run { font-family: var(--f-px); font-size: 11px; letter-spacing: 0.2em; color: var(--accent-hi); margin: 0 0 10px; }
.end-run.practice { color: var(--dim); }
.end-official { font-size: 15px; color: var(--dim); margin: 14px 0 0; }
.end-review { font-family: var(--f-story); font-size: 16px; color: var(--ink-2); margin: 12px auto 0; max-width: 34em; }
/* The ending opens on a summary; the debrief and the map are behind buttons. */
.end-summary { margin: 0 0 8px; }
.sum-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 30px; }
.sum-box { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); font-size: 13px; color: var(--dim); }
.sum-box .big { font-family: var(--f-story); font-weight: 700; font-size: 24px; color: var(--ink); line-height: 1.15; }
.end-panel { margin: 0 0 18px; }
@media (max-width: 560px) { .sum-row { grid-template-columns: 1fr; } }

/* ---------- one-line reviews: asked after the first run, listed on the card ---------- */
.review { margin: 30px 0 0; padding: 22px 22px 18px; border: 1px solid var(--line-2); border-radius: 14px; background: rgba(255, 154, 60, 0.05); opacity: 0; transition: opacity 0.6s; }
.review.is-in { opacity: 1; }
.review-q { font-family: var(--f-story); font-weight: 700; font-size: clamp(21px, 2vw, 25px); line-height: 1.4; color: var(--ink); margin: 0 0 10px; }
.review-sub { font-size: 14px; line-height: 1.5; color: var(--dim); margin: 0 0 16px; }
.review-input { width: 100%; padding: 13px 14px; font: inherit; font-size: 16px; color: var(--ink); background: var(--bg); border: 1px solid var(--line-2); border-radius: 10px; }
.review-input::placeholder { color: var(--faint); }
.review-input:focus { outline: none; border-color: var(--accent); }
.review-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 0; }
.review-actions .btn:disabled { opacity: 0.45; cursor: default; }
.review-actions .btn-primary:disabled:hover { background: var(--accent); }
.reviews { margin: 22px 0 0; max-width: 34em; }
.reviews .eyebrow { margin: 0 0 10px; }
.reviews ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.reviews li { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.reviews li.mine { border-color: rgba(255, 154, 60, 0.35); }
.rv-text { font-family: var(--f-story); font-size: 16.5px; line-height: 1.5; color: var(--ink); margin: 0 0 4px; overflow-wrap: anywhere; }
.rv-meta { font-size: 13px; color: var(--dim); margin: 0; }
.rv-meta .alive { color: var(--good); }
.rv-meta .dead { color: var(--bad); }
.rv-me { font-size: 11px; color: var(--accent-hi); border: 1px solid rgba(255, 196, 107, 0.4); border-radius: 999px; padding: 0 6px; }
.btn-link { margin: 10px 0 0; padding: 4px 0; font: inherit; font-size: 14px; color: var(--dim); background: none; border: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { color: var(--ink); }
.share-box { white-space: pre-wrap; font-family: var(--f-ui); font-size: 15px; line-height: 1.5; color: var(--ink); background: #0f141b; border: 1px solid var(--line-2); border-radius: 12px; padding: 14px 16px; margin: 0 0 12px; }
.share-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.share-row .note { font-size: 13px; color: var(--dim); }

.new-notes { margin: 0 0 8px; padding-left: 20px; }
.new-notes li { margin: 0 0 6px; font-family: var(--f-story); font-size: 18px; }
.new-notes a { color: var(--accent-hi); }

.lang-switch { align-self: flex-start; margin: -18px 0 22px; padding: 4px 10px; font: inherit; font-size: 13px; color: var(--dim); background: transparent; border: 1px solid var(--line-2); border-radius: 999px; cursor: pointer; }
.lang-switch:hover { color: var(--ink); border-color: var(--dim); }
html[lang="ko"] { --f-story: "Alegreya", "Gowun Batang", serif; --f-ui: "Alegreya Sans", "Gowun Dodum", system-ui, sans-serif; --f-px: "Silkscreen", "Gowun Dodum", sans-serif; }
html[lang="ko"] body { word-break: keep-all; }
html[lang="ko"] .beat { line-height: 1.75; }
/* Hangul has no pixel font: labels set in Silkscreen switch to the UI font, a little larger, without the wide tracking. */
html[lang="ko"] .eyebrow, html[lang="ko"] .card-meta, html[lang="ko"] .hud-place, html[lang="ko"] #hudClock, html[lang="ko"] .beat.t,
html[lang="ko"] .stat .new, html[lang="ko"] .end-tag, html[lang="ko"] .end-sec h3, html[lang="ko"] .sig .tm, html[lang="ko"] .sig .ok,
html[lang="ko"] .count, html[lang="ko"] .split-row .k, html[lang="ko"] .run-tag, html[lang="ko"] .end-run { font-family: var(--f-ui); letter-spacing: 0.03em; text-transform: none; }
html[lang="ko"] .eyebrow { font-size: 12.5px; }
html[lang="ko"] .card-meta { font-size: 13.5px; }
html[lang="ko"] .hud-place { font-size: 12.5px; }
html[lang="ko"] .beat.t { font-size: 15px; }
html[lang="ko"] .end-tag, html[lang="ko"] .end-run, html[lang="ko"] .run-tag, html[lang="ko"] .sig .tm { font-size: 12.5px; }
html[lang="ko"] .end-sec h3 { font-size: 13.5px; }
html[lang="ko"] .end-title { font-family: var(--f-story); }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  #card.is-on { grid-template-columns: 1fr; grid-template-rows: 46vh auto; }
  .card-body { padding: 26px 20px 40px; }
  #play { grid-template-columns: 1fr; grid-template-rows: 36vh minmax(0, 1fr); }
  .reader { border-left: 0; border-top: 1px solid var(--line); }
  .story::after { height: 30vh; }
  .log { padding: 26px 18px 16px; }
  .beat { font-size: 18px; }
  .hud { padding: 12px 14px; }
  .sig { grid-template-columns: 62px 1fr; }
  .sig .ok { grid-column: 2; }
  .collect { grid-template-columns: 1fr; }
  .endings-list { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .beat { transition: opacity 0.8s ease-in-out; transform: none; filter: none; }
}
.opt.is-unavailable { opacity: .46; cursor: default; }
.route-map-card { width: min(1100px, 94vw); max-width: none; max-height: calc(100dvh - 40px); display: flex; flex-direction: column; }
#routeMapBody { min-height: 0; overflow: auto; }
.route-map-card > [data-close] { align-self: flex-end; flex-shrink: 0; margin-top: 12px; }
.wildfire-map-viewport { overflow: auto; max-height: 58dvh; }
.wildfire-map-zoom { margin-bottom: 12px; }
.wildfire-map svg { display: block; width: min(100%, 77.333dvh); height: auto; margin-inline: auto; background: #e9e4d5; }
.wildfire-map p, .wildfire-map li { font-size: 15px; line-height: 1.65; }
.wildfire-map ul { padding-left: 20px; }
