/* ═══════════════════════════════════════════════════════════
   LA CLASSE — maquette visuelle
   Palette : tableau vert, papier crème, craie, ambre & corail
   ═══════════════════════════════════════════════════════════ */

:root {
  --tableau:        #2e5b4e;
  --tableau-fonce:  #24473d;
  --tableau-bord:   #1b352e;
  --bois:           #a5713f;
  --bois-fonce:     #7d5028;
  --craie:          #f7f3e8;
  --craie-jaune:    #ffd95e;
  --papier:         #f7f2e7;
  --creme:          #fffdf7;
  --encre:          #2c3a34;
  --encre-douce:    #6b7a72;
  --ligne:          #e6dcc8;
  --ambre:          #f0a828;
  --ambre-fonce:    #d18f12;
  --corail:         #e8604c;
  --vert-ok:        #4f9d6f;
  --ombre:          0 6px 18px rgba(44, 58, 52, .1);
  --ombre-haute:    0 14px 34px rgba(44, 58, 52, .16);
  --rayon:          18px;
  --police-titre:   'Fredoka', 'Trebuchet MS', 'Segoe UI', sans-serif;
  --police-texte:   'Nunito', 'Segoe UI', Verdana, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--police-texte);
  background: var(--papier);
  color: var(--encre);
  min-height: 100vh;
  /* petit grain de papier */
  background-image: radial-gradient(rgba(44,58,52,.035) 1px, transparent 1px);
  background-size: 22px 22px;
}

h1, h2, h3, h4 { font-family: var(--police-titre); font-weight: 600; }

button { font-family: inherit; cursor: pointer; }
input  { font-family: inherit; }

/* ─────────── Écrans (navigation) ─────────── */

.ecran { display: none; min-height: 100vh; }
.ecran.actif { display: block; animation: apparition .45s ease both; }

@keyframes apparition {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─────────── Boutons communs ─────────── */

.btn-principal {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(180deg, var(--ambre), var(--ambre-fonce));
  color: #3d2c05; font-weight: 800; font-size: 1.02rem;
  border: none; border-radius: 999px; padding: 14px 26px;
  box-shadow: 0 5px 0 #a8720c, var(--ombre);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-principal:hover  { transform: translateY(-2px); box-shadow: 0 7px 0 #a8720c, var(--ombre-haute); }
.btn-principal:active { transform: translateY(2px);  box-shadow: 0 2px 0 #a8720c, var(--ombre); }
.btn-principal .fleche { transition: transform .2s ease; }
.btn-principal:hover .fleche { transform: translateX(4px); }

.btn-secondaire {
  background: var(--creme); color: var(--encre); font-weight: 800;
  border: 2px solid var(--ligne); border-radius: 999px; padding: 9px 20px;
  transition: border-color .15s ease, transform .15s ease, background .15s ease;
}
.btn-secondaire:hover { border-color: var(--ambre); background: #fff8e8; transform: translateY(-1px); }

.btn-fantome {
  width: 100%; background: transparent; color: var(--encre);
  border: 2px dashed var(--ligne); border-radius: 999px; padding: 12px;
  font-weight: 700; transition: border-color .15s, background .15s;
}
.btn-fantome:hover { border-color: var(--ambre); background: #fff8e8; }

.btn-rond {
  width: 46px; height: 46px; border-radius: 50%; border: 2px solid var(--ligne);
  background: var(--creme); font-size: 1.15rem; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .15s, border-color .15s, background .15s;
}
.btn-rond:hover { transform: scale(1.08); border-color: var(--ambre); }
.btn-rond.envoyer { background: var(--tableau); color: var(--craie); border-color: var(--tableau-bord); }
.btn-rond.envoyer:hover { background: var(--tableau-fonce); }

/* micro en train d'écouter */
.btn-rond.ecoute {
  background: #ffe9e5; border-color: var(--corail); position: relative;
  animation: pulsation 1.2s ease-in-out infinite;
}
@keyframes pulsation {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 96, 76, .45); }
  50%      { box-shadow: 0 0 0 10px rgba(232, 96, 76, 0); }
}

.lien-retour {
  background: none; border: none; color: var(--encre-douce);
  font-weight: 800; font-size: .95rem; padding: 8px 12px; border-radius: 10px;
  transition: color .15s, background .15s;
}
.lien-retour:hover { color: var(--encre); background: rgba(44,58,52,.06); }

/* ═══════════════════════ ÉCRAN 1 : CONNEXION ═══════════════════════ */

.connexion-grille {
  display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh;
}

/* — panneau tableau à craie — */
.pano-marque {
  position: relative; overflow: hidden;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(247,243,232,.07), transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(0,0,0,.25), transparent 60%),
    var(--tableau);
  border-right: 10px solid var(--bois);
  display: flex; align-items: center; justify-content: center;
  padding: 60px 40px;
}

.marque-contenu { position: relative; z-index: 2; max-width: 460px; }

.logo-rond {
  width: 76px; height: 76px; border-radius: 22px;
  background: var(--craie); font-size: 2.2rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--ombre-haute);
  transform: rotate(-4deg);
}

.titre-craie {
  margin-top: 22px; font-size: 4rem; color: var(--craie); font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 0 14px rgba(247,243,232,.25);
}
.titre-craie::after {
  content: ""; display: block; width: 190px; height: 5px; margin-top: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--craie-jaune), transparent);
  opacity: .9;
}

.slogan {
  margin-top: 16px; font-size: 1.35rem; line-height: 1.5;
  color: rgba(247,243,232,.92); font-weight: 600;
}

.arguments { list-style: none; margin-top: 38px; display: grid; gap: 18px; }
.arguments li {
  display: flex; gap: 14px; align-items: flex-start;
  background: rgba(247,243,232,.08);
  border: 1px solid rgba(247,243,232,.14);
  border-radius: 16px; padding: 14px 16px;
  backdrop-filter: blur(2px);
}
.arg-ico { font-size: 1.6rem; }
.arguments strong { display: block; color: var(--craie); font-size: 1.02rem; }
.arguments span:not(.arg-ico) { color: rgba(247,243,232,.75); font-size: .92rem; }

/* symboles de craie qui flottent */
.symbole {
  position: absolute; color: rgba(247,243,232,.16);
  font-family: var(--police-titre); font-weight: 600; user-select: none;
  animation: flottement 7s ease-in-out infinite;
}
.s1 { top: 8%;  left: 8%;  font-size: 3.4rem; animation-delay: 0s; }
.s2 { top: 16%; right: 12%; font-size: 2.4rem; animation-delay: 1.2s; }
.s3 { top: 48%; left: 4%;  font-size: 2.6rem; animation-delay: 2.1s; }
.s4 { bottom: 22%; right: 7%; font-size: 3rem; animation-delay: .6s; }
.s5 { bottom: 8%; left: 16%; font-size: 2.8rem; animation-delay: 1.7s; }
.s6 { top: 6%; right: 34%; font-size: 2rem; animation-delay: 2.6s; }
.s7 { bottom: 40%; right: 24%; font-size: 2.2rem; animation-delay: 3.2s; }
.s8 { top: 68%; left: 30%; font-size: 1.9rem; animation-delay: .9s; letter-spacing: 4px; }

@keyframes flottement {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-14px) rotate(3deg); }
}

/* — panneau carte de connexion — */
.pano-connexion {
  display: flex; align-items: center; justify-content: center; padding: 40px 24px;
}

.carte-connexion {
  width: 100%; max-width: 420px;
  background: var(--creme); border: 1px solid var(--ligne);
  border-radius: 26px; padding: 34px 32px;
  box-shadow: var(--ombre-haute);
}

.choix-profil {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: var(--papier); border-radius: 999px; padding: 6px; margin-bottom: 26px;
}
.profil-btn {
  border: none; background: transparent; border-radius: 999px;
  padding: 10px; font-weight: 800; color: var(--encre-douce);
  transition: background .2s, color .2s, box-shadow .2s;
}
.profil-btn.actif { background: var(--creme); color: var(--encre); box-shadow: var(--ombre); }

.carte-connexion h2 { font-size: 1.7rem; }
.sous-titre { color: var(--encre-douce); margin-top: 6px; margin-bottom: 24px; }

.champ { display: block; margin-bottom: 16px; }
.champ span { display: block; font-weight: 800; font-size: .9rem; margin-bottom: 7px; }
.champ input {
  width: 100%; border: 2px solid var(--ligne); border-radius: 14px;
  padding: 13px 16px; font-size: 1rem; background: #fff;
  transition: border-color .15s, box-shadow .15s; outline: none;
}
.champ input:focus { border-color: var(--ambre); box-shadow: 0 0 0 4px rgba(240,168,40,.18); }

#formulaire-connexion .btn-principal { width: 100%; margin-top: 8px; }

.separateur {
  display: flex; align-items: center; gap: 12px; margin: 22px 0;
  color: var(--encre-douce); font-size: .85rem; font-weight: 700;
}
.separateur::before, .separateur::after {
  content: ""; flex: 1; height: 1px; background: var(--ligne);
}

.note-maquette {
  margin-top: 20px; text-align: center; font-size: .78rem; color: #b3ab99;
}

/* ═══════════════════════ ÉCRAN 2 : ANNÉES ═══════════════════════ */

.page-etroite { max-width: 860px; margin: 0 auto; padding: 34px 22px 70px; }
.page-large  { max-width: 1120px; margin: 0 auto; padding: 30px 24px 70px; }

.entete-annees { text-align: center; margin: 20px 0 36px; }
.entete-annees h2 { font-size: 2.4rem; }
.entete-annees p  { color: var(--encre-douce); font-size: 1.15rem; margin-top: 8px; }

.groupe-titre { font-size: 1.25rem; margin: 30px 0 14px; }

.grille-annees {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px;
}

.carte-annee {
  position: relative; border-radius: var(--rayon); padding: 22px 14px 18px;
  background: var(--creme); border: 2px solid var(--ligne);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: transform .18s ease, border-color .18s, box-shadow .18s;
}
.annee-num { font-family: var(--police-titre); font-size: 2.3rem; font-weight: 700; line-height: 1; }
.annee-num sup { font-size: 1.1rem; }
.annee-nom { color: var(--encre-douce); font-weight: 700; font-size: .92rem; }

.carte-annee.dispo {
  border-color: var(--ambre);
  box-shadow: 0 0 0 4px rgba(240,168,40,.15), var(--ombre);
}
.carte-annee.dispo:hover { transform: translateY(-5px) scale(1.02); box-shadow: 0 0 0 4px rgba(240,168,40,.25), var(--ombre-haute); }
.badge-dispo {
  margin-top: 8px; background: var(--ambre); color: #3d2c05;
  font-size: .72rem; font-weight: 800; border-radius: 999px; padding: 4px 10px;
}

.carte-annee.bientot { opacity: .62; }
.carte-annee.bientot:hover { transform: none; }
.badge-bientot {
  margin-top: 8px; background: var(--papier); color: var(--encre-douce);
  border: 1px dashed var(--ligne);
  font-size: .72rem; font-weight: 800; border-radius: 999px; padding: 4px 10px;
}

/* petit « non non » quand on clique une année pas encore ouverte */
.carte-annee.secoue { animation: secousse .4s ease; }
@keyframes secousse {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.note-annees { text-align: center; color: var(--encre-douce); margin-top: 34px; }

/* ═══════════════════════ ÉCRAN 3 : TABLEAU DE BORD ═══════════════════════ */

.barre-haute {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 18px;
  background: rgba(255,253,247,.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ligne);
  padding: 10px 22px;
}

.barre-marque { display: flex; align-items: center; gap: 9px; }
.logo-mini {
  width: 40px; height: 40px; border-radius: 12px; background: var(--tableau);
  display: flex; align-items: center; justify-content: center; font-size: 1.25rem;
  transform: rotate(-4deg);
}
.nom-mini { font-family: var(--police-titre); font-weight: 700; font-size: 1.25rem; }

.onglets { display: flex; gap: 6px; margin: 0 auto; overflow-x: auto; }
.onglet-btn {
  border: none; background: transparent; border-radius: 999px;
  padding: 10px 18px; font-weight: 800; color: var(--encre-douce);
  white-space: nowrap; font-size: .95rem;
  transition: background .18s, color .18s;
}
.onglet-btn:hover { background: rgba(44,58,52,.06); color: var(--encre); }
.onglet-btn.actif { background: var(--tableau); color: var(--craie); }

.zone-profil { position: relative; }
.puce-profil {
  display: flex; align-items: center; gap: 10px;
  background: var(--creme); border: 2px solid var(--ligne); border-radius: 999px;
  padding: 5px 12px 5px 5px; transition: border-color .15s;
}
.puce-profil:hover { border-color: var(--ambre); }
.avatar-initiale {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(160deg, var(--ambre), var(--corail));
  color: #fff; font-weight: 800; font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center;
}
.puce-textes { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.puce-textes strong { font-size: .92rem; }
.puce-textes small  { color: var(--encre-douce); font-size: .74rem; font-weight: 700; }
.caret { color: var(--encre-douce); font-size: .8rem; }

.menu-profil {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px;
  background: var(--creme); border: 1px solid var(--ligne); border-radius: 16px;
  box-shadow: var(--ombre-haute); padding: 6px; z-index: 60;
  animation: apparition .2s ease both;
}
.menu-profil button {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 11px 14px; border-radius: 11px; font-weight: 800; font-size: .92rem;
  color: var(--encre); transition: background .15s;
}
.menu-profil button:hover { background: var(--papier); }

/* panneaux d'onglets */
.panneau { display: none; }
.panneau.actif { display: block; animation: apparition .35s ease both; }

/* — carte « reprendre » — */
.carte-reprendre {
  display: grid; grid-template-columns: auto 1fr auto; gap: 26px; align-items: center;
  background: var(--creme); border: 1px solid var(--ligne); border-radius: 24px;
  padding: 24px 28px; margin-bottom: 40px; box-shadow: var(--ombre);
}

.mini-tableau {
  width: 210px; border-radius: 14px; border: 6px solid var(--bois);
  background: radial-gradient(ellipse at 30% 20%, rgba(247,243,232,.08), transparent 60%), var(--tableau);
  padding: 16px 14px; display: flex; flex-direction: column; gap: 7px;
  box-shadow: var(--ombre);
  transform: rotate(-2deg);
}
.mini-craie-titre {
  color: var(--craie); font-family: var(--police-titre); font-size: 1.02rem;
  border-bottom: 2px solid rgba(247,243,232,.4); padding-bottom: 5px;
}
.mini-craie-ligne { color: rgba(247,243,232,.88); font-size: .9rem; }
.mini-craie-ligne.jaune { color: var(--craie-jaune); }

.etiquette-matiere {
  display: inline-block; background: #e4efe7; color: #2e5b4e;
  font-size: .78rem; font-weight: 800; border-radius: 999px; padding: 4px 12px;
  margin-bottom: 10px;
}
.reprendre-infos h3 { font-size: 1.55rem; margin-bottom: 6px; }
.reprendre-infos p  { color: var(--encre-douce); margin-bottom: 14px; }
.reprendre-infos .btn-principal { margin-top: 16px; }

.reprendre-prof { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.bulle-prof-mini {
  position: relative; max-width: 190px; background: var(--papier);
  border: 1px solid var(--ligne); border-radius: 16px; padding: 12px 14px;
  font-size: .88rem; font-style: italic; color: var(--encre);
}
.bulle-prof-mini::after {
  content: ""; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%) rotate(45deg);
  width: 14px; height: 14px; background: var(--papier);
  border-right: 1px solid var(--ligne); border-bottom: 1px solid var(--ligne);
}

.avatar-prof {
  width: 74px; height: 74px; border-radius: 50%; font-size: 2.3rem;
  background: radial-gradient(ellipse at 35% 30%, #3a7263, var(--tableau-fonce));
  border: 4px solid var(--bois);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--ombre);
  animation: respiration 3.5s ease-in-out infinite;
}
@keyframes respiration {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.045); }
}

/* — sections & grilles de cours — */
.entete-section {
  display: flex; align-items: center; gap: 12px; margin: 34px 0 16px;
}
.entete-section h3 { font-size: 1.35rem; }
.pastille-dispo {
  background: #e4efe7; color: #2e5b4e; font-size: .78rem; font-weight: 800;
  border-radius: 999px; padding: 4px 12px;
}
.pastille-bientot {
  background: var(--papier); color: var(--encre-douce); border: 1px dashed var(--ligne);
  font-size: .78rem; font-weight: 800; border-radius: 999px; padding: 4px 12px;
}

.grille-cours {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px;
}

.carte-cours {
  background: var(--creme); border: 1px solid var(--ligne); border-radius: 22px;
  overflow: hidden; box-shadow: var(--ombre);
  transition: transform .18s ease, box-shadow .18s ease;
}
.carte-cours:hover { transform: translateY(-6px); box-shadow: var(--ombre-haute); }

.cours-haut {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 18px; height: 92px;
}
.fond-vert   { background: linear-gradient(135deg, #35685a, #24473d); }
.fond-ambre  { background: linear-gradient(135deg, #f2b13f, #d18f12); }
.fond-corail { background: linear-gradient(135deg, #ec7460, #d34a35); }
.cours-ico { font-size: 2.3rem; filter: drop-shadow(0 3px 4px rgba(0,0,0,.25)); }

.pastille-etat {
  font-size: .72rem; font-weight: 800; border-radius: 999px; padding: 4px 11px;
  background: rgba(255,255,255,.92);
}
.pastille-etat.en-cours { color: #2e5b4e; }
.pastille-etat.nouveau  { color: var(--corail); }

.cours-corps { padding: 18px; }
.cours-corps h4 { font-size: 1.2rem; margin-bottom: 4px; }
.cours-corps > p { color: var(--encre-douce); font-size: .92rem; margin-bottom: 12px; }

.cours-meta {
  display: flex; gap: 14px; color: var(--encre-douce);
  font-size: .82rem; font-weight: 700; margin-bottom: 12px;
}

.barre-progression {
  height: 10px; border-radius: 99px; background: var(--papier);
  border: 1px solid var(--ligne); overflow: hidden;
}
.barre-progression.grande { height: 14px; max-width: 420px; }
.jauge {
  height: 100%; width: 0; border-radius: 99px;
  background: linear-gradient(90deg, var(--ambre), var(--corail));
  transition: width 1s cubic-bezier(.25, .9, .35, 1.2);
}

.cours-pied {
  display: flex; align-items: center; justify-content: space-between; margin-top: 14px;
}
.pct { font-weight: 800; color: var(--encre-douce); }

/* — autres matières — */
.grille-matieres {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px;
}
.carte-matiere {
  background: var(--creme); border: 2px dashed var(--ligne); border-radius: 18px;
  padding: 20px 14px; text-align: center; opacity: .72;
  display: flex; flex-direction: column; gap: 4px;
}
.carte-matiere span { font-size: 1.9rem; }
.carte-matiere small { color: var(--encre-douce); font-weight: 700; }

/* ─────────── Onglet progression ─────────── */

.grille-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px;
  margin-top: 8px;
}
.carte-stat {
  background: var(--creme); border: 1px solid var(--ligne); border-radius: 20px;
  padding: 20px; text-align: center; box-shadow: var(--ombre);
  display: flex; flex-direction: column; gap: 2px;
}
.stat-ico { font-size: 1.8rem; margin-bottom: 6px; }
.carte-stat strong { font-family: var(--police-titre); font-size: 1.65rem; }
.carte-stat small  { color: var(--encre-douce); font-weight: 700; }

.liste-progression { display: grid; gap: 12px; }
.ligne-progression {
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
  background: var(--creme); border: 1px solid var(--ligne); border-radius: 18px;
  padding: 16px 20px; box-shadow: var(--ombre);
}
.ligne-ico {
  width: 52px; height: 52px; border-radius: 15px; font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center;
}
.ligne-infos strong { display: block; }
.ligne-infos small  { display: block; color: var(--encre-douce); margin: 2px 0 8px; }
.ligne-pct { font-family: var(--police-titre); font-weight: 700; font-size: 1.15rem; }

.grille-badges {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px;
}
.badge-carte {
  background: var(--creme); border: 2px dashed var(--ligne); border-radius: 16px;
  padding: 16px 10px; text-align: center; opacity: .5; filter: grayscale(.8);
  display: flex; flex-direction: column; gap: 6px;
}
.badge-carte span { font-size: 1.9rem; }
.badge-carte small { font-weight: 800; color: var(--encre-douce); font-size: .78rem; }
.badge-carte.gagne {
  opacity: 1; filter: none; border-style: solid; border-color: var(--ambre);
  box-shadow: 0 0 0 4px rgba(240,168,40,.12);
}

.encart-parents {
  margin-top: 36px; display: flex; align-items: center; gap: 20px; justify-content: space-between;
  background: linear-gradient(135deg, #fdf3dc, #fbe8c8);
  border: 1px solid #f0dcb2; border-radius: 22px; padding: 22px 26px;
}
.encart-parents h4 { font-size: 1.15rem; margin-bottom: 4px; }
.encart-parents p  { color: #7a6a48; font-size: .95rem; max-width: 560px; }

/* ─────────── Onglet professeur ─────────── */

.carte-prof-presentation {
  display: grid; grid-template-columns: auto 1fr; gap: 34px; align-items: center;
  background: var(--creme); border: 1px solid var(--ligne); border-radius: 24px;
  padding: 30px 34px; margin-bottom: 26px; box-shadow: var(--ombre);
}
.prof-scene { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.avatar-prof.grand { width: 130px; height: 130px; font-size: 4rem; border-width: 6px; }
.etiquette-bois {
  background: var(--bois); color: #fff3e0; font-weight: 800; font-size: .8rem;
  border-radius: 8px; padding: 5px 14px; box-shadow: var(--ombre);
  letter-spacing: .5px;
}
.prof-texte h3 { font-size: 1.7rem; margin-bottom: 10px; }
.prof-texte p  { color: var(--encre-douce); line-height: 1.65; margin-bottom: 20px; max-width: 640px; }

.grille-talents {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px;
}
.carte-talent {
  background: var(--creme); border: 1px solid var(--ligne); border-radius: 20px;
  padding: 22px; box-shadow: var(--ombre);
  transition: transform .18s ease, box-shadow .18s ease;
}
.carte-talent:hover { transform: translateY(-5px); box-shadow: var(--ombre-haute); }
.carte-talent span { font-size: 2rem; display: block; margin-bottom: 10px; }
.carte-talent strong { display: block; font-family: var(--police-titre); font-size: 1.08rem; margin-bottom: 6px; }
.carte-talent p { color: var(--encre-douce); font-size: .92rem; line-height: 1.55; }

/* ═══════════════════════ ÉCRAN 4 : LA SALLE ═══════════════════════ */

#ecran-salle.actif { display: flex; flex-direction: column; height: 100vh; }

.barre-salle {
  display: flex; align-items: center; gap: 18px;
  background: rgba(255,253,247,.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--ligne); padding: 10px 22px; flex-shrink: 0;
}
.salle-titre { line-height: 1.2; }
.salle-titre strong { font-family: var(--police-titre); font-size: 1.1rem; display: block; }
.salle-titre small  { color: var(--encre-douce); font-weight: 700; }

.salle-outils { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.onglets-salle { display: flex; gap: 5px; background: var(--papier); border-radius: 999px; padding: 5px; }
.onglet-salle-btn {
  border: none; background: transparent; border-radius: 999px; padding: 8px 16px;
  font-weight: 800; font-size: .88rem; color: var(--encre-douce);
  transition: background .18s, color .18s;
}
.onglet-salle-btn.actif { background: var(--tableau); color: var(--craie); }

.salle-grille {
  flex: 1; display: grid; grid-template-columns: 1.35fr 1fr; gap: 22px;
  padding: 22px; min-height: 0; max-width: 1280px; width: 100%; margin: 0 auto;
}

/* — le tableau à craie — */
.cadre-tableau { display: flex; flex-direction: column; min-height: 0; }

.tableau-craie {
  flex: 1; border-radius: 16px 16px 0 0; border: 12px solid var(--bois);
  border-bottom: none;
  background:
    radial-gradient(ellipse at 25% 15%, rgba(247,243,232,.09), transparent 55%),
    radial-gradient(ellipse at 85% 85%, rgba(0,0,0,.28), transparent 60%),
    var(--tableau);
  padding: 30px 34px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 13px;
  box-shadow: inset 0 0 40px rgba(0,0,0,.22);
}

.craie-titre {
  color: var(--craie); font-family: var(--police-titre); font-size: 1.7rem;
  border-bottom: 3px solid rgba(247,243,232,.45); padding-bottom: 8px;
  align-self: flex-start; text-shadow: 0 0 10px rgba(247,243,232,.25);
  animation: trace-craie .8s ease both;
}
.craie-ligne {
  color: rgba(247,243,232,.92); font-size: 1.25rem; letter-spacing: .5px;
  animation: trace-craie .6s ease both;
}
.craie-ligne:nth-of-type(2) { animation-delay: .25s; }
.craie-ligne:nth-of-type(3) { animation-delay: .5s; }
.craie-ligne:nth-of-type(4) { animation-delay: .75s; }
.craie-ligne:nth-of-type(5) { animation-delay: 1s; }
.craie-ligne.jaune { color: var(--craie-jaune); }

@keyframes trace-craie {
  from { opacity: 0; transform: translateX(-8px); clip-path: inset(0 100% 0 0); }
  to   { opacity: 1; transform: translateX(0);   clip-path: inset(0 0 0 0); }
}

.craie-parabole { width: min(320px, 85%); margin-top: 8px; animation: apparition 1s ease .9s both; }

.rebord-craie {
  height: 26px; background: linear-gradient(180deg, var(--bois), var(--bois-fonce));
  border-radius: 0 0 12px 12px; box-shadow: var(--ombre);
  display: flex; align-items: center; gap: 12px; padding: 0 24px; flex-shrink: 0;
}
.craie-baton { width: 42px; height: 8px; border-radius: 4px; background: var(--craie); box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.craie-baton.jaune { width: 30px; background: var(--craie-jaune); }
.eponge { width: 54px; height: 14px; border-radius: 4px; background: #5d6f88; margin-left: auto; box-shadow: 0 1px 2px rgba(0,0,0,.3); }

/* — le panneau du professeur — */
.pano-prof {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--creme); border: 1px solid var(--ligne); border-radius: 22px;
  box-shadow: var(--ombre); overflow: hidden;
}

.prof-entete {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--ligne);
  background: var(--papier);
}
.prof-entete .avatar-prof { width: 52px; height: 52px; font-size: 1.6rem; border-width: 3px; }
.prof-nom strong { font-family: var(--police-titre); display: block; }
.en-ligne { color: var(--vert-ok); font-weight: 800; font-size: .78rem; }

.fil-discussion {
  flex: 1; overflow-y: auto; padding: 20px 18px;
  display: flex; flex-direction: column; gap: 12px;
}

.message {
  max-width: 85%; padding: 12px 16px; border-radius: 18px;
  font-size: .95rem; line-height: 1.5;
  animation: apparition .3s ease both;
}
.message.prof {
  align-self: flex-start; background: var(--papier);
  border: 1px solid var(--ligne); border-bottom-left-radius: 6px;
}
.message.eleve {
  align-self: flex-end; background: linear-gradient(160deg, #f8ca6b, var(--ambre));
  color: #3d2c05; font-weight: 700; border-bottom-right-radius: 6px;
}
.message.reflexion { display: flex; gap: 5px; padding: 16px 18px; }
.message.reflexion i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--encre-douce);
  animation: rebond 1.1s ease-in-out infinite;
}
.message.reflexion i:nth-child(2) { animation-delay: .18s; }
.message.reflexion i:nth-child(3) { animation-delay: .36s; }
@keyframes rebond {
  0%, 100% { transform: translateY(0); opacity: .5; }
  40%      { transform: translateY(-6px); opacity: 1; }
}

.raccourcis {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 16px 4px;
  border-top: 1px solid var(--ligne);
}
.raccourci {
  background: var(--papier); border: 1px solid var(--ligne); border-radius: 999px;
  padding: 8px 14px; font-weight: 800; font-size: .82rem; color: var(--encre);
  transition: border-color .15s, background .15s, transform .15s;
}
.raccourci:hover { border-color: var(--ambre); background: #fff8e8; transform: translateY(-1px); }

.barre-saisie {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px 16px;
}
.barre-saisie input {
  flex: 1; border: 2px solid var(--ligne); border-radius: 999px;
  padding: 12px 18px; font-size: .95rem; outline: none; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.barre-saisie input:focus { border-color: var(--ambre); box-shadow: 0 0 0 4px rgba(240,168,40,.18); }

/* ═══════════════════════ RESPONSIVE ═══════════════════════ */

@media (max-width: 980px) {
  .connexion-grille { grid-template-columns: 1fr; }
  .pano-marque { border-right: none; border-bottom: 8px solid var(--bois); padding: 46px 24px; }
  .titre-craie { font-size: 3rem; }
  .arguments { display: none; }
  .pano-connexion { padding: 34px 18px 60px; }

  .carte-reprendre { grid-template-columns: 1fr; text-align: center; }
  .reprendre-tableau { display: flex; justify-content: center; }
  .reprendre-prof { display: none; }
  .reprendre-infos .barre-progression.grande { margin: 0 auto; }

  .carte-prof-presentation { grid-template-columns: 1fr; text-align: center; }
  .prof-texte p { margin-left: auto; margin-right: auto; }

  .salle-grille { grid-template-columns: 1fr; grid-template-rows: minmax(300px, 1fr) auto; }
  .pano-prof { min-height: 420px; }

  .barre-haute { flex-wrap: wrap; }
  .onglets { order: 3; width: 100%; justify-content: center; }
  .zone-profil { margin-left: auto; }

  .barre-salle { flex-wrap: wrap; }
  .salle-outils { width: 100%; justify-content: space-between; margin-left: 0; }
}

@media (max-width: 560px) {
  .puce-textes { display: none; }
  .grille-annees { grid-template-columns: repeat(2, 1fr); }
  .encart-parents { flex-direction: column; text-align: center; }
}
