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

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

html, body {
  height: 100dvh;
  overflow: hidden;
  background: #0a0a12;
}

body {
  font-family: 'Orbitron', 'Segoe UI', monospace;
  background: radial-gradient(ellipse at center, #0d0d1a 0%, #050510 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
}

#app {
  height: 100dvh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 1vh, 10px);
  padding: clamp(4px, 1vh, 10px);
}

/* ===== HUD ===== */
#hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 580px;
  padding: clamp(4px, 1vh, 8px) clamp(8px, 2vw, 16px);
  background: rgba(0, 255, 255, 0.04);
  border: 1px solid rgba(0, 255, 255, 0.15);
  border-radius: 4px;
  flex-shrink: 0;
}

#score-label {
  font-size: clamp(0.5rem, 1.4vh, 0.7rem);
  color: #0ff;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
  letter-spacing: 3px;
}

#score {
  font-size: clamp(0.9rem, 2.2vh, 1.3rem);
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 15px rgba(0, 255, 255, 0.6);
}

#title {
  font-size: clamp(0.7rem, 2vh, 1.1rem);
  font-weight: 900;
  background: linear-gradient(90deg, #ff00ff, #00ffff, #ff00ff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: hueShift 3s linear infinite;
  letter-spacing: 4px;
}

@keyframes hueShift {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

#lives-label {
  font-size: clamp(0.5rem, 1.4vh, 0.7rem);
  color: #f0f;
  text-shadow: 0 0 10px rgba(255, 0, 255, 0.5);
  letter-spacing: 3px;
}

#lives {
  font-size: clamp(0.9rem, 2.2vh, 1.3rem);
  letter-spacing: 4px;
  color: #ff0;
  text-shadow: 0 0 10px rgba(255, 255, 0, 0.5);
}

/* ===== Canvas ===== */
#game-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 0;
  width: 100%;
}

#gameCanvas {
  display: block;
  border: 2px solid rgba(0, 255, 255, 0.25);
  border-radius: 4px;
  box-shadow:
    0 0 20px rgba(0, 255, 255, 0.1),
    0 0 60px rgba(255, 0, 255, 0.05),
    inset 0 0 30px rgba(0, 0, 0, 0.5);
  image-rendering: pixelated;
}

/* ===== Overlay ===== */
#overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 5, 16, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  z-index: 10;
  backdrop-filter: blur(6px);
}

#overlay.hidden { display: none; }

#overlay-content {
  text-align: center;
  padding: clamp(20px, 5vh, 40px);
}

#msg-title {
  font-size: clamp(1.5rem, 5vh, 3rem);
  font-weight: 900;
  letter-spacing: 6px;
  margin-bottom: clamp(4px, 1vh, 8px);
  text-shadow: 0 0 30px rgba(255, 0, 255, 0.6), 0 0 60px rgba(0, 255, 255, 0.3);
  animation: glitch 2s ease-in-out infinite;
}

@keyframes glitch {
  0%, 90%, 100% { transform: translate(0); }
  92% { transform: translate(-2px, 1px); }
  94% { transform: translate(2px, -1px); }
  96% { transform: translate(-1px, -2px); }
  98% { transform: translate(1px, 2px); }
}

#msg-title.win {
  text-shadow: 0 0 30px rgba(0, 255, 255, 0.8), 0 0 60px rgba(255, 255, 0, 0.4);
}

#msg-sub {
  font-size: clamp(0.7rem, 2vh, 1rem);
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: clamp(12px, 3vh, 24px);
  letter-spacing: 2px;
}

#final-score {
  color: #0ff;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

#start-btn {
  padding: clamp(8px, 1.5vh, 14px) clamp(20px, 4vw, 40px);
  font-family: 'Orbitron', monospace;
  font-size: clamp(0.7rem, 2vh, 1rem);
  font-weight: 700;
  letter-spacing: 3px;
  border: 2px solid #0ff;
  border-radius: 4px;
  cursor: pointer;
  background: rgba(0, 255, 255, 0.08);
  color: #0ff;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
  transition: all 0.2s;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.2), inset 0 0 15px rgba(0, 255, 255, 0.05);
}

#start-btn:hover {
  background: rgba(0, 255, 255, 0.2);
  box-shadow: 0 0 30px rgba(0, 255, 255, 0.4), inset 0 0 20px rgba(0, 255, 255, 0.1);
  transform: scale(1.05);
}

#controls-hint {
  font-size: clamp(0.5rem, 1.2vh, 0.7rem);
  color: rgba(255, 255, 255, 0.2);
  letter-spacing: 3px;
  flex-shrink: 0;
  padding-bottom: 2px;
}

#controls-hint span {
  color: rgba(0, 255, 255, 0.4);
}
