:root {
  color-scheme: light dark;
  --ink: #1a1a1a;
  --muted: #5c5c5c;
  --surface: #ffffff;
  --edge: #d4d4d4;
  --accent: #1c86ee;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6e6e6;
    --muted: #9a9a9a;
    --surface: #121212;
    --edge: #333333;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  color: var(--ink);
  background: var(--surface);
}

header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  width: 100%;
  max-width: 600px;
}

h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

header a,
footer a {
  color: var(--accent);
}

main {
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

canvas {
  display: block;
  touch-action: manipulation;
  cursor: pointer;
}

canvas.waiting {
  cursor: progress;
}

#status {
  margin: 0;
  min-height: 1.5em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 0.875rem;
}

select,
button {
  font: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: 6px 12px;
}

button {
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: var(--accent);
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

footer {
  max-width: 600px;
  color: var(--muted);
  font-size: 0.875rem;
}

footer p {
  margin: 0;
}
