/* ============================================================
   LES MURS — la feuille
   ------------------------------------------------------------
   ⚠️ UN SEUL DESIGN, SIX TEINTES. Chaque outil pose `--mu-t` sur
      `<html>` : six portes se distinguent sans six feuilles a tenir.

   ⚠️ TOUT CE QUI SE PROJETTE EST EN `em`, JAMAIS EN `px` NI EN `vw`.
      Un vidéoprojecteur de classe fait 1024×768 ou 1280×720, parfois
      des proportions presque carrees. Une taille en `vw` seule
      s'effondre sur un ecran peu large mais haut : la racine mele
      donc les DEUX dimensions (§7.70).
   ============================================================ */

:root {
  --mu-t:      #7c3aed;   /* la teinte de l'outil, posee par la page */
  --mu-t-pale: #f5f3ff;
  --mu-encre:  #1a1430;
  --mu-gris:   #64748b;
  --mu-bord:   #e2e8f0;
  --mu-fond:   #fbfaff;
  --mu-carte:  #ffffff;
  --mu-vert:   #16a34a;
  --mu-ambre:  #d97706;
  --mu-rouge:  #dc2626;
  --mu-ombre:  0 1px 2px rgba(26,20,48,.06), 0 8px 24px rgba(26,20,48,.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--mu-fond);
  color: var(--mu-encre);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--mu-t); }

/* ------------------------------------------------------------
   Les boutons
   ------------------------------------------------------------
   ⚠️ `.mu-b-plein` NE PORTE PAS `width:100%`. Dans OQuiz, cette
   seule ligne a casse trois ecrans : dans un conteneur flex, le
   bouton reclame toute la largeur, le `flex-shrink` le ramene a une
   fraction, et ce qui est a cote se retrouve ecrase — un titre
   affiche un mot par ligne (§7.121). Quand il doit faire toute la
   largeur, on l'ecrit sur place avec `.mu-b-large`.
   ------------------------------------------------------------ */
.mu-b {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .45em;
  padding: .7rem 1.2rem; border-radius: 12px;
  border: 1px solid var(--mu-bord); background: #fff;
  color: var(--mu-encre); font: inherit; font-weight: 600;
  font-size: 1rem; line-height: 1.2;
  cursor: pointer;
  /* 44 px : la cible minimale qu'un doigt atteint sans viser. */
  min-height: 44px;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.mu-b:hover  { box-shadow: var(--mu-ombre); }
.mu-b:active { transform: translateY(1px); }
.mu-b:focus-visible { outline: 3px solid var(--mu-t); outline-offset: 2px; }
.mu-b[disabled] { opacity: .5; cursor: not-allowed; }

.mu-b-plein  { background: var(--mu-t); border-color: var(--mu-t); color: #fff; }
a.mu-b { text-decoration: none; }
.mu-b-large  { width: 100%; }
.mu-b-danger { border-color: #fecaca; color: var(--mu-rouge); }

/* ------------------------------------------------------------
   Les pages ordinaires (hors projection)
   ------------------------------------------------------------ */
.mu-page { max-width: 62rem; margin: 0 auto; padding: 1.2rem 1rem 4rem; }
.mu-etroit { max-width: 32rem; }

.mu-haut {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: .9rem 1rem; margin-bottom: 1.4rem;
  background: #fff; border-bottom: 1px solid var(--mu-bord);
}
.mu-marque { display: flex; align-items: center; gap: .6rem;
             font-weight: 800; font-size: 1.05rem; text-decoration: none;
             color: var(--mu-encre); }
.mu-marque span.e { font-size: 1.5rem; line-height: 1; }

.mu-carte {
  background: var(--mu-carte); border: 1px solid var(--mu-bord);
  border-radius: 18px; padding: 1.3rem; box-shadow: var(--mu-ombre);
}

h1 { font-size: 1.6rem; margin: 0 0 .4rem; line-height: 1.2; }
h2 { font-size: 1.15rem; margin: 1.6rem 0 .7rem; }
.mu-sous { color: var(--mu-gris); margin: 0 0 1.2rem; line-height: 1.5; }

label { display: block; font-weight: 600; margin: 1rem 0 .35rem; }
input[type=text], input[type=password], input[type=number],
textarea, select {
  width: 100%; padding: .75rem .9rem; font: inherit;
  border: 1px solid var(--mu-bord); border-radius: 12px;
  background: #fff; color: var(--mu-encre);
  /* ⚠️ `min-width:0` : un `<select>` prend la largeur de sa plus
     longue option et deborde de sa colonne sans cela (§7.69). */
  min-width: 0;
}
input:focus, textarea:focus, select:focus {
  outline: 3px solid var(--mu-t); outline-offset: 1px; border-color: var(--mu-t);
}
textarea { min-height: 6rem; resize: vertical; }

.mu-aide { color: var(--mu-gris); font-size: .9rem; margin: .35rem 0 0; }
.mu-err {
  background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
  border-radius: 12px; padding: .8rem 1rem; margin: 1rem 0; font-weight: 600;
}
.mu-ok {
  background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534;
  border-radius: 12px; padding: .8rem 1rem; margin: 1rem 0; font-weight: 600;
}

/* ------------------------------------------------------------
   L'accueil : les six portes
   ------------------------------------------------------------ */
.mu-portes {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  margin: 1.5rem 0;
}
.mu-porte {
  display: block; text-decoration: none; color: inherit;
  background: #fff; border: 1px solid var(--mu-bord); border-radius: 18px;
  padding: 1.2rem; box-shadow: var(--mu-ombre);
  border-top: 4px solid var(--p, var(--mu-t));
  transition: transform .14s ease, box-shadow .14s ease;
}
.mu-porte:hover { transform: translateY(-2px);
                  box-shadow: 0 10px 30px rgba(26,20,48,.12); }
.mu-porte .e  { font-size: 2rem; line-height: 1; display: block; margin-bottom: .5rem; }
.mu-porte .n  { font-weight: 800; font-size: 1.1rem; display: block; }
.mu-porte .q  { color: var(--mu-gris); font-size: .92rem; margin-top: .3rem;
                line-height: 1.45; }
.mu-porte .a  { color: var(--p, var(--mu-t)); font-size: .85rem; font-weight: 700;
                margin-top: .7rem; display: block; }

/* ------------------------------------------------------------
   Le code — saisi, et projete
   ------------------------------------------------------------ */
.mu-code-champ {
  font-size: 2rem; font-weight: 800; letter-spacing: .35em;
  text-align: center; text-transform: uppercase;
  padding: .9rem .5rem .9rem .85em;   /* le letter-spacing decale a droite */
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   LA PROJECTION
   ============================================================ */

/* ⚠️ LA RACINE MELE LARGEUR ET HAUTEUR (§7.70), et `--mu-auto` est
   CHERCHE par dichotomie a chaque ecran (§7.41, §7.121) : la formule
   directe se mord la queue, puisque agrandir change le nombre de
   lignes d'un titre, donc la hauteur. `--mu-z` est le zoom que le
   professeur regle — lui seul voit le fond de la salle. */
.mu-ecran {
  --mu-auto: 1;
  --mu-z: 1;
  /* §7.190 : base relevee (13 → 26 px) — a 1366 × 768, l'ancienne
     donnait 13 px avant toute reduction, et 12 px de texte au final. */
  font-size: calc(clamp(13px, .8vw + .8vh, 26px) * var(--mu-auto) * var(--mu-z));
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: var(--mu-fond);
  overflow: hidden;
}
.mu-ecran-tete {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1em; padding: .7em 1.4em;
  border-bottom: 1px solid var(--mu-bord); background: #fff;
  /* ⚠️ TAILLE FIXE, HORS DE `--mu-auto` (§7.190) : la question doit
     rester lisible du fond, quel que soit le nombre de reponses. */
  font-size: calc(clamp(12px, .8vw + .9vh, 28px) * var(--mu-z));
}
.mu-tete-g { min-width: 0; }
.mu-tete-d { text-align: right; flex: 0 0 auto; }
.mu-ecran-titre { font-size: .95em; font-weight: 700; color: var(--mu-gris); margin: 0; }
/* ⚠️ LA QUESTION EN GRAND ET EN NOIR, le nom de l'outil en petit :
   c'etait l'inverse, et c'est la question qu'on lit de loin (§7.190). */
.mu-ecran-q { font-size: 1.9em; font-weight: 800; color: var(--mu-encre);
              margin: .1em 0 0; line-height: 1.15; }
.mu-ecran-q:empty { display: none; }

.mu-ecran-corps {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  /* ⚠️ `safe center` : avec `center`, un contenu plus grand que la
     boite deborde DES DEUX COTES et le haut devient inatteignable
     (§7.42, §7.121). */
  justify-content: safe center;
  align-items: center;
  padding: 1em 1.4em;
  overflow: hidden;
}
.mu-ecran-pied {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1em; padding: .5em 1.4em;
  border-top: 1px solid var(--mu-bord); background: #fff;
  /* ⚠️ TAILLE FIXE, comme l'en-tete : le QR et le code rapetissaient
     avec un mur plein (94 px, puis 67 px en 1366 × 768, §7.190). */
  font-size: calc(clamp(12px, .7vw + .8vh, 24px) * var(--mu-z));
}

/* Le code au tableau : c'est le seul chiffre que toute la classe doit
   lire du fond de la salle. */
.mu-gros-code {
  font-size: 2.6em; font-weight: 800; letter-spacing: .14em; line-height: 1.05;
  color: var(--mu-t); font-variant-numeric: tabular-nums;
}
.mu-gens { font-size: 1.05em; font-weight: 600; color: var(--mu-gris); }
.mu-gens b { color: var(--mu-encre); font-size: 1.15em; }

/* ------------------------------------------------------------
   Le nuage de mots
   ------------------------------------------------------------ */
.mu-nuage { width: 100%; height: 100%; display: block; }
.mu-nuage text {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 800; letter-spacing: -.01em;
  transform-box: fill-box; transform-origin: center;
}
/* §7.190 — la place (glissement + croissance) est un `transform` CSS du
   groupe : une transition, pas de JS, jamais de saut. */
.mu-nuage g.mu-nm { transition: transform 1.1s cubic-bezier(.22,.9,.25,1); }
.mu-nuage g.mu-flot { transform-box: fill-box;
                      animation: mu-flot 6s ease-in-out infinite alternate; }
@keyframes mu-flot { from { transform: translateY(-3%); } to { transform: translateY(3%); } }
.mu-nuage text.neuf  { animation: mu-entre-mot .8s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes mu-entre-mot { from { opacity: 0; transform: translateY(40%) scale(.2); }
                          to   { opacity: 1; transform: none; } }
.mu-nuage text.pulse { animation: mu-pulse .7s ease-out; }
@keyframes mu-pulse { 40% { transform: scale(1.14); } }
.mu-nuage g.part text { animation: mu-evapore .75s ease-in forwards; }
@keyframes mu-evapore { to { opacity: 0; transform: translateY(-25%) scale(1.3); filter: blur(4px); } }
@keyframes mu-pop {
  from { opacity: 0; transform: scale(.4); }
  to   { opacity: 1; transform: scale(1); }
}

/* ------------------------------------------------------------
   Le sondage
   ------------------------------------------------------------ */
.mu-barres { width: 100%; max-width: 48em; display: flex;
             flex-direction: column; gap: .75em; }
.mu-barre-l { display: grid; grid-template-columns: 1fr auto; gap: .5em .9em; }
.mu-barre-t { font-size: 1.15em; font-weight: 700; display: flex; gap: .5em; align-items: baseline; }
.mu-barre-l.tete .mu-barre-f { box-shadow: inset 0 0 0 .15em rgba(255,255,255,.45); }
.mu-barres.cachees .mu-barre-p { background: repeating-linear-gradient(45deg, #f1f5f9 0 .6em, #fff .6em 1.2em); }
.mu-barres-tot { margin-top: 1em; font-size: 1.1em; font-weight: 700; color: var(--mu-gris); text-align: center; }
.mu-lettre { display: inline-flex; align-items: center; justify-content: center;
             min-width: 1.6em; height: 1.6em; border-radius: .45em; flex: 0 0 auto;
             background: var(--mu-t); color: #fff; font-weight: 800; font-size: .9em; }
.mu-barre-n { font-size: 1.15em; font-weight: 800; color: var(--mu-t);
              font-variant-numeric: tabular-nums; }
.mu-barre-p { grid-column: 1 / -1; height: 1.5em; border-radius: 999px;
              background: #fff; border: 1px solid var(--mu-bord); overflow: hidden; }
.mu-barre-f { height: 100%; border-radius: 999px; background: var(--mu-t);
              transition: width .5s cubic-bezier(.2,.8,.2,1); }

/* ------------------------------------------------------------
   Les cartes : post-it, questions, brainstorming
   ------------------------------------------------------------ */
.mu-cartes {
  width: 100%; height: 100%;
  display: grid; gap: .8em; align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(16em, 1fr));
  overflow: hidden;
}
.mu-c {
  background: #fff; border: 1px solid var(--mu-bord);
  border-left: .35em solid var(--c, var(--mu-t));
  border-radius: 14px; padding: .85em 1em;
  box-shadow: var(--mu-ombre);
}
/* ⚠️ L'ANIMATION D'ENTREE NE VIT QUE SUR `.neuf`, retiree a la fin :
   posee sur `.mu-c`, elle se rejouait a chaque deplacement de nœud, et
   le tableau clignotait toutes les 2,5 s (§7.190). */
.mu-c.neuf { animation: mu-entre .45s cubic-bezier(.2,.9,.3,1.1); }
.mu-c.cache-place { display: none; }
.mu-c-rep { margin-top: .45em; font-size: .95em; font-weight: 700; color: var(--mu-vert); }
@keyframes mu-entre {
  from { opacity: 0; transform: translateY(1em) scale(.96); }
  to   { opacity: 1; transform: none; }
}
.mu-c-txt  { font-size: 1.05em; line-height: 1.45; }
.mu-c-bas  { display: flex; align-items: center; justify-content: space-between;
             gap: .6em; margin-top: .6em; font-size: .85em; color: var(--mu-gris); }
.mu-c-aime { font-weight: 800; color: var(--mu-t); }
.mu-c.epinglee { border-color: var(--mu-ambre); background: #fffbeb; }
.mu-c.traitee  { opacity: .55; }
.mu-c.traitee .mu-c-txt { text-decoration: line-through;
                          text-decoration-color: rgba(26,20,48,.3); }

/* ------------------------------------------------------------
   Le pendu
   ------------------------------------------------------------ */
.mu-pendu { display: flex; flex-direction: column; align-items: center;
            gap: .8em; width: 100%; height: 100%;
            justify-content: safe center; }
.mu-scene { flex: 0 1 auto; max-height: 52%; }
/* ⚠️ LA SCENE DU T-REX A SA HAUTEUR GARANTIE (§7.190) : 45 % du corps,
   le mot prend le reste. En `flex: 1 1 auto`, elle tombait a 0 px. */
.mu-scene-h { flex: 0 0 48%; min-height: 0; width: 100%;
              display: flex; align-items: center; justify-content: center; }
.mu-scene-h svg { height: 100%; width: 100%; max-height: none; }
.mu-scene-h.secousse { animation: mu-secousse .5s ease; }
.mu-scene-h.alerte { background: radial-gradient(closest-side, rgba(220,38,38,.12), transparent); }
@keyframes mu-secousse { 0%,100% { transform: none; } 25% { transform: translateX(-1.5%); }
                         75% { transform: translateX(1.5%); } }
.mu-fin { font-size: 1.5em; font-weight: 800; min-height: 1.3em; text-align: center; }
.mu-fin.gagne { color: var(--mu-vert); animation: mu-pop .5s cubic-bezier(.2,.9,.3,1.3); }
.mu-fin.perdu { color: var(--mu-rouge); }
.mu-tour-proj { width: min(40em, 100%); text-align: center; }
.mu-tour-l { font-size: 1.4em; font-weight: 700; }
.mu-tour-l b { color: var(--mu-t); font-size: 1.2em; }
.mu-tour-calme { color: var(--mu-gris); font-size: 1.1em; font-weight: 600; }
.mu-tour-barre { height: .5em; border-radius: 999px; background: var(--mu-bord);
                 overflow: hidden; margin-top: .4em; }
.mu-tour-barre i { display: block; height: 100%; width: 100%; background: var(--mu-t); }
.mu-mot   { display: flex; flex-wrap: wrap; gap: .3em; justify-content: center; }
.mu-l {
  width: 1.3em; height: 1.7em;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2em; font-weight: 800;
  border-bottom: .12em solid var(--mu-encre);
}
.mu-l.sep { border-bottom: none; width: .7em; }
.mu-l.pleine { animation: mu-pop .4s cubic-bezier(.2,.9,.3,1.3); }
.mu-ratees { display: flex; gap: .35em; flex-wrap: wrap; justify-content: center;
             font-size: 1.3em; font-weight: 800; color: var(--mu-rouge); }
.mu-ratees span { text-decoration: line-through; }
.mu-indice { font-size: 1.1em; color: var(--mu-gris); font-style: italic; }

/* ------------------------------------------------------------
   Le téléphone de l'élève
   ------------------------------------------------------------ */
.mu-tel { min-height: 100svh; display: flex; flex-direction: column; }
/* ⚠️ `svh` ET NON `vh` : sur un telephone, `vh` compte une barre de
   navigateur qui n'est pas la, et le bouton d'envoi tombe sous le
   bord de l'ecran (§7.121). */
.mu-tel-corps { flex: 1 1 auto; padding: 1.1rem 1rem 2rem; }

.mu-choix { display: grid; gap: .7rem; margin: 1.2rem 0; }
.mu-choix button {
  text-align: left; padding: 1rem 1.1rem; font-size: 1.05rem;
  border-radius: 14px; border: 2px solid var(--mu-bord); background: #fff;
  font: inherit; font-weight: 600; cursor: pointer; min-height: 56px;
}
.mu-choix button.pris {
  border-color: var(--mu-t); background: var(--mu-t-pale); color: var(--mu-t);
}

.mu-clavier { display: grid; grid-template-columns: repeat(7, 1fr);
              gap: .4rem; margin: 1rem 0; }
.mu-clavier button {
  aspect-ratio: 1; font-size: 1.1rem; font-weight: 800;
  border-radius: 10px; border: 1px solid var(--mu-bord); background: #fff;
  font-family: inherit; cursor: pointer; min-height: 0;
}
.mu-clavier button.jouee  { opacity: .3; cursor: not-allowed; }
.mu-clavier button.juste  { background: #f0fdf4; border-color: #86efac; color: #166534; }
.mu-clavier button.ratee  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }

/* ------------------------------------------------------------
   La liste du professeur
   ------------------------------------------------------------ */
.mu-liste { display: grid; gap: .8rem; }
.mu-m {
  display: flex; align-items: center; gap: .9rem; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--mu-bord); border-radius: 14px;
  padding: .9rem 1rem; border-left: 4px solid var(--c, var(--mu-t));
}
.mu-m-e { font-size: 1.6rem; line-height: 1; }
.mu-m-t { flex: 1 1 12rem; min-width: 0; }
.mu-m-t b { display: block; font-size: 1.02rem; }
.mu-m-t span { color: var(--mu-gris); font-size: .85rem; }
.mu-m-c { font-weight: 800; letter-spacing: .1em; color: var(--mu-t); }
.mu-badge { font-size: .72rem; font-weight: 800; text-transform: uppercase;
            letter-spacing: .04em; padding: .25em .6em; border-radius: 999px;
            background: var(--mu-t-pale); color: var(--mu-t); }
.mu-badge.ouvert { background: #f0fdf4; color: #166534; }
.mu-badge.ferme  { background: #f1f5f9; color: var(--mu-gris); }
.mu-badge.pause  { background: #fffbeb; color: #92400e; }

/* ------------------------------------------------------------
   Les mots du nuage, cote Maitre
   ------------------------------------------------------------
   ⚠️ LE ✕ FAIT 34 px DE COTE. Le professeur pilote en circulant dans
      la classe : un emoji a la taille du texte ne se touche pas
      (§7.119, ou un bouton tombe a 16 px avait rendu toute la barre
      inutilisable au doigt).
   ------------------------------------------------------------ */
.mu-nmots { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .6rem; }
.mu-nmot { display: inline-flex; align-items: center; gap: .35rem;
           padding: .2rem .25rem .2rem .7rem; border-radius: 999px;
           background: var(--mu-t-pale); color: var(--mu-t);
           font-size: .82rem; }
.mu-nmot b { font-weight: 800; text-transform: uppercase;
             letter-spacing: .03em; }
.mu-nx { width: 34px; height: 34px; min-height: 34px; flex: 0 0 34px;
         display: inline-flex; align-items: center; justify-content: center;
         border: 0; border-radius: 999px; cursor: pointer;
         background: #fff; color: var(--mu-gris);
         font-size: .9rem; line-height: 1; padding: 0; }
.mu-nx:hover, .mu-nx:focus-visible { background: #fee2e2; color: #b91c1c; }
.mu-nx[disabled] { opacity: .5; cursor: default; }

/* ------------------------------------------------------------
   Le QR
   ------------------------------------------------------------ */
.mu-qr { background: #fff; padding: .8rem; border-radius: 14px;
         border: 1px solid var(--mu-bord); display: inline-block; }
.mu-qr svg { display: block; width: 100%; height: auto; }

/* ------------------------------------------------------------
   Sous 760 px
   ------------------------------------------------------------ */
@media (max-width: 760px) {
  .mu-page { padding: 1rem .8rem 3rem; }
  .mu-cartes { grid-template-columns: 1fr; }
  .mu-haut { padding: .7rem .8rem; }
}

/* ============================================================
   §7.190 — LA PROJECTION : rejoindre, accueil, réseau, familles
   ============================================================ */

/* Le QR du pied : une taille en vh, jamais en em (§7.190). 19 % de
   la hauteur = ~205 px en 1080p, ~137 px en 720p, soit plus de 3 px
   par module pour un QR de 41 modules. */
.mu-rejoindre { display: flex; align-items: center; gap: .9em; cursor: pointer; }
.mu-qr-pied { width: min(19vh, 15vw); padding: .35em; flex: 0 0 auto; }
.mu-qr-pied img, .mu-qr-grand img { display: block; width: 100%; height: auto; }
.mu-adresse { font-size: 1.25em; font-weight: 800; color: var(--mu-encre); }
.mu-fin-proche { font-size: .9em; font-weight: 700; color: var(--mu-ambre); }

.mu-svc { display: flex; gap: .4em; align-items: center; flex-wrap: wrap;
          transition: opacity .3s ease; }
/* Sans souris depuis 4 s, les boutons de service s'effacent. */
.mu-ecran.calme .mu-svc-boutons { opacity: 0; pointer-events: none; }

.mu-reste { position: absolute; right: 1.4em; bottom: calc(min(19vh, 15vw) + 2.6em);
            background: var(--mu-encre); color: #fff; font-weight: 700;
            padding: .4em .9em; border-radius: 999px; font-size: clamp(12px, .7vw + .8vh, 22px);
            box-shadow: var(--mu-ombre); }

.mu-reseau { position: fixed; left: 50%; top: .8rem; transform: translateX(-50%);
             z-index: 90; background: #7f1d1d; color: #fff; font-weight: 700;
             padding: .55rem 1rem; border-radius: 999px; box-shadow: var(--mu-ombre);
             font-size: .95rem; max-width: calc(100% - 2rem); text-align: center; }

.mu-attente { text-align: center; color: var(--mu-gris); }
.mu-attente b { display: block; font-size: 1.4em; margin: .4em 0; color: var(--mu-encre); }
.mu-attente strong { color: var(--mu-encre); }

/* L'accueil : le QR en grand, tant que personne n'a répondu. */
.mu-accueil { position: absolute; inset: 0; z-index: 40; background: var(--mu-fond);
              display: flex; flex-direction: column; align-items: center; justify-content: center;
              gap: 2.5vh; padding: 3vh 4vw;
              font-size: calc(clamp(12px, .9vw + 1vh, 30px) * var(--mu-z)); }
.mu-accueil[hidden] { display: none; }
.mu-accueil-q { font-size: 2.1em; font-weight: 800; text-align: center; max-width: 34em; line-height: 1.15; }
.mu-accueil-l { display: flex; align-items: center; gap: 5vw; flex-wrap: wrap; justify-content: center; }
.mu-qr-grand { width: min(56vh, 44vw); padding: 1.2vh; border-width: 2px; }
.mu-accueil-t { display: flex; flex-direction: column; gap: .3em; }
.mu-accueil-etape { font-size: 1.3em; color: var(--mu-gris); font-weight: 700; }
.mu-accueil-adr { font-size: 2.2em; font-weight: 800; color: var(--mu-encre); }
.mu-accueil-code { font-size: 5em; font-weight: 900; letter-spacing: .14em; color: var(--mu-t); line-height: 1; }
.mu-accueil-gens { margin-top: .6em; font-size: 1.3em; font-weight: 700; color: var(--mu-vert); }
.mu-accueil .mu-b { font-size: .8em; }

/* Le brainstorming en colonnes (phase 2). */
.mu-familles { width: 100%; height: 100%; display: grid; gap: .8em;
               grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); }
.mu-fam { background: #fff; border: 1px solid var(--mu-bord); border-radius: 16px;
          display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.mu-fam-t { padding: .55em .8em; font-weight: 800; font-size: 1.1em;
            background: var(--mu-t-pale); color: var(--mu-t); }
.mu-fam-t span { float: right; opacity: .7; }
.mu-fam-reste { background: #f8fafc; border-style: dashed; }
.mu-fam-reste .mu-fam-t { background: #f1f5f9; color: var(--mu-gris); }
.mu-fam-c { padding: .6em; display: flex; flex-direction: column; gap: .55em; overflow: hidden; flex: 1 1 auto; }
.mu-fam-c .mu-c { padding: .55em .7em; }
.rangeable .mu-c { cursor: grab; touch-action: none; }
.mu-c.saisie { position: relative; z-index: 30; cursor: grabbing; box-shadow: 0 12px 30px rgba(26,20,48,.25); }
.mu-c.choisie { outline: .2em solid var(--mu-t); outline-offset: 2px; }
.mu-fois { display: inline-block; font-weight: 800; color: #fff; background: var(--mu-t);
           border-radius: 999px; padding: 0 .45em; font-size: .85em; }

/* ============================================================
   §7.190 — LE TÉLÉPHONE DE L'ÉLÈVE
   ============================================================ */
.mu-tel-q { font-size: 1.3rem; }
/* La place du message est réservée : il ne décale plus la page. */
.mu-msg { min-height: 0; margin: 0 0 .6rem; }
.mu-msg:empty { display: none; }
.mu-msg.mu-ok, .mu-msg.mu-err { margin: 0 0 .6rem; }
.mu-prenom { display: flex; align-items: center; gap: .6rem; margin-bottom: .2rem; }
.mu-prenom label { margin: 0; flex: 0 0 auto; font-size: .92rem; }
.mu-prenom label span { font-weight: 400; color: var(--mu-gris); }
.mu-prenom input { padding: .5rem .7rem; }
/* ⚠️ LE BOUTON ENVOYER COLLE AU BAS DE L'ÉCRAN : clavier ouvert, il
   passait sous le pli (§7.190). */
.mu-envoi { position: sticky; bottom: 0; z-index: 5; background: #fff;
            padding: .7rem 0 .3rem; margin-top: .4rem;
            display: flex; flex-direction: column; gap: .2rem; align-items: center; }
.mu-m-tel { align-items: flex-start; }
.mu-m-tel.amoi { background: var(--mu-t-pale); }
.mu-aime { min-height: 48px; min-width: 64px; padding: .45rem .8rem; }
.mu-aime.oui { border-color: var(--mu-t); color: var(--mu-t); background: var(--mu-t-pale); }
.mu-m-moi { display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
/* « Retirer » : loin du 👍, et assez grand pour ne pas se rater. */
.mu-b-petit { min-height: 40px; padding: .35rem .8rem; font-size: .85rem; }
.mu-rep { display: block; color: var(--mu-vert) !important; font-weight: 700; }
.mu-mesmots { margin-top: 1rem; }
.mu-puces { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.mu-puce { padding: .3rem .7rem; border-radius: 999px; background: var(--mu-t-pale);
           color: var(--mu-t); font-weight: 700; animation: mu-pop .45s cubic-bezier(.2,.9,.3,1.3); }
.mu-puce.fort { background: var(--mu-t); color: #fff; }
.mu-puce i { font-style: normal; opacity: .85; }
.mu-choix button { display: flex; gap: .7rem; align-items: center; }
.mu-minibarres { display: grid; gap: .35rem; margin-top: .6rem; }
.mu-minibarres div { display: grid; grid-template-columns: 1.4rem 1fr 3rem; gap: .5rem; align-items: center; }
.mu-minibarres i { display: block; height: .7rem; border-radius: 999px; background: var(--mu-bord); }
.mu-minibarres .mien i { background: var(--mu-t); }
.mu-minibarres b { text-align: right; font-size: .85rem; }
.mu-minitrex { width: 100%; max-width: 15rem; margin: 0 auto .4rem; aspect-ratio: 400 / 230; }
.mu-minitrex svg { width: 100%; height: 100%; display: block; }
.mu-motel { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem; margin: .3rem 0; }
.mu-motel span { width: 1.45rem; height: 1.9rem; border-bottom: 3px solid var(--mu-encre);
                 display: flex; align-items: center; justify-content: center;
                 font-size: 1.25rem; font-weight: 800; }
.mu-motel i { width: .7rem; font-style: normal; text-align: center; font-weight: 800; color: var(--mu-gris); }
.mu-tour { display: flex; gap: .6rem; align-items: center; margin: .5rem 0; font-size: .9rem; }
.mu-tour b { color: var(--mu-t); }
.mu-tour-barre { flex: 1 1 auto; }
/* Six colonnes et non sept : a 360 px, sept touches faisaient 35 px
   (sous les 44 px d'un doigt) et la derniere debordait (§7.190). */
.mu-clavier { grid-template-columns: repeat(6, 1fr); }
.mu-clavier button { min-height: 0; min-width: 0; }
.mu-clavier-maitre { grid-template-columns: repeat(7, 1fr); }
.mu-clavier button.vote { background: var(--mu-t); border-color: var(--mu-t); color: #fff; }

/* ============================================================
   §7.190 — LE TÉLÉPHONE DU PROFESSEUR (pilotage)
   ============================================================ */
.mu-haut-collant { position: sticky; top: 0; z-index: 20; margin-bottom: 1rem; }
.mu-msg-flottant { position: sticky; top: 4rem; z-index: 19; }
.mu-msg-flottant .mu-ok, .mu-msg-flottant .mu-err { margin: 0 0 .6rem; box-shadow: var(--mu-ombre); }
#pilote > div + div { margin-top: 1rem; }
#pilote > div:empty { display: none; }
.mu-etat { display: grid; gap: .7rem; }
.mu-etat.ouvert { border-color: #bbf7d0; }
.mu-etat.salon { border-color: #fde68a; background: #fffbeb; }
.mu-etat-l { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem; flex-wrap: wrap; }
.mu-etat-b { font-weight: 800; font-size: 1.15rem; }
.mu-etat-g { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.mu-b-geant { min-height: 60px; font-size: 1.15rem; }
.mu-lien { background: none; border: 0; padding: 0; font: inherit; color: var(--mu-t);
           text-decoration: underline; cursor: pointer; min-height: 0; }
.mu-alerte { color: #92400e; font-weight: 700; }
.mu-question-t { font-size: 1.2rem; font-weight: 800; margin: .2rem 0 .6rem; }
.mu-question textarea { margin-top: .5rem; min-height: 3.5rem; }
.mu-relire { border-color: #fde68a; background: #fffbeb; }
.mu-relire h2 { margin-top: 0; }
.mu-cachees summary { cursor: pointer; font-weight: 700; }
.mu-gestes { display: flex; gap: .4rem; flex-wrap: wrap; width: 100%; margin-top: .3rem; }
.mu-gestes .mu-b, .mu-fam-choix .mu-b { min-height: 44px; padding: .4rem .7rem; font-size: .9rem; }
/* ⚠️ LE GESTE DESTRUCTEUR EST LOIN DES AUTRES (§7.190). */
.mu-loin { margin-left: auto; }
.mu-m-maitre { flex-direction: column; align-items: stretch; }
.mu-m-maitre.choisie { outline: 3px solid var(--mu-t); }
.mu-rang { display: inline-block; font-weight: 800; color: var(--mu-t); margin-right: .4rem; }
.mu-phases { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.mu-phases .mu-aide { grid-column: 1 / -1; }
.mu-phase { text-align: center; padding: .7rem .5rem; border-radius: 12px; font-weight: 700;
            border: 2px solid var(--mu-bord); cursor: pointer; }
.mu-phase.on { border-color: var(--mu-t); background: var(--mu-t-pale); color: var(--mu-t); }
.mu-fam-ed { grid-column: 1 / -1; display: grid; gap: .4rem; }
.mu-fam-choix { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }
.mu-repondre { margin-top: .5rem; display: grid; gap: .5rem; }
.mu-sond-l { display: flex; gap: .6rem; align-items: center; padding: .5rem 0;
             border-bottom: 1px solid var(--mu-bord); }
.mu-sond-t { flex: 1 1 auto; min-width: 0; }
.mu-clavier-maitre button { min-height: 44px; }
.mu-case { display: flex; gap: .5rem; align-items: center; font-weight: 600; cursor: pointer; }
.mu-case input { width: auto; }
.mu-tour-maitre { background: var(--mu-t-pale); border-radius: 12px; padding: .7rem;
                  display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.mu-motel-maitre span { width: 1.3rem; font-size: 1.1rem; }
.mu-garder hr { border: 0; border-top: 1px solid var(--mu-bord); margin: 1rem 0 .8rem; }

/* ============================================================
   §7.190 — LES THÈMES DU « PENDU (LE MOT MYSTÈRE) » (FORMAT.md v2)
   Une image par étape, fondu enchaîné entre deux calques.
   ⛔ Rien qui évoque une pendaison : la menace APPROCHE.
   ============================================================ */
.mu-th { position: relative; height: 100%; width: auto; max-width: 100%;
         aspect-ratio: 16 / 9; margin: 0 auto; overflow: hidden; border-radius: 14px;
         background: #e2e8f0; }
.mu-th-i { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
           opacity: 0; transition: opacity .7s ease; }
.mu-th-i.on { opacity: 1; }
.mu-th.tension { box-shadow: 0 0 0 .25em rgba(220,38,38,.55); }
.mu-th.gagne { box-shadow: 0 0 0 .25em rgba(22,163,74,.6); }

.mu-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: .5rem; }
.mu-theme { display: flex; flex-direction: column; gap: .3rem; align-items: stretch; padding: .35rem;
            border: 2px solid var(--mu-bord); border-radius: 12px; background: #fff; font: inherit;
            font-size: .85rem; font-weight: 700; cursor: pointer; text-align: center; }
.mu-theme img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; display: block; }
.mu-theme-e { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 9;
              font-size: 2rem; background: var(--mu-t-pale); border-radius: 8px; }
.mu-theme.on { border-color: var(--mu-t); background: var(--mu-t-pale); color: var(--mu-t); }

/* ============================================================
   §7.190 — LA BOÎTE À OUTILS (prof.php) : vignettes animées
   ⚠️ Animations en CSS seulement, figées par le bloc reduced-motion
      qui clôt la feuille.
   ============================================================ */
.mu-intro { max-width: 46rem; }
.mu-outil-l { display: flex; flex-direction: column; gap: .3rem; }
.mu-outil-l .mu-outil { flex: 1 1 auto; }
.mu-outils { display: grid; gap: 1rem; margin: 1rem 0 2rem;
             grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); }
.mu-outil { display: flex; flex-direction: column; gap: .35rem; text-align: left;
            background: #fff; border: 1px solid var(--mu-bord); border-top: 4px solid var(--p);
            border-radius: 18px; padding: .9rem 1rem 1rem; font: inherit; color: inherit;
            cursor: pointer; box-shadow: var(--mu-ombre);
            transition: transform .15s ease, box-shadow .15s ease; }
.mu-outil:hover, .mu-outil:focus-visible { transform: translateY(-3px);
            box-shadow: 0 12px 30px rgba(26,20,48,.12); outline: none; }
.mu-outil:focus-visible { outline: 3px solid var(--p); outline-offset: 2px; }
.mu-outil-v { display: block; border-radius: 12px; overflow: hidden;
              background: color-mix(in srgb, var(--p) 8%, #fff); background-color: #f8fafc; }
.mu-outil-n { font-weight: 800; font-size: 1.1rem; margin-top: .3rem; }
.mu-outil-q { color: var(--mu-gris); font-size: .9rem; line-height: 1.45; flex: 1 1 auto; }
.mu-outil-a { color: var(--p); font-weight: 800; font-size: .9rem; }

.mu-v { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
.mu-v text { font-family: system-ui, sans-serif; font-weight: 800; }
/* Le nuage : les mots poussent un à un. */
.mu-v-nuage text { fill: var(--p); transform-box: fill-box; transform-origin: center;
                   animation: mu-v-pousse 4s var(--d) ease-in-out infinite; opacity: 0; }
@keyframes mu-v-pousse { 0% { opacity: 0; transform: scale(.3); } 15%, 85% { opacity: 1; transform: none; }
                         100% { opacity: 0; } }
/* Le sondage : les barres montent. */
.mu-v-sondage rect { fill: var(--p); transform-box: fill-box; transform-origin: bottom;
                     animation: mu-v-monte 3.6s var(--d) cubic-bezier(.2,.8,.2,1) infinite; }
@keyframes mu-v-monte { 0% { transform: scaleY(.05); } 40%, 85% { transform: scaleY(var(--h)); }
                        100% { transform: scaleY(.05); } }
/* Les post-it tombent. */
.mu-v-postit rect { fill: var(--p); opacity: .85; transform-box: fill-box; transform-origin: center;
                    animation: mu-v-tombe 4s var(--d) ease-out infinite; }
@keyframes mu-v-tombe { 0% { transform: translateY(-120%) rotate(0); opacity: 0; }
                        20%, 85% { transform: translateY(0) rotate(var(--r)); opacity: .85; } 100% { opacity: 0; } }
/* Les questions : les mains se lèvent, la plus soutenue en tête. */
.mu-v-questions rect { fill: color-mix(in srgb, var(--p) 18%, #fff); fill: #ede9fe; }
.mu-v-questions g { animation: mu-v-leve 3.6s var(--d) ease-in-out infinite; }
.mu-v-questions text { fill: var(--p); }
@keyframes mu-v-leve { 0%, 100% { transform: translateX(-6px); opacity: .3; } 25%, 80% { transform: none; opacity: 1; } }
/* Le brainstorming : les idées se rangent en colonnes. */
.mu-v-brain .col { fill: #fff; stroke: #cbd5e1; }
.mu-v-brain rect:not(.col) { fill: var(--p); animation: mu-v-range 4.4s var(--d) ease-in-out infinite; }
@keyframes mu-v-range { 0% { transform: translate(40px, 50px); opacity: 0; } 25%, 85% { transform: none; opacity: 1; }
                        100% { opacity: 0; } }
/* Le pendu : la menace avance, le bonhomme détale (aucune corde). */
.mu-v-pendu .trex { fill: var(--p); animation: mu-v-avance 4s ease-in-out infinite; }
.mu-v-pendu .fuit { animation: mu-v-court .5s ease-in-out infinite alternate; }
@keyframes mu-v-avance { 0% { transform: translateX(16px); } 70%, 100% { transform: translateX(-36px); } }
@keyframes mu-v-court { to { transform: translateY(-2px); } }

/* Le dialogue */
.mu-pop { position: fixed; inset: 0; background: rgba(26,20,48,.5); z-index: 60; padding: 1rem; overflow: auto; }
.mu-pop-boite { max-width: 36rem; margin: 3vh auto; animation: mu-entre .3s ease; }
.mu-form-t { display: flex; align-items: center; gap: .7rem; margin-bottom: .2rem; }
.mu-form-t span { font-size: 2rem; }
.mu-form-t h2 { margin: 0; font-size: 1.3rem; color: var(--p); }
.mu-leger { font-weight: 400; color: var(--mu-gris); }
.mu-modeles { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .2rem; }
.mu-modeles .mu-b { min-height: 36px; padding: .3rem .7rem; font-size: .85rem; }
.mu-plus { margin-top: 1rem; border-top: 1px solid var(--mu-bord); padding-top: .6rem; }
.mu-plus summary { cursor: pointer; font-weight: 700; color: var(--mu-gris); }
.mu-form-g { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.3rem; align-items: center; }
.mu-form-g .mu-b-geant { flex: 1 1 14rem; }
.mu-pret { text-align: center; }
.mu-pret-e { font-size: 2.6rem; line-height: 1; animation: mu-pop .5s cubic-bezier(.2,.9,.3,1.3); }
.mu-pret h2 { margin: .3rem 0 .2rem; }
.mu-pret-code { font-size: 2.6rem; font-weight: 800; letter-spacing: .14em; color: var(--mu-t); }
.mu-pret-g { display: grid; gap: .5rem; margin-top: 1rem; }
.mu-act-g { display: flex; gap: .4rem; flex-wrap: wrap; width: 100%; }
@media (min-width: 900px) { .mu-act-g { width: auto; } }

/* Le clavier du prof sous le pendu projeté : touches ≥ 56 px (TBI). */
.mu-clavier-proj { display: grid; grid-template-columns: repeat(13, minmax(0, 1fr));
                   gap: .3em; width: min(100%, 60em); flex: 0 0 auto; }
.mu-clavier-proj button { min-height: max(56px, 5.5vh); font: inherit; font-weight: 800;
                          font-size: max(18px, 1.2em); border-radius: 10px; cursor: pointer;
                          border: 1px solid var(--mu-bord); background: #fff; color: var(--mu-encre); }
.mu-clavier-proj button.juste { background: #dcfce7; border-color: #86efac; color: #166534; }
.mu-clavier-proj button.ratee { background: #fee2e2; border-color: #fecaca; color: #991b1b;
                                text-decoration: line-through; }
.mu-clavier-proj button[disabled] { cursor: default; opacity: .8; }
/* Le champ du mot secret : masqué, avec un œil pour vérifier. */
.mu-secret { display: flex; gap: .4rem; }
.mu-secret input { flex: 1 1 auto; }
.mu-aide-ecran { display: grid; gap: .6rem; margin: .8rem 0; }
.mu-aide-ecran > div { border: 1px solid var(--mu-bord); border-radius: 12px; padding: .7rem .8rem; background: #f8fafc; }
.mu-aide-ecran b { display: block; margin-bottom: .2rem; }

/* L'indice du pendu : caché par défaut, la lampe l'allume (§7.190). */
.mu-indice-l { display: flex; align-items: center; justify-content: center; gap: .5em; min-height: 1.6em; }
.mu-indice { opacity: 0; max-width: 0; overflow: hidden; white-space: nowrap;
             transition: opacity .6s ease, max-width .8s ease; }
.mu-indice.vu { opacity: 1; max-width: 40em; }
.mu-lampe { border: 0; background: none; cursor: pointer; font-size: 1.4em; line-height: 1;
            filter: grayscale(1) opacity(.45); transition: filter .5s ease, transform .3s ease; }
.mu-lampe.allumee { filter: drop-shadow(0 0 .35em #fde047); transform: scale(1.12); }

/* ============================================================
   §7.190 — LA DÉMO D'UN OUTIL (demo.php, sans serveur)
   ============================================================ */
/* La bulle se pose dans le PIED, à droite du QR : au-dessus du corps,
   elle cachait justement ce qu'elle commentait (le clavier du pendu). */
.mu-demo-bulle { position: absolute; right: 1em; bottom: .5em;
                 z-index: 50; width: min(40em, calc(100% - min(19vh, 15vw) - 16em)); background: var(--mu-encre); color: #fff;
                 border-radius: 16px; padding: .8em 1em; box-shadow: 0 16px 40px rgba(26,20,48,.35);
                 font-size: clamp(13px, .7vw + .8vh, 22px); }
.mu-demo-t { font-weight: 700; line-height: 1.35; min-height: 2.7em; }
.mu-demo-barre { margin: .4em 0 !important; }
.mu-demo-t.neuve { animation: mu-entre .4s ease; }
.mu-demo-barre { height: 4px; background: rgba(255,255,255,.2); border-radius: 99px; margin: .6em 0; overflow: hidden; }
.mu-demo-barre i { display: block; height: 100%; width: 0; background: var(--mu-t); }
.mu-demo-g { display: flex; gap: .4em; justify-content: flex-end; flex-wrap: wrap; }
.mu-demo-g .mu-b { min-height: 38px; padding: .4em .8em; font-size: .85em; }
.mu-qr-faux { aspect-ratio: 1; background:
  repeating-conic-gradient(#1a1430 0 25%, #fff 0 50%) 0 0 / 22% 22%; opacity: .85; }
.mu-qr-pied.mu-qr-faux { height: min(19vh, 15vw); }
/* Le cadre de démo dans la boîte à outils */
.mu-demo-cadre { width: 100%; aspect-ratio: 16 / 10; border: 0; border-radius: 12px; display: block;
                 background: var(--mu-fond); }
.mu-pop-boite.large { max-width: 64rem; }
.mu-outil-demo { align-self: flex-start; font-size: .85rem; }

/* ============================================================
   ⚠️ CE BLOC DOIT RESTER LE DERNIER DE LA FEUILLE.
      Toute animation ecrite APRES lui LUI ECHAPPE, et rien ne le
      signale — c'est §7.121, ou un `*/` orphelin avait avale le bloc
      entier : 45 regles s'animaient sans contre-ordre et la mesure
      rendait `blocs_media: 0`.
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
