:root {
  --bg-1: #090b1a;
  --bg-2: #0f1230;
  --neon-a: #31d7ff;
  --neon-b: #ff4dd2;
  --neon-c: #7dff5c;
  --panel: rgba(11, 14, 34, 0.66);
  --border: rgba(118, 141, 255, 0.35);
  --text: #ecf1ff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--text);
  background: radial-gradient(circle at 12% 20%, #1a2054 0%, transparent 38%),
    radial-gradient(circle at 85% 10%, #381c58 0%, transparent 40%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2));
}

body {
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
}

.bg-glow {
  position: fixed;
  inset: -20%;
  background: conic-gradient(from 120deg, rgba(49, 215, 255, 0.1), rgba(255, 77, 210, 0.09), rgba(125, 255, 92, 0.08), rgba(49, 215, 255, 0.1));
  filter: blur(60px);
  animation: spin 14s linear infinite;
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  width: min(980px, 100%);
  z-index: 2;
}

.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(10px);
}

.brand {
  font-family: Orbitron, sans-serif;
  letter-spacing: 0.12em;
  font-size: clamp(16px, 2.8vw, 24px);
  text-shadow: 0 0 12px rgba(49, 215, 255, 0.6);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(132, 154, 255, 0.3);
  background: rgba(14, 19, 42, 0.74);
}

.chip span {
  color: #9ff2ff;
  font-weight: 700;
}

.stage-wrap {
  position: relative;
  border-radius: 18px;
  border: 1px solid rgba(140, 162, 255, 0.4);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(4, 8, 29, 0.6), inset 0 0 45px rgba(49, 215, 255, 0.08);
}

canvas {
  width: 100%;
  height: auto;
  display: block;
  touch-action: none;
  background: linear-gradient(180deg, rgba(8, 11, 25, 0.6), rgba(7, 10, 21, 0.9));
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 10px;
  padding: 20px;
  background: linear-gradient(145deg, rgba(8, 10, 28, 0.84), rgba(16, 9, 29, 0.82));
  transition: opacity 0.25s ease;
}

.overlay:not(.show) {
  opacity: 0;
  pointer-events: none;
}

.overlay h1 {
  font-family: Orbitron, sans-serif;
  margin: 0;
  font-size: clamp(26px, 5vw, 42px);
  text-shadow: 0 0 20px rgba(255, 77, 210, 0.5);
}

.overlay p {
  margin: 0;
  opacity: 0.9;
}

.controls {
  font-size: 13px;
  opacity: 0.8;
}

button {
  justify-self: center;
  font: 700 14px/1 'Space Grotesk', sans-serif;
  letter-spacing: 0.05em;
  color: #05111b;
  background: linear-gradient(90deg, #60e7ff, #4db8ff);
  border: 0;
  border-radius: 10px;
  padding: 12px 18px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(97, 230, 255, 0.35);
}

button:hover {
  transform: translateY(-1px);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 700px) {
  .hud {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats {
    width: 100%;
  }

  .chip {
    flex: 1;
    text-align: center;
  }
}
