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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b0c1f;
  font-family: 'Baloo 2', 'Comic Sans MS', 'Segoe UI', Arial, sans-serif;
  cursor: none;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
}

#hud {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: #4a3b6b;
  user-select: none;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border: 4px solid rgba(255,255,255,0.9);
  border-radius: 28px;
  padding: 10px 30px 16px;
  box-shadow: 0 10px 26px rgba(30, 10, 60, 0.35);
}

#scoreWrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

#score {
  font-size: 48px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #3fb8e0;
  text-shadow: 0 3px 0 rgba(63, 184, 224, 0.25);
  transition: transform 0.12s ease;
}

#score.bump { transform: scale(1.18) rotate(-3deg); }

#comboLabel {
  margin-top: 2px;
  font-size: 15px;
  font-weight: 800;
  color: #ffb100;
  height: 18px;
}

#lives {
  margin-top: 8px;
  font-size: 18px;
  letter-spacing: 4px;
}

#livesHearts span {
  display: inline-block;
}

#livesHearts span.lost {
  animation: heartLost 0.4s ease forwards;
}

@keyframes heartLost {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.2); opacity: 0; }
}

#overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 40, 0.75);
  backdrop-filter: blur(4px);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: auto;
}

#overlay.hidden { display: none; }

#overlay h1 {
  font-size: 46px;
  color: #fff;
  text-shadow: 0 3px 0 rgba(0,0,0,0.25);
}

#finalScore { font-size: 22px; font-weight: 700; }
#finalStats { font-size: 14px; opacity: 0.8; margin-bottom: 10px; }

#restartBtn {
  padding: 13px 32px;
  font-size: 18px;
  font-weight: 800;
  font-family: inherit;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, #4fd6ff, #3fd0ff);
  color: #04121a;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(63, 208, 255, 0.45);
  transition: transform 0.1s ease;
}

#restartBtn:hover { transform: translateY(-2px); }
#restartBtn:active { transform: translateY(0); }
