:root {
  --bg: #07060f;
  --p1: #13102a;
  --p2: #1b1738;
  --line: #2c2654;
  --ink: #eeeaff;
  --mut: #9b94c9;
  --neon: #b14bff;
  --cy: #22e6ff;
  --pk: #ff3d9a;
  --lime: #a3ff3d;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}

body {
  display: grid;
  place-items: center;
  background-image:
    radial-gradient(circle at 15% -10%, #2a1360 0, transparent 40%),
    radial-gradient(circle at 100% 20%, #06324a 0, transparent 35%);
  background-attachment: fixed;
}

#wrap {
  position: relative;
  display: inline-block;
  line-height: 0;
  max-width: 100vw;
  max-height: 100vh;
}

#game {
  display: block;
  width: auto;
  height: auto;
  max-width: 100vw;
  max-height: 100vh;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #07060f;
  outline: none;
  touch-action: none;
  cursor: pointer;
}

#hud {
  /* Canvas draws the visible HUD; keep DOM node for assistive live updates */
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  padding: 0;
  margin: -1px;
}

#hud.show { /* still clipped */ }

#hud .label {
  display: block;
  font-size: clamp(8px, 1.4vw, 10px);
  color: var(--mut);
  letter-spacing: 2px;
  font-weight: 700;
}

#hud span:not(.label) {
  font-size: clamp(13px, 2.6vw, 22px);
  color: var(--cy);
  font-variant-numeric: tabular-nums;
}

#hud .hud-left span:not(.label) { color: var(--lime); }
#hud .hud-right span:not(.label) { color: #ffd24a; }

#btn-mute, #btn-pause {
  position: absolute;
  top: 2.2%;
  z-index: 3;
  width: clamp(34px, 6vw, 42px);
  height: clamp(34px, 6vw, 42px);
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(19, 16, 42, 0.85);
  color: #fff;
  font-size: clamp(14px, 2.4vw, 18px);
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 0 18px rgba(177, 75, 255, 0.18);
  line-height: 1;
}

#btn-mute:hover, #btn-pause:hover,
#btn-mute:focus-visible, #btn-pause:focus-visible {
  border-color: var(--neon);
  outline: none;
}

#btn-mute { right: 1.6%; }
#btn-pause { right: calc(1.6% + clamp(38px, 7vw, 50px)); }

#btn-mute[aria-pressed="true"] { opacity: 0.7; }
