/* MicroFreak DJ Mode — page-specific styles. Everything rides on the design
   tokens + component classes in styles.css (panels, rows, fields, buttons,
   midi-status, spotify card); this file only adds the pieces DJ mode invents:
   the pitch readout, the RMS meter with its threshold notch, the gate LED, the
   how-to steps, the arm button state, and the monitor log strip. */

.dj-wrap { padding-top: 26px; }

.dj-spike-tag {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--accent);
  border-radius: 999px; padding: 3px 10px; align-self: center;
}

/* the back-to-trainer pill is an <a> wearing the .theme-toggle button suit */
a.dj-back { text-decoration: none; display: inline-flex; align-items: center; }

/* ---- how-to steps ---- */
.dj-steps {
  margin: 0 0 18px; padding-left: 22px;
  display: flex; flex-direction: column; gap: 10px;
  color: var(--muted); font-size: var(--fs-md); line-height: 1.55;
}
.dj-steps li::marker { color: var(--accent); font-family: var(--font-mono); font-weight: 600; }
.dj-steps strong { color: var(--ink); }
.dj-step-note { display: block; font-size: var(--fs-sm); color: var(--faint); margin-top: 2px; }

/* ---- track row ---- */
.dj-track-row { margin-bottom: 14px; }
.dj-track-field { flex: 1 1 320px; min-width: 0; }
.dj-input {
  font: inherit; font-family: var(--font-mono); font-size: var(--fs-sm);
  color: var(--ink); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 13px; width: 100%; min-width: 0;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.dj-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: transparent; }
.dj-input::placeholder { color: var(--faint); }

/* ---- capture row ---- */
.dj-capture-row { margin-top: 16px; align-items: center; }
.dj-inline-status { margin-top: 0; flex: 1 1 240px; min-width: 0; }

/* ---- live readout: gate LED, big mono note, cents/Hz, last-sent chip ---- */
.dj-readout {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  margin-top: 18px; padding: 14px 18px;
  background: var(--panel-2); border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
}
.dj-led {
  align-self: center; width: 11px; height: 11px; border-radius: 50%;
  background: color-mix(in srgb, var(--muted) 35%, transparent);
  border: 1px solid var(--line); transition: background 0.1s ease, box-shadow 0.1s ease;
}
.dj-led.open { background: var(--accent-fill); border-color: transparent; box-shadow: 0 0 8px var(--accent-fill); }
.dj-note {
  font-family: var(--font-mono); font-weight: 600; font-size: 2.1rem;
  line-height: 1; color: var(--ink); min-width: 3.2ch;
  font-variant-numeric: tabular-nums;
}
.dj-note-detail { display: flex; flex-direction: column; gap: 2px; }
.dj-cents, .dj-freq {
  font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.dj-sent {
  margin-left: auto; font-family: var(--font-mono); font-size: var(--fs-sm);
  color: var(--faint); border: 1px solid var(--line-soft);
  border-radius: 999px; padding: 6px 12px; white-space: nowrap;
}
.dj-sent.on { color: var(--accent); border-color: var(--accent); }

/* ---- RMS meter with the gate-threshold notch ---- */
.dj-meter {
  position: relative; height: 10px; margin-top: 10px;
  background: var(--panel-2); border: 1px solid var(--line-soft);
  border-radius: 999px; overflow: hidden;
}
.dj-meter-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 55%, transparent), var(--accent-fill));
  border-radius: 999px; transition: width 0.05s linear;
}
.dj-meter-thresh {
  position: absolute; top: -2px; bottom: -2px; left: 50%; width: 2px;
  background: var(--accent-2); opacity: 0.9;
}

/* ---- arm button states ---- */
.dj-arm.armed {
  color: var(--accent-on); background: var(--accent-fill); border-color: transparent;
  font-weight: 600; box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ---- gate slider ---- */
.dj-slider-field { width: 100%; }
.dj-slider-field input[type="range"] { width: 100%; accent-color: var(--accent-fill); }
.dj-thresh-val { color: var(--accent); font-variant-numeric: tabular-nums; }

/* ---- monitor log ---- */
.dj-log {
  margin: 0; width: 100%; max-height: 180px; overflow-y: auto;
  font-family: var(--font-mono); font-size: var(--fs-xs); line-height: 1.7;
  color: var(--muted); white-space: pre-wrap; word-break: break-word;
}
