:root {
  --bg-1: #eef4f6;
  --bg-2: #dbe6ea;
  --bg-orb: radial-gradient(circle at top left, rgba(15, 143, 167, 0.08), transparent 28%);
  --surface: rgba(255, 255, 255, 0.84);
  --surface-alt: #f3f8fa;
  --surface-border: rgba(255, 255, 255, 0.82);
  --ink: #17232d;
  --muted: #5a6b78;
  --line: rgba(23, 35, 45, 0.08);
  --accent: #0f8fa7;
  --accent-dark: #0b6678;
  --warning: #ef9b3d;
  --grid-line: rgba(255, 255, 255, 0.42);
  --glow-1: rgba(15, 143, 167, 0.18);
  --glow-2: rgba(239, 155, 61, 0.12);
  --header-start: rgba(11, 24, 35, 0.94);
  --header-end: rgba(24, 52, 71, 0.9);
  --header-soft: rgba(244, 251, 255, 0.68);
  --header-accent: rgba(131, 226, 245, 0.84);
  --chip-bg: rgba(255, 255, 255, 0.09);
  --chip-border: rgba(255, 255, 255, 0.14);
  --primary-end: #0d728b;
  --secondary-bg: #edf7fa;
  --secondary-border: rgba(15, 143, 167, 0.18);
  --ghost-bg: rgba(255, 255, 255, 0.72);
  --ghost-border: rgba(23, 35, 45, 0.08);
  --header-ghost-bg: rgba(255, 255, 255, 0.08);
  --header-ghost-border: rgba(255, 255, 255, 0.15);
  --hero-card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(241, 247, 249, 0.95));
  --dark-panel-start: rgba(11, 23, 34, 0.96);
  --dark-panel-end: rgba(16, 52, 73, 0.92);
  --dark-panel-glow: rgba(40, 189, 214, 0.24);
  --dark-panel-soft-bg: rgba(255, 255, 255, 0.06);
  --dark-panel-soft-border: rgba(255, 255, 255, 0.08);
  --dark-panel-text-soft: rgba(244, 251, 255, 0.72);
  --dark-panel-text-muted: rgba(244, 251, 255, 0.68);
  --route-panel-bg: rgba(255, 255, 255, 0.05);
  --route-panel-border: rgba(255, 255, 255, 0.08);
  --route-line-start: rgba(99, 207, 224, 0.82);
  --route-line-end: rgba(255, 201, 120, 0.9);
  --route-stop-border: #63cfe0;
  --route-stop-ring: rgba(99, 207, 224, 0.14);
  --menu-icon-bg: linear-gradient(135deg, rgba(15, 143, 167, 0.12), rgba(255, 255, 255, 0.95));
  --stat-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 250, 0.96));
  --utility-card-bg: linear-gradient(180deg, #fbfdfe, #f0f5f7);
  --map-bg: linear-gradient(180deg, #f7fafb, #e9f0f3);
  --map-grid-line: rgba(255, 255, 255, 0.4);
  --map-badge-bg: rgba(16, 32, 45, 0.7);
  --map-badge-text: #f4fbff;
  --zone-bg: rgba(255, 255, 255, 0.9);
  --road-fill: linear-gradient(90deg, rgba(24, 49, 66, 0.18), rgba(15, 143, 167, 0.38));
  --road-shadow: 0 2px 10px rgba(14, 38, 53, 0.12);
  --node-border: #ffffff;
  --node-label-bg: rgba(255, 255, 255, 0.94);
  --hq-bg: linear-gradient(135deg, #10212e, #1b3648);
  --hq-text: #f4fbff;
  --customer-bg: linear-gradient(135deg, #ffcf7b, var(--warning));
  --customer-text: #533300;
  --cluster-bg: linear-gradient(135deg, #78cee0, var(--accent));
  --cluster-text: #ffffff;
  --legend-hq: #10212e;
  --legend-hq-ring: rgba(16, 33, 46, 0.14);
  --legend-customer-ring: rgba(239, 155, 61, 0.16);
  --legend-stop-ring: rgba(15, 143, 167, 0.16);
  --input-bg: #ffffff;
  --switch-off: #ccd7de;
  --switch-knob: #ffffff;
  --switch-shadow: 0 6px 12px rgba(16, 32, 45, 0.14);
  --theme-choice-bg: linear-gradient(180deg, #ffffff, #edf5f8);
  --theme-choice-border: rgba(23, 35, 45, 0.08);
  --theme-choice-active-border: rgba(15, 143, 167, 0.42);
  --theme-choice-active-ring: rgba(15, 143, 167, 0.12);
  --toast-bg: rgba(16, 32, 45, 0.96);
  --toast-border: #63cfe0;
  --toast-success: #58d68d;
  --toast-title: rgba(244, 251, 255, 0.62);
  --shadow-lg: 0 22px 44px rgba(16, 32, 45, 0.11);
  --shadow-md: 0 16px 28px rgba(16, 32, 45, 0.08);
  --radius-lg: 24px;
  --radius-md: 18px;
}

body[data-theme="network-optimization"] {
  --bg-1: #edf7fb;
  --bg-2: #d6e8ee;
  --bg-orb: radial-gradient(circle at top left, rgba(37, 167, 193, 0.14), transparent 30%);
  --accent: #1d86b6;
  --accent-dark: #155c7d;
  --warning: #7cc86d;
  --glow-1: rgba(37, 167, 193, 0.24);
  --glow-2: rgba(124, 200, 109, 0.16);
  --header-start: rgba(8, 31, 48, 0.95);
  --header-end: rgba(16, 84, 114, 0.9);
  --header-accent: rgba(160, 233, 245, 0.88);
  --primary-end: #176b91;
  --secondary-bg: #e8f5fb;
  --secondary-border: rgba(29, 134, 182, 0.22);
  --hero-card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(233, 245, 250, 0.97));
  --dark-panel-start: rgba(7, 27, 43, 0.96);
  --dark-panel-end: rgba(18, 92, 120, 0.92);
  --dark-panel-glow: rgba(56, 208, 221, 0.28);
  --route-line-start: rgba(56, 208, 221, 0.88);
  --route-line-end: rgba(124, 200, 109, 0.9);
  --route-stop-border: #38d0dd;
  --route-stop-ring: rgba(56, 208, 221, 0.16);
  --menu-icon-bg: linear-gradient(135deg, rgba(29, 134, 182, 0.16), rgba(255, 255, 255, 0.96));
  --map-bg: linear-gradient(180deg, #f4fbfd, #e1eef4);
  --road-fill: linear-gradient(90deg, rgba(13, 62, 88, 0.18), rgba(29, 134, 182, 0.42));
  --hq-bg: linear-gradient(135deg, #0d2f45, #175f81);
  --customer-bg: linear-gradient(135deg, #cbf0a5, #7cc86d);
  --customer-text: #24441c;
  --cluster-bg: linear-gradient(135deg, #76d8eb, var(--accent));
  --legend-hq: #0d2f45;
  --legend-customer-ring: rgba(124, 200, 109, 0.2);
  --legend-stop-ring: rgba(29, 134, 182, 0.18);
  --theme-choice-active-border: rgba(29, 134, 182, 0.5);
  --theme-choice-active-ring: rgba(29, 134, 182, 0.14);
  --toast-border: #38d0dd;
}

body[data-theme="lehigh-university"] {
  --bg-1: #f7f1e2;
  --bg-2: #ddcfac;
  --bg-orb: radial-gradient(circle at top left, rgba(98, 33, 28, 0.12), transparent 28%);
  --surface: rgba(255, 250, 242, 0.86);
  --surface-alt: #f6efe2;
  --ink: #34231b;
  --muted: #765c49;
  --line: rgba(78, 43, 24, 0.1);
  --accent: #6b231d;
  --accent-dark: #4d1713;
  --warning: #c59a2c;
  --grid-line: rgba(255, 248, 236, 0.5);
  --glow-1: rgba(107, 35, 29, 0.18);
  --glow-2: rgba(197, 154, 44, 0.14);
  --header-start: rgba(73, 22, 20, 0.96);
  --header-end: rgba(121, 86, 25, 0.92);
  --header-accent: rgba(251, 227, 153, 0.88);
  --primary-end: #4d1713;
  --secondary-bg: #f7eadb;
  --secondary-border: rgba(107, 35, 29, 0.2);
  --hero-card-bg: linear-gradient(180deg, rgba(255, 251, 246, 0.92), rgba(245, 235, 219, 0.98));
  --dark-panel-start: rgba(78, 27, 25, 0.96);
  --dark-panel-end: rgba(131, 95, 29, 0.92);
  --dark-panel-glow: rgba(215, 176, 66, 0.24);
  --route-line-start: rgba(244, 212, 118, 0.88);
  --route-line-end: rgba(183, 81, 57, 0.88);
  --route-stop-border: #f4d476;
  --route-stop-ring: rgba(244, 212, 118, 0.16);
  --menu-icon-bg: linear-gradient(135deg, rgba(107, 35, 29, 0.16), rgba(255, 251, 246, 0.98));
  --map-bg: linear-gradient(180deg, #fcf8f0, #efe2c7);
  --map-grid-line: rgba(255, 248, 236, 0.48);
  --map-badge-bg: rgba(73, 22, 20, 0.76);
  --zone-bg: rgba(255, 249, 240, 0.94);
  --road-fill: linear-gradient(90deg, rgba(103, 70, 33, 0.2), rgba(107, 35, 29, 0.35));
  --hq-bg: linear-gradient(135deg, #5c1d19, #8c6421);
  --customer-bg: linear-gradient(135deg, #f7df93, var(--warning));
  --customer-text: #5a3b03;
  --cluster-bg: linear-gradient(135deg, #c87b64, var(--accent));
  --legend-hq: #5c1d19;
  --legend-hq-ring: rgba(92, 29, 25, 0.18);
  --legend-customer-ring: rgba(197, 154, 44, 0.2);
  --legend-stop-ring: rgba(107, 35, 29, 0.18);
  --theme-choice-active-border: rgba(107, 35, 29, 0.46);
  --theme-choice-active-ring: rgba(107, 35, 29, 0.14);
  --toast-bg: rgba(58, 22, 20, 0.96);
  --toast-border: #f4d476;
}

body[data-theme="suburban-roads"] {
  --bg-1: #eef7ef;
  --bg-2: #d8e4d2;
  --bg-orb: radial-gradient(circle at top left, rgba(73, 141, 93, 0.14), transparent 30%);
  --accent: #4b8d5d;
  --accent-dark: #346245;
  --warning: #db9e4a;
  --glow-1: rgba(73, 141, 93, 0.2);
  --glow-2: rgba(219, 158, 74, 0.14);
  --header-start: rgba(36, 57, 47, 0.95);
  --header-end: rgba(85, 105, 120, 0.9);
  --header-accent: rgba(192, 240, 196, 0.84);
  --primary-end: #346245;
  --secondary-bg: #edf5ee;
  --secondary-border: rgba(73, 141, 93, 0.2);
  --hero-card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(239, 246, 237, 0.96));
  --dark-panel-start: rgba(36, 57, 47, 0.96);
  --dark-panel-end: rgba(89, 110, 124, 0.92);
  --dark-panel-glow: rgba(112, 190, 136, 0.24);
  --route-line-start: rgba(112, 190, 136, 0.88);
  --route-line-end: rgba(219, 158, 74, 0.9);
  --route-stop-border: #70be88;
  --route-stop-ring: rgba(112, 190, 136, 0.16);
  --menu-icon-bg: linear-gradient(135deg, rgba(73, 141, 93, 0.16), rgba(255, 255, 255, 0.96));
  --map-bg: linear-gradient(180deg, #f6faf4, #e3ede0);
  --road-fill: linear-gradient(90deg, rgba(86, 96, 104, 0.32), rgba(73, 141, 93, 0.28));
  --hq-bg: linear-gradient(135deg, #46555d, #4b8d5d);
  --customer-bg: linear-gradient(135deg, #ffd39c, var(--warning));
  --customer-text: #5d3b11;
  --cluster-bg: linear-gradient(135deg, #9fd1a7, var(--accent));
  --legend-hq: #46555d;
  --legend-hq-ring: rgba(70, 85, 93, 0.18);
  --legend-customer-ring: rgba(219, 158, 74, 0.18);
  --legend-stop-ring: rgba(73, 141, 93, 0.18);
  --theme-choice-active-border: rgba(73, 141, 93, 0.46);
  --theme-choice-active-ring: rgba(73, 141, 93, 0.14);
  --toast-border: #70be88;
}

body[data-theme="manufacturing-plant"] {
  --bg-1: #edf1f4;
  --bg-2: #d7dde3;
  --bg-orb: radial-gradient(circle at top left, rgba(227, 143, 54, 0.12), transparent 30%);
  --surface: rgba(253, 253, 252, 0.86);
  --surface-alt: #f0f2f3;
  --accent: #d07c26;
  --accent-dark: #934f12;
  --warning: #ffd06a;
  --glow-1: rgba(208, 124, 38, 0.2);
  --glow-2: rgba(75, 93, 112, 0.12);
  --header-start: rgba(36, 43, 51, 0.95);
  --header-end: rgba(88, 97, 108, 0.92);
  --header-accent: rgba(255, 212, 133, 0.88);
  --primary-end: #934f12;
  --secondary-bg: #faf0e5;
  --secondary-border: rgba(208, 124, 38, 0.2);
  --hero-card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 240, 234, 0.98));
  --dark-panel-start: rgba(32, 37, 43, 0.96);
  --dark-panel-end: rgba(95, 103, 112, 0.92);
  --dark-panel-glow: rgba(255, 171, 76, 0.24);
  --route-line-start: rgba(255, 171, 76, 0.9);
  --route-line-end: rgba(148, 162, 176, 0.88);
  --route-stop-border: #ffab4c;
  --route-stop-ring: rgba(255, 171, 76, 0.18);
  --menu-icon-bg: linear-gradient(135deg, rgba(208, 124, 38, 0.16), rgba(255, 255, 255, 0.96));
  --map-bg: linear-gradient(180deg, #f7f8f9, #e2e6ea);
  --map-badge-bg: rgba(45, 52, 59, 0.76);
  --road-fill: linear-gradient(90deg, rgba(81, 93, 104, 0.28), rgba(208, 124, 38, 0.32));
  --hq-bg: linear-gradient(135deg, #3a4047, #d07c26);
  --customer-bg: linear-gradient(135deg, #ffe0a0, var(--warning));
  --customer-text: #654307;
  --cluster-bg: linear-gradient(135deg, #96a4b3, #6d7c8b);
  --legend-hq: #3a4047;
  --legend-hq-ring: rgba(58, 64, 71, 0.18);
  --legend-customer-ring: rgba(255, 208, 106, 0.18);
  --legend-stop-ring: rgba(109, 124, 139, 0.18);
  --theme-choice-active-border: rgba(208, 124, 38, 0.46);
  --theme-choice-active-ring: rgba(208, 124, 38, 0.14);
  --toast-border: #ffab4c;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: var(--bg-orb), linear-gradient(180deg, var(--bg-1), var(--bg-2));
}

button,
input,
select {
  font: inherit;
}

.page-backdrop {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.page-backdrop__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.5;
}

.page-backdrop__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(12px);
}

.page-backdrop__glow--one {
  top: -120px;
  right: -80px;
  width: 360px;
  height: 360px;
  background: radial-gradient(circle, var(--glow-1), transparent 68%);
}

.page-backdrop__glow--two {
  bottom: -140px;
  left: -120px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, var(--glow-2), transparent 70%);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1320px, calc(100% - 2rem));
  margin: 1rem auto 2rem;
  display: grid;
  gap: 0.75rem;
  grid-template-rows: auto 1fr;
}

body.viewing-game .app-shell {
  width: calc(100% - 1.5rem);
  max-width: none;
  margin: 0.5rem auto 0;
  height: calc(100vh - 0.5rem);
  overflow: hidden;
}

body.viewing-game {
  overflow: hidden;
}

.panel {
  background: var(--surface);
  backdrop-filter: blur(18px);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.25rem;
  color: #f4fbff;
  background: linear-gradient(135deg, var(--header-start), var(--header-end));
  border-color: rgba(255, 255, 255, 0.08);
}

body.viewing-game .site-header {
  padding: 0.55rem 1rem;
  gap: 0.75rem;
}

body.viewing-game .header-current__label {
  display: block;
  max-width: 100%;
  font-size: clamp(1.02rem, 1.85vw, 1.42rem);
  letter-spacing: 0.04em;
  line-height: 1.12;
  padding-bottom: 0.08em;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-header__brand {
  min-width: 0;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-brand h1 {
  margin: 0;
  font-size: clamp(1.9rem, 3.3vw, 2.45rem);
  font-family: "Candara", "Segoe UI", sans-serif;
  letter-spacing: 0.02em;
}

.eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.74rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.site-header .eyebrow {
  color: var(--header-soft);
}

.eyebrow--accent {
  color: var(--header-accent);
}

.header-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-self: end;
}

.header-current {
  justify-self: center;
  text-align: center;
  min-width: 0;
}

.header-current__label {
  display: inline-block;
  font-size: clamp(1.45rem, 2.7vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244, 251, 255, 0.88);
}

.header-current__subpage {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(244, 251, 255, 0.62);
}

.header-current--level .header-current__label {
  display: block;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  letter-spacing: 0.14em;
  line-height: 1.02;
}

.header-current--level .header-current__subpage {
  margin-top: 0.18rem;
  font-size: clamp(0.78rem, 1.2vw, 0.92rem);
  letter-spacing: 0.12em;
  color: rgba(244, 251, 255, 0.74);
}

.screen {
  display: none;
}

.screen--active {
  display: block;
  animation: screen-in 0.42s ease both;
}

body.viewing-game .screen-stack {
  min-height: 0;
  overflow: hidden;
}

body.viewing-game #game.screen--active {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

body.viewing-game #game .game-layout {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
}

body.viewing-game .shop-panel,
body.viewing-game .control-panel,
body.viewing-game .map-panel {
  border-radius: 16px;
}

.shop-panel .button {
  padding: 0.6rem 0.75rem;
  font-size: 0.85rem;
  border-radius: 11px;
}

.toast-region {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.global-confetti-host {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  overflow: visible;
}

.toast {
  padding: 0.85rem 1rem 0.9rem;
  border: 1px solid var(--toast-border);
  border-radius: 16px;
  background: var(--toast-bg);
  color: rgba(255, 249, 240, 0.96);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast__title {
  display: block;
  margin: 0 0 0.2rem;
  color: var(--toast-title);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.toast__message {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.42;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.99);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.screen-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
}

.screen-header h2 {
  margin: 0.2rem 0 0.35rem;
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  font-family: "Candara", "Segoe UI", sans-serif;
}

.screen-header p {
  margin: 0;
  color: var(--muted);
  max-width: 52rem;
  line-height: 1.6;
}

.header-chip-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0.85rem 1.15rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease;
}

.button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.button:active {
  transform: translateY(0);
}

.button--primary {
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--primary-end));
}

.button--secondary {
  color: var(--accent-dark);
  background: var(--secondary-bg);
  border-color: var(--secondary-border);
}

.button--ghost {
  color: var(--ink);
  background: var(--ghost-bg);
  border-color: var(--ghost-border);
}

.site-header .button--ghost {
  color: #f4fbff;
  background: var(--header-ghost-bg);
  border-color: var(--header-ghost-border);
}

.button--small {
  padding: 0.68rem 1rem;
}

.button--wide {
  display: inline-flex;
  justify-content: center;
  width: 100%;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.95fr;
  gap: 1.25rem;
  min-height: 72vh;
  padding: clamp(1.25rem, 2vw, 1.75rem);
  align-items: stretch;
}

.hero__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0.4rem;
  text-align: center;
}

.hero__copy h2 {
  margin: 0 0 1rem;
  max-width: 16ch;
  font-size: clamp(2.35rem, 5.3vw, 4.4rem);
  line-height: 1.02;
  font-family: "Candara", "Trebuchet MS", sans-serif;
}

.hero__lede {
  max-width: 40rem;
  margin: 0 0 1.35rem;
  color: var(--muted);
  line-height: 1.8;
  font-size: 1.05rem;
}

.button-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  justify-content: center;
}

.theme-switcher {
  margin-top: 1rem;
  padding: 1rem;
  width: min(100%, 40rem);
  border-radius: var(--radius-md);
  background: var(--hero-card-bg);
  border: 1px solid var(--line);
}

.theme-switcher__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

.theme-switcher__header h3 {
  margin: 0.2rem 0 0;
  font-size: 1.05rem;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.theme-choice {
  padding: 0.9rem 1rem;
  text-align: left;
  border: 1px solid var(--theme-choice-border);
  border-radius: 16px;
  background: var(--theme-choice-bg);
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.theme-choice:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.theme-choice.is-active {
  border-color: var(--theme-choice-active-border);
  box-shadow: 0 0 0 4px var(--theme-choice-active-ring);
}

.theme-switcher__note {
  margin: 0.9rem 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.play-demo {
  width: min(100%, 46rem);
  margin-top: 1.4rem;
  padding: 1.1rem 1.15rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--hero-card-bg);
  border: 1px solid var(--line);
}

.play-demo__copy {
  margin-bottom: 1rem;
}

.play-demo__copy h3 {
  margin: 0.2rem 0 0;
  font-size: 1.15rem;
}

.play-demo__rail {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: start;
  padding-top: 1.5rem;
}

.play-demo__line {
  position: absolute;
  top: 2.15rem;
  left: 8%;
  right: 8%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--route-line-start), var(--route-line-end));
}

.play-demo__bus {
  position: absolute;
  top: -0.2rem;
  left: 8%;
  z-index: 2;
  width: 84px;
  height: 34px;
  border-radius: 11px 14px 8px 8px;
  background: #6b231d;
  box-shadow: 0 10px 18px rgba(52, 35, 27, 0.18);
  transform: translateX(-50%);
  opacity: 1;
  will-change: left, opacity;
  animation: bus-run 16.4s linear infinite;
}

.play-demo__bus::before,
.play-demo__bus::after {
  content: "";
  position: absolute;
  bottom: -6px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #23323e;
}

.play-demo__bus::before {
  left: 10px;
}

.play-demo__bus::after {
  right: 10px;
}

.play-demo__window {
  position: absolute;
  top: 5px;
  right: 9px;
  width: 18px;
  height: 10px;
  border-radius: 4px;
  background: rgba(255, 248, 236, 0.78);
}

.play-demo__decal {
  position: absolute;
  top: 6px;
  left: 8px;
  width: 46px;
  padding: 4px 2px;
  border-radius: 6px;
  background: linear-gradient(180deg, #fff7e8, #f1dfba);
  box-shadow: inset 0 0 0 1px rgba(92, 29, 25, 0.14);
  text-align: center;
  line-height: 0.94;
}

.play-demo__decal-top {
  display: block;
  font-size: 0.44rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  color: #6b231d;
}

.play-step {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 0.45rem;
  padding-top: 1rem;
  text-align: center;
  color: var(--muted);
}

.play-step__dot {
  width: 2px;
  height: 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.88);
}

.play-step strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.play-demo__actions {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

@keyframes bus-run {
  0% {
    left: -12%;
    opacity: 0;
  }

  8% {
    left: 8%;
    opacity: 1;
  }

  14% {
    left: 8%;
    opacity: 1;
  }

  24% {
    left: 28%;
    opacity: 1;
  }

  30% {
    left: 28%;
    opacity: 1;
  }

  40% {
    left: 48%;
    opacity: 1;
  }

  46% {
    left: 48%;
    opacity: 1;
  }

  56% {
    left: 68%;
    opacity: 1;
  }

  62% {
    left: 68%;
    opacity: 1;
  }

  72% {
    left: 88%;
    opacity: 1;
  }

  78% {
    left: 88%;
    opacity: 1;
  }

  88% {
    left: 108%;
    opacity: 0;
  }

  100% {
    left: -12%;
    opacity: 0;
  }
}

.guide-layout {
  display: grid;
  grid-template-columns: 1.3fr 0.85fr;
  gap: 1rem;
  align-items: start;
}

.guide-main,
.guide-card {
  padding: 1.15rem;
}

.guide-main__header {
  margin-top: -0.2rem;
  margin-bottom: 1rem;
  text-align: center;
}

.guide-main__header h2 {
  margin: 0;
  font-size: 2.2rem;
}

.guide-step + .guide-step {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.guide-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: start;
}

.guide-step__number {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--primary-end));
  color: #ffffff;
  font-weight: 800;
}

.guide-step h3,
.guide-card h3 {
  margin: 0 0 0.45rem;
}

.guide-card__title--centered {
  font-size: 2rem;
  text-align: center;
}

.guide-step p,
.guide-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.guide-card p + p {
  margin-top: 0.85rem;
}

.guide-replay-demo {
  margin-top: 0.2rem;
}

.guide-replay-demo__stage {
  position: relative;
  aspect-ratio: 1.22;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(110, 71, 42, 0.16);
  background:
    linear-gradient(180deg, rgba(248, 242, 232, 0.96), rgba(233, 224, 208, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    inset 0 -18px 28px rgba(85, 70, 54, 0.08),
    0 14px 24px rgba(16, 32, 45, 0.08);
}

.guide-replay-demo__stage::before,
.guide-replay-demo__stage::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.guide-replay-demo__stage::before {
  background:
    radial-gradient(circle at 14% 26%, rgba(255, 255, 255, 0.46), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 32%);
}

.guide-replay-demo__stage::after {
  background-image:
    linear-gradient(rgba(113, 132, 149, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(113, 132, 149, 0.07) 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: 0.36;
}

.guide-replay-demo__roads,
.guide-replay-demo__nodes {
  position: absolute;
  inset: 0;
}

.guide-replay-demo__roads {
  z-index: 1;
  overflow: visible;
}

.guide-replay-demo__road {
  stroke: #1f1914;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.92;
}

.guide-replay-demo__nodes {
  z-index: 2;
}

.guide-replay-demo__plant {
  position: absolute;
  width: 25%;
  transform: translate(-50%, -64%);
  filter: drop-shadow(0 10px 16px rgba(16, 32, 45, 0.14));
}

.guide-replay-demo__plant-image {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}

.guide-replay-demo__node {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.96);
  transform: translate(-50%, -50%);
  box-shadow:
    0 8px 14px rgba(16, 32, 45, 0.14),
    0 0 0 3px rgba(107, 35, 29, 0.1);
}

.guide-replay-demo__node--intersection {
  background: linear-gradient(135deg, #6b231d, #8c6421);
}

.guide-replay-demo__node--bus-stop {
  width: 15px;
  height: 15px;
  background: linear-gradient(135deg, #2464cf, #57befd);
  box-shadow:
    0 8px 14px rgba(16, 32, 45, 0.16),
    0 0 0 3px rgba(36, 100, 207, 0.14);
  transition:
    filter 180ms ease,
    opacity 180ms ease;
}

.guide-replay-demo__node--bus-stop.is-served {
  filter: saturate(0.5);
}

.guide-replay-demo__stop-demand {
  position: absolute;
  left: 50%;
  top: -7px;
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  padding: 0.14rem 0.28rem;
  border-radius: 999px;
  border: 1px solid rgba(107, 35, 29, 0.12);
  background: rgba(255, 250, 243, 0.96);
  box-shadow: 0 8px 14px rgba(16, 32, 45, 0.1);
  transform: translate(-8%, -100%);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.guide-replay-demo__node--bus-stop.is-served .guide-replay-demo__stop-demand {
  opacity: 0.28;
  transform: translate(-8%, -100%) scale(0.82);
}

.guide-replay-demo__stop-icon {
  width: 13px;
  height: 13px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  overflow: hidden;
  background: rgba(255, 234, 183, 0.92);
  box-shadow: inset 0 0 0 1px rgba(197, 154, 44, 0.16);
}

.guide-replay-demo__stop-icon-image {
  display: block;
  width: 13px;
  height: 13px;
}

.guide-replay-demo__stop-count {
  color: #6b231d;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1;
}

.guide-replay-demo__runner {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  transform: translate(-50%, -50%);
  transform-origin: 50% 50%;
  filter: drop-shadow(0 10px 16px rgba(16, 32, 45, 0.2));
  transition: opacity 180ms ease;
}

.guide-replay-demo__runner.is-hidden {
  opacity: 0;
}

.guide-replay-demo__runner-body {
  display: block;
  transform-origin: 50% 50%;
}

.guide-replay-demo__runner .map-bus {
  pointer-events: none;
}

.guide-side {
  display: grid;
  gap: 1rem;
}

.guide-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.8;
}

.panel--dark {
  position: relative;
  overflow: hidden;
  padding: 1.35rem;
  color: #f4fbff;
  background: linear-gradient(160deg, var(--dark-panel-start), var(--dark-panel-end));
}

.panel--dark::after {
  content: "";
  position: absolute;
  right: -60px;
  bottom: -70px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--dark-panel-glow), transparent 68%);
  pointer-events: none;
  z-index: 0;
}

.panel--dark > * {
  position: relative;
  z-index: 1;
}

.hero__visual-top h3 {
  margin: 0.25rem 0 1rem;
  font-size: 1.6rem;
}

.hero__visual-copy {
  margin: 0;
  color: var(--dark-panel-text-soft);
  font-size: 1.05rem;
  line-height: 1.7;
  text-align: justify;
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.metric-block {
  padding: 0.72rem 0.95rem;
  width: 86%;
  justify-self: center;
  border-radius: 16px;
  background: var(--dark-panel-soft-bg);
  border: 1px solid var(--dark-panel-soft-border);
  text-align: center;
}

.metric-block span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dark-panel-text-soft);
}

.metric-block strong {
  font-size: 1.45rem;
}

.featured-list__title {
  margin: 1.1rem 0 0.35rem;
}

.featured-list {
  display: grid;
  gap: 0.3rem;
  margin: 0;
  padding-left: 1.1rem;
  color: var(--dark-panel-text-soft);
  line-height: 1.7;
}

.hero__visual-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.menu-grid,
.level-grid,
.results-grid,
.info-grid {
  display: grid;
  gap: 1rem;
}

.menu-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.menu-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 1.2rem;
  text-align: left;
  cursor: pointer;
}

.menu-card__icon {
  display: inline-grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--menu-icon-bg);
  color: var(--accent-dark);
  font-weight: 800;
}

.menu-card h3,
.level-card h3,
.result-card h3,
.info-card h3,
.settings-note h3 {
  margin: 0;
}

.menu-card p,
.level-card p,
.info-card p,
.settings-note p,
.results-summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.level-card h3 + p {
  margin-top: -0.35rem;
}

.menu-card:hover,
.level-card:hover,
.info-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.level-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.level-card {
  padding: 0.95rem 1.15rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.level-card__top,
.bus-card__title,
.shop-card__title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.level-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: -0.35rem;
}

.level-card__tags {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.level-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(107, 35, 29, 0.08);
  color: var(--accent-dark);
  font-size: 0.8rem;
  font-weight: 700;
}

.meta-box {
  padding: 0.85rem;
  border-radius: 14px;
  background: var(--surface-alt);
}

.level-card__meta .meta-box {
  padding: 0.65rem 0.85rem;
}

.meta-box span,
.result-card span,
.stat-pill span {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.meta-box strong,
.result-card strong {
  font-size: 1.3rem;
}

.pill,
.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 143, 167, 0.12);
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.status-pill--accent {
  background: rgba(15, 143, 167, 0.14);
}

.console-ref {
  position: relative;
  overflow: visible;
}

.console-ref::before {
  content: none;
}

.shop-card__visual.console-ref::before,
.shop-card__stats.console-ref::before,
.bus-card__title.console-ref::before,
.bus-card__meta.console-ref::before,
.bus-list.console-ref::before,
.control-list.console-ref::before,
.constraint-list.console-ref::before,
.legend.console-ref::before,
.shop-list.console-ref::before,
.objective-list.console-ref::before,
.score-breakdown.console-ref::before,
.button-column.console-ref::before {
  top: 0.35rem;
  left: 0.35rem;
}

.stars {
  color: #a76c10;
  font-size: 0.92rem;
  font-weight: 700;
}

.top-bar {
  position: absolute;
  left: clamp(0.7rem, 1.7vw, 1rem);
  right: clamp(0.7rem, 1.7vw, 1rem);
  bottom: clamp(0.7rem, 1.7vw, 1rem);
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.72rem;
  margin-top: 0;
  padding: 0.82rem 0.92rem 0.78rem;
  align-items: stretch;
  border-radius: 22px;
  border: 1px solid rgba(250, 247, 239, 0.18);
  background:
    radial-gradient(circle at 18% -18%, rgba(255, 255, 255, 0.2), transparent 38%),
    linear-gradient(180deg, rgba(152, 156, 164, 0.78), rgba(120, 124, 132, 0.88) 22%, rgba(145, 149, 157, 0.84));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 16px 28px rgba(255, 255, 255, 0.04),
    0 14px 24px rgba(20, 27, 34, 0.12);
  backdrop-filter: blur(10px);
  pointer-events: none;
}

.top-bar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1rem;
  right: 1rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 252, 246, 0.48), rgba(255, 255, 255, 0));
  opacity: 0.82;
  pointer-events: none;
}

.top-bar > * {
  min-width: 0;
  pointer-events: none;
}

.stat-pill {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.08rem;
  min-height: 5.35rem;
  padding: 0.66rem 0.88rem 0.68rem;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 251, 244, 0.2), rgba(218, 223, 229, 0.1));
  border: 1px solid rgba(255, 248, 236, 0.22);
  overflow: hidden;
  text-align: left;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -10px 18px rgba(24, 32, 40, 0.08),
    0 8px 18px rgba(20, 27, 34, 0.1);
  backdrop-filter: blur(8px);
}

.stat-pill span {
  font-family: "Candara", "Trebuchet MS", sans-serif;
  font-size: 0.64rem;
  line-height: 1.15;
  color: rgba(247, 242, 234, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.stat-pill strong {
  display: block;
  margin-top: 0.02rem;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: clamp(1.08rem, 0.95vw, 1.28rem);
  font-weight: 700;
  line-height: 1.08;
  color: #fff8ef;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  text-wrap: balance;
  text-shadow: 0 1px 2px rgba(20, 27, 34, 0.22);
}

.stat-pill__detail {
  margin: auto 0 0;
  padding-top: 0.28rem;
  border-top: 1px solid rgba(255, 248, 236, 0.14);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.18;
  color: rgba(255, 248, 236, 0.74);
}

.map-column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 0;
  min-height: 0;
}

.game-layout {
  display: grid;
  grid-template-columns: 22fr 56fr 22fr;
  gap: 0.75rem;
  align-items: stretch;
  min-height: 0;
}

#game {
  position: relative;
  overflow: hidden;
  padding-bottom: 0;
}

#game.is-solution-replay-active .game-layout {
  pointer-events: none;
}

#game.is-solution-replay-active #foundryFleetYard {
  opacity: 0;
  visibility: hidden;
}

.game-victory-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: clamp(0.8rem, 2vw, 1.25rem);
  border-radius: inherit;
  background: rgba(30, 20, 14, 0.36);
  backdrop-filter: blur(6px);
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.game-victory-overlay[hidden] {
  display: none;
}

.game-victory-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.game-victory-card {
  --game-victory-metrics-left-width: 10.4rem;
  --game-victory-metrics-middle-width: 7rem;
  --game-victory-metrics-right-width: 9.6rem;
  --game-victory-row-gap: 0.6rem;
  --game-victory-row-width: calc(
    var(--game-victory-metrics-left-width) +
    var(--game-victory-metrics-middle-width) +
    var(--game-victory-metrics-right-width) +
    (var(--game-victory-row-gap) * 2)
  );
  width: min(31rem, calc(100% - 1rem));
  max-height: calc(100% - 0.5rem);
  padding: 1.18rem 0.9rem 0.9rem;
  border-radius: 28px;
  border: 1px solid rgba(107, 35, 29, 0.18);
  background:
    radial-gradient(circle at top, rgba(244, 212, 118, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(255, 252, 247, 0.98), rgba(246, 237, 220, 0.98));
  box-shadow:
    0 32px 60px rgba(22, 15, 11, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.76);
  overflow-y: auto;
  text-align: center;
}

.game-victory-card h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  line-height: 1.1;
  color: var(--accent-dark);
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  font-weight: 700;
  text-align: center;
  text-wrap: balance;
}

.game-victory__heading {
  margin-bottom: 0.5rem;
}

.game-victory__heading-copy {
  display: flex;
  justify-content: center;
  min-width: 0;
}

.game-victory__heading-copy h2 {
  display: inline-block;
  max-width: 100%;
  margin: 0 auto;
}

.game-victory__delayed-reveal {
  opacity: 1;
  transition: opacity 5400ms cubic-bezier(0.22, 1, 0.36, 1);
}

.game-victory__delayed-reveal.is-awaiting-reveal {
  opacity: 0;
}

.game-victory__top-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 9.9rem;
  min-height: 2.9rem;
  padding: 0.52rem 0.82rem;
  border-radius: 20px;
  border: 1px solid rgba(107, 35, 29, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0) 48%),
    linear-gradient(180deg, rgba(252, 246, 238, 0.99), rgba(244, 232, 214, 0.97));
  color: rgba(107, 35, 29, 0.74);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.16;
  text-align: center;
  white-space: normal;
  text-wrap: balance;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 4px 10px rgba(78, 43, 24, 0.06);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.game-victory__replay-stack .game-victory__top-button {
  max-width: none;
  min-height: 3.14rem;
  padding: 0.48rem 0.58rem;
  border-color: rgba(107, 35, 29, 0.24);
  color: rgba(77, 23, 19, 0.9);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 0 0 1px rgba(255, 245, 227, 0.72),
    0 8px 18px rgba(78, 43, 24, 0.14);
}

.game-victory__top-button-text {
  display: block;
  width: 100%;
  white-space: nowrap;
}

.game-victory__top-button:hover {
  transform: translateY(-1px);
  border-color: rgba(107, 35, 29, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 6px 14px rgba(78, 43, 24, 0.08);
}

.game-victory__replay-stack .game-victory__top-button:hover {
  border-color: rgba(107, 35, 29, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 0 0 1px rgba(255, 248, 236, 0.82),
    0 10px 20px rgba(78, 43, 24, 0.17);
}

.game-victory__top-button:active {
  transform: translateY(0);
}

.game-victory__top-button:disabled {
  opacity: 0.56;
  cursor: default;
  transform: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.76),
    0 3px 8px rgba(78, 43, 24, 0.05);
}

.game-victory__top-button--solution {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0) 48%),
    linear-gradient(180deg, rgba(252, 246, 238, 0.99), rgba(244, 232, 214, 0.97));
}

.game-victory__top-button--optimal {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0) 48%),
    linear-gradient(180deg, rgba(252, 246, 238, 0.99), rgba(244, 232, 214, 0.97));
}

.game-victory__stars {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 0.55rem;
  margin: 1.38rem 0 1.35rem;
}

.game-victory__star {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 24px;
  font-size: 2.55rem;
  line-height: 1;
  color: rgba(107, 35, 29, 0.2);
  background: linear-gradient(180deg, rgba(215, 205, 191, 0.7), rgba(194, 181, 166, 0.78));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.58),
    0 14px 22px rgba(66, 47, 30, 0.14);
  transform: rotate(-7deg);
  transition:
    color 220ms ease,
    background 220ms ease,
    box-shadow 220ms ease;
}

.game-victory__star:nth-child(2) {
  width: 86px;
  height: 86px;
  font-size: 2.95rem;
  transform: translateY(-6px);
}

.game-victory__star:nth-child(3) {
  transform: rotate(7deg);
}

.game-victory__star.is-earned {
  color: #fff7d9;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 247, 206, 0.96), rgba(255, 195, 74, 0.9) 48%, rgba(216, 118, 26, 0.95) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 0 0 2px rgba(255, 242, 213, 0.58),
    0 16px 28px rgba(121, 73, 18, 0.28),
    0 0 24px rgba(255, 181, 76, 0.36);
}

.game-victory__scoreline {
  width: min(100%, var(--game-victory-row-width));
  margin-top: 0.18rem;
  margin-left: auto;
  margin-right: auto;
  padding: 0.54rem 0.5rem 0.38rem;
  border-radius: 20px;
  background: rgba(255, 249, 239, 0.68);
  border: 1px solid rgba(107, 35, 29, 0.1);
  overflow: hidden;
}

.game-victory__track {
  position: relative;
  width: calc(100% - 3.8rem);
  margin-left: auto;
  margin-right: auto;
  height: 88px;
}

.game-victory__track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 36px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(173, 156, 137, 0.34), rgba(151, 132, 111, 0.38));
}

.game-victory__track-fill {
  position: absolute;
  left: 0;
  top: 36px;
  height: 8px;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #f0a43b, #6b231d);
  box-shadow: 0 4px 12px rgba(107, 35, 29, 0.18);
  transition: width 1500ms cubic-bezier(0.22, 0.67, 0.16, 1);
}

.game-victory__marker,
.game-victory__player {
  position: absolute;
  top: 36px;
  transform: translateX(-50%);
}

.game-victory__marker {
  display: grid;
  justify-items: center;
  gap: 0.08rem;
  min-width: 3.8rem;
  text-align: center;
  color: var(--muted);
}

.game-victory__marker--optimal {
  min-width: 3.8rem;
  transform: translateX(-50%);
  justify-items: center;
  text-align: center;
}

.game-victory__tick {
  width: 3px;
  height: 18px;
  border-radius: 999px;
  background: rgba(74, 52, 34, 0.48);
  transform: translateY(-5px);
}

.game-victory__marker-label {
  display: block;
  margin-top: 0.08rem;
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.game-victory__marker strong {
  display: block;
  font-size: 0.86rem;
  color: var(--accent-dark);
}

.game-victory__marker.is-achieved .game-victory__tick {
  background: linear-gradient(180deg, #ffb24c, #d56b21);
  box-shadow: 0 0 0 2px rgba(255, 193, 77, 0.16);
}

.game-victory__marker.is-achieved .game-victory__marker-label,
.game-victory__marker.is-achieved strong {
  color: var(--accent-dark);
}

.game-victory__player {
  z-index: 1;
  display: grid;
  justify-items: center;
  transition: left 1500ms cubic-bezier(0.22, 0.67, 0.16, 1);
}

.game-victory__scoreline.is-score-reset .game-victory__track-fill,
.game-victory__scoreline.is-score-reset .game-victory__player {
  transition: none;
}

.game-victory__player-value {
  position: absolute;
  bottom: calc(100% + 0.38rem);
  min-width: 3.6rem;
  padding: 0.24rem 0.52rem;
  border-radius: 999px;
  border: 1px solid rgba(107, 35, 29, 0.18);
  background: rgba(255, 252, 247, 0.96);
  color: var(--accent-dark);
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 10px 20px rgba(55, 36, 22, 0.12);
}

.game-victory__player-dot {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 4px solid rgba(255, 248, 236, 0.94);
  background: linear-gradient(135deg, #6b231d, #f0a43b);
  box-shadow:
    0 0 0 4px rgba(107, 35, 29, 0.14),
    0 12px 18px rgba(16, 32, 45, 0.18);
}

.game-victory__metrics {
  display: grid;
  width: min(100%, var(--game-victory-row-width));
  grid-template-columns:
    var(--game-victory-metrics-left-width)
    var(--game-victory-metrics-middle-width)
    var(--game-victory-metrics-right-width);
  align-items: start;
  justify-content: center;
  gap: var(--game-victory-row-gap);
  margin: 1rem auto 0;
}

.game-victory__metric {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(107, 35, 29, 0.12);
  background: rgba(255, 250, 242, 0.84);
  text-align: center;
}

.game-victory__metric--costs {
  padding: 0.82rem 0.95rem;
  text-align: left;
}

.game-victory__metric--gap {
  padding: 0.82rem 0.95rem;
  text-align: left;
}

.game-victory__replay-stack {
  display: grid;
  gap: 0.72rem;
  align-self: stretch;
  align-content: start;
}

.game-victory__metric span {
  display: block;
  margin-bottom: 0.18rem;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.game-victory__metric strong {
  display: block;
  font-size: 1.35rem;
  color: var(--accent-dark);
}

.game-victory__cost-breakdown {
  margin: 0;
  display: grid;
  gap: 0.42rem;
}

.game-victory__cost-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 0.55rem;
}

.game-victory__cost-row dt,
.game-victory__cost-row dd {
  margin: 0;
}

.game-victory__cost-row dt {
  color: rgba(99, 76, 61, 0.92);
  font-size: 0.73rem;
  font-weight: 700;
  line-height: 1.2;
}

.game-victory__cost-row dd {
  color: var(--accent-dark);
  font-size: 0.98rem;
  font-weight: 800;
  text-align: right;
  white-space: nowrap;
}

.game-victory__cost-row--total {
  margin-top: 0.1rem;
  padding-top: 0.48rem;
  border-top: 1px solid rgba(107, 35, 29, 0.12);
}

.game-victory__cost-row--total dt,
.game-victory__cost-row--total dd {
  color: var(--accent-dark);
  font-weight: 800;
}

.game-victory__cost-row--total dd {
  font-size: 1.05rem;
}

.game-victory__actions {
  display: grid;
  width: min(100%, var(--game-victory-row-width));
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  justify-items: center;
  margin: 0.72rem auto 0;
}

.game-victory__actions .button {
  width: 100%;
  min-height: 2.85rem;
  padding: 0.78rem 0.86rem;
  font-size: 1rem;
  line-height: 1;
  white-space: nowrap;
  justify-content: center;
}

.game-victory__actions .button:disabled {
  opacity: 0.58;
  cursor: default;
  box-shadow: none;
}

.control-panel,
.shop-panel {
  padding: 0.75rem;
  overflow-y: auto;
}

.shop-panel {
  display: flex;
  flex-direction: column;
  align-self: stretch;
}

.shop-panel > .panel-section {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
}

.map-panel,
.settings-form,
.settings-note,
.results-summary {
  padding: 0.75rem;
}

.control-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-self: stretch;
  padding: 0.75rem;
  overflow-y: auto;
  background:
    radial-gradient(circle at top, rgba(244, 212, 118, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(255, 250, 242, 0.98), rgba(243, 232, 211, 0.96));
  border-color: rgba(255, 248, 236, 0.92);
}

.control-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(107, 35, 29, 0.05), transparent 24%),
    radial-gradient(circle at bottom left, rgba(197, 154, 44, 0.14), transparent 38%);
  pointer-events: none;
}

.control-panel > * {
  position: relative;
  z-index: 1;
}

.control-panel > .section-heading {
  margin-bottom: 0.8rem;
}

.panel-section + .panel-section {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.section-heading--centered {
  justify-content: center;
}

.section-heading h3,
.results-summary h3 {
  margin: 0;
}

.control-panel__section {
  padding: 0.75rem;
  border-radius: 16px;
  border: 1px solid rgba(107, 35, 29, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 252, 246, 0.94), rgba(248, 240, 225, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 12px 22px rgba(91, 62, 24, 0.08);
}

.control-panel__section--routes,
.control-panel__section--submit,
.opportunity-panel {
  display: flex;
  flex-direction: column;
}

.control-panel__section--routes {
  flex: 1 1 auto;
  justify-content: center;
}

.control-panel__section + .control-panel__section {
  margin-top: 0.6rem;
  padding-top: 0.75rem;
  border-top: 0;
}

.control-panel__heading {
  justify-content: center;
  text-align: center;
  margin-bottom: 0.5rem;
}

.control-panel__heading h3 {
  font-size: 0.92rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.bus-list,
.shop-list,
.control-list,
.button-column,
.toggle-list {
  display: grid;
  gap: 0.75rem;
}

.control-panel .control-list {
  gap: 0.7rem;
  align-content: center;
}

.control-panel .control-list .button,
.control-panel .button-column .button {
  width: 100%;
  justify-content: center;
  min-height: 2.6rem;
  border-radius: 14px;
  font-size: 0.88rem;
}

.control-panel .control-list .button--secondary {
  background: linear-gradient(180deg, rgba(255, 249, 240, 0.96), rgba(247, 234, 219, 0.98));
  border-color: rgba(107, 35, 29, 0.16);
}

.control-panel .control-list .button--ghost {
  background: linear-gradient(180deg, rgba(255, 251, 246, 0.9), rgba(241, 229, 210, 0.94));
  border-color: rgba(78, 43, 24, 0.12);
}

.control-panel__section--submit {
  flex: 0 0 auto;
  padding: 0.75rem;
  background:
    linear-gradient(180deg, rgba(107, 35, 29, 0.08), rgba(255, 249, 240, 0.98));
}

#submitSolutionButton {
  letter-spacing: 0.04em;
  box-shadow: 0 14px 26px rgba(77, 23, 19, 0.2);
}

#submitSolutionButton.is-solution-ready {
  background: linear-gradient(135deg, #ff9f3d, #ffb54f);
  border-color: rgba(120, 57, 18, 0.48);
  box-shadow:
    0 0 0 1px rgba(255, 241, 210, 0.72),
    0 0 22px rgba(255, 164, 61, 0.52),
    0 18px 30px rgba(120, 48, 18, 0.28);
  animation: submit-ready-pulse 1.7s ease-in-out infinite;
}

@keyframes submit-ready-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(255, 241, 210, 0.72),
      0 0 20px rgba(255, 164, 61, 0.46),
      0 18px 30px rgba(120, 48, 18, 0.24);
  }

  50% {
    box-shadow:
      0 0 0 1px rgba(255, 247, 226, 0.86),
      0 0 30px rgba(255, 174, 72, 0.68),
      0 20px 34px rgba(120, 48, 18, 0.32);
  }
}

.bus-card,
.shop-card {
  padding: 0.7rem;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--utility-card-bg);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.bus-card:hover,
.shop-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.shop-card {
  text-align: left;
  display: grid;
  gap: 0.5rem;
}

.bus-card__meta,
.shop-card__meta {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.92rem;
}

.shop-card__title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.25rem;
}

.shop-card__price {
  white-space: nowrap;
}

.shop-list--fleet {
  flex: 1 1 auto;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  align-content: stretch;
}

.shop-list--fleet .shop-card {
  height: 100%;
  align-content: center;
  min-height: 0;
}

.shop-card__visual {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  min-height: 68px;
  padding: 1.5rem 0 0.15rem;
  overflow: visible;
}

.shop-card__pill {
  position: absolute;
  top: 0;
  z-index: 2;
  padding: 0.18rem 0.48rem;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.shop-card__pill--capacity {
  left: 0;
  background: rgba(107, 35, 29, 0.1);
  color: var(--accent-dark);
}

.shop-card__pill--route {
  right: 0;
  background: rgba(26, 50, 72, 0.1);
  color: #253543;
}

.shop-card--lift .shop-card__visual {
  background: none;
  min-height: 64px;
  padding-top: 0.85rem;
}

.shop-card--shuttle .shop-card__visual {
  background: none;
  min-height: 68px;
  padding-top: 0.95rem;
}

.shop-card--coach .shop-card__visual {
  background: none;
  min-height: 72px;
  padding-top: 1.05rem;
}

.shop-vehicle {
  position: relative;
  display: block;
  z-index: 1;
  height: 28px;
  border-radius: 12px 16px 9px 9px;
  background: #6b231d;
  box-shadow:
    inset 0 -2px 0 rgba(255, 248, 236, 0.12),
    0 10px 18px rgba(52, 35, 27, 0.16);
}

.shop-vehicle::before,
.shop-vehicle::after {
  content: "";
  position: absolute;
  bottom: -7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1e1b1a;
  box-shadow: 0 0 0 3px rgba(255, 248, 236, 0.82);
}

.shop-vehicle::before {
  left: 10px;
}

.shop-vehicle::after {
  right: 10px;
}

.shop-vehicle__window {
  position: absolute;
  top: 5px;
  right: 9px;
  border-radius: 4px;
  background: rgba(227, 237, 247, 0.96);
}

.shop-vehicle__mark {
  position: absolute;
  top: 6px;
  left: 8px;
  border-radius: 999px;
}

.shop-vehicle--lift {
  width: 76px;
  height: 28px;
  border-radius: 6px 10px 7px 7px;
  background: linear-gradient(180deg, #202020, #0d0d0d);
  box-shadow:
    inset 0 -2px 0 rgba(255, 255, 255, 0.04),
    0 12px 20px rgba(0, 0, 0, 0.22);
}

.shop-vehicle--lift::after {
  right: 12px;
}

.shop-vehicle--lift::before {
  left: 12px;
}

.shop-vehicle--lift .shop-vehicle__window {
  top: 5px;
  right: 9px;
  width: 18px;
  height: 11px;
  border-radius: 3px;
  background: rgba(192, 210, 223, 0.95);
}

.shop-vehicle--lift .shop-vehicle__mark {
  top: 7px;
  left: 10px;
  width: 26px;
  height: 5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 0 rgba(255, 255, 255, 0.08);
}

.shop-vehicle--shuttle {
  width: 110px;
  height: 36px;
  border-radius: 12px 16px 10px 10px;
  background: linear-gradient(180deg, #fffdf9, #e8e1d7);
  box-shadow:
    inset 0 -3px 0 rgba(125, 110, 91, 0.08),
    0 12px 20px rgba(52, 35, 27, 0.16);
}

.shop-vehicle--shuttle .shop-vehicle__window {
  top: 7px;
  right: 12px;
  width: 24px;
  height: 13px;
  border-radius: 5px;
  background: rgba(193, 210, 223, 0.98);
}

.shop-vehicle--shuttle .shop-vehicle__mark {
  top: 8px;
  left: 12px;
  width: 54px;
  height: 10px;
  background:
    linear-gradient(90deg, rgba(90, 90, 90, 0.8) 0 22%, transparent 22% 30%, rgba(90, 90, 90, 0.8) 30% 52%, transparent 52% 60%, rgba(90, 90, 90, 0.8) 60% 82%);
  opacity: 0.52;
}

.shop-vehicle--coach {
  width: 152px;
  height: 38px;
  border-radius: 12px 18px 10px 10px;
  background: linear-gradient(180deg, #6b231d, #4d1713);
  box-shadow:
    inset 0 -3px 0 rgba(255, 248, 236, 0.12),
    0 14px 22px rgba(52, 35, 27, 0.2);
}

.shop-vehicle--coach .shop-vehicle__window {
  top: 8px;
  right: 13px;
  width: 22px;
  height: 13px;
  border-radius: 5px;
}

.shop-vehicle--coach .shop-vehicle__mark {
  top: 9px;
  left: 14px;
  width: 86px;
  height: 11px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff7e8, #f1dfba);
  box-shadow: inset 0 0 0 1px rgba(92, 29, 25, 0.14);
}

.shop-vehicle--coach .shop-vehicle__mark::after {
  content: "PACKARD EXPRESS";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.34rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: #6b231d;
}

.shop-card__title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.shop-card__title strong {
  display: block;
  font-size: 1.02rem;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
}

.shop-card__price {
  font-size: 1.16rem;
  font-weight: 800;
  color: var(--accent-dark);
  text-align: right;
  white-space: nowrap;
}

.opportunity-panel {
  margin-top: auto;
  justify-content: center;
}

.opportunity-card {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.45rem;
  min-height: 15.1rem;
  padding: 1.05rem 1rem 0.7rem;
  border-radius: 14px;
  border: 1px solid rgba(107, 35, 29, 0.16);
  background:
    radial-gradient(circle at top, rgba(244, 212, 118, 0.28), transparent 42%),
    linear-gradient(180deg, rgba(255, 249, 240, 0.96), rgba(245, 235, 219, 0.98));
  text-align: center;
}

.opportunity-card__value {
  display: inline-flex;
  align-items: flex-end;
  gap: 0.18rem;
  font-size: 2.2rem;
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.03em;
  color: var(--accent-dark);
}

.opportunity-card__value span {
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: 0;
}

.opportunity-card__note {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.82rem;
  white-space: nowrap;
}

.worker-icon {
  width: 154px;
  height: 126px;
  margin-top: 0.1rem;
  margin-bottom: -0.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  line-height: 0;
}

.worker-icon__image {
  display: block;
  width: 176px;
  height: auto;
  max-width: none;
  transform: translateY(-6px);
  object-fit: contain;
}

.worker-icon__image[alt=""] {
  color: transparent;
  height: auto;
}

.bus-card__note {
  margin: 0.7rem 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.86rem;
}

.info-copy,
.side-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.constraint-list {
  margin: 0.9rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.75;
}

.map-panel {
  min-height: 0;
  flex: 1 1 0;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  overflow: visible;
}

.map-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.map-panel__header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.map-stage {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 253, 248, 0.95), rgba(243, 236, 224, 0.96)),
    var(--map-bg);
  border: 1px solid var(--line);
}

.map-legend {
  position: absolute;
  top: 0.9rem;
  right: 0.95rem;
  z-index: 5;
  display: inline-grid;
  gap: 0.28rem;
  padding: 0.35rem 0.55rem;
  border-radius: 18px;
  background: rgba(255, 249, 240, 0.82);
  box-shadow: 0 8px 16px rgba(16, 32, 45, 0.1);
  color: var(--accent-dark);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
  pointer-events: none;
}

.map-legend__item {
  display: inline-grid;
  grid-template-columns: 28px 14px auto;
  align-items: center;
  gap: 0.35rem;
}

.map-legend__line {
  display: block;
  width: 28px;
  height: 5px;
  border-radius: 999px;
  background: #17130f;
  box-shadow: 0 2px 5px rgba(23, 19, 15, 0.18);
}

.map-legend__node {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex: 0 0 auto;
  justify-self: center;
}

.map-legend__node--brown {
  border: 2px solid rgba(255, 255, 255, 0.96);
  background: linear-gradient(135deg, #6b231d, #8c6421);
  box-shadow:
    0 3px 8px rgba(16, 32, 45, 0.16),
    0 0 0 2px rgba(107, 35, 29, 0.14);
}

.map-legend__node--pickup {
  border: 2px solid rgba(255, 255, 255, 0.96);
  background: linear-gradient(135deg, #2464cf, #57befd);
  box-shadow:
    0 3px 8px rgba(16, 32, 45, 0.16),
    0 0 0 2px rgba(36, 100, 207, 0.16);
}

.map-legend__equals {
  opacity: 0.72;
}

.map-stage--foundry::before,
.map-stage--foundry::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.map-stage--foundry {
  --map-status-overlay-clearance: 8.15rem;
  background: #a9acb2;
}

.map-stage--foundry::before {
  background:
    linear-gradient(90deg, transparent 0 14%, rgba(105, 190, 233, 0.5) 14% 14.6%, transparent 14.6% 100%),
    linear-gradient(90deg, transparent 0 61%, rgba(105, 190, 233, 0.48) 61% 61.6%, transparent 61.6% 100%),
    linear-gradient(180deg, transparent 0 52%, rgba(105, 190, 233, 0.44) 52% 52.6%, transparent 52.6% 100%),
    linear-gradient(35deg, transparent 0 64%, rgba(105, 190, 233, 0.34) 64% 64.5%, transparent 64.5% 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.55), transparent 26%);
  opacity: 0.65;
}

.map-stage--foundry::after {
  background-image:
    linear-gradient(rgba(113, 132, 149, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(113, 132, 149, 0.08) 1px, transparent 1px);
  background-size: 62px 62px;
  opacity: 0.38;
}

.map-stage--foundry::before,
.map-stage--foundry::after {
  content: none;
}

.foundry-network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.foundry-network path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.foundry-network__minor path {
  stroke: rgba(168, 184, 196, 0.78);
  stroke-width: 6;
}

.foundry-network__base--freeway path {
  stroke: #1fc28d;
  stroke-width: 30;
}

.foundry-network__base--arterial path {
  stroke: #20c892;
  stroke-width: 22;
}

.foundry-network__center--freeway path {
  stroke: rgba(255, 255, 255, 0.54);
  stroke-width: 4;
}

.foundry-network__center--arterial path {
  stroke: rgba(235, 168, 58, 0.9);
  stroke-width: 3.2;
  stroke-dasharray: 28 22;
}

.map-node,
.map-roundabout__node,
.map-pickup-node {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.96);
  background: linear-gradient(135deg, #6b231d, #8c6421);
  box-shadow:
    0 10px 18px rgba(16, 32, 45, 0.16),
    0 0 0 3px rgba(107, 35, 29, 0.12);
  transform: translate(-50%, -50%);
  transition:
    box-shadow 140ms ease,
    transform 140ms ease;
}

.map-node {
  position: absolute;
  z-index: 2;
  cursor: default;
  pointer-events: auto;
}

.map-node--blue {
  background: linear-gradient(135deg, #2464cf, #57befd);
  box-shadow:
    0 10px 18px rgba(16, 32, 45, 0.16),
    0 0 0 3px rgba(36, 100, 207, 0.18);
  overflow: visible;
}

.map-pickup-node {
  position: absolute;
  z-index: 3;
  width: 16px;
  height: 16px;
  padding: 0;
  border-width: 2px;
  appearance: none;
  background: linear-gradient(135deg, #2464cf, #57befd);
  box-shadow:
    0 10px 18px rgba(16, 32, 45, 0.16),
    0 0 0 3px rgba(36, 100, 207, 0.18);
  cursor: default;
  touch-action: manipulation;
  overflow: visible;
}

.map-pickup-node[hidden] {
  display: none;
}

.map-node::after {
  content: none;
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 50%;
  min-width: 1.15rem;
  padding: 0.18rem 0.34rem;
  border-radius: 999px;
  border: 1px solid rgba(107, 35, 29, 0.16);
  background: rgba(255, 249, 240, 0.96);
  color: var(--accent-dark);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 6px 12px rgba(16, 32, 45, 0.08);
  pointer-events: none;
}

.map-node--selected,
.map-roundabout__node--selected {
  box-shadow:
    0 12px 20px rgba(16, 32, 45, 0.18),
    0 0 0 5px rgba(48, 40, 32, 0.18);
  transform: translate(-50%, -50%) scale(1.08);
}

.map-pickup-node.map-node--selected {
  box-shadow:
    0 12px 20px rgba(16, 32, 45, 0.2),
    0 0 0 5px rgba(36, 100, 207, 0.22),
    0 0 0 10px rgba(87, 190, 253, 0.12);
  transform: translate(-50%, -50%) scale(1.12);
}

.map-node--reachable,
.map-roundabout__node--reachable {
  cursor: pointer;
  box-shadow:
    0 14px 24px rgba(16, 32, 45, 0.22),
    0 0 0 6px rgba(244, 212, 118, 0.34),
    0 0 0 11px rgba(244, 212, 118, 0.14);
  transform: translate(-50%, -50%) scale(1.1);
}

.map-pickup-node.map-node--reachable {
  background: linear-gradient(135deg, #2d7cff, #67d6ff);
  box-shadow:
    0 16px 28px rgba(16, 32, 45, 0.24),
    0 0 0 7px rgba(45, 124, 255, 0.44),
    0 0 0 14px rgba(103, 214, 255, 0.24),
    0 0 20px rgba(92, 181, 255, 0.28);
}

.map-node--reachable:hover,
.map-node--reachable:focus-visible,
.map-roundabout__node--reachable:hover,
.map-roundabout__node--reachable:focus-visible {
  transform: translate(-50%, -50%) scale(1.15);
}

.map-pickup-node.map-node--reachable:hover,
.map-pickup-node.map-node--reachable:focus-visible {
  background: linear-gradient(135deg, #3b89ff, #7be0ff);
  transform: translate(-50%, -50%) scale(1.18);
  box-shadow:
    0 18px 30px rgba(16, 32, 45, 0.26),
    0 0 0 8px rgba(45, 124, 255, 0.52),
    0 0 0 16px rgba(123, 224, 255, 0.3),
    0 0 24px rgba(104, 197, 255, 0.36);
}

.map-node--perimeter {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.map-node--perimeter-dragging {
  cursor: grabbing;
  z-index: 3;
  box-shadow:
    0 14px 22px rgba(16, 32, 45, 0.24),
    0 0 0 5px rgba(48, 40, 32, 0.22);
}

.map-node--concealed {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.map-road-layer {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.map-animation-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.map-celebration-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: visible;
}

.map-celebration-burst-host {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.confetti-emitter-handle {
  position: absolute;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 10px 18px rgba(16, 32, 45, 0.28),
    0 0 0 6px rgba(255, 249, 240, 0.34);
  transform: translate(-50%, -50%);
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  appearance: none;
  z-index: 1;
  opacity: 0.88;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    opacity 0.18s ease,
    border-color 0.18s ease;
}

.confetti-emitter-handle:hover,
.confetti-emitter-handle:focus-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow:
    0 12px 22px rgba(16, 32, 45, 0.34),
    0 0 0 8px rgba(255, 249, 240, 0.42);
}

.confetti-emitter-handle.is-dragging {
  cursor: grabbing;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.14);
  box-shadow:
    0 14px 26px rgba(16, 32, 45, 0.38),
    0 0 0 10px rgba(255, 249, 240, 0.48);
}

.confetti-emitter-handle--brown {
  background: linear-gradient(135deg, #6b231d, #8b5532);
}

.confetti-emitter-handle--white {
  background: linear-gradient(135deg, #fffdf8, #f1e3cf);
}

.map-zone-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.map-zone {
  position: absolute;
  inset: 0;
}

.map-zone--northwest {
  background: #a9acb2;
}

.map-road-link {
  position: absolute;
  z-index: 1;
  height: 5px;
  border-radius: 999px;
  background: #17130f;
  box-shadow: 0 3px 8px rgba(23, 19, 15, 0.24);
  transform-origin: left center;
  pointer-events: none;
}

body.foundry-edit-mode .map-road-link {
  pointer-events: auto;
  cursor: pointer;
  height: 9px;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

body.foundry-edit-mode .map-road-link:hover {
  background: #c0392b;
  box-shadow: 0 0 12px rgba(192, 57, 43, 0.5);
}

body.foundry-edit-mode .map-stage {
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}

body.foundry-edit-mode .map-node:not(.map-node--concealed) {
  cursor: grab;
  touch-action: none;
}

body.foundry-edit-mode .map-node[data-builder-node="true"] {
  cursor: grab;
}

body.foundry-edit-mode .lmsa-campus-asset[data-builder-asset="true"],
body.foundry-edit-mode .lmsa-campus-asset:not([data-campus-asset="factory"]) {
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}

body.foundry-edit-mode .lmsa-campus-asset--builder-selected {
  filter: drop-shadow(0 0 6px rgba(255, 210, 84, 0.95));
  outline: 2px dashed rgba(255, 210, 84, 0.9);
  outline-offset: 4px;
  border-radius: 4px;
}

body.foundry-edit-mode .map-node--legacy-removed,
body.foundry-edit-mode .lmsa-campus-asset--legacy-removed {
  display: none !important;
}

.foundry-edit-sandlot {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  z-index: 7;
  display: flex;
  flex-direction: column;
  gap: 0.58rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid rgba(110, 71, 42, 0.2);
  border-radius: 1rem;
  background:
    linear-gradient(180deg, rgba(255, 249, 240, 0.96), rgba(244, 235, 221, 0.94));
  box-shadow:
    0 16px 28px rgba(16, 32, 45, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.35);
  opacity: 0;
  transform: translateY(10px) scale(0.98);
  pointer-events: none;
  transition:
    opacity 0.16s ease,
    transform 0.16s ease;
}

body.foundry-edit-mode .foundry-edit-sandlot {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.foundry-edit-sandlot__title {
  margin: 0;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.foundry-edit-sandlot__items {
  display: flex;
  align-items: stretch;
  gap: 0.55rem;
}

.foundry-edit-sandlot__item {
  min-width: 5.3rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  padding: 0.58rem 0.56rem 0.52rem;
  border: 1px solid rgba(110, 71, 42, 0.18);
  border-radius: 0.88rem;
  background: rgba(255, 252, 247, 0.94);
  box-shadow: 0 10px 18px rgba(16, 32, 45, 0.08);
  color: var(--accent-dark);
  cursor: grab;
  touch-action: none;
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease,
    border-color 0.14s ease;
}

.foundry-edit-sandlot__item:hover,
.foundry-edit-sandlot__item:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(210, 125, 53, 0.34);
  box-shadow: 0 12px 22px rgba(16, 32, 45, 0.12);
}

.foundry-edit-sandlot__item.is-dragging {
  cursor: grabbing;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 14px 24px rgba(16, 32, 45, 0.16);
}

.foundry-edit-sandlot__token {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.96);
  box-shadow:
    0 8px 14px rgba(16, 32, 45, 0.14),
    0 0 0 3px rgba(107, 35, 29, 0.12);
}

.foundry-edit-sandlot__token--brown-node {
  background: linear-gradient(135deg, #6b231d, #8c6421);
}

.foundry-edit-sandlot__token--blue-node {
  background: linear-gradient(135deg, #2464cf, #57befd);
  box-shadow:
    0 8px 14px rgba(16, 32, 45, 0.14),
    0 0 0 3px rgba(36, 100, 207, 0.18);
}

.foundry-edit-sandlot__item--sign {
  min-width: 5.7rem;
}

.foundry-edit-sandlot__item--pair {
  min-width: 6.4rem;
}

.foundry-edit-sandlot__pair {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.3rem;
  pointer-events: none;
}

.foundry-edit-sandlot__pair .foundry-edit-sandlot__token--blue-node {
  width: 14px;
  height: 14px;
  border-width: 2px;
  margin-bottom: 4px;
}

.foundry-edit-sandlot__sign-image {
  display: block;
  width: clamp(36px, 4.8%, 56px);
  max-width: none;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}

.foundry-edit-sandlot__label {
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

.map-road-link--route {
  z-index: 2;
  height: 7px;
  background: rgba(107, 35, 29, 0.42);
  box-shadow:
    0 6px 14px rgba(16, 32, 45, 0.2),
    0 0 0 1px rgba(255, 248, 236, 0.12);
}

.map-road-link--route-active {
  background: linear-gradient(90deg, #f2c05d, #d98333);
  box-shadow:
    0 8px 18px rgba(16, 32, 45, 0.24),
    0 0 0 1px rgba(255, 248, 236, 0.22);
}

.map-roundabout {
  position: absolute;
  z-index: 2;
  width: 74px;
  height: 38px;
  transform-origin: 50% 100%;
  pointer-events: auto;
}

.map-roundabout[hidden] {
  display: none;
}

.map-roundabout__arc {
  position: absolute;
  inset: 0;
  border: 5px solid #17130f;
  border-bottom: 0;
  border-radius: 999px 999px 0 0;
  box-sizing: border-box;
  filter: drop-shadow(0 3px 8px rgba(23, 19, 15, 0.24));
  pointer-events: none;
}

.map-roundabout__node {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: 1;
  padding: 0;
  appearance: none;
  cursor: default;
  overflow: visible;
}

#foundryFactoryStartNode {
  background: linear-gradient(135deg, #d96f24, #f0a43b);
  background-size: 140% 140%;
  background-position: 24% 32%;
  box-shadow:
    0 10px 18px rgba(16, 32, 45, 0.16),
    0 0 0 3px rgba(217, 111, 36, 0.2);
}

#foundryFactoryStartNode::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 50%;
  background:
    radial-gradient(
      circle,
      rgba(255, 234, 170, 0.7) 0%,
      rgba(255, 182, 88, 0.46) 38%,
      rgba(255, 128, 36, 0.18) 62%,
      rgba(255, 128, 36, 0) 82%
    );
  opacity: 0;
  transform: scale(0.84);
  transform-origin: 50% 50%;
  pointer-events: none;
  transition: opacity 320ms ease;
}

#foundryFactoryStartNode.map-roundabout__node--reachable {
  background: linear-gradient(145deg, #ff791d 0%, #ffa135 44%, #ffd868 100%);
  background-size: 180% 180%;
  background-position: 20% 24%;
  box-shadow:
    0 14px 24px rgba(16, 32, 45, 0.2),
    0 0 0 6px rgba(255, 134, 41, 0.28),
    0 0 0 13px rgba(255, 206, 98, 0.14),
    0 0 18px rgba(255, 150, 55, 0.2);
  animation: foundry-depot-core-pulse 3.4s ease-in-out infinite;
}

#foundryFactoryStartNode.map-roundabout__node--reachable::after {
  opacity: 1;
  animation: foundry-depot-glow-pulse 3.4s ease-in-out infinite;
}

#foundryFactoryStartNode.map-roundabout__node--reachable:hover,
#foundryFactoryStartNode.map-roundabout__node--reachable:focus-visible {
  background: linear-gradient(145deg, #ff8420 0%, #ffac3f 46%, #ffe07c 100%);
}

#foundryFactoryStartNode.map-roundabout__node--reachable:hover::after,
#foundryFactoryStartNode.map-roundabout__node--reachable:focus-visible::after {
  opacity: 1;
}

@keyframes foundry-depot-core-pulse {
  0%,
  100% {
    background-position: 18% 24%;
    box-shadow:
      0 13px 22px rgba(16, 32, 45, 0.18),
      0 0 0 5px rgba(255, 134, 41, 0.22),
      0 0 0 11px rgba(255, 206, 98, 0.1),
      0 0 14px rgba(255, 150, 55, 0.16);
  }

  50% {
    background-position: 82% 78%;
    box-shadow:
      0 18px 30px rgba(16, 32, 45, 0.26),
      0 0 0 9px rgba(255, 134, 41, 0.46),
      0 0 0 19px rgba(255, 214, 112, 0.24),
      0 0 34px rgba(255, 152, 57, 0.36);
  }
}

@keyframes foundry-depot-glow-pulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.82);
  }

  50% {
    opacity: 0.86;
    transform: scale(1.22);
  }
}

.map-fleet-yard {
  position: absolute;
  z-index: 2;
  height: 118px;
  pointer-events: auto;
}

.map-fleet-yard[hidden] {
  display: none;
}

.map-fleet-yard__bus {
  position: absolute;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.map-fleet-yard__bus-badge {
  position: relative;
  z-index: 1;
  min-width: 1.55rem;
  padding: 0.06rem 0.24rem;
  margin-bottom: -0.42rem;
  border-radius: 999px;
  border: 1px solid rgba(107, 35, 29, 0.18);
  background: rgba(255, 248, 236, 0.9);
  font-size: 0.46rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--accent-dark);
  text-transform: uppercase;
}

.map-fleet-yard__bus-visual {
  display: grid;
  place-items: center;
  width: auto;
  min-height: 0;
  padding: 0.18rem 0.24rem 0.12rem;
  border-radius: 14px;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease;
}

.map-fleet-yard__bus:hover .map-fleet-yard__bus-visual {
  transform: translateY(-1px);
}

.map-fleet-yard__bus.is-selected .map-fleet-yard__bus-visual {
  background: rgba(255, 248, 236, 0.32);
  box-shadow: 0 0 0 2px rgba(107, 35, 29, 0.18);
}

.map-fleet-yard__bus:focus-visible {
  outline: none;
}

.map-fleet-yard__bus:focus-visible .map-fleet-yard__bus-visual {
  background: rgba(255, 248, 236, 0.32);
  box-shadow:
    0 0 0 2px rgba(107, 35, 29, 0.18),
    0 0 0 4px rgba(244, 212, 118, 0.38);
}

.map-route-runner {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  transform-origin: 50% 50%;
  filter: drop-shadow(0 10px 16px rgba(16, 32, 45, 0.24));
  will-change: transform;
}

.map-route-runner .map-bus {
  pointer-events: none;
  transform-origin: 50% 50%;
}

.map-bus {
  position: relative;
  display: block;
  box-shadow:
    0 7px 12px rgba(27, 25, 23, 0.18),
    inset 0 -2px 0 rgba(255, 255, 255, 0.08);
}

.map-bus::before,
.map-bus::after {
  content: "";
  position: absolute;
  bottom: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1e1b1a;
  box-shadow: 0 0 0 2px rgba(255, 248, 236, 0.78);
}

.map-bus::before {
  left: 6px;
}

.map-bus::after {
  right: 6px;
}

.map-bus__window {
  position: absolute;
  right: 7px;
  border-radius: 3px;
  background: rgba(205, 220, 231, 0.96);
}

.map-bus__mark {
  position: absolute;
  border-radius: 999px;
}

.map-bus--lift {
  width: 36px;
  height: 14px;
  border-radius: 5px 8px 5px 5px;
  background: linear-gradient(180deg, #262626, #101010);
}

.map-bus--lift .map-bus__window {
  top: 3px;
  width: 10px;
  height: 5px;
}

.map-bus--lift .map-bus__mark {
  top: 4px;
  left: 7px;
  width: 12px;
  height: 3px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 5px 0 rgba(255, 255, 255, 0.12);
}

.map-bus--shuttle {
  width: 48px;
  height: 17px;
  border-radius: 7px 11px 6px 6px;
  background: linear-gradient(180deg, #fffdf9, #e7ded2);
}

.map-bus--shuttle .map-bus__window {
  top: 3px;
  width: 12px;
  height: 6px;
}

.map-bus--shuttle .map-bus__mark {
  top: 4px;
  left: 8px;
  width: 23px;
  height: 5px;
  background:
    linear-gradient(90deg, rgba(90, 90, 90, 0.72) 0 24%, transparent 24% 33%, rgba(90, 90, 90, 0.72) 33% 57%, transparent 57% 66%, rgba(90, 90, 90, 0.72) 66% 90%);
}

.map-bus--coach {
  width: 62px;
  height: 18px;
  border-radius: 7px 12px 6px 6px;
  background: linear-gradient(180deg, #6b231d, #4d1713);
}

.map-bus--coach .map-bus__window {
  top: 4px;
  width: 11px;
  height: 6px;
}

.map-bus--coach .map-bus__mark {
  top: 4px;
  left: 9px;
  width: 34px;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff7e8, #f1dfba);
}

.map-delete-can {
  position: absolute;
  right: 12px;
  bottom: calc(var(--map-status-overlay-clearance, 8.15rem) + 0.45rem);
  z-index: 2;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  padding: 0;
  border: 1px solid rgba(255, 248, 236, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 251, 244, 0.2), rgba(218, 223, 229, 0.1));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -10px 18px rgba(24, 32, 40, 0.08),
    0 8px 18px rgba(20, 27, 34, 0.1);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background-color 140ms ease,
    opacity 140ms ease;
}

.map-delete-can:hover {
  transform: translateY(-1px);
  background:
    linear-gradient(180deg, rgba(255, 251, 244, 0.24), rgba(218, 223, 229, 0.14));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -10px 18px rgba(24, 32, 40, 0.08),
    0 0 0 2px rgba(255, 248, 236, 0.22),
    0 10px 22px rgba(16, 32, 45, 0.16);
}

.map-delete-can:focus-visible {
  outline: none;
  background:
    linear-gradient(180deg, rgba(255, 251, 244, 0.24), rgba(218, 223, 229, 0.14));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.26),
    inset 0 -10px 18px rgba(24, 32, 40, 0.08),
    0 0 0 2px rgba(255, 248, 236, 0.22),
    0 0 0 4px rgba(244, 212, 118, 0.38);
}

.map-delete-can.is-armed,
.map-delete-can.is-builder-armed {
  background:
    linear-gradient(180deg, rgba(132, 54, 46, 0.24), rgba(84, 30, 26, 0.18));
  border-color: rgba(107, 35, 29, 0.24);
}

.map-delete-can.is-armed:hover,
.map-delete-can.is-armed:focus-visible,
.map-delete-can.is-builder-armed:hover,
.map-delete-can.is-builder-armed:focus-visible {
  background:
    linear-gradient(180deg, rgba(132, 54, 46, 0.28), rgba(84, 30, 26, 0.22));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -10px 18px rgba(24, 32, 40, 0.08),
    0 0 0 2px rgba(107, 35, 29, 0.18),
    0 10px 22px rgba(16, 32, 45, 0.2);
}

.map-delete-can:disabled {
  opacity: 0.72;
  cursor: default;
}

.map-delete-can__image {
  display: block;
  width: 58px;
  height: auto;
  pointer-events: none;
  -webkit-user-drag: none;
}

.lmsa-campus-asset {
  --campus-rotation: 0deg;
  --campus-scale: 1;
  --campus-offset-x: 0px;
  --campus-offset-y: 0px;
  position: absolute;
  z-index: 1;
  transform:
    translate(
      calc(-50% + var(--campus-offset-x)),
      calc(-50% + var(--campus-offset-y))
    )
    rotate(var(--campus-rotation))
    scale(var(--campus-scale));
  transform-origin: center;
  pointer-events: none;
  user-select: none;
}

.lmsa-campus-asset--factory {
  --campus-offset-y: -24px;
  top: 49.2%;
  left: 55.4%;
  width: clamp(106px, 14.8%, 160px);
  overflow: visible;
}

.lmsa-campus-asset--stop-sign {
  top: 18%;
  left: 73%;
  width: clamp(36px, 4.8%, 56px);
}

.lmsa-stop-demand {
  position: absolute;
  left: 50%;
  top: -8px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.08rem;
  transform: translateX(-50%);
  text-shadow: none;
  pointer-events: none;
  white-space: nowrap;
}

.map-node--blue .lmsa-stop-demand,
.map-pickup-node .lmsa-stop-demand {
  top: -1.62rem;
  z-index: 2;
  gap: 0.14rem;
  text-shadow: none;
}

.lmsa-stop-demand__icon {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  overflow: hidden;
  filter: drop-shadow(0 1px 2px rgba(16, 32, 45, 0.2));
}

.lmsa-stop-demand__icon-image {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

.lmsa-stop-demand__count {
  color: #6b231d;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.01em;
}

.map-node--blue .lmsa-stop-demand__count,
.map-pickup-node .lmsa-stop-demand__count {
  color: #6b231d;
  letter-spacing: 0.02em;
  -webkit-text-stroke: 2px rgba(252, 245, 231, 0.98);
  paint-order: stroke fill;
  text-shadow: 0 1px 2px rgba(16, 32, 45, 0.16);
}

.lmsa-campus-asset__image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
  box-shadow: none;
  pointer-events: none;
  -webkit-user-drag: none;
}

.lmsa-campus-asset--factory .lmsa-campus-asset__image {
  border-radius: 0;
}

.lmsa-campus-asset--builder {
  z-index: 2;
}

.lmsa-campus-asset--dragging {
  cursor: grabbing;
}

.factory-confetti-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}

.factory-confetti-piece {
  position: absolute;
  left: var(--confetti-origin-x);
  top: var(--confetti-origin-y);
  width: var(--confetti-width);
  height: var(--confetti-height);
  border-radius: 2px;
  background: var(--confetti-color);
  box-shadow: 0 2px 6px rgba(16, 32, 45, 0.18);
  opacity: 0;
  transform: translate(-50%, 0) rotate(0deg) scale(0.6);
  animation: factory-confetti-pop var(--confetti-duration) ease-out var(--confetti-delay) forwards;
  will-change: transform, opacity;
}

.factory-confetti-piece:nth-child(3n) {
  border-radius: 999px;
}

@keyframes factory-confetti-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, 8px) rotate(0deg) scale(0.4);
  }

  12% {
    opacity: 1;
    transform:
      translate(
        -50%,
        -6px
      )
      rotate(calc(var(--confetti-rotate) * 0.18))
      scale(1);
  }

  100% {
    opacity: 0;
    transform:
      translate(
        calc(-50% + var(--confetti-drift-x)),
        var(--confetti-drift-y)
      )
      rotate(var(--confetti-rotate))
      scale(0.9);
  }
}

.map-node--1 {
  top: 26%;
  left: 18%;
}

.map-node--2 {
  top: 12%;
  left: 36%;
}

.map-node--3 {
  top: 8%;
  left: 56%;
}

.map-node--4 {
  top: 9%;
  left: 77%;
}

.map-node--5 {
  top: 47%;
  left: 15%;
}

.map-node--6 {
  top: 56%;
  left: 27%;
}

.map-node--7 {
  top: 55%;
  left: 44%;
}

.map-node--8 {
  top: 48%;
  left: 57%;
}

.map-node--9 {
  top: 40%;
  left: 69%;
}

.map-node--10 {
  top: 42%;
  left: 80%;
}

.map-node--11 {
  top: 82%;
  left: 31%;
}

.map-node--12 {
  top: 19%;
  left: 8%;
}

.map-node--13 {
  top: 33%;
  left: 31%;
}

.map-node--14 {
  top: 72%;
  left: 59%;
}

.map-node--15 {
  top: 68%;
  left: 84%;
}

.map-node--16 {
  top: 7%;
  left: 7%;
}

.map-node--17 {
  top: 0%;
  left: 10%;
}

.map-node--18 {
  top: 0%;
  left: 21%;
}

.map-node--19 {
  top: 0%;
  left: 32%;
}

.map-node--20 {
  top: 0%;
  left: 43%;
}

.map-node--21 {
  top: 0%;
  left: 55%;
}

.map-node--22 {
  top: 0%;
  left: 67%;
}

.map-node--23 {
  top: 0%;
  left: 79%;
}

.map-node--24 {
  top: 0%;
  left: 90%;
}

.map-node--25 {
  top: 18%;
  left: 100%;
}

.map-node--26 {
  top: 34%;
  left: 100%;
}

.map-node--27 {
  top: 50%;
  left: 100%;
}

.map-node--28 {
  top: 66%;
  left: 100%;
}

.map-node--29 {
  top: 82%;
  left: 100%;
}

.map-node--30 {
  top: 100%;
  left: 90%;
}

.map-node--31 {
  top: 100%;
  left: 75%;
}

.map-node--32 {
  top: 100%;
  left: 60%;
}

.map-node--33 {
  top: 100%;
  left: 45%;
}

.map-node--34 {
  top: 100%;
  left: 30%;
}

.map-node--35 {
  top: 100%;
  left: 15%;
}

.map-node--36 {
  top: 82%;
  left: 0%;
}

.map-node--37 {
  top: 66%;
  left: 0%;
}

.map-node--38 {
  top: 50%;
  left: 0%;
}

.map-node--39 {
  top: 34%;
  left: 0%;
}

.map-node--40 {
  top: 18%;
  left: 0%;
}

.road {
  position: absolute;
  border-radius: 999px;
  transform-origin: center;
}

.road::before,
.road::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.road::before {
  background: #93a1ab;
  box-shadow: 0 10px 18px rgba(16, 32, 45, 0.08);
}

.road::after {
  inset: 24%;
  background: rgba(247, 249, 250, 0.96);
}

.road.freeway {
  height: 24px;
  z-index: 2;
}

.road.freeway::before {
  background: linear-gradient(180deg, #2acb92, #119f73);
  box-shadow:
    0 14px 20px rgba(16, 32, 45, 0.1),
    inset 0 0 0 2px rgba(10, 101, 73, 0.22);
}

.road.freeway::after {
  inset: 47% 2% 47% 2%;
  background: rgba(255, 255, 255, 0.62);
}

.road.arterial {
  height: 15px;
  z-index: 2;
}

.road.arterial::before {
  background: linear-gradient(180deg, #37d39b, #12b07f);
  box-shadow:
    0 10px 16px rgba(16, 32, 45, 0.08),
    inset 0 0 0 2px rgba(13, 112, 82, 0.2);
}

.road.arterial::after {
  inset: 44% 3% 44% 3%;
  background:
    linear-gradient(90deg, rgba(245, 171, 58, 0.9) 0 16%, transparent 16% 23%, rgba(245, 171, 58, 0.9) 23% 39%, transparent 39% 100%);
  opacity: 0.7;
}

.road.local {
  height: 6px;
  z-index: 1;
}

.road.local::before {
  background: rgba(195, 204, 211, 0.95);
  box-shadow: none;
}

.road.local::after {
  inset: 40% 8%;
  background: rgba(255, 255, 255, 0.9);
}

.road--top-diagonal {
  top: 17%;
  left: -8%;
  width: 46%;
  transform: rotate(-17deg);
}

.road--top-eastwest {
  top: 14%;
  left: 32%;
  width: 54%;
}

.road--bottom-eastwest {
  bottom: 8%;
  left: -3%;
  width: 108%;
}

.road--west-vertical {
  top: 36%;
  left: -6%;
  width: 64%;
  transform: rotate(84deg);
}

.road--central-vertical {
  top: 39%;
  left: 42%;
  width: 46%;
  transform: rotate(83deg);
}

.road--right-vertical {
  top: 41%;
  right: -3%;
  width: 50%;
  transform: rotate(84deg);
}

.road--mid-diagonal {
  top: 34%;
  left: 52%;
  width: 22%;
  transform: rotate(-63deg);
}

.road--lower-diagonal {
  bottom: 23%;
  left: 43%;
  width: 24%;
  transform: rotate(-38deg);
}

.road--lower-west-east {
  bottom: 20%;
  left: -2%;
  width: 38%;
  transform: rotate(-7deg);
}

.road--lower-center-link {
  bottom: 18%;
  left: 30%;
  width: 22%;
  transform: rotate(-26deg);
}

.road--east-connector {
  bottom: 19%;
  right: 5%;
  width: 18%;
  transform: rotate(-8deg);
}

.road--local-1 {
  top: 26%;
  left: 21%;
  width: 17%;
  transform: rotate(-70deg);
}

.road--local-2 {
  top: 29%;
  left: 44%;
  width: 16%;
  transform: rotate(60deg);
}

.road--local-3 {
  top: 49%;
  left: 8%;
  width: 18%;
  transform: rotate(-76deg);
}

.road--local-4 {
  top: 54%;
  left: 64%;
  width: 15%;
  transform: rotate(-76deg);
}

.road--local-5 {
  bottom: 25%;
  left: 55%;
  width: 14%;
  transform: rotate(-66deg);
}

.road--local-6 {
  bottom: 27%;
  left: 72%;
  width: 12%;
  transform: rotate(-74deg);
}

.road--local-7 {
  bottom: 9%;
  left: 38%;
  width: 10%;
  transform: rotate(-86deg);
}

.route-bus {
  position: absolute;
  z-index: 2;
  top: 31%;
  left: 56%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--primary-end));
  box-shadow: 0 0 0 8px rgba(107, 35, 29, 0.08);
}

.legend {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  color: var(--muted);
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.legend__swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.legend__swatch--hq {
  background: var(--legend-hq);
  box-shadow: 0 0 0 4px var(--legend-hq-ring);
}

.legend__swatch--intersection {
  background: #6b231d;
  box-shadow: 0 0 0 4px rgba(107, 35, 29, 0.14);
}

.legend__swatch--demand {
  background: var(--warning);
  box-shadow: 0 0 0 4px var(--legend-customer-ring);
}

.legend__swatch--route {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--legend-stop-ring);
}

.objective-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  line-height: 1.8;
}

.map-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.results-layout,
.settings-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 1rem;
  align-items: start;
}

.about-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.88fr;
  gap: 1rem;
  align-items: start;
}

.about-main {
  display: grid;
  gap: 1rem;
  padding: 1.2rem;
}

.about-main:hover {
  transform: none;
  box-shadow: var(--shadow-lg);
}

.about-main h2 {
  margin: 0.2rem 0 0.2rem;
  font-size: clamp(1.9rem, 4vw, 2.55rem);
  font-family: "Candara", "Segoe UI", sans-serif;
}

.about-main__lede {
  color: var(--ink);
  font-size: 1.04rem;
  line-height: 1.78;
}

.about-formula {
  margin: 0;
  padding: 0.95rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(107, 35, 29, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 251, 246, 0.98), rgba(247, 236, 220, 0.98));
  color: var(--accent-dark);
  font-weight: 800;
  letter-spacing: 0.03em;
}

.about-bands {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.about-side {
  display: grid;
  gap: 1rem;
}

.about-card {
  padding: 1.15rem;
}

.about-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  line-height: 1.75;
}

.about-list li + li {
  margin-top: 0.45rem;
}

.results-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.results-side {
  display: grid;
  gap: 1rem;
}

.result-card {
  padding: 1.2rem;
}

.result-card strong {
  font-size: 1.95rem;
}

.settings-form {
  display: grid;
  gap: 1rem;
}

.field-group {
  display: grid;
  gap: 0.55rem;
}

.field-group label {
  font-weight: 700;
}

.field-group select {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--input-bg);
  color: var(--ink);
}

.settings-static {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-alt);
  color: var(--ink);
  font-weight: 700;
}

.setting-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-alt);
}

.setting-toggle__copy {
  display: grid;
  gap: 0.2rem;
}

.setting-toggle__copy > span {
  font-weight: 700;
}

.setting-toggle__copy small {
  color: var(--muted);
  line-height: 1.5;
}

.setting-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch {
  position: relative;
  flex-shrink: 0;
  width: 56px;
  height: 32px;
  border-radius: 999px;
  background: var(--switch-off);
  transition: background 0.2s ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--switch-knob);
  box-shadow: var(--switch-shadow);
  transition: transform 0.2s ease;
}

.setting-toggle input:checked + .switch {
  background: linear-gradient(135deg, var(--accent), var(--primary-end));
}

.setting-toggle input:checked + .switch::after {
  transform: translateX(24px);
}

.settings-actions,
.info-actions {
  margin-top: 0.25rem;
}

.settings-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.score-breakdown {
  display: grid;
  gap: 0.65rem;
}

.score-band {
  padding: 0.8rem 0.9rem;
  border-radius: 14px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
}

.score-band strong {
  display: block;
  margin-bottom: 0.25rem;
}

.score-band span {
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.88rem;
}

.info-card {
  padding: 1.2rem;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.info-card.is-highlighted {
  border-color: var(--theme-choice-active-border);
  box-shadow:
    0 0 0 4px var(--theme-choice-active-ring),
    var(--shadow-lg);
}

@media (max-width: 1120px) {
  .hero,
  .results-layout,
  .settings-layout,
  .about-layout,
  .info-grid,
  .guide-layout {
    grid-template-columns: 1fr;
  }

  .game-layout {
    grid-template-columns: 22fr 56fr 22fr;
  }

  .about-bands {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .level-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-bar {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 760px) {
  .game-victory-card {
    width: min(27.5rem, 100%);
    padding: 1.02rem 0.7rem 0.82rem;
  }

  .game-victory__scoreline {
    width: 95%;
  }

  .game-victory__track {
    width: calc(100% - 3.3rem);
  }

  .game-victory__actions {
    width: min(100%, 14.5rem);
    gap: 0.5rem;
  }

  .game-victory__heading {
    column-gap: 0.45rem;
  }

  .game-victory__top-button {
    max-width: 8.8rem;
    min-height: 2.56rem;
    font-size: 0.63rem;
    padding: 0.42rem 0.54rem;
    letter-spacing: 0.02em;
  }

  .game-victory__metrics,
  .game-victory__actions {
    grid-template-columns: 1fr;
  }

  .game-victory__star {
    width: 72px;
    height: 72px;
    font-size: 2.35rem;
  }

  .game-victory__star:nth-child(2) {
    width: 84px;
    height: 84px;
    font-size: 2.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-victory__delayed-reveal {
    transition: none;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 1rem, 1320px);
    margin: 0.5rem auto 1.5rem;
  }

  .site-header {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .screen-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .about-bands {
    grid-template-columns: 1fr;
  }

  .header-current,
  .header-actions {
    justify-self: start;
  }

  .hero {
    min-height: auto;
  }

  .hero__copy h2 {
    max-width: none;
  }

  .hero-metrics,
  .menu-grid,
  .level-grid,
  .results-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .hero__visual-actions {
    grid-template-columns: 1fr;
  }

  .play-demo__actions {
    width: 100%;
  }

  .play-demo__rail {
    grid-template-columns: 1fr;
    padding-top: 0;
  }

  .play-demo__line,
  .play-demo__bus {
    display: none;
  }

  .play-step {
    justify-items: start;
    text-align: left;
    grid-template-columns: auto 1fr;
    grid-template-areas: "dot title";
    column-gap: 0.75rem;
  }

  .play-step__dot {
    grid-area: dot;
    margin-top: 0.1rem;
  }

  .play-step strong {
    grid-area: title;
  }

  .top-bar {
    grid-template-columns: repeat(3, 1fr);
  }

  .map-stage--foundry {
    --map-status-overlay-clearance: 14rem;
  }

  .game-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .level-card__meta {
    grid-template-columns: 1fr;
  }

  .map-stage {
    min-height: 420px;
  }

  .button,
  .settings-actions .button,
  .button-row .button {
    width: 100%;
    justify-content: center;
    display: inline-flex;
  }

  .settings-actions,
  .button-row {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .site-brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-victory-card h2 {
    font-size: 1.2rem;
  }

  .game-victory__top-button {
    max-width: 7.9rem;
    min-height: 2.38rem;
    padding: 0.36rem 0.38rem;
    font-size: 0.56rem;
  }

  .header-current__label {
    letter-spacing: 0.12em;
  }

  .top-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .map-stage--foundry {
    --map-status-overlay-clearance: 19.75rem;
  }

  .map-stage::after,
  .intersection::after,
  .edge-demand::after {
    font-size: 0.7rem;
  }
}
