:root {
  color-scheme: dark;
  --bg: #12141a;
  --panel: #1b2030;
  --text: #f6f3ea;
  --muted: #d2cdc2;
  --line: #9aa3b5;
  --accent: #9ad7ff;
  --play: #8ee0b5;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.45;
}

main {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
}

h1, h2, p { margin: 0; }

h1 { font-size: 2rem; letter-spacing: -0.03em; }

h2 {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.kicker {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lede, .hint, #blurb, #meta, #section, #mix, #status {
  color: var(--muted);
}

.lede { max-width: 62ch; margin-top: 10px; }

header { margin-bottom: 22px; }

#songs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

button {
  font: inherit;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 44px;
  padding: 8px 14px;
  cursor: pointer;
}

button[aria-pressed="true"] {
  background: #24344a;
  border-color: var(--accent);
  font-weight: 700;
}

#play[aria-pressed="true"] {
  background: #1c3b32;
  border-color: var(--play);
}

:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.transport {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 16px 0;
}

#play { min-width: 96px; }

#new-song {
  border-color: var(--accent);
  color: var(--accent);
}

#seed {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 44px;
  padding: 8px 12px;
  width: 9ch;
}

#seed::placeholder { color: var(--line); }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  display: grid;
  gap: 8px;
}

.now-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#chords-toggle {
  min-height: 36px;
  padding: 4px 12px;
  font-size: 0.85rem;
  border-color: var(--accent);
  color: var(--accent);
}

#chords-toggle[aria-expanded="true"] {
  background: #24344a;
}

#chords {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.chord-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
  align-items: baseline;
}

.chord-sec {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chord-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chord {
  padding: 2px 8px;
  border-radius: 6px;
  background: #24344a;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: background 80ms linear, color 80ms linear;
}

.chord.now {
  background: var(--accent);
  border-color: var(--accent);
  color: #0c1118;
  font-weight: 700;
}

.chord-empty { color: var(--muted); }

@media (max-width: 640px) {
  .chord-row { grid-template-columns: 1fr; gap: 4px; }
}

#arrange {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.lane {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 8px;
  align-items: center;
}

.lane-label {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.lane-track {
  position: relative;
  display: flex;
  min-height: 22px;
  gap: 2px;
  background: #12141a;
  border-radius: 6px;
  overflow: hidden;
}

.lane-track::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--play, 0%);
  width: 2px;
  background: #fff;
  pointer-events: none;
}

.part {
  min-height: 44px;
  border-radius: 6px;
  padding: 4px 8px;
  flex: 1 1 0;
}

.part[aria-current="true"] {
  border-color: var(--accent);
  font-weight: 700;
}

.solo {
  width: 100%;
  min-height: 44px;
  padding: 6px 8px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.15;
}

.solo-name { font-weight: 700; }

.solo-state {
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.solo[aria-pressed="true"] .solo-state { color: var(--play); }

.cell {
  flex: 1 1 0;
  height: 18px;
  background: #12141a;
  box-shadow: inset 0 0 0 1px #3a4256;
}

.cell.hot { background: #6aa4c8; }

.cell.now { box-shadow: inset 0 0 0 2px #fff; }

.lane.dim { opacity: 0.45; }

#steps {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  gap: 4px;
  margin-top: 8px;
}

.step {
  height: 14px;
  border-radius: 3px;
  background: #12141a;
  border: 1px solid var(--line);
}

.step.on {
  background: var(--accent);
  border-color: var(--accent);
}

#scope {
  width: 100%;
  height: 140px;
  margin-top: 8px;
  border-radius: 8px;
  background: #12141a;
}

.hint { margin-top: 14px; font-size: 0.9rem; }

@media (max-width: 640px) {
  #songs button { flex: 1 1 100%; }
  .transport { align-items: flex-start; flex-direction: column; }
  .lane { grid-template-columns: 96px 1fr; }
  .part { font-size: 0.8rem; padding: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
}
