:root {
  --cyan: #00e5ff;
  --pink: #ff2fd0;
  --violet: #a78bfa;
  --bg: #05060d;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #e8ecff;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(0, 229, 255, 0.12), transparent 60%),
    radial-gradient(1000px 700px at 92% 112%, rgba(255, 47, 208, 0.12), transparent 60%),
    var(--bg);
}

/* ---------- floating background orbs ---------- */
.orbs { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
  animation: drift 18s ease-in-out infinite alternate;
}

.o1 { width: 420px; height: 420px; left: -120px; top: -140px; background: rgba(0, 229, 255, 0.35); }
.o2 { width: 480px; height: 480px; right: -160px; bottom: -180px; background: rgba(255, 47, 208, 0.30); animation-delay: -6s; }
.o3 { width: 320px; height: 320px; left: 45%; top: 55%; background: rgba(124, 92, 255, 0.28); animation-delay: -11s; }

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(40px, -50px, 0) scale(1.15); }
}

/* ---------- layout ---------- */
.shell {
  position: relative;
  z-index: 1;
  width: min(100%, 1000px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ---------- hud ---------- */
.hud {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hud-item { display: flex; flex-direction: column; gap: 2px; min-width: 72px; }

.label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: #7f8bb5;
}

.value {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

#score { color: #fff; text-shadow: 0 0 18px rgba(0, 229, 255, 0.7); }
#lives { color: #ff5c8a; letter-spacing: 2px; text-shadow: 0 0 14px rgba(255, 92, 138, 0.8); }
#combo { color: var(--pink); text-shadow: 0 0 16px rgba(255, 47, 208, 0.8); transition: transform 0.09s ease; }
.combo { opacity: 0.35; transition: opacity 0.2s ease; }
.combo.on { opacity: 1; }

/* ---------- stage ---------- */
.stage {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #04050c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 0 0 1px rgba(0, 229, 255, 0.08),
    0 30px 80px -20px rgba(0, 229, 255, 0.35),
    0 0 120px -40px rgba(255, 47, 208, 0.5);
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  cursor: crosshair;
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  mix-blend-mode: overlay;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.05) 0 1px,
    transparent 1px 3px
  );
}

/* ---------- overlay ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  background: radial-gradient(circle at 50% 45%, rgba(6, 8, 20, 0.72), rgba(3, 4, 10, 0.95));
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.overlay.show { opacity: 1; pointer-events: auto; }

.panel {
  text-align: center;
  padding: 28px 34px;
  animation: pop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

@keyframes pop {
  from { transform: scale(0.9) translateY(12px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(2.2rem, 6.5vw, 4rem);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: 0.1em;
  background: linear-gradient(180deg, #ffffff, #8ef4ff 45%, #ff5ce0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 26px rgba(0, 229, 255, 0.55));
}

p {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.5;
  color: #a9b4d8;
}

p b { color: #fff; }

button {
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.18em;
  padding: 14px 34px;
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 255, 0.5);
  color: #04121a;
  cursor: pointer;
  background: linear-gradient(180deg, #9df6ff, #00e5ff 60%, #00b3d6);
  box-shadow: 0 0 30px rgba(0, 229, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}

button:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 46px rgba(0, 229, 255, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

button:active { transform: scale(0.97); }

.hint {
  margin: 16px 0 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #5d6890;
}

.foot {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #3f4869;
}

@media (max-width: 640px) {
  .hud-item { min-width: 0; }
  .value { font-size: 16px; }
  .label { font-size: 9px; letter-spacing: 0.16em; }
  .panel { padding: 18px; }
}
