/* ==========================================================================
   Maoré 2036 — charte élève (extraite de la référence v2 et étendue)
   Palette lagon / corail / sable · cartes arrondies · gros boutons · ≥ 15 px
   ========================================================================== */

:root {
  --teal: #0F766E;
  --teal-l: #E0F2F0;
  --coral: #D85A30;
  --coral-l: #FAECE7;
  --sand: #FDF6EC;
  --ink: #26221C;
  --mut: #7A7266;
  --ok: #2E7D32;
  --ok-l: #E8F5E9;
  --ko: #C62828;
  --ko-l: #FDECEA;
  --card: #FFFFFF;
  --line: #E8DFD2;
  /* couleurs des territoires (vignettes) */
  --t-village: #D85A30;
  --t-ville: #BA7517;
  --t-lagon: #1D9E75;
  --t-hauteurs: #639922;
  --t-petiteterre: #7F77DD;
  --t-donnees: #378ADD;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  background: var(--sand);
  color: var(--ink);
  line-height: 1.55;
  font-size: 16px;
  padding-bottom: 60px;
}

.wrap { max-width: 860px; margin: 0 auto; padding: 0 14px; }

header {
  background: var(--teal);
  color: #fff;
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
header .wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 17px; }
.tag { background: rgba(255, 255, 255, .18); border-radius: 99px; padding: 2px 11px; font-size: 13px; }
.header-droite { margin-left: auto; display: flex; align-items: center; gap: 8px; }

/* Équipe connectée : pastilles prénom */
.equipe-bandeau { display: flex; gap: 6px; align-items: center; }
.avatar-lettre {
  width: 34px; height: 34px; border-radius: 50%;
  background: #fff; color: var(--teal);
  font-weight: 700; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid rgba(255, 255, 255, .6);
}
.btn-quitter {
  background: rgba(255, 255, 255, .18); color: #fff; border: none;
  border-radius: 99px; padding: 6px 14px; font-size: 14px; cursor: pointer;
  font-family: inherit;
}
.btn-quitter:hover { background: rgba(255, 255, 255, .3); }

h1 { font-size: 22px; margin: 16px 0 2px; }
.sub { color: var(--mut); font-size: 14px; margin-bottom: 10px; }

/* ---------------- cartes et boutons ---------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin: 12px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.btn {
  display: inline-block; border: none; border-radius: 12px;
  padding: 12px 22px; font-size: 16px; font-weight: 600;
  cursor: pointer; background: var(--teal); color: #fff; font-family: inherit;
  text-decoration: none; text-align: center;
}
.btn:active { transform: scale(.97); }
.btn.sec { background: #fff; color: var(--teal); border: 2px solid var(--teal); }
.btn.coral { background: var(--coral); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn:focus-visible, .qcm-btn:focus-visible, .jeton:focus-visible, .choix:focus-visible {
  outline: 3px solid var(--coral); outline-offset: 2px;
}

.btn-audio {
  background: #fff; border: 2px solid var(--teal); color: var(--teal);
  border-radius: 99px; padding: 5px 13px; font-size: 14px; cursor: pointer;
  font-family: inherit; font-weight: 600; vertical-align: middle;
}
.btn-audio:active { transform: scale(.95); }

.consigne { font-size: 18px; font-weight: 600; margin: 6px 0 12px; }
.note { color: var(--mut); font-size: 14px; }

/* ---------------- connexion ---------------- */

.login-wrap { max-width: 480px; padding-top: 10px; }
.login-wrap label { display: block; font-size: 16px; font-weight: 600; margin: 10px 0 4px; }
.login-wrap input {
  display: block; width: 100%; font-size: 18px; padding: 12px;
  border: 2px solid var(--line); border-radius: 12px; font-family: inherit;
  margin-top: 4px;
}
.login-wrap input:focus { border-color: var(--teal); outline: none; }
.login-wrap .btn { width: 100%; margin-top: 8px; }
.login-wrap .btn.sec { width: 100%; margin-top: 12px; }
.btn-retirer {
  float: right; background: none; border: none; color: var(--mut);
  font-size: 16px; cursor: pointer;
}

/* ---------------- accueil : parcours et vignettes ---------------- */

.parcours-carte { border-left: 6px solid var(--teal); }
.parcours-carte.verrouille { opacity: .65; border-left-color: var(--mut); }
.parcours-entete { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.parcours-entete h2 { font-size: 19px; }
.parcours-entete .niveau { color: var(--mut); font-size: 14px; }

/* Barre de progression en segments cochés — jamais de chiffre-score */
.prog-equipe { display: flex; gap: 5px; margin: 10px 0; flex-wrap: wrap; }
.prog-seg {
  width: 26px; height: 12px; border-radius: 99px; background: var(--line);
  display: inline-flex; align-items: center; justify-content: center;
}
.prog-seg.fait { background: var(--ok); }

.vignettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 10px; }
.vignette {
  display: block; text-align: left; background: #fff; border: 2.5px solid var(--line);
  border-radius: 12px; padding: 10px 12px; cursor: pointer; font-family: inherit;
  font-size: 15px; min-height: 74px; text-decoration: none; color: var(--ink);
}
.vignette:hover:not(.verrouillee) { border-color: var(--teal); }
.vignette .etat { font-size: 18px; }
.vignette .code { color: var(--mut); font-size: 13px; }
.vignette .titre { font-weight: 700; display: block; margin-top: 2px; }
.vignette.faite { border-color: var(--ok); background: var(--ok-l); }
.vignette.verrouillee { opacity: .55; cursor: not-allowed; background: var(--sand); }
.vignette.conseillee { border-color: var(--coral); box-shadow: 0 0 0 3px var(--coral-l); }
.vignette.animer-fait { animation: vFait .8s ease; }
@keyframes vFait {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); border-color: var(--ok); }
  100% { transform: scale(1); }
}

/* ---------------- lecteur d'activité ---------------- */

.progress { display: flex; gap: 5px; margin: 14px 0 4px; }
.pstep { flex: 1; height: 8px; border-radius: 99px; background: var(--line); border: none; padding: 0; cursor: default; }
.pstep.done { background: var(--teal); cursor: pointer; }
.pstep.now { background: var(--coral); }

.etape { display: none; }
.etape.on { display: block; animation: pop .25s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.etq {
  display: inline-block; background: var(--coral-l); color: var(--coral);
  font-weight: 700; border-radius: 99px; padding: 3px 13px; font-size: 13px; margin-bottom: 8px;
}

.relecture-bandeau {
  background: var(--teal-l); border: 1.5px solid var(--teal); color: var(--teal);
  border-radius: 12px; padding: 8px 14px; margin: 10px 0; font-weight: 600; font-size: 15px;
  display: none;
}
.relecture .relecture-bandeau { display: block; }
.relecture .card { pointer-events: none; opacity: .92; }
.relecture .relecture-bandeau, .relecture .relecture-bandeau * { pointer-events: auto; }

/* bulle de dialogue */
.bulle { display: flex; gap: 12px; align-items: flex-start; }
.avatar {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--teal); flex-shrink: 0; background: var(--teal-l);
}
.parole { background: var(--teal-l); border-radius: 4px 16px 16px 16px; padding: 12px 14px; font-size: 16.5px; }

.photo { width: 100%; border-radius: 12px; display: block; }

.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }

/* choix photo (observation) */
.choix {
  background: #fff; border: 3px solid var(--line); border-radius: 14px;
  padding: 8px; cursor: pointer; text-align: center; font-family: inherit; font-size: 15px;
}
.choix img { width: 100%; border-radius: 10px; display: block; }
.choix p { font-weight: 700; margin-top: 6px; font-size: 15px; }
.choix.sel { border-color: var(--teal); background: var(--teal-l); }
.choix.ok { border-color: var(--ok); background: var(--ok-l); }
.choix.ko { border-color: var(--ko); background: var(--ko-l); }

/* QCM */
.qcm-btn {
  display: block; width: 100%; text-align: left; background: #fff;
  border: 2.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font-size: 16px; margin: 7px 0; cursor: pointer; font-family: inherit;
}
.qcm-btn.sel { border-color: var(--teal); background: var(--teal-l); font-weight: 600; }
.qcm-btn.ok { border-color: var(--ok); background: var(--ok-l); font-weight: 700; }
.qcm-btn.ko { border-color: var(--ko); background: var(--ko-l); }

/* feedbacks */
.fb { border-radius: 12px; padding: 11px 14px; font-size: 15.5px; font-weight: 600; margin-top: 10px; display: none; }
.fb.ok { display: block; background: var(--ok-l); color: var(--ok); }
.fb.ko { display: block; background: var(--ko-l); color: var(--ko); }
.fb.info { display: block; background: #FFF8E7; color: #7A5A00; }

/* mots du jour */
.mot {
  display: flex; align-items: center; gap: 10px; background: var(--sand);
  border-radius: 12px; padding: 9px 12px; margin: 6px 0; font-size: 17px;
}
.mot b { flex: 1; }

/* remise en ordre : jetons + cases */
.pool { display: flex; flex-wrap: wrap; gap: 9px; margin: 10px 0; }
.jeton {
  background: #fff; border: 2.5px solid var(--teal); color: var(--teal);
  border-radius: 12px; padding: 10px 14px; font-size: 15.5px; font-weight: 700;
  cursor: pointer; font-family: inherit; text-align: left;
}
.jeton:disabled { opacity: .25; cursor: default; }
.slots { display: flex; flex-direction: column; gap: 7px; margin: 10px 0; }
.slot {
  border: 2px dashed var(--line); border-radius: 12px; min-height: 46px;
  padding: 8px 12px; font-size: 15.5px; display: flex; align-items: center;
  gap: 8px; color: var(--mut);
}
.slot.fill { border-style: solid; border-color: var(--teal); background: var(--teal-l); color: var(--ink); font-weight: 700; cursor: pointer; }
.slot.good { border-color: var(--ok); background: var(--ok-l); cursor: default; }
.num {
  background: var(--teal); color: #fff; border-radius: 50%;
  width: 26px; height: 26px; display: inline-flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 13px; flex-shrink: 0;
}

/* trous / rapport */
.rapport-ligne { font-size: 17px; margin: 12px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
select.trou, .rapport-ligne select {
  font-size: 16px; padding: 9px 10px; border-radius: 10px;
  border: 2px solid var(--teal); font-family: inherit; background: #fff;
  color: var(--ink); font-weight: 600;
}

/* encadré savoir */
.savoir { background: #FFF8E7; border: 2px solid #F0C948; border-radius: 14px; padding: 14px; margin: 12px 0; }
.savoir h3 { font-size: 16px; margin-bottom: 6px; }

/* documents (étape je cherche) */
.doc { border: 2px solid var(--line); border-radius: 12px; padding: 10px; margin: 10px 0; background: #fff; }
.doc .legende { color: var(--mut); font-size: 14px; margin-top: 6px; }
.doc table { border-collapse: collapse; width: 100%; font-size: 15px; }
.doc th, .doc td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; }
.doc th { background: var(--teal-l); }
.doc .texte { font-size: 16px; }

/* zones cliquables sur image */
.zones-conteneur { position: relative; display: inline-block; width: 100%; }
.zones-conteneur img { width: 100%; border-radius: 12px; display: block; }
.zone {
  position: absolute; border: 3px solid #fff; background: rgba(15, 118, 110, .35);
  border-radius: 50%; cursor: pointer; transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px; text-shadow: 0 1px 3px rgba(0,0,0,.6);
  min-width: 44px; min-height: 44px;
}
.zone.sel { background: rgba(216, 90, 48, .55); border-color: var(--coral); }
.zone.ok { background: rgba(46, 125, 50, .6); border-color: var(--ok); }
.zone.ko { background: rgba(198, 40, 40, .6); border-color: var(--ko); }

/* lexique survolable */
.lex { color: var(--teal); font-weight: 700; border-bottom: 2px dotted var(--teal); cursor: help; }
#tip {
  position: absolute; z-index: 50; background: #fff; border: 2px solid var(--teal);
  border-radius: 14px; padding: 10px; width: 260px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18); display: none;
}
#tip img { width: 100%; border-radius: 10px; display: block; }
#tip p { font-size: 14px; margin-top: 6px; }

/* indice */
.indice-lien {
  background: none; border: none; color: var(--mut); font-size: 14.5px;
  cursor: pointer; text-decoration: underline dotted; font-family: inherit;
  padding: 4px 0; display: inline-block; margin-top: 8px;
}
.indice-texte {
  display: none; background: var(--teal-l); border-radius: 10px;
  padding: 9px 12px; font-size: 15px; margin-top: 6px;
}
.indice-texte.on { display: block; }

/* navigation bas de carte */
.navrow { display: flex; justify-content: flex-end; margin-top: 14px; gap: 8px; flex-wrap: wrap; }
.navrow.gauche { justify-content: flex-start; }

/* ---------------- la Leçon ---------------- */

.lecon { background: #fff; border: 3px solid var(--teal); border-radius: 16px; overflow: hidden; margin: 12px 0; }
.lecon-titre { background: var(--teal); color: #fff; padding: 10px 16px; font-weight: 700; font-size: 16px; }
.lecon-corps { padding: 16px; background: repeating-linear-gradient(#fff, #fff 30px, #EAF4F3 31px); }
.lecon-corps h3 { font-size: 17px; margin: 8px 0 4px; color: var(--teal); }
.lecon-corps p, .lecon-corps li { font-size: 16px; }
.lecon-corps ul { margin: 4px 0 10px 22px; }
.lecon-schema { width: 100%; height: auto; background: #fff; border-radius: 10px; }

.check { font-size: 15.5px; margin: 6px 0; display: flex; gap: 8px; align-items: flex-start; }

.confetti { position: fixed; top: -10px; font-size: 22px; animation: fall 2.6s linear forwards; z-index: 99; pointer-events: none; }
@keyframes fall { to { transform: translateY(105vh) rotate(360deg); opacity: .6; } }

footer { text-align: center; color: var(--mut); font-size: 12.5px; margin-top: 26px; }

/* module chaîne d'énergie */
.chaine-flux { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; margin: 12px 0; }
.maillon {
  border: 2.5px solid var(--teal); background: var(--teal-l); border-radius: 12px;
  padding: 10px 12px; font-weight: 700; font-size: 15px; text-align: center;
  min-width: 105px; cursor: pointer; font-family: inherit; color: var(--ink);
}
.maillon.coupe { border-color: var(--ko); background: var(--ko-l); text-decoration: line-through; opacity: .8; }
.maillon .sous { display: block; font-weight: 400; font-size: 12.5px; color: var(--mut); }
.fleche-flux { display: flex; align-items: center; padding: 0 4px; font-size: 20px; color: var(--mut); position: relative; }
.fleche-flux .pt { position: absolute; left: 0; top: 50%; width: 8px; height: 8px; border-radius: 50%; background: var(--coral); opacity: 0; }
.fleche-flux.actif .pt { animation: flux 1.2s linear infinite; }
@keyframes flux { 0% { opacity: 0; transform: translate(0, -50%); } 15% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(26px, -50%); } }
.etiquette-energie { margin: 4px 6px; }

/* module banc d'essai */
.banc-grille { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 10px 0; }
.banc-objet { border: 2.5px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; background: #fff; }
.banc-objet h4 { font-size: 16px; margin-bottom: 6px; }
.banc-visu { font-size: 40px; display: inline-block; }
.banc-visu.tourne { animation: tourner 1s linear infinite; }
.banc-visu.tourne.vite { animation-duration: .45s; }
@keyframes tourner { to { transform: rotate(360deg); } }
.banc-mesure { font-size: 18px; font-weight: 700; color: var(--teal); min-height: 28px; }
.banc-tableau { margin-top: 10px; }
.banc-graphe { width: 100%; height: auto; margin-top: 10px; }

/* ---------------- modules avancés ---------------- */

/* simulateur réseau */
.reseau-plan { position: relative; width: 100%; height: 340px; background: var(--sand);
  border: 2px solid var(--line); border-radius: 14px; margin: 10px 0; overflow: hidden; }
.reseau-liens { position: absolute; inset: 0; width: 100%; height: 100%; }
.reseau-noeud { position: absolute; transform: translate(-50%, -50%); background: #fff;
  border: 2.5px solid var(--teal); border-radius: 12px; padding: 6px 10px; cursor: pointer;
  font-family: inherit; font-size: 13.5px; text-align: center; min-width: 74px; z-index: 2; }
.reseau-noeud.sel { border-color: var(--coral); background: var(--coral-l); }
.reseau-noeud .rn-emoji { display: block; font-size: 22px; }
.reseau-noeud .rn-nom { font-weight: 700; }
.reseau-noeud .rn-ip { display: block; font-family: Consolas, monospace; font-size: 12px; color: var(--mut); }
.rn-saisie { display: block; width: 110px; margin: 4px auto 0; font-family: Consolas, monospace;
  font-size: 13px; padding: 4px 6px; border: 2px solid var(--line); border-radius: 8px; }

/* traducteur binaire */
.binaire-grille { display: grid; gap: 3px; margin: 10px 0; }
.binaire-pixel { width: 26px; height: 26px; border: 1.5px solid var(--line); border-radius: 4px;
  background: #fff; cursor: pointer; padding: 0; }
.binaire-pixel.noir { background: var(--ink); }

/* mini-tableur */
.tableur-titre { cursor: pointer; user-select: none; white-space: nowrap; }
.tableur-titre:hover { background: var(--coral-l); }

/* éditeur de schéma */
.schema-cadre { border: 2px dashed var(--mut); border-radius: 14px; padding: 12px; margin: 10px 0; }
.schema-frontiere { color: var(--mut); font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.schema-flux { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.schema-slot { border: 2px dashed var(--line); border-radius: 12px; min-width: 120px; min-height: 52px;
  padding: 8px 10px; font-size: 14.5px; background: #fff; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px; color: var(--mut); }
.schema-slot.rempli { border-style: solid; border-color: var(--teal); background: var(--teal-l);
  color: var(--ink); font-weight: 700; }
.schema-slot.bon { border-color: var(--ok); background: var(--ok-l); }
.schema-fleche { font-size: 18px; color: var(--mut); display: inline-flex; flex-direction: column;
  align-items: center; padding: 0 2px; }
.schema-fleche em { font-size: 11px; font-style: normal; color: var(--coral); max-width: 90px; text-align: center; }
.jeton.sel { background: var(--coral-l); border-color: var(--coral); color: var(--coral); }

/* gestion de projet */
.projet-frise td, .projet-frise th { text-align: center; }
.projet-case { width: 42px; height: 34px; cursor: pointer; background: #fff; }
.projet-case:hover { background: var(--coral-l); }
.projet-case.posee { background: var(--teal); }
.projet-case.fixe { background: var(--sand); cursor: default; }

/* croquis */
.croquis-barre { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.croquis-barre .actif-outil { background: var(--teal); color: #fff; }
.croquis-couleur { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--line); cursor: pointer; }
.croquis-zone { width: 100%; height: 320px; border: 2px solid var(--line); border-radius: 12px;
  background: #fff; touch-action: none; cursor: crosshair; }

/* ---------------- petits écrans ---------------- */

@media (max-width: 560px) {
  .bulle { flex-direction: column; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .vignettes { grid-template-columns: 1fr 1fr; }
}

/* ---------------- version imprimable (plan B papier) ---------------- */

@media print {
  header, .btn, .btn-audio, .btn-quitter, .navrow, .indice-lien, .progress,
  .pool, footer .no-print, #tip { display: none !important; }
  body { background: #fff; padding: 0; font-size: 12pt; }
  .etape { display: block !important; page-break-inside: avoid; }
  .card { border: 1px solid #999; box-shadow: none; }
  .slot { min-height: 34px; border: 1.5px solid #999; }
  .lecon-corps { background: #fff; }
  .mode-papier .jeton { display: inline-block !important; border: 1.5px solid #333; color: #000; }
  .mode-papier .pool { display: flex !important; }
}


/* ==========================================================================
   « Les cours » — bibliothèque publique des notions (cours.php)
   ========================================================================== */

.wrap-large { max-width: 1180px; }
.lien-header { color: #fff; text-decoration: none; background: rgba(255, 255, 255, .18);
  border-radius: 99px; padding: 4px 14px; font-size: 14px; font-weight: 600; }
.lien-header:hover { background: rgba(255, 255, 255, .3); }
.page-cours h1 { margin-top: 18px; }

.cours-outils { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0 10px; }
#cours-recherche { flex: 1; min-width: 220px; padding: 12px 14px; font-size: 16px;
  border: 2px solid var(--line); border-radius: 12px; background: #fff; font-family: inherit; }
#cours-recherche:focus { outline: none; border-color: var(--teal); }
.cours-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-filtre { border: 2px solid var(--line); background: #fff; border-radius: 99px;
  padding: 7px 14px; font-size: 14px; cursor: pointer; font-weight: 600; color: var(--mut);
  font-family: inherit; }
.chip-filtre.actif { border-color: var(--teal); background: var(--teal-l); color: var(--teal); }

.cours-sommaire { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.somm-lien { text-decoration: none; color: var(--ink); background: #fff; font-weight: 600;
  font-size: 14px; border: 2px solid var(--line); border-left-width: 6px; border-radius: 10px;
  padding: 7px 12px; }
.somm-lien:hover { background: var(--teal-l); }

.famille-titre { margin: 30px 0 12px; font-size: 22px; display: flex; align-items: baseline;
  gap: 10px; scroll-margin-top: 70px; }
.famille-compte { font-size: 13px; color: var(--mut); font-weight: 400; }
.famille-section[hidden] { display: none; }

.cours-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
@media (max-width: 380px) { .cours-grille { grid-template-columns: 1fr; } }

.notion-carte { background: var(--card); border: 1px solid var(--line); border-top: 5px solid var(--teal);
  border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .05); scroll-margin-top: 80px; }
.notion-carte[hidden] { display: none; }
.notion-carte.flash { animation: notionFlash 1.8s ease; }
@keyframes notionFlash {
  0%, 55% { box-shadow: 0 0 0 4px var(--coral); }
  100% { box-shadow: 0 1px 4px rgba(0, 0, 0, .05); }
}
.notion-tete { display: flex; align-items: flex-start; gap: 8px; }
.notion-emoji { font-size: 24px; line-height: 1.2; }
.notion-tete .notion-titre { font-size: 17.5px; flex: 1; line-height: 1.3; margin: 0; }
.badge-niveau { font-size: 12px; border-radius: 99px; padding: 3px 10px; background: var(--teal-l);
  color: var(--teal); font-weight: 700; white-space: nowrap; }
.notion-accroche { font-weight: 600; }
.notion-visuel { background: var(--sand); border-radius: 12px; padding: 12px; min-height: 90px; }
.notion-svg { width: 100%; height: auto; display: block; }
.n-svg-petit { max-width: 190px; }
.notion-explication { font-size: 15px; }
.notion-vocab { display: flex; flex-wrap: wrap; gap: 6px; }

/* mot de vocabulaire survolable (info-bulle CSS pure) */
.vmot { position: relative; background: var(--coral-l); color: var(--coral); border-radius: 99px;
  padding: 3px 11px; font-size: 13.5px; font-weight: 600; cursor: help; }
.vmot::after { content: attr(data-def); position: absolute; left: 0; bottom: calc(100% + 7px);
  background: var(--ink); color: #fff; font-weight: 400; font-size: 13.5px; line-height: 1.4;
  border-radius: 10px; padding: 8px 12px; width: max-content; max-width: 250px; z-index: 20;
  opacity: 0; pointer-events: none; transition: opacity .15s; }
.vmot:hover::after, .vmot:focus::after { opacity: 1; }

.notion-pied { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.notion-liens { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.n-lien { border: 1.5px solid var(--line); background: #fff; border-radius: 99px; cursor: pointer;
  padding: 4px 11px; font-size: 12.5px; font-family: inherit; color: var(--ink); }
.n-lien:hover { border-color: var(--teal); background: var(--teal-l); }

/* briques des visuels interactifs */
.n-chip { border: 2px solid var(--teal); background: #fff; color: var(--teal); border-radius: 12px;
  padding: 9px 14px; font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit; }
.n-chip:hover { background: var(--teal-l); }
.n-chip.actif { background: var(--teal); color: #fff; }
.n-chip:disabled { opacity: .5; cursor: default; }
.n-chip.n-gros { font-size: 18px; padding: 14px 22px; border-radius: 99px; }
.n-presenter { border-color: var(--line); color: var(--mut); font-size: 13px; padding: 6px 12px; }
.n-presenter:hover { border-color: var(--teal); color: var(--teal); }
.n-tuiles { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.n-tuile { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 86px; }
.n-tuile-fixe { border: 2px solid var(--line); border-radius: 12px; padding: 9px 12px;
  background: #fff; font-size: 13.5px; text-align: center; }
.n-tuile-emoji { display: block; font-size: 26px; }
.n-micro { display: block; font-size: 11.5px; color: var(--mut); min-height: 15px; }
.n-bit { display: block; font-size: 18px; font-weight: 700; }
.n-grand { font-size: 16.5px; margin: 6px 0; }
.n-note { font-size: 13.5px; color: var(--mut); margin: 4px 0 0; }
.n-ligne { margin: 8px 0; }
.n-label { font-weight: 600; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.n-label input[type="range"] { flex: 1; min-width: 140px; accent-color: var(--teal); }
.n-champ { padding: 10px 12px; font-size: 16px; border: 2px solid var(--line); border-radius: 10px;
  font-family: inherit; min-width: 200px; }
.n-champ:focus { outline: none; border-color: var(--teal); }
.mono { font-family: Consolas, "Courier New", monospace; }
.n-code { background: #fff; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 14px; margin: 6px 0; }
.n-octets { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.n-octet { background: #fff; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 6px 10px; font-size: 14px; }
.n-branche { border: 2px solid var(--line); border-radius: 12px; padding: 10px 14px;
  background: #fff; font-size: 15px; opacity: .45; }
.n-branche.actif { border-color: var(--ok); background: var(--ok-l); opacity: 1; }
.n-etapes { margin: 10px 0 0 22px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; }
.n-etapes li { border-radius: 8px; padding: 4px 8px; }
.n-etapes li.actif { background: #FDE68A; font-weight: 700; }
.n-boite-var { display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  border: 3px solid var(--teal); border-radius: 14px; padding: 12px 26px; background: #fff; }
.n-var-nom { font-size: 13px; color: var(--mut); }
.n-var-val { font-size: 34px; font-weight: 700; color: var(--teal); }
.n-etiquette { background: #fff; border: 1.5px solid var(--line); border-radius: 10px;
  padding: 7px 11px; font-size: 13px; text-align: center; line-height: 1.5; }
.n-criteres { list-style: none; margin: 8px 0; display: flex; flex-direction: column; gap: 4px;
  font-size: 14.5px; }
.n-criteres li.ok { color: var(--ok); font-weight: 600; }
.n-jauge { height: 14px; background: #fff; border: 1.5px solid var(--line); border-radius: 99px;
  overflow: hidden; flex: 1; min-width: 120px; margin: 6px 0; }
.n-jauge-fill { height: 100%; width: 0; border-radius: 99px; background: var(--teal);
  transition: width .3s, background .3s; }
.n-barres { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.n-barre-ligne { display: flex; align-items: center; gap: 10px; }
.n-barre-nom { width: 125px; font-size: 13.5px; text-align: right; color: var(--mut); }
.n-flex { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.n-borne { background: var(--ink); border-radius: 16px; padding: 14px; display: flex;
  flex-direction: column; gap: 10px; }
.n-ecran { background: #0B3B38; color: #7CF2E4; border-radius: 8px; padding: 16px 14px;
  font-size: 17px; min-height: 54px; }
.n-ecran-flash { animation: ecranFlash .35s ease; }
@keyframes ecranFlash { 0% { background: #12655F; } 100% { background: #0B3B38; } }
.n-borne .n-tuiles { margin: 0; }
.n-borne .n-chip { background: var(--sand); border-color: var(--sand); color: var(--ink); }
.reseau-noeud.rn-ok { border-color: var(--ok); background: var(--ok-l); }
.reseau-noeud.rn-ko { border-color: var(--ko); background: var(--ko-l); }

/* grand écran (présentation) et atelier Blockly */
.cours-modal { position: fixed; inset: 0; background: rgba(20, 25, 25, .55); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 16px; }
.cours-modal-carte { position: relative; background: var(--card); border-radius: 18px;
  max-width: 1000px; width: 100%; max-height: 94vh; overflow: auto; padding: 24px;
  font-size: 18px; }
.cours-modal-carte .notion-titre { font-size: 26px; }
.cours-modal-carte .notion-explication { font-size: 18px; }
.cours-modal-carte .notion-visuel { padding: 18px; }
.cours-modal-fermer { position: absolute; top: 12px; right: 12px; border: none; z-index: 5;
  background: var(--sand); border-radius: 50%; width: 40px; height: 40px; font-size: 18px;
  cursor: pointer; }
.cours-modal-fermer:hover { background: var(--coral-l); color: var(--coral); }
.n-atelier { display: flex; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.n-atelier-blocs { flex: 2; min-width: 300px; height: 55vh; min-height: 320px;
  border: 2px solid var(--line); border-radius: 12px; overflow: hidden; }
.n-atelier-code { flex: 1; min-width: 200px; background: var(--ink); color: #7CF2E4;
  border-radius: 12px; padding: 14px; font-size: 14px; white-space: pre-wrap; margin: 0;
  max-height: 55vh; overflow: auto; }
/* lien « les cours » sous le formulaire de connexion */
.acces-cours { text-align: center; margin: 22px 0 8px; }
.acces-cours a { color: var(--teal); font-weight: 600; text-decoration: none;
  border: 2px solid var(--teal-l); background: #fff; border-radius: 12px; padding: 12px 18px;
  display: inline-block; }
.acces-cours a:hover { background: var(--teal-l); }

/* ==========================================================================
   « Le Flux » — mini-cours à faire défiler (flux.php)
   ========================================================================== */

.page-flux { background: #10201D; color: #F2EFE8; overflow: hidden; height: 100vh;
  height: 100dvh; display: flex; flex-direction: column; padding-bottom: 0; }
.flux-tete { display: flex; align-items: center; gap: 14px; padding: 10px 16px;
  background: rgba(0, 0, 0, .35); z-index: 10; flex-wrap: wrap; }
.flux-tete .lien-header { background: rgba(255, 255, 255, .12); }
#flux-audio { border: 2px solid rgba(255, 255, 255, .3); background: transparent;
  color: #F2EFE8; border-radius: 99px; padding: 6px 14px; font-size: 13.5px;
  cursor: pointer; font-family: inherit; margin-left: auto; }
#flux-audio.actif { background: var(--teal); border-color: var(--teal); }
#flux-points { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; }
.flux-pts { font-size: 19px; font-weight: 700; color: #FFD666; white-space: nowrap; }
.flux-barre { width: 130px; height: 10px; border-radius: 99px;
  background: rgba(255, 255, 255, .15); overflow: hidden; }
.flux-barre-fill { height: 100%; background: #FFD666; border-radius: 99px;
  transition: width .5s; }
.flux-cible { font-size: 12px; color: rgba(242, 239, 232, .75); }
.flux-membres { display: flex; gap: 6px; flex-wrap: wrap; }
.flux-membre { font-size: 12px; background: rgba(255, 255, 255, .12);
  border-radius: 99px; padding: 2px 10px; }
.flux-horsligne { background: var(--ko); color: #fff; text-align: center;
  padding: 6px; font-size: 14px; z-index: 10; }

#flux-scene { flex: 1; position: relative; overflow: hidden; }
#flux-liste { height: 100%; transition: transform .45s ease; }
.flux-item { height: 100%; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; padding: 12px 74px 12px 16px; }
.flux-media { width: 100%; max-width: 700px; display: flex; justify-content: center; }
.flux-media img, .flux-media video { max-width: 100%; max-height: 48vh;
  border-radius: 16px; box-shadow: 0 8px 30px rgba(0, 0, 0, .45); }
.flux-anim { background: var(--sand); color: var(--ink); border-radius: 16px;
  padding: 14px; width: 100%; max-width: 700px; max-height: 52vh; overflow: auto; }
.flux-texte { max-width: 700px; text-align: center; }
.flux-texte h2 { font-size: 22px; margin-bottom: 6px; }
.flux-texte p { font-size: 16.5px; line-height: 1.5; }
.flux-texte b { color: #FFD666; }
.flux-compteur { display: inline-block; margin-top: 8px; font-size: 12px;
  color: rgba(242, 239, 232, .6); }

/* la question du mode exercice */
.flux-question { display: none; max-width: 700px; width: 100%; background: #fff;
  color: var(--ink); border-radius: 16px; padding: 14px 16px; }
.flux-question.visible { display: block; animation: fluxMonte .3s ease; }
@keyframes fluxMonte { from { transform: translateY(24px); opacity: 0; } }
.flux-q { font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.flux-option { display: block; width: 100%; text-align: left; margin: 6px 0;
  border: 2px solid var(--line); background: #fff; border-radius: 12px;
  padding: 11px 14px; font-size: 15.5px; cursor: pointer; font-family: inherit; }
.flux-option:hover { border-color: var(--teal); }
.flux-option.bonne { border-color: var(--ok); background: var(--ok-l); font-weight: 700; }
.flux-option.mauvaise { border-color: var(--ko); background: var(--ko-l); opacity: .7; }
.flux-explication { margin-top: 8px; font-size: 14px; }
.flux-question.secoue { animation: fluxSecoue .35s ease; }
@keyframes fluxSecoue { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }

/* la navigation (anneau des 5 secondes) */
.flux-nav { position: fixed; right: 14px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 12px; z-index: 10; }
.flux-nav button { position: relative; width: 54px; height: 54px; border-radius: 50%;
  border: none; background: rgba(255, 255, 255, .14); color: #F2EFE8; font-size: 19px;
  cursor: pointer; }
#flux-suivant svg { position: absolute; inset: 0; width: 100%; height: 100%;
  transform: rotate(-90deg); }
#flux-suivant span { position: relative; }
.flux-anneau-fond, .flux-anneau-fill { fill: none; stroke-width: 4; }
.flux-anneau-fond { stroke: rgba(255, 255, 255, .18); }
.flux-anneau-fill { stroke: #FFD666; stroke-linecap: round; stroke-dasharray: 163;
  stroke-dashoffset: 163; }
#flux-suivant.pret { background: var(--teal); animation: fluxPret 1.6s ease infinite; }
#flux-suivant.pret .flux-anneau-fill { stroke: transparent; }
@keyframes fluxPret { 50% { transform: translateY(4px); } }
#flux-suivant.secoue { animation: fluxSecoue .35s ease; }

/* gains flottants et grandes célébrations */
.flux-gain { position: absolute; right: 84px; top: 46%; font-size: 30px; font-weight: 700;
  z-index: 12; pointer-events: none; animation: fluxGain 1.4s ease forwards; }
.flux-gain.plus { color: #FFD666; }
.flux-gain.moins { color: #FF8A80; }
@keyframes fluxGain { from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-70px); } }
.flux-fete { position: fixed; inset: 0; background: rgba(10, 20, 18, .8); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 18px; }
.flux-fete-carte { background: #fff; color: var(--ink); border-radius: 20px;
  padding: 30px 34px; text-align: center; max-width: 460px;
  animation: fluxMonte .35s ease; }
.flux-fete-carte.badge { border: 4px solid #FFD666;
  box-shadow: 0 0 60px rgba(255, 214, 102, .5); }
.flux-fete-emoji { font-size: 60px; display: block; margin-bottom: 8px; }
.flux-fete-carte h2 { margin-bottom: 10px; }
.flux-fete-carte p { margin-bottom: 14px; }

/* bandeau badge Ingénieur sur le profil (app.php) */
.bandeau-badge { background: linear-gradient(90deg, #B8860B, #FFD666, #B8860B);
  color: #3A2E00; text-align: center; font-weight: 700; padding: 9px 14px;
  font-size: 15.5px; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
/* photo des cartes de notions */
.n-photo { width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; margin: 6px 0; display: block; }
.cours-modal-carte .n-photo { max-height: 380px; }


/* ==========================================================================
   Accueil élève façon « carte de l'aventure » : 3 cartes par ligne,
   pastilles de missions numérotées (le titre s'affiche au survol).
   ========================================================================== */

.wrap:has(.accueil-mondes) { max-width: 1180px; }
.accueil-mondes {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 14px;
}
@media (max-width: 960px) { .accueil-mondes { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .accueil-mondes { grid-template-columns: 1fr; } }

.parcours-carte2 {
  background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  box-shadow: 0 3px 14px rgba(38, 34, 28, .08); display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.parcours-carte2:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(38, 34, 28, .14); }
.parcours-carte2.verrouille { opacity: .6; }
.parcours-bande { padding: 12px 14px; color: #fff; display: flex; align-items: baseline;
  gap: 8px; flex-wrap: wrap; }
.parcours-bande h2 { font-size: 16px; flex: 1; line-height: 1.35; }
.parcours-niveau { background: rgba(255, 255, 255, .22); border-radius: 99px;
  padding: 2px 11px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.bande-5e { background: linear-gradient(120deg, #1D9E75, #15805D); }
.bande-4e { background: linear-gradient(120deg, #378ADD, #2668B0); }
.bande-3e { background: linear-gradient(120deg, #7F77DD, #5F55C4); }
.parcours-carte2 .sub { padding: 10px 14px 0; flex: 1; font-size: 13.5px; }

.pastilles-missions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px 16px; }
.pastille-mission {
  width: 54px; height: 54px; border-radius: 12px; border: 2px solid var(--line);
  background: #F8F9FB; display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-decoration: none; color: var(--ink);
  transition: transform .12s ease, border-color .12s ease;
}
.pastille-mission:hover { transform: scale(1.1); border-color: var(--teal); }
.pastille-mission .pm-num { font-weight: 700; font-size: 18px; line-height: 1.1; }
.pastille-mission .pm-etat { font-size: 11px; min-height: 14px; line-height: 1.2; }
.pastille-mission.faite { background: var(--ok-l); border-color: var(--ok); }
.pastille-mission.faite .pm-num { color: var(--ok); }
.pastille-mission.conseillee { border-color: var(--coral); box-shadow: 0 0 0 3px var(--coral-l); }
.pastille-mission.conseillee .pm-etat { color: var(--coral); }
.pastille-mission.verrouillee { opacity: .55; cursor: default; }
.pastille-mission.animer-fait { animation: pastilleFete .9s ease; }
@keyframes pastilleFete {
  0% { transform: scale(1); }
  40% { transform: scale(1.35) rotate(6deg); box-shadow: 0 0 0 6px var(--ok-l); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   Orientation (page publique) + liens désactivés « mise à jour en cours »
   ========================================================================== */

.lien-header.desactive { opacity: .55; cursor: not-allowed; }
.acces-cours { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.acces-desactive { color: var(--mut); background: #fff; border: 2px dashed var(--line);
  border-radius: 12px; padding: 12px 18px; display: inline-block; cursor: not-allowed;
  font-weight: 600; }

.or-hero { position: relative; border-radius: 18px; overflow: hidden; margin-top: 16px;
  box-shadow: 0 6px 24px rgba(38, 34, 28, .16); }
.or-hero img { width: 100%; height: 300px; object-fit: cover; display: block; }
.or-hero-texte { position: absolute; inset: 0; display: flex; flex-direction: column;
  justify-content: flex-end; padding: 22px 26px;
  background: linear-gradient(180deg, rgba(20, 15, 25, 0) 30%, rgba(20, 15, 25, .74)); }
.or-hero-texte h1 { color: #fff; margin: 0 0 6px; }
.or-hero-texte p { color: #F5EDE2; max-width: 640px; margin-bottom: 14px; }
.or-hero-texte .btn { align-self: flex-start; }
@media (max-width: 700px) { .or-hero img { height: 220px; } }

.or-ressources { margin-top: 16px; }
.or-ressources ul { list-style: none; margin: 10px 0 0; display: flex; flex-direction: column;
  gap: 9px; }
.or-ressources li { font-size: 15px; }
.or-ressources a { color: var(--teal); font-weight: 600; }

.or-domaines { margin-top: 18px; }
.bande-orientation { background: linear-gradient(120deg, #C2185B, #8E0F44); }