/* 霓虹打砖块 — 纯 CSS 原创美术 */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: #05060f radial-gradient(ellipse at 50% 0%, #101a3a 0%, #05060f 70%);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  color: #dfe7ff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#game-wrap {
  position: relative;
  width: min(96vw, 800px);
  filter: drop-shadow(0 0 24px rgba(72, 198, 239, 0.18));
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #070a18;
  border: 2px solid rgba(72, 198, 239, 0.45);
  border-radius: 10px;
  touch-action: none;
}

/* ---------- HUD ---------- */
#hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 8px rgba(72, 198, 239, 0.6);
}
#hud.hidden { visibility: hidden; }
.hud-box { display: flex; flex-direction: column; gap: 1px; }
.hud-mid { text-align: center; }
.hud-right { flex-direction: row; align-items: center; gap: 10px; }
.hud-dim { opacity: 0.6; font-size: 12px; }
.hud-combo { color: #f7d154; font-size: 13px; min-height: 16px; text-shadow: 0 0 8px rgba(247, 209, 84, 0.8); }
.lives { color: #ff5d7a; letter-spacing: 2px; text-shadow: 0 0 8px rgba(255, 93, 122, 0.9); font-size: 16px; }

/* ---------- 屏幕覆盖层 ---------- */
.screen {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(5, 8, 20, 0.82);
  backdrop-filter: blur(4px);
  border-radius: 10px;
  text-align: center;
  padding: 20px;
}
.screen.hidden { display: none; }

.title {
  font-size: clamp(34px, 7vw, 56px);
  letter-spacing: 8px;
  color: #48c6ef;
  text-shadow: 0 0 12px #48c6ef, 0 0 42px rgba(72, 198, 239, 0.7);
  animation: pulse 2.2s ease-in-out infinite;
}
.subtitle {
  letter-spacing: 6px;
  font-size: 13px;
  color: #a55eff;
  text-shadow: 0 0 10px rgba(165, 94, 255, 0.8);
  margin-top: -8px;
}
.title2 {
  font-size: clamp(26px, 5vw, 38px);
  letter-spacing: 4px;
  color: #48c6ef;
  text-shadow: 0 0 14px rgba(72, 198, 239, 0.9);
}
.glow-green { color: #4ecb71; text-shadow: 0 0 16px rgba(78, 203, 113, 0.9); }
.glow-red { color: #ff5d5d; text-shadow: 0 0 16px rgba(255, 93, 93, 0.9); }
.glow-gold { color: #f7d154; text-shadow: 0 0 16px rgba(247, 209, 84, 0.9); }

@keyframes pulse {
  0%, 100% { text-shadow: 0 0 12px #48c6ef, 0 0 42px rgba(72, 198, 239, 0.7); }
  50% { text-shadow: 0 0 20px #48c6ef, 0 0 70px rgba(72, 198, 239, 1); }
}

.menu-high { font-size: 17px; color: #f7d154; text-shadow: 0 0 10px rgba(247, 209, 84, 0.7); }
.hint { font-size: 13px; line-height: 1.8; opacity: 0.65; margin-top: 6px; }

/* ---------- 按钮 ---------- */
.btn {
  font-family: inherit;
  font-size: 17px;
  letter-spacing: 3px;
  color: #dfe7ff;
  background: rgba(72, 198, 239, 0.08);
  border: 1.5px solid rgba(72, 198, 239, 0.7);
  border-radius: 8px;
  padding: 10px 34px;
  min-width: 220px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-shadow: 0 0 8px rgba(72, 198, 239, 0.6);
}
.btn:hover, .btn:active {
  background: rgba(72, 198, 239, 0.25);
  box-shadow: 0 0 18px rgba(72, 198, 239, 0.55);
  transform: translateY(-1px);
}
.btn-big { font-size: 21px; padding: 13px 40px; border-color: #4ecb71; color: #eafff0; background: rgba(78, 203, 113, 0.12); text-shadow: 0 0 8px rgba(78, 203, 113, 0.7); }
.btn-big:hover, .btn-big:active { background: rgba(78, 203, 113, 0.3); box-shadow: 0 0 18px rgba(78, 203, 113, 0.6); }
.btn-small { font-size: 14px; padding: 7px 20px; min-width: 0; }

#btn-pause { min-width: 0; padding: 6px 12px; font-size: 13px; }

/* ---------- 关卡选择 ---------- */
.level-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin: 10px 0 14px;
}
.level-cell {
  width: clamp(52px, 11vw, 84px);
  height: clamp(52px, 11vw, 84px);
  font-family: inherit;
  font-size: clamp(18px, 4vw, 26px);
  color: #dfe7ff;
  background: rgba(72, 198, 239, 0.1);
  border: 1.5px solid rgba(72, 198, 239, 0.6);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.level-cell .lv-name { font-size: 10px; opacity: 0.7; letter-spacing: 0; }
.level-cell:hover:not(:disabled) { background: rgba(72, 198, 239, 0.3); box-shadow: 0 0 14px rgba(72, 198, 239, 0.5); }
.level-cell:disabled { opacity: 0.28; cursor: not-allowed; border-style: dashed; }

@media (max-width: 560px) {
  .btn { min-width: 180px; font-size: 15px; }
  #hud { font-size: 13px; }
}
