* {
  box-sizing: border-box;
}

:root {
  --bg: #000616;
  --line: #2C3DDD;
  --text: #33AAFF;
}

body {
  font: 13px monospace;
  margin: 16px;
  background: var(--bg);
  color: var(--text);
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

button,
select,
input {
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  font: inherit;
}

button {
  padding: 4px 10px;
  cursor: pointer;
}

.bpm-label {
  display: flex;
  gap: 8px;
  align-items: center;
}

.bpm-label input[type="range"] {
  width: 120px;
}

main,
.deck {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.deck {
  margin-top: 24px;
}

.deck-common .panel {
  width: auto;
  flex-direction: row;
  align-items: flex-end;
}

.piano-roll {
  display: grid;
  grid-template-columns: 44px repeat(16, 30px);
  gap: 2px;
}

.cell {
  height: 20px;
  padding: 0;
  border: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
}

.cell.active {
  background: var(--line);
}

.cell.playing {
  outline: 2px solid var(--text);
}

.note-label {
  height: 20px;
  line-height: 20px;
  font-size: 10px;
  text-align: right;
  padding-right: 4px;
}

.panel {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 8px;
  width: 250px;
}

.param {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 72px;
}

.param-value {
  font-size: 11px;
  white-space: nowrap;
}

.param select {
  width: 100%;
}

.param-slider {
  width: 100%;
  flex-direction: row;
  gap: 8px;
}

.param-slider .param-label {
  width: 64px;
  flex: none;
}

.param-slider input[type="range"] {
  flex: 1;
  min-width: 0;
}

.param-slider .param-value {
  width: 58px;
  text-align: right;
  flex: none;
}

.knob {
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
}

.knob:focus-visible {
  outline: 2px solid var(--text);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: linear-gradient(
    to right,
    var(--text) 0 var(--fill, 0%),
    var(--line) var(--fill, 0%) 100%
  );
  border: none;
  border-radius: 2px;
  outline-offset: 4px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--text);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--text);
  cursor: pointer;
}

input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    var(--text) 0 var(--fill, 0%),
    var(--line) var(--fill, 0%) 100%
  );
}

input[type="range"]::-moz-range-progress {
  height: 4px;
  border-radius: 2px;
  background: var(--text);
}
