:root {
  color-scheme: dark;
  --bg: #111318;
  --panel: #1b1f26;
  --line: #333a45;
  --muted: #929dab;
  --ink: #eef1f6;
  --accent: #d6dee8;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    13px Arial,
    Helvetica,
    sans-serif;
}
button,
input {
  font: inherit;
}
button {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 11px 14px;
  color: var(--ink);
  cursor: pointer;
  transition:
    background 0.15s,
    border 0.15s;
}
button:hover {
  border-color: var(--accent);
  background: #ffffff08;
}
button:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.4;
  cursor: default;
}
.primary {
  background: var(--accent);
  color: #17202b;
  border-color: var(--accent);
  font-weight: 700;
}
.primary:hover {
  background: var(--accent);
  filter: brightness(1.08);
}
header {
  height: 78px;
  margin: 0 4%;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  gap: 30px;
}
.brand {
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -1.4px;
  text-decoration: none;
  color: var(--ink);
}
.brand span {
  color: var(--accent);
}
.brand sup {
  font: 9px monospace;
  vertical-align: top;
  margin-left: 8px;
  color: var(--muted);
}
.tagline {
  font: 9px/1.8 monospace;
  letter-spacing: 1px;
  color: var(--muted);
}
.tagline span {
  color: #c7cabb;
}
.audio {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.audio button {
  padding: 7px;
  font: 11px monospace;
}
.audio input {
  width: 78px;
  accent-color: var(--accent);
}
main {
  max-width: 1460px;
  margin: auto;
  padding: 26px 4% 16px;
}
.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 23px;
}
.eyebrow,
.section-label {
  font: 10px monospace;
  letter-spacing: 1.4px;
  color: var(--muted);
}
.eyebrow #status {
  color: var(--accent);
}
h1 {
  font-size: 36px;
  line-height: 1.08;
  letter-spacing: -1.5px;
  margin: 13px 0 0;
  font-weight: 500;
}
.session {
  display: flex;
  align-items: center;
  gap: 34px;
}
.session small,
.stats small {
  display: block;
  font: 9px monospace;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 10px;
}
.session strong {
  font: 18px monospace;
}
.session em {
  font: 10px monospace;
  color: var(--muted);
  margin-left: 7px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 322px;
  gap: 24px;
}
.stage {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #171b22;
}
.stagebar {
  height: 38px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  font: 9px monospace;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--line);
}
.live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
}
.board-wrap {
  position: relative;
  background: #15191f;
}
canvas {
  display: block;
  width: 100%;
  aspect-ratio: 1.6;
  cursor: crosshair;
}
.board-label {
  position: absolute;
  top: 12px;
  left: 14px;
  color: #777f6c;
  font: 9px monospace;
  pointer-events: none;
}
.board-label span {
  color: var(--accent);
}
#toast {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  max-width: 95%;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #131921ed;
  color: #c3cddd;
  padding: 7px 12px;
  border: 1px solid #3b4657;
  border-radius: 20px;
  font-size: 10px;
  pointer-events: none;
}
.transport {
  display: flex;
  align-items: center;
  padding: 12px;
  gap: 8px;
  border-top: 1px solid var(--line);
}
.transport button {
  font-size: 11px;
  padding: 10px 12px;
}
.phase-key {
  font: 8px monospace;
  color: var(--accent);
  margin-left: auto;
  white-space: nowrap;
}
.phase-key span {
  margin-left: 9px;
  color: #abb6c5;
}
.sequencer {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 15px 13px;
  font: 8px monospace;
  color: var(--muted);
}
#steps {
  display: flex;
  gap: 4px;
  flex: 1;
}
#steps i {
  height: 6px;
  flex: 1;
  background: #303743;
  border-radius: 1px;
}
#steps i:nth-child(4n + 1) {
  background: #566273;
}
#steps i.active {
  background: var(--accent);
  box-shadow: 0 0 9px #d6dee870;
}
.section-label {
  margin: 1px 0 12px;
}
.set-tabs {
  display: flex;
  gap: 4px;
}
.set-tabs button {
  font-size: 10px;
  padding: 9px 8px;
  flex: 1;
}
.set-tabs .active {
  background: var(--accent);
  color: #17202b;
  border-color: var(--accent);
}
.set-description {
  font: 8px monospace;
  letter-spacing: 1.2px;
  color: var(--muted);
  margin: 13px 0;
}
.tower-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.tower-card {
  text-align: left;
  padding: 10px;
  position: relative;
  background: #1c2129;
  min-height: 70px;
}
.tower-card.active {
  border-color: var(--accent);
  background: #d6dee80b;
}
.tower-card .icon {
  display: block;
  color: var(--accent);
  font: 20px monospace;
  margin-bottom: 7px;
}
.tower-card b {
  font-size: 11px;
  font-weight: 500;
}
.tower-card small {
  float: right;
  color: var(--muted);
  font: 9px monospace;
}
.rack-label {
  display: flex;
  justify-content: space-between;
  font: 8px monospace;
  letter-spacing: 1px;
  color: var(--muted);
  margin: 12px 0 20px;
}
#inspector {
  border-top: 1px solid var(--line);
  padding-top: 15px;
}
h2 {
  font-size: 22px;
  font-weight: 500;
  margin: 8px 0;
}
#selected-info {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.6;
  margin: 6px 0 10px;
  min-height: 31px;
}
#fx {
  display: grid;
  gap: 5px;
}
.fx-button {
  text-align: left;
  padding: 7px 9px;
  font-size: 10px;
}
.fx-button strong {
  color: var(--accent);
  font-weight: 500;
}
.fx-button span {
  float: right;
  color: var(--muted);
  font: 9px monospace;
}
.fx-button small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-top: 3px;
}
.fx-button.active {
  border-color: var(--accent);
}
.inspector-actions {
  display: flex;
  gap: 6px;
  margin-top: 9px;
}
.inspector-actions button {
  font-size: 10px;
  padding: 8px 10px;
}
.tip {
  margin-top: 17px;
  border-left: 2px solid var(--accent);
  padding-left: 11px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.8;
}
.tip b {
  font: 8px monospace;
  letter-spacing: 1px;
  color: var(--accent);
}
.tip p {
  margin: 5px 0;
}
.tip span {
  font: 9px monospace;
}
.stats {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1.5fr;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  gap: 25px;
}
.stats > div {
  border-right: 1px solid var(--line);
  padding-right: 25px;
}
.stats > div:last-child {
  border: 0;
}
.stats strong {
  font: 30px monospace;
  letter-spacing: -1px;
}
.stats strong span {
  font: 12px monospace;
  margin-left: 5px;
  color: var(--muted);
}
.stat-note {
  display: block;
  font: 8px monospace;
  letter-spacing: 1px;
  color: var(--muted);
  margin-top: 8px;
}
.meter {
  height: 3px;
  background: #303743;
  margin-top: 10px;
}
.meter i {
  display: block;
  height: 100%;
  background: var(--accent);
  width: 100%;
}
.tension-stat small span {
  float: right;
  color: var(--accent);
}
#tension-bars {
  display: flex;
  gap: 5px;
  margin-top: 10px;
}
#tension-bars i {
  height: 4px;
  background: #303743;
  flex: 1;
}
#tension-bars .active {
  background: var(--accent);
}
footer {
  display: flex;
  justify-content: space-between;
  color: #7c8797;
  font: 8px monospace;
  letter-spacing: 1px;
  margin-top: 17px;
}
dialog {
  background: #191e17;
  color: var(--ink);
  border: 1px solid #586b42;
  border-radius: 12px;
  padding: 35px;
  max-width: 480px;
  width: 90%;
}
dialog::backdrop {
  background: #030603cc;
  backdrop-filter: blur(7px);
}
dialog h2 {
  font-size: 42px;
  letter-spacing: -2px;
}
dialog p {
  color: var(--muted);
  line-height: 1.6;
}
#result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 25px 0;
  font: 12px monospace;
}
#result-stats small {
  display: block;
  color: var(--muted);
  font-size: 9px;
  margin-bottom: 6px;
}
.result-note {
  font-size: 10px;
}
@media (min-width: 1100px) and (max-height: 1000px) {
  header {
    height: 58px;
  }
  main {
    padding-top: 16px;
  }
  .topline {
    margin-bottom: 17px;
  }
  h1 {
    font-size: 29px;
    margin-top: 8px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
  }
  .board-wrap {
    max-height: 365px;
  }
  canvas {
    height: 365px;
    width: 100%;
    object-fit: contain;
  }
  .tower-card {
    min-height: 59px;
    padding: 8px;
  }
  .tower-card .icon {
    margin-bottom: 3px;
    font-size: 17px;
  }
  .tip {
    margin-top: 10px;
  }
  .rack-label {
    margin-bottom: 13px;
  }
  .stats {
    margin-top: 14px;
    padding: 12px 0;
  }
  .stats strong {
    font-size: 25px;
  }
  #inspector {
    padding-top: 10px;
  }
  .fx-button {
    padding: 6px 8px;
  }
  .section-label {
    margin-bottom: 9px;
  }
  .set-description {
    margin: 9px 0;
  }
  .tip p {
    margin: 3px 0;
  }
  footer {
    margin-top: 12px;
  }
}
@media (max-width: 900px) {
  header {
    margin: 0 20px;
  }
  .tagline {
    display: none;
  }
  main {
    padding: 20px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .session {
    gap: 12px;
  }
  .session strong {
    font-size: 13px;
  }
  h1 {
    font-size: 29px;
  }
  aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
  }
  aside > .section-label,
  aside > .set-tabs,
  aside > .set-description,
  aside > .tower-grid,
  aside > .rack-label {
    grid-column: 1;
  }
  #inspector {
    grid-column: 2;
    grid-row: 1/6;
  }
  .tip {
    grid-column: 1/3;
  }
  .stats {
    gap: 12px;
  }
  .stats > div {
    padding-right: 10px;
  }
  .phase-key {
    font-size: 7px;
  }
  footer {
    font-size: 7px;
  }
}
@media (max-width: 550px) {
  .topline {
    align-items: flex-start;
    gap: 18px;
    flex-direction: column;
  }
  .brand {
    font-size: 21px;
  }
  .audio input {
    width: 55px;
  }
  aside {
    display: block;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  .phase-key {
    display: none;
  }
  footer span:last-child {
    display: none;
  }
  #inspector {
    margin-top: 18px;
  }
}
@media (min-width: 901px) {
  header {
    height: 58px;
  }
  main {
    padding-top: 16px;
  }
  .topline {
    margin-bottom: 17px;
  }
  h1 {
    font-size: 29px;
    margin-top: 8px;
  }
  .board-wrap {
    max-height: none;
  }
  canvas {
    height: clamp(300px, 43vh, 460px);
    width: 100%;
    object-fit: contain;
  }
  .stage {
    align-self: start;
  }
  .stats {
    margin-top: 14px;
    padding: 12px 0;
  }
  .stats strong {
    font-size: 25px;
  }
  footer {
    margin-top: 12px;
  }
}
@media (min-width: 901px) and (max-height: 1000px) {
  aside .tip {
    display: none;
  }
  aside .section-label {
    margin: 0 0 6px;
  }
  aside .set-description {
    margin: 8px 0;
  }
  aside .tower-card {
    min-height: 53px;
    padding: 7px;
  }
  aside .tower-card .icon {
    font-size: 16px;
    margin-bottom: 3px;
  }
  aside .rack-label {
    margin: 8px 0 10px;
  }
  #inspector {
    padding-top: 8px;
  }
  #inspector h2 {
    font-size: 19px;
    line-height: 22px;
    margin: 5px 0;
  }
  #selected-info {
    margin: 4px 0 7px;
    min-height: 0;
    line-height: 1.45;
  }
  .fx-button {
    padding: 5px 8px;
    line-height: 1.2;
  }
  .fx-button small {
    margin-top: 2px;
    line-height: 1.2;
  }
  .inspector-actions {
    margin-top: 7px;
  }
  .inspector-actions button {
    padding: 7px 9px;
  }
  .stats {
    padding: 10px 0;
  }
  .stats small {
    margin-bottom: 6px;
  }
}

/* Instrument identity is independent of the selected sound set. */
.sound-key {
  display: flex;
  gap: 16px;
  font: 9px monospace;
  letter-spacing: 0.8px;
  margin: 0 0 9px;
}
.sound-key .low {
  color: #b9f56b;
}
.sound-key .tone {
  color: #74baff;
}
.sound-key .rhythm {
  color: #ff8a7a;
}
.tower-card {
  border-top: 2px solid var(--voice);
}
.tower-card .icon,
.tower-card b {
  color: var(--voice);
}
.tower-card.active {
  border-color: var(--voice);
  background: color-mix(in srgb, var(--voice) 10%, #191e26);
}
.tower-card:hover {
  border-color: var(--voice);
}
#selected-name,
.fx-button strong {
  color: var(--voice);
}
.fx-button.active {
  border-color: var(--voice);
}
#steps i {
  height: 9px;
}
#steps i.active {
  outline: 1px solid #eef1f6;
  outline-offset: 2px;
  box-shadow: none;
}
@media (min-width: 901px) and (max-height: 1000px) {
  .sound-key {
    margin-bottom: 6px;
    font-size: 8px;
  }
}
@media (max-width: 900px) {
  aside > .sound-key {
    grid-column: 1;
  }
  #inspector {
    grid-row: 1/7;
  }
}
