* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #060610; font-family: 'Segoe UI', Arial, sans-serif; color: #e0ddd4; }

canvas { display: block; width: 100%; height: 100%; position: fixed; top: 0; left: 0; z-index: 0; }

#backBtn {
  position: fixed; top: 14px; left: 14px; z-index: 100;
  color: #aaa; text-decoration: none; font-size: 14px; font-weight: 600;
  background: rgba(0,0,0,0.5); padding: 6px 14px; border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}
#backBtn:hover { background: rgba(255,255,255,0.1); color: #fff; }

/* HUD */
#hud {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center; gap: 28px;
  padding: 14px 20px; pointer-events: none;
}
#score {
  font-size: 32px; font-weight: 900; letter-spacing: 2px; color: #fff;
  text-shadow: 0 0 20px rgba(255,255,255,0.3);
}
#combo {
  font-size: 18px; font-weight: 700; color: #f5a623;
  min-width: 80px; text-align: center;
  transition: transform 0.1s;
}
#combo.pop { transform: scale(1.3); }
#lives { display: flex; gap: 4px; }
.heart { font-size: 22px; color: #ff4466; transition: all 0.3s; }
.heart.lost { color: #222; transform: scale(0.7); }
#wave {
  font-size: 13px; font-weight: 600; color: #88aaff;
  letter-spacing: 2px; text-transform: uppercase;
}
#dashBar {
  width: 60px; height: 6px; background: rgba(255,255,255,0.08);
  border-radius: 3px; overflow: hidden;
}
#dashFill {
  height: 100%; width: 100%; background: #88ccff;
  border-radius: 3px; transition: width 0.05s;
}

/* Start Screen */
#startScreen {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(6,6,16,0.92);
}
#startScreen h1 {
  font-size: 96px; font-weight: 900; letter-spacing: 12px;
  color: #ff4466;
  text-shadow: 0 0 40px rgba(255,68,102,0.5), 0 0 80px rgba(255,68,102,0.2);
}
#startScreen .sub {
  font-size: 20px; letter-spacing: 8px; color: #aaa; margin-top: 8px;
}
#startScreen .controls {
  font-size: 14px; color: #666; margin-top: 24px;
}
#startScreen .hint {
  font-size: 16px; color: #555; margin-top: 20px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

/* End Overlay */
#endOverlay {
  position: fixed; inset: 0; z-index: 70;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: rgba(6,6,16,0.94);
}
#endOverlay h1 { font-size: 64px; font-weight: 900; letter-spacing: 6px; color: #ff4466; }
#endScore { font-size: 28px; font-weight: 700; color: #e8c44a; margin: 12px 0 4px; }
#endStats { font-size: 15px; color: #888; margin-bottom: 24px; }
#restartBtn {
  background: #ff4466; color: #fff; border: none; padding: 14px 36px;
  border-radius: 8px; font-weight: 700; font-size: 16px; cursor: pointer;
  letter-spacing: 1px; transition: background 0.2s, transform 0.15s;
}
#restartBtn:hover { background: #ff6688; transform: scale(1.05); }

.hidden { display: none !important; }
