/* Mise en page commune des écrans d'exercice du Mode libre (colonnes, cartes, barre du bas). */
/* Écran d'exercice : pleine largeur, barre du bas collée en bas de l'écran. */
.ecran {
  min-height: calc(100vh - var(--barre-hauteur));
  display: flex;
  flex-direction: column;
}

/* Le fil d'Ariane des écrans est dans la barre du haut (Layout/PageTrail) : un peu d'air au-dessus des colonnes. */
.ecran > .colonnes:first-child, .ecran > .onglets-exercices:first-child { padding-top: 14px; }

.colonnes {
  flex: 1;
  padding: 10px 24px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: flex-start;
}

.gauche { flex: 1 1 400px; max-width: 430px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.droite { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }

/*
  Deux colonnes côte à côte : la colonne de gauche (consigne, notes, rythme…) reste à l'écran, collée sous le
  bandeau ; seule la colonne de droite (manche, partition) défile avec la page. Si la gauche est plus haute que
  l'écran, elle défile dans sa propre zone. La place gardée en bas suit l'affichage du métronome.
*/
@media (min-width: 1000px) {
  .ecran { --reserve-bas: 96px; }
  .ecran:has(.metro-carte:not(.libre)) { --reserve-bas: 290px; }
  .ecran:has(.metro-focus:not(.libre)) { --reserve-bas: 230px; }
  .colonnes:not(.solution-cachee) > .gauche {
    position: sticky;
    top: calc(var(--barre-visible) + var(--bande-routine) + 10px);
    max-height: calc(100vh - var(--barre-visible) - var(--bande-routine) - var(--reserve-bas));
    transition: top .25s ease, max-height .25s ease;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    /* padding-top à 0 : le haut de la colonne tombe au niveau du premier élément de la colonne de droite (mesuré). */
    padding: 0 8px 10px;
    margin: -30px -8px 0;
  }
}

.carte { padding: 2px 4px 4px; }
.entete-carte { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-bottom: 4px; }
.libelle { font-weight: 600; }
.aide { font-weight: 400; color: var(--encre-douce); }

.legende { display: flex; flex-wrap: wrap; gap: 14px; font-size: .85rem; color: var(--encre-douce); }
.legende span { display: inline-flex; align-items: center; gap: 6px; }
.pastille-legende { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 1.5px solid #8a7d68; background: var(--papier); }
.pastille-legende.tonique { background: var(--encre); border-color: var(--encre); }
.pastille-legende.caracteristique { background: #c8955a; border-color: #8a5a2a; }
.pastille-legende.en-cours { border: 3px solid var(--rouge-jeu); }

/* Barre du bas : crème translucide, comme le bandeau du haut. */
.barre-bas {
  position: sticky;
  bottom: 0;
  z-index: 10;
  padding: 8px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  background: rgba(255, 250, 240, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.groupe-gauche, .groupe-droit { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.pastille-commande {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px 6px;
  border-radius: 16px;
  background: rgba(243, 234, 211, .9);
}

.battements { display: flex; align-items: center; gap: 7px; padding: 0 8px 0 4px; }

.point-metro {
  width: 15px;
  height: 15px;
  display: block;
  opacity: .28;
  background: url("../img/point.webp") center / 100% 100% no-repeat;
}

.point-metro.premier { width: 19px; height: 19px; }

/* Plus de 4 clics par mesure : des points plus petits, pour garder la même largeur. */
.battements.serres { gap: 3px; padding: 0 6px 0 2px; }
.battements.serres .point-metro { width: 10px; height: 10px; }
.battements.serres .point-metro.premier { width: 13px; height: 13px; }

/* Plus de 8 clics (12/8, 16/16…) : deux lignes, groupées par pulsation dans les mesures composées. */
.battements.deux-lignes {
  display: grid;
  grid-template-columns: repeat(var(--cols), auto);
  align-items: center;
  justify-items: center;
  column-gap: 3px;
  row-gap: 4px;
  padding: 0 6px 0 2px;
}
.battements.deux-lignes .point-metro { width: 8px; height: 8px; }
.battements.deux-lignes .point-metro.appui { width: 10px; height: 10px; }
.battements.deux-lignes .point-metro.premier { width: 12px; height: 12px; }
.battements .point-metro.appui { opacity: .45; }
.battements .point-metro.fin-groupe { margin-right: 5px; }

/* Clic en cours, posé par le moteur audio (bleu pendant le décompte). */
.point-metro.battement {
  opacity: 1;
  background: var(--rouge-jeu);
  -webkit-mask: url("../img/point.webp") center / 100% 100% no-repeat;
  mask: url("../img/point.webp") center / 100% 100% no-repeat;
}
.battements.decompte .point-metro.battement { background: var(--bleu-nuit); }

/* -------------------------------------------------------------------------
   Métronome détaché : la grande carte de l'original, à cheval sur la barre du bas.
   Une place vide de la largeur de la carte dans la barre (l'accompagnement se range à côté) ;
   la carte y est posée en absolu et dépasse vers le haut. Mesures internes en cqw, comme l'original.
   ------------------------------------------------------------------------- */
.barre-bas { --metro-largeur: 340px; }
.metro-place { position: relative; width: var(--metro-largeur); align-self: stretch; min-height: 40px; }
/* Carte détachée (refaite le 26/11) : le cadre papier du site (.cadre), posée sur la barre et qui dépasse vers le haut. */
.metro-carte {
  position: absolute;
  left: 0;
  bottom: -6px;
  width: var(--metro-largeur);
  box-sizing: border-box;
  padding: 2px 4px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.metro-carte button { border: 0; padding: 0; background: none; color: inherit; cursor: pointer; font: inherit; }

/* Ligne du haut : ▶ / ■, − tempo +, mesure. */
.metro-carte .mc-haut { display: flex; align-items: center; gap: 8px; }
.metro-carte .mc-play {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bleu-nuit);
  color: #f1e6cf;
  transition: transform .12s, background .12s;
}
.metro-carte .mc-play:hover { transform: scale(1.05); }
.metro-carte.en-marche .mc-play { background: var(--rouille); }
.metro-carte .mc-play .mud-icon-root { font-size: 30px; }
.metro-carte .mc-pas {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--encre-douce);
  color: var(--encre);
  touch-action: none;
}
.metro-carte .mc-pas:hover { background: rgba(29, 26, 22, .07); }
.metro-carte .mc-tempo { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.metro-carte .mc-bpm { font-size: 46px; line-height: 1; font-variant-numeric: tabular-nums; cursor: ns-resize; touch-action: none; padding: 0 4px; border-radius: 8px; }
.metro-carte .mc-bpm:hover { background: rgba(29, 26, 22, .05); }
.metro-carte .mc-nom { font-family: var(--police-texte); font-size: .78rem; color: var(--encre-douce); white-space: nowrap; }
.metro-carte .mc-nom em { font-family: var(--police-titre); font-size: .95rem; color: var(--rouille); }
.metro-carte .mc-mesure { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; font-size: 22px; line-height: .9; padding: 2px 0 2px 10px; border-left: 1px dashed var(--pointille); }

/* Les temps numérotés : le 1 cerclé de rouille, le temps joué en bleu nuit (classe battement posée par audio.js). */
.metro-carte .mc-temps { display: flex; align-items: center; justify-content: space-around; gap: 4px; padding: 2px 4px; }
.metro-carte .mc-temps-n {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(93, 81, 66, .45);
  color: var(--encre-douce);
  font-family: var(--police-texte);
  font-weight: 600;
  font-size: .9rem;
  transition: transform .06s, background .06s;
}
.metro-carte .mc-temps-n.premier { border-color: var(--rouille); color: var(--rouille); }
.metro-carte .mc-temps-n.battement { background: var(--bleu-nuit); border-color: var(--bleu-nuit); color: #f1e6cf; transform: scale(1.15); }
.metro-carte .mc-temps.decompte .mc-temps-n.battement { background: #8a9aa6; border-color: #8a9aa6; }
/* Mesure composée : les croches entre les pulsations, en petits points. */
.metro-carte .mc-temps-n.sous { width: 12px; height: 12px; border-width: 1.5px; }
.metro-carte .mc-temps.serres .mc-temps-n:not(.sous) { width: 28px; height: 28px; font-size: .8rem; }

/* Suivi de la pratique : mesure, temps écoulé, prochain palier ; la jauge se remplit avant chaque palier. */
.metro-carte .mc-suivi { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 10px; font-family: var(--police-texte); font-size: .8rem; color: var(--encre-douce); }
.metro-carte .mc-suivi > span { display: inline-flex; align-items: center; gap: 3px; }
.metro-carte .mc-suivi .mud-icon-root { font-size: 15px; }
.metro-carte .mc-suivi b { color: var(--encre); font-variant-numeric: tabular-nums; }
.metro-carte .mc-progression { color: #4f6f3a; }
.metro-carte:not(.en-marche) .mc-suivi { opacity: .6; }
.metro-carte .mc-jauge { height: 4px; border-radius: 2px; background: rgba(93, 81, 66, .15); overflow: hidden; }
.metro-carte .mc-jauge > div { height: 100%; width: 0; background: #4f6f3a; transition: width .3s; }

/* Bas : puces (décompte, accent sur 1, tap) et icônes. */
.metro-carte .mc-bas { display: flex; align-items: center; gap: 2px; padding-top: 6px; border-top: 1.5px dashed var(--pointille); }
.metro-carte .mc-bas .mud-icon-button { padding: 4px; }
.metro-carte .mc-puce {
  padding: 4px 7px;
  border: 1px solid rgba(172, 167, 118, .9);
  border-radius: 14px;
  font-family: var(--police-texte);
  font-size: .76rem;
  color: var(--encre);
  white-space: nowrap;
}
.metro-carte .mc-puce:hover { background: rgba(29, 26, 22, .06); }
.metro-carte .mc-puce.active { background: url("../img/option.webp") center / 100% 100% no-repeat; border-color: transparent; color: var(--bleu-nuit); font-weight: 600; }
.metro-carte .mc-tap { touch-action: none; }
.metro-carte .mc-tap.tape { animation: tape .25s; }
@keyframes tape { from { background: rgba(31, 52, 64, .25); } to { background: transparent; } }

.metro-play-zone { position: absolute; left: 40%; width: 20%; top: -15%; }
.metro-play {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background: url("../img/play.webp") center / contain no-repeat !important;
  transition: transform .12s;
}
.metro-play.stop { background-image: url("../img/stop.webp") !important; }
.metro-play:hover { transform: scale(1.06); }

.metro-mesure-zone { position: absolute; left: 6%; top: 25%; }
.metro-mesure { display: flex !important; flex-direction: column; align-items: center; line-height: .9 !important; font-size: 10cqw !important; }

.metro-tempo { position: absolute; left: 21%; width: 56%; top: 22%; display: flex; align-items: center; justify-content: center; gap: 2cqw; }
.metro-bpm { font-size: 17cqw; line-height: 1; min-width: 2.2ch; text-align: center; font-variant-numeric: tabular-nums; }
.metro-moins, .metro-plus { width: 8cqw; aspect-ratio: 1; background: url("../img/moins.webp") center / contain no-repeat !important; opacity: .8; }
.metro-plus { background-image: url("../img/plus.webp") !important; }
.metro-moins:hover, .metro-plus:hover { opacity: 1; }
.metro-unite { position: absolute; left: 21%; width: 56%; top: 61%; text-align: center; font-style: italic; font-size: 4.6cqw; color: var(--encre-douce); }
.metro-progression { font-style: normal; font-weight: 700; color: var(--bleu-nuit); margin-left: 1.5cqw; }

.metro-points {
  position: absolute;
  right: 5%;
  top: 12%;
  width: 17%;
  height: 64%;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  align-content: center;
  justify-items: center;
  gap: 1.6cqw 1cqw;
}
.metro-points .point-metro { width: min(100%, 5.4cqw); height: auto; aspect-ratio: 1; }
.metro-points .point-metro.premier { grid-column: 1 / -1; width: 9cqw; }
.metro-points .point-metro.appui { opacity: .5; }
/* Mesure composée : une ligne par pulsation, son premier clic marqué (pas de point à part). */
.metro-points.compose .point-metro.premier { grid-column: auto; width: min(100%, 5.4cqw); }
.metro-points.decompte .point-metro.battement { background: var(--bleu-nuit); }

.metro-bas { position: absolute; left: 6%; right: 4%; bottom: 4%; display: flex; align-items: center; gap: 2px; }
.metro-espace { flex: 1; }
.metro-decompte { font-size: 4.8cqw !important; color: var(--rouille) !important; }
.metro-decompte:hover { text-decoration: underline; }
/* -------------------------------------------------------------------------
   Focus tempo : encore plus grand, sur une seule ligne, posé juste au-dessus de la barre du bas.
   Il ne réserve pas de place dans la barre. Les règles de la carte (positions en cqw) sont neutralisées.
   ------------------------------------------------------------------------- */
.metro-place:has(.metro-focus) { width: 0; }
.metro-focus {
  position: absolute;
  left: 0;
  bottom: calc(100% + 16px);
  width: max-content;
  max-width: calc(100vw - 40px);
  box-sizing: border-box;
  padding: 2px 6px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.metro-focus button { border: 0; padding: 0; background: none; color: inherit; cursor: pointer; font: inherit; }
.metro-focus .metro-play { width: 76px; flex-shrink: 0; }
.metro-focus .metro-mesure { font-size: 2.3rem !important; }
.metro-focus .metro-tempo { position: static; width: auto; display: grid; grid-template-columns: auto auto auto; align-items: center; column-gap: 10px; }
.metro-focus .metro-bpm { font-size: 4.6rem; }
.metro-focus .metro-moins, .metro-focus .metro-plus { width: 34px; }
.metro-focus .metro-unite { position: static; width: auto; grid-column: 1 / -1; margin-top: -6px; font-size: .95rem; }
.metro-focus .metro-progression { margin-left: 8px; }

/* Les points, tous sur une ligne : très gros jusqu'à 4 clics, plus petits au-delà. */
.metro-points-ligne { display: flex; align-items: center; gap: 14px; padding: 0 4px; }
.metro-points-ligne .point-metro { width: 46px; height: 46px; }
.metro-points-ligne .point-metro.premier { width: 58px; height: 58px; }
.metro-points-ligne.moyens { gap: 9px; }
.metro-points-ligne.moyens .point-metro { width: 32px; height: 32px; }
.metro-points-ligne.moyens .point-metro.premier { width: 40px; height: 40px; }
.metro-points-ligne.petits { gap: 5px; }
.metro-points-ligne.petits .point-metro { width: 21px; height: 21px; }
.metro-points-ligne.petits .point-metro.appui { width: 26px; height: 26px; }
.metro-points-ligne.petits .point-metro.premier { width: 30px; height: 30px; }
.metro-points-ligne .point-metro.appui { opacity: .5; }
.metro-points-ligne .point-metro.fin-groupe { margin-right: 12px; }
.metro-points-ligne.decompte .point-metro.battement { background: var(--bleu-nuit); }

.metro-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.metro-boutons { display: flex; }
.metro-focus .metro-decompte { font-size: 1rem !important; color: var(--rouille) !important; white-space: nowrap; }
.metro-focus .metro-decompte:hover { text-decoration: underline; }

/* -------------------------------------------------------------------------
   Carte détachée et focus tempo : déplaçables (js/metronome-drag.js), on les attrape partout sauf sur leurs boutons.
   ------------------------------------------------------------------------- */
.metro-carte .panneau, .metro-focus .panneau { left: 0; touch-action: auto; cursor: auto; max-height: min(70vh, var(--panneau-max, 70vh)); }
.metro-carte, .metro-focus { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.metro-carte button, .metro-focus button { cursor: pointer; }
.metro-carte.deplacement, .metro-focus.deplacement { cursor: grabbing; filter: drop-shadow(0 8px 16px rgba(40, 30, 15, .35)); }
.metro-carte.libre, .metro-focus.libre { bottom: auto; z-index: 30; }
/* Libre, la carte ne réserve plus de place dans la barre. */
.metro-place:has(.metro-carte.libre) { width: 0; }
/* Le panneau de réglages s'ouvre du côté où il y a de la place. */
.metro-carte.panneau-bas .panneau, .metro-focus.panneau-bas .panneau { bottom: auto; top: calc(100% + 10px); }
.metro-carte.panneau-droite .panneau, .metro-focus.panneau-droite .panneau { left: auto; right: 0; }

/* La page garde de la place en bas pour la carte à sa place (pas quand elle est déplacée). */
.ecran:has(.metro-carte:not(.libre)) .colonnes { padding-bottom: 210px; }
.ecran:has(.metro-focus:not(.libre)) .colonnes { padding-bottom: 150px; }

/* Tablette : une carte plus petite, un focus tempo un peu moins grand. */
@media (max-width: 1100px) {
  .barre-bas { --metro-largeur: 330px; }
  .ecran:has(.metro-carte:not(.libre)) .colonnes { padding-bottom: 200px; }
  .metro-focus { gap: 14px; }
  .metro-focus .metro-play { width: 60px; }
  .metro-focus .metro-bpm { font-size: 3.6rem; }
  .metro-points-ligne .point-metro { width: 36px; height: 36px; }
  .metro-points-ligne .point-metro.premier { width: 46px; height: 46px; }
}

.tempo { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 64px; text-align: center; }
.progression { padding: 1px 8px; border-radius: 8px; background: #dfe8ec; color: var(--bleu-nuit); font-size: .8rem; font-weight: 700; }
/* Lu par les lecteurs d'écran, invisible à l'écran. */
.lecteur-ecran { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Barre du bas : boutons secondaires et « ⋯ ». Sur grand écran, tout est dans la barre et « ⋯ » est caché. */
.secondaire, .secondaires-droite { display: inline-flex; align-items: center; gap: 10px; }
.barre-bas .bouton-plus { display: none; }
.bouton-demarrer { display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.bouton-demarrer .icone-demarrer { display: none; }

/*
  Petit écran : seuls restent le métronome compact, Écouter et Démarrer (icône ▶ seule) ; les boutons secondaires
  (accompagnement, témoin MIDI, boutons du module, Réussi) apparaissent sur une 2ᵉ rangée quand on ouvre « ⋯ ».
*/
@media (max-width: 760px) {
  .barre-bas { padding: 6px 10px; gap: 6px 10px; }
  .barre-bas .bouton-plus { display: inline-flex; }
  .barre-bas .secondaire, .barre-bas .secondaires-droite { display: none; }
  .barre-bas.plus-ouvert .secondaire, .barre-bas.plus-ouvert .secondaires-droite { display: inline-flex; }
  .bouton-demarrer { min-width: 56px; padding-left: 14px; padding-right: 14px; }
  .bouton-demarrer .icone-demarrer { display: inline-flex; }
  .bouton-demarrer .texte-demarrer { display: none; }
}
/* Témoin du pédalier MIDI : vert sauge quand un appareil est branché, estompé sinon. */
.temoin-midi.branche { color: #5f7d4e; }
.temoin-midi.absent { color: var(--encre-douce); opacity: .5; }
.temoin-midi-zone { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; }
.temoin-midi-zone.recu { animation: midi-recu .6s ease-out; }
@keyframes midi-recu { from { background: rgba(95, 125, 78, .32); box-shadow: 0 0 0 4px rgba(95, 125, 78, .15); } to { background: transparent; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .temoin-midi-zone.recu { animation: none; background: rgba(95, 125, 78, .2); } }

/* Panneau ouvert depuis la droite de la barre du bas (ex. volumes de la batterie) : il s'aligne sur la droite. */
.ancre-panneau { position: relative; display: inline-flex; }
.ancre-panneau .panneau { left: auto; right: 0; width: 380px; }
.panneau-mixage dt { display: flex; align-items: center; gap: 2px; font-weight: 600; white-space: nowrap; }
.panneau-mixage dd { display: flex; align-items: center; gap: 10px; }
.panneau-mixage .pourcent { min-width: 52px; text-align: right; font-variant-numeric: tabular-nums; color: var(--encre-douce); font-size: .9rem; }

.aide-raccourcis { position: fixed; right: 24px; bottom: 90px; z-index: 25; }
.aide-raccourcis .panneau { position: static; }
.pedale-aide { margin-left: 8px; padding: 0 6px; border-radius: 6px; background: #e4ead9; color: #3f5a33; font-size: .8rem; white-space: nowrap; }

/* Module Accords : doigtés côte à côte (tiré, barré), message tant que la réponse est cachée. */
.diagrammes { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 28px; padding: 4px 0 2px; }
.reponse-cachee { margin: 12px 0 10px; text-align: center; }
/* Verdict d'un doigté posé sur le diagramme (Accords, Renversements, Conduite de voix). */
.verdict-doigte { margin: 6px 0 4px; text-align: center; font-weight: 700; }
.verdict-doigte.juste { color: #4f7a3f; }
.verdict-doigte.faux { color: #c0281e; }

/* Module Renversements : notes de l'accord, réponse (cases et doigté) et bouton « Voir la réponse ». */
.tache-renversement { display: flex; flex-direction: column; gap: 6px; padding: 4px 6px 2px; }
.tache-renversement .notes-accord { color: var(--encre-douce); }
.tache-renversement .reponse { font-weight: 700; color: var(--rouille); letter-spacing: .03em; }
.tache-renversement .action { display: flex; justify-content: flex-end; }

/* Module Conduite de voix : la suite d'accords (chiffre romain, nom, déplacement après la réponse). */
.suite-accords { display: flex; flex-direction: column; gap: 8px; padding: 4px 6px 2px; }
.suite-accords .suite { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.suite-accords .fleche { color: var(--encre-douce); }
.accord-suite {
  display: flex; flex-direction: column; align-items: center; min-width: 64px; padding: 6px 8px 4px;
  border-radius: 10px; background: var(--papier-2); border: 2px solid transparent; transition: transform .08s;
}
.accord-suite .romain { font-weight: 700; font-size: .8rem; color: var(--rouille); }
.accord-suite .nom { font-size: 1.2rem; line-height: 1.1; }
.accord-suite .deplacement { font-size: .72rem; color: var(--encre-douce); white-space: nowrap; }
.accord-suite.en-cours { border-color: var(--rouge-jeu); transform: scale(1.06); }
.suite-accords .total { font-weight: 600; color: var(--rouille); }
.suite-accords .action { display: flex; justify-content: flex-end; }

/* Module Progressions : une carte par degré (cachée puis révélée), doigtés à trouver. */
.grille-progression { display: flex; flex-direction: column; gap: 8px; padding: 4px 6px 2px; }
.grille-progression .grille { display: grid; gap: 8px; }
.carte-degre {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px 8px;
  border-radius: 12px; border: 2px solid transparent; background: var(--papier-2); color: var(--encre);
  font: inherit; cursor: pointer; transition: transform .08s;
}
.carte-degre:hover { border-color: var(--pointille); }
.carte-degre .degre { font-size: 1.7rem; line-height: 1; }
.carte-degre .nom { font-weight: 700; color: var(--encre-douce); min-height: 1.3em; }
.carte-degre.vu { background: #eef3e2; }
.carte-degre.vu .nom { color: var(--rouille); }
.carte-degre.emprunt { border-style: dashed; border-color: #8a5a2a; }
.carte-degre .etiquette-emprunt { font-size: .68rem; font-weight: 700; color: #8a5a2a; text-transform: uppercase; letter-spacing: .04em; }
.carte-degre.en-cours { border-color: var(--rouge-jeu); border-style: solid; transform: scale(1.06); }
.grille-progression .action { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.diagramme-cache {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 140px; height: 190px; border: 2px dashed var(--pointille); border-radius: 14px; color: var(--encre-douce);
}
.diagramme-cache .titre { font-size: 2rem; color: var(--encre); }
.diagramme-cache.en-cours { border-color: var(--rouge-jeu); }

/* Module Licks : la progression (un accord par mesure ; les accords de la cadence soulignés). */
.progression-lick { display: flex; flex-direction: column; gap: 6px; padding: 4px 6px 4px; }
.progression-lick .titre-carte { font-weight: 600; }
.progression-lick .cle-bloc { font-family: var(--police-titre); font-size: 1.05rem; color: var(--rouille); }
.accords-lick { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.accord-lick {
  display: flex; flex-direction: column; align-items: center; padding: 6px 4px 4px; border-radius: 10px;
  background: var(--papier-2); border: 2px solid transparent; transition: transform .08s;
}
.accord-lick .romain { font-weight: 700; font-size: .8rem; color: var(--encre-douce); }
.accord-lick .nom { font-size: 1.15rem; line-height: 1.1; }
.accord-lick.cadence { border-bottom-color: var(--rouille); }
.accord-lick.en-cours { border-color: var(--rouge-jeu); transform: scale(1.06); }
.progression-lick .aide { color: var(--encre-douce); font-size: .9rem; }

/* Module Rythme : les figures sorties au tirage, et la caisse claire pendant la pratique. */
.figures-rythme { display: flex; flex-direction: column; gap: 4px; padding: 4px 8px 4px; }
.figures-rythme .titre-carte { font-weight: 600; }
.figures-rythme ul { margin: 0; padding-left: 18px; color: var(--encre-douce); }

/* Module Batterie : la cymbale du rythme, les figures et les éléments joués (tête ronde ou croix). */
.legende-batterie { display: flex; flex-direction: column; gap: 4px; padding: 4px 8px 6px; }
.legende-batterie .titre-carte { font-weight: 600; }
.legende-batterie .aide { color: var(--encre-douce); font-size: .88rem; }
.legende-batterie .elements { margin: 2px 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 12px; }
.legende-batterie .tete-legende { display: inline-block; width: 18px; color: var(--encre); }

/* Gammes : tant que la solution est cachée, la colonne de la consigne est seule, au centre. */
.colonnes.solution-cachee { justify-content: center; }
.colonnes.solution-cachee .gauche { flex: 0 1 560px; max-width: 560px; }
.bouton-solution { display: flex; justify-content: center; }

/* Apparition de la solution : le manche et la partition arrivent en fondu, en glissant un peu depuis la droite,
   juste après le déplacement de la colonne de consigne (animée en JavaScript, voir js/layout.js). */
.droite.apparition { animation: apparition-solution .55s .1s both cubic-bezier(.2, .75, .25, 1); }
@keyframes apparition-solution {
  from { opacity: 0; transform: translateX(32px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .droite.apparition { animation: none; }
}

/* Quiz et Ear training : onglets (thèmes) au-dessus du plateau de question, centré. */
.page-quiz { max-width: 860px; margin: 0 auto; padding: 8px 16px 24px; display: flex; flex-direction: column; gap: 12px; }
.onglets-quiz { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.onglets-quiz .onglet {
  padding: 6px 14px; border-radius: 16px; color: var(--encre); text-decoration: none; font-weight: 600;
  background: rgba(255, 250, 240, .78);
}
.onglets-quiz .onglet:hover { background: var(--papier); }

/* Gammes : une carte par position (manche puis notation). */
.position-gamme .entete-notation { margin-top: 10px; }
/* Bouton secondaire très discret (ex. export PDF dans l'en-tête d'une carte). */
.bouton-discret { opacity: .55; }
.bouton-discret:hover, .bouton-discret:focus-visible { opacity: 1; }

/* Exercices de dextérité : onglets des exercices sous le fil d'Ariane, réglages dans la colonne de gauche. */
.onglets-exercices { padding: 6px 20px 0; }
.onglets-exercices .onglet { border: none; font: inherit; font-weight: 600; cursor: pointer; }
.reglages-dexterite { display: flex; flex-direction: column; gap: 4px; padding: 6px 10px 8px; }
.reglages-dexterite .ligne-ordre { display: flex; align-items: center; gap: 4px; }
.ordres-par-corde { margin: 4px 0 0; padding-left: 18px; columns: 2; font-weight: 600; letter-spacing: .04em; }
.ordres-par-corde .aide { font-weight: 400; letter-spacing: 0; }

/* Gammes : une seule carte, un onglet par position (tonique sur la 6ᵉ, sur la 5ᵉ corde), « Comparer » à droite. */
.entete-positions { flex-wrap: wrap; row-gap: 4px; }
.onglets-positions { display: inline-flex; gap: 4px; }
.onglet-position {
  padding: 3px 12px; border: 1.5px dashed var(--pointille); border-radius: 14px; background: transparent;
  font: inherit; font-weight: 600; color: var(--encre-douce); cursor: pointer;
}
.onglet-position:hover { color: var(--encre); background: rgba(255, 255, 255, .45); }
.onglet-position.opt { border-color: transparent; color: #1f3440; }
.espace-entete { flex: 1; }
.interrupteur-comparer { margin: 0; }
.interrupteur-comparer .mud-typography { font-family: var(--police-texte); font-size: .9rem; }
.legende-manche { margin: 0 0 4px; }
.pastille-legende.autre-position { background: transparent; border: 2px solid var(--rouille); box-sizing: border-box; }
/* Export PDF : les cartes de chaque position, dessinées hors de l'écran le temps de la copie (print.js). */
.positions-impression { position: absolute; left: -10000px; top: 0; width: 1040px; }

/* Choix de l'affichage de la notation : des boutons-icônes serrés. */
.choix-notation { display: inline-flex; gap: 2px; padding: 2px; border: 1.5px dashed var(--pointille); border-radius: 10px; }
.choix-vue {
  display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 28px; padding: 0 6px;
  border: none; border-radius: 7px; background: transparent; color: var(--encre-douce); cursor: pointer;
  font-family: var(--police-texte); font-weight: 700; font-size: .72rem; letter-spacing: .04em;
}
.choix-vue:hover { color: var(--encre); background: rgba(255, 255, 255, .5); }
.choix-vue.actif { background: #1f3440; color: #f1e6cf; }
.choix-vue svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.choix-vue .glyphe-musique { font-family: "Noto Music", serif; font-size: 1.15rem; line-height: 1; }
.choix-vue .texte-tab small { font-size: .8rem; margin-left: 1px; }

/* -------------------------------------------------------------------------
   « Mon rythme » (essai) : écoute de la guitare, notes colorées selon leur justesse rythmique (js/rhythm.js).
   Vert = à l'heure, bleu = en avance, ambre = en retard, gris barré = manquée ; légende dans la carte.
   ------------------------------------------------------------------------- */
.coach-rythme { display: flex; flex-direction: column; gap: 8px; padding: 6px 12px 12px; }
.coach-rythme .alerte { color: var(--rouille); }
.coach-rythme .appel { color: var(--rouille); font-size: 1.1rem; }
.ligne-coach { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vumetre { flex: 1; min-width: 90px; height: 8px; border-radius: 4px; background: rgba(29, 26, 22, .1); overflow: hidden; }
.vumetre span { display: block; height: 100%; width: 0; background: #5f7d4e; transition: width .06s linear; }
.bilan-rythme { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; border-top: 1.5px dashed var(--pointille); }
.bilan-rythme .titre { font-size: 1.2rem; }
.bilan-rythme .conseil { color: var(--rouille); }
/* Compte à rebours du calibrage : grand chiffre, éclair à chaque clic ; en vert pendant les clics mesurés. */
.decompte-calibrage { text-align: center; font-family: var(--police-titre); font-size: 3rem; line-height: 1.1; min-height: 3.3rem; color: var(--rouille); }
.decompte-calibrage.mesure { font-size: 2rem; color: #4f7a3f; }
.decompte-calibrage.eclair { animation: eclair-clic .25s ease-out; }
@keyframes eclair-clic { from { transform: scale(1.25); opacity: .6; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .decompte-calibrage.eclair { animation: none; } }
.legende-rythme { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .85rem; color: var(--encre-douce); }
.legende-rythme span { display: inline-flex; align-items: center; gap: 5px; }
.pastille-rythme { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.pastille-rythme.juste { background: #4f7a3f; }
.pastille-rythme.avance { background: #2f6f9f; }
.pastille-rythme.retard { background: #c27a1a; }
.pastille-rythme.manquee { background: #a39a8c; }

/* Sur la partition : la tête de note ; sur la tablature : le fond du chiffre. */
.notation .note.rythme-juste .tete { fill: #4f7a3f; }
.notation .note.rythme-avance .tete { fill: #2f6f9f; }
.notation .note.rythme-retard .tete { fill: #c27a1a; }
.notation .note.rythme-manquee .tete { fill: #a39a8c; }
.notation .case.rythme-juste rect { fill: #d9e6cf; }
.notation .case.rythme-avance rect { fill: #d3e3ef; }
.notation .case.rythme-retard rect { fill: #f3dfc0; }
.notation .case.rythme-manquee rect { fill: #e4dfd7; }

/* Figure de solfège devant son nom (liste déroulante des exercices de dextérité). */
.option-figure { display: inline-flex; align-items: center; gap: 10px; }

/* Conduite de voix : « Ta suite » puis « La suite la plus économe ». */
.sous-titre-diagrammes { margin: 8px 0 0; text-align: center; font-family: var(--police-titre); font-size: 1.15rem; color: var(--encre-douce); }

/* Gammes et Séquences : « Jouer l'exercice » ou « Jouer en contexte », sous la consigne. */
.facon-jouer { display: flex; justify-content: center; }

/*
  Mode concentration (Préférences › Affichage, touche C) : la consigne est dans la barre du haut (Layout/FocusBar),
  la colonne de gauche devient le « panneau de l'exercice », rangé hors de l'écran à gauche et ouvert à la demande
  par-dessus la page (sans la bloquer) ; le manche et la partition prennent toute la largeur.
*/
.colonnes.concentration > .droite { flex: 1 1 100%; }
.colonnes.concentration > .gauche {
  position: fixed;
  z-index: 25;
  top: calc(var(--barre-hauteur) + var(--bande-routine) + 10px);
  bottom: 96px;
  left: 12px;
  width: min(410px, calc(100vw - 24px));
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 12px 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 16px;
  background: rgba(255, 250, 240, .95);
  box-shadow: 0 10px 30px rgba(29, 26, 22, .25);
  transform: translateX(calc(-100% - 30px));
  visibility: hidden;
  transition: transform .25s ease, visibility 0s linear .25s;
}

.colonnes.concentration.panneau-ouvert > .gauche {
  transform: none;
  visibility: visible;
  transition: transform .25s ease;
}

/* La consigne est déjà dans la barre du haut : pas de doublon dans le panneau. */
.colonnes.concentration > .gauche > .consigne { display: none; }

@media (prefers-reduced-motion: reduce) {
  .colonnes.concentration > .gauche { transition: none; }
}

/* Éléments vivants dans la barre de l'exercice (mode concentration) : puces et accords du contexte. */
.puces-barre { display: inline-flex; gap: 2px; padding: 2px; border-radius: 999px; background: rgba(29, 26, 22, .06); }
.puce-barre { border: 0; background: none; padding: 4px 10px; border-radius: 999px; font: 600 .82rem var(--police-texte); color: var(--encre-douce); cursor: pointer; }
.puce-barre.opt { color: var(--encre); }
.accords-barre { display: inline-flex; gap: 4px; }
.accord-barre { padding: 3px 8px; border-radius: 8px; background: var(--papier-2); border: 2px solid transparent; font-size: .9rem; white-space: nowrap; transition: transform .08s; }
.accord-barre b { color: var(--rouille); font-size: .78rem; margin-right: 2px; }
.accord-barre.en-cours { border-color: var(--rouge-jeu); background: #fbe6bd; transform: scale(1.06); }
/* Le choix « Jouer l'exercice / en contexte » est dans la barre du haut : pas de doublon dans le panneau.
   Sous 1000 px, la barre n'a pas la place : le choix reste dans le panneau. */
@media (min-width: 1001px) {
  .colonnes.concentration > .gauche > .facon-jouer { display: none; }
}

@media (max-width: 1000px) {
  .barre-exercice .puces-barre { display: none; }
}
/* Barre moins large : les chiffres romains seuls (le nom de l'accord est dans l'info-bulle et dans le panneau). */
@media (max-width: 1280px) {
  .accord-barre .nom-accord { display: none; }
}
