/* 雷霆战机 · 网页复刻版
   视觉基调：暴风雨云海 / 军用机库面板 / 橙金描边 HUD
   帧内所有尺寸跟随容器，用 cqw 单位等比缩放（480 宽基准 → 1cqw = 4.8px）
   ────────────────────────────────────────────────────────────────── */

:root {
  --ink: #0a1119;
  --panel: #121d27;
  --panel-2: #17252f;
  --line: #1f3240;
  --line-soft: #182936;
  --bone: #eef3f0;
  --dim: #8298a4;
  --gold: #ff8a2b;
  --gold-2: #ffc75f;
  --mint: #3ddc84;
  --crimson: #e5484d;
  --sky: #4fb3d9;
  --violet: #a978e8;
  --q1: #8fa3ad;
  --q2: #4fb3d9;
  --q3: #a978e8;
  --q4: #ff8a2b;
  --font: "Chakra Petch", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --frame-h: min(calc(100dvh - 2 * var(--pad)), calc((100vw - 2 * var(--pad)) * 5 / 3));
  --pad: 12px;
}

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

html,
body {
  margin: 0;
  height: 100%;
  background: #070d13;
}

body {
  color: var(--bone);
  font-family: var(--font);
  overflow: hidden;
  overscroll-behavior: none;
  user-select: none;
}

.stage-wrap {
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--pad);
  background:
    radial-gradient(120% 90% at 50% 0%, #12202b 0%, #070d13 62%),
    #070d13;
}

.frame {
  position: relative;
  container-type: size;
  aspect-ratio: 3 / 5;
  height: var(--frame-h);
  overflow: hidden;
  background: #0b141d;
  border: 1px solid #1d3341;
  border-radius: 6px;
  box-shadow: 0 0 0 1px #060b10, 0 34px 80px -34px #000;
  touch-action: none;
}

#view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.crt {
  position: absolute;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, rgba(3, 8, 12, 0.26) 0 1px, transparent 1px 3px),
    radial-gradient(118% 76% at 50% 46%, transparent 54%, rgba(3, 8, 12, 0.66) 100%);
  mix-blend-mode: multiply;
}

/* ── 通用元件 ─────────────────────────────────────────────────────── */
.screens {
  position: absolute;
  inset: 0;
  z-index: 20;
}

.screens[hidden] {
  display: none;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, #0b141d 0%, #0a1119 100%);
}

.screen.is-active {
  display: flex;
  animation: screen-in 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(1.4cqh);
  }
}

#scr-home.is-active {
  background: linear-gradient(180deg, rgba(8, 16, 23, 0.6) 0%, rgba(8, 15, 22, 0.78) 56%, rgba(9, 16, 23, 0.94) 100%);
}

.screen-dim {
  background: rgba(6, 12, 18, 0.9);
}

.screen-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 4.4cqw 3cqw;
}

.screen-body[hidden] {
  display: none;
}

.hud-label {
  display: block;
  font-size: 2.1cqw;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
}

.btn {
  font-family: var(--font);
  font-size: 3cqw;
  font-weight: 700;
  letter-spacing: 0.14em;
  padding: 3.2cqw 5.4cqw;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 120ms ease, background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

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

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.btn-primary {
  color: #1a1005;
  background: var(--gold);
  box-shadow: 0 10px 26px -12px rgba(255, 138, 43, 0.9);
}

.btn-primary:hover:not(:disabled) {
  background: #ffa04d;
}

.btn-ghost {
  color: var(--bone);
  background: rgba(23, 37, 47, 0.7);
  border-color: #27404f;
}

.btn-ghost:hover:not(:disabled) {
  border-color: #3c6376;
}

.btn-wide {
  width: 100%;
}

.icon-btn {
  width: 8.4cqw;
  height: 8.4cqw;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--dim);
  background: rgba(18, 29, 39, 0.7);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease;
}

.icon-btn svg {
  width: 4.6cqw;
  height: 4.6cqw;
}

.icon-btn:hover {
  color: var(--bone);
  border-color: #37596b;
}

.icon-btn.is-muted {
  color: #4a606b;
}

.icon-btn.is-muted .snd-wave {
  display: none;
}

.icon-btn:not(.is-muted) .snd-off {
  display: none;
}

.wallet {
  display: flex;
  align-items: center;
  gap: 1.6cqw;
  font-size: 3.1cqw;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--gold-2);
  padding: 1.6cqw 3cqw;
  background: rgba(12, 20, 28, 0.8);
  border: 1px solid #24384a;
  border-radius: 3px;
}

.wallet-sm {
  font-size: 2.8cqw;
  padding: 1.2cqw 2.4cqw;
}

.coin-glyph {
  width: 3.4cqw;
  height: 3.4cqw;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #ffe6a8, var(--gold-2) 42%, #c47a12 100%);
  box-shadow: inset 0 0 0 1px rgba(90, 52, 0, 0.5);
  flex: none;
}

.q-tag,
.lv-tag {
  font-size: 2.2cqw;
  font-weight: 700;
  letter-spacing: 0.16em;
  padding: 0.9cqw 2cqw;
  border-radius: 2px;
  border: 1px solid currentColor;
}

.q-tag {
  color: var(--q2);
}

.lv-tag {
  color: var(--dim);
}

.bar {
  height: 8px;
  border-radius: 2px;
  background: #16242e;
  overflow: hidden;
}

.bar > i {
  display: block;
  height: 100%;
  background: var(--gold);
  transform-origin: left center;
}

/* ── 基地 ─────────────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3cqw;
  padding: calc(3.4cqw + env(safe-area-inset-top)) 4.4cqw 2cqw;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 2.4cqw;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 1.4cqw;
  max-width: 28cqw;
  padding: 1.3cqw 2.2cqw;
  font-family: var(--font);
  font-size: 2.2cqw;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--dim);
  background: rgba(12, 20, 28, 0.78);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  cursor: pointer;
}

.account-chip span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-chip.is-on {
  color: var(--bone);
  border-color: #31566a;
}

.account-dot {
  width: 2.5cqw;
  height: 2.5cqw;
  flex: none;
  border-radius: 50%;
  background: #4a606b;
  box-shadow: 0 0 0 1px rgba(130, 152, 164, 0.3);
}

.account-chip.is-on .account-dot {
  background: var(--mint);
  box-shadow: 0 0 0 1px rgba(61, 220, 132, 0.28), 0 0 10px rgba(61, 220, 132, 0.5);
}

.rank-chip {
  font-size: 2.4cqw;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--dim);
  padding: 1.4cqw 2.6cqw;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
}

.hero {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  place-items: center;
}

.hero canvas {
  position: relative;
  width: 82%;
  height: auto;
  filter: drop-shadow(0 26px 30px rgba(0, 0, 0, 0.62));
}

.hero-glow {
  position: absolute;
  width: 62cqw;
  height: 62cqw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 138, 43, 0.16), transparent 66%);
}

.hero-info {
  padding: 0 4.4cqw;
  text-align: center;
}

.hero-tags {
  display: flex;
  justify-content: center;
  gap: 1.6cqw;
}

.hero-name {
  margin: 1.6cqw 0 1cqw;
  font-family: var(--font-display);
  font-size: 9.6cqw;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  line-height: 1;
}

.hero-power {
  font-size: 2.6cqw;
  letter-spacing: 0.24em;
  color: var(--dim);
}

.hero-power b {
  font-size: 3.6cqw;
  letter-spacing: 0.06em;
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2cqw;
  padding: 3.4cqw 4.4cqw 0;
}

.stat-row > div {
  border-top: 1px solid var(--line);
  padding-top: 2cqw;
}

.stat-row span {
  font-size: 2.1cqw;
  letter-spacing: 0.18em;
  color: var(--dim);
}

.stat-row b {
  display: block;
  margin-top: 0.6cqw;
  font-size: 3.9cqw;
  font-variant-numeric: tabular-nums;
}

.home-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.4cqw;
  padding: 3.4cqw 4.4cqw calc(3.4cqw + env(safe-area-inset-bottom));
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2cqw;
  padding: 3.2cqw 0.6cqw;
  font-family: var(--font);
  font-size: 2.55cqw;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--bone);
  background: rgba(18, 29, 39, 0.72);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, transform 120ms ease;
}

.nav-btn svg {
  width: 5.2cqw;
  height: 5.2cqw;
  color: var(--dim);
}

.nav-btn:hover {
  border-color: #3a6072;
}

.nav-btn:active {
  transform: translateY(1px);
}

.nav-primary {
  color: #1a1005;
  background: var(--gold);
  border-color: transparent;
}

.nav-primary svg {
  color: #1a1005;
}

.nav-primary:hover {
  background: #ffa04d;
  border-color: transparent;
}

/* ── 子页顶栏 ─────────────────────────────────────────────────────── */
.subbar {
  display: flex;
  align-items: center;
  gap: 3cqw;
  padding: calc(3.4cqw + env(safe-area-inset-top)) 4.4cqw 3.4cqw;
  border-bottom: 1px solid var(--line-soft);
}

.subbar h2 {
  margin: 0;
  font-size: 4.4cqw;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.back-btn {
  width: 8.4cqw;
  height: 8.4cqw;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--bone);
  background: rgba(18, 29, 39, 0.8);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
}

.back-btn svg {
  width: 5cqw;
  height: 5cqw;
}

.subbar .wallet {
  margin-left: auto;
}

.seg {
  margin-left: auto;
  display: flex;
  padding: 0.8cqw;
  background: #101a23;
  border: 1px solid var(--line);
  border-radius: 3px;
}

.seg-btn {
  font-family: var(--font);
  font-size: 2.6cqw;
  font-weight: 600;
  letter-spacing: 0.14em;
  padding: 1.6cqw 3.4cqw;
  color: var(--dim);
  background: transparent;
  border: 0;
  border-radius: 2px;
  cursor: pointer;
}

.seg-btn.is-on {
  color: #1a1005;
  background: var(--gold-2);
}

/* ── 关卡列表 ─────────────────────────────────────────────────────── */
.pane-note {
  margin: 3.4cqw 0;
  font-size: 2.5cqw;
  line-height: 1.7;
  color: var(--dim);
}

.stage-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.4cqw;
  padding-bottom: 3cqw;
}

.stage-card {
  position: relative;
  aspect-ratio: 1 / 1.06;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1cqw;
  padding: 2cqw;
  font-family: var(--font);
  color: var(--bone);
  background: linear-gradient(160deg, #16242f 0%, #101a23 100%);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 150ms ease, transform 120ms ease;
}

.stage-card:hover {
  border-color: var(--gold);
}

.stage-card:active {
  transform: translateY(1px);
}

.stage-card.is-locked {
  cursor: not-allowed;
  opacity: 0.6;
  filter: saturate(0.35);
}

.stage-card.is-locked:hover {
  border-color: var(--line);
}

.stage-card.is-cleared {
  border-color: #2f4f5f;
  background: linear-gradient(160deg, #17293a 0%, #101a23 100%);
}

.stage-card.is-picked {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(255, 138, 43, 0.35), 0 0 22px -10px rgba(255, 138, 43, 0.8);
}

.stage-no {
  font-size: 6.4cqw;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stage-sub {
  font-size: 2.1cqw;
  letter-spacing: 0.16em;
  color: var(--dim);
}

.stars {
  display: flex;
  gap: 0.8cqw;
  margin-top: 0.6cqw;
}

.stars svg {
  width: 3.4cqw;
  height: 3.4cqw;
  color: #2b414f;
}

.stars svg.on {
  color: var(--gold-2);
}

.stage-card .lock {
  position: absolute;
  top: 1.6cqw;
  right: 1.6cqw;
  width: 4cqw;
  height: 4cqw;
  color: #47616f;
}

.stage-card .flag {
  position: absolute;
  top: 1.4cqw;
  left: 1.4cqw;
  font-size: 1.9cqw;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.5cqw 1.2cqw;
  color: #1a1005;
  background: var(--gold-2);
  border-radius: 2px;
}

/* ── 无尽模式 ─────────────────────────────────────────────────────── */
.endless-card {
  margin-top: 3.4cqw;
  padding: 6cqw 5cqw;
  text-align: center;
  background: linear-gradient(170deg, #14222e 0%, #0d1720 100%);
  border: 1px solid var(--line);
  border-radius: 5px;
}

.endless-mark {
  width: 16cqw;
  height: 16cqw;
  margin: 0 auto 4cqw;
  display: grid;
  place-items: center;
  color: var(--gold-2);
  border: 1px solid #3a5266;
  border-radius: 50%;
}

.endless-mark svg {
  width: 8.4cqw;
  height: 8.4cqw;
}

.endless-card h3 {
  margin: 0 0 2cqw;
  font-family: var(--font-display);
  font-size: 6.4cqw;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
}

.endless-card p {
  margin: 0 0 5cqw;
  font-size: 2.5cqw;
  line-height: 1.8;
  color: var(--dim);
}

.endless-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2cqw;
}

.endless-stats > div {
  padding: 3cqw 2cqw;
  background: rgba(9, 16, 22, 0.6);
  border: 1px solid var(--line-soft);
  border-radius: 3px;
}

.endless-stats span {
  display: block;
  font-size: 2.1cqw;
  letter-spacing: 0.16em;
  color: var(--dim);
}

.endless-stats b {
  display: block;
  margin-top: 1cqw;
  font-size: 4.6cqw;
  font-variant-numeric: tabular-nums;
  color: var(--gold-2);
}

/* ── 底部出战条 ───────────────────────────────────────────────────── */
.launch-bar {
  display: flex;
  align-items: center;
  gap: 3cqw;
  padding: 3cqw 4.4cqw calc(3.4cqw + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(10, 17, 25, 0.5), #0a1119 40%);
  border-top: 1px solid var(--line-soft);
}

.launch-plane {
  display: flex;
  align-items: center;
  gap: 2cqw;
  min-width: 0;
}

.launch-plane canvas {
  width: 11cqw;
  height: 11cqw;
  flex: none;
}

.launch-plane-text {
  min-width: 0;
}

.launch-plane-text b {
  display: block;
  margin-top: 0.6cqw;
  font-size: 3.4cqw;
  letter-spacing: 0.08em;
}

.launch-power {
  margin-left: auto;
  text-align: right;
}

.launch-power b {
  display: block;
  margin-top: 0.6cqw;
  font-size: 3.8cqw;
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
}

.launch-bar .btn {
  padding: 3.4cqw 5cqw;
}

/* ── 机库 ─────────────────────────────────────────────────────────── */
.plane-strip {
  display: flex;
  gap: 2.2cqw;
  padding: 3.4cqw 4.4cqw 2.4cqw;
  overflow-x: auto;
  scrollbar-width: none;
}

.plane-strip::-webkit-scrollbar {
  display: none;
}

.plane-chip {
  position: relative;
  flex: none;
  width: 17cqw;
  padding: 1.6cqw 1.4cqw 2cqw;
  background: #101a23;
  border: 1px solid var(--line);
  border-radius: 4px;
  border-top: 2px solid var(--q);
  cursor: pointer;
  transition: transform 120ms ease, background-color 150ms ease;
}

.plane-chip:hover {
  background: #16232e;
}

.plane-chip.is-on {
  background: #1b2c38;
  border-color: var(--q);
  border-top-color: var(--q);
}

.plane-chip canvas {
  width: 100%;
  height: auto;
}

.plane-chip b {
  display: block;
  font-size: 2.4cqw;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: center;
  color: var(--bone);
  white-space: nowrap;
}

.plane-chip.is-locked canvas {
  opacity: 0.34;
}

.plane-chip .chip-state {
  display: block;
  margin-top: 0.4cqw;
  font-size: 1.9cqw;
  letter-spacing: 0.1em;
  text-align: center;
  color: var(--q);
}

.detail {
  background: linear-gradient(170deg, #131f2a 0%, #0d161e 100%);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3cqw 4cqw 4cqw;
}

.detail-hero {
  height: 28cqh;
  display: grid;
  place-items: center;
}

.detail-hero canvas {
  width: 64%;
  height: auto;
  filter: drop-shadow(0 20px 26px rgba(0, 0, 0, 0.6));
}

.detail-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3cqw;
}

.detail-head h3 {
  margin: 1.4cqw 0 0;
  font-family: var(--font-display);
  font-size: 6cqw;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.detail-power {
  text-align: right;
}

.detail-power b {
  display: block;
  margin-top: 0.6cqw;
  font-size: 4.4cqw;
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
}

.detail-desc {
  margin: 3cqw 0;
  font-size: 2.45cqw;
  line-height: 1.75;
  color: var(--dim);
}

.bars {
  display: grid;
  gap: 2.4cqw;
}

.bars > div {
  display: grid;
  grid-template-columns: 8cqw 1fr auto;
  align-items: center;
  gap: 2.4cqw;
}

.bars span {
  font-size: 2.3cqw;
  letter-spacing: 0.16em;
  color: var(--dim);
}

.bars b {
  font-size: 2.7cqw;
  font-variant-numeric: tabular-nums;
}

/* ── 任务 ─────────────────────────────────────────────────────────── */
.task-list {
  display: grid;
  gap: 2.4cqw;
  margin-top: 3.4cqw;
  padding-bottom: 3cqw;
}

.task-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3cqw;
  align-items: center;
  padding: 3cqw 3.4cqw;
  background: linear-gradient(160deg, #131f2a 0%, #0e1720 100%);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.task-main {
  min-width: 0;
}

.task-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.6cqw;
}

.task-item h4 {
  margin: 0 0 1.4cqw;
  font-size: 3.1cqw;
  font-weight: 600;
  letter-spacing: 0.06em;
}

.task-progress {
  display: flex;
  align-items: center;
  gap: 2cqw;
}

.task-progress .bar {
  flex: 1;
}

.task-progress em {
  font-style: normal;
  font-size: 2.3cqw;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.task-reward {
  display: flex;
  align-items: center;
  gap: 1.2cqw;
  font-size: 2.6cqw;
  font-weight: 700;
  color: var(--gold-2);
}

.task-item .btn {
  font-size: 2.4cqw;
  padding: 2cqw 3.4cqw;
}

/* ── 排行榜 ───────────────────────────────────────────────────────── */
.rank-stage-picker {
  display: flex;
  gap: 1.4cqw;
  padding: 2.4cqw 4.4cqw;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-soft);
  scrollbar-width: none;
}

.rank-stage-picker[hidden] {
  display: none;
}

.rank-stage-picker::-webkit-scrollbar {
  display: none;
}

.rank-stage-btn {
  flex: none;
  min-width: 7cqw;
  padding: 1.4cqw 1.2cqw;
  font-family: var(--font);
  font-size: 2.3cqw;
  font-weight: 700;
  color: var(--dim);
  background: #101a23;
  border: 1px solid var(--line);
  border-radius: 2px;
  cursor: pointer;
}

.rank-stage-btn.is-on {
  color: #1a1005;
  background: var(--gold-2);
  border-color: var(--gold-2);
}

.rank-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.4cqw;
  margin: 3.4cqw 0 2.4cqw;
  padding: 2.8cqw 3cqw;
  background: linear-gradient(110deg, rgba(23, 37, 47, 0.92), rgba(13, 22, 30, 0.86));
  border: 1px solid var(--line);
  border-left: 3px solid var(--sky);
  border-radius: 3px;
}

.rank-account-main {
  display: flex;
  align-items: center;
  gap: 2.2cqw;
  min-width: 0;
}

.rank-account-main > div {
  min-width: 0;
}

.rank-account-main b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 3cqw;
}

.rank-account-main span:not(.rank-avatar) {
  display: block;
  margin-top: 0.4cqw;
  font-size: 2.1cqw;
  letter-spacing: 0.06em;
  color: var(--dim);
}

.rank-avatar,
.podium-avatar {
  display: grid;
  place-items: center;
  flex: none;
  color: var(--bone);
  background-color: #203441;
  background-image: var(--rank-avatar, none);
  background-size: cover;
  background-position: center;
  border: 1px solid #3a6072;
  border-radius: 50%;
  font-weight: 700;
}

.rank-avatar[style*="--rank-avatar"],
.podium-avatar[style*="--rank-avatar"] {
  color: transparent;
}

.rank-avatar {
  width: 7.4cqw;
  height: 7.4cqw;
  font-size: 2.8cqw;
}

.rank-avatar.is-empty {
  color: var(--sky);
  background: #152630;
}

.rank-mini-btn {
  flex: none;
  padding: 1.8cqw 3cqw;
  font-size: 2.25cqw;
}

.rank-summary {
  min-height: 12cqw;
}

.rank-podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: end;
  gap: 2cqw;
  padding: 1.4cqw 0 2.4cqw;
}

.podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  gap: 1cqw;
  padding: 2.6cqw 1cqw 2.2cqw;
  background: linear-gradient(180deg, rgba(22, 36, 47, 0.86), rgba(14, 23, 31, 0.9));
  border: 1px solid var(--line);
  border-bottom: 3px solid #31566a;
  border-radius: 3px;
}

.podium-item.place-1 {
  padding-top: 4.4cqw;
  border-color: rgba(255, 199, 95, 0.55);
  border-bottom-color: var(--gold);
  box-shadow: 0 0 24px -14px rgba(255, 199, 95, 0.8);
}

.podium-item.is-empty {
  min-height: 17cqw;
  opacity: 0.35;
}

.podium-place {
  font-size: 2.2cqw;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--dim);
}

.podium-item.place-1 .podium-place {
  color: var(--gold-2);
}

.podium-avatar {
  width: 9cqw;
  height: 9cqw;
  font-size: 3.2cqw;
}

.podium-item.place-1 .podium-avatar {
  width: 11.4cqw;
  height: 11.4cqw;
  font-size: 4cqw;
}

.podium-item b {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 2.55cqw;
}

.podium-item em {
  font-style: normal;
  font-size: 2.6cqw;
  font-weight: 700;
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
}

.rank-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 0 3cqw;
  list-style: none;
}

.rank-row {
  display: grid;
  grid-template-columns: 5.6cqw 7.4cqw minmax(0, 1fr) auto;
  align-items: center;
  gap: 2.2cqw;
  padding: 2.4cqw 1.6cqw;
  border-bottom: 1px solid var(--line-soft);
}

.rank-row.is-me {
  background: rgba(255, 138, 43, 0.07);
  border-bottom-color: rgba(255, 138, 43, 0.45);
}

.rank-no {
  font-size: 2.5cqw;
  font-weight: 700;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.rank-user {
  min-width: 0;
}

.rank-user b,
.rank-user em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-user b {
  font-size: 2.9cqw;
  font-weight: 600;
}

.rank-user em {
  margin-top: 0.3cqw;
  font-style: normal;
  font-size: 2.1cqw;
  color: var(--dim);
}

.rank-score {
  font-size: 3.4cqw;
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
}

.rank-empty,
.rank-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1cqw;
  min-height: 20cqw;
  color: var(--dim);
  border: 1px dashed var(--line);
  border-radius: 3px;
  font-size: 2.4cqw;
}

.rank-empty b {
  color: var(--bone);
  font-size: 3cqw;
}

.rank-sync {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2cqw;
  min-height: 7cqw;
  margin: -2cqw 0 3.4cqw;
  font-size: 2.35cqw;
  color: var(--dim);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.rank-sync-btn {
  padding: 0;
  font-family: var(--font);
  font-size: 2.35cqw;
  font-weight: 700;
  color: var(--gold-2);
  background: transparent;
  border: 0;
  cursor: pointer;
}

/* ── 结算 / 暂停 ──────────────────────────────────────────────────── */
.sheet {
  margin: auto;
  width: 100%;
  padding: 0 8cqw;
  animation: sheet-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(2.4cqh);
  }
}

.sheet-kicker {
  margin: 0 0 2cqw;
  font-size: 2.2cqw;
  font-weight: 600;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold);
}

.sheet-title-cn {
  margin: 0;
  font-family: var(--font-display);
  font-size: 10cqw;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1.05;
}

.sheet-sub {
  margin: 2cqw 0 0;
  font-size: 2.6cqw;
  letter-spacing: 0.1em;
  color: var(--dim);
}

.sheet-rule {
  height: 1px;
  margin: 4.4cqw 0;
  background: linear-gradient(90deg, var(--line), transparent);
}

.result-stars {
  display: flex;
  gap: 2.4cqw;
  margin: 1cqw 0 4cqw;
}

.result-stars svg {
  width: 11cqw;
  height: 11cqw;
  color: #24394a;
}

.result-stars svg.on {
  color: var(--gold-2);
  filter: drop-shadow(0 0 12px rgba(255, 199, 95, 0.5));
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3cqw 2cqw;
  margin-bottom: 5cqw;
}

.result-grid > div {
  border-top: 1px solid var(--line);
  padding-top: 2cqw;
}

.result-grid span {
  display: block;
  font-size: 2.1cqw;
  letter-spacing: 0.18em;
  color: var(--dim);
}

.result-grid b {
  display: block;
  margin-top: 0.8cqw;
  font-size: 4.4cqw;
  font-variant-numeric: tabular-nums;
}

.result-grid .gold b {
  color: var(--gold-2);
}

.actions {
  display: flex;
  gap: 3cqw;
}

.actions .btn {
  flex: 1;
}

/* ── 局内 HUD ─────────────────────────────────────────────────────── */
.hud {
  position: absolute;
  z-index: 30;
  pointer-events: none;
}

.hud[hidden] {
  display: none;
}

.hud-top {
  top: 0;
  left: 0;
  right: 0;
  padding: calc(3cqw + env(safe-area-inset-top)) 4cqw 3.4cqw;
  background: linear-gradient(180deg, rgba(5, 11, 16, 0.92), rgba(5, 11, 16, 0));
}

.hud-row {
  display: flex;
  align-items: center;
  gap: 3cqw;
}

.hud-row-mid {
  margin-top: 2.6cqw;
  align-items: flex-end;
}

.hp-block {
  flex: 1;
  min-width: 0;
}

.hp-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.4cqw;
}

.hp-name {
  font-size: 2.7cqw;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.hp-num {
  font-size: 2.2cqw;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.hp-num b {
  font-size: 2.8cqw;
  color: var(--bone);
}

.hp-num i {
  font-style: normal;
}

.hp-track {
  height: 2.1cqw;
  background: rgba(4, 10, 14, 0.86);
  border: 1px solid #22384a;
  border-radius: 2px;
  overflow: hidden;
}

.hp-fill {
  height: 100%;
  width: 100%;
  background: var(--mint);
  transition: width 180ms ease-out, background-color 240ms ease;
}

.hud-top .icon-btn {
  pointer-events: auto;
  background: rgba(8, 15, 21, 0.7);
}

.score-block {
  display: flex;
  align-items: baseline;
  gap: 2cqw;
}

.score-block b {
  font-size: 5.4cqw;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 16px rgba(238, 243, 240, 0.24);
}

.score-block .hud-label {
  margin-right: 0.4cqw;
}

.combo {
  font-size: 3cqw;
  font-weight: 700;
  color: var(--gold-2);
  letter-spacing: 0.05em;
}

.combo.bump {
  animation: combo-bump 280ms ease-out;
}

@keyframes combo-bump {
  from {
    transform: scale(1.5);
    color: var(--bone);
  }
}

.stage-block {
  margin-left: auto;
  width: 34%;
  text-align: right;
}

.wave-track {
  height: 1.4cqw;
  margin-top: 1.2cqw;
  background: rgba(4, 10, 14, 0.86);
  border-radius: 2px;
  overflow: hidden;
}

.wave-fill {
  height: 100%;
  width: 0%;
  background: var(--gold);
  transition: width 200ms linear;
}

.hud-boss {
  top: 20.5cqw;
  left: 0;
  right: 0;
  padding: 0 4cqw;
}

.hud-boss[hidden] {
  display: none;
}

.boss-meta {
  display: flex;
  justify-content: center;
  margin-bottom: 1.2cqw;
  font-size: 2.3cqw;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: #ffb4b6;
}

.boss-track {
  height: 1.8cqw;
  background: rgba(4, 10, 14, 0.9);
  border: 1px solid #4a2028;
  border-radius: 2px;
  overflow: hidden;
}

.boss-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff6a3d, var(--crimson));
  transition: width 160ms ease-out;
}

.hud-bottom {
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-end;
  gap: 3cqw;
  padding: 3.4cqw 4cqw calc(3.4cqw + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, rgba(5, 11, 16, 0.92), rgba(5, 11, 16, 0));
}

.hud-cell {
  display: flex;
  align-items: center;
  gap: 2cqw;
}

.hud-cell-end {
  margin-left: auto;
}

.hud-cell .hud-label {
  margin: 0;
}

.power {
  display: flex;
  gap: 0.8cqw;
}

.power i {
  width: 3cqw;
  height: 1.5cqw;
  border: 1px solid #2c4a5b;
  border-radius: 1px;
}

.power i.on {
  background: var(--gold-2);
  border-color: var(--gold-2);
  box-shadow: 0 0 8px rgba(255, 199, 95, 0.5);
}

.coin-num {
  font-size: 3.4cqw;
  color: var(--gold-2);
  font-variant-numeric: tabular-nums;
}

.bomb-btn {
  position: absolute;
  right: 4cqw;
  bottom: calc(11cqw + env(safe-area-inset-bottom));
  width: 17cqw;
  height: 17cqw;
  display: grid;
  place-items: center;
  gap: 0;
  padding: 0;
  font-family: var(--font);
  font-size: 2.3cqw;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--bone);
  background: radial-gradient(circle at 50% 34%, rgba(255, 138, 43, 0.5), rgba(46, 22, 6, 0.72));
  border: 1px solid rgba(255, 138, 43, 0.75);
  border-radius: 50%;
  opacity: 0.78;
  pointer-events: auto;
  cursor: pointer;
  touch-action: none;
}

.bomb-btn svg {
  width: 6.4cqw;
  height: 6.4cqw;
  color: var(--gold-2);
}

.bomb-btn span {
  margin-top: -0.6cqw;
}

.bomb-btn .bomb-count {
  position: absolute;
  top: -0.6cqw;
  right: -0.6cqw;
  min-width: 5.4cqw;
  height: 5.4cqw;
  display: grid;
  place-items: center;
  font-style: normal;
  font-size: 2.6cqw;
  color: #1a1005;
  background: var(--gold-2);
  border-radius: 50%;
}

.bomb-btn:active {
  transform: scale(0.94);
}

.bomb-btn:disabled {
  opacity: 0.35;
}

/* ── 提示条 ───────────────────────────────────────────────────────── */
.toast {
  position: absolute;
  left: 50%;
  bottom: 26cqh;
  z-index: 45;
  transform: translateX(-50%);
  padding: 2.6cqw 5cqw;
  font-size: 2.7cqw;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--bone);
  background: rgba(10, 18, 25, 0.94);
  border: 1px solid var(--line);
  border-radius: 3px;
  animation: toast-in 200ms ease-out both;
}

.toast[hidden] {
  display: none;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 10px);
  }
}

/* ── 触屏 / 窄屏 ──────────────────────────────────────────────────── */
@media (max-width: 780px), (max-height: 640px) {
  :root {
    --pad: 0px;
  }

  .frame {
    border-radius: 0;
    border-color: #142833;
  }
}

@media (hover: none) {
  #view {
    cursor: default;
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen.is-active,
  .sheet,
  .toast {
    animation: none;
  }

  .combo.bump {
    animation: none;
  }
}
