/* =========================================================================
   BioGladys — feuille de style unique
   =========================================================================

   Organisation du fichier :
      1. Variables (couleurs, espacements, arrondis)
      2. Remise à zéro et bases
      3. Structure (en-tête, contenu, pied)
      4. Éléments communs (boutons, cartes, messages, formulaires)
      5. Pages publiques (accueil, connexion, rejoindre)
      6. Espace élève (chapitres, fiches, progression)
      7. Exercices (entraînement et quiz)
      8. Quiz en direct — écran projeté et écran élève
      9. Espace enseignante
     10. Adaptation aux petits écrans

   Aucune police extérieure n'est chargée : la politique de sécurité du
   site interdit toute ressource distante, et une police téléchargée
   ralentirait le premier affichage sur le téléphone d'une élève en 4G.
   ========================================================================= */

/* =========================================================================
   1. Variables
   ========================================================================= */
:root {
  /* Couleurs de marque — un violet prune profond, réchauffé de rose et
     de corail. Assez doux pour un usage long, assez contrasté pour être
     lisible au vidéoprojecteur. */
  --prune:        #4a2545;
  --prune-clair:  #6d3a63;
  --prune-encre:  #2e1429;
  --rose:         #e0567a;
  --rose-clair:   #f7d9e2;
  --corail:       #ff8a65;
  --menthe:       #14a98b;
  --menthe-clair: #d6f3ec;
  --ambre:        #e8a33d;
  --ambre-clair:  #fdf0d9;
  --rouge:        #d64545;
  --rouge-clair:  #fbe0e0;

  /* Fonds et textes */
  --creme:     #fdf9f7;
  --blanc:     #ffffff;
  --sable:     #f6ebe6;
  --bord:      #ecdcd6;
  --texte:     #34212f;
  --texte-doux:#7a6672;

  /* Rythme */
  --r-s:  10px;
  --r-m:  16px;
  --r-l:  24px;
  --r-xl: 32px;

  --ombre-s: 0 1px 2px rgba(74, 37, 69, .06), 0 2px 8px rgba(74, 37, 69, .05);
  --ombre-m: 0 2px 6px rgba(74, 37, 69, .07), 0 12px 28px rgba(74, 37, 69, .08);
  --ombre-l: 0 8px 20px rgba(74, 37, 69, .10), 0 24px 56px rgba(74, 37, 69, .12);

  --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
            Arial, sans-serif;

  --largeur: 1180px;
}

/* =========================================================================
   2. Remise à zéro et bases
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--police);
  font-size: 16px;
  line-height: 1.6;
  color: var(--texte);
  background: var(--creme);
  /* Deux halos très doux en fond : la page respire sans image à charger. */
  background-image:
    radial-gradient(900px 500px at 12% -10%, rgba(224, 86, 122, .10), transparent 70%),
    radial-gradient(800px 460px at 95% 0%,   rgba(255, 138, 101, .10), transparent 70%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  line-height: 1.25;
  color: var(--prune);
  font-weight: 700;
  letter-spacing: -.015em;
}
h1 { font-size: clamp(1.65rem, 1.2rem + 1.8vw, 2.4rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.02rem; }

p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--rose); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; }

mark {
  background: linear-gradient(transparent 55%, var(--rose-clair) 55%);
  color: inherit;
  padding: 0 .1em;
  border-radius: 2px;
}

hr {
  border: 0;
  border-top: 1px solid var(--bord);
  margin: 1.6rem 0;
}

/* Le contour de mise au point reste visible : c'est indispensable pour
   qui navigue au clavier, et cela ne gêne personne d'autre. */
:focus-visible {
  outline: 3px solid var(--rose);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Personne n'aime être secoué : on respecte le réglage du système. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* =========================================================================
   3. Structure
   ========================================================================= */
.entete {
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--bord);
  position: sticky;
  top: 0;
  z-index: 50;
}
.entete-dedans {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: .7rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.marque {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: var(--prune);
  text-decoration: none;
  flex-shrink: 0;
}
.marque:hover { text-decoration: none; }
.marque-picto {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--prune), var(--rose));
  color: #fff;
  box-shadow: var(--ombre-s);
}
.marque-texte { display: flex; flex-direction: column; line-height: 1.15; }
.marque-texte strong { font-size: 1.12rem; letter-spacing: -.02em; }
.marque-texte small { font-size: .72rem; color: var(--texte-doux); }

.menu {
  display: flex;
  gap: .25rem;
  margin-left: auto;
  flex-wrap: wrap;
}
.menu a {
  padding: .45rem .8rem;
  border-radius: 999px;
  color: var(--prune);
  font-size: .92rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.menu a:hover { background: var(--sable); text-decoration: none; }
.menu a.lien-fort {
  background: linear-gradient(135deg, var(--rose), var(--corail));
  color: #fff;
  box-shadow: var(--ombre-s);
}
.menu a.lien-fort:hover { filter: brightness(1.06); }

.compte-menu {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding-left: .9rem;
  border-left: 1px solid var(--bord);
}
.compte-nom {
  display: flex; align-items: center; gap: .45rem;
  color: var(--prune); font-size: .9rem; font-weight: 600;
}
.pastille {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--prune-clair), var(--rose));
  color: #fff; font-size: .85rem; font-weight: 700;
}
.bouton-lien {
  background: none; border: 0; padding: 0;
  color: var(--texte-doux); font: inherit; font-size: .82rem;
  cursor: pointer; text-decoration: underline;
}
.bouton-lien:hover { color: var(--rose); }

.bouton-menu {
  display: none;
  background: none; border: 0; cursor: pointer;
  padding: .4rem; margin-left: auto;
}
.bouton-menu span {
  display: block; width: 22px; height: 2px;
  background: var(--prune); border-radius: 2px;
  margin: 4px 0; transition: transform .2s, opacity .2s;
}

.contenu {
  flex: 1;
  width: 100%;
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 2rem 1.2rem 4rem;
}
.plein { flex: 1; width: 100%; }

.pied {
  border-top: 1px solid var(--bord);
  padding: 1.4rem 1.2rem;
  text-align: center;
  font-size: .82rem;
  color: var(--texte-doux);
}

/* --- Fil d'Ariane --------------------------------------------------- */
.fil {
  font-size: .85rem;
  color: var(--texte-doux);
  margin-bottom: 1rem;
  display: flex; flex-wrap: wrap; gap: .35rem; align-items: center;
}
.fil a { color: var(--texte-doux); }
.fil a:hover { color: var(--rose); }
.fil span[aria-hidden] { opacity: .5; }

/* --- En-tête de page -------------------------------------------------- */
.titre-page {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
}
.titre-page p { color: var(--texte-doux); margin: .2rem 0 0; }
.titre-page .actions { display: flex; gap: .6rem; flex-wrap: wrap; }

/* =========================================================================
   4. Éléments communs
   ========================================================================= */

/* --- Boutons ---------------------------------------------------------- */
.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .68rem 1.25rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform .12s, box-shadow .15s, filter .15s;
  background: linear-gradient(135deg, var(--rose), var(--corail));
  color: #fff;
  box-shadow: var(--ombre-s);
}
.bouton:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--ombre-m); }
.bouton:active { transform: translateY(0); }
.bouton[disabled], .bouton:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.bouton.secondaire {
  background: var(--blanc);
  color: var(--prune);
  border: 1px solid var(--bord);
  box-shadow: none;
}
.bouton.secondaire:hover { background: var(--sable); }

.bouton.sombre { background: linear-gradient(135deg, var(--prune), var(--prune-clair)); }
.bouton.danger { background: linear-gradient(135deg, #c9403f, var(--rouge)); }
.bouton.menthe { background: linear-gradient(135deg, #0f9a7e, var(--menthe)); }

.bouton.petit { padding: .4rem .85rem; font-size: .85rem; }
.bouton.grand { padding: .95rem 1.9rem; font-size: 1.08rem; }
.bouton.large { width: 100%; }

/* --- Cartes ------------------------------------------------------------ */
.carte {
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: var(--r-l);
  padding: 1.4rem;
  box-shadow: var(--ombre-s);
}
.carte-titre {
  display: flex; align-items: center; justify-content: space-between;
  gap: .8rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.carte-titre h2, .carte-titre h3 { margin: 0; }

.grille { display: grid; gap: 1.1rem; }
.grille-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grille-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grille-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

/* --- Chiffres clés ------------------------------------------------------ */
.chiffres { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.chiffre {
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: var(--r-m);
  padding: 1rem 1.1rem;
  box-shadow: var(--ombre-s);
}
.chiffre b {
  display: block;
  font-size: 1.9rem;
  line-height: 1.1;
  color: var(--prune);
  letter-spacing: -.03em;
}
.chiffre span { font-size: .82rem; color: var(--texte-doux); }

/* --- Messages ----------------------------------------------------------- */
.messages {
  max-width: var(--largeur);
  margin: 1rem auto 0;
  padding: 0 1.2rem;
  display: grid;
  gap: .6rem;
}
.message {
  display: flex;
  align-items: center;
  gap: .7rem;
  padding: .8rem 1rem;
  border-radius: var(--r-m);
  font-size: .93rem;
  border: 1px solid;
  animation: apparait .3s ease;
}
.message-picto {
  width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: .75rem; font-weight: 700; color: #fff;
}
.message-succes { background: var(--menthe-clair); border-color: #a9e3d5; color: #0b5e4c; }
.message-succes .message-picto { background: var(--menthe); }
.message-erreur { background: var(--rouge-clair); border-color: #f3bcbc; color: #8f2020; }
.message-erreur .message-picto { background: var(--rouge); }
.message-info   { background: var(--ambre-clair); border-color: #f2d9a8; color: #7a5310; }
.message-info .message-picto { background: var(--ambre); }
.message-fermer {
  margin-left: auto; background: none; border: 0; cursor: pointer;
  font-size: 1.3rem; line-height: 1; color: inherit; opacity: .55;
}
.message-fermer:hover { opacity: 1; }

@keyframes apparait { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* --- Formulaires --------------------------------------------------------- */
.champ { margin-bottom: 1.1rem; }
.champ > label,
.champ-titre {
  display: block;
  font-weight: 600;
  font-size: .88rem;
  color: var(--prune);
  margin-bottom: .35rem;
}
.champ .aide {
  display: block;
  font-size: .8rem;
  color: var(--texte-doux);
  margin-top: .3rem;
  font-weight: 400;
}

input[type=text], input[type=password], input[type=search], input[type=number],
select, textarea {
  width: 100%;
  padding: .7rem .9rem;
  border: 1px solid var(--bord);
  border-radius: var(--r-s);
  font: inherit;
  font-size: .96rem;
  color: var(--texte);
  background: var(--blanc);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(224, 86, 122, .16);
}
textarea { resize: vertical; min-height: 120px; line-height: 1.6; }
textarea.code {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: .9rem;
}

.ligne-champs { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.case {
  display: flex; align-items: flex-start; gap: .55rem;
  font-size: .93rem; cursor: pointer;
}
.case input { width: auto; margin-top: .25rem; accent-color: var(--rose); }

/* --- Étiquettes ---------------------------------------------------------- */
.etiquette {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .75rem; font-weight: 600;
  background: var(--sable); color: var(--prune);
  white-space: nowrap;
}
.etiquette.rose   { background: var(--rose-clair); color: #9c2545; }
.etiquette.menthe { background: var(--menthe-clair); color: #0b5e4c; }
.etiquette.ambre  { background: var(--ambre-clair); color: #7a5310; }
.etiquette.rouge  { background: var(--rouge-clair); color: #8f2020; }
.etiquette.grise  { background: #eee9ec; color: var(--texte-doux); }

/* --- Jauges --------------------------------------------------------------- */
.jauge {
  height: 8px;
  background: var(--sable);
  border-radius: 999px;
  overflow: hidden;
}
.jauge > i {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--corail));
  border-radius: 999px;
  transition: width .5s ease;
}
.jauge.verte > i  { background: linear-gradient(90deg, #0f9a7e, var(--menthe)); }
.jauge.ambre > i  { background: linear-gradient(90deg, #d18f24, var(--ambre)); }
.jauge.rouge > i  { background: linear-gradient(90deg, #b93636, var(--rouge)); }

/* --- Zone vide ------------------------------------------------------------ */
.vide {
  text-align: center;
  padding: 2.6rem 1.4rem;
  color: var(--texte-doux);
  background: var(--blanc);
  border: 1px dashed var(--bord);
  border-radius: var(--r-l);
}
.vide .picto { font-size: 2.4rem; display: block; margin-bottom: .6rem; opacity: .5; }

/* --- Tableaux -------------------------------------------------------------- */
.tableau { width: 100%; overflow-x: auto; }
.tableau table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tableau th, .tableau td {
  padding: .7rem .8rem;
  text-align: left;
  border-bottom: 1px solid var(--bord);
  vertical-align: middle;
}
.tableau th {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
  color: var(--texte-doux); font-weight: 700;
}
.tableau tbody tr:hover { background: #fdf6f3; }
.tableau td.serre { white-space: nowrap; }

/* =========================================================================
   5. Pages publiques
   ========================================================================= */

/* --- Accueil ------------------------------------------------------------- */
.heros {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 4rem 1.2rem 2.5rem;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 3rem;
  align-items: center;
}
.heros-texte h1 {
  font-size: clamp(2rem, 1.4rem + 2.6vw, 3.2rem);
  margin-bottom: .6rem;
}
.heros-texte .accroche {
  font-size: 1.12rem;
  color: var(--texte-doux);
  max-width: 34rem;
  margin-bottom: 1.8rem;
}
.heros-signature {
  display: inline-flex; align-items: center; gap: .55rem;
  font-size: .85rem; color: var(--texte-doux);
  margin-bottom: 1.2rem;
  padding: .35rem .85rem .35rem .35rem;
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: 999px;
}
.heros-actions { display: flex; gap: .8rem; flex-wrap: wrap; }
.heros-illu { display: grid; place-items: center; }
.heros-illu svg { width: 100%; max-width: 380px; height: auto; }

.bandeau-niveaux {
  max-width: var(--largeur);
  margin: 0 auto;
  padding: 1rem 1.2rem 4rem;
}
.bandeau-niveaux h2 { text-align: center; margin-bottom: .4rem; }
.bandeau-niveaux .sous { text-align: center; color: var(--texte-doux); margin-bottom: 2rem; }

.carte-niveau {
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: var(--r-l);
  padding: 1.3rem;
  box-shadow: var(--ombre-s);
  display: flex;
  flex-direction: column;
  gap: .55rem;
  position: relative;
  overflow: hidden;
  transition: transform .15s, box-shadow .2s;
}
.carte-niveau::before {
  content: '';
  position: absolute; inset: 0 0 auto 0;
  height: 4px;
  background: var(--teinte, var(--rose));
}
a.carte-niveau:hover { transform: translateY(-3px); box-shadow: var(--ombre-m); text-decoration: none; }
.carte-niveau .famille {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .06em;
  font-weight: 700; color: var(--teinte, var(--rose));
}
.carte-niveau h3 { margin: 0; font-size: 1.12rem; }
.carte-niveau p { font-size: .88rem; color: var(--texte-doux); margin: 0; }
.carte-niveau .compteurs {
  display: flex; gap: .4rem; flex-wrap: wrap; margin-top: auto; padding-top: .7rem;
}

/* --- Connexion et rejoindre ------------------------------------------- */
.ecran-centre {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.2rem;
}
.boite {
  width: 100%;
  max-width: 430px;
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: var(--r-xl);
  padding: 2.2rem;
  box-shadow: var(--ombre-l);
}
.boite-large { max-width: 520px; }
.boite .logo-boite {
  width: 58px; height: 58px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--prune), var(--rose));
  display: grid; place-items: center;
  color: #fff;
  margin: 0 auto 1.1rem;
  box-shadow: var(--ombre-m);
}
.boite h1 { text-align: center; font-size: 1.5rem; margin-bottom: .3rem; }
.boite .sous { text-align: center; color: var(--texte-doux); font-size: .9rem; margin-bottom: 1.8rem; }
.boite-pied {
  margin-top: 1.4rem; padding-top: 1.2rem;
  border-top: 1px solid var(--bord);
  text-align: center; font-size: .85rem; color: var(--texte-doux);
}

/* Champ du code à 6 chiffres */
.champ-code input {
  font-size: 2.1rem;
  text-align: center;
  letter-spacing: .5em;
  padding: .8rem .5rem .8rem 1.3rem;
  font-weight: 700;
  font-family: ui-monospace, Consolas, monospace;
  color: var(--prune);
}

/* =========================================================================
   6. Espace élève
   ========================================================================= */
.salut {
  background: linear-gradient(135deg, var(--prune), var(--prune-clair) 60%, #8a4a72);
  color: #fff;
  border-radius: var(--r-xl);
  padding: 1.8rem 2rem;
  margin-bottom: 1.8rem;
  position: relative;
  overflow: hidden;
  box-shadow: var(--ombre-m);
}
.salut::after {
  content: '';
  position: absolute; right: -60px; top: -60px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,138,101,.35), transparent 65%);
}
.salut h1 { color: #fff; margin-bottom: .25rem; position: relative; }
.salut p { color: rgba(255,255,255,.82); margin: 0; position: relative; }
.salut .raccourcis { display: flex; gap: .7rem; margin-top: 1.2rem; flex-wrap: wrap; position: relative; }
.salut .bouton.secondaire {
  background: rgba(255,255,255,.14);
  border-color: rgba(255,255,255,.3);
  color: #fff;
}
.salut .bouton.secondaire:hover { background: rgba(255,255,255,.24); }

.carte-chapitre {
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: var(--r-l);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--ombre-s);
  display: flex;
  flex-direction: column;
  gap: .6rem;
  transition: transform .15s, box-shadow .2s;
}
a.carte-chapitre:hover { transform: translateY(-3px); box-shadow: var(--ombre-m); text-decoration: none; }
.carte-chapitre .haut { display: flex; align-items: center; gap: .7rem; }
.carte-chapitre .numero {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--rose-clair);
  color: #9c2545;
  font-weight: 700; font-size: 1rem;
}
.carte-chapitre h3 { margin: 0; font-size: 1.05rem; }
.carte-chapitre .resume { font-size: .87rem; color: var(--texte-doux); margin: 0; }
.carte-chapitre .bas {
  margin-top: auto; padding-top: .6rem;
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  font-size: .78rem; color: var(--texte-doux);
}
.carte-chapitre .progression-mini { flex: 1; min-width: 90px; }

/* --- Fiche de révision --------------------------------------------------- */
.fiche-corps {
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: var(--r-l);
  padding: 2rem 2.2rem;
  box-shadow: var(--ombre-s);
  font-size: 1.02rem;
  max-width: 780px;
}
.fiche-corps h3 {
  font-size: 1.25rem;
  margin: 1.8rem 0 .7rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--rose-clair);
}
.fiche-corps h3:first-child { margin-top: 0; }
.fiche-corps h4 { font-size: 1.05rem; margin: 1.3rem 0 .5rem; color: var(--prune-clair); }
.fiche-corps ul, .fiche-corps ol { padding-left: 1.3rem; margin: 0 0 1em; }
.fiche-corps li { margin-bottom: .4em; }
.fiche-corps li::marker { color: var(--rose); font-weight: 700; }

.encadre {
  display: flex; gap: .8rem;
  padding: .95rem 1.1rem;
  border-radius: var(--r-m);
  margin: 1.2rem 0;
  font-size: .95rem;
  border: 1px solid;
}
.encadre .picto {
  width: 24px; height: 24px; flex-shrink: 0;
  border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: .8rem; color: #fff;
}
.encadre div > :last-child { margin-bottom: 0; }
.encadre.retenir   { background: var(--menthe-clair); border-color: #a9e3d5; }
.encadre.retenir .picto   { background: var(--menthe); }
.encadre.attention { background: var(--rouge-clair); border-color: #f3bcbc; }
.encadre.attention .picto { background: var(--rouge); }
.encadre.anecdote  { background: var(--ambre-clair); border-color: #f2d9a8; }
.encadre.anecdote .picto  { background: var(--ambre); }

.tableau-fiche { overflow-x: auto; margin: 1.2rem 0; }
.tableau-fiche table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tableau-fiche th {
  background: var(--sable); color: var(--prune);
  padding: .6rem .8rem; text-align: left; font-weight: 700;
}
.tableau-fiche td { padding: .6rem .8rem; border-top: 1px solid var(--bord); }
.tableau-fiche tr:nth-child(even) td { background: #fdfaf9; }

.navigation-fiches {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 1.6rem; flex-wrap: wrap;
}

/* --- Badges -------------------------------------------------------------- */
.badges { display: flex; gap: .7rem; flex-wrap: wrap; }
.badge {
  display: flex; align-items: center; gap: .5rem;
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: 999px;
  padding: .4rem .9rem .4rem .5rem;
  box-shadow: var(--ombre-s);
}
.badge .picto {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--ambre-clair);
  font-size: 1rem;
}
.badge b { font-size: .85rem; color: var(--prune); display: block; line-height: 1.2; }
.badge small { font-size: .72rem; color: var(--texte-doux); }

/* =========================================================================
   7. Exercices (entraînement et quiz)
   ========================================================================= */
.exo-cadre {
  max-width: 780px;
  margin: 0 auto;
}
.exo-barre {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.2rem;
}
.exo-barre .progression-serie { flex: 1; }
.exo-compteur { font-size: .88rem; color: var(--texte-doux); font-weight: 600; white-space: nowrap; }

.exo-carte {
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: var(--r-xl);
  padding: 2rem;
  box-shadow: var(--ombre-m);
}
.exo-type {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .75rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--rose);
  margin-bottom: .8rem;
}
.exo-enonce {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--prune);
  line-height: 1.45;
  margin-bottom: 1.5rem;
}
.exo-consigne { font-size: .85rem; color: var(--texte-doux); margin-bottom: 1rem; }

/* --- Choix multiples ----------------------------------------------------- */
.choix { display: grid; gap: .7rem; }
.choix button {
  display: flex; align-items: center; gap: .9rem;
  width: 100%;
  padding: 1rem 1.2rem;
  background: var(--blanc);
  border: 2px solid var(--bord);
  border-radius: var(--r-m);
  font: inherit;
  font-size: 1.02rem;
  text-align: left;
  color: var(--texte);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.choix button:hover:not(:disabled) { border-color: var(--rose); background: #fffafb; }
.choix button:active:not(:disabled) { transform: scale(.995); }
.choix button .lettre {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 9px;
  display: grid; place-items: center;
  background: var(--sable);
  color: var(--prune);
  font-weight: 700; font-size: .9rem;
  transition: background .15s, color .15s;
}
.choix button.choisi { border-color: var(--rose); background: var(--rose-clair); }
.choix button.choisi .lettre { background: var(--rose); color: #fff; }
.choix button.juste { border-color: var(--menthe); background: var(--menthe-clair); }
.choix button.juste .lettre { background: var(--menthe); color: #fff; }
.choix button.faux { border-color: var(--rouge); background: var(--rouge-clair); }
.choix button.faux .lettre { background: var(--rouge); color: #fff; }
.choix button:disabled { cursor: default; }
.choix button .marque-fin { margin-left: auto; font-size: 1.1rem; font-weight: 700; }

/* --- Vrai / faux --------------------------------------------------------- */
.vrai-faux { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.vrai-faux button {
  padding: 1.6rem 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  border-radius: var(--r-l);
  border: 2px solid var(--bord);
  background: var(--blanc);
  color: var(--prune);
  cursor: pointer;
  transition: transform .12s, border-color .15s, background .15s;
}
.vrai-faux button:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--rose); }
.vrai-faux button.choisi { border-color: var(--rose); background: var(--rose-clair); }
.vrai-faux button.juste  { border-color: var(--menthe); background: var(--menthe-clair); color: #0b5e4c; }
.vrai-faux button.faux   { border-color: var(--rouge); background: var(--rouge-clair); color: #8f2020; }

/* --- Texte à trous -------------------------------------------------------- */
.trous {
  font-size: 1.18rem;
  line-height: 2.4;
  color: var(--prune);
}
.trous input {
  display: inline-block;
  width: auto;
  min-width: 6ch;
  padding: .25rem .6rem;
  margin: 0 .2rem;
  border: 0;
  border-bottom: 2px dashed var(--rose);
  border-radius: 6px 6px 0 0;
  background: #fffafb;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
  color: var(--prune);
}
.trous input.juste { border-bottom-color: var(--menthe); background: var(--menthe-clair); }
.trous input.faux  { border-bottom-color: var(--rouge); background: var(--rouge-clair); }
.trous .correction {
  display: inline-block;
  margin-left: .3rem;
  font-size: .85rem;
  color: var(--menthe);
  font-weight: 700;
}

/* --- Associations ---------------------------------------------------------- */
.paires { display: grid; gap: .7rem; }
.paire {
  display: grid;
  grid-template-columns: 1fr auto 1.1fr;
  gap: .7rem;
  align-items: center;
}
.paire .terme {
  padding: .8rem 1rem;
  background: var(--sable);
  border-radius: var(--r-m);
  font-weight: 600;
  color: var(--prune);
  font-size: .98rem;
}
.paire .fleche { color: var(--texte-doux); font-size: 1.1rem; }
.paire select { font-size: .95rem; }
.paire.juste select { border-color: var(--menthe); background: var(--menthe-clair); }
.paire.faux select  { border-color: var(--rouge); background: var(--rouge-clair); }
.paire .bonne-reponse {
  grid-column: 3; font-size: .8rem; color: var(--menthe); font-weight: 700; margin-top: -.3rem;
}

/* --- Schéma à annoter ------------------------------------------------------- */
.schema-zone {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.4rem;
  align-items: start;
}
.schema-dessin {
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: var(--r-m);
  padding: .8rem;
  position: relative;
}
.schema-dessin svg { width: 100%; height: auto; display: block; }
.schema-cible {
  fill: rgba(224, 86, 122, .10);
  stroke: var(--rose);
  stroke-width: 2;
  stroke-dasharray: 5 4;
  cursor: pointer;
  transition: fill .15s;
}
.schema-cible.survol { fill: rgba(224, 86, 122, .25); }
.schema-cible.remplie { fill: rgba(20, 169, 139, .14); stroke: var(--menthe); stroke-dasharray: none; }
.schema-numero {
  font-size: 13px; font-weight: 700; fill: var(--prune);
  pointer-events: none; user-select: none;
}
.schema-reperes { display: grid; gap: .55rem; }
.schema-repere {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: .6rem;
  align-items: center;
}
.schema-repere .num {
  width: 26px; height: 26px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--prune); color: #fff;
  font-size: .8rem; font-weight: 700;
}
.schema-repere select { font-size: .9rem; padding: .5rem .6rem; }
.schema-repere.juste select { border-color: var(--menthe); background: var(--menthe-clair); }
.schema-repere.faux select  { border-color: var(--rouge); background: var(--rouge-clair); }

/* --- Correction ------------------------------------------------------------- */
.verdict {
  margin-top: 1.4rem;
  padding: 1.1rem 1.3rem;
  border-radius: var(--r-m);
  border: 1px solid;
  animation: apparait .25s ease;
}
.verdict.juste { background: var(--menthe-clair); border-color: #a9e3d5; }
.verdict.faux  { background: var(--rouge-clair); border-color: #f3bcbc; }
.verdict .titre-verdict {
  display: flex; align-items: center; gap: .55rem;
  font-weight: 700; font-size: 1.05rem; margin-bottom: .4rem;
}
.verdict.juste .titre-verdict { color: #0b5e4c; }
.verdict.faux .titre-verdict  { color: #8f2020; }
.verdict p { font-size: .93rem; margin: 0; }
.verdict .explication { margin-top: .5rem; color: var(--texte); }

.exo-pied {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; margin-top: 1.4rem; flex-wrap: wrap;
}

/* --- Bilan de fin de série ------------------------------------------------- */
.bilan { text-align: center; padding: 1rem 0; }
.bilan .anneau {
  width: 170px; height: 170px;
  margin: 0 auto 1.4rem;
  position: relative;
  display: grid; place-items: center;
}
.bilan .anneau svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.bilan .anneau .fond { fill: none; stroke: var(--sable); stroke-width: 12; }
.bilan .anneau .part {
  fill: none; stroke: url(#degrade-score); stroke-width: 12; stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}
.bilan .anneau b { font-size: 2.6rem; color: var(--prune); line-height: 1; }
.bilan .anneau span { font-size: .8rem; color: var(--texte-doux); }
.bilan h2 { margin-bottom: .3rem; }
.bilan .encouragement { color: var(--texte-doux); margin-bottom: 1.6rem; }
.bilan .actions { display: flex; gap: .8rem; justify-content: center; flex-wrap: wrap; }

/* --- Choix du mode d'entraînement -------------------------------------------- */
.modes { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.mode-carte {
  background: var(--blanc);
  border: 2px solid var(--bord);
  border-radius: var(--r-l);
  padding: 1.3rem;
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: transform .15s, border-color .15s, box-shadow .2s;
}
.mode-carte:hover { transform: translateY(-3px); border-color: var(--rose); box-shadow: var(--ombre-m); }
.mode-carte .picto { font-size: 1.8rem; display: block; margin-bottom: .5rem; }
.mode-carte b { display: block; color: var(--prune); font-size: 1.05rem; margin-bottom: .25rem; }
.mode-carte small { color: var(--texte-doux); font-size: .85rem; line-height: 1.45; display: block; }

/* =========================================================================
   8. Quiz en direct
   ========================================================================= */

/* --- Écran projeté (professeure) --------------------------------------- */
.page-piloter {
  background: var(--prune-encre);
  background-image:
    radial-gradient(900px 600px at 15% 0%, rgba(224, 86, 122, .22), transparent 65%),
    radial-gradient(800px 500px at 90% 100%, rgba(255, 138, 101, .18), transparent 65%);
  color: #fff;
}
.piloter {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.4rem clamp(1rem, 4vw, 3rem) 2rem;
}
.piloter h1, .piloter h2, .piloter h3 { color: #fff; }
.piloter-entete {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.piloter-entete .titre-quiz { font-size: 1.1rem; font-weight: 600; opacity: .85; }

.code-partie {
  display: flex; align-items: center; gap: 1.2rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: var(--r-l);
  padding: .8rem 1.4rem;
}
.code-partie .libelle { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; opacity: .7; }
.code-partie .valeur {
  font-size: clamp(2rem, 1.2rem + 3vw, 3.4rem);
  font-weight: 800;
  letter-spacing: .12em;
  font-family: ui-monospace, Consolas, monospace;
  line-height: 1;
  background: linear-gradient(135deg, #fff, #ffd9c4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.code-partie .adresse { font-size: .9rem; opacity: .75; }

.salle-attente { flex: 1; display: flex; flex-direction: column; }
.salle-attente .compte-joueurs {
  font-size: clamp(2.4rem, 1.5rem + 4vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, #fff, var(--corail));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.liste-joueurs {
  display: flex; flex-wrap: wrap; gap: .6rem;
  margin: 1.5rem 0;
  align-content: flex-start;
  flex: 1;
}
.jeton-joueur {
  padding: .55rem 1.1rem;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  font-weight: 600;
  font-size: 1rem;
  animation: arrive .35s cubic-bezier(.2,.9,.3,1.3);
}
.jeton-joueur.invite { opacity: .78; font-style: italic; }
@keyframes arrive { from { opacity: 0; transform: scale(.75); } to { opacity: 1; transform: none; } }

.question-projetee { flex: 1; display: flex; flex-direction: column; }
.question-projetee .enonce-grand {
  font-size: clamp(1.5rem, 1rem + 2.4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.28;
  margin: 1rem 0 1.8rem;
  max-width: 24ch;
}
.grille-reponses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}
.reponse-projetee {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.3rem 1.5rem;
  border-radius: var(--r-l);
  background: rgba(255,255,255,.10);
  border: 2px solid rgba(255,255,255,.16);
  font-size: clamp(1.05rem, .9rem + .6vw, 1.4rem);
  font-weight: 600;
  position: relative;
  overflow: hidden;
  transition: background .3s, border-color .3s;
}
.reponse-projetee .lettre {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 12px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.18);
  font-weight: 800;
}
.reponse-projetee.juste {
  background: rgba(20, 169, 139, .28);
  border-color: var(--menthe);
}
.reponse-projetee.juste .lettre { background: var(--menthe); }
.reponse-projetee.ecartee { opacity: .45; }
/* Barre de proportion des votes, dessinée derrière le texte. */
.reponse-projetee .barre-votes {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: rgba(255,255,255,.10);
  transition: width .8s cubic-bezier(.2,.8,.3,1);
  z-index: 0;
}
.reponse-projetee > * { position: relative; z-index: 1; }
.reponse-projetee .nb-votes { margin-left: auto; font-size: 1rem; opacity: .85; }

.chrono {
  --part: 1;
  height: 10px;
  background: rgba(255,255,255,.14);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1.2rem;
}
.chrono > i {
  display: block; height: 100%;
  width: calc(var(--part) * 100%);
  background: linear-gradient(90deg, var(--menthe), var(--ambre) 60%, var(--rouge));
  transition: width .95s linear;
}
.chrono.urgence > i { animation: pulse .6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

.piloter-pied {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.2rem; flex-wrap: wrap;
  margin-top: 1.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid rgba(255,255,255,.14);
}
.compteur-reponses { font-size: 1.15rem; font-weight: 600; }
.compteur-reponses b { font-size: 1.7rem; }
.piloter .bouton.secondaire {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.24);
  color: #fff;
}
.piloter .bouton.secondaire:hover { background: rgba(255,255,255,.2); }

/* Podium et classement projeté */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 1.2rem; margin: 2rem 0; }
.marche { text-align: center; width: clamp(110px, 18vw, 190px); }
.marche .socle {
  border-radius: 14px 14px 0 0;
  background: linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.08));
  display: grid; place-items: center;
  font-size: 2rem; font-weight: 800;
  border: 1px solid rgba(255,255,255,.2);
  border-bottom: 0;
}
.marche.or     .socle { height: 170px; background: linear-gradient(180deg, #ffd76e, #e8a33d); color: #4a2a00; }
.marche.argent .socle { height: 130px; background: linear-gradient(180deg, #e6e6ee, #b9bcc9); color: #33343d; }
.marche.bronze .socle { height: 100px; background: linear-gradient(180deg, #f0b184, #c9764a); color: #43220f; }
.marche .nom { font-weight: 700; font-size: 1.05rem; margin-bottom: .3rem; }
.marche .pts { font-size: .85rem; opacity: .8; }

.classement-liste { display: grid; gap: .5rem; max-width: 620px; margin: 0 auto; }
.classement-ligne {
  display: flex; align-items: center; gap: 1rem;
  padding: .7rem 1.1rem;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--r-m);
}
.classement-ligne .rang {
  width: 30px; height: 30px; flex-shrink: 0;
  border-radius: 9px; display: grid; place-items: center;
  background: rgba(255,255,255,.16); font-weight: 800; font-size: .9rem;
}
.classement-ligne .pseudo { font-weight: 600; }
.classement-ligne .score { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.classement-ligne.moi { background: rgba(224, 86, 122, .3); border-color: var(--rose); }

/* --- Écran de l'élève pendant un quiz ------------------------------------ */
.page-jeu { background: var(--creme); }
.jeu {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  max-width: 620px;
  margin: 0 auto;
  width: 100%;
}
.jeu-entete {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem;
  font-size: .88rem;
}
.jeu-entete .mon-score {
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: 999px;
  padding: .35rem .9rem;
  font-weight: 700; color: var(--prune);
  font-variant-numeric: tabular-nums;
}
.jeu-corps { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.jeu-attente { text-align: center; padding: 2rem 1rem; }
.jeu-attente .picto-attente {
  font-size: 3rem; display: block; margin-bottom: 1rem;
  animation: respire 2.4s ease-in-out infinite;
}
@keyframes respire { 50% { transform: scale(1.12); opacity: .75; } }

.jeu-verdict {
  text-align: center;
  padding: 2.4rem 1.4rem;
  border-radius: var(--r-xl);
  animation: apparait .3s ease;
}
.jeu-verdict.juste { background: var(--menthe-clair); }
.jeu-verdict.faux  { background: var(--rouge-clair); }
.jeu-verdict .grand-picto { font-size: 3.6rem; display: block; margin-bottom: .6rem; }
.jeu-verdict h2 { margin-bottom: .3rem; }
.jeu-verdict.juste h2 { color: #0b5e4c; }
.jeu-verdict.faux h2  { color: #8f2020; }
.jeu-verdict .points { font-size: 1.6rem; font-weight: 800; color: var(--prune); }

/* =========================================================================
   9. Espace enseignante
   ========================================================================= */
.admin-grille { display: grid; grid-template-columns: 260px 1fr; gap: 1.6rem; align-items: start; }

.onglets-niveaux {
  display: flex; gap: .5rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding-bottom: .3rem;
}
.onglets-niveaux a {
  padding: .5rem 1rem;
  border-radius: 999px;
  background: var(--blanc);
  border: 1px solid var(--bord);
  color: var(--prune);
  font-size: .88rem;
  font-weight: 600;
}
.onglets-niveaux a:hover { background: var(--sable); text-decoration: none; }
.onglets-niveaux a.actif {
  background: linear-gradient(135deg, var(--prune), var(--prune-clair));
  color: #fff; border-color: transparent;
}

.ligne-chapitre {
  display: flex; align-items: center; gap: 1rem;
  padding: .9rem 1.1rem;
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: var(--r-m);
  margin-bottom: .6rem;
}
.ligne-chapitre .infos { flex: 1; min-width: 0; }
.ligne-chapitre .infos b { display: block; color: var(--prune); }
.ligne-chapitre .infos small { color: var(--texte-doux); font-size: .82rem; }
.ligne-chapitre .compteurs { display: flex; gap: .35rem; flex-wrap: wrap; }
.ligne-chapitre .commandes { display: flex; gap: .3rem; align-items: center; }
.ligne-chapitre.brouillon { opacity: .72; border-style: dashed; }

.bouton-icone {
  width: 32px; height: 32px;
  border-radius: 9px;
  border: 1px solid var(--bord);
  background: var(--blanc);
  color: var(--prune);
  cursor: pointer;
  display: grid; place-items: center;
  font-size: .95rem;
  transition: background .15s, border-color .15s;
}
.bouton-icone:hover { background: var(--sable); border-color: var(--rose); }
.bouton-icone.danger:hover { background: var(--rouge-clair); border-color: var(--rouge); color: var(--rouge); }

.ligne-question {
  display: flex; align-items: flex-start; gap: .9rem;
  padding: .85rem 1rem;
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: var(--r-m);
  margin-bottom: .55rem;
}
.ligne-question .type-picto {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 9px; display: grid; place-items: center;
  background: var(--rose-clair); color: #9c2545; font-size: 1rem;
}
.ligne-question .enonce { flex: 1; min-width: 0; font-size: .93rem; }
.ligne-question .enonce small { display: block; color: var(--texte-doux); font-size: .78rem; margin-top: .15rem; }

/* --- Aide-mémoire de la syntaxe des fiches ------------------------------- */
.aide-syntaxe {
  background: var(--sable);
  border-radius: var(--r-m);
  padding: 1rem 1.2rem;
  font-size: .85rem;
}
.aide-syntaxe h4 { margin-bottom: .6rem; font-size: .9rem; }
.aide-syntaxe dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem .9rem; margin: 0; }
.aide-syntaxe dt {
  font-family: ui-monospace, Consolas, monospace;
  background: var(--blanc);
  padding: .1rem .45rem;
  border-radius: 5px;
  font-size: .82rem;
  white-space: nowrap;
}
.aide-syntaxe dd { margin: 0; color: var(--texte-doux); }

/* --- Éditeur de propositions --------------------------------------------- */
.proposition {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .6rem;
  align-items: center;
  margin-bottom: .55rem;
}
.proposition.avec-apparie { grid-template-columns: auto 1fr 1fr auto; }
.proposition .coche { display: grid; place-items: center; }
.proposition .coche input { width: 20px; height: 20px; accent-color: var(--menthe); }

/* --- Sélection des questions d'un quiz ------------------------------------ */
.selection-chapitre { margin-bottom: 1.2rem; }
.selection-chapitre summary {
  cursor: pointer;
  padding: .8rem 1rem;
  background: var(--blanc);
  border: 1px solid var(--bord);
  border-radius: var(--r-m);
  font-weight: 600;
  color: var(--prune);
  display: flex; align-items: center; gap: .6rem;
  list-style: none;
}
.selection-chapitre summary::-webkit-details-marker { display: none; }
.selection-chapitre summary::before { content: '▸'; transition: transform .2s; }
.selection-chapitre[open] summary::before { transform: rotate(90deg); }
.selection-chapitre .liste { padding: .7rem .4rem .2rem 1.2rem; display: grid; gap: .35rem; }
.selection-chapitre .compte-choisies { margin-left: auto; font-size: .8rem; color: var(--texte-doux); }

.case-question {
  display: flex; gap: .6rem; align-items: flex-start;
  padding: .5rem .7rem;
  border-radius: var(--r-s);
  cursor: pointer;
  font-size: .9rem;
}
.case-question:hover { background: var(--blanc); }
.case-question input { margin-top: .3rem; accent-color: var(--rose); }
.case-question .meta { color: var(--texte-doux); font-size: .78rem; }

.barre-lancement {
  position: sticky;
  bottom: 0;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--bord);
  padding: .9rem 1.2rem;
  margin: 1.5rem -1.2rem -4rem;
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  z-index: 20;
}
.barre-lancement .resume-choix { font-weight: 600; color: var(--prune); }

/* --- Identifiants fraîchement créés ---------------------------------------- */
.identifiants {
  background: var(--ambre-clair);
  border: 1px solid #f2d9a8;
  border-radius: var(--r-l);
  padding: 1.3rem;
  margin-bottom: 1.6rem;
}
.identifiants h3 { color: #7a5310; margin-bottom: .3rem; }
.identifiants .avertissement { font-size: .87rem; color: #7a5310; margin-bottom: 1rem; }
.identifiants table { width: 100%; border-collapse: collapse; background: var(--blanc); border-radius: var(--r-s); overflow: hidden; }
.identifiants th, .identifiants td { padding: .55rem .8rem; text-align: left; font-size: .9rem; border-bottom: 1px solid var(--bord); }
.identifiants td.mdp { font-family: ui-monospace, Consolas, monospace; font-weight: 700; color: var(--prune); }

/* --- Bandeau « contenu proposé » -------------------------------------------- */
.bandeau-propose {
  display: flex; gap: .8rem; align-items: flex-start;
  background: var(--ambre-clair);
  border: 1px solid #f2d9a8;
  border-radius: var(--r-m);
  padding: .9rem 1.1rem;
  font-size: .88rem;
  color: #7a5310;
  margin-bottom: 1.4rem;
}
.bandeau-propose strong { display: block; }

/* =========================================================================
   10. Petits écrans
   ========================================================================= */
@media (max-width: 900px) {
  .heros { grid-template-columns: 1fr; padding-top: 2.5rem; gap: 2rem; }
  .heros-illu { order: -1; }
  .heros-illu svg { max-width: 240px; }
  .admin-grille { grid-template-columns: 1fr; }
  .schema-zone { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .menu {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--blanc);
    border-bottom: 1px solid var(--bord);
    padding: .8rem 1.2rem;
    box-shadow: var(--ombre-m);
    gap: .2rem;
  }
  .menu.ouvert { display: flex; }
  .menu a { padding: .7rem .9rem; border-radius: var(--r-s); }
  .bouton-menu { display: block; }
  .compte-menu { margin-left: auto; padding-left: 0; border-left: 0; }
  .compte-nom span:last-child { display: none; }
  .compte-menu form { display: none; }
  .entete-dedans { position: relative; }

  .contenu { padding: 1.4rem 1rem 3rem; }
  .exo-carte { padding: 1.4rem; border-radius: var(--r-l); }
  .exo-enonce { font-size: 1.12rem; }
  .fiche-corps { padding: 1.4rem; }
  .paire { grid-template-columns: 1fr; gap: .35rem; }
  .paire .fleche { display: none; }
  .vrai-faux { grid-template-columns: 1fr; }
  .podium { gap: .6rem; }
  .titre-page { flex-direction: column; align-items: stretch; }
  .barre-lancement { margin-left: -1rem; margin-right: -1rem; }
}

@media (max-width: 480px) {
  .salut { padding: 1.4rem 1.2rem; border-radius: var(--r-l); }
  .boite { padding: 1.6rem 1.3rem; }
  .champ-code input { font-size: 1.7rem; letter-spacing: .35em; }
  .chiffre b { font-size: 1.6rem; }
}

/* --- Impression : la professeure imprime parfois une fiche ---------------- */
@media print {
  .entete, .pied, .messages, .navigation-fiches, .bouton { display: none !important; }
  body { background: #fff; }
  .fiche-corps { border: 0; box-shadow: none; padding: 0; max-width: none; }
}
