:root {
  color-scheme: light;
  --ink: #17304a;
  --ink-soft: #40627c;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-strong: rgba(255, 255, 255, 0.96);
  --line: rgba(35, 70, 100, 0.16);
  --gold: #ffbf2e;
  --rose: #ff5b7f;
  --leaf: #32a871;
  --sky: #4bb8ff;
  --blue: #1a75d2;
  --route-accent: #ff5b9a;
  --route-secondary: #ffbf2e;
  --route-trim: #8edbff;
  --route-ground: #ffe8f4;
  --route-ink: #7d2555;
  --route-surface: #fff8fb;
  --shadow: 0 18px 44px rgba(34, 60, 82, 0.22);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #87d7ff;
  color: var(--ink);
  font-family:
    "Trebuchet MS",
    "Segoe UI",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
}

button {
  border: 0;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 4px solid rgba(255, 191, 46, 0.72);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
}

.game-shell {
  position: relative;
  width: 100vw;
  height: 100dvh;
  min-height: 520px;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 9%, rgba(255, 255, 255, 0.62), transparent 19%),
    linear-gradient(180deg, #62c7ff 0%, #e4f7ff 52%, #75d56b 100%);
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.loading-panel {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(123, 210, 255, 0.18), rgba(255, 255, 255, 0.16)),
    rgba(15, 78, 116, 0.2);
  backdrop-filter: blur(8px);
}

.loading-panel.is-hidden {
  display: none;
}

.loading-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  width: min(380px, calc(100vw - 40px));
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  text-align: center;
}

.loading-card img {
  width: 150px;
  height: 76px;
  object-fit: contain;
  filter: drop-shadow(0 7px 0 rgba(36, 72, 92, 0.12));
}

.loading-kicker {
  color: #b54362;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.loading-card strong {
  color: #104f95;
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  line-height: 1.02;
}

.loading-track {
  position: relative;
  width: min(260px, 100%);
  height: 14px;
  overflow: hidden;
  border: 2px solid rgba(20, 70, 110, 0.16);
  border-radius: 999px;
  background: rgba(32, 110, 161, 0.12);
}

.loading-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), var(--gold), var(--leaf), var(--sky));
  transition: width 160ms ease;
}

.loading-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
  font-weight: 800;
}

.hud {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(138px, auto) minmax(280px, 520px) auto;
  gap: 12px;
  align-items: stretch;
  pointer-events: none;
}

.game-shell.is-playing .hud,
.game-shell.is-paused .hud {
  top: max(10px, env(safe-area-inset-top));
  grid-template-columns: minmax(180px, 260px) minmax(330px, 520px) minmax(230px, 310px);
  justify-content: space-between;
  gap: 10px;
}

.brand-block,
.stat-grid,
.spark-row,
.start-content {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(1.18);
}

.brand-block {
  min-height: 70px;
  padding: 9px 14px 10px;
  border-radius: 8px;
}

.game-shell.is-playing .brand-block,
.game-shell.is-playing .stat-grid,
.game-shell.is-playing .spark-row,
.game-shell.is-paused .brand-block,
.game-shell.is-paused .stat-grid,
.game-shell.is-paused .spark-row {
  min-height: 58px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow:
    0 10px 28px rgba(8, 28, 54, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px) saturate(1.08);
}

.game-shell.is-playing .brand-block,
.game-shell.is-paused .brand-block {
  padding: 8px 12px;
}

.kicker {
  margin: 0 0 1px;
  color: #b54362;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.45rem, 2.4vw, 2.05rem);
  line-height: 0.96;
  color: #104f95;
}

.game-shell.is-playing h1,
.game-shell.is-paused h1 {
  font-size: clamp(1.28rem, 1.8vw, 1.72rem);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 70px;
  border-radius: 8px;
  overflow: hidden;
}

.stat {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 8px 13px;
  border-right: 1px solid var(--line);
}

.game-shell.is-playing .stat,
.game-shell.is-paused .stat {
  padding: 7px 11px;
}

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

.stat-label {
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.stat strong {
  min-width: 4ch;
  color: #123b6a;
  font-size: clamp(1.42rem, 2.4vw, 2.15rem);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.game-shell.is-playing .stat strong,
.game-shell.is-paused .stat strong {
  font-size: clamp(1.28rem, 1.9vw, 1.78rem);
}

.progress-track {
  position: relative;
  width: 100%;
  height: 16px;
  margin-top: 8px;
  overflow: hidden;
  border: 2px solid rgba(20, 70, 110, 0.2);
  border-radius: 999px;
  background: rgba(32, 110, 161, 0.16);
}

.game-shell.is-playing .progress-track,
.game-shell.is-paused .progress-track {
  height: 13px;
  margin-top: 6px;
}

.progress-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), var(--gold), var(--leaf));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.5);
  transition: width 160ms linear;
}

.game-shell.is-playing .progress-track span,
.game-shell.is-paused .progress-track span {
  background: linear-gradient(90deg, var(--route-accent), var(--route-secondary), var(--route-trim));
}

.spark-row {
  display: grid;
  grid-template-columns: auto repeat(3, 34px);
  place-content: center;
  align-items: center;
  gap: 7px;
  min-height: 70px;
  padding: 10px 12px;
  border-radius: 8px;
}

.game-shell.is-playing .spark-row,
.game-shell.is-paused .spark-row {
  grid-template-columns: auto repeat(3, 28px);
  gap: 6px;
  padding: 8px 10px;
}

.spark-label {
  margin-right: 8px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.spark-dot {
  width: 30px;
  height: 30px;
  background: url("assets/items/item-spark.png") center / contain no-repeat;
  filter: drop-shadow(0 5px 0 rgba(52, 83, 111, 0.12));
  transform: scale(1);
  transition:
    filter 180ms ease,
    opacity 180ms ease,
    transform 180ms ease;
}

.game-shell.is-playing .spark-dot,
.game-shell.is-paused .spark-dot {
  width: 26px;
  height: 26px;
}

.spark-dot.dim {
  filter: grayscale(0.92) drop-shadow(0 5px 0 rgba(52, 83, 111, 0.08));
  opacity: 0.44;
  transform: scale(0.82);
}

.rail-controls,
.action-controls {
  position: absolute;
  z-index: 4;
  display: grid;
  gap: 10px;
}

.mission-panel {
  position: absolute;
  top: calc(max(14px, env(safe-area-inset-top)) + 82px);
  left: 50%;
  z-index: 3;
  width: min(620px, calc(100vw - 34px));
  transform: translateX(-50%);
  pointer-events: none;
}

.route-event-coach {
  position: absolute;
  top: calc(max(10px, env(safe-area-inset-top)) + 184px);
  left: 50%;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: min(430px, calc(100vw - 34px));
  padding: 9px 10px 10px;
  border: 1px solid color-mix(in srgb, var(--route-accent) 32%, rgba(16, 79, 149, 0.18));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--route-surface) 80%, white), rgba(255, 255, 255, 0.82)),
    rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 30px rgba(8, 28, 54, 0.18);
  color: #183f63;
  pointer-events: none;
  transform: translateX(-50%);
}

.route-event-coach[hidden] {
  display: none;
}

.route-event-coach .route-theme-rail {
  grid-column: 1 / -1;
  height: 4px;
}

.route-event-coach-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.route-event-coach-main span,
.route-event-coach-count {
  color: #b54362;
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.route-event-coach-main strong {
  color: var(--route-ink);
  font-size: 1rem;
  line-height: 1.04;
  overflow-wrap: anywhere;
}

.route-event-coach-main small {
  color: #4f7188;
  font-size: 0.74rem;
  font-weight: 850;
  line-height: 1.14;
  overflow-wrap: anywhere;
}

.route-event-coach-count {
  min-width: 42px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--route-ink);
  text-align: center;
}

.ride-mode-badge {
  display: none;
  width: fit-content;
  margin: 0 auto 7px;
  padding: 5px 10px;
  border: 1px solid rgba(16, 79, 149, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: #104f95;
  box-shadow: 0 7px 18px rgba(8, 28, 54, 0.14);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.game-shell.is-playing .ride-mode-badge,
.game-shell.is-paused .ride-mode-badge {
  border-color: color-mix(in srgb, var(--route-accent) 44%, rgba(16, 79, 149, 0.16));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--route-ground) 58%, white), rgba(255, 255, 255, 0.82)),
    rgba(255, 255, 255, 0.84);
  color: var(--route-ink);
}

.game-shell.is-playing .ride-mode-badge,
.game-shell.is-paused .ride-mode-badge {
  display: block;
}

.game-shell.is-playing .mission-panel,
.game-shell.is-paused .mission-panel {
  top: calc(max(10px, env(safe-area-inset-top)) + 66px);
  width: min(540px, calc(100vw - 34px));
}

.mission-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.game-shell.is-playing .mission-list,
.game-shell.is-paused .mission-list {
  gap: 7px;
}

.mission-pill {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-height: 44px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 24px rgba(34, 60, 82, 0.14);
  backdrop-filter: blur(10px) saturate(1.12);
}

.game-shell.is-playing .mission-pill,
.game-shell.is-paused .mission-pill {
  grid-template-columns: 28px minmax(0, 1fr);
  min-height: 40px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow:
    0 8px 20px rgba(8, 28, 54, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.64);
}

.game-shell.is-playing .mission-pill,
.game-shell.is-paused .mission-pill {
  border-left: 5px solid color-mix(in srgb, var(--route-accent) 76%, white);
}

.mission-pill.is-complete {
  background: rgba(234, 255, 221, 0.86);
}

.game-shell.is-playing .mission-pill.is-complete,
.game-shell.is-paused .mission-pill.is-complete {
  background: rgba(225, 250, 217, 0.84);
}

.mission-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 4px 0 rgba(36, 72, 92, 0.1));
}

.game-shell.is-playing .mission-icon,
.game-shell.is-paused .mission-icon {
  width: 25px;
  height: 25px;
}

.mission-text {
  min-width: 0;
  color: #183f63;
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.05;
  text-transform: uppercase;
}

.game-shell.is-playing .mission-text,
.game-shell.is-paused .mission-text {
  font-size: 0.7rem;
}

.mission-progress {
  display: block;
  margin-top: 2px;
  color: #4f7188;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: none;
}

.game-shell.is-playing .mission-progress,
.game-shell.is-paused .mission-progress {
  margin-top: 1px;
  font-size: 0.64rem;
}

.rail-controls {
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  grid-template-rows: repeat(2, 64px);
}

.action-controls {
  left: max(16px, env(safe-area-inset-left));
  bottom: max(18px, env(safe-area-inset-bottom));
  grid-template-columns: repeat(3, 56px);
}

.game-shell.is-playing .rail-controls,
.game-shell.is-paused .rail-controls,
.game-shell.is-playing .action-controls,
.game-shell.is-paused .action-controls {
  padding: 6px;
  border: 1px solid color-mix(in srgb, var(--route-accent) 22%, rgba(16, 79, 149, 0.16));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.24);
  box-shadow: 0 10px 28px rgba(8, 28, 54, 0.12);
  backdrop-filter: blur(8px) saturate(1.12);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 2px solid rgba(16, 79, 149, 0.18);
  border-radius: 8px;
  color: #13476f;
  background: var(--panel-strong);
  box-shadow:
    0 8px 0 rgba(35, 84, 105, 0.18),
    0 17px 32px rgba(34, 60, 82, 0.24);
  touch-action: manipulation;
  transition:
    transform 130ms ease,
    box-shadow 130ms ease,
    background 130ms ease;
}

.game-shell.is-playing .icon-button,
.game-shell.is-paused .icon-button {
  border-color: color-mix(in srgb, var(--route-accent) 36%, rgba(16, 79, 149, 0.18));
}

.action-controls .icon-button {
  width: 56px;
  height: 56px;
}

.install-chip {
  position: absolute;
  right: max(16px, env(safe-area-inset-right));
  top: calc(max(14px, env(safe-area-inset-top)) + 96px);
  z-index: 6;
  display: inline-grid;
  grid-template-columns: 22px auto;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid rgba(16, 79, 149, 0.18);
  border-radius: 8px;
  background: var(--panel-strong);
  color: #104f95;
  box-shadow: 0 8px 22px rgba(34, 60, 82, 0.2);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  touch-action: manipulation;
}

.install-chip[hidden] {
  display: none;
}

.game-shell.is-playing .install-chip,
.game-shell.is-paused .install-chip {
  display: none;
}

.install-chip svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.install-chip:hover {
  background: #fff7d8;
}

.update-toast {
  position: absolute;
  left: 50%;
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 78px);
  z-index: 7;
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  padding: 10px 12px;
  border: 1px solid rgba(16, 79, 149, 0.18);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  color: #104f95;
  font-size: 0.84rem;
  font-weight: 900;
}

.update-toast[hidden] {
  display: none;
}

.update-toast button {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 7px;
  background: linear-gradient(180deg, #ffdf73, #ffbf2e);
  color: #3b2500;
  font-weight: 900;
  box-shadow: 0 4px 0 #c66a12;
}

.pause-menu {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(18, 61, 94, 0.18), rgba(20, 79, 116, 0.14)),
    rgba(13, 48, 74, 0.2);
  backdrop-filter: blur(5px);
}

.pause-menu[hidden] {
  display: none;
}

.pause-card {
  display: grid;
  gap: 12px;
  width: min(420px, calc(100vw - 36px));
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  text-align: center;
}

.pause-kicker {
  color: #b54362;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pause-card strong {
  color: #104f95;
  font-size: 1.45rem;
  line-height: 1.1;
}

.pause-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.pause-action {
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid rgba(16, 79, 149, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  color: #123f63;
  font-weight: 900;
  box-shadow: 0 5px 0 rgba(35, 84, 105, 0.12);
}

.pause-action.primary {
  background: linear-gradient(180deg, #ffdf73, #ffbf2e);
  color: #3b2500;
  box-shadow: 0 5px 0 #c66a12;
}

.pause-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(232, 248, 255, 0.72);
  text-align: left;
}

.pause-settings[hidden] {
  display: none;
}

.icon-button svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.icon-button:active,
.icon-button.is-pressed {
  transform: translateY(5px);
  box-shadow:
    0 3px 0 rgba(35, 84, 105, 0.2),
    0 10px 20px rgba(34, 60, 82, 0.2);
}

.icon-button:hover {
  background: #fff7d8;
}

.play-icon,
.sound-off-icon,
.is-paused .pause-icon,
.is-muted .sound-on-icon {
  display: none;
}

.is-paused .play-icon,
.is-muted .sound-off-icon {
  display: block;
}

.start-panel {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(123, 210, 255, 0.18), rgba(255, 255, 255, 0.16)),
    rgba(15, 78, 116, 0.18);
  backdrop-filter: blur(4px);
}

.start-panel.is-hidden {
  display: none;
}

.start-content {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: min(680px, calc(100vw - 34px));
  max-height: calc(100dvh - 34px);
  overflow-y: auto;
  padding: clamp(18px, 4vw, 30px);
  border-radius: 8px;
  text-align: center;
}

.start-content h2 {
  color: #104f95;
  font-size: clamp(2rem, 7vw, 4.1rem);
  line-height: 0.95;
}

.panel-score {
  margin: 10px auto 14px;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2.8vw, 1.18rem);
  font-weight: 800;
  line-height: 1.35;
}

.start-overview {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 10px;
  align-items: stretch;
  margin: 0 0 16px;
}

.progress-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.progress-chip {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(232, 248, 255, 0.66);
  color: #183f63;
  font-weight: 900;
}

.progress-chip span {
  color: #4f7188;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.progress-chip strong {
  font-size: 1rem;
  line-height: 1;
}

.daily-panel,
.ride-plan,
.next-rewards,
.sticker-book,
.passport-panel,
.settings-panel {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(232, 248, 255, 0.66);
  text-align: left;
}

.start-overview .daily-panel {
  margin: 0;
}

.daily-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
}

.daily-card.is-complete {
  background: rgba(234, 255, 221, 0.68);
}

.daily-icon,
.sticker-card img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 5px 0 rgba(36, 72, 92, 0.12));
}

.daily-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.daily-copy span,
.sticker-book-head span,
.passport-head span,
.settings-title {
  color: #b54362;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.daily-copy strong {
  color: #183f63;
  font-size: 1rem;
  line-height: 1.1;
}

.daily-copy small,
.daily-status,
.sticker-card span {
  color: #4f7188;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.12;
}

.daily-status {
  min-width: max-content;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #8c4b00;
}

.ride-plan,
.next-rewards {
  display: grid;
  gap: 9px;
  padding: 10px 12px 12px;
}

.ride-plan-theme {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.ride-ticket {
  gap: 10px;
}

.route-theme-rail {
  display: block;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--route-accent), var(--route-secondary), var(--route-trim));
  box-shadow: 0 3px 0 color-mix(in srgb, var(--route-ink) 14%, transparent);
}

.ride-plan-head,
.next-rewards-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.ride-plan-head span,
.ride-plan-main span,
.ride-plan-item span,
.next-rewards-head span,
.next-reward-copy span {
  color: #b54362;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ride-plan-head strong,
.next-rewards-head strong {
  color: #183f63;
  font-size: 0.82rem;
}

.ride-plan-main {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.ride-ticket-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(190px, 0.65fr);
  gap: 8px;
  align-items: stretch;
  min-width: 0;
}

.ride-plan-theme .ride-plan-main {
  padding: 7px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--route-ground) 64%, white), rgba(255, 255, 255, 0.7)),
    rgba(255, 255, 255, 0.68);
}

.ride-plan-main img {
  width: 86px;
  height: 58px;
  border-radius: 7px;
  object-fit: cover;
  filter: drop-shadow(0 5px 0 rgba(36, 72, 92, 0.1));
}

.ride-plan-main div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ride-plan-main strong {
  color: #104f95;
  font-size: 1.12rem;
  line-height: 1.05;
}

.ride-plan-theme .ride-plan-head strong,
.ride-plan-theme .ride-plan-main strong {
  color: var(--route-ink);
}

.ride-plan-main small,
.ride-plan-item small,
.ride-ticket-chip small,
.playbook-card small,
.rules-playbook-head small,
.practice-card small {
  color: #4f7188;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.16;
}

.ride-ticket-side {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  min-width: 0;
}

.ride-ticket-chip {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  min-height: 58px;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--route-accent) 22%, rgba(16, 79, 149, 0.1));
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.ride-ticket-chip img {
  width: 48px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 4px 0 rgba(36, 72, 92, 0.1));
}

.ride-ticket-chip div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ride-ticket-chip span {
  color: #b54362;
  font-size: 0.58rem;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.ride-ticket-chip strong {
  color: var(--route-ink);
  font-size: 0.78rem;
  line-height: 1.05;
}

.ride-plan-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.ride-plan-item {
  display: grid;
  align-content: start;
  gap: 2px;
  min-width: 0;
  min-height: 62px;
  padding: 8px;
  border: 1px solid rgba(16, 79, 149, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.ride-plan-theme .ride-plan-item {
  border-color: color-mix(in srgb, var(--route-accent) 22%, rgba(16, 79, 149, 0.1));
}

.ride-plan-theme .ride-plan-item strong {
  color: var(--route-ink);
}

.ride-plan-item span {
  font-size: 0.6rem;
}

.ride-plan-item strong {
  color: #183f63;
  font-size: 0.78rem;
  line-height: 1.08;
}

.ride-plan-goal {
  background: rgba(255, 247, 216, 0.76);
}

.next-reward-list {
  display: grid;
  gap: 8px;
}

.next-reward-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(16, 79, 149, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: #183f63;
  font-weight: 900;
}

.next-reward-card img {
  width: 52px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  filter: drop-shadow(0 4px 0 rgba(36, 72, 92, 0.1));
}

.next-reward-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.next-reward-copy span {
  font-size: 0.62rem;
}

.next-reward-copy strong {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  line-height: 1.05;
}

.next-reward-copy small {
  color: #4f7188;
  font-size: 0.66rem;
  line-height: 1.12;
}

.next-reward-status {
  min-width: max-content;
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(255, 247, 216, 0.9);
  color: #8c4b00;
  font-size: 0.62rem;
  font-weight: 900;
}

.sticker-book {
  display: grid;
  gap: 9px;
  padding: 10px 12px 12px;
}

.sticker-book-head,
.passport-head,
.trophy-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.sticker-book-head strong,
.passport-head strong,
.trophy-head strong {
  color: #183f63;
  font-size: 0.82rem;
}

.trophy-case {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(16, 79, 149, 0.1);
  border-radius: 8px;
  background: rgba(255, 247, 216, 0.72);
}

.trophy-head span,
.trophy-copy span {
  color: #b54362;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.trophy-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.trophy-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(16, 79, 149, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: #183f63;
  font-weight: 900;
}

.trophy-card.is-earned {
  background: rgba(234, 255, 221, 0.72);
}

.trophy-card img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 4px 0 rgba(36, 72, 92, 0.1));
}

.trophy-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.trophy-copy strong {
  overflow-wrap: anywhere;
  font-size: 0.82rem;
  line-height: 1.04;
}

.trophy-copy small {
  color: #4f7188;
  font-size: 0.62rem;
  line-height: 1.12;
}

.trophy-progress {
  min-width: max-content;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #8c4b00;
  font-size: 0.62rem;
  font-weight: 900;
}

.sticker-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.sticker-card {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 74px;
  padding: 7px 5px;
  border: 1px solid rgba(16, 79, 149, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  color: #183f63;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
}

.sticker-card.is-locked {
  color: #6b7f90;
  filter: grayscale(0.75);
  opacity: 0.58;
}

.passport-panel {
  display: grid;
  gap: 10px;
  padding: 10px 12px 12px;
  text-align: left;
}

.passport-routes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.passport-card {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(16, 79, 149, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  color: #183f63;
  font-weight: 900;
}

.passport-card.is-route-themed {
  border-color: color-mix(in srgb, var(--route-accent) 24%, rgba(16, 79, 149, 0.1));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--route-surface) 74%, white), rgba(255, 255, 255, 0.72)),
    rgba(255, 255, 255, 0.68);
}

.passport-card .route-theme-rail {
  grid-column: 1 / -1;
  height: 4px;
}

.passport-card img {
  width: 88px;
  aspect-ratio: 2 / 1;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 5px 14px rgba(34, 60, 82, 0.14);
}

.passport-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.passport-copy span {
  color: #b54362;
  font-size: 0.62rem;
  text-transform: uppercase;
}

.passport-copy strong {
  overflow-wrap: anywhere;
  font-size: 0.9rem;
  line-height: 1.04;
}

.passport-card.is-route-themed .passport-copy strong,
.passport-card.is-route-themed .passport-mastery-copy strong {
  color: var(--route-ink);
}

.passport-copy small {
  color: #4f7188;
  font-size: 0.64rem;
  line-height: 1.12;
}

.passport-stats {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  color: #4f7188;
  font-size: 0.62rem;
  font-weight: 900;
}

.passport-card .passport-photo {
  grid-column: 1 / -1;
  width: 96px;
  aspect-ratio: 3 / 2;
  border: 1px solid rgba(16, 79, 149, 0.14);
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 5px 14px rgba(34, 60, 82, 0.14);
}

.passport-mastery {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding-top: 6px;
  border-top: 1px solid rgba(16, 79, 149, 0.1);
}

.passport-mastery-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.passport-mastery-copy span {
  color: #b54362;
  font-size: 0.58rem;
  text-transform: uppercase;
}

.passport-mastery-copy strong {
  color: #104f95;
  font-size: 0.78rem;
  line-height: 1.05;
}

.passport-mastery-copy small,
.passport-mastery-copy em {
  color: #4f7188;
  font-size: 0.62rem;
  font-style: normal;
  line-height: 1.14;
}

.passport-mastery.is-complete .passport-mastery-copy strong {
  color: #2d7c54;
}

.passport-mastery-actions {
  display: grid;
  justify-items: end;
  gap: 5px;
  min-width: max-content;
}

.passport-mastery-actions span {
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 247, 216, 0.9);
  color: #8c4b00;
  font-size: 0.58rem;
  font-weight: 900;
}

.passport-practice-button {
  min-width: 74px;
  min-height: 44px;
  padding: 7px 10px;
  border-radius: 7px;
  color: #ffffff;
  background: #104f95;
  font-size: 0.68rem;
  font-weight: 900;
}

.passport-card.is-locked {
  filter: grayscale(0.4);
  opacity: 0.62;
}

.settings-panel {
  padding: 9px 12px 12px;
}

.settings-title {
  display: block;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.setting-row {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: #183f63;
  font-size: 0.78rem;
  font-weight: 900;
}

.setting-row span {
  color: #4f7188;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.setting-row select,
.setting-row input[type="range"] {
  width: 100%;
}

.setting-row select,
.setting-row input[type="text"] {
  min-height: 44px;
  border: 1px solid rgba(16, 79, 149, 0.18);
  border-radius: 8px;
  padding: 0 0.6rem;
  color: #183f63;
  background: rgba(255, 255, 255, 0.82);
  font: inherit;
}

.setting-row input[type="text"] {
  width: min(100%, 10em);
}

.setting-toggle {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.setting-toggle span {
  text-transform: none;
}

.setting-toggle input {
  width: 28px;
  height: 28px;
  accent-color: var(--blue);
}

.reset-progress {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.save-code-tools {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(16, 79, 149, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
  color: #183f63;
  text-align: left;
}

.save-code-title {
  color: #104f95;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.save-code-tools p {
  margin: 0;
  color: #4f7188;
  font-size: 0.76rem;
  line-height: 1.25;
}

.save-code-tools textarea {
  width: 100%;
  min-height: 72px;
  padding: 8px;
  border: 1px solid rgba(16, 79, 149, 0.2);
  border-radius: 8px;
  color: #183f63;
  background: rgba(255, 255, 255, 0.9);
  font: 700 0.76rem / 1.35 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  resize: vertical;
}

.save-code-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.save-code-actions button {
  min-height: 44px;
  padding: 7px 10px;
  border-radius: 7px;
  color: #183f63;
  background: rgba(255, 255, 255, 0.9);
  font-size: 0.76rem;
  font-weight: 900;
}

.save-code-actions button:first-child {
  color: #ffffff;
  background: #104f95;
}

.save-code-status {
  min-height: 1rem;
  color: #2d7c54;
  font-size: 0.74rem;
  font-weight: 900;
}

.save-code-status.is-error {
  color: #b33449;
}

.reset-button {
  justify-self: start;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(199, 58, 72, 0.28);
  border-radius: 8px;
  background: rgba(255, 246, 247, 0.95);
  color: #b33449;
  font-size: 0.78rem;
  font-weight: 900;
}

.reset-confirm {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  border: 1px solid rgba(199, 58, 72, 0.22);
  border-radius: 8px;
  background: rgba(255, 246, 247, 0.82);
  color: #8e3442;
  font-size: 0.78rem;
  font-weight: 800;
}

.reset-confirm[hidden] {
  display: none;
}

.reset-confirm button {
  min-height: 44px;
  padding: 6px 10px;
  border-radius: 7px;
  color: #183f63;
  background: rgba(255, 255, 255, 0.9);
  font-weight: 900;
}

.reset-confirm button:first-of-type {
  color: #ffffff;
  background: #c73a48;
}

.game-shell.large-text .hud,
.game-shell.large-text .start-content,
.game-shell.large-text .pause-card,
.game-shell.large-text .mission-panel,
.game-shell.large-text .route-event-coach {
  font-size: 1.08rem;
}

.game-shell.large-text .stat-label,
.game-shell.large-text .mission-progress,
.game-shell.large-text .setting-row span {
  font-size: 0.78rem;
}

.game-shell.large-text .mission-text {
  font-size: 0.84rem;
}

.game-shell.high-contrast .mission-pill,
.game-shell.high-contrast .stat-grid,
.game-shell.high-contrast .spark-row,
.game-shell.high-contrast .route-event-coach {
  border-color: rgba(10, 55, 92, 0.34);
  background: rgba(255, 255, 255, 0.92);
}

.game-shell.high-contrast .start-tab.is-selected,
.game-shell.high-contrast .engine-option.is-selected,
.game-shell.high-contrast .scene-option.is-selected,
.game-shell.high-contrast .primary-button {
  outline: 3px solid rgba(10, 55, 92, 0.6);
  outline-offset: 2px;
}

.scene-preview {
  display: none;
  grid-template-columns: minmax(130px, 0.9fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin: 0 0 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(232, 248, 255, 0.66);
  text-align: left;
}

.start-panel.is-celebration .scene-preview {
  display: grid;
}

.start-panel.is-celebration .progress-summary {
  display: none;
}

.start-panel.is-celebration .daily-panel {
  display: none;
}

.start-panel.is-celebration .start-overview {
  display: none;
}

.start-panel.is-celebration .next-rewards {
  display: none;
}

.start-panel.is-celebration .primary-button {
  order: 1;
  margin-bottom: 0;
}

.start-panel.is-celebration .start-tabs {
  order: 2;
}

.start-panel.is-celebration .start-panels {
  order: 3;
}

.reward-panel {
  display: none;
  gap: 10px;
  margin: 0 0 16px;
  text-align: left;
}

.start-panel.is-celebration .reward-panel {
  display: grid;
}

.reward-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, auto);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(16, 79, 149, 0.14);
  border-radius: 8px;
  background: rgba(232, 248, 255, 0.82);
  color: #183f63;
  font-weight: 900;
}

.reward-summary.is-route-themed {
  border-color: color-mix(in srgb, var(--route-accent) 28%, rgba(16, 79, 149, 0.14));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--route-surface) 72%, white), rgba(232, 248, 255, 0.82)),
    rgba(232, 248, 255, 0.82);
}

.reward-summary.is-practice,
.reward-panel.is-practice .station-postcard,
.reward-panel.is-practice .journey-cue {
  background: rgba(255, 247, 216, 0.86);
}

.reward-summary span,
.reward-score span {
  display: block;
  color: #b54362;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.reward-summary strong {
  display: block;
  color: #104f95;
  font-size: clamp(1.05rem, 2.6vw, 1.38rem);
  line-height: 1.05;
}

.reward-summary.is-route-themed strong {
  color: var(--route-ink);
}

.reward-summary small {
  display: block;
  margin-top: 2px;
  color: #4f7188;
  font-size: 0.74rem;
  line-height: 1.18;
}

.reward-score {
  display: grid;
  gap: 2px;
  justify-items: end;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.reward-score strong {
  font-size: 1.2rem;
}

.reward-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 8px;
}

.ride-photo-card {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 20px rgba(34, 60, 82, 0.1);
}

.ride-photo {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 3 / 2;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 7px 18px rgba(34, 60, 82, 0.16);
}

.ride-photo-caption {
  display: grid;
  gap: 2px;
  color: #183f63;
  font-size: 0.72rem;
  font-weight: 900;
}

.ride-photo-caption span {
  color: #b54362;
  font-size: 0.66rem;
  text-transform: uppercase;
}

.station-postcard {
  position: relative;
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  color: #183f63;
  font-weight: 900;
}

.station-postcard.is-route-themed {
  border-color: color-mix(in srgb, var(--route-accent) 26%, var(--line));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--route-surface) 78%, white), rgba(255, 255, 255, 0.74)),
    rgba(255, 255, 255, 0.74);
}

.station-postcard .route-theme-rail {
  grid-column: 1 / -1;
  height: 4px;
}

.station-postcard img {
  width: 100%;
  aspect-ratio: 2 / 1;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 7px 18px rgba(34, 60, 82, 0.14);
}

.station-postcard span {
  display: block;
  color: #b54362;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.station-postcard strong {
  display: block;
  color: #104f95;
  font-size: clamp(1.2rem, 3vw, 1.7rem);
  line-height: 1.02;
}

.station-postcard.is-route-themed strong {
  color: var(--route-ink);
}

.station-postcard small {
  display: block;
  margin-top: 3px;
  color: #4f7188;
  font-size: 0.74rem;
  line-height: 1.15;
}

.journey-cue {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(16, 79, 149, 0.14);
  border-radius: 8px;
  background: rgba(255, 248, 215, 0.82);
  color: #183f63;
  font-weight: 800;
}

.journey-cue span {
  color: #b54362;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.journey-cue strong {
  color: #104f95;
  font-size: 1rem;
  line-height: 1.1;
}

.journey-cue p {
  margin: 0;
  color: #4f7188;
  font-size: 0.78rem;
  line-height: 1.25;
}

.route-event-recap {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(16, 79, 149, 0.14);
  border-radius: 8px;
  background: rgba(232, 248, 255, 0.72);
}

.route-event-recap.is-route-themed {
  border-color: color-mix(in srgb, var(--route-accent) 24%, rgba(16, 79, 149, 0.14));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--route-surface) 78%, white), rgba(232, 248, 255, 0.72)),
    rgba(232, 248, 255, 0.72);
}

.route-event-recap-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.route-event-recap-head span,
.route-event-chip span {
  color: #b54362;
  font-size: 0.68rem;
  font-weight: 950;
  text-transform: uppercase;
}

.route-event-recap-head strong {
  color: var(--route-ink);
  font-size: 0.86rem;
  font-weight: 950;
}

.route-event-chip-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 7px;
}

.route-event-chip {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(16, 79, 149, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #183f63;
}

.route-event-chip img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: drop-shadow(0 4px 0 rgba(36, 72, 92, 0.1));
}

.route-event-chip div {
  min-width: 0;
}

.route-event-chip strong,
.route-event-chip small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.route-event-chip strong {
  color: #104f95;
  font-size: 0.86rem;
  font-weight: 950;
  line-height: 1.04;
}

.route-event-recap.is-route-themed .route-event-chip strong {
  color: var(--route-ink);
}

.route-event-chip small {
  margin-top: 2px;
  color: #4f7188;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.12;
}

.reward-stat,
.unlock-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
}

.reward-stat {
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 8px 6px;
  color: #183f63;
  font-weight: 900;
}

.reward-stat img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 4px 0 rgba(36, 72, 92, 0.1));
}

.reward-stat span {
  color: #4f7188;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.unlock-list {
  display: grid;
  gap: 8px;
}

.unlock-item {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  color: #183f63;
  font-weight: 900;
}

.unlock-item img {
  width: 52px;
  height: 38px;
  border-radius: 6px;
  object-fit: cover;
  filter: drop-shadow(0 4px 0 rgba(36, 72, 92, 0.1));
}

.unlock-item span {
  display: block;
  color: #b54362;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.scene-preview img {
  width: 100%;
  aspect-ratio: 2 / 1;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 8px 20px rgba(34, 60, 82, 0.16);
}

.scene-preview-label {
  display: block;
  margin-bottom: 4px;
  color: #b54362;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.scene-preview strong {
  display: block;
  color: #104f95;
  font-size: clamp(1.35rem, 4vw, 2rem);
  line-height: 1;
}

.engine-picker {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  text-align: left;
}

.scene-picker {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  text-align: left;
}

.start-tabs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 12px;
}

.start-tab {
  min-width: 0;
  min-height: 44px;
  padding: 0 8px;
  border: 2px solid rgba(16, 79, 149, 0.12);
  border-radius: 8px;
  color: #183f63;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 -3px 0 rgba(35, 84, 105, 0.08);
  font-size: 0.76rem;
  font-weight: 900;
}

.start-tab:hover {
  background: #fff7d8;
}

.start-tab.is-selected {
  border-color: rgba(255, 191, 46, 0.92);
  background: rgba(255, 247, 216, 0.92);
  box-shadow:
    0 0 0 3px rgba(255, 191, 46, 0.22),
    inset 0 -3px 0 rgba(35, 84, 105, 0.08);
}

.start-panels {
  min-height: 112px;
}

.start-section[hidden] {
  display: none;
}

.start-section.is-active {
  display: block;
}

.start-section .engine-picker,
.start-section .scene-picker,
.start-section .sticker-book,
.start-section .passport-panel,
.start-section .settings-panel,
.start-section .how-to {
  margin-bottom: 0;
}

.engine-picker-title,
.scene-picker-title {
  color: #b54362;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.engine-options,
.scene-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.engine-option {
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 96px;
  padding: 6px;
  border: 2px solid rgba(16, 79, 149, 0.12);
  border-radius: 8px;
  color: #183f63;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 -4px 0 rgba(35, 84, 105, 0.08);
  font-size: 0.82rem;
  font-weight: 900;
  transition:
    border-color 130ms ease,
    background 130ms ease,
    transform 130ms ease;
}

.engine-option img {
  width: 100%;
  max-width: 118px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 5px 0 rgba(36, 72, 92, 0.12));
}

.engine-option > span {
  display: block;
  min-width: 0;
  line-height: 1.08;
}

.engine-option:hover {
  background: #fff7d8;
}

.engine-option.is-selected {
  border-color: rgba(255, 191, 46, 0.92);
  background: rgba(255, 247, 216, 0.92);
  box-shadow:
    0 0 0 3px rgba(255, 191, 46, 0.24),
    inset 0 -4px 0 rgba(35, 84, 105, 0.08);
}

.engine-option.is-selected span::after {
  display: block;
  content: "Selected";
  color: #4f7188;
  font-size: 0.7rem;
  font-weight: 900;
}

.engine-option.is-locked,
.scene-option.is-locked {
  color: #6b7f90;
  background: rgba(239, 244, 247, 0.78);
  filter: grayscale(0.32);
  cursor: default;
}

.engine-option.is-locked img,
.scene-option.is-locked img {
  opacity: 0.62;
}

.lock-note {
  display: block;
  max-width: 100%;
  color: #6a7d8b;
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1.05;
}

.perk-note {
  display: block;
  max-width: 100%;
  margin-top: 2px;
  color: #2a8a68;
  font-size: 0.62rem;
  font-weight: 950;
  line-height: 1.05;
}

.perk-detail {
  display: block;
  max-width: 100%;
  margin-top: 2px;
  color: #4f7188;
  font-size: 0.58rem;
  font-weight: 850;
  line-height: 1.08;
}

.scene-option {
  position: relative;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 7px;
  border: 2px solid rgba(16, 79, 149, 0.12);
  border-radius: 8px;
  color: #183f63;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 -4px 0 rgba(35, 84, 105, 0.08);
  font-size: 0.76rem;
  font-weight: 900;
  text-align: left;
  transition:
    border-color 130ms ease,
    background 130ms ease,
    transform 130ms ease;
}

.scene-option.is-route-themed {
  border-color: color-mix(in srgb, var(--route-accent) 24%, rgba(16, 79, 149, 0.12));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--route-surface) 72%, white), rgba(255, 255, 255, 0.72)),
    rgba(255, 255, 255, 0.72);
}

.scene-option .route-theme-rail {
  height: 4px;
}

.scene-option img {
  width: 100%;
  aspect-ratio: 2 / 1;
  border-radius: 6px;
  object-fit: cover;
}

.scene-option strong {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.05;
}

.scene-option.is-route-themed strong {
  color: var(--route-ink);
}

.scene-option span {
  display: block;
  color: #4f7188;
  font-size: 0.66rem;
  line-height: 1.05;
}

.passport-line,
.passport-stamp,
.route-flavor {
  display: block;
  font-size: 0.62rem;
  font-weight: 900;
  line-height: 1.05;
}

.passport-line,
.route-flavor {
  color: #4f7188;
}

.route-briefing {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 2px;
}

.route-briefing small {
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 4px;
  border-radius: 6px;
  background: rgba(232, 248, 255, 0.68);
  color: #4f7188;
  font-size: 0.54rem;
  font-weight: 900;
  line-height: 1.05;
}

.route-briefing small.route-practice {
  grid-column: 1 / -1;
  background: rgba(255, 247, 216, 0.78);
  color: #7f5c00;
}

.route-briefing span,
.route-briefing strong {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.route-briefing span {
  color: #6d8aa0;
  font-size: 0.48rem;
  text-transform: uppercase;
}

.route-briefing strong {
  color: #183f63;
  font-size: 0.56rem;
}

.route-briefing.is-locked {
  grid-template-columns: 1fr;
}

.passport-stamp {
  width: fit-content;
  margin-top: 2px;
  padding: 2px 5px;
  border-radius: 999px;
  color: #8c4b00;
  background: rgba(255, 214, 86, 0.7);
}

.passport-stamp.is-open {
  color: #4f7188;
  background: rgba(232, 248, 255, 0.82);
}

.passport-stamp.is-bronze {
  color: #7a4827;
  background: rgba(219, 168, 94, 0.72);
}

.passport-stamp.is-silver {
  color: #38556d;
  background: rgba(226, 236, 244, 0.9);
}

.passport-stamp.is-gold {
  color: #704400;
  background: rgba(255, 214, 86, 0.9);
}

.scene-option:hover {
  background: #fff7d8;
}

.scene-option.is-selected {
  border-color: rgba(255, 191, 46, 0.92);
  background: rgba(255, 247, 216, 0.92);
  box-shadow:
    0 0 0 3px rgba(255, 191, 46, 0.24),
    inset 0 -4px 0 rgba(35, 84, 105, 0.08);
}

.scene-option.is-route-themed.is-selected {
  border-color: color-mix(in srgb, var(--route-accent) 72%, var(--gold));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--route-ground) 66%, white), rgba(255, 247, 216, 0.9)),
    rgba(255, 247, 216, 0.92);
}

.how-to {
  display: grid;
  gap: 12px;
  margin: 0 0 22px;
  text-align: left;
}

.practice-card {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 2px solid color-mix(in srgb, var(--route-accent) 34%, rgba(255, 191, 46, 0.44));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--route-surface) 78%, white), rgba(255, 247, 216, 0.86)),
    rgba(255, 247, 216, 0.86);
  box-shadow: inset 0 -3px 0 rgba(126, 82, 10, 0.08);
}

.practice-card .route-theme-rail {
  grid-column: 1 / -1;
  height: 4px;
}

.practice-route-image {
  width: 96px;
  aspect-ratio: 2 / 1;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 6px 14px rgba(34, 60, 82, 0.14);
}

.practice-card strong,
.practice-card span,
.practice-card small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.practice-card strong {
  color: var(--route-ink);
  font-size: 0.88rem;
  font-weight: 950;
  line-height: 1.05;
}

.practice-card span {
  margin-top: 2px;
  color: #4f7188;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1.12;
}

.practice-card small {
  margin-top: 3px;
}

.practice-button {
  min-width: 108px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(180deg, #25a96a, #157a54);
  box-shadow:
    0 5px 0 rgba(15, 81, 57, 0.24),
    inset 0 2px 0 rgba(255, 255, 255, 0.32);
  font-size: 0.76rem;
  font-weight: 950;
}

.practice-button:hover {
  filter: brightness(1.04);
}

.rules-playbook,
.rules-playbook-theme {
  min-width: 0;
}

.rules-playbook-theme {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--route-accent) 24%, var(--line));
  border-radius: 8px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--route-surface) 76%, white), rgba(232, 248, 255, 0.72)),
    rgba(232, 248, 255, 0.72);
}

.rules-playbook-head {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.rules-playbook-head img {
  width: 112px;
  aspect-ratio: 2 / 1;
  border-radius: 6px;
  object-fit: cover;
}

.rules-playbook-head div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.rules-playbook-head span,
.playbook-card span {
  color: #b54362;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.rules-playbook-head strong {
  color: var(--route-ink);
  font-size: 1.08rem;
  line-height: 1.04;
}

.playbook-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.playbook-card {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
  min-height: 132px;
  padding: 8px;
  border: 1px solid rgba(16, 79, 149, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.7);
}

.playbook-card img {
  width: 48px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 4px 0 rgba(36, 72, 92, 0.1));
}

.playbook-card div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.playbook-card strong {
  color: var(--route-ink);
  font-size: 0.8rem;
  line-height: 1.06;
}

.playbook-card.is-hazard {
  border-color: rgba(255, 91, 80, 0.26);
  background: rgba(255, 246, 239, 0.76);
}

.playbook-card.is-helper {
  border-color: color-mix(in srgb, var(--route-accent) 28%, rgba(16, 79, 149, 0.1));
  background: color-mix(in srgb, var(--route-ground) 32%, white);
}

.rule-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: #254c6f;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.3;
}

.rule-row p {
  margin: 0;
}

.rule-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e8f8ff;
  box-shadow: inset 0 -4px 0 rgba(35, 84, 105, 0.12);
}

.rule-icon svg {
  width: 28px;
  height: 28px;
  fill: #13476f;
}

.rule-icon.spark-dot {
  width: 40px;
  height: 40px;
  background: url("assets/items/item-spark.png") center / contain no-repeat;
  box-shadow: none;
}

.item-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.item-column {
  display: grid;
  gap: 8px;
}

.item-column h3 {
  margin: 0 0 2px;
  color: #b54362;
  font-size: 0.82rem;
  letter-spacing: 0;
  text-transform: uppercase;
}

.item-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-height: 46px;
  color: #183f63;
  font-weight: 900;
}

.item-picture {
  width: 48px;
  height: 48px;
  overflow: visible;
  object-fit: contain;
  filter: drop-shadow(0 5px 0 rgba(36, 72, 92, 0.13));
}

.primary-button {
  display: inline-grid;
  align-self: center;
  grid-auto-flow: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100%, 238px);
  min-height: 58px;
  margin: 0 0 16px;
  padding: 0 20px;
  border-radius: 8px;
  color: #2f2000;
  background: linear-gradient(180deg, #ffe98b, #ffb52d);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.56),
    0 8px 0 #c76a1e,
    0 18px 34px rgba(75, 60, 28, 0.25);
  font-weight: 950;
  transition:
    transform 130ms ease,
    box-shadow 130ms ease;
}

.primary-button svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

.primary-button:active {
  transform: translateY(5px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.56),
    0 3px 0 #c76a1e,
    0 10px 20px rgba(75, 60, 28, 0.22);
}

.primary-button:disabled {
  cursor: default;
  filter: saturate(0.82);
  opacity: 0.68;
  transform: none;
}

@media (prefers-reduced-motion: no-preference) {
  .primary-button.is-attract:not(:disabled) {
    animation: attractPulse 1.5s ease-in-out infinite;
  }
}

/*
 * Pulse glow + brightness only — never transform/geometry. A scaling button is
 * never "stable" for tap actionability (it fails Playwright clicks and is harder
 * for a small child to tap precisely); a glowing ring draws the eye without
 * moving the hit target.
 */
@keyframes attractPulse {
  0%,
  100% {
    box-shadow:
      inset 0 2px 0 rgba(255, 255, 255, 0.56),
      0 8px 0 #c76a1e,
      0 0 0 0 rgba(255, 210, 90, 0),
      0 18px 34px rgba(75, 60, 28, 0.25);
    filter: brightness(1);
  }
  50% {
    box-shadow:
      inset 0 2px 0 rgba(255, 255, 255, 0.7),
      0 8px 0 #c76a1e,
      0 0 0 7px rgba(255, 210, 90, 0.4),
      0 20px 40px rgba(255, 170, 40, 0.45);
    filter: brightness(1.08);
  }
}

@media (max-width: 760px) {
  .game-shell {
    min-height: 500px;
  }

  .hud {
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  .game-shell.is-playing .hud,
  .game-shell.is-paused .hud {
    top: max(10px, env(safe-area-inset-top));
    grid-template-columns: minmax(0, 1fr) auto;
    justify-content: stretch;
    gap: 8px;
  }

  .brand-block {
    display: none;
  }

  .game-shell.is-playing .brand-block,
  .game-shell.is-paused .brand-block {
    display: none;
  }

  .stat-grid {
    grid-template-columns: minmax(74px, 0.8fr) minmax(74px, 0.8fr) minmax(112px, 1.4fr);
    min-height: 60px;
  }

  .game-shell.is-playing .stat-grid,
  .game-shell.is-paused .stat-grid,
  .game-shell.is-playing .spark-row,
  .game-shell.is-paused .spark-row {
    min-height: 54px;
  }

  .stat {
    padding: 8px 10px;
  }

  .stat strong {
    font-size: 1.35rem;
  }

  .spark-row {
    grid-template-columns: repeat(3, 25px);
    gap: 5px;
    min-height: 60px;
    padding: 8px;
  }

  .game-shell.is-playing .spark-row,
  .game-shell.is-paused .spark-row {
    grid-template-columns: repeat(3, 24px);
    gap: 4px;
    padding: 7px;
  }

  .spark-label {
    display: none;
  }

  .spark-dot {
    width: 23px;
    height: 23px;
  }

  .mission-panel {
    top: calc(max(14px, env(safe-area-inset-top)) + 68px);
    width: min(520px, calc(100vw - 24px));
  }

  .game-shell.is-playing .mission-panel,
  .game-shell.is-paused .mission-panel {
    top: calc(max(10px, env(safe-area-inset-top)) + 60px);
    width: min(500px, calc(100vw - 24px));
  }

  .route-event-coach {
    top: calc(max(10px, env(safe-area-inset-top)) + 158px);
    width: min(500px, calc(100vw - 24px));
    padding: 8px;
  }

  .mission-list {
    gap: 6px;
  }

  .mission-pill {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 4px;
    min-height: 38px;
    padding: 5px 7px;
  }

  .mission-icon {
    width: 23px;
    height: 23px;
  }

  .mission-text {
    font-size: 0.64rem;
  }

  .mission-progress {
    font-size: 0.62rem;
  }

  .start-panel {
    padding: 12px;
    place-items: start center;
  }

  .start-content {
    width: min(560px, calc(100vw - 24px));
    margin-top: 8px;
    padding: 18px 16px 20px;
  }

  .start-content h2 {
    font-size: clamp(2rem, 10vw, 3.2rem);
  }

  .panel-score {
    margin-bottom: 12px;
  }

  .start-overview {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 12px;
  }

  .progress-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .progress-chip {
    padding: 7px 6px;
  }

  .progress-chip span {
    font-size: 0.6rem;
  }

  .progress-chip strong {
    font-size: 0.86rem;
  }

.daily-panel,
.ride-plan,
.next-rewards,
.sticker-book,
.passport-panel,
.settings-panel {
  margin-bottom: 12px;
}

  .daily-card {
    grid-template-columns: 46px minmax(0, 1fr);
    padding: 9px;
  }

  .daily-status {
    grid-column: 2;
    width: fit-content;
  }

  .ride-plan-main {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .ride-ticket-layout {
    grid-template-columns: 1fr;
  }

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

  .ride-plan-main img {
    width: 68px;
    height: 52px;
  }

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

  .ride-plan-goal {
    grid-column: 1 / -1;
  }

  .next-reward-card {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 8px;
    padding: 7px;
  }

  .next-reward-card img {
    width: 44px;
    height: 36px;
  }

  .next-reward-status {
    grid-column: 2;
    width: fit-content;
  }

  .daily-icon,
  .sticker-card img {
    width: 40px;
    height: 40px;
  }

.sticker-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.passport-routes {
  grid-template-columns: 1fr;
}

.trophy-list {
  grid-template-columns: 1fr;
}

.trophy-card {
  grid-template-columns: 38px minmax(0, 1fr) auto;
}

.trophy-card img {
  width: 38px;
  height: 38px;
}

.passport-card {
  grid-template-columns: 78px minmax(0, 1fr);
}

.passport-card img {
  width: 78px;
}

  .passport-mastery {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .passport-mastery-actions {
    grid-template-columns: auto 1fr;
    justify-items: stretch;
    align-items: center;
    min-width: 0;
  }

  .passport-mastery-actions span {
    width: fit-content;
  }

  .passport-practice-button {
    width: 100%;
  }

  .sticker-card {
    min-height: 68px;
    padding: 6px 4px;
    font-size: 0.66rem;
  }

  .settings-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .pause-menu {
    padding: 16px;
  }

  .pause-card {
    width: 100%;
    max-width: 430px;
    padding: 18px;
  }

  .pause-actions,
  .pause-settings,
  .reset-confirm {
    grid-template-columns: 1fr;
  }

  .start-tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 10px;
  }

  .start-tab {
    min-height: 44px;
    padding: 0 4px;
    font-size: 0.64rem;
  }

  .start-panels {
    min-height: 102px;
  }

  .scene-preview {
    grid-template-columns: 1fr;
    gap: 9px;
    margin-bottom: 14px;
    text-align: center;
  }

  .reward-summary {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .reward-score {
    justify-items: start;
  }

  .reward-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .route-event-recap-head {
    display: grid;
    gap: 2px;
  }

  .route-event-chip-list {
    grid-template-columns: 1fr;
  }

  .station-postcard {
    grid-template-columns: 1fr;
    gap: 8px;
    text-align: center;
  }

  .reward-stat {
    grid-template-columns: 30px minmax(0, 1fr);
    justify-items: start;
    align-items: center;
    padding: 6px 8px;
  }

  .reward-stat img {
    width: 30px;
    height: 30px;
    grid-row: span 2;
  }

  .unlock-item {
    grid-template-columns: 48px minmax(0, 1fr);
    padding: 7px 8px;
  }

  .unlock-item img {
    width: 46px;
    height: 34px;
  }

  .engine-picker {
    margin-bottom: 14px;
  }

  .engine-option {
    min-height: 92px;
    padding: 5px;
    font-size: 0.76rem;
  }

  .engine-option img {
    height: 40px;
  }

  .engine-option.is-selected span::after {
    content: "";
    display: none;
  }

  .scene-picker {
    margin-bottom: 14px;
  }

  .scene-option {
    padding: 5px;
    font-size: 0.68rem;
  }

  .scene-option span,
  .lock-note,
  .passport-line,
  .passport-stamp {
    font-size: 0.58rem;
  }

  .route-briefing {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .route-briefing small.route-practice {
    grid-column: auto;
  }

  .route-briefing small {
    padding: 3px 4px;
    font-size: 0.52rem;
  }

  .route-briefing span {
    font-size: 0.46rem;
  }

  .route-briefing strong {
    font-size: 0.54rem;
  }

  .how-to {
    gap: 10px;
    margin-bottom: 18px;
  }

  .practice-card {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 8px;
  }

  .practice-route-image {
    width: 82px;
  }

  .practice-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .rules-playbook-head {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .rules-playbook-head img {
    width: 88px;
  }

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

  .playbook-card {
    min-height: 118px;
  }

  .rule-row {
    grid-template-columns: 36px minmax(0, 1fr);
    font-size: 0.9rem;
  }

  .rule-icon,
  .rule-icon.spark-dot {
    width: 34px;
    height: 34px;
  }

  .rule-icon svg {
    width: 24px;
    height: 24px;
  }

  .item-guide {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .item-column {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px 8px;
  }

  .item-column h3 {
    grid-column: 1 / -1;
  }

  .item-row {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 3px;
    min-height: 74px;
    font-size: 0.78rem;
    line-height: 1.05;
    text-align: center;
  }

  .item-picture {
    width: 42px;
    height: 42px;
  }

  .rail-controls {
    grid-template-rows: repeat(2, 58px);
  }

  .rail-controls .icon-button {
    width: 58px;
    height: 58px;
  }

  .action-controls {
    grid-template-columns: repeat(2, 50px);
  }

  .action-controls .icon-button {
    width: 50px;
    height: 50px;
  }
}

@media (max-width: 430px) {
  .hud {
    left: 10px;
    right: 10px;
  }

  .stat-label {
    font-size: 0.66rem;
  }

  .progress-track {
    height: 13px;
  }

  .route-event-coach {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .route-event-coach-count {
    justify-self: start;
  }

  .start-content {
    padding: 20px 16px 24px;
  }

  .primary-button {
    min-height: 54px;
  }
}

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