:root {
  --bg: #0e0e0e;
  --fg: #f3f3f1;
  --muted: #8a8a86;
  --line: #262624;
  --panel: #161615;
  --accent: #1f7a4d;
  --accent-dim: #145234;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 4rem;
}

/* header */
.topbar {
  padding: 0.5rem 0 1.75rem;
}
.brand {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

/* readout */
.readout {
  margin-bottom: 1.5rem;
}
.bpm {
  font-family: "JetBrains Mono", monospace;
  font-weight: 500;
  font-size: clamp(4.5rem, 22vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.03em;
}
.bpm-unit {
  font-size: 0.3em;
  color: var(--muted);
  letter-spacing: 0;
}
.source {
  margin-top: 0.6rem;
  font-size: 1.05rem;
  font-weight: 600;
}
.detail {
  margin-top: 0.2rem;
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--muted);
}

/* pulse bar */
.pulse-track {
  height: 4px;
  width: 100%;
  background: var(--line);
  margin: 1.75rem 0;
  overflow: hidden;
}
.pulse-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transform-origin: left center;
}

/* controls */
.controls {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.btn {
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  width: 100%;
  text-align: center;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.btn:hover { border-color: var(--muted); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-dim); border-color: var(--accent-dim); }
.btn-primary.playing {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-ghost.armed {
  border-color: var(--accent);
  color: var(--accent);
}

/* divider */
.rule {
  border: none;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

/* blocks */
.block-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin: 0 0 1rem;
}

/* pro list */
.pro-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pro-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--line);
  cursor: pointer;
}
.pro-card:first-child { border-top: none; }
.pro-card:hover .pro-name { color: var(--accent); }
.pro-main { min-width: 0; }
.pro-name { font-weight: 600; font-size: 0.95rem; }
.pro-note { color: var(--muted); font-size: 0.8rem; margin-top: 0.1rem; }
.pro-meta {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  flex-shrink: 0;
}
.pro-bpm {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.85rem;
  color: var(--muted);
}
.pro-arrow { color: var(--line); font-size: 0.9rem; }
.pro-card.active {
  border-left: 2px solid var(--accent);
  padding-left: 0.75rem;
  margin-left: -0.75rem;
}
.pro-card.active .pro-name { color: var(--accent); }
.pro-card.active .pro-arrow { color: var(--accent); }

/* sliders */
.slider-row { margin-bottom: 1.4rem; }
.slider-row:last-child { margin-bottom: 0; }
.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
}
.slider-head label { font-size: 0.9rem; }
.slider-val {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--muted);
}
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 2px;
  background: var(--line);
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--fg);
  border: none;
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--fg);
  border: none;
  border-radius: 0;
}

/* reset */
.reset {
  display: block;
  margin: 2.5rem 0 0;
  background: none;
  border: none;
  color: var(--muted);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  padding: 0;
}
.reset:hover { color: var(--fg); }

@media (min-width: 560px) {
  .controls { flex-direction: row; }
}
