* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #03040a;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

#stage { position: relative; }

#game-canvas {
  display: block;
  background: #04060f;
  border-radius: 8px;
  box-shadow: 0 0 60px rgba(30, 80, 200, 0.35);
  touch-action: none;
}

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  color: #cfe8ff;
  user-select: none;
  -webkit-user-select: none;
}

.hud-top {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.hud-col { display: flex; flex-direction: column; gap: 4px; }

.hud-item {
  background: rgba(8, 20, 45, 0.55);
  border: 1px solid rgba(79, 195, 247, 0.25);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 13px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.hud-label { color: #7fb3d8; font-size: 11px; }
#hud-score, #hud-best, #hud-wave { font-weight: 700; }

.icon-btn {
  pointer-events: auto;
  background: rgba(8, 20, 45, 0.6);
  color: #cfe8ff;
  border: 1px solid rgba(79, 195, 247, 0.3);
  border-radius: 8px;
  width: 36px;
  height: 30px;
  font-size: 15px;
  cursor: pointer;
}
.icon-btn:active { transform: scale(0.94); }

.hud-bottom {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  text-shadow: 0 1px 3px #000;
}

#boss-bar {
  position: absolute;
  top: 56px;
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.boss-label {
  color: #ff8a80;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
}
.boss-track {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  overflow: hidden;
}
#boss-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff5252, #ff8a65);
  border-radius: 4px;
  transition: width 0.15s linear;
}

.hidden { display: none !important; }

/* ---------- 覆盖界面 ---------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(3, 6, 16, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 8px;
  color: #e3f2fd;
  text-align: center;
}

.screen h1 {
  font-size: 44px;
  letter-spacing: 10px;
  color: #81d4fa;
  text-shadow: 0 0 24px rgba(41, 182, 246, 0.65);
}

.screen h2 {
  font-size: 30px;
  letter-spacing: 8px;
  color: #81d4fa;
  text-shadow: 0 0 18px rgba(41, 182, 246, 0.5);
}

.over-title {
  color: #ff8a80;
  text-shadow: 0 0 18px rgba(255, 82, 82, 0.5);
}

.sub {
  font-size: 14px;
  letter-spacing: 6px;
  color: #7fb3d8;
}

.tips {
  font-size: 13px;
  line-height: 2;
  color: #9fc3e0;
}

.btn {
  pointer-events: auto;
  margin-top: 6px;
  padding: 12px 46px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #04121f;
  background: linear-gradient(180deg, #81d4fa, #29b6f6);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(41, 182, 246, 0.4);
}
.btn:active { transform: scale(0.96); }

.btn.ghost {
  background: transparent;
  color: #81d4fa;
  border: 1px solid rgba(129, 212, 250, 0.5);
  box-shadow: none;
}

.over-line { font-size: 18px; color: #cfe8ff; }
.hint { font-size: 11px; color: #5c7a99; letter-spacing: 1px; }
