:root {
  font-family: 'Poppins', 'Segoe UI', Tahoma, sans-serif;
  color: #f8f9fb;
  --pink: #ff3366;
  --cyan: #00e6ff;
  --yellow: #ffcc00;
  --mint: #66ff99;
  --bg-dark: #050510;
}

* {
  box-sizing: border-box;
  user-select: none;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 20%, rgba(255, 51, 102, 0.45), transparent 45%),
    radial-gradient(circle at 80% 30%, rgba(0, 230, 255, 0.35), transparent 40%),
    #050510;
  overflow: hidden;
}

.background-glow {
  position: fixed;
  inset: 0;
  background: linear-gradient(125deg, rgba(255, 51, 102, 0.3), rgba(0, 230, 255, 0.2), rgba(255, 204, 0, 0.25));
  filter: blur(90px) brightness(1.2);
  opacity: 0.35;
  animation: pulse 8s ease-in-out infinite;
  z-index: 0;
}

@keyframes pulse {
  0% {
    opacity: 0.2;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(1.05);
  }
  100% {
    opacity: 0.25;
    transform: scale(1);
  }
}

canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: transparent;
}

.hud {
  position: fixed;
  top: 2vh;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: rgba(5, 5, 16, 0.5);
  backdrop-filter: blur(12px);
  border-radius: 999px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat {
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stat .label {
  display: block;
  color: rgba(248, 249, 251, 0.7);
  font-size: 0.7rem;
}

.stat .value {
  font-weight: 700;
  font-size: 1rem;
  min-width: 3rem;
  display: inline-block;
}

.lives-dots {
  display: flex;
  gap: 0.3rem;
}

.lives-dots span {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 12px rgba(255, 204, 0, 0.8);
}

.combo-flash {
  position: fixed;
  top: 12vh;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--cyan), var(--pink));
  color: #050510;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 0 12px rgba(0, 230, 255, 0.7));
  transition: opacity 0.2s, transform 0.2s;
}

.overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle, rgba(5, 5, 16, 0.85), rgba(5, 5, 16, 0.95));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  transition: opacity 0.3s ease;
}

.overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.panel {
  width: min(420px, 90vw);
  padding: 2.5rem;
  background: rgba(9, 9, 30, 0.85);
  border-radius: 24px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.panel h1,
.panel h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel p {
  color: rgba(248, 249, 251, 0.8);
  line-height: 1.5;
  margin: 1rem 0 2rem;
}

.primary {
  border: none;
  border-radius: 999px;
  padding: 0.9rem 2.5rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #050510;
  background: linear-gradient(110deg, var(--yellow), var(--pink));
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(255, 51, 102, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 30px rgba(0, 230, 255, 0.4);
}

.primary:active {
  transform: translateY(1px) scale(0.98);
}

.results {
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.result-row {
  display: flex;
  justify-content: space-between;
  font-size: 1rem;
  color: rgba(248, 249, 251, 0.8);
  padding: 0.4rem 0.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.result-row strong {
  color: #fff;
}

@media (max-width: 720px) {
  .hud {
    top: auto;
    bottom: 3vh;
    flex-wrap: wrap;
    border-radius: 18px;
  }

  .stat {
    flex: 1 1 40%;
  }

  canvas {
    height: 100vh;
  }
}
