:root {
  --bg-canvas: #05070b;
  --pill-bg: rgba(10, 14, 22, 0.72);
  --pill-border: rgba(255, 255, 255, 0.14);
  --pill-text: #e2e8f0;
  --accent: #22c55e;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-canvas);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
}

.stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  touch-action: none;
}

#ascii-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
}

/* Minimal floating audio pill (required because browsers need one click to start sound) */
.audio-pill {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--pill-border);
  background: var(--pill-bg);
  backdrop-filter: blur(8px);
  color: var(--pill-text);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  user-select: none;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.audio-pill:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(16, 22, 34, 0.88);
}

.audio-pill:active {
  transform: scale(0.97);
}

.audio-pill:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.audio-pill.playing {
  border-color: rgba(34, 197, 94, 0.55);
}

.eq-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 14px;
}

.eq-bars span {
  width: 3px;
  height: 5px;
  border-radius: 2px;
  background: var(--accent);
  transition: height 150ms ease;
}

.audio-pill.playing .eq-bars span:nth-child(1) {
  animation: eqPulse 0.65s ease-in-out infinite alternate;
}

.audio-pill.playing .eq-bars span:nth-child(2) {
  animation: eqPulse 0.5s ease-in-out 0.15s infinite alternate;
}

.audio-pill.playing .eq-bars span:nth-child(3) {
  animation: eqPulse 0.72s ease-in-out 0.28s infinite alternate;
}

@keyframes eqPulse {
  from {
    height: 4px;
  }
  to {
    height: 14px;
  }
}
