/* Voicing Study, page II-V-I (ii-v-i/index.html, src/trainer/trainer.js) : révision des tétrades.
   Reprend le thème de css/style.css (chargé avant) ; les classes tt-* viennent de la version jimjam. */

.tt {
  --paper: var(--bg-2);
  --line: var(--panel-border);
  --accent: var(--brass);
  --accent-soft: rgba(217, 164, 65, 0.14);
  --accent-ink: #1b1408;
  --muted: var(--ink-2);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tt .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tt-panel { background: var(--panel); border: 1px solid var(--panel-border); border-radius: var(--radius); padding: 18px; min-width: 0; }
.tt-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 16px; }
.tt-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.search-label, .eyebrow { font-size: 12px; color: var(--ink-2); text-transform: uppercase; letter-spacing: 0.08em; margin: 0; }
.tt-minor { display: none; }
.tt-has-minor .tt-minor { display: flex; }
.tt-checks { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 14px; color: var(--ink-2); }
.tt-checks label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.tt-checks input { accent-color: var(--brass); width: 17px; height: 17px; }

.tt .btn { display: inline-flex; align-items: center; gap: 8px; background: var(--bg-2); color: var(--ink); border: 1px solid var(--panel-border); font-weight: 500; }
.tt .btn:hover { border-color: var(--brass); }
.tt .btn-primary { background: var(--brass); color: #1b1408; border-color: var(--brass); font-weight: 600; }
.tt .ico { width: 16px; height: 16px; flex: none; }

.tt-transport { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.tt-play { min-width: 120px; justify-content: center; }
.tt-tempo { display: flex; flex-direction: column; gap: 5px; flex: 1 1 180px; }
.tt-tempo input { accent-color: var(--brass); width: 100%; }
.tt-rep { flex: 0 1 120px; }
.tt-out { flex: 1 1 190px; }

.tt-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.tt-key { margin: 0; font: 600 clamp(24px, 4vw, 32px) / 1.1 var(--font-display); }
.tt-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tt-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px 12px; text-align: left; cursor: pointer;
  font: inherit; color: var(--ink); background: var(--bg-2); border: 1px solid var(--panel-border); border-radius: 12px; transition: border-color 0.15s; }
.tt-card:hover { border-color: rgba(217, 164, 65, 0.5); }
.tt-card.on { border-color: var(--brass); background: linear-gradient(rgba(217, 164, 65, 0.12), rgba(217, 164, 65, 0.02)), var(--bg-2); }
.tt-sym { font: 600 24px/1.1 var(--font-display); color: var(--ivory); }
.tt-roman { font-size: 12px; color: var(--ink-2); }
.tt-notes { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; }
.tt-notes > span { display: inline-flex; flex-direction: column; align-items: center; min-width: 2ch; }
.tt-notes b { font-size: 16px; }
.tt-notes small { font-size: 11px; color: var(--brass-2); }
.tt-tension b { color: var(--ink-2); }
.tt-hide .tt-notes, .tt-hide .tt-staff .nh, .tt-hide .tt-staff .acc, .tt-hide .tt-staff .stem, .tt-hide .tt-staff .beam, .tt-hide .tt-staff .lg { visibility: hidden; }

/* portée : fond ivoire pour qu'elle se lise comme une partition */
.tt-staff { overflow-x: auto; margin: 14px 0 10px; background: var(--ivory); border-radius: 10px; padding: 6px 0; color: #15161b; }
.tt-staff svg { display: block; max-width: 100%; min-width: 560px; height: auto; margin: 0 auto; } /* sur téléphone, la portée défile plutôt que de rapetisser */
.tt-staff .st { stroke: #15161b; stroke-width: 1; opacity: 0.75; }
.tt-staff .bl, .tt-staff .stem, .tt-staff .lg { stroke: #15161b; stroke-width: 1.2; }
.tt-staff .beam { fill: #15161b; }
.tt-staff .clef { font: 66px "Bravura", "Noto Music", "Apple Symbols", "Segoe UI Symbol", serif; fill: #15161b; }
.tt-staff .clef.fa { font-size: 46px; }
.tt-staff .acc { font: 15px "Noto Music", "Apple Symbols", "Segoe UI Symbol", serif; fill: #15161b; position: static; }
.tt-staff .cs { font: 600 20px var(--font-display); fill: #15161b; }
.tt-staff .nh { fill: #15161b; stroke: #15161b; stroke-width: 1.4; }
.tt-staff .nh.open { fill: var(--ivory); }
.tt-staff .nh.play { fill: #b9781a; stroke: #b9781a; }
.tt-staff .bar-bg { fill: transparent; }
.tt-staff g.on .bar-bg { fill: rgba(217, 164, 65, 0.22); }
.tt-staff g.on .cs { fill: #9a6210; }

/* clavier : 4 octaves (C2 à C6), la basse en violet, les notes de l'accord en laiton avec leur degré */
.tt-kb { overflow-x: auto; }
.tt-kb-in { position: relative; height: 120px; min-width: 620px; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.tt-k { position: absolute; top: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; cursor: pointer; border-radius: 0 0 4px 4px; }
.tt-k.w { height: 100%; background: var(--ivory); border: 1px solid var(--ivory-shade); z-index: 1; }
.tt-k.b { height: 62%; background: var(--ebony); border: 1px solid #000; z-index: 2; }
.tt-k i { font: normal 700 11px var(--font-body); margin-bottom: 6px; color: #1b1408; }
.tt-k em { position: absolute; bottom: 3px; font: normal 10px var(--font-body); color: var(--ink-3); }
.tt-k.on { background: var(--brass); border-color: var(--brass); }
.tt-k.w.on em { color: #1b1408; }
.tt-k.bass { background: var(--bass); border-color: var(--bass); }
.tt-k.hit { box-shadow: inset 0 -8px 0 rgba(255, 255, 255, 0.55), 0 0 0 2px var(--brass-2); }

.tt-route { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tt-route button { font: 500 15px var(--font-body); min-width: 46px; padding: 5px 8px; cursor: pointer; color: var(--ink); background: var(--bg-2); border: 1px solid var(--panel-border); border-radius: 10px; }
.tt-route button[aria-current] { background: var(--brass); border-color: var(--brass); color: #1b1408; }

.tt-note { color: var(--ink-2); font-size: 14px; margin: 0; }
