:root {
  /* Layout: Visualizer füllt den Hintergrund; oben Transportleiste, darunter freie Bühne, unten das 16-Step-Raster */
  --bg: #0a0717;
  --panel: rgba(16, 11, 34, 0.66);
  --line: rgba(190, 170, 255, 0.16);
  --ink: #f3effc;
  --dim: #9d93bd;
  --hot: #ff4d8d;
  --amber: #ffb23e;
  --cyan: #3fe0ff;
  --display: "Syne", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  background: var(--bg);
  color: var(--ink);
  font: 13px/1.4 var(--mono);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
canvas#viz {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.top,
.deck {
  position: relative;
  z-index: 1;
  background: var(--panel);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}
h1 {
  font: 800 22px/1 var(--display);
  margin: 0;
  letter-spacing: -0.01em;
}
h1 span {
  color: var(--hot);
}
#play {
  font: 800 14px var(--display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  min-width: 104px;
  padding: 10px 16px;
  border-radius: 99px;
  border: 0;
  background: var(--hot);
  color: #1a0410;
  cursor: pointer;
}
#play.on {
  background: var(--ink);
}
.knob {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 108px;
  flex: 1 1 108px;
  max-width: 170px;
}
.knob label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.knob output {
  color: var(--ink);
}
input[type="range"] {
  width: 100%;
  margin: 0;
  height: 18px;
  accent-color: var(--hot);
}
select,
button.b {
  font: 500 12px var(--mono);
  color: var(--ink);
  background: rgba(190, 170, 255, 0.1);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  cursor: pointer;
}
button.b:hover,
select:hover {
  background: rgba(190, 170, 255, 0.2);
}
button.b.gen {
  background: var(--amber);
  color: #241500;
  border-color: transparent;
  font-weight: 500;
}
button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
.grp {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.stage {
  flex: 1 1 0;
  min-height: 90px;
  position: relative;
  z-index: 1;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
}
.stage p {
  margin: 0;
  color: var(--dim);
  font-size: 11.5px;
  text-shadow: 0 0 8px #000;
  text-align: center;
  padding: 0 16px;
}
.deck {
  border-top: 1px solid var(--line);
  padding: 10px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.harm {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}
.harm .lab {
  color: var(--dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.ch {
  font: 500 12.5px var(--mono);
  min-width: 66px;
  text-align: center;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(190, 170, 255, 0.07);
  color: var(--ink);
  cursor: pointer;
}
.ch.now {
  border-color: var(--amber);
  color: var(--amber);
  box-shadow: 0 0 14px rgba(255, 178, 62, 0.35);
}
.scroll {
  overflow-x: auto;
}
.grid {
  display: grid;
  grid-template-columns: 196px repeat(16, minmax(26px, 1fr));
  gap: 4px;
  min-width: 720px;
  align-items: center;
}
.th {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 6px;
}
.th .nm {
  flex: 1;
  font: 600 13px var(--display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--c);
}
.th canvas {
  width: 44px;
  height: 22px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  flex: none;
}
.th button {
  font: 500 10.5px var(--mono);
  width: 22px;
  height: 22px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: none;
  color: var(--dim);
  cursor: pointer;
  padding: 0;
  flex: none;
}
.th button[aria-pressed="true"] {
  background: var(--hot);
  color: #1a0410;
  border-color: transparent;
}
.th input {
  width: 46px;
  flex: none;
  accent-color: var(--c);
}
.cell {
  height: 26px;
  border-radius: 5px;
  border: 1px solid rgba(190, 170, 255, 0.13);
  background: rgba(190, 170, 255, 0.05);
  cursor: pointer;
  padding: 0;
  transition: transform 0.08s;
}
.cell.q {
  background: rgba(190, 170, 255, 0.11);
}
.cell.g {
  margin-left: 5px;
}
.cell[data-v="1"] {
  background: color-mix(in srgb, var(--c) 62%, #0a0717);
  border-color: var(--c);
}
.cell[data-v="2"] {
  background: var(--c);
  border-color: #fff;
  box-shadow: 0 0 12px var(--c);
}
.cell.ph {
  outline: 1.5px solid rgba(255, 255, 255, 0.7);
  outline-offset: 1px;
}
.cell.ph[data-v="1"],
.cell.ph[data-v="2"] {
  transform: scale(1.12);
}
.hint {
  color: var(--dim);
  font-size: 11px;
  margin: 0;
}
@media (max-width: 700px) {
  .grid {
    grid-template-columns: 120px repeat(16, minmax(26px, 1fr));
  }
  .th input {
    display: none;
  }
  h1 {
    font-size: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .cell {
    transition: none;
  }
}
.back {
  margin-left: auto;
  font:
    500 12px system-ui,
    sans-serif;
  color: #f3effc;
  background: rgba(10, 8, 22, 0.78);
  border: 1px solid rgba(190, 170, 255, 0.35);
  border-radius: 99px;
  padding: 7px 13px;
  text-decoration: none;
  white-space: nowrap;
}
.back:hover {
  border-color: #fff;
}
.back:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}
