/* ============================================================
 * NEON DRIFT · 界面样式
 * 竞速风格：深空底 + 霓虹强调色 + 等宽数字 + 玻璃拟态面板
 * ============================================================ */

:root {
  --accent: #24e6ff;
  --ink: #e9f6ff;
  --dim: rgba(186, 212, 234, 0.62);
  --line: rgba(120, 190, 230, 0.18);
  --panel: rgba(7, 11, 24, 0.82);
  --font: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', system-ui, -apple-system, sans-serif;
  --mono: Consolas, 'SFMono-Regular', Menlo, 'Courier New', monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: #04050d;
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* -------------------------------------------------- 画布 */
#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

/* -------------------------------------------------- 全屏氛围层 */
.fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

#fx-vignette {
  background:
    radial-gradient(ellipse 78% 62% at 50% 52%, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, 0.62) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 74%, rgba(0, 0, 0, 0.55) 100%);
}

#fx-speed {
  background: radial-gradient(
    ellipse 46% 40% at 50% 50%,
    rgba(160, 225, 255, 0) 40%,
    rgba(160, 225, 255, 0.16) 74%,
    rgba(160, 225, 255, 0) 92%
  );
  opacity: 0;
  mix-blend-mode: screen;
}

#fx-boost {
  background:
    radial-gradient(ellipse 60% 52% at 50% 50%, rgba(36, 230, 255, 0) 44%, rgba(36, 230, 255, 0.34) 100%),
    linear-gradient(180deg, rgba(36, 230, 255, 0.16), rgba(36, 230, 255, 0) 30%);
  opacity: 0;
  mix-blend-mode: screen;
}

#fx-damage {
  background: radial-gradient(
    ellipse 70% 60% at 50% 50%,
    rgba(255, 30, 80, 0) 30%,
    rgba(255, 30, 80, 0.55) 100%
  );
  opacity: 0;
}

#fx-scan {
  background: repeating-linear-gradient(
    180deg,
    rgba(180, 230, 255, 0.05) 0px,
    rgba(180, 230, 255, 0.05) 1px,
    rgba(0, 0, 0, 0) 1px,
    rgba(0, 0, 0, 0) 3px
  );
  opacity: 0.34;
  mix-blend-mode: overlay;
}

/* -------------------------------------------------- HUD 容器 */
#hud {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

#hud.visible {
  opacity: 1;
}

#hud.shake {
  animation: hudShake 0.3s ease-out;
}

@keyframes hudShake {
  0%, 100% { transform: translate(0, 0); }
  18% { transform: translate(-7px, 4px); }
  38% { transform: translate(6px, -5px); }
  58% { transform: translate(-4px, -3px); }
  78% { transform: translate(3px, 2px); }
}

/* ---------- 顶部 ---------- */
.hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 22px;
}

.hud-block {
  flex: 0 0 auto;
  min-width: 150px;
}

.hud-left { text-align: left; }
.hud-right { text-align: right; }
.align-right { text-align: right; }

.hud-center {
  flex: 1 1 auto;
  text-align: center;
  padding-top: 2px;
}

.chip {
  display: inline-block;
  padding: 4px 13px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.22em;
  box-shadow: 0 0 16px -2px var(--accent), inset 0 0 12px -6px var(--accent);
}

.hud-sub {
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--dim);
}

.hud-sub b {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  letter-spacing: 0;
}

/* -------------------------------------------------- 右上角控制芯片（视角 / 音效 / 全屏） */
/* 常驻图层：z-index 高于各个全屏面板，菜单与暂停界面下也能操作 */
#quickbar {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 26;
  pointer-events: none;
}

/* 芯片移出 HUD 后，给"里程"一行让出空间 */
#hud .hud-right {
  padding-top: 50px;
}

.hud-buttons {
  display: inline-flex;
  gap: 9px;
  justify-content: flex-end;
}

.ctrl-btn {
  /* 关键：#hud 是 pointer-events:none，芯片必须显式开启才可点击 */
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(13, 21, 40, 0.88), rgba(7, 11, 22, 0.72));
  color: var(--ink);
  cursor: pointer;
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 22px -16px #000;
  transition: border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.ctrl-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 20px -8px var(--accent);
  transform: translateY(-1px);
}

.ctrl-btn:active {
  transform: translateY(0);
}

.ctrl-btn:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 2px;
}

.ctrl-ico {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.ctrl-ico svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ctrl-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  line-height: 1;
}

.ctrl-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

/* 视角：三点档位指示器 */
.ctrl-dots {
  display: inline-flex;
  gap: 3px;
}

.ctrl-dots i {
  width: 10px;
  height: 2px;
  border-radius: 1px;
  background: rgba(196, 222, 244, 0.22);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.ctrl-dots i.on {
  background: var(--accent);
  box-shadow: 0 0 7px var(--accent);
}

/* 音效：ON / OFF 状态字 */
.ctrl-state {
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.18em;
  color: rgba(110, 240, 180, 0.9);
}

.ctrl-state.off {
  color: rgba(255, 130, 150, 0.85);
}

.ctrl-key {
  min-width: 0;
  padding: 2px 4px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(198, 224, 246, 0.5);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0;
}

/* 静音时切换喇叭图标并整体降调 */
#mute-btn .ico-muted { display: none; }
#mute-btn.off { color: rgba(255, 255, 255, 0.42); border-color: rgba(255, 120, 150, 0.28); }
#mute-btn.off .ico-sound { display: none; }
#mute-btn.off .ico-muted { display: block; }

/* 全屏时切换为"向内收"图标，并高亮状态 */
#fs-btn .ico-exit { display: none; }
#fs-btn.on { color: var(--accent); border-color: var(--accent); }
#fs-btn.on .ico-enter { display: none; }
#fs-btn.on .ico-exit { display: block; }
#fs-btn.on .ctrl-state { color: var(--accent); }
#fs-btn[hidden] { display: none; }

.score-label {
  font-size: 10.5px;
  letter-spacing: 0.42em;
  color: var(--dim);
}

.score-value {
  font-family: var(--mono);
  font-size: clamp(34px, 5.2vw, 60px);
  font-weight: 700;
  line-height: 1.05;
  color: #fff;
  text-shadow: 0 0 18px rgba(36, 230, 255, 0.75), 0 0 52px rgba(36, 230, 255, 0.32);
}

.combo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
}

.combo-track {
  width: min(230px, 40vw);
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.combo-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #ffc23d);
  box-shadow: 0 0 12px var(--accent);
  transition: width 0.14s linear;
}

.combo-mult {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.2s;
}

.combo-mult.visible { opacity: 1; }

/* ---------- 底部 ---------- */
.hud-bottom {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 18px;
}

.meters {
  display: grid;
  gap: 13px;
  width: min(32vw, 300px);
}

.meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--dim);
  margin-bottom: 5px;
}

.meter-head b {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink);
  letter-spacing: 0;
}

.meter-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.14s linear;
}

.hp-fill {
  background: linear-gradient(90deg, #3ee6a0, #a8ff6b);
  box-shadow: 0 0 16px rgba(62, 230, 160, 0.7);
}

.hp-fill.critical {
  background: linear-gradient(90deg, #ff3d81, #ff8a3d);
  box-shadow: 0 0 18px rgba(255, 61, 129, 0.85);
  animation: pulse 0.7s ease-in-out infinite;
}

/* 拾取维修核心的瞬间：血条绿闪（回血只来自道具，不再是持续状态） */
.hp-fill.healing {
  background: linear-gradient(90deg, #3dff9a, #8affd0);
  box-shadow: 0 0 26px rgba(61, 255, 154, 1);
  animation: healFlash 0.62s ease-out;
}

@keyframes healFlash {
  0% { filter: brightness(2.1); transform: scaleY(1.5); }
  40% { filter: brightness(1.5); transform: scaleY(1.2); }
  100% { filter: brightness(1); transform: scaleY(1); }
}

.repair-badge {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 7px;
  border-radius: 999px;
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: #04170d;
  background: #3dff9a;
  box-shadow: 0 0 14px rgba(61, 255, 154, 0.8);
  opacity: 0;
  transform: translateY(-1px);
  transition: opacity 0.2s ease;
}

.repair-badge.visible {
  opacity: 1;
}

/* 护罩徽标：白色能量场风，激活期间闪烁倒计时 */
.shield-badge {
  color: #0b1220;
  background: #eaf6ff;
  box-shadow: 0 0 14px rgba(234, 246, 255, 0.85);
}

.shield-badge.visible {
  opacity: 1;
  animation: shield-pulse 1s ease-in-out infinite;
}

@keyframes shield-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(234, 246, 255, 0.6); }
  50% { box-shadow: 0 0 20px rgba(234, 246, 255, 1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.boost-fill {
  background: linear-gradient(90deg, #24e6ff, #8f6bff);
  box-shadow: 0 0 16px rgba(36, 230, 255, 0.75);
}

/* ---------- 速度表 ---------- */
.gauge {
  position: relative;
  width: 172px;
  height: 172px;
  flex: 0 0 auto;
  filter: drop-shadow(0 0 22px rgba(36, 230, 255, 0.22));
}

.gauge svg {
  width: 100%;
  height: 100%;
  display: block;
}

.gauge-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 5;
}

.gauge-arc {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke 0.3s;
  filter: drop-shadow(0 0 7px var(--accent));
}

.needle-line {
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px var(--accent));
}

.needle-hub {
  fill: var(--accent);
  filter: drop-shadow(0 0 8px var(--accent));
}

.gauge-readout {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 34px;
  text-align: center;
}

.gauge-readout b {
  display: block;
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 16px var(--accent);
}

.gauge-readout i {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-size: 9.5px;
  letter-spacing: 0.32em;
  color: var(--dim);
}

/* ---------- 飘字 ---------- */
.popups {
  position: absolute;
  left: 50%;
  top: 56%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.popup {
  animation: popupRise 1s ease-out forwards;
  text-align: center;
  white-space: nowrap;
}

.popup b {
  display: block;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-shadow: 0 0 16px currentColor;
}

.popup i {
  display: block;
  font-style: normal;
  font-size: 11.5px;
  opacity: 0.75;
  letter-spacing: 0.16em;
}

@keyframes popupRise {
  0% { opacity: 0; transform: translateY(16px) scale(0.88); }
  18% { opacity: 1; transform: translateY(0) scale(1.05); }
  60% { opacity: 1; transform: translateY(-24px) scale(1); }
  100% { opacity: 0; transform: translateY(-52px) scale(0.98); }
}

/* -------------------------------------------------- 全屏面板 */
.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 22px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.32s ease, visibility 0.32s ease;
  background:
    radial-gradient(ellipse 90% 70% at 50% 38%, rgba(24, 12, 52, 0.62), rgba(3, 4, 10, 0.93)),
    rgba(3, 4, 10, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.screen.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.screen-inner {
  width: min(1120px, 100%);
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.screen-foot {
  position: absolute;
  bottom: 16px;
  font-size: 10.5px;
  letter-spacing: 0.24em;
  color: rgba(150, 180, 205, 0.42);
}

/* ---------- 标题 ---------- */
.title-block {
  text-align: center;
}

.title-kicker {
  font-size: 10.5px;
  letter-spacing: 0.5em;
  color: var(--accent);
  text-shadow: 0 0 16px rgba(36, 230, 255, 0.6);
  margin-bottom: 8px;
}

.game-title {
  font-size: clamp(42px, 8.4vw, 92px);
  font-weight: 900;
  line-height: 0.86;
  letter-spacing: -0.02em;
  color: #f2fbff;
  text-shadow: 0 0 34px rgba(36, 230, 255, 0.45), 0 0 90px rgba(36, 230, 255, 0.22);
}

.game-title span { display: inline-block; }

.game-title .accent-word {
  color: transparent;
  background-image: linear-gradient(180deg, #ffffff 8%, var(--accent) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 26px rgba(36, 230, 255, 0.75));
}

.title-cn {
  margin-top: 10px;
  font-size: 14px;
  letter-spacing: 0.52em;
  color: var(--dim);
}

/* ---------- 菜单栅格 ---------- */
.menu-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(0, 1fr);
  gap: 24px;
  width: 100%;
  margin-top: 22px;
}

.section-label {
  font-size: 10.5px;
  letter-spacing: 0.36em;
  color: var(--dim);
  padding-bottom: 7px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

/* ---------- 难度卡片 ---------- */
.diff-list {
  display: grid;
  gap: 9px;
}

.diff-card {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.012));
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.diff-card:hover {
  transform: translateX(5px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
  box-shadow: -6px 0 26px -14px var(--accent);
}

.diff-card.selected {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.02));
  box-shadow: 0 0 0 1px var(--accent), 0 14px 40px -18px var(--accent);
}

.diff-tag {
  position: absolute;
  top: 13px;
  right: 15px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.28em;
  color: var(--accent);
  opacity: 0.9;
}

.diff-name {
  display: block;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.diff-desc {
  display: block;
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--dim);
}

.diff-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 9px;
}

.stat {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.stat i {
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--dim);
}

.stat b {
  font-family: var(--mono);
  font-size: 16px;
  color: #fff;
}

.stat em {
  font-style: normal;
  font-size: 9px;
  color: rgba(186, 212, 234, 0.5);
}

.diff-best {
  display: block;
  margin-top: 7px;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--dim);
}

.diff-best b {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0;
  color: var(--accent);
}

/* ---------- 按钮 ---------- */
.primary-btn {
  width: 100%;
  margin-top: 14px;
  padding: 14px 26px;
  border: none;
  border-radius: 12px;
  font-size: 16.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #04121a;
  background: linear-gradient(120deg, var(--accent), #a5f4ff);
  box-shadow: 0 0 30px -6px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.5);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 40px -4px var(--accent), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.primary-btn:active { transform: translateY(0); }

.ghost-btn {
  padding: 13px 22px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font-size: 13.5px;
  letter-spacing: 0.12em;
  transition: border-color 0.16s ease, color 0.16s ease, background 0.16s ease;
}

.ghost-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(36, 230, 255, 0.06);
}

.hint-line {
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(186, 212, 234, 0.45);
}

/* ---------- 侧栏信息 ---------- */
.keymap,
.best-list {
  list-style: none;
  display: grid;
  gap: 7px;
}

/* 两列排布，压缩菜单高度 */
.keymap {
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
}

.keymap li {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--dim);
}

kbd {
  min-width: 24px;
  padding: 3px 7px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.055);
  color: #fff;
  font-family: var(--mono);
  font-size: 10.5px;
  text-align: center;
}

.keymap li span {
  margin-left: auto;
  color: rgba(186, 212, 234, 0.72);
}

.best-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  border-left: 2px solid var(--accent);
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
}

.best-list li b {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 15px;
}

.tip-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px dashed rgba(36, 230, 255, 0.3);
  background: rgba(36, 230, 255, 0.05);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--dim);
}

.tip-box b {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.tip-box .inline-ok {
  display: inline;
  margin: 0;
  color: #3dff9a;
  letter-spacing: 0;
  font-size: inherit;
}

/* ---------- 色卡图例：颜色 = 功能语言 ---------- */
.legend {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 16px;
  row-gap: 6px;
}

.legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.legend .lg-name {
  color: var(--ink);
}

.legend em {
  margin-left: auto;
  font-style: normal;
  font-size: 11px;
  color: var(--dim);
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  flex: 0 0 auto;
}

/* 危险色阶：黄 → 橙 → 红 */
.danger-1 { background: #ffd23d; box-shadow: 0 0 12px #ffd23d; }
.danger-2 { background: #ff6a1f; box-shadow: 0 0 12px #ff6a1f; }
.danger-3 { background: #ff2d55; box-shadow: 0 0 12px #ff2d55; }
/* 道具：绿=回血，青=能量 */
.item-repair { background: #3dff9a; box-shadow: 0 0 12px #3dff9a; }
.item-energy { background: #24e6ff; box-shadow: 0 0 12px #24e6ff; }

/* ---------- 暂停 / 结算面板 ---------- */
.panel {
  width: min(560px, 100%);
  margin: auto;
  padding: 34px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--panel);
  text-align: center;
  box-shadow: 0 34px 90px -34px #000, inset 0 1px 0 rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.panel-kicker {
  font-size: 10.5px;
  letter-spacing: 0.42em;
  color: var(--accent);
}

.panel h2 {
  margin: 8px 0 18px;
  font-size: 29px;
  letter-spacing: 0.1em;
}

.panel-stats,
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}

.panel-stats > div,
.result-grid > div {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
}

.panel-stats i,
.result-grid i {
  display: block;
  margin-bottom: 6px;
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--dim);
}

.panel-stats b,
.result-grid b {
  font-family: var(--mono);
  font-size: 20px;
  color: #fff;
}

.result-score {
  margin: 4px 0 20px;
}

.result-score i {
  display: block;
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: 0.34em;
  color: var(--dim);
}

.result-score b {
  font-family: var(--mono);
  font-size: clamp(48px, 11vw, 74px);
  font-weight: 800;
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 0 28px var(--accent), 0 0 66px rgba(36, 230, 255, 0.4);
}

.record-badge {
  display: inline-block;
  margin-bottom: 10px;
  padding: 5px 15px;
  border-radius: 999px;
  background: var(--accent);
  color: #04121a;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.3em;
  opacity: 0;
  transform: scale(0.82);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.record-badge.visible {
  opacity: 1;
  transform: scale(1);
}

#over-title.record {
  color: var(--accent);
  text-shadow: 0 0 30px var(--accent);
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.panel-actions .primary-btn {
  width: auto;
  margin-top: 0;
  padding: 14px 32px;
}

.panel-hint {
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(186, 212, 234, 0.45);
}

/* -------------------------------------------------- 倒计时 */
#countdown {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  align-content: center;
  /* 上移一点，让提示行不会压在车身上 */
  padding-bottom: 9vh;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

#countdown.visible {
  opacity: 1;
  visibility: visible;
}

#countdown-num {
  font-family: var(--mono);
  font-size: clamp(88px, 19vw, 210px);
  font-weight: 900;
  line-height: 1;
  color: #fff;
  text-shadow: 0 0 42px var(--accent), 0 0 110px var(--accent);
  animation: cdPop 0.72s ease-out;
}

@keyframes cdPop {
  0% { transform: scale(1.65); opacity: 0; }
  38% { opacity: 1; }
  100% { transform: scale(1); opacity: 0.94; }
}

#countdown-label {
  margin-top: 6px;
  font-size: 12.5px;
  letter-spacing: 0.4em;
  color: var(--dim);
}

/* 倒计时里的操作提示行（独立节点，纯文本写入） */
#countdown-hint {
  margin-top: 12px;
  font-size: 12.5px;
  letter-spacing: 0.16em;
  color: rgba(214, 232, 248, 0.82);
  text-shadow: 0 0 14px rgba(36, 230, 255, 0.25);
  min-height: 1em;
}

#countdown-hint:empty {
  margin-top: 0;
}

/* -------------------------------------------------- 提示 / 错误 */
#toast {
  position: fixed;
  left: 50%;
  bottom: 118px;
  transform: translateX(-50%);
  z-index: 40;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(6, 10, 22, 0.92);
  font-size: 13px;
  letter-spacing: 0.1em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

#error-panel {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(3, 4, 10, 0.95);
}

#error-panel.visible { display: grid; }

#error-panel .err-msg {
  margin-bottom: 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: #ff7d9c;
  word-break: break-all;
}

/* -------------------------------------------------- 响应式 */
@media (max-width: 900px) {
  .menu-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .hud-top {
    padding: 14px 14px;
  }

  .hud-block { min-width: 0; }

  .hud-bottom {
    left: 14px;
    right: 14px;
    bottom: 12px;
  }

  .meters { width: min(46vw, 250px); }

  .gauge {
    width: 128px;
    height: 128px;
  }

  .gauge-readout { bottom: 22px; }
  .gauge-readout b { font-size: 22px; }

  .popups { top: 46%; }
}

@media (max-width: 560px) {
  .screen { padding: 16px; }

  .hud-bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .meters { width: 100%; }
  .gauge { align-self: flex-end; }
  .diff-stats { gap: 11px; }
}

/* -------------------------------------------------- 快捷控制条响应式 */
@media (max-width: 900px) {
  #quickbar {
    top: 14px;
    right: 14px;
  }

  .hud-buttons { gap: 6px; }

  .ctrl-btn {
    padding: 5px 6px 5px 7px;
    gap: 6px;
  }

  .ctrl-label { font-size: 10.5px; }

  /* 小屏隐藏热键角标，避免芯片过长 */
  .ctrl-key { display: none; }

  #hud .hud-right { padding-top: 44px; }
}

@media (max-width: 560px) {
  /* 极窄屏只保留图标，文案交给 tooltip */
  .ctrl-body { display: none; }
  .ctrl-btn { padding: 8px; }
  #hud .hud-right { padding-top: 42px; }
}
