:root {
  --ink: #05060f;
  --night: #0a0e22;
  --glass: rgba(13, 17, 38, 0.78);
  --glass-soft: rgba(20, 26, 52, 0.6);
  --line: rgba(120, 200, 255, 0.16);
  --cyan: #38e8ff;
  --magenta: #ff4d9d;
  --amber: #ffc857;
  --lime: #b6f24a;
  --text: #eef3ff;
  --muted: #97a3c4;
  --radius: 18px;
  --font: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font);
  overscroll-behavior: none;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
  outline: none;
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.is-hidden {
  display: none !important;
}

/* ---------- HUD ---------- */

.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  padding: clamp(12px, 2.2vw, 26px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-variant-numeric: tabular-nums;
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.hud-score {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.hud-score span {
  font-size: clamp(34px, 6vw, 62px);
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 0 22px rgba(56, 232, 255, 0.55), 0 3px 0 rgba(0, 0, 0, 0.4);
}

.hud-score small,
.hud-stat small {
  font-size: 11px;
  letter-spacing: 0.24em;
  color: var(--muted);
  text-transform: uppercase;
}

.hud-stats {
  display: flex;
  gap: clamp(10px, 2vw, 26px);
  text-align: right;
}

.hud-stat {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.hud-stat span {
  font-family: var(--mono);
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 700;
  color: var(--cyan);
}

.hud-stat:nth-child(2) span {
  color: var(--amber);
}

.hud-stat:nth-child(3) span {
  color: var(--lime);
}

/* 连击喊话气泡 */
.combo-shout {
  position: absolute;
  left: 50%;
  top: 21%;
  transform: translateX(-50%);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: clamp(16px, 2.6vw, 24px);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #041019;
  background: linear-gradient(120deg, #9ff7ff, #38e8ff 60%, #b6f24a);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 8px 26px rgba(56, 232, 255, 0.35), 0 0 0 4px rgba(56, 232, 255, 0.12);
  white-space: nowrap;
  pointer-events: none;
  animation: shoutPop 260ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes shoutPop {
  0% {
    transform: translateX(-50%) scale(0.7);
    opacity: 0;
  }
  100% {
    transform: translateX(-50%) scale(1);
    opacity: 1;
  }
}

/* 连击条 */
.combo {
  position: relative;
  align-self: flex-start;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 12px 7px;
  border-radius: 12px;
  background: rgba(8, 12, 28, 0.62);
  border: 1px solid rgba(56, 232, 255, 0.35);
  overflow: hidden;
  transform-origin: left center;
  backdrop-filter: blur(6px);
}

.combo b {
  font-family: var(--mono);
  font-size: clamp(18px, 3vw, 24px);
  color: #fff;
  line-height: 1;
  text-shadow: 0 0 14px rgba(56, 232, 255, 0.75);
}

.combo .combo-label {
  font-size: 9px;
  letter-spacing: 0.24em;
  color: var(--cyan);
}

.combo em {
  font-style: normal;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 800;
  color: var(--lime);
}

.combo.hot {
  border-color: rgba(255, 200, 87, 0.7);
  box-shadow: 0 0 18px rgba(255, 200, 87, 0.25);
}

.combo.hot em {
  color: var(--amber);
}

.combo-speed {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: #8fe9ff;
  letter-spacing: 0.02em;
}

.combo.hot .combo-speed {
  color: var(--amber);
}

.combo i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--lime));
  transition: width 90ms linear;
}

.combo.pop {
  animation: comboPop 220ms ease-out;
}

@keyframes comboPop {
  0% {
    transform: scale(1.16);
  }
  100% {
    transform: scale(1);
  }
}

.hud-missions {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 260px;
}

.hud-missions li {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(8, 12, 28, 0.55);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px 9px;
  font-size: 12px;
  color: #c9d5f2;
  backdrop-filter: blur(6px);
}

.hud-missions li b {
  margin-left: auto;
  font-family: var(--mono);
  color: var(--cyan);
}

.hud-missions li i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--magenta);
  box-shadow: 0 0 8px var(--magenta);
  flex: 0 0 auto;
}

.hud-missions li.done {
  color: var(--lime);
  border-color: rgba(182, 242, 74, 0.4);
}

.hud-missions li.done i {
  background: var(--lime);
  box-shadow: 0 0 8px var(--lime);
}

.hud-bottom {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.nitro {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(250px, 30vw);
}

.nitro-bar {
  position: relative;
  flex: 1;
  height: 13px;
  border-radius: 8px;
  background: rgba(6, 10, 24, 0.75);
  border: 1px solid rgba(56, 232, 255, 0.28);
  overflow: hidden;
}

.nitro-bar i {
  position: absolute;
  inset: 1px;
  width: 0%;
  border-radius: 7px;
  background: linear-gradient(90deg, #1c8dff, var(--cyan) 60%, #d9fbff);
  box-shadow: 0 0 16px rgba(56, 232, 255, 0.8);
  transition: width 90ms linear;
}

.nitro-bar.hot i {
  background: linear-gradient(90deg, #ff7a18, var(--amber));
  box-shadow: 0 0 20px rgba(255, 200, 87, 0.9);
}

.nitro em {
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

/* 屏幕中下的仪表盘（指针时速表 + 油量） */
.speedo {
  position: absolute;
  left: 50%;
  bottom: max(2px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: clamp(190px, 21vh, 300px);
  aspect-ratio: 200 / 132;
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.55));
}

.shield-badge {
  margin-bottom: 6px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #06121c;
  font-weight: 800;
  background: linear-gradient(180deg, #b9f6ff, #38e8ff);
  border-radius: 999px;
  padding: 5px 12px;
  box-shadow: 0 0 20px rgba(56, 232, 255, 0.6);
}

.pause-btn {
  position: absolute;
  top: clamp(12px, 2.2vw, 26px);
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(8, 12, 28, 0.6);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

/* ---------- Screens ---------- */

.screens {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: auto;
  padding: clamp(14px, 3vw, 34px);
  overflow: auto;
}

.screen.is-active {
  display: flex;
  flex-direction: column;
}

#screen-menu.is-active,
#screen-result.is-active,
#screen-pause.is-active {
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 44%, rgba(8, 12, 30, 0.28), rgba(3, 5, 13, 0.72) 66%);
  backdrop-filter: blur(2px);
}

/* menu */

.menu-wrap {
  width: min(560px, 100%);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.4vh, 26px);
  animation: rise 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.brand-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.5em;
  color: var(--cyan);
  opacity: 0.85;
}

.brand-title {
  font-size: clamp(48px, 12vw, 96px);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #ffffff 12%, #8fe9ff 52%, #2b9dff 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 26px rgba(56, 160, 255, 0.55));
}

.brand-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: clamp(12px, 2.6vw, 15px);
  letter-spacing: 0.16em;
}

.menu-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.menu-stats div {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-stats span {
  font-family: var(--mono);
  font-size: clamp(17px, 3.6vw, 22px);
  font-weight: 700;
  color: #fff;
}

.menu-stats small {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.menu-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn {
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
  background: var(--glass-soft);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  cursor: pointer;
  transition: transform 120ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.btn:hover {
  border-color: rgba(56, 232, 255, 0.5);
  background: rgba(28, 38, 74, 0.8);
}

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

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  border-color: var(--line);
}

.btn-primary {
  background: linear-gradient(120deg, #1d7cff, #38e8ff 70%, #9ff7ff);
  border-color: transparent;
  color: #041019;
  box-shadow: 0 10px 34px rgba(29, 124, 255, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.btn-primary:hover {
  background: linear-gradient(120deg, #3a8dff, #5df0ff 70%, #c9fdff);
  border-color: transparent;
}

.btn-xl {
  font-size: clamp(18px, 3.4vw, 22px);
  padding: 18px 22px;
  border-radius: 16px;
  letter-spacing: 0.16em;
}

.btn-ghost {
  background: rgba(10, 14, 30, 0.5);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
}

.menu-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.car-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  color: #c9d5f2;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px 7px 9px;
}

.car-chip .dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e8462f;
  box-shadow: 0 0 12px currentColor;
}

.hint {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #6f7c9c;
  text-align: center;
}

/* top bar (garage / missions) */

.top-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(12px, 2vh, 20px);
  flex: 0 0 auto;
}

.top-bar h2 {
  font-size: clamp(20px, 4vw, 26px);
  letter-spacing: 0.18em;
  font-weight: 800;
}

.top-bar .btn {
  order: -1;
}

.coin-pill {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--amber);
  background: rgba(255, 200, 87, 0.1);
  border: 1px solid rgba(255, 200, 87, 0.32);
  border-radius: 999px;
  padding: 8px 16px;
}

#screen-garage.is-active,
#screen-missions.is-active {
  background: linear-gradient(180deg, rgba(4, 6, 16, 0.94), rgba(6, 10, 26, 0.97));
}

/* garage */

.garage-body {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: clamp(12px, 2vw, 22px);
  align-items: start;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  /* 大显示器上不要把车库拉成超宽表格，否则升级按钮会被甩到屏幕最右边 */
  max-width: 1180px;
  margin: 0 auto;
}

.top-bar {
  width: 100%;
  max-width: 1180px;
  margin-left: auto;
  margin-right: auto;
}

.car-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  min-width: 0;
}

.car-item {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--glass);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font-family: inherit;
  transition: border-color 150ms ease, transform 150ms ease, background 150ms ease;
}

.car-item:hover {
  transform: translateX(2px);
  border-color: rgba(56, 232, 255, 0.42);
}

.car-item.is-selected {
  border-color: var(--cyan);
  background: rgba(24, 46, 84, 0.72);
  box-shadow: 0 0 0 1px rgba(56, 232, 255, 0.3), 0 12px 30px rgba(0, 0, 0, 0.4);
}

.car-thumb {
  width: 54px;
  height: 34px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.car-thumb canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.car-item .meta {
  min-width: 0;
  overflow: hidden;
}

.car-item .meta strong {
  display: block;
  font-size: 14px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.car-item .meta small {
  color: var(--muted);
  font-size: 11px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.car-item .tag {
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.car-item .tag.owned {
  color: var(--lime);
  border-color: rgba(182, 242, 74, 0.4);
}

.car-item .tag.equipped {
  color: #041019;
  background: linear-gradient(120deg, #38e8ff, #9ff7ff);
  border-color: transparent;
  font-weight: 800;
}

.car-item.is-locked .meta strong {
  color: #8d9ab9;
}

.car-detail {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(12px, 1.8vw, 20px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(120, 200, 255, 0.4) transparent;
}
  overflow: auto;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.detail-head h3 {
  font-size: clamp(19px, 3.4vw, 24px);
  letter-spacing: 0.04em;
}

.detail-head p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  letter-spacing: 0.08em;
}

.detail-price {
  margin-left: auto;
  text-align: right;
  font-family: var(--mono);
  color: var(--amber);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

/* 属性两列排布，腾出高度让五项升级一屏可见 */
.stat-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 14px;
}

.stat-row {
  display: grid;
  grid-template-columns: 34px 1fr 64px;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--muted);
}

.stat-row .bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.stat-row .bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1d7cff, var(--cyan));
  box-shadow: 0 0 12px rgba(56, 232, 255, 0.5);
}

.stat-row b {
  font-family: var(--mono);
  color: #dce6ff;
  text-align: right;
  white-space: nowrap;
}

.upgrade-list {
  display: grid;
  gap: 6px;
}

.upgrade-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 12px;
  background: rgba(8, 12, 28, 0.55);
  border: 1px solid var(--line);
}

.upgrade-row .info .title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pips {
  display: inline-flex;
  gap: 3px;
}

.upgrade-row .info strong {
  font-size: 13px;
  letter-spacing: 0.06em;
}

.upgrade-row .info small {
  display: block;
  color: var(--muted);
  font-size: 10.5px;
  margin-top: 1px;
}

.pips {
  display: inline-flex;
  gap: 3px;
}

.pips i {
  width: 12px;
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
}

.pips i.on {
  background: linear-gradient(90deg, #38e8ff, #b6f24a);
  box-shadow: 0 0 8px rgba(56, 232, 255, 0.6);
}

.upgrade-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 2px;
}

.upgrade-head strong {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: #cfdcff;
}

.upgrade-head small {
  font-size: 10.5px;
  color: #6f7c9c;
  letter-spacing: 0.06em;
}

/* 宽屏把五项升级排两列，一眼能看全，不用找 */
@media (min-width: 1000px) {
  .upgrade-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.upgrade-row .btn {
  font-size: 12px;
  padding: 9px 13px;
  border-radius: 10px;
}

.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  position: sticky;
  bottom: -2px;
  padding-top: 8px;
  background: linear-gradient(180deg, rgba(13, 17, 38, 0) 0%, rgba(13, 17, 38, 0.94) 45%);
}

.detail-actions .btn {
  flex: 1;
}

.detail-note {
  font-size: 11px;
  color: #6f7c9c;
  letter-spacing: 0.06em;
}

/* missions */

.mission-body {
  width: min(680px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mission-lead {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
  line-height: 1.7;
}

.mission-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mission-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--glass);
}

.mission-row .icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: rgba(56, 232, 255, 0.1);
  border: 1px solid rgba(56, 232, 255, 0.24);
  flex: 0 0 auto;
}

.mission-row .text {
  flex: 1;
}

.mission-row .text strong {
  font-size: 14px;
  letter-spacing: 0.04em;
}

.mission-row .text small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.mission-row .reward {
  font-family: var(--mono);
  color: var(--amber);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}

/* result */

.result-card {
  width: min(520px, 100%);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: clamp(18px, 3vw, 30px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: rise 340ms cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  max-height: 100%;
  overflow: auto;
}

.result-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.result-head .result-kicker {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--muted);
  margin-right: auto;
}

.result-head strong {
  font-family: var(--mono);
  font-size: clamp(40px, 9vw, 60px);
  font-weight: 800;
  color: #fff;
  line-height: 1;
  text-shadow: 0 0 30px rgba(56, 232, 255, 0.5);
}

.result-head small {
  color: var(--muted);
  font-size: 12px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.result-grid div {
  background: rgba(6, 10, 24, 0.6);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.result-grid span {
  font-family: var(--mono);
  font-size: clamp(15px, 3.2vw, 19px);
  font-weight: 700;
}

.result-grid small {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.result-coins {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(255, 200, 87, 0.14), rgba(255, 77, 157, 0.1));
  border: 1px solid rgba(255, 200, 87, 0.3);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: #f2e2bd;
}

.result-coins b {
  font-family: var(--mono);
  font-size: 22px;
  color: var(--amber);
}

.result-missions {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-missions li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(6, 10, 24, 0.45);
  border: 1px solid var(--line);
}

.result-missions li.done {
  color: var(--lime);
  border-color: rgba(182, 242, 74, 0.36);
  background: rgba(80, 120, 20, 0.16);
}

.result-missions li b {
  font-family: var(--mono);
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.record-tag {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--amber);
  text-shadow: 0 0 18px rgba(255, 200, 87, 0.7);
}

/* pause */

.pause-card {
  width: min(360px, 100%);
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  text-align: center;
}

.pause-card h2 {
  letter-spacing: 0.4em;
  font-size: 20px;
}

/* touch controls */

.touch-controls {
  position: absolute;
  inset: auto 0 0 0;
  display: none;
  justify-content: space-between;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  pointer-events: none;
}

.touch-controls button {
  pointer-events: auto;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 1px solid rgba(120, 200, 255, 0.3);
  background: rgba(10, 16, 36, 0.62);
  color: #d9e6ff;
  font-size: 22px;
  font-family: inherit;
  backdrop-filter: blur(8px);
  touch-action: none;
}

.touch-controls .touch-nitro {
  width: 88px;
  font-size: 14px;
  letter-spacing: 0.1em;
  color: #041019;
  font-weight: 800;
  background: linear-gradient(120deg, #38e8ff, #9ff7ff);
  border: none;
}

.touch-controls button:active {
  transform: scale(0.95);
}

body.is-touch .touch-controls {
  display: flex;
  align-items: flex-end;
}

/* 触屏时氮气键上移到右侧，给中下的仪表盘腾位置 */
body.is-touch .touch-controls .touch-nitro {
  position: absolute;
  right: 22px;
  bottom: calc(104px + env(safe-area-inset-bottom));
  width: 78px;
  height: 62px;
  border-radius: 26px;
}

body.is-touch .speedo {
  width: min(200px, 40vw);
}

body.is-touch .hud-missions {
  max-width: 180px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 720px) {
  .garage-body {
    grid-template-columns: 1fr;
  }

  .car-list {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .car-item {
    min-width: 210px;
  }

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

  .stat-row {
    grid-template-columns: 54px 1fr 50px;
  }

  .hud-missions {
    font-size: 11px;
  }
}

/* 矮窗口：把车库再收紧，保证五项升级和底部按钮都在屏内 */
@media (max-height: 700px) {
  .detail-note {
    display: none;
  }

  .upgrade-row .info small {
    font-size: 10px;
    margin-top: 0;
  }

  .upgrade-row .btn {
    padding: 7px 11px;
  }

  .detail-head h3 {
    font-size: 18px;
  }

  .detail-head p {
    font-size: 11px;
    margin-top: 2px;
  }
}

/* 矮窗口（笔记本小窗 / 横屏手机）下把界面收紧，保证主要按钮不用滚 */
@media (max-height: 680px) {
  .menu-wrap {
    gap: 10px;
  }

  .brand-title {
    font-size: clamp(36px, 9vw, 64px);
  }

  .result-card {
    gap: 9px;
    padding: 14px 16px;
  }

  .result-head strong {
    font-size: clamp(28px, 7vw, 42px);
  }

  .result-grid div {
    padding: 7px 9px;
  }

  .result-grid span {
    font-size: 15px;
  }

  .result-coins {
    padding: 9px 12px;
  }

  .result-coins b {
    font-size: 18px;
  }

  .result-missions li {
    padding: 5px 10px;
  }

  .btn-xl {
    padding: 12px 18px;
    font-size: 17px;
  }

  .btn {
    padding: 11px 14px;
  }
}
