/* Jam tracks — builds on styles.css, chords.css (stage, the Now/Next queue, transport, tones) and scales.css
   (fretboard, position grid). Design system: brand/design-guide.md */

/* the whole progression, four bars to a row like a chart; the bar playing is amber */
.jam-form { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 6px; }
.jf-bar {
  display: grid;
  place-items: center;
  height: 40px;
  overflow: hidden;
  border: 1px solid var(--on-stage-line);
  border-radius: var(--radius-control);
  background: var(--on-stage);
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
}
/* a chord held from the bar before: its name again, quieter */
.jf-bar.is-held { color: var(--text-quiet); font-size: 15px; font-weight: 500; }
.jf-bar.is-current { border-color: var(--amber); background: var(--amber-tint); color: var(--amber); }

/* transport: the band's switches stay on the row; when the player column is narrow the ±5 steps go first */
@container workspace (max-width: 720px) {
  .jam-page .tempo .step:is([data-bpm='-5'], [data-bpm='5']) { display: none; }
}
/* a style with an organ has a fourth switch: the row closes up and the ±5 steps go sooner, and on a phone, where
   four switches don't fit across, they sit two by two */
@container workspace (max-width: 830px) {
  .jam-page .transport:has(#organ-switch:not([hidden])) { gap: 6px; }
  .jam-page .transport:has(#organ-switch:not([hidden])) .switch { gap: 8px; }
  .jam-page .transport:has(#organ-switch:not([hidden])) .transport-toggles { gap: 12px; }
}
@container workspace (max-width: 800px) {
  .jam-page .transport:has(#organ-switch:not([hidden])) .tempo .step:is([data-bpm='-5'], [data-bpm='5']) { display: none; }
}
@container workspace (max-width: 400px) {
  .jam-page .transport:has(#organ-switch:not([hidden])) .transport-toggles { display: grid; grid-template-columns: repeat(2, max-content); gap: 0 24px; }
}
.inspector .switch.wide { font-family: var(--font-panel); font-size: 17px; }

/* ---------- solo over it ---------- */

.solo { margin-top: 20px; }
.solo .panel-head h2 { flex: none; white-space: nowrap; }
.solo .panel-head .video-sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.solo-body { display: grid; gap: 16px; padding: 16px 20px 20px; }
.solo-picks { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.solo .field-label { color: var(--amp-legend); font-family: var(--font-panel); font-size: 16px; font-weight: 600; }
.solo-scales { flex-wrap: wrap; }
.solo-scales button { flex: 0 1 auto; height: 40px; padding: 0 14px; }
.solo .pos-grid button { height: 44px; }
/* the positions, then All (the whole neck); where they don't fit on one row, All takes the row below */
.pos-row { display: flex; flex-wrap: wrap; gap: 4px; }
.pos-row > #pos-grid { flex: 999 1 calc(var(--n, 5) * 40px); }
.pos-all { flex: 1 0 auto; grid-template-columns: 1fr; }
.pos-all button { padding: 4px 12px; }
.solo .board-tools { justify-content: flex-start; margin-top: -4px; }
.solo-labels { grid-template-columns: 1fr 1fr; padding: 3px; }
.solo-labels button { height: 26px; padding: 0 10px; font-size: 14px; }
.solo-legend { flex: 1; min-width: 220px; margin: 0; color: var(--text-muted); font-size: 14px; line-height: 1.45; }
.solo-legend b { color: var(--text); font-weight: 600; }
.sl-out { white-space: nowrap; }
.sl-ring {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin: 0 6px -1px 0;
  border: 2px solid var(--amber);
  border-radius: 50%;
}
.sl-ring.is-dashed { border-style: dashed; }

/* the chord playing now: its notes in the scale get an amber ring; the ones outside it a dashed amber ring */
.fb-note.is-tone .fb-halo { opacity: 1; }
.fb-note.is-outside .fb-dot { fill: #17100b; stroke: var(--amber); stroke-dasharray: 4 3; stroke-width: 2.5; }
.fb-note.is-outside text { fill: var(--amber); }
.solo .fb-note { cursor: default; }

/* the whole neck: notes outside the picked position dimmed but still readable, their chord tones outlined in amber
   (the full ring would crowd the next fret); drawn at its full width and scrolled sideways where the panel is narrower */
.fretboard.is-whole { overflow-x: auto; overscroll-behavior-x: contain; }
.fretboard.is-whole .fb-svg { max-width: none; }
.fretboard.is-whole .fb-halo { transform: scale(0.82); transform-box: fill-box; transform-origin: center; }
.fb-note.is-dim .fb-dot { stroke-opacity: 0.4; }
.fb-note.is-dim text { opacity: 0.6; }
.fb-note.is-dim.is-root .fb-dot { fill-opacity: 0.55; }
.fb-note.is-dim.is-root text { opacity: 0.9; }
.fb-note.is-dim.is-tone .fb-halo { opacity: 0; }
.fb-note.is-dim.is-tone .fb-dot { stroke: var(--amber); stroke-opacity: 0.85; }

/* ---------- responsive ---------- */

@media (max-width: 1280px) {
  .jam-page .insp-body > .wide { grid-column: 1 / -1; }
  .jam-page .prog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.prog-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (max-width: 860px) {
  .solo-picks { grid-template-columns: 1fr; }
  .jam-page .prog-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .jf-bar { height: 36px; font-size: 15px; }
  .jf-bar.is-held { font-size: 13px; }
  .solo-body { padding: 14px 16px 16px; }
}
