/* Mathautomatix — espace « En classe » (piste A, fond lavande clair, fort contraste). */

/* ───────────── Catalogue ───────────── */

.classe { display: flex; flex-direction: column; gap: 1.25rem; padding-block-end: 2rem; }
.classe__entete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.classe__entete .titre-page { margin-block: 0.5rem; color: var(--violet); }
.classe__personnages { display: flex; align-items: flex-end; gap: 0.25rem; }
.classe__personnages .personnage { width: 4.25rem; height: auto; }
.classe__personnages .personnage--tri { rotate: 8deg; }
.classe__personnages .personnage--carre { rotate: -8deg; }

.classe__colonnes { display: grid; gap: 1.5rem; align-items: start; }
@media (min-width: 62rem) {
  .classe__colonnes { grid-template-columns: minmax(0, 1fr) 23rem; }
  .classe__serie { position: sticky; top: 1rem; }
}
.classe__catalogue { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }

.filtres { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem 1.25rem; }
.filtres__ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; }
.filtres__nom { min-width: 5.5rem; font-family: var(--police-titre); font-weight: 800; font-size: 1.125rem; color: var(--violet); }
.page--clair .pastille--claire[aria-pressed="true"] { color: var(--violet); background: var(--soleil); border-color: var(--violet); }

.liste-auto { display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
@media (min-width: 44rem) { .liste-auto { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; } }

.auto-carte {
  display: flex; flex-direction: column; height: 100%;
  background: var(--blanc);
  border: 3px solid var(--lavande-trait);
  border-radius: var(--rayon-carte);
  box-shadow: 0 6px 0 var(--lavande-trait);
  transition: border-color var(--duree) ease, box-shadow var(--duree) ease;
}
.auto-carte--choisie { border-color: var(--violet); box-shadow: 0 6px 0 var(--violet-fonce); }
.auto-carte__label { display: flex; align-items: flex-start; gap: 0.875rem; padding: 1rem 1.125rem 0.5rem; cursor: pointer; }
.auto-carte__contenu { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; min-width: 0; }
.auto-carte__titre { font-family: var(--police-titre); font-weight: 800; font-size: 1.375rem; line-height: 1.15; color: var(--encre); }

.auto-carte__case {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0.125rem 0 0;
  width: 2rem; height: 2rem;
  background: var(--blanc);
  border: 3px solid var(--violet);
  border-radius: 10px;
  cursor: pointer;
}
.auto-carte__case:checked {
  background: var(--violet) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFD23F' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 75% no-repeat;
}

.programme { margin-top: auto; padding: 0 1.125rem 0.75rem 4rem; }
.programme summary {
  display: inline-flex; align-items: center; min-height: 2.75rem;
  font-weight: 700; color: var(--violet); cursor: pointer;
}
.programme summary:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.programme__corps { display: flex; flex-direction: column; gap: 0.75rem; padding-bottom: 0.25rem; }
.programme__ligne { padding: 0.75rem 1rem; background: var(--lavande); border-radius: var(--rayon); }
.programme__niveau { font-family: var(--police-titre); font-weight: 800; color: var(--violet); }
.programme__texte { margin-block: 0.25rem; }
.programme__source { font-size: 0.9375rem; color: var(--encre-douce); }

/* ───────────── Panneau Série ───────────── */

.classe__serie { display: flex; flex-direction: column; gap: 1rem; padding: 1.25rem; }
.classe__serie h2 { color: var(--violet); }
.serie__compte { color: var(--encre-douce); font-weight: 700; }
.serie__reglage { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; font-family: var(--police-titre); font-weight: 800; font-size: 1.125rem; }
.serie__reglage .groupe-pastilles { gap: 0.375rem; }
.serie__reglage .pastille { padding-inline: 0.875rem; font-size: 1.0625rem; }
.serie__choix { margin-inline: -0.5rem; }
.serie__aide { margin-top: -0.5rem; font-size: 0.9375rem; color: var(--encre-douce); }
.serie__actions { display: flex; flex-direction: column; gap: 0.75rem; }
.serie__partage { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.serie__partage .touche { flex: 1 1 auto; font-size: 1rem; padding-inline: 0.875rem; }
.touche--inactive { opacity: 0.55; cursor: not-allowed; }
.serie__statut { min-height: 1.5rem; font-size: 0.9375rem; font-weight: 700; color: var(--juste-encre); }

.stepper { display: inline-flex; align-items: center; gap: 0.5rem; }
.stepper__bouton {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem;
  font-family: var(--police-titre); font-weight: 800; font-size: 1.75rem; line-height: 1;
  color: var(--violet); background: var(--blanc);
  border: 3px solid var(--lavande-trait); border-radius: 16px;
  box-shadow: var(--ombre-touche);
}
.stepper__bouton:hover:not(:disabled) { border-color: var(--violet-vif); }
.stepper__bouton:disabled { opacity: 0.45; cursor: not-allowed; }
.stepper__valeur { min-width: 2.5rem; text-align: center; font-family: var(--police-titre); font-weight: 800; font-size: 1.75rem; color: var(--violet); }

.seance { display: flex; flex-direction: column; gap: 0.75rem; padding: 1rem; background: var(--lavande); border: 3px solid var(--lavande-trait); border-radius: var(--rayon-carte); }
.seance__nav { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.seance__titre { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; font-family: var(--police-titre); font-weight: 800; font-size: 1.375rem; color: var(--violet); text-align: center; }
.seance__liste { display: flex; flex-direction: column; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.seance__liste li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.25rem 0.75rem; padding: 0.5rem 0.75rem; background: var(--blanc); border-radius: 14px; }
.seance__auto { font-weight: 700; }
.seance__raison { white-space: nowrap; }
.seance__fermer { font-size: 1rem; min-height: 2.75rem; }

/* ───────────── Projection ───────────── */

body.projection-ouverte { overflow: hidden; }

.projection {
  --couleur-focus: var(--violet-vif);
  position: fixed; inset: 0; z-index: 1000;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.5rem;
  padding: clamp(0.75rem, 1.6vw, 1.75rem) clamp(1rem, 3.3vw, 3.5rem) clamp(0.75rem, 1.6vw, 1.5rem);
  color: var(--encre);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='50' fill='%235CC8FF' fill-opacity='.16'/%3E%3C/svg%3E") right 2vw bottom 14vh / 11vw no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M44 18a7 7 0 0 1 12 0l38 66a7 7 0 0 1-6 10H12a7 7 0 0 1-6-10z' fill='%23FF6B5A' fill-opacity='.12'/%3E%3C/svg%3E") left 1vw bottom 12vh / 9vw no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect x='15' y='15' width='70' height='70' rx='14' fill='%232FD4A3' fill-opacity='.14' transform='rotate(18 50 50)'/%3E%3C/svg%3E") right 26vw bottom 5vh / 7vw no-repeat,
    var(--lavande);
  overflow: hidden;
  outline: none;
}
.projection :focus-visible { outline: 5px solid var(--violet-vif); outline-offset: 3px; }

/* Barre haute */
.projection__barre { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 1rem 1.5rem; }
.projection__quitter { min-height: 3.25rem; font-size: 1.125rem; border-color: var(--violet); color: var(--violet); box-shadow: 0 4px 0 var(--lavande-trait); }
.projection__quitter svg { width: 1.125rem; height: 1.125rem; }
.projection__contexte { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.875rem; min-width: 0; }
.projection__titre { font-family: var(--police-titre); font-weight: 800; font-size: clamp(1.125rem, 1.7vw, 1.75rem); color: var(--violet); }
.projection__pas { display: flex; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.pas { width: 1.125rem; height: 1.125rem; border-radius: 50%; border: 3px solid var(--violet); background: var(--blanc); }
.pas--fait { background: var(--violet-trait); border-color: var(--violet-trait); }
.pas--courant { background: var(--soleil); border-color: var(--violet); }
.projection__outils { display: flex; align-items: center; gap: 0.625rem; }
.projection__rond {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3.25rem; height: 3.25rem; padding: 0;
  font-family: var(--police-titre); font-weight: 800; font-size: 1.5rem; line-height: 1;
  color: var(--violet); background: var(--blanc);
  border: 3px solid var(--lavande-trait); border-radius: 50%;
}
.projection__rond:hover { border-color: var(--violet-vif); }
.projection__rond svg { width: 1.5rem; height: 1.5rem; }
.chrono svg { width: 100%; height: 100%; }
.chrono { border-width: 2px; }
.chrono__piste { stroke: var(--lavande-trait); }
.chrono__anneau { stroke: var(--violet-vif); }
.chrono__chiffre { fill: var(--violet); font: 800 17px var(--police-titre); text-anchor: middle; dominant-baseline: central; }
.chrono--inactif { opacity: 0.6; }
.chrono--fini .chrono__anneau { stroke: var(--soleil-ombre); }
.chrono--fini { background: var(--soleil); }

/* Jauge du temps : trait discret en haut, sans clignotement */
.jauge-temps { position: absolute; inset: 0 0 auto; height: 8px; background: var(--lavande-trait); }
.jauge-temps__remplie { display: block; height: 100%; background: var(--violet-trait); transform-origin: left center; transition: transform 250ms linear; }
.jauge-temps--pause .jauge-temps__remplie { background: var(--lavande-trait); outline: 2px dashed var(--violet-trait); outline-offset: -2px; }
.jauge-temps--finie { background: var(--soleil); }

/* Scène */
.projection__scene { display: flex; flex-direction: column; justify-content: center; gap: clamp(0.5rem, 1.6vh, 1.25rem); min-height: 0; overflow: auto; padding-inline-end: 2vw; }
.projection__haut { display: flex; align-items: center; justify-content: space-between; gap: 2vw; }
.projection__texte { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; min-width: 0; flex: 1 1 auto; }
.enonce {
  font-family: var(--police-titre); font-weight: 800;
  font-size: max(8vw, 4rem); line-height: 1.08; letter-spacing: -0.01em;
  color: var(--encre);
  text-wrap: pretty;
}
.projection[data-longueur="moyenne"] .enonce { font-size: max(5.6vw, 2.75rem); }
.projection[data-longueur="longue"] .enonce { font-size: max(4.2vw, 2.25rem); }
.projection[data-longueur="tres-longue"] .enonce { font-size: max(3.3vw, 1.875rem); }
.projection.projection--figure .enonce { font-size: min(max(3.4vw, 2rem), 4.25rem); }
.projection.projection--figure[data-longueur="courte"] .enonce { font-size: max(5vw, 2.75rem); }
.projection--figure .visuel .notion { height: 46vh; }
.projection--figure.projection--choix .visuel .notion { height: 32vh; }
.cahier { font-size: clamp(1rem, 1.5vw, 1.5rem); padding: 0.375rem 1rem; }
.penseur { flex: none; width: 11vw; min-width: 6rem; }
/* Personnage immobile en projection : rien ne bouge sans action de l'enseignant. */
.penseur .personnage { width: 100%; height: auto; animation: none; }

.projection .fraction { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; margin-inline: 0.1em; font-size: 0.82em; line-height: 1.05; }
.projection .fraction .num { padding-inline: 0.15em; border-bottom: 0.07em solid currentColor; }
.projection .fraction .den { padding-inline: 0.15em; }
.projection .unite { font-weight: 700; }

.indice {
  align-self: flex-start; max-width: 70vw;
  padding: 0.875rem 1.5rem;
  font-family: var(--police-titre); font-weight: 700; font-size: clamp(1.25rem, 2.4vw, 2.5rem); line-height: 1.2;
  color: var(--encre); background: var(--soleil); border: 3px solid var(--encre); border-radius: var(--rayon-carte);
}

/* Les 4 choix */
.choix { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.choix__item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem;
  padding: 0.75rem 1rem;
  font-family: var(--police-titre); font-weight: 800; font-size: clamp(1.5rem, 3.4vw, 3.5rem); line-height: 1.1;
  background: var(--blanc); border: 4px solid var(--violet); border-radius: var(--rayon-carte);
  box-shadow: 0 6px 0 var(--lavande-trait);
}
.choix__lettre { display: inline-flex; align-items: center; justify-content: center; width: 1.6em; height: 1.6em; font-size: 0.7em; color: var(--blanc); background: var(--violet); border-radius: 50%; }
.choix__item--juste { background: var(--juste); border-color: var(--juste-encre); box-shadow: 0 6px 0 var(--juste-trait); }
.choix__item--juste .choix__lettre { background: var(--juste-encre); }
.choix__item--autre { opacity: 0.55; }
.choix__bon { flex-basis: 100%; font-size: clamp(0.9rem, 1.2vw, 1.25rem); font-weight: 800; color: var(--juste-encre); }
.choix__bon::before { content: "✓ "; }

/* Visuel et correction */
.projection__bas { display: flex; align-items: center; justify-content: center; gap: 3vw; min-height: 0; }
.visuel { flex: 0 1 46rem; min-width: 0; margin: 0; padding: 0.75rem 1rem; background: var(--blanc); border: 3px solid var(--lavande-trait); border-radius: var(--rayon-carte); box-shadow: 0 6px 0 var(--lavande-trait); }
.visuel .notion { width: auto; max-width: 100%; height: 33vh; margin-inline: auto; }
.projection--choix .visuel .notion { height: 22vh; }
.projection--correction .visuel { flex: 0 0 auto; max-width: 48%; }
.projection--correction .visuel .notion { height: 38vh; }

.correction { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.etape__num { align-self: flex-start; padding: 0.25rem 1rem; font-family: var(--police-titre); font-weight: 800; font-size: clamp(1rem, 1.5vw, 1.5rem); color: var(--blanc); background: var(--violet); border-radius: 999px; }
.etape__phrase { font-family: var(--police-titre); font-weight: 700; font-size: clamp(1.5rem, 3.6vw, 4rem); line-height: 1.18; color: var(--encre); }
.bilan { padding: 0.75rem 1.25rem; background: var(--juste); border: 4px solid var(--juste-encre); border-radius: var(--rayon-carte); box-shadow: 0 6px 0 var(--juste-trait); }
.bilan__titre { font-weight: 800; font-size: clamp(0.9rem, 1.2vw, 1.25rem); color: var(--juste-encre); }
.bilan__texte { font-family: var(--police-titre); font-weight: 800; font-size: clamp(1.75rem, 4.4vw, 4.75rem); line-height: 1.1; color: var(--juste-encre); }

/* En correction, l'énoncé se réduit pour laisser la place */
.projection.projection--correction .enonce { font-size: clamp(1.5rem, 2.8vw, 3.25rem); }
.projection--correction .penseur { width: 7vw; min-width: 4.5rem; }
.projection--sans-visuel .projection__bas { justify-content: flex-start; }

/* Actions */
/* Pied : reculer à gauche, action du moment au centre, avancer à droite */
.projection__actions { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 0.75rem; }
.projection__actions-gauche { display: flex; justify-content: flex-start; }
.projection__actions-centre { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.75rem; }
.projection__actions-droite { display: flex; justify-content: flex-end; }
.projection__action { display: inline-flex; align-items: center; gap: 0.5rem; }
.projection__action .fleche { width: 1.25em; height: 1.25em; flex: none; }
.projection__action:disabled { opacity: 0.45; cursor: not-allowed; }

/* Pause : bouton texte + icône, à côté du cadran du temps */
.projection__pause { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 3.25rem; padding-inline: 1.125rem; font-size: 1.125rem; border-color: var(--violet); color: var(--violet); }
.projection__pause svg { width: 1.25rem; height: 1.25rem; }
.projection__pause[aria-pressed="true"] { background: var(--soleil); }
.chrono--pause .chrono__anneau { stroke: var(--lavande-trait); }
.projection__action { min-height: 3.5rem; font-size: clamp(1rem, 1.5vw, 1.375rem); padding-inline: 1.5rem; }
.projection__action--grande { min-height: 4.25rem; font-size: clamp(1.25rem, 2vw, 1.875rem); padding-inline: 2.25rem; }
.projection__action[aria-pressed="true"] { background: var(--lilas); border-color: var(--violet); }

/* Aide clavier */
.raccourcis { display: grid; grid-template-columns: max-content 1fr; gap: 0.625rem 1.25rem; align-items: center; margin: 0; }
.raccourcis dt, .raccourcis dd { margin: 0; }
kbd {
  display: inline-block; min-width: 2.5rem; padding: 0.125rem 0.625rem; text-align: center;
  font: 800 1.0625rem var(--police-titre); color: var(--violet);
  background: var(--lavande); border: 2px solid var(--violet-trait); border-bottom-width: 4px; border-radius: 10px;
}
.dialogue--aide .dialogue__corps { min-width: min(26rem, 90vw); }

@media (max-width: 52rem) {
  .projection__barre { grid-template-columns: auto minmax(0, 1fr) auto; }
  .projection__pas { grid-column: 1 / -1; order: 5; }
  .choix { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .projection__bas { flex-direction: column; }
  .penseur { display: none; }
  .projection__actions { grid-template-columns: 1fr 1fr; }
  .projection__actions-centre { grid-column: 1 / -1; order: -1; }
}
