/* =========================================================
   队列防线 · CONVOY LINE
   深色克制风格，与迅易达官网视觉保持一致
   ========================================================= */

:root {
  --ink: #0a0f0d;
  --ink-soft: #111a15;
  --panel: #101a14;
  --paper: #f4f5ef;
  --white: #fbfcf8;
  --acid: #d8f36b;
  --acid-strong: #c9ee4a;
  --teal: #77e7c5;
  --coral: #ff8377;
  --muted: #9aa8a0;
  --muted-dim: #64706a;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC",
    "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: #070b09;
  color: var(--paper);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button {
  font-family: inherit;
  color: inherit;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

svg {
  display: block;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}

/* ---------------- 顶栏 ---------------- */

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 50px;
  padding: 0 13px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #0c130f 0%, #090e0b 100%);
}

.back-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.back-links a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 30px;
  padding: 0 8px;
  border-radius: 999px;
  color: rgba(251, 252, 248, 0.62);
  font-size: 11.5px;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}

.back-links a svg {
  width: 12px;
  height: 12px;
}

.back-links a:hover {
  color: var(--acid);
  background: rgba(216, 243, 107, 0.08);
}

.title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.title-mark {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}

.title-mark i {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: var(--acid);
  transform: rotate(45deg);
  opacity: 0.45;
}

.title-mark i:nth-child(2) {
  width: 7px;
  height: 7px;
  opacity: 1;
}

.title-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.title-copy strong {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.title-copy em {
  color: rgba(251, 252, 248, 0.35);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.22em;
  white-space: nowrap;
}

.tag {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid rgba(216, 243, 107, 0.22);
  border-radius: 4px;
  color: rgba(216, 243, 107, 0.7);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

/* ---------------- 状态栏 ---------------- */

.hud {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 7px 13px 8px;
  border-bottom: 1px solid var(--line);
  background: #0a110d;
}

.hud-wave {
  min-width: 62px;
}

.hud-label {
  display: block;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.18em;
}

.hud-wave-line {
  display: flex;
  align-items: baseline;
  gap: 3px;
  line-height: 1.1;
}

.hud-wave-line strong {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hud-wave-line span {
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 9px;
}

.hud-wave em {
  display: block;
  margin-top: 1px;
  color: var(--muted-dim);
  font-size: 8.5px;
  font-style: normal;
  line-height: 1.2;
}

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

.hud-hp-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.hud-hp-top span {
  color: var(--muted-dim);
  font-size: 8.5px;
  letter-spacing: 0.08em;
}

.hud-hp-top b {
  color: var(--paper);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 600;
}

.hp-track {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
}

.hp-track i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal) 0%, var(--acid) 100%);
  transition: width 0.22s ease, background 0.3s ease;
}

.hp-track i.low {
  background: linear-gradient(90deg, #ff6b5e 0%, #ffa27a 100%);
}

.hud-score {
  min-width: 66px;
  text-align: right;
}

.hud-score strong {
  display: block;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hud-score em {
  display: block;
  margin-top: 1px;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 8px;
  font-style: normal;
  white-space: nowrap;
}

/* ---------------- 舞台 ---------------- */

.stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #080d0a;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

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

.banner {
  position: absolute;
  top: 7%;
  left: 50%;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  pointer-events: none;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, -10px);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

.banner strong {
  color: var(--acid);
  font-family: var(--mono);
  font-size: clamp(20px, 5.4vw, 30px);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-shadow: 0 0 30px rgba(216, 243, 107, 0.35);
  white-space: nowrap;
}

.banner span {
  color: rgba(251, 252, 248, 0.6);
  font-size: 10px;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

.hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  z-index: 6;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(8, 13, 10, 0.7);
  color: rgba(251, 252, 248, 0.56);
  font-size: 10px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

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

/* ---------------- Boss 血条 ---------------- */

.bossbar {
  position: absolute;
  top: 8px;
  right: 12px;
  left: 12px;
  z-index: 7;
  padding: 7px 10px 8px;
  border: 1px solid rgba(255, 131, 119, 0.3);
  border-radius: 11px;
  background: linear-gradient(180deg, rgba(31, 13, 11, 0.92), rgba(9, 13, 11, 0.88));
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 180, 160, 0.08);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  transform: translateY(-7px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.3s ease, border-color 0.3s ease;
}

.bossbar.show {
  opacity: 1;
  transform: translateY(0);
}

.bossbar.enraged {
  border-color: rgba(255, 126, 92, 0.6);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 26px rgba(255, 96, 60, 0.16);
}

.bossbar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.bossbar-name {
  color: #ffd9d3;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  white-space: nowrap;
}

.bossbar-head em {
  color: rgba(255, 131, 119, 0.78);
  font-family: var(--mono);
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.bossbar-track {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.bossbar-track i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff5f52 0%, #ffa36b 100%);
  box-shadow: 0 0 14px rgba(255, 131, 119, 0.5);
  transition: width 0.12s linear;
}

.bossbar-track::before,
.bossbar-track::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 2;
  width: 1px;
  background: rgba(8, 13, 10, 0.85);
}

.bossbar-track::before {
  left: 30%;
}

.bossbar-track::after {
  left: 65%;
}

/* Boss 出现时把波次横幅下移，避免和血条重叠 */
.stage.boss-on .banner {
  top: 15%;
}

.boss-credit {
  margin-top: 10px;
  color: var(--coral);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-align: center;
}

/* ---------------- 浮层 ---------------- */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  overflow-y: auto;
  background: rgba(5, 9, 7, 0.78);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.26s ease, visibility 0.26s;
  touch-action: pan-y;
}

.overlay.show {
  opacity: 1;
  visibility: visible;
}

.panel {
  position: relative;
  width: min(100%, 520px);
  margin: auto;
  padding: clamp(20px, 4vw, 30px);
  border: 1px solid rgba(216, 243, 107, 0.16);
  border-radius: 22px;
  background:
    radial-gradient(ellipse 90% 60% at 100% 0%, rgba(119, 231, 197, 0.09), transparent 70%),
    linear-gradient(165deg, #111c15 0%, #0a100c 100%);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--acid), transparent);
  opacity: 0.5;
}

.eyebrow {
  color: rgba(216, 243, 107, 0.72);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.24em;
}

.panel h1 {
  margin: 9px 0 0;
  font-size: clamp(30px, 8.5vw, 42px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.panel h2 {
  margin: 8px 0 0;
  font-size: clamp(23px, 6.4vw, 30px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.panel-lead {
  margin-top: 11px;
  color: rgba(251, 252, 248, 0.56);
  font-size: 12.5px;
  line-height: 1.85;
}

.howto {
  display: grid;
  gap: 7px;
  margin-top: 16px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.howto li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: rgba(251, 252, 248, 0.62);
  font-size: 11.5px;
  line-height: 1.65;
}

.howto li span {
  flex: 0 0 auto;
  min-width: 17px;
  padding-top: 1px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.panel-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
  color: var(--muted-dim);
  font-size: 9.5px;
  letter-spacing: 0.06em;
}

.panel-hint {
  display: none;
  margin-top: 8px;
  color: rgba(251, 252, 248, 0.5);
  font-size: 10px;
  line-height: 1.5;
}

.panel-meta strong {
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  margin-top: 15px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease,
    border-color 0.2s ease;
}

.btn:active {
  transform: scale(0.985);
}

.btn-primary {
  background: var(--acid);
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(216, 243, 107, 0.16);
}

.btn-primary:hover {
  background: var(--acid-strong);
}

.btn-ghost {
  margin-top: 0;
  border: 1px solid var(--line-strong);
  color: rgba(251, 252, 248, 0.82);
}

.btn-ghost:hover {
  border-color: rgba(216, 243, 107, 0.4);
  color: var(--acid);
}

.panel-foot {
  margin-top: 11px;
  color: var(--muted-dim);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-align: center;
}

.panel-foot strong {
  color: rgba(251, 252, 248, 0.7);
  font-family: var(--mono);
  font-weight: 600;
}

/* 强化三选一 */

.upgrade-grid {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.upgrade-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.upgrade-card:hover,
.upgrade-card:focus-visible {
  border-color: rgba(216, 243, 107, 0.45);
  background: rgba(216, 243, 107, 0.06);
}

.upgrade-card:active {
  transform: scale(0.99);
}

.upgrade-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(216, 243, 107, 0.18);
  border-radius: 10px;
  background: rgba(216, 243, 107, 0.07);
  color: var(--acid);
}

.upgrade-icon svg {
  width: 19px;
  height: 19px;
}

.upgrade-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.upgrade-copy strong {
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.upgrade-copy em {
  color: rgba(251, 252, 248, 0.5);
  font-size: 10.5px;
  font-style: normal;
  line-height: 1.5;
}

.upgrade-key {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted-dim);
  font-family: var(--mono);
  font-size: 9px;
}

/* 结算 */

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 18px;
  padding: 13px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.result-stats div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.result-stats span {
  color: var(--muted-dim);
  font-size: 8px;
  letter-spacing: 0.12em;
}

.result-stats strong {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.result-stats div:nth-child(2) strong {
  color: var(--teal);
}

.record {
  margin-top: 10px;
  color: var(--acid);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-align: center;
}

.result-actions {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 8px;
  margin-top: 15px;
}

.result-actions .btn {
  margin-top: 0;
}

/* ---------------- 操作区 ---------------- */

.controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-top: 1px solid var(--line);
  background: #080d0b;
}

.gears {
  display: flex;
  align-items: center;
  gap: 1px;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

.gear-label {
  padding: 0 7px 0 8px;
  color: var(--muted-dim);
  font-size: 8.5px;
  letter-spacing: 0.1em;
}

.gears button {
  min-width: 34px;
  height: 34px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}

.gears button:hover {
  color: var(--acid);
}

.gears button.active {
  background: var(--acid);
  color: var(--ink);
  font-weight: 700;
}

.pulse {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: 1 1 auto;
  min-width: 0;
  height: 42px;
  overflow: hidden;
  border: 1px solid rgba(216, 243, 107, 0.16);
  border-radius: 13px;
  background: rgba(216, 243, 107, 0.05);
  color: rgba(251, 252, 248, 0.78);
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.pulse.ready {
  border-color: rgba(216, 243, 107, 0.55);
  background: rgba(216, 243, 107, 0.1);
  color: var(--acid);
  box-shadow: 0 0 22px rgba(216, 243, 107, 0.1) inset;
}

.pulse:active {
  transform: scale(0.99);
}

.pulse-ico {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.9;
}

.pulse-ico::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.5;
}

.pulse-ico i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
}

.pulse-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  min-width: 0;
  line-height: 1.2;
}

.pulse-text strong {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.pulse-text em {
  color: var(--muted-dim);
  font-size: 8px;
  font-style: normal;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.pulse.ready .pulse-text em {
  color: rgba(216, 243, 107, 0.6);
}

.pulse-fill {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--acid);
  opacity: 0.75;
  transform: scaleX(1);
  transform-origin: left center;
  transition: transform 0.1s linear;
}

.pulse.deny {
  animation: denyShake 0.28s ease;
}

@keyframes denyShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* ---------------- 页脚 ---------------- */

.foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 3px 16px;
  padding: 7px 13px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #070b09;
  color: rgba(251, 252, 248, 0.3);
  font-size: 9.5px;
}

.foot-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.foot-nav a {
  color: rgba(251, 252, 248, 0.46);
  transition: color 0.2s ease;
}

.foot-nav a:hover {
  color: var(--acid);
}

.noscript {
  position: fixed;
  inset: auto 16px 16px;
  z-index: 99;
  padding: 12px 16px;
  border-radius: 12px;
  background: #d8f36b;
  color: #0a0f0d;
  font-size: 13px;
  text-align: center;
}

/* ---------------- 紧凑高度（横屏 / 小屏） ---------------- */

@media (max-height: 680px) {
  .topbar {
    height: 42px;
  }

  .title-copy em,
  .tag {
    display: none;
  }

  .hud {
    gap: 10px;
    padding: 4px 12px 5px;
  }

  .hud-wave-line strong,
  .hud-score strong {
    font-size: 13px;
  }

  .hud-wave em {
    display: none;
  }

  .hp-track {
    height: 4px;
  }

  .controls {
    padding: 6px 10px;
  }

  .gears button {
    height: 32px;
    min-width: 30px;
  }

  .pulse {
    height: 36px;
  }

  .pulse-text em {
    display: none;
  }

  .foot {
    padding: 5px 12px calc(5px + env(safe-area-inset-bottom));
    font-size: 8.5px;
  }

  .banner {
    top: 5%;
  }

  .hint {
    bottom: 7px;
    font-size: 9px;
  }

  .overlay {
    align-items: flex-start;
    padding: 8px;
  }

  .panel {
    padding: 16px 18px;
    border-radius: 18px;
  }

  .panel h1 {
    font-size: 28px;
  }

  .panel h2 {
    font-size: 21px;
  }

  .panel-lead {
    display: none;
  }

  .howto {
    grid-template-columns: 1fr 1fr;
    gap: 5px 16px;
    margin-top: 11px;
    padding: 10px 0;
  }

  .howto li {
    font-size: 10px;
    line-height: 1.5;
  }

  .btn {
    min-height: 40px;
    margin-top: 11px;
  }

  .panel-meta {
    margin-top: 9px;
  }

  .upgrade-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-top: 11px;
  }

  .upgrade-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    padding: 9px 10px;
  }

  .upgrade-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
  }

  .upgrade-icon svg {
    width: 15px;
    height: 15px;
  }

  .upgrade-copy strong {
    font-size: 11.5px;
  }

  .upgrade-copy em {
    font-size: 9px;
    line-height: 1.4;
  }

  .upgrade-key {
    display: none;
  }

  .result-stats {
    margin-top: 11px;
    padding: 9px 0;
  }

  .result-stats strong {
    font-size: 14px;
  }

  .result-actions {
    margin-top: 11px;
  }

  .panel-foot {
    margin-top: 8px;
  }
}

/* 极短视口（横屏手机）：启动面板只保留标题、操作提示与按钮 */
@media (max-height: 480px) {
  .start-panel {
    padding: 13px 16px;
  }

  .start-panel h1 {
    margin-top: 4px;
    font-size: 24px;
  }

  .start-panel .eyebrow {
    font-size: 7.5px;
  }

  .start-panel .howto {
    display: none;
  }

  .start-panel .panel-hint {
    display: block;
    margin-top: 5px;
  }

  .start-panel .panel-meta {
    margin-top: 7px;
  }

  .start-panel .panel-foot {
    display: none;
  }

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

  /* 横屏结算面板压缩，保证按钮完整落在画面内 */
  .result-panel {
    padding: 11px 14px;
  }

  .result-panel .eyebrow {
    font-size: 7px;
  }

  .result-panel h2 {
    margin-top: 3px;
    font-size: 18px;
  }

  .result-panel .boss-credit {
    margin-top: 4px;
    font-size: 8px;
  }

  .result-panel .result-stats {
    margin-top: 6px;
    padding: 6px 0;
    gap: 4px;
  }

  .result-panel .result-stats span {
    font-size: 7px;
  }

  .result-panel .result-stats strong {
    font-size: 13px;
  }

  .result-panel .record {
    margin-top: 4px;
    font-size: 8px;
  }

  .result-panel .result-actions {
    margin-top: 6px;
  }

  .result-panel .result-actions .btn {
    min-height: 32px;
    margin-top: 0;
    font-size: 12px;
  }
}

@media (max-width: 370px) {
  .back-links a {
    padding: 0 6px;
    font-size: 10.5px;
  }
  .title-copy strong {
    font-size: 13px;
  }

  .tag {
    display: none;
  }

  .hud {
    gap: 10px;
  }

  .gear-label {
    display: none;
  }

  .pulse-text em {
    display: none;
  }

  .hint {
    font-size: 9px;
  }
}

@media (max-height: 680px) {
  .bossbar {
    top: 4px;
    right: 8px;
    left: 8px;
    padding: 4px 8px 5px;
    border-radius: 8px;
  }

  .bossbar-head {
    margin-bottom: 3px;
  }

  .bossbar-name {
    font-size: 9px;
  }

  .bossbar-head em {
    font-size: 7px;
  }

  .bossbar-track {
    height: 4px;
  }

  .stage.boss-on .banner {
    top: 27%;
  }
}

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