/* 俄罗斯方块4 · 赛博朋克霓虹街机 */
:root {
  --orange: #ff8a3d;
  --orange-hi: #ffbd86;
  --cyan: #2fe8ff;
  --cyan-soft: rgba(47, 232, 255, 0.55);
  --magenta: #c45cff;
  --violet: #7b5cff;
  --ink: #05020f;
  --panel: rgba(10, 14, 40, 0.8);
  --panel-line: rgba(47, 232, 255, 0.24);
  --text: #eef9ff;
  --dim: #8da6cc;
  --mono: ui-monospace, "SFMono-Regular", "Menlo", "Consolas", "Liberation Mono", monospace;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --pad: clamp(44px, 14.2vw, 58px);
}

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

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #05020f;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

.app {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 540px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: max(8px, var(--safe-top));
  isolation: isolate;
}

/* ---------- 背景层 ---------- */
.bg {
  position: absolute;
  inset: -3%;
  z-index: 0;
  background-image: url("images/gen/gptimg_1795262750_look.png");
  background-size: cover;
  background-position: 100% 50%;
  background-repeat: no-repeat;
  filter: saturate(1.38) contrast(1.08) brightness(0.94) blur(0.2px);
  transform: scale(1.04);
  will-change: transform;
}

.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(54% 42% at 50% 55%, rgba(4, 2, 16, 0.72) 0%, rgba(4, 2, 16, 0.4) 60%, rgba(4, 2, 16, 0) 100%),
    radial-gradient(118% 64% at 50% 32%, rgba(23, 8, 62, 0.02) 0%, rgba(4, 2, 16, 0.22) 72%, rgba(4, 2, 16, 0.62) 100%),
    linear-gradient(180deg, rgba(4, 2, 16, 0.82) 0%, rgba(4, 2, 16, 0.14) 24%, rgba(4, 2, 16, 0.12) 58%, rgba(4, 2, 16, 0.78) 100%);
}

.fx-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.5;
  background-image:
    linear-gradient(rgba(74, 205, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(74, 205, 255, 0.07) 1px, transparent 1px);
  background-size: 30px 30px;
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 46%, rgba(0, 0, 0, 0.5));
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.8), transparent 46%, rgba(0, 0, 0, 0.5));
}

.fx-scan {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.32;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.055) 0px,
    rgba(255, 255, 255, 0.055) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: soft-light;
  animation: scanDrift 14s linear infinite;
}

@keyframes scanDrift {
  from { background-position: 0 0; }
  to { background-position: 0 60px; }
}

.orb {
  position: absolute;
  z-index: 1;
  width: 52vw;
  height: 52vw;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(46px);
  opacity: 0.4;
}

.orb-a {
  top: 26%;
  left: -22vw;
  background: radial-gradient(circle, rgba(123, 92, 255, 0.6), transparent 68%);
}

.orb-b {
  bottom: -14vw;
  right: -18vw;
  background: radial-gradient(circle, rgba(255, 138, 61, 0.42), transparent 70%);
}

/* ---------- 顶部 HUD ---------- */
.hud {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  padding: 2px 16px 0;
}

.hud-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 40px;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  line-height: 1;
}

.brand-main {
  font-family: "Arial Black", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(17px, 5.4vw, 22px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.045em;
  background: linear-gradient(178deg, #ffffff 4%, #c6f6ff 46%, #56c8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 0 5px rgba(47, 232, 255, 0.85))
    drop-shadow(0 0 13px rgba(47, 140, 255, 0.55));
  transform: skewX(-3deg);
  white-space: nowrap;
}

.brand-num {
  font-family: "Arial Black", "PingFang SC", sans-serif;
  font-size: clamp(24px, 7.6vw, 32px);
  font-weight: 900;
  font-style: italic;
  line-height: 0.8;
  background: linear-gradient(178deg, #fff2c9 0%, #ffb25c 42%, #ff7a2f 78%, #ff5f1f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter:
    drop-shadow(0 0 7px rgba(255, 138, 61, 0.9))
    drop-shadow(0 0 18px rgba(255, 102, 20, 0.5));
  transform: skewX(-7deg);
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}

.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(47, 232, 255, 0.34);
  background: linear-gradient(160deg, rgba(16, 27, 62, 0.88), rgba(7, 8, 26, 0.86));
  box-shadow:
    inset 0 0 12px rgba(47, 232, 255, 0.09),
    0 2px 10px rgba(0, 0, 0, 0.35);
  color: #b9efff;
  transition: transform 0.09s ease, border-color 0.16s ease, color 0.16s ease;
}

.icon-btn::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 12px;
}

.icon-btn .mp-icon {
  width: 19px;
  height: 19px;
  filter: drop-shadow(0 0 5px rgba(47, 232, 255, 0.6));
}

.icon-btn:active {
  transform: scale(0.93);
  border-color: rgba(255, 138, 61, 0.75);
  color: var(--orange-hi);
}

.icon-btn.is-off {
  color: #5f7294;
  border-color: rgba(120, 145, 180, 0.25);
}

.icon-btn.is-off .mp-icon {
  filter: none;
}

.hud-main {
  display: flex;
  align-items: stretch;
  gap: 7px;
  margin-top: 5px;
}

.stats {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.stat {
  position: relative;
  height: 57px;
  min-width: 0;
  padding: 7px 9px 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background:
    linear-gradient(152deg, rgba(29, 41, 88, 0.82) 0%, rgba(12, 12, 38, 0.86) 56%, rgba(8, 6, 26, 0.92) 100%);
  border: 1px solid rgba(47, 232, 255, 0.22);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  box-shadow: inset 0 0 16px rgba(47, 232, 255, 0.06);
  overflow: hidden;
}

.stat::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8px;
  right: 34%;
  height: 1px;
  background: linear-gradient(90deg, rgba(47, 232, 255, 0.85), transparent);
}

.stat::after {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 9px;
  height: 9px;
  border-right: 1px solid rgba(255, 138, 61, 0.65);
  border-bottom: 1px solid rgba(255, 138, 61, 0.65);
}

.stat-label {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--dim);
  line-height: 1;
  text-indent: 0.2em;
}

.stat-val {
  font-family: var(--mono);
  font-size: clamp(16px, 5.1vw, 21px);
  font-weight: 800;
  line-height: 1;
  color: #f4fcff;
  letter-spacing: -0.02em;
  text-shadow:
    0 0 8px rgba(47, 232, 255, 0.4),
    0 0 18px rgba(47, 232, 255, 0.15);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.stat-score .stat-val {
  color: #ffd8ba;
  text-shadow:
    0 0 8px rgba(255, 138, 61, 0.65),
    0 0 20px rgba(255, 110, 30, 0.28);
}

.stat-val.bump {
  animation: statBump 0.22s ease-out;
}

@keyframes statBump {
  0% { transform: scale(1); }
  45% { transform: scale(1.13); color: #fff; }
  100% { transform: scale(1); }
}

.next-card {
  position: relative;
  flex: 0 0 72px;
  width: 72px;
  height: 57px;
  padding: 5px 5px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(155deg, rgba(24, 30, 74, 0.9), rgba(7, 6, 24, 0.94));
  border: 1px solid rgba(196, 92, 255, 0.34);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  box-shadow: inset 0 0 18px rgba(196, 92, 255, 0.1);
}

.next-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8px;
  right: 8px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196, 92, 255, 0.9), transparent);
}

.next-label {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: #b9a6d9;
  text-indent: 0.16em;
  line-height: 1;
}

#nextCanvas {
  display: block;
  width: 48px;
  height: 38px;
  margin-top: 2px;
}

/* ---------- 棋盘 ---------- */
.stage {
  position: relative;
  z-index: 4;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 7px 16px 3px;
}

.board-shell {
  position: relative;
  flex: 0 0 auto;
  background: linear-gradient(150deg, #d9feff 0%, #45eaff 14%, #2fb6ff 36%, #4f6bff 56%, #9b4dff 76%, #c45cff 89%, #ff9a55 100%);
  clip-path: polygon(13px 0, calc(100% - 13px) 0, 100% 13px, 100% calc(100% - 13px), calc(100% - 13px) 100%, 13px 100%, 0 calc(100% - 13px), 0 13px);
  filter:
    drop-shadow(0 0 7px rgba(47, 232, 255, 0.68))
    drop-shadow(0 0 24px rgba(103, 72, 255, 0.34))
    drop-shadow(0 10px 28px rgba(0, 0, 0, 0.55));
  animation: framePulse 4.2s ease-in-out infinite;
}

.board-shell::before {
  content: "";
  position: absolute;
  inset: 2px;
  z-index: 3;
  pointer-events: none;
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.4),
    inset 0 0 10px rgba(47, 232, 255, 0.5);
  opacity: 0.7;
}

@keyframes framePulse {
  0%, 100% {
    filter:
      drop-shadow(0 0 7px rgba(47, 232, 255, 0.62))
      drop-shadow(0 0 22px rgba(103, 72, 255, 0.3))
      drop-shadow(0 10px 28px rgba(0, 0, 0, 0.55));
  }
  50% {
    filter:
      drop-shadow(0 0 12px rgba(47, 232, 255, 0.9))
      drop-shadow(0 0 32px rgba(196, 92, 255, 0.48))
      drop-shadow(0 10px 28px rgba(0, 0, 0, 0.55));
  }
}

.board-shell.shake {
  animation: boardShake 0.26s cubic-bezier(0.36, 0.07, 0.19, 0.97) 1;
}

@keyframes boardShake {
  0% { transform: translate3d(0, 0, 0); }
  18% { transform: translate3d(-2px, 1px, 0); }
  36% { transform: translate3d(2px, -1px, 0); }
  54% { transform: translate3d(-1.5px, 1px, 0); }
  72% { transform: translate3d(1.5px, -0.5px, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.board-bezel {
  position: absolute;
  inset: 8px;
  overflow: hidden;
  background: #040514;
  clip-path: polygon(9px 0, calc(100% - 9px) 0, 100% 9px, 100% calc(100% - 9px), calc(100% - 9px) 100%, 9px 100%, 0 calc(100% - 9px), 0 9px);
  box-shadow:
    inset 0 0 30px rgba(47, 232, 255, 0.14),
    inset 0 0 0 1px rgba(123, 225, 255, 0.28);
}

#boardCanvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.board-scan {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0.28;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.07) 0,
    rgba(255, 255, 255, 0.07) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: soft-light;
}

.board-scan::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -22%;
  height: 18%;
  background: linear-gradient(180deg, rgba(47, 232, 255, 0) 0%, rgba(47, 232, 255, 0.13) 50%, rgba(47, 232, 255, 0) 100%);
  animation: boardSweep 7.5s linear infinite;
}

@keyframes boardSweep {
  0% { transform: translateY(-40%); opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { transform: translateY(660%); opacity: 0; }
}

.board-danger {
  position: absolute;
  top: 0;
  left: 6%;
  right: 6%;
  height: 2px;
  z-index: 3;
  background: linear-gradient(90deg, transparent, rgba(255, 138, 61, 0.8), transparent);
  opacity: 0.65;
  filter: blur(0.4px);
  pointer-events: none;
}

.combo {
  position: absolute;
  left: 0;
  right: 0;
  top: 31%;
  z-index: 4;
  pointer-events: none;
  text-align: center;
  font-family: "Arial Black", "PingFang SC", sans-serif;
  font-size: clamp(20px, 7vw, 30px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.02em;
  color: #ffffff;
  text-shadow:
    0 0 8px rgba(47, 232, 255, 0.95),
    0 0 24px rgba(47, 232, 255, 0.6),
    0 2px 0 rgba(98, 34, 148, 0.8);
  opacity: 0;
  transform: translateY(8px) scale(0.86);
}

.combo.show {
  animation: comboPop 0.78s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.combo.hot {
  color: #ffe1b8;
  text-shadow:
    0 0 10px rgba(255, 138, 61, 0.95),
    0 0 26px rgba(255, 110, 30, 0.7),
    0 2px 0 rgba(120, 30, 0, 0.7);
}

@keyframes comboPop {
  0% { opacity: 0; transform: translateY(12px) scale(0.82); }
  22% { opacity: 1; transform: translateY(0) scale(1.08); }
  40% { transform: translateY(0) scale(1); }
  74% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-18px) scale(0.98); }
}

.start-tip {
  position: absolute;
  left: 50%;
  top: 46%;
  z-index: 5;
  transform: translate(-50%, -50%);
  padding: 6px 11px;
  border: 1px solid rgba(47, 232, 255, 0.24);
  border-radius: 9px;
  background: linear-gradient(160deg, rgba(10, 22, 50, 0.82), rgba(5, 6, 22, 0.78));
  box-shadow:
    inset 0 0 12px rgba(47, 232, 255, 0.08),
    0 4px 14px rgba(0, 0, 0, 0.3);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  color: #9ec0dd;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.2;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transition: opacity 0.45s ease, transform 0.45s ease;
  pointer-events: none;
}

.start-tip.hide {
  opacity: 0;
  transform: translate(-50%, -64%);
}

/* ---------- 操作区 ---------- */
.controls {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 16px calc(8px + var(--safe-bottom));
}

.pad-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pad {
  position: relative;
  width: var(--pad);
  height: var(--pad);
  flex: 0 0 auto;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent;
  touch-action: none;
  transition: transform 0.08s ease;
}

.pad::before,
.pad::after {
  content: "";
  position: absolute;
  clip-path: polygon(22% 0, 78% 0, 100% 22%, 100% 78%, 78% 100%, 22% 100%, 0 78%, 0 22%);
  pointer-events: none;
}

.pad::before {
  inset: 0;
  background: linear-gradient(155deg, rgba(126, 246, 255, 0.95), rgba(47, 174, 255, 0.65) 42%, rgba(123, 92, 255, 0.7) 76%, rgba(47, 232, 255, 0.4));
  box-shadow: 0 0 14px rgba(47, 232, 255, 0.35);
}

.pad::after {
  inset: 1.5px;
  background:
    linear-gradient(155deg, rgba(20, 34, 72, 0.96) 0%, rgba(9, 12, 34, 0.97) 58%, rgba(7, 5, 22, 0.98) 100%);
  box-shadow: inset 0 0 18px rgba(47, 232, 255, 0.13);
}

.pad .mp-icon {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
  color: #ccf7ff;
  filter: drop-shadow(0 0 5px rgba(47, 232, 255, 0.8));
  pointer-events: none;
}

.pad-magenta::before {
  background: linear-gradient(155deg, #f3d4ff, rgba(196, 92, 255, 0.85) 44%, rgba(123, 92, 255, 0.8) 78%, rgba(196, 92, 255, 0.4));
  box-shadow: 0 0 14px rgba(196, 92, 255, 0.4);
}

.pad-magenta .mp-icon {
  color: #f0d8ff;
  filter: drop-shadow(0 0 5px rgba(196, 92, 255, 0.9));
}

.pad-hot::before {
  background: linear-gradient(155deg, #fff0d8, rgba(255, 138, 61, 0.95) 42%, rgba(255, 90, 30, 0.85) 78%, rgba(255, 138, 61, 0.4));
  box-shadow: 0 0 16px rgba(255, 138, 61, 0.48);
}

.pad-hot .mp-icon {
  color: #ffe2c6;
  filter: drop-shadow(0 0 6px rgba(255, 138, 61, 0.95));
}

.pad:active {
  transform: translateY(1px) scale(0.94);
}

.pad:active::before {
  filter: brightness(1.45);
}

.pad.pressed {
  transform: translateY(1px) scale(0.96);
}

/* ---------- 弹层 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(3, 2, 14, 0.62);
  backdrop-filter: blur(9px) saturate(1.05);
  -webkit-backdrop-filter: blur(9px) saturate(1.05);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.modal {
  position: relative;
  width: min(330px, 86vw);
  padding: 26px 22px 22px;
  text-align: center;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(59, 47, 128, 0.55), transparent 60%),
    linear-gradient(168deg, rgba(18, 22, 58, 0.98), rgba(6, 5, 22, 0.99));
  border: 1px solid rgba(47, 232, 255, 0.38);
  clip-path: polygon(18px 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px), 0 18px);
  box-shadow:
    inset 0 0 40px rgba(47, 232, 255, 0.06),
    0 0 0 1px rgba(123, 92, 255, 0.16),
    0 24px 60px rgba(0, 0, 0, 0.6);
  filter: drop-shadow(0 0 18px rgba(47, 232, 255, 0.16));
}

.modal::before {
  content: "";
  position: absolute;
  top: 0;
  left: 18px;
  right: 18px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--orange), transparent);
  opacity: 0.85;
}

.modal-kicker {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.34em;
  color: var(--cyan);
  text-indent: 0.34em;
  opacity: 0.9;
}

.modal-title {
  margin: 10px 0 4px;
  font-family: "Arial Black", "PingFang SC", sans-serif;
  font-size: 32px;
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0.05em;
  background: linear-gradient(178deg, #ffffff 3%, #b8f3ff 48%, #48b8ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(47, 232, 255, 0.5));
}

.over-title {
  background-image: linear-gradient(178deg, #fff5d9 3%, #ffb066 48%, #ff6a24 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 12px rgba(255, 122, 47, 0.55));
}

.modal-sub {
  margin: 0 0 20px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--dim);
}

.final-score {
  margin: 18px 0 12px;
  padding: 12px 10px;
  border-top: 1px solid rgba(47, 232, 255, 0.16);
  border-bottom: 1px solid rgba(47, 232, 255, 0.16);
  background: rgba(47, 232, 255, 0.03);
}

.final-label {
  display: block;
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--dim);
  text-indent: 0.24em;
}

.final-val {
  display: block;
  margin-top: 2px;
  font-family: var(--mono);
  font-size: 38px;
  font-weight: 800;
  line-height: 1.1;
  color: #ffd2a4;
  text-shadow:
    0 0 12px rgba(255, 138, 61, 0.75),
    0 0 32px rgba(255, 110, 30, 0.35);
  font-variant-numeric: tabular-nums;
}

.final-meta {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin-bottom: 20px;
  color: var(--dim);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.final-meta b {
  margin-left: 4px;
  color: #eaf8ff;
  font-family: var(--mono);
  font-size: 14px;
}

.btn-primary,
.btn-ghost {
  position: relative;
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0 18px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  touch-action: manipulation;
  transition: transform 0.08s ease, filter 0.16s ease;
}

.btn-primary {
  color: #2a0d00;
  background: linear-gradient(168deg, #ffe2c8 0%, #ffb064 34%, #ff8a3d 66%, #ff6a1f 100%);
  clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 0 calc(100% - 12px), 0 12px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 0 18px rgba(255, 138, 61, 0.4),
    0 6px 18px rgba(60, 20, 0, 0.4);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.985);
  filter: brightness(1.08);
}

.btn-ghost {
  margin-top: 12px;
  min-height: 38px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: #9fb8d8;
  background: transparent;
  border: 1px solid rgba(143, 170, 208, 0.24);
  clip-path: polygon(9px 0, calc(100% - 9px) 0, 100% 9px, 100% calc(100% - 9px), calc(100% - 9px) 100%, 9px 100%, 0 calc(100% - 9px), 0 9px);
}

.btn-ghost:active {
  color: #fff;
  border-color: rgba(255, 138, 61, 0.5);
  transform: scale(0.985);
}

/* ---------- 小屏适配 ---------- */
@media (max-width: 340px) {
  .start-tip {
    padding: 5px 8px;
    font-size: 8px;
  }
}

@media (max-width: 350px) {
  .hud,
  .stage,
  .controls {
    padding-left: 12px;
    padding-right: 12px;
  }

  .stat {
    height: 52px;
    padding: 6px 7px 5px;
  }

  .next-card {
    height: 52px;
    flex-basis: 64px;
    width: 64px;
  }

  #nextCanvas {
    width: 42px;
    height: 34px;
  }

  .stat-label {
    font-size: 9px;
  }

  .pad-group {
    gap: 6px;
  }

  .controls {
    gap: 6px;
  }
}

@media (max-height: 700px) {
  .hud-top {
    height: 32px;
  }

  .stat {
    height: 50px;
  }

  .next-card {
    height: 50px;
  }

  #nextCanvas {
    height: 30px;
  }

  .stage {
    padding-top: 4px;
  }

  .controls {
    padding-top: 2px;
    padding-bottom: calc(5px + var(--safe-bottom));
  }
}

@media (max-height: 620px) {
  .brand-main {
    font-size: 16px;
  }

  .brand-num {
    font-size: 23px;
  }

  .hud-top {
    height: 29px;
  }

  .stat,
  .next-card {
    height: 46px;
  }

  .stat {
    padding-top: 5px;
    padding-bottom: 4px;
  }

  .stat-val {
    font-size: 15px;
  }

  #nextCanvas {
    width: 40px;
    height: 28px;
    margin-top: 0;
  }

  .next-label {
    font-size: 8px;
  }
}

@media (min-width: 620px) {
  .bg {
    filter: saturate(1.34) contrast(1.06) brightness(0.76) blur(9px);
    transform: scale(1.1);
  }

  .hud,
  .stage,
  .controls {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
  }

  .hud {
    padding-left: 22px;
    padding-right: 22px;
  }

  .stage {
    padding-left: 22px;
    padding-right: 22px;
  }

  .controls {
    padding-left: 22px;
    padding-right: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .board-shell,
  .fx-scan,
  .combo.show,
  .stat-val.bump {
    animation: none !important;
  }
}
