/* Virtual Visit: a warm, sunny pixel-adventure look. Golden-hour sky over
   stepped green hills, parchment panels in dark wood frames, a pixel font
   with crisp outlines, earthy terracotta / ochre / leaf green / teal, and
   hard pixel shadows; everything in CSS or inline SVG. */

:root {
  --ink: #3b2418;          /* dark wood brown */
  --ink-soft: rgba(59, 36, 24, 0.28);
  --wood: #5b3a29;
  --wood-light: #c98f5a;
  --paper: #f6e6c4;        /* parchment */
  --card: #fbf0d9;
  --muted: #8a6a4f;
  --yellow: #f4c55a;       /* golden */
  --red: #d2603f;          /* terracotta */
  --blue: #3d8a8c;         /* teal */
  --sky: #9fd3c7;
  --pink: #f0a868;
  --green: #7fb356;
  --caption: #f8e2b0;
  --display: "Pixelify Sans", "Zen Maru Gothic", system-ui, sans-serif;
  --round: "Pixelify Sans", "Zen Maru Gothic", "Hiragino Maru Gothic ProN", system-ui, sans-serif;
  --body: "Zen Kaku Gothic New", "Hiragino Sans", "Segoe UI", system-ui, sans-serif;
  --shadow: 0 4px 0 var(--ink-soft);
  --ol: 3px solid var(--ink);
  --radius: 6px;
  --frame: inset 0 0 0 3px var(--wood-light), inset 0 0 0 5px rgba(59, 36, 24, 0.12);
  --ease: cubic-bezier(0.3, 0.9, 0.35, 1);
  /* a 1-pixel outline in 8 directions plus a drop: pixel-game lettering */
  --pixel-outline: 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 2px 0 var(--ink), 0 -2px 0 var(--ink),
    2px 2px 0 var(--ink), -2px 2px 0 var(--ink), 2px -2px 0 var(--ink), -2px -2px 0 var(--ink), 0 5px 0 var(--ink-soft);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); }
body { font-family: var(--body); color: var(--ink); font-size: clamp(14px, 1.15vw + 6px, 22px); line-height: 1.5; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.jp { color: var(--red); font-weight: 700; font-family: "Zen Maru Gothic", var(--body); }

vv-app { position: fixed; inset: 0; display: block; overflow: hidden; background: var(--paper); }

.screen {
  position: absolute; inset: 0; display: block; overflow: hidden;
  background: var(--paper);
  animation: screen-in 0.4s steps(6, end);
}
.screen.overlay {
  background: rgba(59, 36, 24, 0.45); display: grid; place-items: center; z-index: 50;
  animation: fade-in 0.2s steps(4, end);
}
@keyframes screen-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } }

/* ---------- backgrounds: golden-hour sky, pixel clouds, green hills ---------- */
.sunburst {
  position: absolute; inset: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 16' shape-rendering='crispEdges'%3E%3Cpath d='M8 16V12H4V8H12V4H24V0H36V4H40V8H44V12H48V16Z' fill='%23fdf3dc'/%3E%3Cpath d='M8 16V12H48V16Z' fill='%23f2d9b0'/%3E%3C/svg%3E") 12% 14% / 13vw auto no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 16' shape-rendering='crispEdges'%3E%3Cpath d='M8 16V12H4V8H12V4H24V0H36V4H40V8H44V12H48V16Z' fill='%23fdf3dc'/%3E%3Cpath d='M8 16V12H48V16Z' fill='%23f2d9b0'/%3E%3C/svg%3E") 78% 8% / 17vw auto no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 16' shape-rendering='crispEdges'%3E%3Cpath d='M8 16V12H4V8H12V4H24V0H36V4H40V8H44V12H48V16Z' fill='%23fdf3dc'/%3E%3Cpath d='M8 16V12H48V16Z' fill='%23f2d9b0'/%3E%3C/svg%3E") 58% 30% / 9vw auto no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 120' preserveAspectRatio='none' shape-rendering='crispEdges'%3E%3Cpath d='M0 120 L0 60 L8 60 L8 60 L16 60 L16 60 L24 60 L24 64 L32 64 L32 64 L40 64 L40 68 L48 68 L48 68 L56 68 L56 68 L64 68 L64 64 L72 64 L72 64 L80 64 L80 60 L88 60 L88 60 L96 60 L96 60 L104 60 L104 60 L112 60 L112 64 L120 64 L120 68 L128 68 L128 72 L136 72 L136 76 L144 76 L144 80 L152 80 L152 84 L160 84 L160 84 L168 84 L168 84 L176 84 L176 84 L184 84 L184 80 L192 80 L192 76 L200 76 L200 72 L208 72 L208 72 L216 72 L216 68 L224 68 L224 68 L232 68 L232 68 L240 68 L240 72 L248 72 L248 72 L256 72 L256 72 L264 72 L264 72 L272 72 L272 68 L280 68 L280 68 L288 68 L288 64 L296 64 L296 60 L304 60 L304 56 L312 56 L312 56 L320 56 L320 56 L328 56 L328 56 L336 56 L336 60 L344 60 L344 64 L352 64 L352 68 L360 68 L360 72 L368 72 L368 76 L376 76 L376 80 L384 80 L384 80 L392 80 L392 80 L400 80 L400 76 L408 76 L400 120 Z' fill='%238fbf6a'/%3E%3Cpath d='M0 120 L0 96 L8 96 L8 100 L16 100 L16 100 L24 100 L24 100 L32 100 L32 100 L40 100 L40 96 L48 96 L48 96 L56 96 L56 92 L64 92 L64 96 L72 96 L72 96 L80 96 L80 96 L88 96 L88 96 L96 96 L96 92 L104 92 L104 88 L112 88 L112 84 L120 84 L120 80 L128 80 L128 80 L136 80 L136 80 L144 80 L144 84 L152 84 L152 88 L160 88 L160 92 L168 92 L168 96 L176 96 L176 96 L184 96 L184 96 L192 96 L192 92 L200 92 L200 92 L208 92 L208 96 L216 96 L216 96 L224 96 L224 100 L232 100 L232 100 L240 100 L240 100 L248 100 L248 100 L256 100 L256 96 L264 96 L264 88 L272 88 L272 84 L280 84 L280 84 L288 84 L288 84 L296 84 L296 84 L304 84 L304 88 L312 88 L312 88 L320 88 L320 92 L328 92 L328 88 L336 88 L336 88 L344 88 L344 88 L352 88 L352 88 L360 88 L360 92 L368 92 L368 96 L376 96 L376 100 L384 100 L384 104 L392 104 L392 104 L400 104 L400 104 L408 104 L400 120 Z' fill='%235f9e4a'/%3E%3Crect y='112' width='400' height='8' fill='%234a8240'/%3E%3C/svg%3E") bottom / 100% 30vh no-repeat,
    linear-gradient(#7fc6c0 0 14%, #a6d7c4 14% 28%, #d8e6b8 28% 42%, #f6e2a6 42% 56%, #f6cb8c 56% 100%);
  animation: drift 120s steps(240, end) infinite alternate;
}
.sunburst.slow { animation-duration: 180s; }
.sunburst.gold {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 16' shape-rendering='crispEdges'%3E%3Cpath d='M8 16V12H4V8H12V4H24V0H36V4H40V8H44V12H48V16Z' fill='%23fdf3dc'/%3E%3Cpath d='M8 16V12H48V16Z' fill='%23f2d9b0'/%3E%3C/svg%3E") 15% 12% / 14vw auto no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 16' shape-rendering='crispEdges'%3E%3Cpath d='M8 16V12H4V8H12V4H24V0H36V4H40V8H44V12H48V16Z' fill='%23fdf3dc'/%3E%3Cpath d='M8 16V12H48V16Z' fill='%23f2d9b0'/%3E%3C/svg%3E") 80% 10% / 16vw auto no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 120' preserveAspectRatio='none' shape-rendering='crispEdges'%3E%3Cpath d='M0 120 L0 60 L8 60 L8 60 L16 60 L16 60 L24 60 L24 64 L32 64 L32 64 L40 64 L40 68 L48 68 L48 68 L56 68 L56 68 L64 68 L64 64 L72 64 L72 64 L80 64 L80 60 L88 60 L88 60 L96 60 L96 60 L104 60 L104 60 L112 60 L112 64 L120 64 L120 68 L128 68 L128 72 L136 72 L136 76 L144 76 L144 80 L152 80 L152 84 L160 84 L160 84 L168 84 L168 84 L176 84 L176 84 L184 84 L184 80 L192 80 L192 76 L200 76 L200 72 L208 72 L208 72 L216 72 L216 68 L224 68 L224 68 L232 68 L232 68 L240 68 L240 72 L248 72 L248 72 L256 72 L256 72 L264 72 L264 72 L272 72 L272 68 L280 68 L280 68 L288 68 L288 64 L296 64 L296 60 L304 60 L304 56 L312 56 L312 56 L320 56 L320 56 L328 56 L328 56 L336 56 L336 60 L344 60 L344 64 L352 64 L352 68 L360 68 L360 72 L368 72 L368 76 L376 76 L376 80 L384 80 L384 80 L392 80 L392 80 L400 80 L400 76 L408 76 L400 120 Z' fill='%238fbf6a'/%3E%3Cpath d='M0 120 L0 96 L8 96 L8 100 L16 100 L16 100 L24 100 L24 100 L32 100 L32 100 L40 100 L40 96 L48 96 L48 96 L56 96 L56 92 L64 92 L64 96 L72 96 L72 96 L80 96 L80 96 L88 96 L88 96 L96 96 L96 92 L104 92 L104 88 L112 88 L112 84 L120 84 L120 80 L128 80 L128 80 L136 80 L136 80 L144 80 L144 84 L152 84 L152 88 L160 88 L160 92 L168 92 L168 96 L176 96 L176 96 L184 96 L184 96 L192 96 L192 92 L200 92 L200 92 L208 92 L208 96 L216 96 L216 96 L224 96 L224 100 L232 100 L232 100 L240 100 L240 100 L248 100 L248 100 L256 100 L256 96 L264 96 L264 88 L272 88 L272 84 L280 84 L280 84 L288 84 L288 84 L296 84 L296 84 L304 84 L304 88 L312 88 L312 88 L320 88 L320 92 L328 92 L328 88 L336 88 L336 88 L344 88 L344 88 L352 88 L352 88 L360 88 L360 92 L368 92 L368 96 L376 96 L376 100 L384 100 L384 104 L392 104 L392 104 L400 104 L400 104 L408 104 L400 120 Z' fill='%235f9e4a'/%3E%3Crect y='112' width='400' height='8' fill='%234a8240'/%3E%3C/svg%3E") bottom / 100% 30vh no-repeat,
    linear-gradient(#f2b06a 0 16%, #f4c27a 16% 32%, #f6d38e 32% 50%, #f8e2a6 50% 100%);
}
@keyframes drift { from { background-position: 12% 14%, 78% 8%, 58% 30%, bottom, 0 0; } to { background-position: 20% 14%, 70% 8%, 64% 30%, bottom, 0 0; } }
.halftone {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(59, 36, 24, 0.035) 50%, transparent 50%);
  background-size: 100% 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.panel {
  background: var(--card); border: 4px solid var(--wood); border-radius: var(--radius);
  box-shadow: var(--frame), var(--shadow);
}
.caption { background: var(--caption); }

.comic-heading {
  font-family: var(--display); font-weight: 700; letter-spacing: 0.02em; margin: 0;
  font-size: clamp(1.8rem, 4.2vw, 3.4rem); line-height: 1.1; color: var(--card);
  text-shadow: var(--pixel-outline);
}
.comic-heading.small { font-size: 1.9rem; text-align: center; color: var(--yellow); }
.comic-heading.big { font-size: clamp(2.2rem, 5.5vw, 4.4rem); color: var(--yellow); }
.tilt-l, .tilt-r { transform: none; }

/* ---------- speech bubbles ---------- */
vv-speech { display: flex; align-items: flex-end; gap: 4px; z-index: 20; }
vv-speech .bubble {
  position: relative; max-width: min(46rem, 64vw);
  background: var(--card); border: 4px solid var(--wood); border-radius: 8px; padding: 0.7em 1.2em 1.1em;
  font-family: var(--round); font-weight: 500; font-size: 1.12em; line-height: 1.5;
  box-shadow: var(--frame), var(--shadow); margin-bottom: 120px;
}
vv-speech .bubble::before {
  /* the tail, pointing at Hana */
  content: ""; position: absolute; left: -22px; bottom: 28px; width: 22px; height: 20px;
  background: var(--wood);
  clip-path: polygon(100% 0, 100% 100%, 0 100%, 0 80%, 30% 80%, 30% 60%, 60% 60%, 60% 30%, 80% 30%, 80% 0);
}
vv-speech .bubble.pop { animation: bubble-pop 0.24s steps(3, end); }
@keyframes bubble-pop { from { transform: translateY(6px); opacity: 0; } }
vv-speech .bubble-more {
  position: absolute; right: 16px; bottom: 4px; font-size: 0.75em; color: var(--red); opacity: 0;
}
vv-speech .bubble.typed .bubble-more { opacity: 1; animation: nudge 0.8s steps(2, end) infinite alternate; }
vv-speech .bubble.typed.last .bubble-more { color: var(--blue); }
@keyframes nudge { to { transform: translateY(4px); } }
vv-speech.no-hana vv-guide { display: none; }
vv-speech.no-hana .bubble { margin-bottom: 0; }
vv-speech.no-hana .bubble::before { display: none; }

.bottom-speech { position: absolute; left: 2vw; bottom: 0; right: 2vw; }
.bottom-speech.no-hana { bottom: 14vh; left: 50%; right: auto; transform: translateX(-50%); }
.corner-speech { position: absolute; right: 3vw; bottom: 0; flex-direction: row-reverse; }
.corner-speech .bubble { max-width: min(26rem, 40vw); font-size: 1em; }
.corner-speech .bubble::before { left: auto; right: -22px; transform: scaleX(-1); }

/* ---------- pad hints ---------- */
vv-pad-hint {
  position: absolute; right: 1.2vw; bottom: 1vh; z-index: 30; display: flex; gap: 0.9em; flex-wrap: wrap; justify-content: flex-end;
  font-family: var(--round); font-weight: 500; font-size: 0.85em; color: var(--card);
  background: var(--wood); border: 3px solid var(--ink); border-radius: 6px; padding: 0.25em 0.9em;
  box-shadow: inset 0 0 0 2px #7a5038, var(--shadow);
}
vv-pad-hint .hint { display: inline-flex; align-items: center; gap: 0.35em; cursor: pointer; user-select: none; }
vv-pad-hint .glyph { width: 1.6em; height: 1.6em; color: var(--ink); }
vv-pad-hint .glyph.wide { width: 3.2em; }
.corner-speech ~ vv-pad-hint, .visit ~ vv-pad-hint { left: 1.2vw; right: auto; justify-content: flex-start; }

/* ---------- menus ---------- */
vv-menu { display: grid; gap: 0.4em; }
.menu-item {
  display: flex; align-items: center; gap: 0.6em; padding: 0.5em 0.9em; border: 3px solid transparent; border-radius: 4px;
  cursor: pointer;
}
.menu-item .menu-pointer { color: var(--red); visibility: hidden; font-size: 0.8em; }
.menu-item.selected { border-color: var(--ink); background: var(--yellow); box-shadow: inset 0 -4px 0 #d99a3a, 0 3px 0 var(--ink-soft); }
.menu-item.selected .menu-pointer { visibility: visible; animation: nudge-x 0.6s steps(2, end) infinite alternate; }
.menu-item.disabled { opacity: 0.45; cursor: default; }
@keyframes nudge-x { to { transform: translateX(4px); } }
.menu-body { display: grid; min-width: 0; }
.menu-label { font-family: var(--round); font-weight: 600; font-size: 1.2em; line-height: 1.25; }
.menu-sub { color: var(--muted); font-size: 0.85em; }

/* ---------- splash ---------- */
.splash { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 1.5vh; text-align: center; }
.splash-art { width: min(36vh, 60vw); aspect-ratio: 1; filter: drop-shadow(0 6px 0 var(--ink-soft)); }
.splash-art svg { width: 100%; height: 100%; overflow: visible; }
.globe-land { animation: globe-turn 48s linear infinite; }
@keyframes globe-turn { to { transform: translateX(-360px); } }
.orbit { transform-origin: 160px 160px; animation: spin 16s linear infinite; }
.comic-title { margin: -4vh 0 0; display: grid; justify-items: center; line-height: 0.92; }
.comic-title span {
  display: block; font-family: var(--display); font-weight: 700; letter-spacing: 0.02em; color: var(--card);
  text-shadow: 3px 0 0 var(--ink), -3px 0 0 var(--ink), 0 3px 0 var(--ink), 0 -3px 0 var(--ink),
    3px 3px 0 var(--ink), -3px 3px 0 var(--ink), 3px -3px 0 var(--ink), -3px -3px 0 var(--ink), 0 7px 0 var(--ink-soft);
  animation: title-in 0.6s steps(6, end) both;
}
.comic-title .w1 { font-size: clamp(2.2rem, 6.5vw, 5.6rem); transform: rotate(-1.5deg); }
.comic-title .w2 { font-size: clamp(2.8rem, 8.5vw, 7.4rem); color: var(--yellow); transform: rotate(0.8deg); animation-delay: 0.15s; }
.comic-title .w3 { font-size: clamp(2.2rem, 6.5vw, 5.6rem); color: var(--sky); transform: rotate(-0.8deg); animation-delay: 0.3s; }
@keyframes title-in { from { opacity: 0; transform: translateY(10px); } }
.press-start {
  margin-top: 2vh; font-family: var(--display); font-weight: 600; font-size: clamp(1.2rem, 2.4vw, 2rem); letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--red); color: #fff; border: var(--ol); border-radius: 6px; padding: 0.15em 1.1em; box-shadow: var(--shadow); cursor: pointer;
  animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe { 50% { transform: translateY(-3px); box-shadow: 0 7px 0 var(--ink-soft); } }
.splash-note { margin: 0; font-family: var(--round); font-weight: 700; color: var(--ink); opacity: 0.75; }

/* ---------- main menu, load ---------- */
.menu-screen { position: absolute; inset: 0; display: grid; align-content: start; justify-items: start; gap: 4vh; padding: 7vh 8vw; }
.menu-panel { padding: 1.2em; min-width: min(32rem, 84vw); }
.load-panel { max-height: 62vh; overflow-y: auto; min-width: min(48rem, 84vw); }
.credits-panel { padding: 0.6em 1.4em 1.2em; width: min(60rem, 84vw); max-height: 66vh; overflow-y: auto; scroll-behavior: smooth; }
.credits-panel h3 { margin: 0.9em 0 0.1em; font-family: var(--round); font-weight: 900; font-size: 1.2em; color: var(--red); }
.credits-panel ul { margin: 0.3em 0 0; padding: 0; list-style: none; }
.credits-panel li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.7em; padding: 0.15em 0; border-bottom: 2px dotted rgba(59, 36, 24, 0.18); }
.credits-panel li a, .credits-panel li > span:first-child { font-weight: 700; color: var(--ink); }
.credits-panel li a { text-decoration: underline; text-decoration-color: var(--blue); text-underline-offset: 0.15em; }
.credits-note { margin: 0; color: var(--muted); font-size: 0.85em; }
.credit-by { color: var(--muted); font-size: 0.9em; }
.credit-license { margin-left: auto; font-family: var(--round); font-weight: 700; font-size: 0.75em; color: var(--blue); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .credits-panel { scroll-behavior: auto; } }
.version { position: absolute; left: 1.2vw; bottom: 1.2vh; font-family: var(--round); font-weight: 700; opacity: 0.6; }
.menu-screen vv-pad-hint { left: auto; right: 1.2vw; }
.menu-screen .corner-speech ~ vv-pad-hint { left: auto; right: auto; left: 50%; transform: translateX(-50%); bottom: 1vh; }
.save-row { display: flex; gap: 1em; align-items: center; }
.save-city { width: 5.5em; flex: none; }
.save-city svg { width: 100%; display: block; }
.save-info { display: grid; gap: 0.1em; min-width: 0; flex: 1; }
.save-meta { font-size: 0.78em; color: var(--muted); }
.save-bar, .hud-bar { display: block; height: 8px; border: 2px solid var(--ink); border-radius: 4px; background: #fff; overflow: hidden; }
.save-bar i, .hud-bar i { display: block; height: 100%; background: var(--red); }
.toast {
  position: absolute; left: 50%; top: 4vh; transform: translateX(-50%) rotate(-0.4deg); z-index: 40;
  background: var(--red); color: #fff; font-family: var(--round); font-weight: 900; padding: 0.5em 1.2em; border: var(--ol); box-shadow: var(--shadow);
}

/* ---------- journey select ---------- */
.journey-screen { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 5vh; padding: 4vh 4vw; }
.journey-cards { display: flex; gap: 3vw; flex-wrap: wrap; justify-content: center; }
.journey-card {
  position: relative; width: min(22rem, 28vw); min-width: 14rem; padding: 1em 1.2em 1.3em; background: var(--card);
  border: var(--ol); border-radius: var(--radius); box-shadow: var(--shadow); cursor: pointer; transition: transform 0.15s;
  transform: rotate(-0.4deg);
}
.journey-card:nth-child(2) { transform: rotate(0.6deg); }
.journey-card.selected { transform: scale(1.08) rotate(-0.8deg); background: var(--yellow); box-shadow: var(--shadow); z-index: 2; }
.journey-card.locked { filter: grayscale(1); opacity: 0.75; }
.journey-art { border: 2px solid var(--ink); border-radius: 4px; background: linear-gradient(#bfe6fb, #fff 85%); }
.journey-art svg { display: block; width: 100%; }
.journey-name { font-family: var(--display); font-weight: 600; font-size: 2.4em; letter-spacing: 0.04em; margin-top: 0.3em; line-height: 1; }
.journey-tag { font-weight: 700; color: var(--muted); }
.journey-guide { font-family: var(--round); font-weight: 900; color: var(--blue); }
.stamp {
  position: absolute; right: 0.6em; top: 40%; transform: rotate(-1.5deg); font-family: var(--display); font-weight: 600; font-size: 1.6em; letter-spacing: 0.06em;
  color: var(--red); border: 2.5px solid var(--red); border-radius: var(--radius); padding: 0 0.4em; background: rgba(255, 255, 255, 0.85);
}

/* ---------- pause ---------- */
.pause-panel { padding: 1.4em 1.8em; min-width: min(26rem, 80vw); display: grid; gap: 1em; transform: rotate(-0.4deg); }
.pause-note { margin: 0; text-align: center; color: var(--muted); font-size: 0.85em; }

/* ---------- journey HUD ---------- */
.hud {
  position: absolute; left: 50%; top: 1.2vh; transform: translateX(-50%); z-index: 25; display: flex; align-items: center; gap: 0.7em;
  background: #fff; border: 2px solid var(--ink); border-radius: 6px; padding: 0.15em 0.9em; font-family: var(--round); font-weight: 900; font-size: 0.85em;
  box-shadow: var(--shadow);
}
.hud-day { background: var(--ink); color: #fff; border-radius: 4px; padding: 0 0.5em; }
.hud-bar { width: 8em; }
.hud-count { color: var(--muted); }

/* ---------- line names, station codes ---------- */
.line-name { font-family: var(--round); font-weight: 900; display: flex; align-items: center; gap: 0.5em; font-size: 1.1em; }
.chip { width: 0.9em; height: 0.9em; border-radius: 3px; display: inline-block; border: 2px solid var(--ink); }
.stations { display: flex; align-items: center; gap: 0.5em; flex-wrap: wrap; font-weight: 700; }
.st { display: inline-flex; align-items: center; gap: 0.35em; }
.code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800; font-size: 0.75em; line-height: 1;
  display: inline-grid; place-items: center; min-width: 2.6em; height: 2.3em; padding: 0 0.3em;
  border: 4px solid var(--line); border-radius: 8px; background: #fff; outline: 2px solid var(--ink);
}
.arrow { color: var(--muted); }
.mins { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85em; color: var(--muted); }
.icon { width: 1.2em; height: 1.2em; }

/* ---------- day intro ---------- */
.day-intro { position: absolute; inset: 7vh 4vw auto; display: grid; justify-items: center; gap: 2vh; }
.burst { position: relative; width: min(15vh, 30vw); aspect-ratio: 1; display: grid; place-items: center; animation: burst-in 0.6s var(--ease); }
.burst svg { position: absolute; inset: 0; width: 100%; height: 100%; animation: spin 120s linear infinite; }
.burst span { position: relative; white-space: nowrap; font-family: var(--display); font-weight: 600; font-size: clamp(1.4rem, 4.2vh, 3rem); letter-spacing: 0.05em; color: var(--red); transform: rotate(-1.5deg); }
@keyframes burst-in { from { transform: translateY(8px) scale(0.94); opacity: 0; } }
.day-title { text-align: center; font-size: clamp(1.6rem, 3.6vw, 3rem); }
.day-plan { padding: 0.9em 1.3em; max-width: min(56rem, 92vw); }
.plan-lines { display: flex; flex-wrap: wrap; gap: 0.4em; margin-bottom: 0.6em; }
.line-pill { font-family: var(--round); font-weight: 900; font-size: 0.8em; padding: 0.1em 0.7em; border-radius: 6px; border: 2px solid var(--ink); background: var(--line); color: #fff; text-shadow: 0 3px 0 var(--ink-soft); }
.plan-stops {
  margin: 0; padding: 0; list-style: none; display: grid; gap: 0.9em;
  grid-template-columns: repeat(var(--n, 6), minmax(0, 9rem)); justify-content: center;
}
.plan-stop { display: grid; align-content: start; gap: 0.35em; animation: card-in 0.5s var(--ease) both; }
.plan-stop:nth-child(2) { animation-delay: 60ms; } .plan-stop:nth-child(3) { animation-delay: 120ms; }
.plan-stop:nth-child(4) { animation-delay: 180ms; } .plan-stop:nth-child(5) { animation-delay: 240ms; }
.plan-stop:nth-child(6) { animation-delay: 300ms; }
@keyframes card-in { from { opacity: 0; transform: translateY(6px); } }
.plan-photo {
  position: relative; display: block; aspect-ratio: 4 / 3; border: 2px solid var(--ink); border-radius: 6px; overflow: hidden;
  background: repeating-linear-gradient(45deg, #ead7b0 0 8px, #f3e5c6 8px 16px); box-shadow: 0 3px 0 var(--ink-soft);
}
.plan-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.plan-num {
  position: absolute; left: 0.25em; top: 0.25em; min-width: 1.6em; height: 1.6em; display: grid; place-items: center; padding: 0 0.3em;
  border: 2px solid var(--ink); border-radius: 999px; background: #fff7e3; font-size: 0.8em; line-height: 1;
}
.plan-stop.dinner .plan-num { background: var(--red); }
.plan-name { font-weight: 700; font-size: 0.85em; line-height: 1.25; overflow-wrap: anywhere; }
.plan-name .jp { display: block; font-size: 0.85em; }
@media (max-height: 820px) and (min-width: 761px) {
  /* Short screens: the day badge goes beside the title, to leave room for the photos. */
  .day-intro { grid-template-columns: auto auto; justify-content: center; align-items: center; column-gap: 1.5vw; inset-block-start: 6.5vh; }
  .burst { width: 13vh; }
  .burst span { font-size: 3.4vh; }
  .day-plan { grid-column: 1 / -1; }
}
.photo-credits { display: block; margin-top: 0.6em; text-align: right; font-size: 0.7em; color: var(--muted); }

/* ---------- ride ---------- */
vv-ride-screen { background: var(--ink); }
.video-wrap { position: absolute; inset: 0; overflow: hidden; }
.video-host, .video-host iframe { position: absolute; left: 50%; top: 50%; width: max(100vw, 177.78vh); height: max(100vh, 56.25vw); transform: translate(-50%, -50%); border: 0; }
.video-shield { position: absolute; inset: 0; } /* clicks stay on the game, so its keys keep working */
.boarding {
  position: absolute; inset: 0; display: grid; place-items: center; background: var(--sky); z-index: 1; transition: opacity 0.6s;
}
.boarding span {
  position: relative; font-family: var(--display); font-weight: 600; font-size: clamp(3rem, 9vw, 7rem); color: var(--yellow);  text-shadow: 0 3px 0 var(--ink-soft); transform: rotate(-1.5deg);
}
.speedlines {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent 0 22px, rgba(255, 255, 255, 0.55) 22px 25px, transparent 25px 61px, rgba(59, 36, 24, 0.12) 61px 63px);
  background-size: 400px 100%; animation: rush 1.4s linear infinite;
}
@keyframes rush { to { background-position: -400px 0; } }
vv-ride-screen.playing .boarding { opacity: 0; pointer-events: none; }
vv-ride-screen.no-video .boarding span::after { content: " (no video)"; font-size: 0.35em; }
.arrived {
  position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: rgba(59, 36, 24, 0.25);
}
.arrived span {
  font-family: var(--display); font-weight: 600; font-size: clamp(3rem, 9vw, 7rem); color: #fff; 
  text-shadow: 0 3px 0 var(--ink-soft); transform: rotate(-1.5deg); animation: burst-in 0.5s var(--ease);
}
.ride-caption { position: absolute; left: 2vw; top: calc(2vh + 2.6em); z-index: 10; padding: 0.6em 1em; display: grid; gap: 0.4em; transform: rotate(-0.4deg); max-width: 46vw; }
.ride-count { font-family: var(--display); font-weight: 600; letter-spacing: 0.08em; color: var(--red); }
vv-route-map { position: absolute; right: 2vw; top: calc(2vh + 2.6em); z-index: 10; width: min(30vw, 420px); padding: 4px; transition: transform 0.3s; transform: rotate(0.4deg); }
vv-route-map svg { display: block; width: 100%; height: auto; background: #fff; }
vv-route-map text { font-family: var(--body); fill: var(--ink); paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
vv-route-map text.ctx { fill: var(--muted); }
vv-route-map.folded { transform: translateX(calc(100% + 3vw)); }
.sound-badge {
  position: absolute; left: 50%; bottom: 7vh; transform: translateX(-50%); z-index: 12; cursor: pointer;
  background: #fff; border: 2px solid var(--ink); border-radius: 6px; padding: 0.2em 1em; font-weight: 700; box-shadow: var(--shadow);
}
.seek-badge {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); z-index: 12; pointer-events: none;
  background: rgba(59, 36, 24, 0.82); color: #fff; border-radius: 999px; padding: 0.3em 1.1em; font-weight: 800; font-size: 1.4em;
}
.seek-badge.show { animation: seek-fade 1.2s ease-out forwards; }
@keyframes seek-fade { 0%, 60% { opacity: 1; } 100% { opacity: 0; } }
.over-video .bubble { max-width: min(40rem, 56vw); }

/* ---------- walk ---------- */
.walk-scene { position: absolute; inset: 0; overflow: hidden; background: var(--sky); }
.walk-scene .sky { position: absolute; inset: 0; background: radial-gradient(circle at 80% 18%, #fff1c4 0 5vh, transparent 5.2vh), linear-gradient(#9fd3c7, #f6e2a6 70%); }
.skyline { position: absolute; left: 0; width: 200%; bottom: 22vh; background-repeat: repeat-x; animation: scroll-x linear infinite; }
.skyline.far {
  height: 38vh; opacity: 0.6; animation-duration: 120s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 200' preserveAspectRatio='none'%3E%3Cpath d='M0 200V120h30V80h25v40h20V60h30v60h15V100h40V40h20v80h25V90h35v110h20V70h30v130h25V110h30v90z' fill='%238fb8a8' stroke='%233b2418' stroke-width='3'/%3E%3C/svg%3E");
  background-size: 50% 100%;
}
.skyline.near {
  height: 30vh; animation-duration: 48s;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 160' preserveAspectRatio='none'%3E%3Cg stroke='%233b2418' stroke-width='3'%3E%3Cpath d='M10 160V60h70v100z' fill='%23e48a52'/%3E%3Cpath d='M100 160V30h60v130z' fill='%23f2c45a'/%3E%3Cpath d='M180 160V80h90v80z' fill='%23f6e6c4'/%3E%3Cpath d='M290 160V50h80v110z' fill='%23d2603f'/%3E%3C/g%3E%3Cg fill='%236b4a35'%3E%3Crect x='25' y='75' width='14' height='14'/%3E%3Crect x='50' y='75' width='14' height='14'/%3E%3Crect x='115' y='45' width='12' height='12'/%3E%3Crect x='135' y='45' width='12' height='12'/%3E%3Crect x='115' y='75' width='12' height='12'/%3E%3Crect x='305' y='70' width='50' height='10'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 50% 100%;
}
@keyframes scroll-x { to { transform: translateX(-50%); } }
.walk-scene .street {
  position: absolute; left: 0; right: 0; bottom: 0; height: 22vh; background: #b9875a; border-top: var(--ol);
  background-image: repeating-linear-gradient(90deg, rgba(251, 240, 217, 0.8) 0 50px, transparent 50px 140px);
  background-size: 140px 10px; background-repeat: repeat-x; background-position: 0 50%; animation: road 3.6s linear infinite;
}
@keyframes road { to { background-position: -140px 50%; } }
.walk-scene vv-guide { position: absolute; left: 12vw; bottom: 14vh; transform: scale(1.3); transform-origin: 50% 100%; }
.walk-caption { position: absolute; left: 2vw; top: calc(2vh + 2.6em); padding: 0.6em 1em; transform: rotate(-0.4deg); }

/* ---------- visit ---------- */
.visit { position: absolute; inset: calc(2vh + 3.2em) 4vw 12vh; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 3vw; align-items: start; }
.stop-card { padding: 1.2em 1.4em; display: grid; gap: 0.6em; transform: rotate(-0.32deg); }
.stop-card h2 { margin: 0; font-family: var(--round); font-weight: 900; font-size: 1.8em; line-height: 1.15; }
.stop-card h2 small { display: block; font-size: 0.6em; }
.stop-card p { margin: 0; }
.stop-card.dinner { border-color: var(--red); }
.eyebrow { font-family: var(--display); font-weight: 600; letter-spacing: 0.1em; color: var(--red); font-size: 1.2em; }
.kind { color: var(--muted); font-weight: 700; }
.walk { display: flex; align-items: center; gap: 0.5em; color: var(--muted); flex-wrap: wrap; }
.walk b { color: var(--ink); }
.tip { background: var(--caption); border: 2px dashed var(--ink-soft); border-radius: var(--radius); padding: 0.5em 0.8em; font-size: 0.92em; }
.visit-actions { padding: 1em; display: grid; gap: 1em; transform: rotate(0.4deg); }
.ext-status { font-size: 0.85em; border-radius: var(--radius); padding: 0.6em 0.8em; border: 2px solid var(--ink); }
.ext-status.ok { background: #dcebc0; }
.ext-status.missing { background: #f6d0b8; }
vv-visit-screen .corner-speech .bubble { margin-bottom: 110px; }
vv-visit-screen.leaving { animation: leave 0.6s ease-in forwards; }
@keyframes leave { to { transform: scale(1.04); opacity: 0; filter: blur(3px); } }

/* ---------- wrap-up ---------- */
.wrap-up { position: absolute; inset: 7vh 4vw 4vh; display: grid; justify-items: center; align-content: start; gap: 2.5vh; overflow-y: auto; padding-bottom: 30vh; }
.stamp-book { padding: 1em 1.4em; width: min(70rem, 92vw); background: #f8ead0; }
.stamp-book h3 { margin: 0.4em 0 0.2em; font-family: var(--round); font-weight: 900; }
.stamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5em, 1fr)); gap: 0.8em; }
.stamp-cell { display: grid; justify-items: center; text-align: center; transform: rotate(var(--rot)); animation: stamp-in 0.4s var(--ease) both; }
.stamp-cell svg { width: 4.6em; height: 4.6em; }
.stamp-jp { font-weight: 900; color: var(--ink); font-size: 0.8em; color: var(--ink); }
.stamp-name { font-size: 0.72em; color: var(--muted); line-height: 1.2; }
@keyframes stamp-in { from { transform: scale(1.25) rotate(var(--rot)); opacity: 0; } }
.tally { display: flex; gap: 1.5em; align-items: center; flex-wrap: wrap; margin-top: 0.8em; font-family: var(--round); font-weight: 700; border-top: 3px dashed var(--ink); padding-top: 0.6em; }
.tally b { font-family: var(--display); font-weight: 600; font-size: 1.6em; color: var(--red); }
.pills { display: flex; gap: 0.3em; }
.dot { width: 1em; height: 1em; border-radius: 3px; border: 2px solid var(--ink); display: inline-block; }
.wrap-menu { position: fixed; right: 4vw; bottom: 9vh; z-index: 35; padding: 1em; min-width: min(24rem, 80vw); animation: burst-in 0.4s var(--ease); }
.wrap-up.journey .stamps { grid-template-columns: repeat(auto-fill, minmax(6.5em, 1fr)); gap: 0.4em; }
.wrap-up.journey .stamp-cell svg { width: 3.2em; height: 3.2em; }
.wrap-up.journey .stamp-name { display: none; }
.the-end {
  font-family: var(--display); font-weight: 600; font-size: clamp(2rem, 5vw, 4rem); color: #fff; 
  text-shadow: 0 3px 0 var(--ink-soft); transform: rotate(-1.5deg);
}

/* ---------- small screens ---------- */
@media (max-width: 760px), (max-height: 520px) {
  vv-guide { transform: scale(0.7); transform-origin: 0 100%; margin-right: -44px; margin-top: -63px; }
  vv-speech .bubble { margin-bottom: 70px; max-width: 72vw; font-size: 1em; }
  .visit { grid-template-columns: 1fr; overflow-y: auto; bottom: 2vh; }
  .plan-stops { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6em; }
  vv-route-map { display: none; }
  .ride-caption { max-width: 92vw; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

@media (max-height: 680px) {
  vv-visit-screen .corner-speech { display: none; }
  .splash-note { display: none; }
}

/* ---------- controls ---------- */
.controls-screen { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr; gap: 3vh; padding: 5vh 5vw 9vh; }
.controls-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 3vw; min-height: 0; align-items: start; }
.pad-panel { padding: 1em; display: grid; gap: 0.8em; transform: rotate(-0.32deg); }
.snes-pad { width: 100%; height: auto; display: block; }
.pad-body { fill: #e8d2a8; stroke: var(--ink); stroke-width: 5; }
.pad-well { fill: #d9b98a; stroke: var(--ink); stroke-width: 2; opacity: 0.7; }
.pad-well.face { fill: #cfa97a; }
.pad-shoulder { fill: #b9875a; stroke: var(--ink); stroke-width: 4; stroke-linejoin: round; }
.pad-dpad { fill: #5b3a29; }
.pad-dir { fill: #5b3a29; stroke: none; }
.pad-small { fill: #8a6a4f; stroke: var(--ink); stroke-width: 3; }
.pad-face { fill: var(--c); stroke: var(--ink); stroke-width: 4; }
.pad-face-label { font: 900 16px var(--round); fill: #fff; text-anchor: middle; pointer-events: none; }
.pad-label { font: 800 9px var(--round); fill: var(--ink); text-anchor: middle; letter-spacing: 0.06em; }
.pad-label.big { font-size: 16px; }
.snes-pad .on { fill: var(--yellow) !important; stroke: var(--red); stroke-width: 5; }
.snes-pad .capturing { animation: pad-pulse 0.5s ease-in-out infinite alternate; }
@keyframes pad-pulse { to { fill: var(--red); } }
.controls-status { font-size: 0.85em; line-height: 1.5; }
.controls-status .warn { color: var(--red); font-weight: 700; }
.preset-image { display: block; width: 100%; height: auto; border: 3px solid var(--ink); border-radius: 8px; }
.pad-name { font-family: var(--round); font-weight: 900; text-align: center; }
.settings-head { font-family: var(--round); font-weight: 900; font-size: 0.8em; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.menu-item.heading .menu-pointer { visibility: hidden; }
.menu-item.heading { opacity: 1; cursor: default; }
.set-row { display: grid; grid-template-columns: 1fr auto; gap: 0.6em; align-items: center; }
.set-label { font-weight: 700; font-size: 0.9em; }
.set-value { display: inline-flex; align-items: center; gap: 0.3em; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85em; font-weight: 700; }
.set-value b { min-width: 3.4em; text-align: center; }
.set-arrow { font: inherit; background: #fff; border: 2px solid var(--ink); border-radius: 4px; padding: 0 0.35em; cursor: pointer; color: var(--ink); }
.ctl-row.action-row { grid-template-columns: 1fr auto; }
.controls-panel { max-height: 72vh; overflow-y: auto; min-width: 0; }
.controls-panel vv-menu { gap: 0.15em; }
.controls-panel .menu-body { flex: 1; min-width: 0; display: block; }
.controls-panel .menu-item { padding: 0.25em 0.7em; }
.controls-panel .menu-label { font-size: 1.05em; }
.ctl-row { display: grid; grid-template-columns: 5.2em 1fr auto; gap: 0.6em; align-items: baseline; }
.ctl-name { font-family: var(--round); font-weight: 900; }
.ctl-does { color: var(--muted); font-size: 0.85em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctl-binding { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.8em; font-weight: 700; background: #fff; border: 2px solid var(--ink); border-radius: 4px; padding: 0 0.4em; }
.ctl-binding.none { color: var(--red); border-color: var(--red); }
.capture-prompt { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(59, 36, 24, 0.3); }
.capture-box { padding: 1.2em 2em; display: grid; gap: 0.5em; justify-items: center; min-width: min(26rem, 80vw); transform: rotate(-0.4deg); animation: burst-in 0.3s var(--ease); }
.capture-title { font-family: var(--display); font-weight: 600; font-size: 2.4em; letter-spacing: 0.05em; }
.capture-title b { color: var(--red); font-weight: 400; }
.capture-sub { font-weight: 700; color: var(--muted); }
.capture-bar { width: 100%; height: 10px; border: 2px solid var(--ink); border-radius: 5px; overflow: hidden; background: #fff; }
.capture-bar i { display: block; height: 100%; background: var(--yellow); }
.capture-keys { font-size: 0.8em; color: var(--muted); }
@media (max-width: 760px) { .controls-body { grid-template-columns: 1fr; overflow-y: auto; } }

/* Real line colours, softened to sit with the pastels. */
.line-pill { background: color-mix(in srgb, var(--line) 72%, #fbf0d9); }
.chip, .tally .dot, .plan-lines .dot { filter: saturate(0.75) brightness(1.08); }
.code { border-color: color-mix(in srgb, var(--line) 75%, #fbf0d9); outline-width: 1.5px; }
vv-route-map polyline { filter: saturate(0.8); }

/* Journey cards in the same wood frames as the panels. */
.journey-card { border: 4px solid var(--wood); box-shadow: var(--frame), var(--shadow); }
.journey-card.selected { box-shadow: inset 0 0 0 3px #e0a540, var(--shadow); }
.journey-art { border-color: var(--wood); background: linear-gradient(#9fd3c7, #fbf0d9 85%); }

/* Main menu: the globe instead of a guide (guides belong to their city). */
.menu-globe { position: absolute; right: 7vw; bottom: 12vh; width: min(34vh, 30vw); filter: drop-shadow(0 6px 0 var(--ink-soft)); }
.menu-globe svg { width: 100%; height: auto; overflow: visible; }
/* Journey cards: the guide, small, next to their name. */
.journey-guide { display: flex; align-items: center; gap: 0.4em; }
.journey-guide vv-guide { width: 42px; height: 58px; flex: none; }
.journey-guide vv-guide .guide-fig { transform: scale(0.28); transform-origin: 0 0; inset: auto; width: 150px; height: 210px; animation: none; }
/* Eleven journey cards: a grid, six to a row on a wide screen, scrolling if it doesn't fit. */
.journey-screen { grid-template-rows: auto minmax(0, 1fr) auto; align-content: stretch; gap: 2.5vh; }
.journey-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(11.5rem, 40vw), 1fr)); gap: 1.4vw;
  width: min(100%, 100rem); max-height: 100%; overflow-y: auto; padding: 1.4vh 1.2vw 2vh; align-content: start;
  scrollbar-width: thin;
}
.journey-card { width: auto; min-width: 0; padding: 0.5em 0.6em 0.7em; font-size: clamp(0.7rem, 0.9vw, 1rem); }
.journey-card.selected { transform: scale(1.05) rotate(-0.8deg); }
.journey-name { font-size: 1.6em; overflow-wrap: anywhere; }
.journey-name .jp { display: block; font-size: 0.5em; letter-spacing: 0; margin-top: 0.2em; }

/* ---------- opening cutscene: the view from a train ---------- */
.intro-end > :not(.splash-art) { visibility: hidden; } /* they keep the globe where the title screen has it */
.intro-skip { position: absolute; right: 3vw; top: 1.5vh; bottom: auto; z-index: 5; }
.screen.after-intro { animation: none; } /* the title takes over from the cutscene without a fade */
.train-cabin {
  position: absolute; inset: 0; display: grid; place-items: center;
  animation: train-through 1.2s ease-in var(--scroll) forwards;
}
@keyframes train-through { to { transform: scale(9); } }
.train-window {
  position: relative; width: var(--w); height: var(--h); overflow: hidden; border-radius: 22px;
  outline: 10px solid var(--wood-light); outline-offset: -2px;
  box-shadow: 0 0 0 16px var(--ink), 0 0 0 200vmax var(--wood);
}
.train-world {
  position: absolute; inset: -3px;
  animation: train-rock 0.42s steps(2, end) infinite, train-world-out 0.8s linear calc(var(--scroll) + 0.25s) forwards;
}
@keyframes train-rock { 50% { transform: translateY(2px); } }
@keyframes train-world-out { to { opacity: 0; } }
.train-sky { position: absolute; inset: 0; background: linear-gradient(#7fc6c0 0 22%, #a6d7c4 22% 42%, #d8e6b8 42% 60%, #f6e2a6 60% 78%, #f6cb8c 78% 100%); }
.train-lift { position: absolute; inset: 0; animation: train-lift 1.1s ease-in calc(var(--scroll) - 0.85s) forwards; }
@keyframes train-lift { to { transform: translateY(calc(var(--h) * 1.1)); } }
.train-strip {
  position: absolute; left: 0; bottom: 0; height: 100%; display: flex; padding-left: var(--lead); z-index: 1; width: max-content;
  animation: train-scroll var(--scroll) linear both;
}
@keyframes train-scroll { to { transform: translateX(calc(var(--distance) * -1)); } }
.train-ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 22%;
  background: linear-gradient(var(--green) 0 27%, #d9c39a 27% 33%, #f4c55a 33% 38%, #d9c39a 38% 100%);
  border-top: var(--ol);
}
.train-city { position: relative; flex: none; width: var(--city); height: 100%; }
.train-landmark { position: absolute; right: 2%; bottom: 15.7%; width: 74%; } /* its drawn ground line meets the grass */
.train-landmark svg { display: block; width: 100%; height: auto; overflow: visible; }
.train-sign {
  position: absolute; left: 44%; bottom: 3%; z-index: 2; padding: 0.1em 0.55em; white-space: nowrap;
  font-family: var(--round); font-weight: 700; font-size: calc(var(--h) * 0.065); color: #fff;
  background: var(--blue); border: var(--ol); border-radius: var(--radius); box-shadow: var(--shadow);
}
.train-city vv-guide { position: absolute; left: 22%; margin: 0 0 0 -75px; bottom: 7%; z-index: 3; transform: scale(var(--guide)); transform-origin: 50% 100%; }
.train-poles {
  position: absolute; inset: 0; z-index: 2; opacity: 0.85;
  background: linear-gradient(90deg, var(--ink) 0 100%) 0 0 / calc(var(--w) * 0.018) 100% no-repeat;
  animation: train-pole 0.95s linear infinite;
}
@keyframes train-pole { from { background-position-x: calc(var(--w) * 1.1); } to { background-position-x: calc(var(--w) * -0.1); } }
.train-curtain {
  position: absolute; top: 0; bottom: 18%; width: 9%; z-index: 3; border-bottom: var(--ol);
  background: repeating-linear-gradient(90deg, var(--red) 0 12px, #b84e31 12px 22px);
}
.train-curtain.l { left: 0; border-right: var(--ol); border-bottom-right-radius: 70% 22%; }
.train-curtain.r { right: 0; border-left: var(--ol); border-bottom-left-radius: 70% 22%; }
.train-sill {
  position: absolute; left: 50%; top: calc(50% + var(--h) / 2 + 16px); width: calc(var(--w) + 72px); height: 20px; margin-left: calc((var(--w) + 72px) / -2);
  background: var(--wood-light); border: var(--ol); border-radius: 4px; box-shadow: var(--shadow);
}
.train-seat { position: absolute; bottom: -6vh; width: 16vw; height: 26vh; background: var(--blue); border: var(--ol); border-radius: 26px 26px 0 0; box-shadow: inset 0 14px 0 rgba(255, 255, 255, 0.16); }
.train-seat.l { left: -3vw; }
.train-seat.r { right: -3vw; }
