:root {
  --bg: #fafafa;
  --fg: #1d1d1f;
  --muted: #6b6b70;
  --border: #d0d0d5;
  --button: #ffffff;
  --button-active: #dce6fa;
  --accent: #2860c8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18181b;
    --fg: #ececf0;
    --muted: #9c9ca3;
    --border: #3a3a40;
    --button: #26262b;
    --button-active: #263a63;
    --accent: #7aa2f0;
  }
}

body {
  margin: 0;
  padding: 0 16px 32px;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

header,
main {
  max-width: 960px;
  margin: 0 auto;
}

h1 {
  margin-bottom: 0.25rem;
}

.subtitle,
.hint,
#status,
#stats,
.version {
  color: var(--muted);
}

#status {
  margin-bottom: 0.25rem;
}

#stats {
  margin-top: 0;
  min-height: 1.2em;
}

.version {
  font-size: 0.85em;
}

a {
  color: inherit;
}

#canvas canvas {
  display: block;
  /* p5 sets a fixed pixel size inline; let the canvas scale with the page
     and keep its aspect ratio. Pointer positions are mapped back in
     editor.js. */
  width: 100% !important;
  max-width: 960px;
  height: auto !important;
  border: 1px solid var(--border);
  border-radius: 6px;
  /* Drags on the canvas edit the scene instead of scrolling the page. */
  touch-action: none;
}

button {
  font: inherit;
  color: inherit;
  background: var(--button);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
}

button[aria-pressed="true"] {
  background: var(--button-active);
  border-color: var(--accent);
}

.toolbar,
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}

.controls {
  gap: 8px 16px;
}

#draft-actions:not([hidden]) {
  display: contents;
}

.controls label:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.controls select,
.controls input {
  font: inherit;
  min-width: 0;
  max-width: 100%;
}

.controls input[type="number"] {
  width: 6em;
}

.about {
  margin-top: 24px;
  color: var(--muted);
}

.about summary {
  cursor: pointer;
  color: var(--fg);
}
