/* practice.css — the piano practice page */

body { padding-bottom: 70px; }

.page-title {
  font-size: 12px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--dimmer);
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.io-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--dim);
}
.io-status { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.io-bar select { max-width: 160px; font-size: 12px; padding: 5px 24px 5px 9px; }
#io-voice { max-width: 96px; }

/* ── Tabs ───────────────────────────────────────────────────────────── */

.tabs {
  position: sticky;
  top: 52px;
  z-index: 30;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 2px;
  padding: 0 24px;
  max-width: var(--maxw);
  margin: 0 auto;
  overflow-x: auto;
}
.tabs button {
  appearance: none;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--dim);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 12px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .12s ease, border-color .12s ease;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

/* ── Panels ─────────────────────────────────────────────────────────── */

.tab-panel { padding-top: 30px; }
.tab-panel h1 { font-size: 20px; letter-spacing: -0.02em; margin-bottom: 8px; }

.lede {
  color: var(--dim);
  font-size: 14px;
  line-height: 1.65;
  max-width: 640px;
  margin: 0 0 22px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 16px;
}

/* ── Controls ───────────────────────────────────────────────────────── */

.controls {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  align-items: flex-start;
  margin-bottom: 14px;
}
.ctl { display: flex; align-items: center; gap: 10px; }
.ctl.wide { flex: 1 1 100%; align-items: flex-start; }
.ctl .label { flex: none; padding-top: 5px; }
.ctl.wide .label { width: 74px; }

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--dim);
  cursor: pointer;
}

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips button {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--dim);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: var(--r);
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.chips button:hover { background: var(--surface-2); color: var(--text); }
.chips button[aria-selected="true"], .chips button.on {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.chips.roots button { font-family: var(--mono); min-width: 42px; text-align: center; }

/* ── Keyboard ───────────────────────────────────────────────────────── */

.kb-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--surface-2);
  margin: 14px 0;
}
.kb-wrap canvas { display: block; width: 100%; height: 168px; }

/* ── Drill ──────────────────────────────────────────────────────────── */

.drill { padding: 16px 18px 14px; }

.drill-top {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}
.drill-prompt { min-width: 0; flex: 1; }
.prompt-main {
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.prompt-sub {
  font-size: 13px;
  color: var(--dim);
  margin-top: 4px;
  min-height: 18px;
}

.drill-stats { display: flex; gap: 20px; }
.dstat { text-align: right; }
.dstat .v {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.dstat:nth-child(1) .v { color: var(--good); }
.dstat:nth-child(2) .v { color: var(--bad); }
.dstat .k {
  font-size: 10px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--dimmer);
  margin-top: 2px;
}

.drill-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.drill-feedback {
  font-size: 13px;
  font-weight: 600;
  min-width: 120px;
}
.drill-feedback.right { color: var(--good); }
.drill-feedback.wrong { color: var(--bad); }
.drill-goal {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dimmer);
}

/* ── Learn ──────────────────────────────────────────────────────────── */

.learn-head {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}
.progress-ring {
  flex: none;
  text-align: center;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 14px 20px;
}
.pr-num { font-family: var(--mono); font-size: 22px; font-weight: 600; }
.pr-label { font-size: 10px; letter-spacing: .07em; text-transform: uppercase; color: var(--dimmer); margin-bottom: 8px; }

.lesson-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.lesson {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 15px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color .12s ease, background .12s ease;
}
.lesson:hover { border-color: var(--surface-3); background: var(--surface-2); }
.lesson.done { border-color: #24382e; }

.lesson-badge {
  flex: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--dim);
}
.lesson.done .lesson-badge {
  background: #16211b;
  border-color: #2c4a3a;
  color: var(--good);
}
.lesson-t { display: block; font-size: 13px; font-weight: 600; }
.lesson-d { display: block; font-size: 12px; color: var(--dim); margin-top: 3px; line-height: 1.5; }

.lesson-view { max-width: none; }
.lesson-view h2, .lesson-num { max-width: 780px; }
.back-to-list { margin-bottom: 16px; padding-left: 0; }
.lesson-num {
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--dimmer);
}
.lesson-view h2 { font-size: 22px; letter-spacing: -0.02em; margin: 4px 0 14px; }
.lesson-body p {
  color: var(--dim);
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 12px;
  max-width: 66ch;
}
.lesson-body strong { color: var(--text); font-weight: 600; }
.lesson-body .kbd {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--text);
}
/* An endless drill is a different kind of thing from a lesson you finish,
 * so it says so in the list and in the body. */
.lesson-inf {
  font-style: normal;
  font-size: 12px;
  margin-left: 7px;
  color: var(--accent);
  opacity: .8;
}

/* Finger-to-key map: the one thing a beginner needs printed literally. */
.finger-map {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 2px 0 4px;
}
.finger-map span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 46px;
  padding: 7px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
}
.finger-map b {
  display: grid;
  place-items: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #16202c;
  color: #cfe0f5;
  font-size: 11px;
  font-weight: 700;
}

.lesson-drill { margin-top: 20px; }

/* ── Chord browser ──────────────────────────────────────────────────── */

.chord-headline {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.chord-name {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-family: var(--mono);
}
.chord-full { font-size: 14px; color: var(--dim); }
.chord-spell {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
}
.chord-blurb { color: var(--dim); font-size: 13px; line-height: 1.6; margin: 8px 0 0; max-width: 62ch; }

/* Where a progression came from: the record, the section, the original key. */
.prog-source-note {
  margin: 10px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--surface);
  color: var(--dim);
  font-size: 13px;
  line-height: 1.65;
  max-width: 70ch;
}
.prog-source-note strong { color: var(--text); font-weight: 600; }
.prog-numerals {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  white-space: nowrap;
}
.prog-caveat { color: var(--dimmer); font-size: 12px; }

/* Guitar progression strip: numeral, name, and the shape written as a chord
 * chart writes it (x32010) so it can be read without a diagram. */
.gprog-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 0;
}
.gprog-chord {
  min-width: 108px;
  padding: 10px 12px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.gprog-chord.active { border-color: var(--accent); background: var(--accent-dim); }
.gprog-chord .pc-num {
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--dimmer);
  font-family: var(--mono);
}
.gprog-chord .pc-name { font-size: 17px; font-weight: 600; margin-top: 1px; }
.gprog-chord .pc-tab {
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .12em;
  color: var(--accent);
  margin-top: 5px;
}
.gprog-chord .pc-shape { font-size: 11px; color: var(--dimmer); margin-top: 3px; }
.chord-formula {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--dimmer);
}

.fingering-note {
  font-size: 12px;
  color: var(--dimmer);
  margin-top: 10px;
  line-height: 1.6;
}

/* ── Progressions ───────────────────────────────────────────────────── */

.prog-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 18px;
}
.prog-chord {
  min-width: 92px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  text-align: center;
}
.prog-chord.active { border-color: var(--accent); background: var(--accent-dim); }
.prog-chord.done { border-color: #2c4a3a; }
.pc-num { font-family: var(--mono); font-size: 11px; color: var(--dimmer); }
.pc-name { font-family: var(--mono); font-size: 18px; font-weight: 600; margin-top: 2px; }
.pc-notes { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-top: 4px; }
.prog-chord.active .pc-name { color: var(--accent); }

.hidden { display: none !important; }

@media (max-width: 700px) {
  .io-bar .io-status, .page-title { display: none; }
  .drill-stats { gap: 14px; }
}

/* ── Guitar practice additions ──────────────────────────────────────── */

.fb-wrap {
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--bg);
  margin: 14px 0;
}
.fb-wrap canvas { display: block; width: 100%; height: 190px; }

.mono-notice { margin: 4px 0 20px; max-width: 780px; }
.mono-notice em { color: var(--text); font-style: normal; font-weight: 600; }

.chord-diagram-row {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  margin-top: 14px;
  flex-wrap: wrap;
}
.chord-box {
  flex: none;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 8px;
}
.chord-box canvas { display: block; }
.chord-side { flex: 1; min-width: 180px; padding-top: 6px; }
.chord-shape-label {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
}

.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 9px;
  margin-bottom: 18px;
}
.song-chip {
  display: block;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 12px 14px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color .12s ease, background .12s ease;
}
.song-chip:hover { border-color: var(--surface-3); background: var(--surface-2); }
.song-chip.on { border-color: var(--accent); background: var(--accent-dim); }
.sc-song   { display: block; font-size: 13px; font-weight: 600; }
.sc-artist { display: block; font-size: 12px; color: var(--dim); margin-top: 2px; }
.sc-key    { display: block; font-family: var(--mono); font-size: 11px; color: var(--dimmer); margin-top: 6px; }
.song-chip.on .sc-key { color: var(--accent); }

.song-alt {
  font-size: 12px;
  color: var(--dimmer);
  margin-top: 10px;
  line-height: 1.6;
}
.song-alt strong { color: var(--dim); }
