@font-face{font-family:'Fraunces';font-style:italic;font-weight:300 900;font-display:swap;src:url(fonts/fraunces-italic-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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:'Fraunces';font-style:italic;font-weight:300 900;font-display:swap;src:url(fonts/fraunces-italic-latin.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:'Fraunces';font-style:normal;font-weight:300 900;font-display:swap;src:url(fonts/fraunces-normal-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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:'Fraunces';font-style:normal;font-weight:300 900;font-display:swap;src:url(fonts/fraunces-normal-latin.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:'Source Serif 4';font-style:italic;font-weight:300 700;font-display:swap;src:url(fonts/source-serif-4-italic-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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:'Source Serif 4';font-style:italic;font-weight:300 700;font-display:swap;src:url(fonts/source-serif-4-italic-latin.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:'Source Serif 4';font-style:normal;font-weight:300 700;font-display:swap;src:url(fonts/source-serif-4-normal-latin-ext.woff2) format('woff2');unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, 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:'Source Serif 4';font-style:normal;font-weight:300 700;font-display:swap;src:url(fonts/source-serif-4-normal-latin.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}
/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --paper: #f3ecdf;
  --paper-deep: #e9e0cf;
  --surface: #fbf7ef;
  --ink: #1c1814;
  --ink-soft: #3a332b;
  --ink-muted: #473f35;
  --rule: #d6cab4;
  --rule-strong: #b5a78d;
  --accent: #a8261c;          /* cinnabar, marks and fills */
  --accent-text: #801b13;     /* cinnabar for small text on paper */
  --on-accent: #fff8ef;
  --gold: #634306;
  --sea: #dbe3df;
  --land: #f1e8d6;
  --desert: #e3cf9f;
  --stipple: #b89a5b;
  --mount: #d7c8ab;
  --hatch: #a8957a;
  --coast: #8f826b;
  --river: #7d9aa3;
  --grat: #c3cdc8;
  --route: #b3261e;
  --route-dim: #b3261e40;
  --route-ghost: #6b5e4c;
  --kept: #2e7d32;
  --cut: #b3261e;
  --rewritten: #9a6a00;
  --label: #2a241d;
  --label-halo: #f1e8d6;
  --shadow: 0 1px 2px #1c181414, 0 8px 24px #1c181412;
  --display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --serif: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --han: "Seal Han", "Noto Serif TC", "Songti TC", "PMingLiU", serif;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --bar: 2.75rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #14110d;
    --paper-deep: #1d1914;
    --surface: #1f1a15;
    --ink: #f1e9dc;
    --ink-soft: #ddd3c3;
    --ink-muted: #c2b7a5;
    --rule: #3a3229;
    --rule-strong: #5a4f41;
    --accent: #e0513c;
    --accent-text: #ff9d86;
    --on-accent: #1a0f0b;
    --gold: #e0b45c;
    --sea: #10181b;
    --land: #231e18;
    --desert: #3a2f1e;
    --stipple: #6e5a37;
    --mount: #312a21;
    --hatch: #5c4f3e;
    --coast: #5f5343;
    --river: #3f6068;
    --grat: #1e282b;
    --route: #ff6b50;
    --route-dim: #ff6b5038;
    --route-ghost: #a39580;
    --kept: #7cc47f;
    --cut: #ff6b50;
    --rewritten: #e0b45c;
    --label: #efe6d6;
    --label-halo: #231e18;
    --shadow: 0 1px 2px #0006, 0 8px 24px #0005;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #14110d;
  --paper-deep: #1d1914;
  --surface: #1f1a15;
  --ink: #f1e9dc;
  --ink-soft: #ddd3c3;
  --ink-muted: #c2b7a5;
  --rule: #3a3229;
  --rule-strong: #5a4f41;
  --accent: #e0513c;
  --accent-text: #ff9d86;
  --on-accent: #1a0f0b;
  --gold: #e0b45c;
  --sea: #10181b;
  --land: #231e18;
  --desert: #3a2f1e;
  --stipple: #6e5a37;
  --mount: #312a21;
  --hatch: #5c4f3e;
  --coast: #5f5343;
  --river: #3f6068;
  --grat: #1e282b;
  --route: #ff6b50;
  --route-dim: #ff6b5038;
  --route-ghost: #a39580;
  --kept: #7cc47f;
  --cut: #ff6b50;
  --rewritten: #e0b45c;
  --label: #efe6d6;
  --label-halo: #231e18;
  --shadow: 0 1px 2px #0006, 0 8px 24px #0005;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
/* clip, not hidden: hidden turns body into a scroll container and every sticky element stops sticking */
html, body { overflow-x: clip; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-size: 1.125rem; line-height: 1.62;
  font-optical-sizing: auto; text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
em { font-style: italic; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; color: var(--ink); text-wrap: balance; }
section { scroll-margin-top: calc(var(--bar) + .5rem); }
[hidden] { display: none !important; }
.wrap { max-width: 72rem; margin: 0 auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--ink); color: var(--paper); padding: .5rem .8rem; border-radius: 4px; }
.skip:focus { left: .8rem; top: .8rem; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: .55rem;
  min-height: var(--bar); padding: .3rem var(--gutter);
  padding-top: calc(.3rem + env(safe-area-inset-top, 0px));
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: saturate(1.3) blur(10px); -webkit-backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid var(--rule); font-family: var(--sans); font-size: .78rem;
}
.topbar .home { font-weight: 650; color: var(--ink-soft); text-decoration: none; flex: none; }
.topbar .spacer { flex: 1; }
.topnav { display: flex; gap: .1rem; overflow-x: auto; scrollbar-width: none; min-width: 0; margin-left: .25rem; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { padding: .25rem .55rem; border-radius: 999px; text-decoration: none; color: var(--ink-muted); white-space: nowrap; }
.topnav a:hover { color: var(--accent-text); background: var(--paper-deep); }
.topnav a[aria-current="true"] { color: var(--ink); background: var(--paper-deep); font-weight: 650; }
.langmenu { position: relative; flex: none; }
.langmenu summary {
  display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .6rem; border-radius: 999px;
  border: 1px solid var(--rule-strong); color: var(--ink-soft); background: var(--surface);
  cursor: pointer; list-style: none; white-space: nowrap;
}
.langmenu summary::-webkit-details-marker { display: none; }
.langmenu summary:hover { border-color: var(--accent); color: var(--accent-text); }
.langmenu ul {
  position: absolute; right: 0; top: calc(100% + .4rem); margin: 0; padding: .3rem; list-style: none;
  background: var(--surface); border: 1px solid var(--rule-strong); border-radius: .6rem;
  box-shadow: var(--shadow); min-width: 11rem; z-index: 60;
}
.langmenu li a { display: block; padding: .32rem .6rem; border-radius: .4rem; color: var(--ink-soft); text-decoration: none; white-space: nowrap; }
.langmenu li a:hover { color: var(--accent-text); background: var(--paper-deep); }
.langmenu li a[aria-current="true"] { color: var(--ink); font-weight: 650; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 1.95rem; height: 1.95rem; padding: 0; border-radius: 999px; cursor: pointer;
  color: var(--ink-muted); background: var(--surface); border: 1px solid var(--rule-strong);
}
.icon-btn:hover { color: var(--accent-text); border-color: var(--accent); }
.icon-btn svg { display: block; }
.icon-btn svg[hidden] { display: none; }
@media (max-width: 34rem) {
  .topbar { gap: .35rem; }
  .topbar .home { max-width: 5.6rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .topnav a { padding: .25rem .4rem; }
}

/* ---------- reading rail ---------- */
.rail { display: none; position: fixed; top: 50%; right: 1.1rem; transform: translateY(-50%); flex-direction: column; align-items: flex-end; gap: .5rem; z-index: 30; }
@media (min-width: 88rem) { .rail { display: flex; } }
.rail-dot { position: relative; display: flex; align-items: center; justify-content: flex-end; width: 14px; padding: .15rem 0; text-decoration: none; }
.rail-dot .dot { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--rule-strong); transition: background-color .15s, transform .15s; }
.rail-dot:hover .dot, .rail-dot:focus-visible .dot { background: var(--ink-soft); }
.rail-dot.active .dot { background: var(--accent); transform: scale(1.5); }
.rail-label {
  position: absolute; right: 100%; top: 50%; margin-top: -.85rem; margin-right: .5rem;
  font-family: var(--sans); font-size: .75rem; line-height: 1.2; color: var(--ink-soft); white-space: nowrap;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 4px; padding: .25rem .55rem; box-shadow: var(--shadow);
  opacity: 0; transform: translateX(6px); pointer-events: none; transition: opacity .12s, transform .12s;
}
.rail-dot:hover .rail-label, .rail-dot:focus-visible .rail-label { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rail-dot .dot, .rail-label { transition: none; } }
@media print { .rail, .topbar { display: none; } }

/* ---------- hero ---------- */
.hero {
  position: relative; display: grid; gap: 1.5rem 2.5rem;
  padding: clamp(1.2rem, 3vw, 2.2rem) var(--gutter) 2rem; max-width: 96rem; margin: 0 auto;
}
@media (min-width: 64rem) {
  .hero { grid-template-columns: minmax(0, 1.02fr) minmax(0, .98fr); align-items: start; padding-bottom: 1.5rem; }
  .hero-text { grid-column: 1; grid-row: 1; margin: 0; min-width: 0; padding-top: .4rem; }
  .hero-doc { grid-column: 2; grid-row: 1 / span 2; margin: 0; min-width: 0; }
  .hero-doc .plate { margin: 0; }
  .hero-doc img { max-height: min(66svh, 42rem); width: auto; max-width: 100%; margin-inline: auto; }
  .cast-wrap { grid-column: 1; grid-row: 2; align-self: start; }
}
.kicker { font-family: var(--sans); font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); margin: 0 0 .9rem; }
.hero h1 { font-size: clamp(2.3rem, 5.2vw, 3.7rem); line-height: 1.02; letter-spacing: -.02em; margin: 0 0 1.1rem; font-weight: 640; font-variation-settings: "SOFT" 30, "WONK" 0; }
.deck { font-size: clamp(1.1rem, 1.8vw, 1.28rem); line-height: 1.5; color: var(--ink-soft); margin: 0 0 1rem; max-width: 34rem; }
.byline { font-family: var(--sans); font-size: .82rem; color: var(--ink-muted); margin: 0; }
.lede { font-size: 1.12rem; line-height: 1.55; color: var(--ink-soft); margin: 0 0 1rem; max-width: 46rem; }
.cast-wrap h2 { font-family: var(--sans); font-size: .76rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); margin: 0 0 .6rem; }
.cast { margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.cast-card {
  display: grid; grid-template-columns: auto 1fr; column-gap: .65rem; align-items: center;
  padding: .5rem .65rem; border-radius: 6px; text-decoration: none; color: var(--ink);
  background: var(--surface); border: 1px solid var(--rule); transition: transform .15s, border-color .15s;
}
.cast-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.cast-num { font-family: var(--display); font-weight: 700; font-size: .85rem; letter-spacing: .14em; color: var(--on-accent); background: var(--accent); border-radius: 3px; padding: .3em .45em .25em .55em; line-height: 1; }
.cast-main { display: grid; }
.cast-name { font-family: var(--display); font-weight: 600; font-size: 1rem; line-height: 1.15; }
.cast-role { font-family: var(--sans); font-size: .74rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }

/* ---------- narrative ---------- */
.narrative { max-width: 46rem; margin: 0 auto; padding: 0 var(--gutter); }
.mapsec h2, .game h2, .decoder h2, .numbers h2, .myths h2, .sources h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); line-height: 1.1; letter-spacing: -.015em; margin: 0 0 1rem; }

.chapter { padding: 3.5rem 0 2.5rem; border-top: 1px solid var(--rule); }
.ch-head { display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; align-items: center; margin-bottom: 1.2rem; }
.ch-num { grid-column: 1 / -1; margin: 0 0 .3rem; font-family: var(--display); font-weight: 700; font-size: .9rem; letter-spacing: .2em; color: var(--accent-text); }
.ch-head h2 { margin: 0; font-size: clamp(2rem, 4.8vw, 3rem); line-height: 1; letter-spacing: -.02em; }
.ch-dates { margin: .35rem 0 0; font-family: var(--sans); font-size: .85rem; color: var(--ink-muted); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 0 1.6rem; background: var(--rule); border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.stats > div { background: var(--surface); padding: .6rem .8rem; }
.stats dt { font-family: var(--sans); font-size: .7rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
.stats dd { margin: .1rem 0 0; font-family: var(--display); font-size: 1.12rem; font-weight: 600; line-height: 1.3; }
.chapter p { margin: 0 0 1.1rem; }

.plate { margin: 1.8rem 0; }
.plate img { width: 100%; height: auto; border-radius: 6px; background: var(--paper-deep); box-shadow: var(--shadow); }
.plate.portrait img { max-height: 34rem; width: auto; max-width: 100%; margin-inline: auto; }
figcaption { font-family: var(--sans); font-size: .82rem; line-height: 1.45; color: var(--ink-muted); margin-top: .6rem; }
.credit { display: block; margin-top: .15rem; }
.credit a { color: var(--ink-muted); }

/* ---------- story map ---------- */
.map-fig { margin: 1.6rem 0 0; }
.map-fig svg { width: 100%; height: auto; display: block; border-radius: 10px; box-shadow: var(--shadow); }
.storymap { font-family: var(--sans); }
.storymap .sea-rect { fill: var(--sea); }
.storymap .grat path { fill: none; stroke: var(--grat); stroke-width: 1; }
.storymap .land path { fill: var(--land); stroke: var(--coast); stroke-width: 1.1; }
.storymap .romania path { fill: var(--paper-deep); stroke: var(--ink-soft); stroke-width: 1.6; }
.storymap .ro-hatch path { fill: url(#ro-hatch); stroke: none; }
.storymap .hatch-line { stroke: var(--hatch); stroke-width: 1; opacity: .55; }
.storymap .lakes path { fill: var(--sea); stroke: var(--river); stroke-width: .8; }
.storymap .rivers path { fill: none; stroke: var(--river); stroke-width: 1.8; stroke-linecap: round; }
.storymap .frame { fill: none; stroke: var(--rule-strong); stroke-width: 2; }
.storymap text { paint-order: stroke; stroke: var(--label-halo); stroke-width: 3px; fill: var(--label); }
.storymap .sea { font-size: 21px; font-style: italic; letter-spacing: .28em; text-transform: uppercase; fill: var(--river); stroke: none; opacity: .9; }
.storymap .river { font-size: 12.5px; font-style: italic; fill: var(--river); }
.storymap .country { font-size: 15px; font-weight: 700; letter-spacing: .3em; text-transform: uppercase; opacity: .55; }
.storymap .town-dot { fill: var(--ink-muted); }
.storymap .town { font-size: 12.5px; fill: var(--ink-muted); }
.storymap .dot .halo { fill: none; stroke: var(--accent); stroke-width: 1.6; opacity: .85; }
.storymap .dot .core { fill: var(--accent); stroke: var(--label-halo); stroke-width: 1.5; }
.storymap .place { font-size: 15px; font-weight: 700; }
.storymap .place-sub { font-size: 11.5px; fill: var(--ink-muted); }
@media (max-width: 40rem) {
  .storymap .place-sub { display: none; }
  .storymap .town { font-size: 11px; }
  .storymap .sea { font-size: 17px; }
}

/* ---------- data moments ---------- */
.moment {
  display: grid; place-items: center; min-height: 100svh;
  padding: 4rem var(--gutter); border-top: 1px solid var(--rule); background: var(--surface);
  scroll-margin-top: var(--bar);
}
#moment-81 { background: var(--paper); }
.moment-inner { width: 100%; max-width: 62rem; margin: 0 auto; text-align: center; }
.moment .kicker { margin-bottom: 1.4rem; }
.moment-giant {
  margin: 0 0 1rem; font-family: var(--display); font-weight: 700;
  font-size: clamp(3.4rem, 12vw, 8rem); line-height: 1; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums lining-nums; color: var(--ink);
}
.moment-giant.small { font-size: clamp(2.6rem, 8vw, 4.6rem); margin-bottom: .6rem; }
.moment-unit, .moment-prefix { font-size: clamp(1.3rem, 3.4vw, 2rem); font-weight: 560; color: var(--accent-text); letter-spacing: 0; }
.moment-range { font-family: var(--sans); font-size: .95rem; color: var(--ink-muted); margin: 0 0 1rem; font-variant-numeric: tabular-nums; }
.moment-human, .moment-sub { font-size: clamp(1.1rem, 2.4vw, 1.4rem); line-height: 1.5; color: var(--ink-soft); margin: 0 auto 1rem; max-width: 40rem; text-wrap: balance; }
.moment-extra { font-size: 1.02rem; color: var(--ink-soft); margin: 0 auto 1rem; max-width: 44rem; }
.moment-conds { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .45rem; text-align: left; }
.moment-conds li {
  font-size: 1rem; line-height: 1.45; color: var(--ink-soft); padding: .55rem .8rem .55rem 2.4rem;
  background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; position: relative;
  counter-increment: cond;
}
.moment-conds { counter-reset: cond; }
.moment-conds li::before {
  content: counter(cond); position: absolute; left: .7rem; top: .55rem;
  font: 700 .8rem var(--sans); color: var(--on-accent); background: var(--accent);
  border-radius: 3px; padding: .15em .42em; line-height: 1.4;
}
.moment-faceoff { display: grid; gap: 2rem; margin: 0 0 1.6rem; align-items: start; }
@media (min-width: 64rem) {
  .moment-faceoff { grid-template-columns: 1.2fr 1fr; gap: 2.5rem; }
}
.moment-side { margin: 0; }
.moment-side figcaption { font-family: var(--sans); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); margin: 0 0 .7rem; }
@media (min-width: 64rem) {
  #moment-conditii .moment-inner { max-width: 68rem; }
}
.moment-cite { font-family: var(--sans); font-size: .88rem; color: var(--ink-muted); margin: 0; }

/* ---------- game ---------- */
.game, .decoder, .numbers, .myths, .sources, .mapsec { padding: 4.5rem 0 3.5rem; border-top: 1px solid var(--rule); }
.game { background: var(--paper-deep); }
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.round { margin: 0 0 2rem; }
.round h3 { margin: 0 0 .2rem; font-size: 1.3rem; }
.round-task { margin: 0 0 1rem; color: var(--ink-soft); }
.game-legend { color: var(--ink-soft); max-width: 60ch; }
.card-buttons { flex-direction: column; }
.card-buttons button { flex: none; width: 100%; text-align: left; font-size: 1.05rem; line-height: 1.45; }
.card-buttons .line { display: block; }
.card {
  position: relative; display: flex; flex-direction: column; padding: 1.1rem 1.1rem 1rem; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--rule); box-shadow: var(--shadow);
  transition: transform .25s, border-color .25s;
}
.card-num { position: absolute; right: .9rem; top: .7rem; margin: 0; font-family: var(--display); font-weight: 700; font-size: 1.6rem; color: var(--rule-strong); line-height: 1; }
.card-place { margin: 0 2rem .5rem 0; font-size: 1.25rem; line-height: 1.2; }
.card-buttons { display: none; gap: .5rem; margin-top: auto; }
.js .card-buttons { display: flex; }
.card-buttons button, .btn {
  flex: 1; font: 650 .92rem var(--sans); padding: .6rem .8rem; border-radius: 999px; cursor: pointer; text-decoration: none; text-align: center;
  color: var(--ink); background: var(--paper); border: 1.5px solid var(--rule-strong); min-height: 2.75rem;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.card-buttons button:hover, .btn:hover { border-color: var(--accent); color: var(--accent-text); }
.card-buttons button:active, .btn:active { transform: scale(.97); }
.card-buttons button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.card-buttons button:disabled { cursor: default; }
.card-buttons button:disabled:not([aria-pressed="true"]) { opacity: .45; }
.card-verdict { margin: .6rem 0 0; font: 700 .8rem var(--sans); letter-spacing: .12em; text-transform: uppercase; min-height: 0; }
.card-verdict:empty { display: none; }
.card.right { border-color: var(--gold); }
.card.right .card-verdict { color: var(--gold); }
.card.wrong .card-verdict { color: var(--accent-text); }
.card.answered { transform: translateY(-2px); }
.card-answer { margin-top: .6rem; font-size: .98rem; }
.card-answer summary { font: 600 .82rem var(--sans); color: var(--ink-muted); cursor: pointer; }
.card-answer p { margin: .4rem 0 .5rem; }
.game.ready .card-answer summary { display: none; }
.card-answer:focus { outline: none; }
.card-answer:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.game.ready .card:not(.answered) .card-answer { display: none; }
@keyframes pop { 0% { transform: scale(.96); } 60% { transform: scale(1.02); } 100% { transform: scale(1) translateY(-2px); } }
.game.ready .card.answered { animation: pop .4s ease-out; }
@media (prefers-reduced-motion: reduce) { .game.ready .card.answered { animation: none; } }
.scoreboard { margin-top: 1.6rem; padding: 1.2rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--rule); display: grid; gap: .6rem; }
.score { margin: 0; font-family: var(--display); font-weight: 650; font-size: 1.35rem; }
.score-done { margin: 0; color: var(--ink-soft); }
.score-done:empty { display: none; }
.score-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.score-actions .btn { flex: 0 1 auto; }

/* ---------- decoder ---------- */
.decoder-actions { display: none; gap: .6rem; margin: 0 0 1.2rem; flex-wrap: wrap; }
.js .decoder-actions { display: flex; }
.phrases { list-style: none; margin: 0; padding: 0; counter-reset: phrase; max-width: 52rem; }
.phrases > li { margin-bottom: .7rem; }
.phrase { border: 1px solid var(--rule); border-radius: 10px; background: var(--surface); overflow: hidden; }
.phrase summary { display: flex; gap: .8rem; align-items: baseline; padding: .9rem 1rem; cursor: pointer; list-style: none; }
.phrase summary::-webkit-details-marker { display: none; }
.phrase summary::before { counter-increment: phrase; content: counter(phrase, decimal-leading-zero); font: 700 .8rem var(--sans); color: var(--accent-text); font-variant-numeric: tabular-nums; }
.phrase-tag { font: 700 .7rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); border: 1px solid var(--rule-strong); border-radius: 999px; padding: .1rem .5rem; white-space: nowrap; }
.phrase-old { font-family: var(--display); font-size: 1.08rem; line-height: 1.45; }
.phrase[open] summary { border-bottom: 1px solid var(--rule); }
.gloss { margin: 0; padding: .9rem 1rem .9rem 3.2rem; font-size: 1.02rem; color: var(--ink-soft); }

/* ---------- sources ---------- */
.sources { font-size: 1rem; }
.sources > .wrap > p { max-width: 46rem; color: var(--ink-soft); }
.method-h { font-size: 1.3rem; margin: 0 0 .8rem; }
.source-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 1.2rem 2rem; margin-top: 2rem; }
.source-groups h3 { font-family: var(--sans); font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-muted); margin: 0 0 .4rem; }
.source-groups ol { margin: 0; padding-left: 1.1rem; font-family: var(--sans); font-size: .86rem; line-height: 1.5; }
.source-groups li { margin-bottom: .35rem; overflow-wrap: anywhere; }
.source-groups li::marker { color: var(--accent-text); }

/* ---------- footer ---------- */
.page footer { border-top: 1px solid var(--rule); padding: 2rem var(--gutter) calc(2.5rem + env(safe-area-inset-bottom, 0px)); text-align: center; font-family: var(--sans); font-size: .88rem; color: var(--ink-muted); }
.page footer p { margin: 0; }

/* ---------- 404 ---------- */
.missing { padding-block: 4rem 5rem; max-width: 40rem; }
.missing h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.05; margin: 0 0 1rem; }
.missing p { color: var(--ink-soft); }

@media (max-width: 63.99rem) {
  .cast-card { padding: .4rem .5rem; column-gap: .45rem; }
  .cast-name { font-size: .92rem; }
}

/* ---------- scenes, decoder, numbers ---------- */
.scene {
  margin: 1.6rem 0; padding: 1.1rem 1.2rem 1rem 1.3rem; border-radius: 0 8px 8px 0;
  border-left: 4px solid var(--accent); background: var(--surface);
}
.scene-quote { margin: 0 0 .5rem; font-size: 1.06rem; line-height: 1.55; }
.scene-cite { margin: 0; font-family: var(--sans); font-size: .8rem; font-weight: 600; color: var(--ink-muted); }
.scene-cite::before { content: "— "; }



.num-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); gap: 1px; margin: 0; background: var(--rule); border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; }
.num-grid > div { background: var(--surface); padding: 1rem .9rem; }
.num-grid dt { font-family: var(--display); font-weight: 700; font-size: 2.1rem; line-height: 1; color: var(--accent-text); font-variant-numeric: tabular-nums lining-nums; }
.num-grid dd { margin: .4rem 0 0; font-family: var(--sans); font-size: .86rem; line-height: 1.4; color: var(--ink-soft); }

.card-situation { margin: 0 0 .9rem; font-size: 1rem; color: var(--ink-soft); }

/* ---------- script-gated controls (last: must beat the base rules) ---------- */
.scoreboard { display: none; }
.js .scoreboard { display: block; }

/* ---------- ballot-stamp motif ---------- */
.stamp { display: block; width: 100%; height: auto; overflow: visible; }
.stamp-ring { fill: none; stroke: var(--accent); stroke-width: 7; opacity: .92; }
.stamp-ring.thin { stroke-width: 2.5; }
.stamp-word {
  font-family: var(--display); font-weight: 800; font-size: 34px; letter-spacing: .06em;
  text-transform: uppercase; fill: var(--accent);
}
.stamp-years { font-family: var(--sans); font-weight: 700; font-size: 19px; letter-spacing: .14em; fill: var(--accent); opacity: .85; }
.hero-doc { position: relative; }
.hero-stamp { position: absolute; right: clamp(.4rem, 4%, 2rem); bottom: 3.2rem; width: clamp(6.5rem, 34%, 10rem); transform: rotate(9deg); pointer-events: none; }
.hero-stamp .stamp { filter: drop-shadow(0 2px 6px #1c181422); }
.game-fiction { color: var(--ink-muted); font-size: .95rem; max-width: 60ch; margin-top: -.4rem; }
.score-done {
  display: inline-block; align-self: start; margin: 0; padding: .4rem 1.1rem;
  border: 2.5px solid var(--accent); border-radius: 8px; transform: rotate(-2deg);
  font-family: var(--sans); font-size: .85rem; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
}
.score-done:empty { display: none; }
.card-verdict { font-style: normal; }
.card.right .card-verdict, .card.wrong .card-verdict { letter-spacing: .14em; }

/* ---------- canal motif: pick crossed with a surveyor chain ---------- */
.motif { display: block; width: 100%; height: auto; overflow: visible; }
.pick-handle { stroke: var(--ink-soft); stroke-width: 10; stroke-linecap: round; }
.pick-head { fill: none; stroke: var(--accent); stroke-width: 11; stroke-linecap: round; }
.pick-tip { stroke: var(--accent); stroke-width: 8; stroke-linecap: round; }
.chain-link { stroke: var(--gold); stroke-width: 3.5; fill: none; }
.motif-fig { max-width: 22rem; margin: 0 auto; }
.motif-fig .motif { max-height: 20rem; }
.game-motif { width: 5rem; margin: 0 0 1.2rem; opacity: .9; }

/* ---------- canal map extras ---------- */
.storymap .canal-lines path { fill: none; stroke: var(--route); stroke-width: 4.5; stroke-linecap: round; }
.storymap .canal-north { stroke-width: 3.5; }
.storymap .canal { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; fill: var(--route-ghost); }
.storymap .sea.narrow { font-size: 13px; }
.storymap .dot.camp .core { fill: var(--ink-soft); }
.storymap .dot.camp .halo { stroke: var(--ink-soft); }
@media (max-width: 40rem) {
  .storymap .sea.narrow { font-size: 11px; }
  .storymap .canal { font-size: 11px; }
}

/* ---------- lock cycle: one locking, looped; static final without motion ---------- */
.lock { display: block; width: min(100%, 26rem); height: auto; margin: 0 auto 1.2rem; }
.lock-frame { fill: none; stroke: var(--rule-strong); stroke-width: 2; }
.lock-water rect { fill: var(--river); opacity: .55; }
.lock-ship .ship-hull { fill: var(--accent); }
.lock-ship .ship-house { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.lock-gates line { stroke: var(--ink-soft); stroke-width: 3; }
.lock-walls rect { fill: var(--rule-strong); }
@keyframes lockcycle {
  0%, 42% { transform: translateY(46px); }
  72%, 100% { transform: translateY(0); }
}
.js .lock-water, .js .lock-ship { animation: lockcycle 9s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) {
  .js .lock-water, .js .lock-ship { animation: none; }
}

/* ---------- console verdict ---------- */
.verdict { margin: 0; padding: .7rem .9rem; border-radius: 8px; background: var(--paper); border: 1px solid var(--rule); color: var(--ink-soft); }
.verdict strong { display: block; font-family: var(--display); font-size: 1.05rem; color: var(--ink); }
