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

html, body {
  height: 100%;
  overflow: hidden;
  background: #0b0e1a;
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

#stage { position: fixed; inset: 0; }

#game {
  position: absolute;
  inset: 0;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

#vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 42%, transparent 55%, rgba(4, 6, 14, 0.55) 100%);
}

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  top: 0; left: 0; right: 0;
  max-width: 620px;
  margin: 0 auto;
  padding: calc(8px + env(safe-area-inset-top)) 14px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  color: #eef2ff;
}

.hud-box { min-width: 92px; }
.hud-box.right { margin-left: auto; text-align: right; }

.hud-label {
  font-size: 10px;
  letter-spacing: 3px;
  opacity: 0.55;
}

.hud-value {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 12px rgba(90, 140, 255, 0.45);
  line-height: 1.1;
}

.hud-chip {
  margin: 0 auto;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #cfe0ff;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.2s;
}
.hud-chip.bump { transform: scale(1.25); }

#btn-mute {
  pointer-events: auto;
  width: 34px; height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.15s;
}
#btn-mute:hover { background: rgba(255, 255, 255, 0.15); }
#btn-mute.off { opacity: 0.45; }

/* ---------- 覆盖层 ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(7, 9, 18, 0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
  z-index: 10;
}
.overlay.show { opacity: 1; visibility: visible; }

.panel {
  width: min(400px, 100%);
  padding: 34px 30px 30px;
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(30, 36, 64, 0.92), rgba(16, 19, 36, 0.92));
  border: 1px solid rgba(140, 170, 255, 0.16);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
  color: #e8edff;
  transform: translateY(14px) scale(0.97);
  transition: transform 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.overlay.show .panel { transform: none; }

.logo {
  font-size: 46px;
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(100deg, #6ab8ff, #b46bff 55%, #ff5d8e);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 22px rgba(120, 100, 255, 0.4));
}
.logo span { -webkit-text-fill-color: #ffc541; }

.tagline {
  margin-top: 4px;
  font-size: 14px;
  letter-spacing: 6px;
  opacity: 0.6;
}

.howto {
  list-style: none;
  margin: 26px 0 28px;
  text-align: left;
  display: grid;
  gap: 12px;
}
.howto li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  line-height: 1.45;
  color: #c4cdea;
}
.howto li i {
  font-style: normal;
  font-size: 20px;
  flex: 0 0 auto;
}
.howto li b { color: #fff; }

.btn-primary {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 16px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 4px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(120deg, #4a8dff, #8b5bff);
  box-shadow: 0 10px 30px rgba(90, 110, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
}
.btn-primary:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(1px) scale(0.98); box-shadow: 0 4px 14px rgba(90, 110, 255, 0.35); }

/* ---------- 结算 ---------- */
.over-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 8px;
  opacity: 0.85;
}

.record-badge {
  display: none;
  margin: 12px auto 0;
  width: fit-content;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #2a1a00;
  background: linear-gradient(100deg, #ffd75e, #ffb02e);
  box-shadow: 0 4px 18px rgba(255, 180, 40, 0.45);
  animation: badge-pop 0.5s cubic-bezier(0.2, 1.8, 0.4, 1);
}
.record-badge.show { display: block; }
@keyframes badge-pop { from { transform: scale(0.3); opacity: 0; } }

.final-score {
  margin: 10px 0 18px;
  font-size: 58px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff, #9db4ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stats-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 26px;
}
.stat {
  flex: 1;
  padding: 10px 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.stat-v { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-k { font-size: 10px; opacity: 0.55; margin-top: 2px; letter-spacing: 1px; }

.hud-ghost {
  pointer-events: auto;
  width: 42px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
}

.claim {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.55;
  color: #dce4ff;
  opacity: 0.88;
}

.meta-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 0 0 18px;
  font-size: 13px;
}

.meta-dot { opacity: 0.35; }

.text-link {
  color: #9fc8ff;
  text-decoration: none;
}

.text-link:hover { color: #c6deff; }

.leaderboard-card {
  margin: 0 0 18px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.leaderboard-card.compact {
  margin-top: 14px;
}

.card-title {
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: 3px;
  text-align: left;
  color: #dce4ff;
  opacity: 0.72;
}

.board-list {
  display: grid;
  gap: 8px;
  min-height: 72px;
}

.board-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(11, 14, 26, 0.35);
  color: #edf2ff;
  font-size: 13px;
}

.board-rank {
  font-weight: 800;
  color: #ffc541;
}

.board-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-score {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.board-meta {
  opacity: 0.56;
  font-size: 11px;
}

.board-empty {
  padding: 12px 0;
  color: #aeb7d5;
  font-size: 13px;
  opacity: 0.7;
}

.submit-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.text-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  font-size: 14px;
  outline: none;
}

.btn-secondary {
  padding: 12px 14px;
  border: none;
  border-radius: 14px;
  background: rgba(83, 146, 255, 0.18);
  color: #dce8ff;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.submit-status {
  min-height: 18px;
  margin-bottom: 10px;
  font-size: 12px;
  color: #a6c8ff;
}

.email-copy {
  margin-bottom: 10px;
  text-align: left;
  font-size: 13px;
  line-height: 1.5;
  color: #c9d4f5;
}

.page-shell {
  min-height: 100%;
  overflow: auto;
  background:
    radial-gradient(circle at 20% 20%, rgba(74, 141, 255, 0.16), transparent 30%),
    radial-gradient(circle at 80% 0%, rgba(180, 107, 255, 0.16), transparent 26%),
    linear-gradient(180deg, #101527 0%, #0b0e1a 55%, #131022 100%);
  color: #edf2ff;
}

.page-wrap {
  width: min(760px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.page-wrap h1,
.page-wrap h2 {
  margin-bottom: 14px;
}

.page-wrap p,
.page-wrap li {
  line-height: 1.7;
  color: #cdd7f5;
}

.page-wrap ul {
  padding-left: 20px;
  margin: 12px 0 18px;
}

@media (max-width: 560px) {
  .panel {
    padding: 26px 18px 20px;
  }

  .logo {
    font-size: 38px;
  }

  .submit-row {
    flex-direction: column;
  }

  .hud-box {
    min-width: 70px;
  }
}

/* ---------- 精简菜单(居中大开始键) ---------- */
.hud-home {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 17px;
  width: 36px;
}
.hud-home:hover { background: rgba(255, 255, 255, 0.15); }

.menu-compact { padding-top: 40px; padding-bottom: 26px; }

.btn-hero {
  margin: 26px auto 22px;
  display: block;
  width: 78%;
  padding: 18px;
  font-size: 20px;
  letter-spacing: 6px;
  border-radius: 20px;
}

.howto.slim { margin: 0 0 18px; gap: 9px; }
.howto.slim li { font-size: 13px; justify-content: center; }
