* { 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: #1a1d27;
  image-rendering: pixelated;
}
#ui {
  position: absolute;
  top: 0; left: 0; right: 0;
  pointer-events: none;
  padding: 8px 12px;
  z-index: 10;
}
#hud {
  display: flex;
  gap: 16px;
  align-items: center;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  background: rgba(26,29,39,0.9);
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid #305CDE33;
}
#hiArea { color: #305CDE; margin-left: auto; }
#powerupHud {
  margin-top: 5px;
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
  background: rgba(255,200,0,0.15);
  border: 1px solid rgba(255,200,0,0.4);
  color: #ffcc00;
}
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15,17,23,0.94);
  color: #fff;
  z-index: 20;
  gap: 14px;
}
.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: 15px; color: #aaa; text-align: center; }
.screen .sub { font-size: 13px; color: #555; }
button {
  margin-top: 8px;
  padding: 13px 38px;
  font-size: 19px;
  font-weight: 700;
  background: #305CDE;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-family: system-ui, sans-serif;
  transition: background 0.2s;
}
button:hover { background: #4a7aff; }
button:active { transform: scale(0.97); }
.hiscore { color: #305CDE; font-size: 14px; }
#goScore, #goWave { font-size: 20px; color: #aaa; }
#mobileControls {
  position: absolute;
  bottom: 14px;
  left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 20px;
  z-index: 15;
  pointer-events: none;
}
#joystickZone {
  width: 110px;
  height: 110px;
  pointer-events: all;
  position: relative;
}
#joystickBase {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(48,92,222,0.15);
  border: 2px solid rgba(48,92,222,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}
#joystickKnob {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(48,92,222,0.6);
  border: 2px solid #305CDE;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  pointer-events: none;
}
#fireZone {
  pointer-events: all;
}
#fireBtn {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(222,48,48,0.35);
  border: 2px solid rgba(220,48,48,0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #ff6666;
  cursor: pointer;
  user-select: none;
  line-height: 1.2;
}
#fireBtn span, #fireBtn { font-size: 12px; font-weight: 700; }
#fireBtn:active { background: rgba(222,48,48,0.65); }
#waveScreen { background: rgba(15,17,23,0.7); pointer-events: none; }
@media (pointer: fine) {
  #mobileControls { display: none; }
}
