* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  background: #0F1117;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  overflow: hidden;
  font-family: system-ui, sans-serif;
  touch-action: none;
}
#gameContainer {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
#gameCanvas {
  display: block;
  background: #0F1117;
  image-rendering: pixelated;
}
#ui {
  position: absolute;
  top: 0; left: 0; right: 0;
  pointer-events: none;
  padding: 10px;
  z-index: 10;
}
#hud {
  display: flex;
  gap: 20px;
  align-items: center;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  background: rgba(26,29,39,0.85);
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #305CDE44;
}
#weaponHud {
  margin-top: 6px;
  color: #305CDE;
  font-size: 13px;
  font-weight: 600;
  background: rgba(26,29,39,0.85);
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid #305CDE44;
  display: inline-block;
}
#shieldHud {
  margin-top: 4px;
  color: #00cfff;
  font-size: 13px;
  font-weight: 700;
  background: rgba(0,180,255,0.15);
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid #00cfff44;
  display: inline-block;
}
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15,17,23,0.93);
  color: #fff;
  z-index: 20;
  gap: 16px;
}
.screen h1 {
  font-size: clamp(32px, 8vw, 64px);
  font-weight: 900;
  color: #305CDE;
  text-align: center;
  text-shadow: 0 0 30px #305CDE88;
  line-height: 1.1;
}
.screen p { font-size: 16px; color: #aaa; text-align: center; }
.controls { color: #666; font-size: 14px; }
button {
  margin-top: 8px;
  padding: 14px 40px;
  font-size: 20px;
  font-weight: 700;
  background: #305CDE;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  font-family: system-ui, sans-serif;
}
button:hover { background: #4a7aff; }
button:active { transform: scale(0.97); }
.hiscore { color: #305CDE; font-size: 15px; font-weight: 600; }
#finalScore, #finalWave { font-size: 22px; color: #aaa; }
#mobileControls {
  position: absolute;
  bottom: 20px;
  left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 15;
  pointer-events: none;
}
.mBtn {
  width: 70px; height: 70px;
  background: rgba(48,92,222,0.35);
  border: 2px solid #305CDE88;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #fff;
  cursor: pointer;
  pointer-events: all;
  user-select: none;
  -webkit-user-select: none;
}
.mBtn:active { background: rgba(48,92,222,0.6); }
@media (pointer: fine) {
  #mobileControls { display: none; }
}
