:root {
  color-scheme: dark;
  --ink: #070707;
  --ink-soft: #1c1a17;
  --cream: #f4ead8;
  --cream-2: #fff6e8;
  --paper-dim: #d8cbb7;
  --red: #d71920;
  --red-dark: #8f1117;
  --yellow: #f2c230;
  --cyan: #2aa7bd;
  --green: #52b269;
  --gray: #7f7a70;
  --shadow: #000;
  --body-font: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --display-font: "Microsoft YaHei", "PingFang SC", "Arial Black", sans-serif;
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --cut: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  background:
    linear-gradient(112deg, transparent 0 62%, rgba(215, 25, 32, 0.14) 62% 65%, transparent 65%),
    repeating-linear-gradient(-14deg, rgba(244, 234, 216, 0.045) 0 1px, transparent 1px 14px),
    radial-gradient(circle, rgba(244, 234, 216, 0.12) 1px, transparent 1.5px),
    var(--ink);
  background-size: auto, auto, 12px 12px, auto;
  color: var(--cream);
  font-family: var(--body-font);
}

button {
  font: inherit;
}

.app-shell {
  position: relative;
  min-height: 100svh;
  min-height: 100dvh;
  isolation: isolate;
}

.slash {
  position: fixed;
  z-index: -1;
  pointer-events: none;
}

.slash-a {
  width: 180px;
  height: 115vh;
  left: -92px;
  top: -6vh;
  background: var(--red);
  transform: skewX(-10deg);
}

.slash-b {
  width: 160px;
  height: 84vh;
  right: -92px;
  bottom: -18vh;
  background: rgba(244, 234, 216, 0.08);
  transform: skewX(-10deg);
}

.route-select[hidden],
.map-ui[hidden] {
  display: none;
}

.route-select {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100svh;
  padding: clamp(16px, 3vw, 38px);
  overflow: hidden;
}

.route-select::before {
  content: "ACCESS\A ROUTE";
  position: absolute;
  left: max(-22px, -2vw);
  bottom: -22px;
  color: rgba(244, 234, 216, 0.075);
  font-family: "Arial Black", var(--display-font);
  font-size: clamp(86px, 18vw, 226px);
  font-weight: 900;
  line-height: 0.78;
  white-space: pre;
  transform: rotate(-7deg);
  pointer-events: none;
}

.route-select::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(106deg, transparent 0 38%, rgba(215, 25, 32, 0.88) 38% 45%, transparent 45% 100%),
    linear-gradient(104deg, transparent 0 67%, rgba(242, 194, 48, 0.72) 67% 70%, transparent 70% 100%);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
  pointer-events: none;
}

.route-select-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(520px, 1.22fr);
  align-items: stretch;
  gap: clamp(18px, 3.1vw, 42px);
  width: min(1180px, 100%);
}

.route-select-copy {
  position: relative;
  min-height: 392px;
  padding: clamp(24px, 3vw, 38px);
  border: 3px solid var(--ink);
  background: var(--cream-2);
  color: var(--ink);
  box-shadow: 10px 10px 0 var(--shadow);
  clip-path: polygon(0 0, calc(100% - 34px) 0, 100% 34px, 100% 100%, 28px 100%, 0 calc(100% - 28px));
}

.route-select-copy::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 26px;
  width: 74px;
  height: calc(100% - 52px);
  background: var(--red);
  clip-path: polygon(0 0, 54% 0, 100% 12%, 48% 19%, 88% 32%, 32% 43%, 76% 58%, 28% 70%, 64% 100%, 0 100%);
  pointer-events: none;
}

.route-select-copy > * {
  position: relative;
  z-index: 1;
  margin-left: clamp(46px, 4.6vw, 72px);
}

.route-select-copy h1 {
  margin-top: 0;
  margin-bottom: 18px;
  font-family: var(--display-font);
  font-size: clamp(44px, 5.1vw, 74px);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: 0;
}

.route-select-copy p:last-child {
  max-width: 28em;
  margin-bottom: 0;
  color: #292622;
  font-size: clamp(15px, 1.35vw, 18px);
  font-weight: 800;
  line-height: 1.68;
}

.route-card-grid {
  display: grid;
  align-content: center;
  gap: clamp(13px, 1.9vw, 22px);
}

.route-card {
  position: relative;
  width: min(100%, 760px);
  min-height: clamp(128px, 18vh, 168px);
  padding: clamp(20px, 2.4vw, 28px) clamp(22px, 3.2vw, 42px);
  border: 3px solid var(--ink);
  background: var(--cream-2);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: 9px 9px 0 var(--shadow);
  clip-path: polygon(0 0, calc(100% - 44px) 0, 100% 24px, calc(100% - 18px) 100%, 28px 100%, 0 calc(100% - 30px));
  transition:
    transform 180ms var(--ease-out-quart),
    background-color 180ms var(--ease-out-quart),
    color 180ms var(--ease-out-quart);
}

.route-card:nth-child(2) {
  justify-self: end;
  width: min(96%, 720px);
}

.route-card:nth-child(3) {
  justify-self: center;
  width: min(98%, 740px);
}

.route-card::before {
  content: "";
  position: absolute;
  inset: 10px 12px;
  border: 2px solid currentColor;
  opacity: 0.98;
  clip-path: polygon(0 0, calc(100% - 30px) 0, 100% 18px, calc(100% - 16px) 100%, 18px 100%, 0 calc(100% - 18px));
  pointer-events: none;
}

.route-card::after {
  content: "SELECT";
  position: absolute;
  right: clamp(14px, 2vw, 24px);
  bottom: 10px;
  color: rgba(7, 7, 7, 0.12);
  font-family: "Arial Black", var(--display-font);
  font-size: clamp(42px, 5vw, 76px);
  font-weight: 900;
  line-height: 0.8;
  pointer-events: none;
}

.route-card span,
.route-card strong,
.route-card em {
  position: relative;
  z-index: 1;
  display: block;
}

.route-card span {
  color: var(--red);
  font-family: "Arial Black", var(--display-font);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.route-card strong {
  margin-top: 9px;
  font-family: var(--display-font);
  font-size: clamp(27px, 3.2vw, 42px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0;
}

.route-card em {
  max-width: 38em;
  margin-top: 10px;
  color: #332f29;
  font-size: clamp(13px, 1.1vw, 15px);
  font-style: normal;
  font-weight: 800;
  line-height: 1.48;
}

.route-card:hover,
.route-card:focus-visible {
  background: var(--red);
  color: var(--cream-2);
  outline: none;
  transform: translate(-5px, -5px);
}

.route-card:hover span,
.route-card:hover em,
.route-card:focus-visible span,
.route-card:focus-visible em {
  color: var(--cream-2);
}

.route-card:active {
  transform: translate(1px, 1px);
}

.map-ui {
  position: relative;
  display: grid;
  grid-template-columns: clamp(248px, 21vw, 300px) minmax(480px, 1fr) clamp(268px, 23vw, 322px);
  grid-template-rows: clamp(146px, 20vh, 172px) minmax(0, 1fr);
  gap: clamp(10px, 1.6vh, 18px);
  height: 100svh;
  min-height: 0;
  padding: clamp(14px, 2vh, 24px);
  overflow: hidden;
}

.brand-panel,
.hud-panel,
.command-panel,
.result-card,
.receipt-card {
  border: 3px solid var(--ink);
  background: var(--cream-2);
  color: var(--ink);
  box-shadow: 9px 9px 0 var(--shadow);
  clip-path: var(--cut);
}

.brand-panel {
  grid-column: 1 / 2;
  align-self: stretch;
  min-height: 0;
  padding: clamp(12px, 1.8vh, 18px) 18px clamp(12px, 2vh, 20px);
  border-left: 14px solid var(--red);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--red);
  font-family: "Arial Black", var(--body-font);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-panel h1 {
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(28px, 2.45vw, 36px);
  font-weight: 900;
  line-height: 0.96;
  letter-spacing: 0;
}

.brand-panel p:last-child {
  margin: clamp(7px, 1.1vh, 12px) 0 0;
  color: #2d2a25;
  font-size: clamp(11px, 0.92vw, 13px);
  font-weight: 800;
  line-height: 1.45;
}

.hud-panel {
  grid-column: 2 / 4;
  display: grid;
  grid-template-columns: repeat(3, minmax(130px, 1fr)) repeat(2, minmax(118px, 0.72fr));
  min-height: 0;
  overflow: hidden;
}

.meter,
.stat {
  position: relative;
  min-height: 0;
  padding: clamp(10px, 1.5vh, 14px) 16px;
  border-right: 3px solid var(--ink);
  background: linear-gradient(180deg, var(--cream-2), var(--cream));
}

.hud-panel > :first-child {
  padding-left: 20px;
}

.meter:last-child,
.stat:last-child {
  border-right: 0;
}

.meter span,
.stat span {
  display: block;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.meter b,
.stat b {
  display: block;
  margin-top: clamp(4px, 0.8vh, 7px);
  font-family: "Arial Black", var(--body-font);
  font-size: clamp(19px, 1.8vw, 24px);
  line-height: 1;
}

.meter i {
  display: block;
  width: 100%;
  height: clamp(7px, 1.1vh, 9px);
  margin-top: clamp(7px, 1.25vh, 12px);
  border: 2px solid var(--ink);
  background: var(--green);
  box-shadow: 3px 3px 0 var(--ink);
}

.meter[data-key="safety"] i {
  background: var(--cyan);
}

.meter[data-key="independence"] i {
  background: var(--yellow);
}

.map-stage {
  --map-ratio: 5 / 3;
  position: relative;
  grid-column: 1 / 3;
  grid-row: 2 / 3;
  min-height: 0;
  height: 100%;
  border: 4px solid var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 246, 232, 0.96), rgba(231, 219, 199, 0.92)),
    repeating-linear-gradient(0deg, rgba(7, 7, 7, 0.055) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(7, 7, 7, 0.055) 0 1px, transparent 1px 32px);
  box-shadow: 12px 12px 0 var(--shadow);
  clip-path: polygon(0 0, calc(100% - 34px) 0, 100% 34px, 100% calc(100% - 44px), calc(100% - 44px) 100%, 0 100%);
  overflow: hidden;
}

.map-stage.has-base-map {
  border-color: var(--cream-2);
  background:
    linear-gradient(135deg, rgba(64, 14, 18, 0.62), rgba(14, 12, 11, 0.96) 42%, rgba(32, 24, 19, 0.9)),
    var(--ink);
  box-shadow:
    0 0 0 4px var(--ink),
    13px 13px 0 var(--red),
    24px 24px 0 var(--shadow);
}

.map-stage::before {
  content: "ACCESS MAP";
  position: absolute;
  right: 24px;
  bottom: 20px;
  color: rgba(215, 25, 32, 0.12);
  font-family: "Arial Black", var(--body-font);
  font-size: 72px;
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: 0;
  pointer-events: none;
}

.map-stage::after {
  content: "";
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 26px;
  height: 10px;
  background: var(--ink);
  clip-path: polygon(0 0, 210px 0, 198px 100%, 0 100%);
  pointer-events: none;
}

.map-stage.has-base-map::before,
.map-stage.has-base-map::after {
  opacity: 1;
}

.map-stage.has-base-map::before {
  content: "TACTICAL MAP";
  z-index: 2;
  top: 12px;
  right: 16px;
  bottom: auto;
  padding: 8px 18px 9px;
  background: var(--red);
  color: var(--cream-2);
  font-size: 18px;
  line-height: 1;
  box-shadow: 5px 5px 0 var(--ink);
  clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 13px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.map-stage.has-base-map::after {
  z-index: 2;
  inset: 0;
  height: auto;
  background:
    linear-gradient(90deg, rgba(242, 194, 48, 0.92) 0 6px, transparent 6px),
    linear-gradient(180deg, rgba(215, 25, 32, 0.88) 0 8px, transparent 8px);
  box-shadow:
    inset 0 0 0 3px var(--ink),
    inset 0 0 0 9px rgba(255, 246, 232, 0.96),
    inset 0 0 0 13px var(--ink);
  clip-path: none;
}

.route-map {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.map-base-image,
.mini-map-base-image {
  opacity: 0.9;
  filter: contrast(1.06) saturate(0.86) brightness(1.08);
}

.map-stage.has-base-map .route.available,
.map-stage.has-base-map .route.passed {
  filter:
    drop-shadow(3px 3px 0 rgba(255, 246, 232, 0.78))
    drop-shadow(8px 8px 0 var(--ink));
}

.map-stage.has-base-map .route.available {
  stroke-width: 20;
}

.map-stage.has-base-map .route.locked {
  stroke: rgba(255, 246, 232, 0.24);
}

.map-stage.has-base-map .route.revealed {
  stroke: rgba(255, 246, 232, 0.38);
}

.map-stage.has-base-map .route.passed {
  stroke: var(--cream-2);
}

.map-stage.has-base-map .route.passed.risk {
  stroke: var(--red);
}

.map-stage.has-base-map .route.passed.detour {
  stroke: var(--yellow);
}

.map-stage.has-base-map .route.passed.assist {
  stroke: var(--cyan);
}

.map-stage.has-base-map .route.passed.blocked {
  stroke: var(--red-dark);
  stroke-dasharray: 24 14;
}

.map-stage.has-base-map .route.passed.return {
  stroke: var(--gray);
  stroke-dasharray: 18 14;
}

.map-stage.has-base-map .node.passed .node-core {
  fill: var(--cream-2);
}

.map-stage.has-base-map .node.locked {
  opacity: 0.16;
}

.route {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 180ms ease, stroke-width 180ms ease;
}

.route.locked {
  stroke: rgba(7, 7, 7, 0.18);
  stroke-width: 12;
  stroke-dasharray: 2 22;
}

.route.revealed {
  stroke: rgba(7, 7, 7, 0.36);
  stroke-width: 12;
  stroke-dasharray: 12 14;
}

.route.available {
  stroke: var(--red);
  stroke-width: 18;
  filter: url(#hardShadow);
}

.route.available.risk {
  stroke: var(--red-dark);
}

.route.available.assist {
  stroke: var(--cyan);
}

.route.available.detour {
  stroke: var(--yellow);
}

.route.available.blocked {
  stroke: var(--red-dark);
}

.route.available.return {
  stroke: var(--gray);
}

.route.passed {
  stroke: var(--ink);
  stroke-width: 18;
  filter: url(#hardShadow);
}

.route.passed.risk {
  stroke: var(--red-dark);
}

.route.passed.detour {
  stroke: var(--yellow);
}

.route.passed.assist {
  stroke: var(--cyan);
}

.route.passed.blocked {
  stroke: var(--red);
  stroke-dasharray: 24 14;
}

.route.passed.return {
  stroke: var(--gray);
  stroke-dasharray: 18 14;
}

.node {
  transition: opacity 160ms ease;
}

.node-hit {
  fill: transparent;
}

.node-core {
  stroke: var(--ink);
  stroke-width: 5;
}

.node-label {
  fill: var(--ink);
  paint-order: stroke;
  stroke: var(--cream-2);
  stroke-width: 7px;
  font-family: var(--display-font);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
}

.node.locked {
  opacity: 0.08;
}

.node.locked .node-core {
  fill: var(--ink);
}

.node.passed .node-core {
  fill: var(--paper-dim);
}

.node.current .node-core {
  fill: var(--red);
}

.node.available {
  cursor: pointer;
}

.node.available .node-core {
  fill: var(--yellow);
  animation: nodePulse 900ms steps(2, end) infinite;
  transform-box: fill-box;
  transform-origin: center;
}

.node.available:hover .node-core,
.node.available:focus .node-core {
  fill: var(--cream-2);
}

.node.portal {
  cursor: pointer;
  filter: drop-shadow(4px 5px 0 rgba(7, 7, 7, 0.82));
}

.node.portal .node-hit {
  fill: rgba(255, 246, 232, 0.02);
}

.portal-sticker {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 160ms ease, filter 160ms ease, opacity 160ms ease;
  filter:
    drop-shadow(5px 6px 0 rgba(7, 7, 7, 0.86))
    drop-shadow(0 0 12px rgba(242, 194, 48, 0.18));
}

.node.portal:hover .portal-sticker,
.node.portal:focus .portal-sticker {
  transform: scale(1.03) translateY(-2px);
  filter:
    drop-shadow(6px 7px 0 rgba(7, 7, 7, 0.9))
    drop-shadow(0 0 14px rgba(242, 194, 48, 0.24));
}

.avatar-sprite {
  animation: spriteJitter 380ms steps(2, end) infinite;
  transform-origin: center;
}

.avatar-shadow {
  fill: rgba(0, 0, 0, 0.22);
}

.wheel {
  fill: var(--cream-2);
  stroke: var(--ink);
  stroke-width: 6;
}

.chair {
  fill: var(--cyan);
  stroke: var(--ink);
  stroke-width: 5;
}

.body {
  fill: var(--red);
  stroke: var(--ink);
  stroke-width: 5;
}

.head {
  fill: var(--cream-2);
  stroke: var(--ink);
  stroke-width: 5;
}

.hair {
  fill: var(--ink);
}

.arm {
  fill: none;
  stroke: var(--ink);
  stroke-width: 6;
  stroke-linecap: round;
}

.node-tooltip {
  position: absolute;
  z-index: 3;
  min-width: 216px;
  max-width: 276px;
  padding: 12px 14px;
  border: 3px solid var(--ink);
  background: var(--ink);
  color: var(--cream);
  box-shadow: 6px 6px 0 var(--red);
  clip-path: var(--cut);
  transform: translate(20px, -110%);
  pointer-events: none;
}

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

.node-tooltip b,
.node-tooltip span,
.node-tooltip em {
  display: block;
}

.node-tooltip b {
  color: var(--yellow);
  font-family: var(--display-font);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.node-tooltip span {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 800;
}

.node-tooltip em {
  margin-top: 8px;
  color: var(--cyan);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.4;
}

.command-panel {
  grid-column: 3 / 4;
  grid-row: 2 / 3;
  align-self: stretch;
  min-height: 0;
  max-height: 100%;
  padding: clamp(14px, 2vh, 20px);
  border-top: 10px solid var(--red);
  overflow: auto;
  scrollbar-width: thin;
}

.command-panel h2 {
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(28px, 2.6vw, 36px);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: 0;
}

.command-panel p:not(.eyebrow) {
  margin: clamp(8px, 1.3vh, 12px) 0 clamp(10px, 1.8vh, 18px);
  color: #292622;
  font-size: clamp(12px, 1vw, 14px);
  font-weight: 800;
  line-height: 1.45;
}

.choice-strip {
  display: grid;
  gap: clamp(7px, 1.1vh, 10px);
}

.choice-pill,
.reset-button,
.primary-button,
.plain-button {
  border: 3px solid var(--ink);
  background: var(--cream-2);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: 5px 5px 0 var(--ink);
  clip-path: var(--cut);
}

.choice-pill {
  display: block;
  width: 100%;
  min-height: clamp(54px, 8.2vh, 72px);
  padding: clamp(9px, 1.4vh, 12px) 14px;
}

.choice-pill:hover,
.choice-pill:focus,
.primary-button:hover,
.plain-button:hover,
.reset-button:hover {
  transform: translate(-2px, -2px);
}

.choice-pill strong,
.choice-pill span {
  display: block;
}

.choice-pill strong {
  font-family: var(--display-font);
  font-size: clamp(17px, 1.45vw, 20px);
  font-weight: 900;
  line-height: 1.08;
}

.choice-pill span {
  margin-top: 3px;
  color: var(--red-dark);
  font-size: clamp(10px, 0.9vw, 12px);
  font-weight: 900;
}

.choice-pill.risk {
  background: var(--red);
  color: var(--cream-2);
}

.choice-pill.risk span {
  color: var(--cream-2);
}

.choice-pill.assist {
  background: var(--cyan);
}

.choice-pill.detour,
.choice-pill.final {
  background: var(--yellow);
}

.choice-pill.blocked {
  background: var(--red-dark);
  color: var(--cream-2);
}

.choice-pill.blocked span {
  color: var(--cream-2);
}

.choice-pill.return {
  background: var(--gray);
  color: var(--cream-2);
}

.choice-pill.return span {
  color: var(--cream-2);
}

.reset-button {
  width: 100%;
  margin-top: clamp(10px, 1.6vh, 18px);
  padding: clamp(9px, 1.3vh, 11px) 14px;
  background: var(--ink);
  color: var(--cream-2);
  text-align: center;
}

.result-overlay,
.receipt-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
}

.result-overlay[hidden],
.receipt-overlay[hidden] {
  display: none;
}

.video-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  background: var(--ink);
}

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

.video-card {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 620px;
  overflow: hidden;
  background: var(--ink);
  color: var(--cream-2);
}

.immersive-video::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: none;
}

.video-frame {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--ink);
}

.video-overlay.is-portrait-video .video-frame {
  background:
    radial-gradient(circle at 50% 44%, rgba(215, 25, 32, 0.22), transparent 34%),
    linear-gradient(90deg, rgba(7, 7, 7, 0.98) 0 17%, rgba(24, 20, 18, 0.86) 30%, rgba(24, 20, 18, 0.86) 70%, rgba(7, 7, 7, 0.98) 83% 100%),
    var(--ink);
}

.video-frame img,
.video-frame video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.18) saturate(0.9);
  transform: scale(1.012);
}

.video-overlay.is-portrait-video .video-frame video {
  object-fit: contain;
  filter: contrast(1.12) saturate(0.94);
  transform: none;
}

.video-overlay.is-portrait-video .video-frame img {
  object-fit: cover;
}

.video-frame img[hidden],
.video-frame video[hidden] {
  display: none !important;
}

.scanline {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 8px);
  mix-blend-mode: overlay;
  pointer-events: none;
}

.video-dim {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
}

.video-mini-map {
  position: absolute;
  z-index: 4;
  top: 26px;
  left: 26px;
  width: min(318px, 31vw);
  min-width: 242px;
  padding: 10px;
  border: 3px solid var(--cream-2);
  background: rgba(7, 7, 7, 0.74);
  color: var(--cream-2);
  box-shadow: 6px 6px 0 var(--red), 11px 11px 0 var(--shadow);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.mini-map-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mini-map-head .eyebrow {
  margin-bottom: 0;
  white-space: nowrap;
}

.mini-map-head b {
  color: var(--cream-2);
  font-size: 13px;
  font-weight: 900;
  text-align: right;
}

.mini-route-map {
  display: block;
  width: 100%;
  height: 138px;
  margin-top: 8px;
  border: 2px solid var(--cream-2);
  background:
    linear-gradient(135deg, rgba(7, 7, 7, 0.88), rgba(28, 26, 23, 0.68)),
    repeating-linear-gradient(0deg, rgba(255, 246, 232, 0.08) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(90deg, rgba(255, 246, 232, 0.08) 0 1px, transparent 1px 26px);
}

.mini-route {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini-route.muted {
  stroke: rgba(255, 246, 232, 0.2);
  stroke-width: 14;
  stroke-dasharray: 2 18;
}

.mini-route.available {
  stroke: rgba(215, 25, 32, 0.72);
  stroke-width: 15;
}

.mini-route.passed {
  stroke: rgba(255, 246, 232, 0.72);
  stroke-width: 16;
}

.mini-route.passed.risk {
  stroke: var(--red-dark);
}

.mini-route.passed.detour {
  stroke: var(--yellow);
}

.mini-route.passed.assist {
  stroke: var(--cyan);
}

.mini-route.passed.blocked {
  stroke: var(--red);
  stroke-dasharray: 20 12;
}

.mini-route.passed.return {
  stroke: var(--gray);
  stroke-dasharray: 16 10;
}

.mini-route.active {
  stroke: var(--red);
  stroke-width: 24;
  filter: url(#hardShadow);
}

.mini-route.active.risk,
.mini-route.active.blocked {
  stroke: var(--red);
}

.mini-route.active.detour {
  stroke: var(--yellow);
}

.mini-route.active.assist {
  stroke: var(--cyan);
}

.mini-route.active.return {
  stroke: var(--gray);
}

.mini-node circle {
  fill: rgba(255, 246, 232, 0.38);
}

.mini-node.passed circle {
  fill: var(--cream-2);
}

.mini-node.from circle {
  fill: var(--cream-2);
  stroke: var(--ink);
  stroke-width: 5;
}

.mini-node.to circle {
  fill: var(--yellow);
  stroke: var(--ink);
  stroke-width: 5;
}

.mini-node.portal circle {
  fill: rgba(242, 194, 48, 0.42);
  stroke: var(--cream-2);
  stroke-width: 3;
}

.mini-node.portal.passed circle {
  fill: rgba(255, 246, 232, 0.58);
}

.mini-avatar path {
  fill: var(--cyan);
  stroke: var(--ink);
  stroke-width: 5;
}

.mini-target path {
  fill: var(--yellow);
  stroke: var(--ink);
  stroke-width: 5;
}

.skip-button {
  position: absolute;
  z-index: 5;
  top: 30px;
  right: 34px;
  min-width: 104px;
  padding: 12px 18px;
  border: 3px solid var(--ink);
  background: var(--cream-2);
  color: var(--ink);
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 6px 6px 0 var(--shadow);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}

.skip-button:hover,
.skip-button:focus {
  transform: translate(-2px, -2px);
  background: var(--yellow);
}

.video-choice-panel {
  position: absolute;
  z-index: 5;
  right: clamp(26px, 4.2vw, 68px);
  bottom: clamp(12px, 3.2vh, 30px);
  width: min(340px, 27vw);
  min-width: 280px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--cream-2);
  box-shadow: none;
  clip-path: none;
  animation: p5ChoicePanelIn 260ms var(--ease-out-quint) both;
}

.video-choice-panel::before {
  display: none;
}

.video-choice-panel h3 {
  position: relative;
  z-index: 1;
  display: inline-block;
  margin: 0 0 10px 18px;
  padding: 7px 13px 8px;
  border: 3px solid var(--ink);
  background: var(--red);
  color: var(--cream-2);
  box-shadow: 4px 4px 0 var(--shadow);
  clip-path: polygon(0 0, calc(100% - 15px) 0, 100% 13px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  font-family: var(--display-font);
  font-size: 21px;
  font-weight: 900;
  line-height: 1.05;
}

.video-choice-panel .eyebrow {
  position: relative;
  z-index: 1;
  width: max-content;
  margin: 0 0 6px;
  padding: 4px 9px 5px;
  background: var(--ink);
  color: var(--yellow);
  box-shadow: 3px 3px 0 var(--red);
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.video-choice-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
}

.video-choice-button {
  position: relative;
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 10px 14px 10px 18px;
  border: 3px solid var(--cream-2);
  background: rgba(7, 7, 7, 0.88);
  color: var(--cream-2);
  cursor: pointer;
  text-align: left;
  box-shadow: 6px 6px 0 var(--shadow);
  clip-path: polygon(8px 0, calc(100% - 22px) 0, 100% 16px, calc(100% - 8px) 100%, 0 100%, 12px 50%);
  transform: skewX(-4deg);
  animation: p5ChoiceButtonIn 260ms var(--ease-out-quint) both;
}

.video-choice-button:nth-child(1) {
  animation-delay: 40ms;
}

.video-choice-button:nth-child(2) {
  animation-delay: 90ms;
}

.video-choice-button:nth-child(3) {
  animation-delay: 140ms;
}

.video-choice-button:hover,
.video-choice-button:focus-visible {
  outline: none;
  transform: translate(-3px, -3px) skewX(-4deg);
  background: var(--red);
  color: var(--cream-2);
}

.video-choice-button strong,
.video-choice-button span {
  display: block;
}

.video-choice-button strong {
  font-family: var(--display-font);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.12;
}

.video-choice-button span {
  margin-top: 5px;
  color: var(--paper-dim);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
}

.video-choice-button:hover span,
.video-choice-button:focus-visible span {
  color: var(--cream-2);
}

.video-choice-button.assist {
  border-color: var(--cyan);
}

.video-choice-button.rest,
.video-choice-button.detour {
  border-color: var(--yellow);
}

.video-choice-button.blocked {
  border-color: var(--red);
}

.video-choice-button.blocked span {
  color: var(--cream-2);
}

.video-choice-panel.is-video-skipped .video-choice-button {
  box-shadow: 6px 6px 0 var(--red);
}

.dialogue-box {
  position: absolute;
  z-index: 4;
  left: max(28px, 5vw);
  bottom: max(28px, 5vh);
  display: grid;
  grid-template-columns: 252px minmax(520px, 780px);
  align-items: end;
  width: min(1010px, 90vw);
  pointer-events: none;
}

.dialogue-portrait-card {
  position: relative;
  z-index: 2;
  width: 238px;
  height: 238px;
  transform: translate(22px, 10px) rotate(-4deg);
  filter: drop-shadow(8px 9px 0 #000);
}

.dialogue-portrait-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.dialogue-bubble-frame {
  position: relative;
  z-index: 4;
  min-height: 172px;
  padding: 0;
  background: transparent;
  filter: drop-shadow(10px 10px 0 #000);
  overflow: visible;
  transform: translateX(42px);
}

.dialogue-shell {
  position: absolute;
  z-index: 1;
  inset: -42px -40px -22px -118px;
  width: calc(100% + 156px);
  height: calc(100% + 64px);
  overflow: visible;
  pointer-events: none;
}

.dialogue-shell-main,
.dialogue-shell-top,
.dialogue-shell-right {
  fill: var(--cream-2);
  stroke: var(--ink);
  stroke-width: 3.8px;
  stroke-linejoin: miter;
  vector-effect: non-scaling-stroke;
}

.dialogue-shell-fill {
  fill: var(--ink);
  stroke: none;
}

.dialogue-shell-top,
.dialogue-shell-right {
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform;
}

.dialogue-shell-tail-outline,
.dialogue-shell-tail-border,
.dialogue-shell-tail-core {
  fill: none;
  stroke-linecap: square;
  vector-effect: non-scaling-stroke;
}

.dialogue-shell-tail-outline {
  stroke: var(--ink);
}

.dialogue-shell-tail-border {
  stroke: var(--cream-2);
}

.dialogue-shell-tail-core {
  stroke: var(--ink);
}

.dialogue-shell-tail-outline.tail-segment-a {
  stroke-width: 25px;
}

.dialogue-shell-tail-outline.tail-segment-b {
  stroke-width: 21px;
}

.dialogue-shell-tail-outline.tail-segment-c {
  stroke-width: 28px;
}

.dialogue-shell-tail-border.tail-segment-a {
  stroke-width: 17px;
}

.dialogue-shell-tail-border.tail-segment-b {
  stroke-width: 13px;
}

.dialogue-shell-tail-border.tail-segment-c {
  stroke-width: 20px;
}

.dialogue-shell-tail-core.tail-segment-a {
  stroke-width: 7px;
}

.dialogue-shell-tail-core.tail-segment-b {
  stroke-width: 5px;
}

.dialogue-shell-tail-core.tail-segment-c {
  stroke-width: 9px;
}

.dialogue-shell-top {
  animation: p5TopShard 2400ms var(--ease-out-quint) infinite alternate;
}

.dialogue-shell-right {
  animation: p5RightShard 2100ms var(--ease-out-quart) infinite alternate;
}

.dialogue-bubble {
  position: relative;
  z-index: 2;
  min-height: 154px;
  padding: 36px 78px 36px 92px;
  background: transparent;
  color: var(--cream-2);
}

.dialogue-speaker {
  margin: 0 0 8px;
  color: var(--red);
  font-family: "Arial Black", var(--body-font);
  font-size: 13px;
  line-height: 1.2;
  text-transform: uppercase;
}

.dialogue-bubble h3,
.result-card h3,
.receipt-card h3 {
  margin: 8px 0 8px;
  font-family: var(--display-font);
  font-size: 36px;
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: 0;
}

.dialogue-bubble h3 {
  margin: 6px 0 6px;
  font-size: 34px;
  line-height: 1.2;
}

.dialogue-bubble p:not(.dialogue-speaker),
.result-card p,
.receipt-card p {
  margin: 0;
  color: var(--cream-2);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.65;
}

.dialogue-bubble p:not(.dialogue-speaker) {
  font-size: 14px;
  line-height: 1.45;
}

.dialogue-bubble p.is-typing::after {
  content: "";
  display: inline-block;
  width: 0.64em;
  height: 1em;
  margin-left: 4px;
  background: var(--red);
  vertical-align: -0.14em;
  animation: terminalCursor 720ms steps(1, end) infinite;
}

#resultNote,
#receiptSummary {
  color: #292622;
  font-weight: 800;
  line-height: 1.55;
}

#resultNote {
  max-width: 58em;
  margin: 10px 0 16px;
}

.video-progress {
  position: absolute;
  z-index: 4;
  left: 104px;
  right: 146px;
  bottom: -22px;
  height: 10px;
  margin-top: 0;
  overflow: hidden;
  border: 2px solid var(--cream-2);
  background: rgba(255, 246, 232, 0.14);
  box-shadow: 4px 4px 0 var(--ink);
  transform: skewX(-8deg);
}

.video-progress i {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--red);
  transform-origin: left center;
  transition: width 120ms linear;
}

.result-card,
.receipt-card {
  width: min(720px, 100%);
  padding: 24px;
  border-top: 10px solid var(--red);
}

.delta-grid,
.receipt-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.delta-item,
.receipt-item {
  min-height: 88px;
  padding: 12px;
  border: 3px solid var(--ink);
  background: var(--cream-2);
  box-shadow: 4px 4px 0 var(--ink);
}

.delta-item span,
.receipt-item span {
  display: block;
  color: var(--red);
  font-family: "Arial Black", var(--body-font);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.delta-item b,
.receipt-item b {
  display: block;
  margin-top: 7px;
  font-family: "Arial Black", var(--body-font);
  font-size: 28px;
}

.delta-item.loss b {
  color: var(--red);
}

.delta-item.gain b {
  color: #07873d;
}

.primary-button,
.plain-button {
  display: inline-block;
  padding: 11px 16px;
  background: var(--red);
  color: var(--cream-2);
  text-align: center;
}

.plain-button {
  background: var(--cream-2);
  color: var(--ink);
}

.receipt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

@keyframes nodePulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes spriteJitter {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(2px, -2px) rotate(-1deg);
  }
}

@keyframes p5TopShard {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(3px, -2px) rotate(-0.8deg);
  }
}

@keyframes p5RightShard {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  52% {
    transform: translate(4px, -1px) rotate(1deg);
  }
}

@keyframes p5ChoicePanelIn {
  0% {
    opacity: 0;
    transform: translate(24px, 18px) skewX(-2deg);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) skewX(0deg);
  }
}

@keyframes p5ChoiceButtonIn {
  0% {
    opacity: 0;
    transform: translate(30px, 10px) skewX(-4deg);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) skewX(-4deg);
  }
}

@keyframes terminalCursor {
  0%, 48% {
    opacity: 1;
  }
  49%, 100% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1100px) {
  .route-select {
    align-items: start;
    padding: 18px;
    overflow: auto;
  }

  .route-select-panel {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .route-select-copy {
    min-height: auto;
    padding: 24px;
  }

  .route-select-copy h1 {
    font-size: 46px;
  }

  .route-card-grid {
    gap: 13px;
  }

  .route-card,
  .route-card:nth-child(2),
  .route-card:nth-child(3) {
    justify-self: stretch;
    width: 100%;
    min-height: 122px;
  }

  .map-ui {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    height: auto;
    min-height: 100svh;
    overflow: visible;
    padding: 16px;
  }

  .brand-panel,
  .hud-panel,
  .map-stage,
  .command-panel {
    grid-column: 1 / 2;
    grid-row: auto;
  }

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

  .map-stage,
  .route-map {
    min-height: 500px;
  }
}

@media (max-width: 640px) {
  .route-select {
    padding: 12px;
  }

  .route-select::before {
    font-size: 92px;
    left: -18px;
    bottom: 12px;
  }

  .route-select::after {
    background:
      linear-gradient(108deg, transparent 0 58%, rgba(215, 25, 32, 0.78) 58% 68%, transparent 68% 100%),
      linear-gradient(102deg, transparent 0 28%, rgba(242, 194, 48, 0.62) 28% 32%, transparent 32% 100%);
  }

  .route-select-copy {
    padding: 20px 18px;
    box-shadow: 6px 6px 0 var(--shadow);
  }

  .route-select-copy::before {
    left: -6px;
    top: 22px;
    width: 44px;
    height: calc(100% - 44px);
  }

  .route-select-copy > * {
    margin-left: 32px;
  }

  .route-select-copy h1 {
    margin-bottom: 12px;
    font-size: 36px;
    line-height: 0.96;
  }

  .route-select-copy p:last-child {
    font-size: 14px;
    line-height: 1.55;
  }

  .route-card {
    min-height: 118px;
    padding: 18px 18px 20px;
    box-shadow: 6px 6px 0 var(--shadow);
  }

  .route-card::before {
    inset: 8px 9px;
  }

  .route-card::after {
    right: 10px;
    bottom: 8px;
    font-size: 42px;
  }

  .route-card span {
    font-size: 12px;
  }

  .route-card strong {
    font-size: 26px;
  }

  .route-card em {
    font-size: 13px;
    line-height: 1.4;
  }

  .map-ui {
    padding: 14px;
  }

  .brand-panel h1 {
    font-size: 32px;
  }

  .hud-panel {
    grid-template-columns: 1fr;
  }

  .meter,
  .stat {
    min-height: 68px;
    border-right: 0;
    border-bottom: 3px solid var(--ink);
  }

  .hud-panel > :first-child {
    padding-left: 16px;
  }

  .map-stage,
  .route-map {
    min-height: 430px;
  }

  .node-label {
    font-size: 28px;
  }

  .command-panel h2,
  .dialogue-bubble h3,
  .result-card h3,
  .receipt-card h3 {
    font-size: 32px;
  }

  .video-frame {
    height: 230px;
  }

  .video-card {
    height: 100vh;
    min-height: 100vh;
  }

  .video-frame {
    position: absolute;
    inset: 0;
    height: auto;
  }

  .video-mini-map {
    top: 14px;
    left: 14px;
    width: 240px;
    min-width: 0;
    padding: 9px;
  }

  .mini-route-map {
    height: 112px;
  }

  .mini-map-head {
    display: block;
  }

  .mini-map-head b {
    display: block;
    margin-top: 4px;
    text-align: left;
  }

  .skip-button {
    top: 18px;
    right: 16px;
    min-width: 82px;
    padding: 10px 13px;
    font-size: 16px;
  }

  .video-choice-panel {
    top: auto;
    bottom: 96px;
    right: 14px;
    width: min(238px, calc(100vw - 28px));
    min-width: 0;
    padding: 0;
  }

  .video-choice-panel h3 {
    margin: 0 0 8px 10px;
    font-size: 20px;
  }

  .video-choice-list {
    gap: 7px;
  }

  .video-choice-button {
    min-height: 50px;
    padding: 8px 10px 8px 12px;
  }

  .video-choice-button strong {
    font-size: 15px;
  }

  .video-choice-button span {
    font-size: 10px;
  }

  .dialogue-box {
    left: 14px;
    right: 14px;
    bottom: 18px;
    grid-template-columns: 98px minmax(0, 1fr);
    width: auto;
  }

  .dialogue-portrait-card {
    z-index: 6;
    width: 118px;
    height: 118px;
    transform: translate(-2px, 14px) rotate(-4deg);
  }

  .dialogue-bubble-frame {
    min-height: 150px;
    transform: translateX(0);
  }

  .dialogue-shell {
    inset: -30px -22px -16px -72px;
    width: calc(100% + 94px);
    height: calc(100% + 46px);
  }

  .dialogue-bubble {
    min-height: 132px;
    padding: 32px 52px 28px 50px;
  }

  .dialogue-speaker {
    margin-bottom: 5px;
    font-size: 10px;
  }

  .dialogue-bubble h3 {
    margin: 4px 0 5px;
    font-size: 28px;
    line-height: 1.25;
  }

  .dialogue-bubble p:not(.dialogue-speaker) {
    font-size: 12px;
    line-height: 1.35;
  }

  .video-progress {
    left: 58px;
    right: 74px;
    bottom: -15px;
    height: 8px;
    border-width: 2px;
    box-shadow: 3px 3px 0 var(--ink);
  }

  .delta-grid,
  .receipt-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
  }

  button,
  [role="button"] {
    -webkit-tap-highlight-color: rgba(215, 25, 32, 0.35);
    touch-action: manipulation;
  }

  .route-select {
    min-height: 100dvh;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .route-select-panel {
    gap: 12px;
  }

  .route-select-copy,
  .route-card,
  .brand-panel,
  .hud-panel,
  .command-panel,
  .result-card,
  .receipt-card {
    box-shadow: 6px 6px 0 var(--shadow);
  }

  .route-select-copy > * {
    margin-left: 24px;
  }

  .route-card-grid {
    gap: 10px;
  }

  .route-card {
    min-height: 108px;
    padding: 16px 16px 18px;
  }

  .route-card::after {
    right: 8px;
    bottom: 6px;
    z-index: 0;
    color: rgba(7, 7, 7, 0.05);
    font-size: 34px;
  }

  .route-card strong {
    font-size: clamp(22px, 7vw, 28px);
    line-height: 1.08;
  }

  .route-card em {
    max-width: 88%;
  }

  .map-ui {
    min-height: 100dvh;
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
    gap: 10px;
  }

  .brand-panel {
    padding: 12px 14px 13px;
    border-left-width: 10px;
  }

  .brand-panel h1 {
    font-size: clamp(26px, 8vw, 32px);
  }

  .brand-panel p:last-child {
    font-size: 12px;
    line-height: 1.38;
  }

  .hud-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
  }

  .meter,
  .stat {
    min-height: 52px;
    padding: 8px 10px 9px;
    border-right: 3px solid var(--ink);
    border-bottom: 3px solid var(--ink);
  }

  .hud-panel > :nth-child(3n) {
    border-right: 0;
  }

  .hud-panel > :nth-child(n + 4) {
    border-bottom: 0;
  }

  .hud-panel > :last-child {
    grid-column: span 2;
    border-right: 0;
  }

  .hud-panel > :first-child {
    padding-left: 10px;
  }

  .meter span,
  .stat span {
    font-size: 10px;
  }

  .meter b,
  .stat b {
    margin-top: 4px;
    font-size: 18px;
  }

  .meter i {
    height: 7px;
    margin-top: 7px;
  }

  .map-stage {
    justify-self: stretch;
    width: 100%;
    max-width: 100%;
    height: auto;
    height: clamp(330px, 48dvh, 460px);
    min-height: 0;
    aspect-ratio: auto;
    box-shadow: 7px 7px 0 var(--shadow);
  }

  .map-stage.is-portrait-map {
    height: clamp(390px, 56dvh, 520px);
    min-height: 0;
  }

  .map-stage.has-base-map {
    box-shadow:
      0 0 0 3px var(--ink),
      7px 7px 0 var(--red),
      13px 13px 0 var(--shadow);
  }

  .map-stage.has-base-map::before {
    top: 8px;
    right: 9px;
    padding: 6px 10px 7px;
    font-size: 12px;
    box-shadow: 3px 3px 0 var(--ink);
  }

  .map-stage.has-base-map::after {
    box-shadow:
      inset 0 0 0 2px var(--ink),
      inset 0 0 0 6px rgba(255, 246, 232, 0.96),
      inset 0 0 0 9px var(--ink);
  }

  .map-stage,
  .route-map {
    min-width: 0;
  }

  .route-map {
    min-height: 0;
    height: 100%;
  }

  .node-label {
    font-size: 24px;
  }

  .portal-sticker {
    pointer-events: none;
  }

  .command-panel {
    padding: 12px;
    border-top-width: 8px;
    max-height: none;
    overflow: visible;
  }

  .command-panel h2 {
    font-size: clamp(24px, 7vw, 30px);
  }

  .command-panel p:not(.eyebrow) {
    margin: 8px 0 10px;
    font-size: 12px;
    line-height: 1.42;
  }

  .choice-strip {
    gap: 8px;
  }

  .choice-pill {
    min-height: 50px;
    padding: 9px 12px;
    box-shadow: 4px 4px 0 var(--ink);
  }

  .choice-pill strong {
    font-size: 18px;
  }

  .choice-pill span {
    font-size: 11px;
    line-height: 1.28;
  }

  .reset-button {
    margin-top: 10px;
    padding: 9px 12px;
    box-shadow: 4px 4px 0 var(--ink);
  }

  .video-overlay {
    overflow: hidden;
  }

  .video-card {
    height: 100dvh;
    min-height: 100dvh;
  }

  .video-frame img,
  .video-frame video {
    transform: none;
  }

  .video-mini-map {
    top: max(10px, env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
    width: min(184px, 46vw);
    min-width: 0;
    padding: 7px;
    border-width: 2px;
    box-shadow: 4px 4px 0 var(--red), 7px 7px 0 var(--shadow);
  }

  .mini-map-head .eyebrow {
    font-size: 9px;
  }

  .mini-map-head b {
    font-size: 10px;
    line-height: 1.25;
  }

  .mini-route-map {
    height: 82px;
    margin-top: 5px;
  }

  .skip-button {
    top: max(12px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    min-width: 70px;
    padding: 9px 11px;
    border-width: 2px;
    font-size: 14px;
    box-shadow: 4px 4px 0 var(--shadow);
  }

  .video-choice-panel {
    left: max(14px, env(safe-area-inset-left));
    right: max(14px, env(safe-area-inset-right));
    bottom: clamp(158px, 23dvh, 214px);
    width: auto;
    min-width: 0;
  }

  .video-choice-panel .eyebrow {
    margin-bottom: 5px;
    padding: 3px 7px 4px;
    font-size: 9px;
    box-shadow: 2px 2px 0 var(--red);
  }

  .video-choice-panel h3 {
    margin: 0 0 7px 10px;
    padding: 6px 10px 7px;
    border-width: 2px;
    font-size: 18px;
    box-shadow: 3px 3px 0 var(--shadow);
  }

  .video-choice-list {
    gap: 6px;
  }

  .video-choice-button {
    min-height: 46px;
    padding: 8px 10px 8px 14px;
    border-width: 2px;
    box-shadow: 4px 4px 0 var(--shadow);
  }

  .video-choice-button strong {
    font-size: 14px;
    line-height: 1.12;
  }

  .video-choice-button span {
    margin-top: 3px;
    font-size: 10px;
  }

  .dialogue-box {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    grid-template-columns: 70px minmax(0, 1fr);
    width: auto;
  }

  .dialogue-portrait-card {
    z-index: 7;
    width: 96px;
    height: 96px;
    transform: translate(-5px, 10px) rotate(-4deg);
    filter: drop-shadow(5px 6px 0 #000);
  }

  .dialogue-bubble-frame {
    min-height: 126px;
    filter: drop-shadow(6px 6px 0 #000);
    transform: translateX(0);
  }

  .dialogue-shell {
    inset: -26px -18px -14px -58px;
    width: calc(100% + 76px);
    height: calc(100% + 40px);
  }

  .dialogue-bubble {
    min-height: 116px;
    padding: 28px 42px 24px 34px;
  }

  .dialogue-speaker {
    margin-bottom: 4px;
    font-size: 9px;
  }

  .dialogue-bubble h3 {
    margin: 3px 0 4px;
    font-size: clamp(20px, 6vw, 26px);
    line-height: 1.18;
  }

  .dialogue-bubble p:not(.dialogue-speaker) {
    font-size: 11px;
    line-height: 1.36;
  }

  .video-progress {
    left: 42px;
    right: 54px;
    bottom: -12px;
    height: 7px;
    box-shadow: 3px 3px 0 var(--ink);
  }

  .result-overlay,
  .receipt-overlay {
    align-items: center;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .result-card,
  .receipt-card {
    width: 100%;
    max-width: calc(100vw - 36px);
    max-height: calc(100dvh - 24px);
    padding: 18px;
    overflow: auto;
    border-top-width: 8px;
  }

  .result-card h3,
  .receipt-card h3 {
    font-size: clamp(25px, 8vw, 32px);
    line-height: 1.1;
  }

  #resultNote,
  #receiptSummary {
    font-size: 12px;
    line-height: 1.45;
  }

  .delta-grid,
  .receipt-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 12px 0;
  }

  .delta-item,
  .receipt-item {
    min-height: 74px;
    padding: 10px;
    border-width: 2px;
    box-shadow: 3px 3px 0 var(--ink);
  }

  .delta-item span,
  .receipt-item span {
    font-size: 10px;
  }

  .delta-item b,
  .receipt-item b {
    margin-top: 5px;
    font-size: 22px;
  }

  .receipt-actions {
    gap: 8px;
    margin-top: 12px;
  }

  .primary-button,
  .plain-button {
    flex: 1 1 130px;
    padding: 10px 12px;
    text-align: center;
    box-shadow: 4px 4px 0 var(--ink);
  }
}

@media (max-width: 430px) {
  .slash-a {
    left: -128px;
  }

  .slash-b {
    right: -124px;
  }

  .route-select-copy {
    padding: 17px 15px;
  }

  .route-select-copy h1 {
    font-size: clamp(30px, 10vw, 36px);
  }

  .route-select-copy p:last-child {
    font-size: 13px;
  }

  .route-card {
    min-height: 100px;
    padding: 14px 14px 16px;
  }

  .route-card::after {
    font-size: 34px;
  }

  .route-card strong {
    font-size: clamp(20px, 6.6vw, 24px);
  }

  .route-card em {
    max-width: 92%;
    font-size: 12px;
  }

  .brand-panel {
    padding: 10px 12px 11px;
  }

  .brand-panel h1 {
    font-size: clamp(24px, 7.8vw, 29px);
  }

  .eyebrow {
    margin-bottom: 6px;
    font-size: 10px;
  }

  .meter,
  .stat {
    min-height: 48px;
    padding: 7px 9px;
  }

  .map-stage {
    height: clamp(310px, 45dvh, 420px);
  }

  .map-stage.is-portrait-map {
    height: clamp(372px, 54dvh, 500px);
  }

  .command-panel {
    padding: 11px;
  }

  .choice-pill strong {
    font-size: 16px;
  }

  .video-mini-map {
    width: min(160px, 43vw);
  }

  .mini-route-map {
    height: 68px;
  }

  .video-choice-panel {
    bottom: clamp(148px, 22dvh, 190px);
  }

  .video-choice-panel h3 {
    font-size: 16px;
  }

  .video-choice-button {
    min-height: 43px;
  }

  .dialogue-box {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .dialogue-portrait-card {
    width: 86px;
    height: 86px;
    transform: translate(-5px, 8px) rotate(-4deg);
  }

  .dialogue-bubble-frame {
    min-height: 112px;
  }

  .dialogue-bubble {
    min-height: 104px;
    padding: 25px 36px 21px 31px;
  }

  .dialogue-bubble h3 {
    font-size: clamp(18px, 5.8vw, 23px);
  }

  .dialogue-bubble p:not(.dialogue-speaker) {
    font-size: 10.5px;
  }

  .video-progress {
    left: 36px;
    right: 48px;
  }
}

@media (max-width: 360px) {
  .delta-grid,
  .receipt-grid {
    grid-template-columns: 1fr;
  }

  .video-choice-panel {
    bottom: clamp(142px, 22dvh, 176px);
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .video-mini-map {
    width: 150px;
  }

  .mini-route-map {
    height: 54px;
  }

  .video-choice-panel {
    left: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: 18px;
    width: min(300px, 34vw);
  }

  .dialogue-box {
    left: max(10px, env(safe-area-inset-left));
    right: auto;
    bottom: max(10px, env(safe-area-inset-bottom));
    grid-template-columns: 58px minmax(300px, 52vw);
  }

  .dialogue-portrait-card {
    width: 78px;
    height: 78px;
  }

  .dialogue-bubble-frame {
    min-height: 96px;
  }

  .dialogue-bubble {
    min-height: 90px;
    padding: 22px 36px 18px 30px;
  }

  .dialogue-bubble h3 {
    font-size: 20px;
  }

  .dialogue-bubble p:not(.dialogue-speaker) {
    font-size: 10px;
  }
}
