/* Harmony Trainer (Level 9 / 10) — shared styles.
   Reuses global tokens from /style.css (--bg --ink --muted --accent --accent-soft --card --border --heart). */

.th-intro { color: var(--muted); font-size: 16px; line-height: 1.55; max-width: 64ch; margin: 0 0 20px; }
.th-intro strong { color: var(--ink); font-weight: 650; }

.th-block-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--accent); margin: 0 0 9px;
}
.th-block-label .th-lvl {
  color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 6px;
}

/* Mode picker — wraps to a tidy grid on phones */
.th-modes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.th-seg {
  appearance: none; border: 1px solid var(--border); border-radius: 11px;
  background: var(--card); color: var(--muted); font-size: 14px; font-weight: 600;
  padding: 9px 13px; cursor: pointer; transition: border-color .18s, color .18s, background .18s;
}
.th-seg:hover { border-color: var(--accent); color: var(--ink); }
.th-seg.is-sel { color: var(--ink); border-color: var(--accent); background: var(--accent-soft); }

/* Flashcard */
.th-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 20px 18px; text-align: center; margin-bottom: 16px;
}
.th-prompt { color: var(--muted); font-size: 15px; margin: 0 0 6px; }
.th-prompt strong { color: var(--ink); font-weight: 650; }
/* Notation sits on a light "score paper" panel with natural dark ink — the reliable approach
   the cello/violin/piano timeline players use. (Verovio's glyphs carry their own fills, so
   recolouring them to a light ink on a dark card leaves noteheads invisible; a light panel
   sidesteps that entirely.) Force every element to dark ink so it's consistent across engines. */
.th-stave {
  min-height: 118px; display: flex; align-items: center; justify-content: center;
  background: #f6f7fb; border-radius: 12px; padding: 12px 8px; margin-top: 4px;
}
.th-stave svg { max-width: 100%; height: auto; max-height: 168px; color: #14183a; }
/* Verovio wraps noteheads in <g class="layer"> and each note in <g class="note"> — the same
   class names the global /style.css styles for other UI (…`.layer{opacity:0;position:absolute}`),
   which would make every notehead INVISIBLE. Reset those classes inside the score. */
.th-stave svg .layer { position: static; inset: auto; width: auto; height: auto; opacity: 1; background: none; object-fit: fill; }
.th-stave svg .note { background: none; border: 0; border-radius: 0; padding: 0; }
.th-loading { color: #5b6180; font-size: 14px; padding: 34px 0; }

.th-cardtools { display: flex; gap: 10px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.th-hear {
  appearance: none; border: 1px solid var(--border); border-radius: 11px; background: var(--card);
  color: var(--ink); font-size: 14px; font-weight: 600; padding: 9px 16px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; transition: border-color .18s, background .18s;
}
.th-hear:hover { border-color: var(--accent); }
.th-hear:active { background: var(--accent-soft); transform: scale(.99); }
.th-autoplay { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13.5px; cursor: pointer; }
.th-autoplay input { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

.th-feedback { min-height: 22px; margin-top: 12px; font-size: 15px; font-weight: 600; color: var(--muted); }
.th-feedback.is-correct { color: #36d399; }
.th-feedback.is-wrong { color: var(--heart); }
.th-explain { color: var(--muted); font-size: 14px; line-height: 1.5; margin-top: 6px; min-height: 20px; max-width: 52ch; margin-left: auto; margin-right: auto; }
.th-explain b { color: var(--ink); font-weight: 650; }

/* Answer groups (one row per group: intervals = quality + number, etc.) */
.th-answer { margin-bottom: 8px; }
.th-group { margin-bottom: 14px; }
.th-group-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 8px; }
.th-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.th-opt {
  appearance: none; border: 1px solid var(--border); border-radius: 11px; background: var(--card);
  color: var(--ink); font-size: 15px; font-weight: 600; padding: 11px 15px; cursor: pointer;
  transition: border-color .15s, background .15s, transform .08s; min-width: 46px;
}
.th-opt:hover { border-color: var(--accent); }
.th-opt:active { transform: scale(.97); }
.th-opt.is-pick { border-color: var(--accent); background: var(--accent-soft); }
.th-opt.is-correct { border-color: #36d399; background: rgba(54,211,153,.14); color: var(--ink); }
.th-opt.is-wrong { border-color: var(--heart); background: rgba(255,93,143,.12); }
.th-opt .th-sub { display: block; font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 1px; }

.th-next {
  appearance: none; width: 100%; margin-top: 6px; padding: 14px; border: 0; border-radius: 13px;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
  transition: filter .15s, transform .08s, opacity .15s;
}
.th-next:hover { filter: brightness(1.08); }
.th-next:active { transform: scale(.99); }
.th-next[disabled] { opacity: .4; cursor: default; }

/* Stats row (matches sight-reading) */
.th-stats { display: flex; align-items: center; gap: 22px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.th-stat { text-align: center; }
.th-stat-num { font-size: 24px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.th-stat-lbl { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.th-reset {
  margin-left: auto; appearance: none; border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); color: var(--muted); font-size: 13px; font-weight: 600; padding: 8px 14px; cursor: pointer;
}
.th-reset:hover { border-color: var(--heart); color: var(--heart); }

.th-tip { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 16px 0 0; }

@media (max-width: 480px) {
  .th-opt { padding: 10px 12px; font-size: 14px; }
  .th-stats { gap: 16px; }
}
