/* Solo: tablature as the stage, practice bar, then the position and what each technique means. */

.sol {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-5);
  padding: var(--s-4) var(--gutter) var(--s-7);
  background: var(--bg);
}

.sol:focus {
  outline: none;
}

/* ---------- Config and heading ---------- */

.sol-config {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-5);
}

.sol-pick {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
}

.sol-pick-title {
  color: var(--ink-2);
  font-size: var(--t-small);
  font-weight: 600;
}

.sol-config [data-positions] button {
  min-width: 44px;
  padding: 0 var(--s-3);
  font-variant-numeric: tabular-nums;
}

.sol-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--s-3) var(--s-5);
}

.sol-head h1 {
  font: 800 clamp(2.5rem, 1.5rem + 2.2vw, 3.75rem) / 0.95 var(--font-display);
  letter-spacing: -0.03em;
}

.sol-sub {
  margin-top: var(--s-2);
  color: var(--ink-2);
  font-weight: 600;
}

/* ---------- Tablature (the stage) ---------- */

.sol-tab {
  order: 0; /* chords.css reorders .stage-visual on small screens */
  position: relative;
  width: 100%;
  padding: var(--s-4) var(--s-5) var(--s-3) var(--s-3);
}

.sol-tab .tab {
  display: block;
  width: 100%;
  height: auto;
}

.tab-string {
  stroke: var(--ink);
  stroke-opacity: 0.4;
  stroke-width: 1.5;
}

.tab-bar {
  stroke: var(--line-strong);
  stroke-width: 2;
}

.tab-bar--end {
  stroke: var(--ink);
  stroke-width: 4;
}

.tab-string-name,
.tab-count {
  fill: var(--ink-2);
  font: 700 16px var(--font-ui);
}

.tab-count {
  font-size: 14px;
  font-weight: 800;
}

.tab-phrase {
  fill: var(--ink-2);
  font: 700 15px var(--font-ui);
}

.tab-phrase--response {
  fill: var(--ink);
}

.tab-chip {
  fill: var(--surface);
}

.tab-fret {
  fill: var(--ink);
  font: 800 21px var(--font-display);
  font-variant-numeric: tabular-nums;
}

.tab-slur,
.tab-vibrato {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.tab-slide {
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
}

.tab-tech {
  fill: var(--ink);
  font: 800 13px var(--font-ui);
}

.tab-dur {
  fill: var(--ink-2);
  opacity: 0.85;
}

.tab-rest {
  stroke: var(--ink-2);
  stroke-width: 2.5;
  stroke-dasharray: 3 5;
  stroke-linecap: round;
}

/* Play-along: the cursor and the note under it are the lamp. */
.tab-playhead {
  fill: var(--accent);
}

.tab-note .tab-chip,
.tab-dur {
  transition: fill 80ms var(--ease-out), opacity 80ms var(--ease-out);
}

.tab-note.is-current .tab-chip {
  fill: var(--accent);
}

.tab-note.is-current .tab-fret {
  fill: var(--accent-ink);
}

.tab-dur.is-current {
  fill: var(--accent);
  opacity: 1;
}

.sol-count {
  position: absolute;
  left: 50%;
  top: 50%; /* the view moves it onto the first line */
  translate: -50% -50%;
  display: none;
  place-items: center;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font: 800 5rem / 1 var(--font-display);
  outline: 8px solid var(--bg);
  pointer-events: none;
}

.is-counting .sol-count {
  display: grid;
}

/* ---------- Practice bar ---------- */

.sol-practice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3) var(--s-5);
}

.sol-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.sol-controls .btn {
  min-height: 50px;
  padding: 0 var(--s-4);
}

.sol-controls [data-action="toggle"] {
  min-width: 140px;
}

.sol-tempo {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-3);
}

.sol-status {
  color: var(--ink-2);
  font-size: var(--t-small);
  font-weight: 600;
}

/* ---------- Position and techniques ---------- */

.sol-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 1fr);
  gap: var(--s-5) var(--s-6);
  align-items: start;
  padding-top: var(--s-4);
  border-top: 1px solid var(--line);
}

.sol-board {
  padding: var(--s-3) var(--s-4) var(--s-2) var(--s-2);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.sol-board .fretboard {
  display: block;
  width: 100%;
  height: auto;
  max-height: 380px;
}

.sol-now {
  display: grid;
  justify-items: start;
  gap: 2px;
  margin-bottom: var(--s-4);
}

.sol-now:empty {
  display: none;
}

.sol-now b {
  font: 800 4rem / 1 var(--font-display);
  letter-spacing: -0.02em;
}

.sol-now b.is-done {
  font-size: 2.5rem;
}

.sol-now span {
  color: var(--ink-2);
  font-weight: 600;
}

.sol-now .sol-now-tech {
  color: var(--ink);
}

.sol-done-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.is-finished .sol-now {
  padding: var(--s-4) var(--s-5);
  border-radius: var(--r-lg);
  background: var(--surface);
  outline: 2px solid var(--accent-edge);
}

.sol-techs-title {
  font: 800 var(--t-title) / 1.1 var(--font-display);
  letter-spacing: -0.01em;
}

.sol-techs {
  display: grid;
  gap: var(--s-3);
  margin-top: var(--s-3);
}

.sol-techs li {
  display: grid;
  grid-template-columns: 44px 1fr;
  align-items: start;
  gap: var(--s-3);
}

.sol-techs b {
  display: grid;
  place-items: center;
  height: 32px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-sm);
  font: 800 1rem / 1 var(--font-display);
}

.sol-techs span {
  color: var(--ink-2);
}

.sol-techs strong {
  color: var(--ink);
  font-weight: 700;
}

.sol-techs-none {
  color: var(--ink-2);
}

/* ---------- Full screen class view ---------- */

.sol.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 20;
  align-content: start;
  padding: var(--s-5) clamp(24px, 4vw, 64px);
  overflow: auto;
}

.sol.is-fullscreen .sol-config,
.sol.is-fullscreen .sol-head .btn,
.sol.is-fullscreen .sol-tempo,
.sol.is-fullscreen .sol-status,
.sol.is-fullscreen .sol-techs-title,
.sol.is-fullscreen .sol-techs,
.sol.is-fullscreen .sol-techs-none,
.sol.is-fullscreen [data-action="restart"],
.sol.is-fullscreen [data-action="notes"],
.sol.is-fullscreen [data-action="mute"] {
  display: none;
}

.sol.is-fullscreen .sol-detail {
  border-top: 0;
  padding-top: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .sol-detail {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Phone: two bars per line, controls in the bottom bar like the other modules. */
@media (max-width: 520px) {
  .sol {
    gap: var(--s-4);
    padding-bottom: 120px;
  }

  .sol-config {
    gap: var(--s-3);
  }

  .sol-config > .field:first-child > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .sol-head h1 {
    font-size: 2.25rem;
  }

  .sol-tab {
    padding: var(--s-3) var(--s-3) var(--s-2) var(--s-1);
  }

  .sol-count {
    width: 104px;
    height: 104px;
    font-size: 3.5rem;
  }

  .sol-controls {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    display: grid;
    grid-template-columns: 1fr repeat(4, 52px);
    gap: var(--s-2);
    padding: var(--s-3) var(--gutter) calc(var(--s-3) + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 94%, transparent);
    backdrop-filter: blur(10px);
  }

  .sol-controls .btn {
    min-height: 52px;
    padding: 0;
  }

  .sol-controls [data-action="toggle"] {
    min-width: 0;
    padding: 0 var(--s-4);
  }

  .sol-controls .btn:not([data-action="toggle"]) span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .sol-now b {
    font-size: 2.75rem;
  }

  .is-playing .sol-config,
  .is-paused .sol-config {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tab-note .tab-chip,
  .tab-dur {
    transition: none;
  }
}
