:root {
  --soil-deep: #0a0d0c;
  --soil: #141a16;
  --ink: #e6f0e6;
  --ink-dim: #9fb3a3;
  --accent: #8bffbe;
  --accent-dim: #4f7d63;
  --panel: #10171380;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  background: radial-gradient(120% 90% at 50% 0%, #16211b 0%, var(--soil) 60%, var(--soil-deep) 100%);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.35;
  -webkit-text-size-adjust: 100%;
}

.hud {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px max(12px, env(safe-area-inset-left)) calc(12px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-right));
}

.bar {
  width: 100%;
  max-width: 520px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.level, .goal, .hint, .note {
  margin: 0;
  font-size: 16px;
}

.level { color: var(--accent); letter-spacing: 0.02em; }
.goal { color: var(--ink-dim); text-align: right; }

.hint, .note {
  width: 100%;
  max-width: 520px;
  color: var(--ink-dim);
  text-align: center;
  min-height: 22px;
}

.note { color: var(--accent-dim); }

.stage {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
}

canvas {
  display: block;
  border-radius: 14px;
  background: #0c110e;
  box-shadow: 0 0 0 1px #1e2b22 inset, 0 12px 40px #0007;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.bar:last-of-type { justify-content: center; flex-wrap: wrap; }

#sound {
  border-color: var(--accent);
  color: var(--accent);
  background: #16241c;
}

#sound[aria-pressed="false"] {
  border-color: var(--accent-dim);
  color: var(--ink-dim);
  background: var(--panel);
}

button {
  min-width: 88px;
  min-height: 44px;
  padding: 10px 18px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--accent-dim);
  border-radius: 12px;
  cursor: pointer;
}

button:hover { border-color: var(--accent); }
button:active { transform: translateY(1px); }
button[disabled] { opacity: 0.4; cursor: default; }
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  button:active { transform: none; }
  button { transition: none; }
}
