:root {
  --bg: #0c0c12;
  --panel: #15151e;
  --line: #2a2a38;
  --control: #20202b;
  --hover: #2b2b3a;
  --text: #e9e9f2;
  --dim: #9a9ab0;
  --accent: #7d95ff;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0 4px 0 0;
  font-size: 17px;
  font-weight: 700;
  background: linear-gradient(90deg, #ff5a5a, #ffb347, #f2e85a, #5be37d, #5ab8ff, #b77bff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

label, .group {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--dim);
}

select, button {
  font: inherit;
  color: var(--text);
  background: var(--control);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 10px;
}

select { max-width: 220px; }
button { cursor: pointer; }
button:hover, select:hover { background: var(--hover); }

button.primary {
  min-width: 82px;
  background: var(--accent);
  border-color: var(--accent);
  color: #0b0b16;
  font-weight: 600;
}
button.primary:hover { background: #95a8ff; }

.seg { display: flex; }
.seg button { border-radius: 0; margin-left: -1px; }
.seg button:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.seg button:last-child { border-radius: 0 6px 6px 0; }
.seg button[aria-pressed="true"] { background: #3a3a52; border-color: #4a4a66; position: relative; }

input[type="range"] {
  width: 120px;
  accent-color: var(--accent);
}
#volume { width: 80px; }

output {
  min-width: 2.6em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

input[type="number"] {
  width: 5.2em;
  font: inherit;
  color: var(--text);
  background: var(--control);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 4px 4px 8px;
  font-variant-numeric: tabular-nums;
}
#speedNum { width: 6.6em; }
.unit { margin-left: -4px; }

#info {
  display: flex;
  gap: 12px 32px;
  align-items: flex-start;
  min-height: 84px;
  padding: 12px 24px 4px;
  font-variant-numeric: tabular-nums;
}

#now {
  flex: 0 0 290px;
}

#hudName { font-size: 21px; font-weight: 700; line-height: 1.25; }
#hudStats, #hudNote { color: #d6d6e4; min-height: 1.4em; }

#about {
  flex: 1 1 auto;
  max-width: 820px;
  padding-top: 2px;
}
#about p { margin: 0 0 4px; }
#aboutText { color: var(--dim); }
#tipText { color: var(--text); }
#tryBtn { padding: 3px 10px; }

#stage {
  position: relative;
  flex: 1;
  min-height: 0;
}

#canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#ver {
  margin-left: auto;
  color: #5d5d72;
  font-size: 12px;
}

/* The Visualizer and Learn tabs, on both pages. */
.tabs { display: flex; }
.tabs a {
  color: var(--dim);
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid var(--line);
  background: var(--control);
  margin-left: -1px;
}
.tabs a:first-child { border-radius: 6px 0 0 6px; margin-left: 0; }
.tabs a:last-child { border-radius: 0 6px 6px 0; }
.tabs a:hover { background: var(--hover); color: var(--text); }
.tabs a[aria-current="page"] { background: #3a3a52; border-color: #4a4a66; color: var(--text); position: relative; }

/* A link that looks like a button. */
a.button {
  display: inline-block;
  color: var(--text);
  background: var(--control);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 10px;
  text-decoration: none;
  white-space: nowrap;
}
a.button:hover { background: var(--hover); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
