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

body {
  background: #0a0a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  height: 100dvh;
  font-family: 'Courier New', monospace;
  color: #fff;
  overflow: hidden;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
}

/* HUD */
.hud {
  position: fixed;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: bold;
  z-index: 10;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0,0,0,0.5) 0%, transparent 100%);
  letter-spacing: 1px;
}
.hud span { color: #ffcc00; }
.hud-center {
  background: rgba(255,255,255,0.08);
  padding: 4px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
}
.hud-right { color: #ff6666; letter-spacing: 3px; font-size: 16px; }

/* Overlays */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 30, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 20;
  text-align: center;
  padding: 24px;
}

.overlay h2 {
  font-size: 42px;
  letter-spacing: 6px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #fff 0%, #8b8bff 50%, #63c8ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

.subtitle {
  font-size: 12px;
  color: #666;
  letter-spacing: 3px;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.start-controls {
  margin: 16px 0 24px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 14px 20px;
}
.start-controls p {
  font-size: 13px;
  color: #777;
  margin: 4px 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', sans-serif;
}

.btn {
  margin-top: 12px;
  padding: 16px 56px;
  font-size: 18px;
  font-weight: bold;
  font-family: 'Courier New', monospace;
  letter-spacing: 4px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  background: linear-gradient(135deg, #4a6cf7, #6366f1);
  color: #fff;
  transition: transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 30px rgba(74, 108, 247, 0.5);
}
.btn:hover { box-shadow: 0 6px 40px rgba(74, 108, 247, 0.7); }
.btn:active { transform: scale(0.96); }

.final-score {
  font-size: 64px;
  font-weight: 900;
  color: #ffcc00;
  margin: 8px 0;
  text-shadow: 0 0 30px rgba(255, 204, 0, 0.5);
  letter-spacing: 4px;
}
.final-wave {
  font-size: 15px;
  color: #8b8bff;
  margin-bottom: 24px;
  letter-spacing: 3px;
}

.wave-bonus {
  font-size: 44px;
  font-weight: 900;
  color: #06C755;
  margin: 4px 0 16px;
  text-shadow: 0 0 24px rgba(6, 199, 85, 0.5);
  letter-spacing: 2px;
}

.gameover-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.line-btn {
  margin-top: 4px;
  padding: 11px 28px;
  font-size: 13px;
  font-weight: bold;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  background: #06C755;
  color: #fff;
  text-decoration: none;
  display: inline-block;
  font-family: -apple-system, BlinkMacSystemFont, 'Hiragino Sans', sans-serif;
  box-shadow: 0 4px 20px rgba(6, 199, 85, 0.3);
}

/* Wave clear decorations */
.wave-clear-sub {
  font-size: 12px;
  color: #888;
  margin-bottom: 8px;
}

.hidden { display: none; }

.shake { animation: shake 0.25s ease-out; }
@keyframes shake {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-3px, 2px); }
  40% { transform: translate(3px, -2px); }
  60% { transform: translate(-2px, 3px); }
  80% { transform: translate(2px, -3px); }
}
