:root {
  --navy: #07101a;
  --navy-2: #0c1826;
  --panel: rgba(7, 13, 21, 0.84);
  --panel-2: rgba(13, 22, 33, 0.92);
  --panel-3: rgba(20, 31, 44, 0.72);
  --cream: #f3e6d1;
  --cream-2: #d8ccb8;
  --amber: #ffb25e;
  --amber-hi: #ffd9a0;
  --gold: #ffc247;
  --line: rgba(255, 178, 94, 0.46);
  --line-soft: rgba(255, 178, 94, 0.2);
  --red: #d93b2e;
  --pink: #ff4f9a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  --font: "Overpass", "Arial Narrow", sans-serif;
  --mono: "Overpass Mono", "Courier New", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--navy);
  color: var(--cream);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

img {
  display: block;
  max-width: 100%;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
}

#menuBg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url("assets/game/menu_bg.webp");
  background-size: cover;
  background-position: 55% 55%;
  transform: scale(1.03);
  filter: saturate(1.02) contrast(1.02);
}

#menuBg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 8, 14, 0.9) 0%, rgba(4, 8, 14, 0.52) 42%, rgba(4, 8, 14, 0.1) 76%),
    linear-gradient(0deg, rgba(4, 8, 14, 0.92) 0%, rgba(4, 8, 14, 0.1) 42%, rgba(4, 8, 14, 0.25) 100%),
    radial-gradient(ellipse at 65% 50%, rgba(0, 0, 0, 0) 30%, rgba(2, 5, 9, 0.38) 100%);
}

#game {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.7s ease;
}

#game.live {
  opacity: 1;
}

#game canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

#gameFx {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 46%, rgba(0, 0, 0, 0) 48%, rgba(2, 5, 9, 0.42) 100%);
  mix-blend-mode: multiply;
}

.grain {
  position: absolute;
  inset: -40px;
  opacity: 0.075;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E");
  background-size: 160px 160px;
  mix-blend-mode: overlay;
}

.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  justify-content: safe center;
  padding: calc(14px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left));
  overflow-y: auto;
  overflow-x: hidden;
}

.screen[hidden] {
  display: none;
}

.menu-screen {
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(90deg, rgba(4, 8, 14, 0.2), rgba(4, 8, 14, 0.02));
}

.menu-shell {
  width: min(1220px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.82fr);
  align-items: end;
  gap: clamp(18px, 4vw, 64px);
  margin: auto 0;
}

.title-card {
  position: relative;
  padding: clamp(14px, 2.2vw, 26px) clamp(14px, 2.4vw, 30px) clamp(18px, 2.6vw, 32px);
  background:
    linear-gradient(90deg, rgba(5, 10, 17, 0.9) 0%, rgba(5, 10, 17, 0.72) 62%, rgba(5, 10, 17, 0.2) 100%);
  border-left: 2px solid var(--line);
  box-shadow: var(--shadow);
}

.title-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.4'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--amber);
  font-size: clamp(0.58rem, 1.5vw, 0.76rem);
  font-weight: 700;
  letter-spacing: 0.32em;
  line-height: 1.4;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.45rem, 7.4vw, 6.4rem);
  font-weight: 900;
  letter-spacing: 0.015em;
  line-height: 0.82;
  text-transform: uppercase;
  color: #fff1dc;
  text-shadow:
    0 0 34px rgba(255, 166, 76, 0.32),
    0 5px 0 rgba(48, 18, 2, 0.55),
    0 18px 40px rgba(0, 0, 0, 0.48);
}

.tagline {
  margin: 12px 0 0;
  color: var(--amber-hi);
  font-size: clamp(0.7rem, 1.75vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.34em;
  line-height: 1.5;
  text-transform: uppercase;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

.tagline.small {
  margin-top: 6px;
  font-size: clamp(0.62rem, 1.5vw, 0.8rem);
  letter-spacing: 0.28em;
  color: var(--amber);
}

.blurb {
  max-width: 38ch;
  margin: 14px 0 0;
  color: #d2c7b6;
  font-size: clamp(0.82rem, 1.55vw, 1rem);
  line-height: 1.45;
  text-wrap: pretty;
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 5px 12px 5px 5px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(5, 10, 16, 0.64);
  color: var(--cream-2);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sound-toggle img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.sound-toggle:hover,
.sound-toggle:focus-visible {
  border-color: var(--line);
  color: var(--cream);
}

.select-panel {
  position: relative;
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(13, 22, 33, 0.94), rgba(7, 13, 21, 0.9));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 220, 180, 0.05);
}

.select-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.select-head {
  position: relative;
  z-index: 1;
  margin-bottom: 12px;
}

.select-head h2 {
  margin: 0 0 3px;
  font-size: clamp(0.88rem, 2vw, 1.12rem);
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cream);
}

.select-head p {
  margin: 0;
  color: #aeb2ad;
  font-size: 0.76rem;
  line-height: 1.4;
}

.twin-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 1.4vw, 14px);
}

.twin-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 10px 8px 12px;
  border: 1px solid rgba(255, 178, 94, 0.22);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(18, 28, 41, 0.9), rgba(8, 14, 22, 0.92));
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.twin-card:hover {
  border-color: rgba(255, 178, 94, 0.55);
  transform: translateY(-3px);
}

.twin-card.selected {
  border-color: var(--amber);
  box-shadow: 0 0 0 1px rgba(255, 178, 94, 0.55), 0 0 32px rgba(255, 150, 60, 0.22);
  transform: translateY(-3px);
}

.twin-glow {
  position: absolute;
  left: 50%;
  bottom: 22%;
  width: 130%;
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 162, 66, 0.42) 0%, rgba(255, 120, 40, 0.16) 38%, rgba(255, 120, 40, 0) 70%);
  pointer-events: none;
}

.twin-art {
  position: relative;
  z-index: 1;
  width: 100%;
  height: clamp(142px, 28vh, 272px);
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, 0.5)) brightness(1.16) saturate(1.03);
  transition: transform 0.2s ease;
}

.twin-card.selected .twin-art {
  transform: scale(1.04);
}

.twin-meta {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin-top: 8px;
}

.twin-meta strong {
  font-size: clamp(1.05rem, 2.6vw, 1.5rem);
  font-weight: 900;
  letter-spacing: 0.2em;
  line-height: 1;
}

.twin-meta span {
  color: #a7aaa5;
  font-size: 0.57rem;
  font-weight: 700;
  letter-spacing: 0.24em;
}

.twin-meta .twin-level {
  margin-top: 2px;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.48rem;
  letter-spacing: 0.12em;
}

.twin-check {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5, 10, 15, 0.8);
  color: var(--amber-hi);
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.twin-card.selected .twin-check {
  opacity: 1;
  transform: none;
}

.start-btn {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin-top: 14px;
  padding: 12px 18px;
  border: 1px solid rgba(255, 226, 176, 0.8);
  border-radius: 7px;
  background:
    linear-gradient(180deg, #ffe0a8 0%, #ffbe68 45%, #e8943c 100%);
  color: #261406;
  font-size: clamp(0.78rem, 1.6vw, 0.95rem);
  font-weight: 900;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  box-shadow:
    0 8px 26px rgba(255, 143, 48, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -2px 0 rgba(120, 56, 8, 0.28);
  transition: transform 0.16s ease, filter 0.16s ease;
}

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

.start-btn:hover {
  filter: brightness(1.06);
}

.start-btn:active {
  transform: translateY(1px) scale(0.995);
}

.start-btn:disabled {
  filter: grayscale(0.45) brightness(0.75);
  cursor: wait;
}

.keys,
.touch-hint {
  position: relative;
  z-index: 1;
  margin: 9px 0 0;
  color: #9ca29f;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
  text-transform: uppercase;
}

.touch-hint {
  display: none;
}

.download-link {
  position: relative;
  z-index: 1;
  display: block;
  width: fit-content;
  margin: 10px auto 0;
  padding: 6px 12px;
  border: 1px solid rgba(255, 194, 71, 0.45);
  border-radius: 999px;
  color: var(--amber-hi);
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-align: center;
}

.download-hint {
  position: relative;
  z-index: 1;
  margin: 6px 0 0;
  color: #9ca29f;
  font-size: 0.62rem;
  text-align: center;
}

.download-link:hover,
.download-link:focus-visible {
  background: rgba(255, 194, 71, 0.12);
}

.best-line {
  position: relative;
  z-index: 1;
  margin: 8px 0 0;
  color: var(--amber-hi);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.menu-foot {
  width: min(1220px, 100%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  padding-top: 6px;
  color: rgba(225, 214, 196, 0.7);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

#hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  font-family: var(--font);
}

#hud[hidden] {
  display: none;
}

.hud-top-left {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  left: calc(10px + env(safe-area-inset-left));
}

.hud-plate {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 172px;
  padding: 8px 10px 7px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
}

.hud-plate::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.4;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.88' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.3'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.hud-kicker {
  color: var(--chest, var(--cream));
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  line-height: 1.2;
  text-transform: uppercase;
}

.hud-stage {
  color: var(--amber);
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.2;
  text-transform: uppercase;
}

.hud-stats {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 4px;
}

.hearts {
  display: flex;
  gap: 3px;
}

.heart {
  width: 12px;
  height: 11px;
  background: var(--amber);
  clip-path: polygon(50% 100%, 2% 42%, 0 21%, 12% 5%, 31% 2%, 50% 17%, 69% 2%, 88% 5%, 100% 21%, 98% 42%);
  filter: drop-shadow(0 0 5px rgba(255, 150, 60, 0.6));
}

.heart.lost {
  background: rgba(255, 255, 255, 0.14);
  filter: none;
}

.map-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--amber-hi);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.04em;
}

.map-count img {
  width: 19px;
  height: 16px;
  object-fit: cover;
  border: 1px solid rgba(255, 178, 94, 0.5);
  border-radius: 2px;
}

.map-count b {
  color: var(--cream);
  font-weight: 700;
}

.time {
  margin-left: auto;
  color: #c4bbab;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
}

.hud-level {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
}

.hud-level b {
  color: var(--amber-hi);
  font-family: var(--mono);
  font-size: 0.52rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.hud-level .xp-track {
  position: relative;
  width: 58px;
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
}

.hud-level .xp-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #e8943c, #ffe0a8);
  box-shadow: 0 0 8px rgba(255, 178, 94, 0.65);
  transition: width 0.25s ease;
}

.hud-level em {
  color: #a9a196;
  font-family: var(--mono);
  font-size: 0.44rem;
  font-style: normal;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.objective {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--panel);
  transform: translateX(-50%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
  white-space: nowrap;
}

.objective[hidden] {
  display: none;
}

.obj-label {
  color: var(--cream);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.obj-dist {
  color: var(--amber);
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
}

.race-panel {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  left: calc(10px + env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 5px 13px 6px;
  border: 1px solid rgba(255, 226, 176, 0.42);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(10, 16, 24, 0.94), rgba(5, 9, 14, 0.94));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 22px rgba(255, 150, 60, 0.14);
  white-space: nowrap;
}

#hud.hud-race .hud-top-left {
  display: none;
}

.race-panel[hidden] {
  display: none;
}

.race-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  min-width: 46px;
}

.race-stat span {
  color: #a7aaa5;
  font-size: 0.4rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.3;
}

.race-stat b {
  color: var(--amber-hi);
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.race-stat b em {
  margin-left: 2px;
  color: #a7aaa5;
  font-size: 0.38rem;
  font-style: normal;
  letter-spacing: 0.04em;
}

.race-countdown {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.race-countdown[hidden] {
  display: none;
}

.race-countdown span {
  color: #ffe0a8;
  font-size: clamp(3.2rem, 18vw, 7.5rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  text-align: center;
  text-shadow: 0 0 44px rgba(255, 150, 60, 0.85), 0 10px 34px rgba(0, 0, 0, 0.95);
}

.race-countdown.show span {
  animation: racePop 0.62s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

@keyframes racePop {
  0% { transform: scale(0.55); opacity: 0; }
  28% { opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.power-pill {
  position: absolute;
  top: calc(52px + env(safe-area-inset-top));
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 1px solid rgba(255, 226, 176, 0.6);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(72, 39, 10, 0.94), rgba(18, 24, 34, 0.94));
  transform: translateX(-50%);
  box-shadow: 0 0 26px rgba(255, 178, 94, 0.24);
  animation: powerPulse 1.6s ease-in-out infinite;
}

.power-pill[hidden] {
  display: none;
}

.power-pill img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.power-pill span {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}

.power-pill b {
  color: var(--amber-hi);
  font-size: 0.57rem;
  letter-spacing: 0.16em;
}

.power-pill em {
  color: #d3b78d;
  font-size: 0.48rem;
  font-style: normal;
  letter-spacing: 0.14em;
}

.hud-top-right {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: calc(10px + env(safe-area-inset-right));
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.disc-btn {
  position: relative;
  display: block;
  width: var(--disc, 54px);
  height: var(--disc, 54px);
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  filter: drop-shadow(0 5px 9px rgba(0, 0, 0, 0.55));
  transition: transform 0.1s ease, filter 0.1s ease;
}

.disc-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

.disc-btn:active,
.disc-btn.is-down {
  transform: scale(0.93);
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.55)) brightness(1.18);
}

.disc-btn:focus-visible,
.sound-toggle:focus-visible,
.start-btn:focus-visible,
.ghost-btn:focus-visible,
.twin-card:focus-visible {
  outline: 2px solid var(--amber-hi);
  outline-offset: 2px;
}

.hud-bottom-left {
  position: absolute;
  left: calc(12px + env(safe-area-inset-left));
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex;
  gap: 8px;
  pointer-events: auto;
}

.joystick {
  --joy: 132px;
  position: relative;
  width: var(--joy);
  height: var(--joy);
  border-radius: 50%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(10, 16, 24, 0.78) 0 54%, rgba(10, 16, 24, 0.55) 70%, rgba(10, 16, 24, 0.2) 100%);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
}

.joy-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid #9a6a36;
  box-shadow:
    inset 0 0 0 2px rgba(255, 210, 150, 0.28),
    inset 0 0 18px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(0, 0, 0, 0.6);
  background:
    repeating-conic-gradient(from 0deg, rgba(255, 190, 110, 0.07) 0 6deg, transparent 6deg 30deg);
}

.joy-arrow {
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  margin-top: -9px;
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  opacity: 0.75;
  transition: opacity 0.1s ease, filter 0.1s ease;
}

.joy-arrow-l {
  left: 10px;
  border-right: 12px solid var(--amber);
}

.joy-arrow-r {
  right: 10px;
  border-left: 12px solid var(--amber);
}

.joystick.is-left .joy-arrow-l,
.joystick.is-right .joy-arrow-r {
  opacity: 1;
  filter: drop-shadow(0 0 6px var(--amber-hi));
}

.joy-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46%;
  height: 46%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 36% 30%, #ffe2b0 0 8%, #e0a052 30%, #8a5420 70%, #4a2a10 100%);
  border: 2px solid rgba(40, 22, 8, 0.9);
  box-shadow:
    inset 0 -4px 8px rgba(0, 0, 0, 0.45),
    inset 0 3px 5px rgba(255, 230, 190, 0.35),
    0 4px 10px rgba(0, 0, 0, 0.6);
  transition: transform 0.12s ease-out;
  pointer-events: none;
}

.joystick.is-down .joy-knob {
  transition: none;
  filter: brightness(1.12);
}

.hud-bottom-right {
  position: absolute;
  right: calc(12px + env(safe-area-inset-right));
  bottom: calc(14px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: auto;
}

.action-btn {
  --disc: 64px;
}

.jump-btn {
  --disc: 82px;
}

.action-tag {
  position: absolute;
  left: 50%;
  bottom: -16px;
  transform: translateX(-50%);
  padding: 2px 6px;
  border: 1px solid rgba(255, 178, 94, 0.35);
  border-radius: 999px;
  background: rgba(5, 10, 15, 0.82);
  color: #e7d3b4;
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  white-space: nowrap;
  text-shadow: 0 2px 4px #000;
}

.action-btn.laser-mode img {
  filter: drop-shadow(0 0 14px rgba(255, 178, 94, 0.9));
}

.action-btn.laser-mode .action-tag {
  color: var(--amber-hi);
}

.edge-arrow {
  position: absolute;
  top: 50%;
  right: calc(14px + env(safe-area-inset-right));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transform: translateY(-50%);
  opacity: 0.88;
  animation: edgeFloat 1.6s ease-in-out infinite;
}

.edge-arrow img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  transform: rotate(-90deg);
  filter: drop-shadow(0 0 10px rgba(255, 190, 90, 0.8));
}

.edge-arrow span {
  color: var(--amber-hi);
  font-family: var(--mono);
  font-size: 0.48rem;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 6px #000;
  writing-mode: vertical-rl;
}

.unite-prompt {
  position: absolute;
  left: 50%;
  bottom: calc(128px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  transform: translateX(-50%);
  box-shadow: 0 0 28px rgba(255, 178, 94, 0.24);
  animation: promptFloat 1.2s ease-in-out infinite;
}

.unite-prompt[hidden] {
  display: none;
}

.prompt-hand img {
  width: 44px;
  height: 44px;
}

.unite-prompt span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.08;
}

.unite-prompt b {
  color: var(--amber-hi);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
}

.unite-prompt em {
  color: #c8b595;
  font-size: 0.46rem;
  font-style: normal;
  letter-spacing: 0.12em;
}

.quest-prompt {
  position: absolute;
  left: 50%;
  bottom: calc(196px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--cream);
  transform: translateX(-50%);
  box-shadow: 0 0 30px rgba(255, 178, 94, 0.28);
  animation: promptFloat 1.2s ease-in-out infinite;
  pointer-events: auto;
  cursor: pointer;
}

.quest-prompt[hidden] {
  display: none;
}

.quest-prompt .prompt-hand img {
  width: 40px;
  height: 40px;
}

.quest-prompt span:last-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.08;
}

.quest-prompt b {
  color: var(--amber-hi);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
}

.quest-prompt em {
  max-width: 42vw;
  overflow: hidden;
  color: #d8c4a2;
  font-size: 0.48rem;
  font-style: normal;
  letter-spacing: 0.12em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quest-log {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0 0 12px;
}

.quest-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
}

.quest-row.is-open {
  border-color: rgba(255, 178, 94, 0.4);
}

.quest-row.is-done {
  opacity: 0.72;
}

.quest-row.is-locked {
  opacity: 0.55;
}

.quest-row b {
  color: var(--amber-hi);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
}

.quest-row strong {
  display: block;
  color: var(--cream);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.quest-row span {
  color: #a9a49a;
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.quest-row em {
  grid-column: 2 / 4;
  color: #989d96;
  font-family: var(--mono);
  font-size: 0.44rem;
  font-style: normal;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.quest-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.quest-facts div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
}

.quest-facts span {
  color: #9da09b;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.quest-facts b {
  color: var(--amber-hi);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.map-bonus {
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
}

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

.map-bonus p {
  margin: 0 0 3px;
  color: #9da09b;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.map-bonus strong {
  display: block;
  color: var(--amber-hi);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.map-bonus em {
  display: block;
  margin-top: 4px;
  color: #c9c1b2;
  font-size: 0.68rem;
  font-style: normal;
  line-height: 1.35;
}

.quest-modal {
  width: min(640px, 100%);
}

.toast {
  position: fixed;
  top: 19%;
  left: 50%;
  z-index: 30;
  max-width: min(88vw, 520px);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel-2);
  color: var(--cream);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-align: center;
  text-transform: uppercase;
  opacity: 0;
  transform: translate(-50%, -8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.speech {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(92vw, 980px);
  padding: clamp(14px, 3vw, 30px) clamp(18px, 4vw, 40px);
  border: 2px solid rgba(255, 217, 160, 0.7);
  background:
    radial-gradient(ellipse at 50% 50%, rgba(51, 34, 12, 0.74) 0%, rgba(7, 12, 20, 0.88) 72%),
    linear-gradient(180deg, rgba(11, 18, 29, 0.9), rgba(5, 9, 15, 0.92));
  box-shadow: 0 0 80px rgba(255, 178, 94, 0.32), 0 24px 60px rgba(0, 0, 0, 0.6);
  transform: translate(-50%, -50%) scale(0.9);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.2, 1.4, 0.4, 1);
  pointer-events: none;
  text-align: center;
}

.speech[hidden] {
  display: none;
}

.speech.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.speech span {
  color: var(--cream);
  font-size: clamp(1.35rem, 5vw, 3.2rem);
  font-weight: 900;
  letter-spacing: 0.14em;
  line-height: 0.95;
  text-transform: uppercase;
  text-shadow: 0 0 28px rgba(255, 190, 100, 0.5), 0 4px 0 rgba(50, 20, 2, 0.6);
}

.speech strong {
  color: #ffe2a6;
  font-size: clamp(2.6rem, 11vw, 6.8rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  line-height: 0.84;
  text-transform: uppercase;
  text-shadow:
    0 0 22px rgba(255, 255, 255, 0.9),
    0 0 58px rgba(255, 176, 64, 0.9),
    0 0 110px rgba(255, 130, 40, 0.55),
    0 6px 0 rgba(52, 20, 2, 0.7);
}

.modal {
  position: relative;
  width: min(620px, 100%);
  padding: clamp(18px, 3.4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(14, 23, 35, 0.97), rgba(6, 11, 18, 0.96));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 230, 190, 0.08);
  text-align: center;
}

.modal::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0.34;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.35'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.modal h2 {
  margin: 0;
  color: var(--cream);
  font-size: clamp(1.6rem, 4.6vw, 2.6rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
}

.modal .eyebrow {
  margin-bottom: 7px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 20px;
}

.ghost-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--cream-2);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.ghost-btn:hover {
  border-color: var(--line);
  background: rgba(255, 178, 94, 0.08);
  color: var(--cream);
}

.sound-line img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.modal-keys {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 14px;
  margin-top: 20px;
  color: #999b95;
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.modal-keys[hidden] {
  display: none;
}

.race-keys {
  margin: 20px 0 0;
  color: var(--amber-hi);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  line-height: 1.5;
  text-align: center;
  text-transform: uppercase;
}

.race-keys[hidden] {
  display: none;
}

.map-modal {
  width: min(760px, 100%);
}

.map-board {
  position: relative;
  height: clamp(136px, 27vw, 176px);
  margin: 14px 0 6px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  overflow: hidden;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 178, 94, 0.13), transparent 55%),
    repeating-linear-gradient(0deg, transparent 0 26px, rgba(255, 178, 94, 0.055) 26px 27px),
    repeating-linear-gradient(90deg, transparent 0 26px, rgba(255, 178, 94, 0.055) 26px 27px),
    linear-gradient(180deg, rgba(18, 29, 42, 0.97), rgba(5, 10, 16, 0.98));
}

.map-board::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 120%, transparent 30%, rgba(2, 5, 9, 0.55) 100%);
}

.map-road {
  position: absolute;
  left: 2%;
  top: 14%;
  width: 96%;
  height: 72%;
}

.map-stop {
  position: absolute;
  bottom: 88px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
}

.map-stop::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--amber-hi);
  box-shadow: 0 0 10px rgba(255, 194, 71, 0.7);
}

.map-stop b {
  color: var(--amber-hi);
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.08em;
}

.map-stop span {
  color: rgba(255, 231, 194, 0.62);
  font-family: var(--mono);
  font-size: 0.4rem;
  letter-spacing: 0.12em;
}

.map-stop.quest-done::after {
  background: #9fb7c9;
  box-shadow: 0 0 10px rgba(159, 183, 201, 0.6);
}

.map-stop.quest-done b {
  color: #b9cbd8;
}

.map-stop.quest-locked {
  opacity: 0.48;
}

.stop-cp1 {
  left: 13%;
}

.stop-cp2 {
  left: 25%;
}

.stop-cp3 {
  left: 37%;
}

.stop-cp4 {
  left: 49%;
}

.stop-cp5 {
  left: 64%;
}

.stop-cp6 {
  left: 80%;
}

.stop-exit {
  left: 92%;
}

.map-checkpoints {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px 10px;
  margin: 0 0 12px;
}

.map-checkpoints span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(255, 231, 194, 0.78);
  font-family: var(--mono);
  font-size: 0.45rem;
  letter-spacing: 0.06em;
}

.map-checkpoints b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--amber);
  color: #101014;
  font-size: 0.45rem;
  font-weight: 900;
}

.map-rider,
.map-partner {
  position: absolute;
  bottom: 0;
  height: clamp(56px, 11vw, 80px);
  width: auto;
  transform: translateX(-50%);
  filter: drop-shadow(0 7px 9px rgba(0, 0, 0, 0.68)) brightness(1.12) saturate(1.02);
  transition: left 0.25s ease;
}

.map-rider {
  z-index: 2;
}

.map-partner {
  z-index: 1;
  opacity: 0.88;
}

.map-route {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 24px 0 18px;
}

.map-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(76px, 19vw, 128px);
  aspect-ratio: 1.15;
  border: 1px dashed rgba(255, 178, 94, 0.34);
  background-color: rgba(255, 255, 255, 0.025);
  background-image: url("assets/game/map_fragment.webp");
  background-size: 235% auto;
  background-repeat: no-repeat;
  filter: brightness(0.68) saturate(0.82) sepia(0.08);
  clip-path: polygon(4% 7%, 22% 0, 48% 5%, 72% 1%, 96% 9%, 100% 46%, 95% 78%, 100% 96%, 76% 100%, 47% 95%, 22% 100%, 2% 94%, 0 52%, 5% 26%);
  color: rgba(255, 225, 186, 0.26);
  font-family: var(--mono);
  font-size: 1.2rem;
}

.map-slot[data-slot="0"] {
  background-position: 18% 40%;
}

.map-slot[data-slot="1"] {
  background-position: 58% 55%;
}

.map-slot[data-slot="2"] {
  background-position: 82% 30%;
}

.map-slot::before {
  content: "TORN";
  position: absolute;
  left: 50%;
  top: 5px;
  padding: 1px 4px;
  transform: translateX(-50%);
  background: rgba(5, 10, 15, 0.72);
  color: rgba(255, 225, 186, 0.55);
  font-family: var(--font);
  font-size: 0.4rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.map-slot span {
  position: absolute;
  left: 6px;
  bottom: 5px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(5, 10, 15, 0.72);
  color: var(--amber-hi);
  font-size: 0.55rem;
  line-height: 1.2;
}

.map-slot.found {
  border-color: transparent;
  filter: none;
  box-shadow: 0 0 24px rgba(255, 178, 94, 0.24);
  color: transparent;
}

.map-slot.found::before {
  display: none;
}

.map-slot.found span {
  color: transparent;
  background: transparent;
}

.map-slot.found::after {
  content: "FOUND";
  position: absolute;
  left: 50%;
  bottom: 5px;
  padding: 2px 5px;
  transform: translateX(-50%);
  background: rgba(5, 10, 15, 0.82);
  color: var(--amber-hi);
  font-family: var(--font);
  font-size: 0.42rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.map-line {
  width: clamp(16px, 5vw, 46px);
  height: 1px;
  background: repeating-linear-gradient(90deg, rgba(255, 178, 94, 0.55) 0 5px, transparent 5px 10px);
}

.map-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
}

.map-note img {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
}

.map-note p {
  margin: 0;
  color: #c9c1b2;
  font-size: 0.78rem;
  line-height: 1.4;
}

.complete-modal {
  width: min(700px, 100%);
}

.complete-copy {
  max-width: 44ch;
  margin: 14px auto 0;
  color: #c9c0b0;
  font-size: 0.86rem;
  line-height: 1.45;
}

.score-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
}

.score-grid div {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
}

.score-grid span {
  color: #9da09b;
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.score-grid b {
  color: var(--amber-hi);
  font-family: var(--mono);
  font-size: 0.96rem;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.loading {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(4, 8, 14, 0.62), rgba(4, 8, 14, 0.94)),
    url("assets/game/menu_bg.webp") center / cover no-repeat;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.loading.done {
  opacity: 0;
  visibility: hidden;
}

.loading-inner {
  width: min(480px, 100%);
  text-align: center;
}

.loading-inner h1 {
  font-size: clamp(1.6rem, 5.4vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: 0.04em;
}

.load-track {
  width: min(320px, 78%);
  height: 3px;
  margin: 22px auto 10px;
  background: rgba(255, 255, 255, 0.13);
  overflow: hidden;
}

.load-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #e8943c, #ffe0a8);
  box-shadow: 0 0 12px rgba(255, 178, 94, 0.6);
  transition: width 0.2s ease;
}

#loadText {
  margin: 0;
  color: #b4aa9b;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

@keyframes edgeFloat {
  0%, 100% { transform: translateY(-50%) translateX(0); }
  50% { transform: translateY(-50%) translateX(-4px); }
}

@keyframes promptFloat {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-5px); }
}

@keyframes powerPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 178, 94, 0.2); }
  50% { box-shadow: 0 0 34px rgba(255, 178, 94, 0.42); }
}

@keyframes titleBreathe {
  0%, 100% { text-shadow: 0 0 34px rgba(255, 166, 76, 0.28), 0 5px 0 rgba(48, 18, 2, 0.55), 0 18px 40px rgba(0, 0, 0, 0.48); }
  50% { text-shadow: 0 0 54px rgba(255, 190, 100, 0.46), 0 5px 0 rgba(48, 18, 2, 0.55), 0 18px 40px rgba(0, 0, 0, 0.48); }
}

@media (hover: none), (pointer: coarse) {
  .keys {
    display: none;
  }
  .touch-hint {
    display: block;
  }
}

@media (max-width: 860px) {
  .menu-shell {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 12px;
  }

  .title-card {
    padding: 12px 14px 14px;
    border-left-width: 1px;
    background: linear-gradient(90deg, rgba(5, 10, 17, 0.9), rgba(5, 10, 17, 0.72));
  }

  h1 {
    font-size: clamp(2.25rem, 10vw, 4.2rem);
  }

  .blurb {
    display: none;
  }

  .tagline {
    margin-top: 8px;
    font-size: 0.64rem;
    letter-spacing: 0.26em;
  }

  .sound-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    margin: 0;
    padding: 4px;
    border: none;
    background: transparent;
  }

  .sound-toggle span {
    display: none;
  }

  .sound-toggle img {
    width: 38px;
    height: 38px;
  }

  .select-panel {
    padding: 12px;
  }

  .select-head {
    margin-bottom: 8px;
  }

  .select-head p {
    display: none;
  }

  .twin-art {
    height: clamp(150px, 25vh, 230px);
  }

  .menu-foot {
    display: none;
  }

  .objective {
    top: calc(88px + env(safe-area-inset-top));
    padding: 5px 10px;
  }

  .power-pill {
    top: calc(122px + env(safe-area-inset-top));
  }

  .hud-plate {
    min-width: 150px;
    padding: 7px 8px 6px;
  }

  .hud-kicker {
    font-size: 0.49rem;
  }

  .hud-stage {
    font-size: 0.43rem;
  }

  :root {
    --disc: 50px;
  }

  .joystick {
    --joy: 116px;
  }

  .action-btn {
    --disc: 58px;
  }

  .jump-btn {
    --disc: 74px;
  }

  .edge-arrow img {
    width: 34px;
    height: 34px;
  }

  .unite-prompt {
    bottom: calc(108px + env(safe-area-inset-bottom));
  }

  .quest-prompt {
    bottom: calc(168px + env(safe-area-inset-bottom));
  }

  .quest-facts {
    grid-template-columns: 1fr 1fr;
  }

  .quest-facts div:last-child {
    grid-column: 1 / 3;
  }

  .score-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 430px) {
  h1 {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .title-card {
    padding: 10px 12px 12px;
  }

  .eyebrow {
    font-size: 0.5rem;
    letter-spacing: 0.22em;
  }

  .twin-art {
    height: clamp(128px, 22vh, 190px);
  }

  .twin-meta strong {
    font-size: 1rem;
  }

  .twin-check {
    font-size: 0.42rem;
    padding: 2px 5px;
  }

  .start-btn {
    min-height: 46px;
    margin-top: 10px;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
  }

  .hud-plate {
    min-width: 134px;
  }

  .map-count img {
    width: 16px;
    height: 13px;
  }

  .time {
    font-size: 0.52rem;
  }

  .obj-label {
    font-size: 0.55rem;
  }

  .obj-dist {
    font-size: 0.5rem;
  }

  .modal {
    padding: 16px 13px;
  }

  .modal h2 {
    font-size: clamp(1.25rem, 7vw, 1.8rem);
  }

  .score-grid {
    gap: 6px;
  }

  .score-grid b {
    font-size: 0.82rem;
  }

  .map-route {
    margin: 16px 0 12px;
  }
}

@media (max-height: 610px) and (orientation: landscape) {
  .menu-shell {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
  }

  .map-modal {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    grid-template-areas:
      "eyebrow questlog"
      "title questlog"
      "board route"
      "board note"
      "checkpoints button";
    gap: 4px 18px;
    align-items: start;
    width: min(1000px, 100%);
    max-height: calc(100vh - 28px);
    padding: 10px 16px;
    overflow: hidden;
    text-align: left;
  }

  .map-modal > .eyebrow {
    grid-area: eyebrow;
    margin: 0;
    font-size: 0.5rem;
    text-align: left;
  }

  .map-modal > h2 {
    grid-area: title;
    margin: 0 0 2px;
    font-size: clamp(1.05rem, 3vw, 1.55rem);
    text-align: left;
  }

  .map-modal > .map-board {
    grid-area: board;
    height: clamp(112px, calc(100vh - 230px), 200px);
    margin: 0;
  }

  .map-modal > .map-checkpoints {
    grid-area: checkpoints;
    margin: 0;
    justify-content: flex-start;
    gap: 3px 7px;
  }

  .map-modal .map-checkpoints span {
    font-size: 0.36rem;
  }

  .map-modal .map-checkpoints b {
    width: 12px;
    height: 12px;
    font-size: 0.36rem;
  }

  .map-modal > .quest-log {
    grid-area: questlog;
    gap: 3px;
    margin: 0;
  }

  .map-modal > .map-bonus {
    grid-area: questlog;
    margin: 0;
    padding: 8px 10px;
  }

  .map-modal .map-bonus strong {
    font-size: 0.6rem;
  }

  .map-modal .map-bonus em {
    font-size: 0.58rem;
  }

  .map-modal .quest-row {
    padding: 3px 7px;
  }

  .map-modal .quest-row strong {
    font-size: 0.52rem;
    letter-spacing: 0.08em;
  }

  .map-modal .quest-row b {
    font-size: 0.5rem;
  }

  .map-modal .quest-row span {
    font-size: 0.38rem;
  }

  .map-modal .quest-row em {
    display: none;
  }

  .map-modal > .map-route {
    grid-area: route;
    margin: 0;
  }

  .map-modal .map-slot {
    width: 56px;
    font-size: 0.9rem;
  }

  .map-modal .map-line {
    width: 14px;
  }

  .map-modal > .map-note {
    grid-area: note;
    gap: 7px;
    padding: 5px 8px;
  }

  .map-modal .map-note img {
    width: 28px;
    height: 28px;
  }

  .map-modal .map-note p {
    font-size: 0.58rem;
    line-height: 1.25;
  }

  .map-modal > #closeMapBtn {
    grid-area: button;
    min-height: 36px;
    margin: 0;
    font-size: 0.62rem;
  }

  .map-modal .map-stop {
    bottom: 48px;
  }

  .map-modal .map-stop b {
    font-size: 0.4rem;
  }

  .map-modal .map-stop span {
    font-size: 0.3rem;
  }

  .map-modal .map-stop::after {
    width: 5px;
    height: 5px;
  }

  .map-modal .map-rider,
  .map-modal .map-partner {
    height: 50px;
  }

  .map-modal .map-road {
    top: 10%;
    height: 60%;
  }

  .quest-prompt {
    bottom: calc(104px + env(safe-area-inset-bottom));
  }

  .objective {
    top: calc(10px + env(safe-area-inset-top));
  }

  .power-pill {
    top: calc(46px + env(safe-area-inset-top));
  }

  .title-card {
    padding: 10px 16px 14px;
  }

  h1 {
    font-size: clamp(2.2rem, 5.4vw, 4rem);
  }

  .blurb,
  .sound-toggle span {
    display: none;
  }

  .sound-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 3px;
    border: none;
    background: transparent;
  }

  .sound-toggle img {
    width: 34px;
    height: 34px;
  }

  .twin-art {
    height: clamp(110px, 22vh, 160px);
  }

  .start-btn {
    min-height: 44px;
    margin-top: 8px;
  }

  .select-head p,
  .keys,
  .touch-hint,
  .download-hint,
  .menu-foot {
    display: none;
  }
}

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

.speech {
  flex-direction: row;
  justify-content: center;
  gap: clamp(8px, 2vw, 24px);
}

.speech-words {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.speech-owl {
  width: auto;
  height: clamp(86px, 15vw, 190px);
  flex: 0 1 auto;
  object-fit: contain;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 22px rgba(255, 190, 100, 0.3)) brightness(1.12);
}

.speech-owl.left {
  transform: scaleX(-1);
}

@media (max-width: 720px) {
  .speech {
    flex-wrap: wrap;
    gap: 4px 12px;
  }

  .speech-owl {
    height: clamp(58px, 13vw, 96px);
  }

  .speech-words {
    order: -1;
    flex-basis: 100%;
  }
}
.action-tag[hidden] { display: none; }
.map-modal {
  background: linear-gradient(180deg, #0e1723, #060b12);
}
.map-board .map-stop {
  z-index: 3;
}
.map-board .stop-exit {
  left: 86%;
}
.map-slot[data-slot="0"] {
  background-position: 34% 46%;
}
.map-board .stop-cp1 { left: 6%; }
.map-board .stop-cp2 { left: 13%; }
.map-board .stop-cp3 { left: 20%; }
.map-board .stop-cp4 { left: 27%; }
.map-board .stop-cp5 { left: 35%; }
.map-board .stop-cp6 { left: 43%; }
.map-board .map-stop b,
.map-board .map-stop span {
  padding: 0 3px;
  border-radius: 3px;
  background: rgba(6, 11, 18, 0.88);
}
.map-board .map-rider,
.map-board .map-partner {
  height: clamp(66px, 15vw, 92px);
}
.map-modal .map-board .map-rider,
.map-modal .map-board .map-partner {
  height: clamp(60px, 13vw, 80px);
}

/* The map's way back to the game stays on screen on a short or narrow
   window: when the map is taller than the screen it scrolls under the button. */
.map-modal > #closeMapBtn {
  position: sticky;
  bottom: 0;
  z-index: 3;
  box-shadow: 0 -10px 18px rgba(4, 8, 14, 0.85);
}

/* Quest / bonus race prompt: anchored on a dark grainy panel just above the
   action button instead of floating over the road. */
.quest-prompt {
  left: auto;
  right: calc(12px + env(safe-area-inset-right));
  transform: none;
  border-radius: 8px;
  padding: 7px 14px 7px 7px;
  animation: none;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.22'/%3E%3C/svg%3E"),
    linear-gradient(180deg, rgba(14, 20, 28, 0.96), rgba(5, 9, 14, 0.97));
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55), 0 0 18px rgba(255, 178, 94, 0.22);
}

.quest-prompt b {
  font-size: 0.74rem;
  letter-spacing: 0.22em;
}

.quest-prompt em {
  font-size: 0.6rem;
}

/* HUD lettering sized to read at phone size. */
.hud-kicker {
  font-size: 0.7rem;
  letter-spacing: 0.24em;
}

.hud-stage {
  font-size: 0.6rem;
  letter-spacing: 0.18em;
}

@media (max-height: 610px) and (orientation: landscape) {
  /* Short landscape: the action and jump discs fill the right edge, so the
     prompt sits just left of the action button at its height. */
  .quest-prompt {
    right: calc(96px + env(safe-area-inset-right));
    bottom: calc(100px + env(safe-area-inset-bottom));
  }
}

/* The map panel scrolls inside itself, so nothing of the game or of the
   panel's own text shows past its edges or under the button. */
#mapScreen {
  background: rgba(3, 6, 10, 0.88);
}
@media (orientation: portrait), (min-height: 611px) {
  #mapScreen .map-modal {
    max-height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    flex-shrink: 0;
  }
  #mapScreen .map-modal > #closeMapBtn {
    box-shadow: 0 36px 0 0 #060b12, 0 -10px 18px rgba(4, 8, 14, 0.85);
  }
}

/* The drawn road keeps the stage's proportions after the last checkpoint:
   the Daddy Cool card, then the long road on to the exit. */
.map-board .stop-card { left: 51%; }
.map-board .stop-card b { color: #ff6a5e; }
.map-board .stop-exit { left: 92%; }

.map-board .map-stop::after {
  order: -1;
  margin-top: 0;
  margin-bottom: 2px;
}
@media (max-height: 610px) and (orientation: landscape) {
  .map-modal .map-board .map-rider,
  .map-modal .map-board .map-partner {
    height: 40px;
  }
}

/* Overlay panels that scroll must take a finger drag (the page body blocks
   touch panning for the game controls). */
.screen,
#mapScreen .map-modal {
  touch-action: pan-y;
}

/* On a tall upright screen the route board takes the spare height, so the
   map panel fills the screen instead of floating in a dark band. */
@media (orientation: portrait) {
  #mapScreen .map-modal > .map-board {
    height: clamp(140px, calc(100vh - 560px), 300px);
  }
}

/* Power-ups on the map road: small gift icons sitting on the line. */
.map-board .map-power {
  position: absolute;
  z-index: 2;
  width: 15px;
  height: 15px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 0 4px rgba(255, 178, 94, 0.8));
}
.map-checkpoints .power-legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.map-checkpoints .power-legend img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}
.map-board .stop-card img {
  width: 30px;
  height: 24px;
  object-fit: cover;
  border: 1px solid rgba(255, 194, 71, 0.7);
  border-radius: 3px;
  margin-bottom: 1px;
}

/* The bonus race in 3D: drawn over the 2D game canvas, under the HUD. */
#race3d {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
}
#race3d[hidden], #raceMini[hidden] { display: none; }
#raceMini {
  position: absolute;
  right: calc(10px + env(safe-area-inset-right));
  top: calc(66px + env(safe-area-inset-top));
  width: clamp(92px, 24vmin, 150px);
  height: clamp(92px, 24vmin, 150px);
  border-radius: 14px;
  background: rgba(5, 9, 14, 0.55);
  border: 1px solid rgba(255, 226, 176, 0.3);
  pointer-events: none;
}
#hud:not(.hud-race) #raceMini { display: none; }
.race-stat b#racePos em {
  margin-left: 1px;
  color: #a7aaa5;
  font-size: 0.5rem;
  font-style: normal;
}
body.race-3d .race-stat b#racePos { font-size: 1.05rem; }
body.race-3d #edgeArrow { display: none !important; }

/* Map pieces still on the road, drawn on the map route. */
.map-board .map-piece {
  position: absolute;
  z-index: 2;
  width: 24px;
  height: 15px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 0 4px rgba(255, 215, 122, 0.95));
}
.map-checkpoints .piece-legend[hidden] { display: none; }
.map-checkpoints .piece-legend img { width: 20px; }

/* On a narrow board the checkpoints stand close together, so the map
   pieces and gifts are drawn a little smaller to fit between their dots. */
@media (max-width: 480px) {
  .map-board .map-piece { width: 18px; height: 12px; }
  .map-board .map-power { width: 13px; height: 13px; }
}

/* The ending: Daddy Cool unmasks, hugs the twins, and the white car
   drives them off into the sunset. */
.ending {
  position: fixed;
  inset: 0;
  z-index: 60;
  overflow: hidden;
  background: #1a0710;
  color: var(--cream);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
.ending[hidden] { display: none; }
.end-world {
  position: absolute;
  left: 0;
  top: 0;
  width: 1024px;
  height: 1024px;
  transform-origin: 0 0;
}
.end-world .end-bg {
  position: absolute;
  inset: 0;
  width: 1024px;
  height: 1024px;
  object-fit: cover;
}
.end-world .end-sprite {
  position: absolute;
  display: block;
  pointer-events: none;
  will-change: transform, opacity;
}
.end-world .end-sprite img {
  display: block;
  max-width: none;
  max-height: none;
}
.end-world .end-heart {
  position: absolute;
  font-size: 54px;
  line-height: 1;
  color: #ff4f9a;
  text-shadow: 0 0 18px rgba(255, 90, 160, 0.8);
  pointer-events: none;
}
.end-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, #fff 0%, #ffe6b0 35%, rgba(255, 200, 120, 0) 75%);
  opacity: 0;
  pointer-events: none;
}
.end-caption {
  position: absolute;
  left: 50%;
  top: max(6%, env(safe-area-inset-top));
  transform: translateX(-50%);
  width: min(92vw, 760px);
  margin: 0;
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(20, 6, 14, 0.62);
  font-size: clamp(0.9rem, 3.6vw, 1.5rem);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}
.end-caption.show { opacity: 1; }
.end-title {
  position: absolute;
  left: 50%;
  top: 14%;
  transform: translateX(-50%);
  width: min(94vw, 900px);
  text-align: center;
  animation: endTitleIn 2.4s ease both;
  pointer-events: none;
}
.end-title h2 {
  margin: 0;
  font-size: clamp(3rem, 15vw, 7.5rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #fff3d6;
  text-shadow: 0 0 30px rgba(255, 150, 60, 0.9), 0 4px 0 #8a2a12;
}
.end-title p {
  margin: 6px 0 0;
  font-size: clamp(0.7rem, 2.8vw, 1.1rem);
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #ffd77a;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}
@keyframes endTitleIn {
  from { opacity: 0; transform: translateX(-50%) scale(0.9); }
  to { opacity: 1; transform: translateX(-50%) scale(1); }
}
.end-skip {
  position: absolute;
  right: max(14px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  padding: 10px 16px;
  border: 1px solid rgba(255, 215, 150, 0.6);
  border-radius: 999px;
  background: rgba(20, 6, 14, 0.55);
  color: var(--cream);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  cursor: pointer;
}
.end-go {
  position: absolute;
  left: 50%;
  bottom: max(9%, calc(env(safe-area-inset-bottom) + 64px));
  transform: translateX(-50%);
  width: auto;
  min-width: 200px;
}

/* The sprint's racer pick, once Daddy Cool is unlocked: three cards. */
.racer-modal { width: min(680px, 100%); max-height: 100%; overflow-y: auto; }
.racer-row { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 8px 0 4px; }
.racer-row .twin-art { height: clamp(70px, 15vh, 170px); }
.racer-pick .tagline { margin: 10px 0 0; }
.track-row { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(6px, 1.4vw, 12px); margin: 10px 0 4px; }
.track-card {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0;
  padding: 8px 5px 9px; border: 1px solid rgba(255, 178, 94, 0.22); border-radius: 12px;
  background: linear-gradient(180deg, rgba(18, 28, 41, 0.9), rgba(8, 14, 22, 0.92));
  color: inherit; font: inherit; cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.track-card.selected { border-color: var(--amber); box-shadow: 0 0 0 1px rgba(255, 178, 94, 0.55), 0 0 26px rgba(255, 150, 60, 0.22); transform: translateY(-2px); }
.track-map { width: 100%; max-width: 160px; height: auto; aspect-ratio: 16 / 11; }
.track-card strong { font-size: clamp(0.62rem, 2.3vw, 0.95rem); font-weight: 900; letter-spacing: 0.1em; line-height: 1.1; text-align: center; }
.track-card span { color: #a7aaa5; font-size: clamp(0.44rem, 1.5vw, 0.58rem); font-weight: 700; letter-spacing: 0.12em; text-align: center; line-height: 1.25; }
.track-card em { color: var(--amber); font-family: var(--mono); font-style: normal; font-size: 0.5rem; letter-spacing: 0.1em; }
.racer-row .twin-meta strong { font-size: clamp(0.72rem, 2.4vw, 1.2rem); letter-spacing: 0.12em; text-align: center; }

/* Thumb controls, matched set: a matte dark knob with a bronze rim that leans
   toward the way it is pushed, an amber arc lit on that side of the base, and
   two thumb-sized discs on the right, side by side in a low arc, lifted clear
   of the screen edge. */
.joystick {
  --joy: 124px;
}
.joystick::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
  -webkit-mask: radial-gradient(circle, transparent 60%, #000 62%, #000 70%, transparent 72%);
  mask: radial-gradient(circle, transparent 60%, #000 62%, #000 70%, transparent 72%);
}
.joystick.is-left::after {
  opacity: 1;
  background: conic-gradient(from 210deg, transparent 0deg, rgba(255, 178, 94, 0.95) 60deg, rgba(255, 178, 94, 0.95) 60deg, transparent 120deg, transparent 360deg);
  filter: drop-shadow(0 0 6px rgba(255, 170, 80, 0.8));
}
.joystick.is-right::after {
  opacity: 1;
  background: conic-gradient(from 30deg, transparent 0deg, rgba(255, 178, 94, 0.95) 60deg, transparent 120deg, transparent 360deg);
  filter: drop-shadow(0 0 6px rgba(255, 170, 80, 0.8));
}
.joy-knob {
  width: 48%;
  height: 48%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.1' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='80' height='80' filter='url(%23n)' opacity='.28'/%3E%3C/svg%3E"),
    radial-gradient(circle at 50% 50%, transparent 0 52%, rgba(214, 150, 84, 0.55) 53% 56%, transparent 57%),
    radial-gradient(circle at 50% 42%, #2a2f36 0%, #171b21 62%, #0d1015 100%);
  border: 3px solid #a3713c;
  box-shadow:
    inset 0 0 0 1px rgba(255, 214, 160, 0.22),
    inset 0 -3px 6px rgba(0, 0, 0, 0.5),
    0 4px 10px rgba(0, 0, 0, 0.6);
}
.joystick.is-down .joy-knob,
.joystick.is-left .joy-knob,
.joystick.is-right .joy-knob {
  filter: none;
  border-color: #d39250;
}

.hud-bottom-left {
  left: calc(16px + env(safe-area-inset-left));
  bottom: calc(26px + env(safe-area-inset-bottom));
}
.hud-bottom-right {
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(26px + env(safe-area-inset-bottom));
  flex-direction: row;
  align-items: flex-end;
  gap: 12px;
}
.hud-bottom-right .action-btn,
.hud-bottom-right .jump-btn {
  --disc: 84px;
}
/* Hand sits a little higher than the jump disc: the arc a thumb sweeps. */
.hud-bottom-right .action-btn {
  margin-bottom: 26px;
}
.quest-prompt,
.unite-prompt {
  z-index: 4;
}
.quest-prompt {
  left: auto;
  right: calc(16px + env(safe-area-inset-right));
  bottom: calc(26px + 84px + 26px + 30px + env(safe-area-inset-bottom));
}
.unite-prompt {
  bottom: calc(26px + 84px + 26px + 30px + env(safe-area-inset-bottom));
}
@media (max-width: 430px) {
  .joystick { --joy: 112px; }
  .hud-bottom-left { left: calc(12px + env(safe-area-inset-left)); }
  .hud-bottom-right { right: calc(12px + env(safe-area-inset-right)); gap: 10px; }
  .hud-bottom-right .action-btn,
  .hud-bottom-right .jump-btn { --disc: 76px; }
  .hud-bottom-right .action-btn { margin-bottom: 22px; }
  .quest-prompt {
    right: calc(12px + env(safe-area-inset-right));
    bottom: calc(26px + 76px + 22px + 28px + env(safe-area-inset-bottom));
  }
  .unite-prompt { bottom: calc(26px + 76px + 22px + 28px + env(safe-area-inset-bottom)); }
}
@media (max-height: 610px) and (orientation: landscape) {
  .joystick { --joy: 108px; }
  .hud-bottom-left { bottom: calc(18px + env(safe-area-inset-bottom)); }
  .hud-bottom-right { bottom: calc(18px + env(safe-area-inset-bottom)); }
  .hud-bottom-right .action-btn,
  .hud-bottom-right .jump-btn { --disc: 72px; }
  .hud-bottom-right .action-btn { margin-bottom: 20px; }
  /* Short screens: the prompt sits left of the discs, above the road line. */
  .quest-prompt {
    right: calc(12px + 72px * 2 + 12px + 18px + env(safe-area-inset-right));
    bottom: calc(18px + 72px + 20px + env(safe-area-inset-bottom));
  }
  .unite-prompt { bottom: calc(18px + 72px + 28px + env(safe-area-inset-bottom)); }
}
