/* style.css — 深渊百层：地心微缩竖井机台。
   铸铁包边 + 黄铜刻度 + 随深度渐变的矿坑光晕；桌面双翼仪表，移动端一体化悬挂机台。 */

:root {
  --ink: #0a0d12;
  --metal-0: #11151b;
  --metal-1: #1b2129;
  --metal-2: #242c36;
  --metal-3: #35404e;
  --edge: #4d5b6d;
  --brass: #c9974f;
  --brass-light: #f0c880;
  --amber: #ecc94b;
  --stone: #4a5568;
  --spike: #e53e3e;
  --belt: #ed8936;
  --crystal: #4fd1c5;
  --gold: #f6c453;
  --text: #d7e0eb;
  --text-dim: #93a2b5;
  --text-faint: #66768a;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--ink);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  overscroll-behavior: none;
}

body {
  background:
    radial-gradient(900px 520px at 20% -10%, #1b2634 0%, transparent 62%),
    radial-gradient(760px 520px at 80% 8%, #251a13 0%, transparent 60%),
    radial-gradient(1000px 700px at 50% 110%, #10202a 0%, transparent 65%),
    linear-gradient(180deg, #0d1117 0%, #080a0e 100%);
}

button,
a {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

#game-app {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 22px 28px;
}

/* ================= 机顶控制条 ================= */
#stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--metal-3);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 42%),
    linear-gradient(180deg, var(--metal-2), var(--metal-1));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    inset 0 -2px 0 rgba(0, 0, 0, 0.5),
    0 12px 30px rgba(0, 0, 0, 0.45);
}

#app-title {
  margin: 0;
  text-align: center;
  line-height: 1.1;
}

#app-title-main {
  display: block;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.18em;
  background: linear-gradient(180deg, #fff1c9 0%, var(--brass-light) 28%, #b07a33 68%, #7c5320 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}

#app-subtitle {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  letter-spacing: 0.34em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.stage-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid var(--metal-3);
  background: linear-gradient(180deg, #2c3540, #1a2029);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -2px 0 rgba(0, 0, 0, 0.55),
    0 4px 10px rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, border-color 0.18s ease;
}

.bar-btn:hover {
  border-color: #5d6d82;
}

.bar-btn:active {
  transform: translateY(2px);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.6);
}

.bar-glyph {
  font-size: 14px;
  color: var(--brass-light);
}

#back-home {
  white-space: nowrap;
}

#btn-lang {
  min-width: 42px;
  justify-content: center;
  font-weight: 700;
  color: var(--brass-light);
}

/* ================= 模式吊牌 ================= */
#mode-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 14px auto 0;
  padding: 6px;
  width: fit-content;
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid var(--metal-3);
  background: linear-gradient(180deg, #141920, #0d1116);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 -3px 8px rgba(0, 0, 0, 0.6);
}

.mode-chip {
  position: relative;
  padding: 7px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  font-size: 13px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.mode-chip:hover {
  color: var(--text);
}

.mode-chip.is-active {
  color: #fff3d6;
  background:
    radial-gradient(120% 160% at 50% 0%, rgba(236, 201, 75, 0.34), transparent 68%),
    linear-gradient(180deg, #3a3222, #221d14);
  border-color: #6d5726;
  box-shadow: inset 0 1px 0 rgba(255, 240, 190, 0.3), 0 0 18px rgba(236, 201, 75, 0.16);
}

/* ================= 主舞台 ================= */
#stage-core {
  display: grid;
  grid-template-columns: 176px minmax(320px, 420px) 176px;
  justify-content: center;
  align-items: start;
  gap: 20px;
  margin: 18px auto 0;
  max-width: 1000px;
}

.wing {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plate {
  position: relative;
  padding: 10px 12px 12px;
  border-radius: 12px;
  border: 1px solid var(--metal-3);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), transparent 36%),
    linear-gradient(180deg, #232b35, #161c24);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -2px 0 rgba(0, 0, 0, 0.5),
    0 10px 22px rgba(0, 0, 0, 0.35);
}

.plate::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.plate-label {
  display: block;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--text-faint);
  text-transform: uppercase;
}

.depth-read {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 2px;
}

.depth-value {
  font-size: 38px;
  line-height: 1;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff4cd, #e0b467 52%, #9c6c2d);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.55);
}

.depth-value.is-bump {
  animation: bump 0.22s ease;
}

.depth-unit {
  font-size: 12px;
  color: var(--text-dim);
}

.depth-ticks {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}

.depth-ticks span {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, #7d5a26, #c9974f);
  opacity: 0.7;
}

.hearts {
  display: flex;
  gap: 4px;
  margin: 8px 0 6px;
  flex-wrap: wrap;
}

.heart {
  font-size: 17px;
  line-height: 1;
  color: #4a2b31;
  transition: color 0.16s ease, text-shadow 0.16s ease, transform 0.16s ease;
}

.heart.is-full {
  color: #ff5f70;
  text-shadow: 0 0 8px rgba(255, 95, 112, 0.55);
}

.heart.is-half {
  color: #ff9a62;
  opacity: 0.8;
  text-shadow: 0 0 6px rgba(255, 154, 98, 0.4);
}

.heart.is-empty {
  color: #3a2b2f;
  opacity: 0.55;
}

.life-value,
.goal-value,
.best-value {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}

.best-value {
  font-size: 18px;
  color: var(--brass-light);
}

.goal-track {
  margin: 9px 0 2px;
  height: 7px;
  border-radius: 4px;
  background: #0c1015;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.goal-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 4px;
  background: linear-gradient(90deg, #8a5f1d, var(--gold), #ffe9a3);
  box-shadow: 0 0 10px rgba(246, 196, 83, 0.5);
  transition: width 0.2s ease;
}

/* 声纳 */
.radar-screen {
  position: relative;
  width: 92px;
  height: 92px;
  margin: 8px auto 6px;
  border-radius: 50%;
  border: 1px solid #3f4d5c;
  background:
    radial-gradient(circle at 50% 50%, rgba(79, 209, 197, 0.16), transparent 62%),
    repeating-radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.09) 0 1px, transparent 1px 18px),
    #08110f;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.85), 0 0 14px rgba(79, 209, 197, 0.12);
  overflow: hidden;
}

.radar-ring {
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px solid rgba(79, 209, 197, 0.22);
}

.radar-sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(79, 209, 197, 0.34), transparent 26%, transparent 100%);
  animation: sweep 3.4s linear infinite;
}

.radar-glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 24px;
  color: #8ce8df;
  text-shadow: 0 0 12px rgba(79, 209, 197, 0.6);
}

.radar-text {
  display: block;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-dim);
  text-align: center;
  min-height: 34px;
}

.radar-text.is-warn {
  color: #ff8f7a;
}

.speed-read {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 4px;
}

.speed-value {
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #a9c7e4;
}

.speed-unit {
  font-size: 10.5px;
  color: var(--text-faint);
}

.speed-track {
  margin-top: 6px;
  height: 6px;
  border-radius: 3px;
  background: #0c1015;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.8);
  overflow: hidden;
}

.speed-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #4a7fa8, #a9d4f5);
  transition: width 0.12s linear;
}

.plate-hint {
  padding: 8px 10px;
}

.key-hint {
  display: block;
  font-size: 11px;
  line-height: 1.7;
  color: var(--text-faint);
}

/* ================= 井口机台 ================= */
#shaft-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

#shaft-frame {
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 9px;
  border-radius: 18px;
  border: 1px solid #465365;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent 32%),
    linear-gradient(180deg, #39434f, #171c23 42%, #0d1116);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -3px 0 rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(0, 0, 0, 0.65),
    0 24px 60px rgba(0, 0, 0, 0.6),
    0 0 44px rgba(236, 201, 75, 0.06);
}

#shaft-frame::before,
#shaft-frame::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d9e3ee, #5c6c80 55%, #232b35);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

#shaft-frame::before {
  left: 6px;
  top: 6px;
}

#shaft-frame::after {
  right: 6px;
  bottom: 6px;
}

#stage-canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 420 / 680;
  border-radius: 11px;
  background: #080b10;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.85), inset 0 0 0 1px rgba(0, 0, 0, 0.7);
  touch-action: none;
  overscroll-behavior: none;
  cursor: pointer;
}

#toast {
  position: absolute;
  left: 50%;
  bottom: 13%;
  transform: translate(-50%, 10px);
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(201, 151, 79, 0.5);
  background: rgba(24, 20, 13, 0.86);
  color: #ffe9bd;
  font-size: 12.5px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
}

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

/* ================= 触屏键（移动端才显示） ================= */
#touch-controls {
  display: none;
  width: 100%;
  max-width: 420px;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 10px;
}

.touch-key {
  position: relative;
  padding: 14px 0;
  border-radius: 13px;
  border: 1px solid var(--metal-3);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 45%),
    linear-gradient(180deg, #2f3944, #1a2029);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -3px 0 rgba(0, 0, 0, 0.55),
    0 8px 18px rgba(0, 0, 0, 0.4);
  font-size: 20px;
  color: var(--brass-light);
  cursor: pointer;
  user-select: none;
  transition: transform 0.06s ease, box-shadow 0.06s ease;
}

.touch-key:active,
.touch-key.is-down {
  transform: translateY(2px);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.7);
  background: linear-gradient(180deg, #232b34, #151a21);
}

.touch-key-dive {
  color: #ffcf7a;
  background:
    radial-gradient(120% 160% at 50% 0%, rgba(236, 201, 75, 0.28), transparent 66%),
    linear-gradient(180deg, #3b3323, #201b13);
  border-color: #6b5628;
}

/* ================= 浮层 ================= */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 7, 10, 0.78);
  backdrop-filter: blur(6px);
}

.overlay.is-open {
  display: flex;
}

.panel {
  width: 100%;
  max-width: 500px;
  max-height: 88vh;
  overflow: auto;
  padding: 24px 24px 20px;
  border-radius: 18px;
  border: 1px solid #4b586a;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 30%),
    linear-gradient(180deg, #232b35, #12171d 70%, #0c1015);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 30px 80px rgba(0, 0, 0, 0.7);
  animation: panel-in 0.24s ease both;
}

.panel-levels {
  max-width: 660px;
}

.panel-title {
  margin: 0 0 4px;
  font-size: 21px;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #fff1c9, var(--brass-light) 45%, #a2712f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.panel-sub {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--text-faint);
}

.panel-desc {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-dim);
}

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

.btn {
  padding: 9px 18px;
  border-radius: 10px;
  border: 1px solid var(--metal-3);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 46%),
    linear-gradient(180deg, #2f3945, #1a2029);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -2px 0 rgba(0, 0, 0, 0.55),
    0 6px 14px rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
  transition: transform 0.07s ease, box-shadow 0.07s ease, border-color 0.18s ease;
}

.btn:hover {
  border-color: #5d6d82;
}

.btn:active {
  transform: translateY(2px);
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.65);
}

.btn-primary {
  border-color: #7a6029;
  color: #fff3d4;
  background:
    radial-gradient(120% 180% at 50% 0%, rgba(236, 201, 75, 0.32), transparent 66%),
    linear-gradient(180deg, #4a3e26, #2a2318);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 204, 0.28),
    0 0 20px rgba(236, 201, 75, 0.15);
}

/* 选关 */
.levels-scroll {
  max-height: 56vh;
  overflow: auto;
  padding-right: 4px;
}

.levels-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.level-chapter {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(90, 104, 120, 0.4);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 60%);
}

.level-chapter-name {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--brass-light);
}

.level-chapter-cells {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.level-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 0 6px;
  border-radius: 9px;
  border: 1px solid #39434f;
  background: linear-gradient(180deg, #232b35, #151a21);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -2px 0 rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: border-color 0.16s ease, transform 0.07s ease, box-shadow 0.16s ease;
}

.level-cell:hover:not(:disabled) {
  border-color: #6d5726;
}

.level-cell:active:not(:disabled) {
  transform: translateY(2px);
}

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

.level-cell.is-cleared {
  border-color: #8a6a26;
  box-shadow: inset 0 0 12px rgba(246, 196, 83, 0.16), 0 0 12px rgba(246, 196, 83, 0.1);
}

.level-cell.is-current {
  border-color: #e0a84e;
  box-shadow: 0 0 0 1px rgba(224, 168, 78, 0.5), 0 0 16px rgba(224, 168, 78, 0.24);
}

.level-num {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.cell-stars {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--gold);
  min-height: 12px;
}

/* 结算 */
.result-stars {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 4px;
}

.result-stars[hidden] {
  display: none;
}

.star {
  font-size: 30px;
  color: #3c3423;
  text-shadow: none;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.star.is-on {
  color: var(--gold);
  text-shadow: 0 0 16px rgba(246, 196, 83, 0.55);
}

.result-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin: 12px 0 10px;
  flex-wrap: wrap;
}

.result-score-label {
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--text-faint);
}

.result-score-value {
  font-size: 32px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff3cd, var(--gold) 55%, #b07a33);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.result-badge {
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(246, 196, 83, 0.55);
  background: rgba(246, 196, 83, 0.12);
  font-size: 11px;
  color: var(--gold);
}

.result-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(90, 104, 120, 0.28);
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-dim);
}

.result-row strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.result-hint {
  min-height: 18px;
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 1.7;
  text-align: center;
  color: var(--text-faint);
}

.help-list {
  margin: 12px 0 0;
  padding-left: 20px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--text-dim);
}

.help-list li {
  margin-bottom: 4px;
}

/* ================= 动画 ================= */
@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

@keyframes sweep {
  to { transform: rotate(360deg); }
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ================= 桌面端（≥900px）双翼沉浸舞台 ================= */
@media (min-width: 900px) {
  #stage-core {
    grid-template-columns: 176px minmax(340px, 420px) 176px;
  }

  #shaft-frame {
    max-width: 420px;
  }
}

/* ================= 移动端（≤899px）一体化竖屏 ================= */
@media (max-width: 899px) {
  #game-app {
    padding: 10px 12px max(68px, calc(16px + env(safe-area-inset-bottom)));
  }

  #stage-bar {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 8px 10px;
  }

  #app-title {
    order: -1;
    width: 100%;
  }

  #app-title-main {
    font-size: 21px;
  }

  #app-subtitle {
    font-size: 10px;
  }

  .bar-btn {
    padding: 6px 9px;
    font-size: 12px;
  }

  #mode-bar {
    width: 100%;
    justify-content: center;
    gap: 4px;
    margin-top: 10px;
  }

  .mode-chip {
    flex: 1;
    padding: 7px 6px;
    font-size: 12px;
  }

  #stage-core {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
  }

  #wing-left {
    order: 1;
    display: grid;
    grid-template-columns: 0.95fr 1.05fr 1.25fr;
    gap: 6px;
    width: 100%;
    max-width: 460px;
  }

  #wing-left .plate {
    padding: 6px 8px 7px;
    border-radius: 10px;
  }

  #wing-left .plate-depth,
  #wing-left .plate-life,
  #wing-left .plate-goal {
    grid-column: span 1;
  }

  #wing-left .plate-best {
    display: none;
  }

  .depth-value {
    font-size: 24px;
  }

  .plate-label {
    font-size: 9px;
    letter-spacing: 0.12em;
  }

  .hearts {
    margin: 4px 0 2px;
    gap: 2px;
  }

  .heart {
    font-size: 12px;
  }

  .life-value,
  .goal-value {
    font-size: 11px;
  }

  .goal-track {
    margin: 6px 0 1px;
    height: 5px;
  }

  .depth-ticks {
    display: none;
  }

  #wing-right {
    display: none;
  }

  #shaft-arena {
    order: 2;
    width: 100%;
  }

  #shaft-frame {
    width: min(100%, 420px);
    width: min(100%, clamp(220px, calc((100vh - 330px) * 0.6176), 420px));
    width: min(100%, clamp(220px, calc((100dvh - 330px) * 0.6176), 420px));
    max-width: 100%;
  }

  #touch-controls {
    display: grid;
  }

  .panel {
    padding: 18px 16px 16px;
  }

  .panel-title {
    font-size: 18px;
  }

  .level-chapter-cells {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .level-cell {
    padding: 6px 0 4px;
  }

  .level-num {
    font-size: 13px;
  }

  .cell-stars {
    font-size: 9px;
  }
}

@media (max-width: 560px) {
  #game-app {
    padding-left: 8px;
    padding-right: 8px;
  }

  .bar-text {
    display: none;
  }

  #back-home .bar-text {
    display: inline;
  }

  .bar-btn {
    padding: 6px 8px;
  }

  .mode-chip {
    font-size: 11px;
    letter-spacing: 0.02em;
  }

  .panel {
    max-width: 100%;
  }

  .levels-scroll {
    max-height: 50vh;
  }

  .level-chapter {
    padding: 8px 8px;
  }

  .level-chapter-cells {
    gap: 5px;
  }

  .result-score-value {
    font-size: 26px;
  }

  .star {
    font-size: 25px;
  }
}

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

  .radar-sweep {
    display: none;
  }
}
