:root {
  --bg: #000;
  --fg: #fff;
  --cyan: #00f0ff;
  --pink: #ff2bd6;
  --dim: #8a8a8a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: "Chakra Petch", system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  overflow-x: hidden;
}

main {
  width: 100%;
  max-width: 760px;
  text-align: center;
}

h1 {
  margin: 0 0 40px;
  font-size: clamp(2rem, 7vw, 4.2rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-shadow: 0 0 8px rgba(0, 240, 255, .7), 0 0 28px rgba(0, 240, 255, .35);
}

.float { animation: float 4s ease-in-out infinite; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-14px) rotate(1deg); }
}

p { margin: 0 0 24px; color: var(--dim); font-size: 1.1rem; }

button {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: var(--fg);
  background: #000;
  border: 2px solid var(--pink);
  border-radius: 999px;
  padding: 14px 30px;
  font-size: 1.05rem;
  box-shadow: 0 0 10px var(--pink), 0 0 30px rgba(255, 43, 214, .45), inset 0 0 12px rgba(255, 43, 214, .35);
  animation: pulse 1.6s ease-in-out infinite;
  transition: transform .15s ease;
}

button:hover { transform: scale(1.06) rotate(-2deg); }
button:active { transform: scale(.96); }
button:focus-visible { outline: 3px solid var(--fg); outline-offset: 4px; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 8px var(--pink), 0 0 20px rgba(255, 43, 214, .35), inset 0 0 8px rgba(255, 43, 214, .3); }
  50%      { box-shadow: 0 0 16px var(--pink), 0 0 44px rgba(255, 43, 214, .7), inset 0 0 18px rgba(255, 43, 214, .5); }
}

[hidden] { display: none !important; }

.hud {
  display: flex;
  justify-content: space-between;
  width: min(92vw, 400px);
  margin: 0 auto 10px;
  color: var(--dim);
}
.hud b { color: var(--fg); }

canvas {
  display: block;
  margin: 0 auto 18px;
  width: min(92vw, 400px);
  height: auto;
  aspect-ratio: 1;
  background: #000;
  border: 2px solid var(--cyan);
  border-radius: 6px;
  box-shadow: 0 0 14px rgba(0, 240, 255, .6), 0 0 40px rgba(0, 240, 255, .25);
  touch-action: none;
}

#msg { min-height: 1.5em; font-size: 1rem; }
#msg.over { color: var(--fg); }

@media (prefers-reduced-motion: reduce) {
  .float, button { animation: none; }
  button { transition: none; }
}
