/* =========================================================================
   Pinpon — feuille de style côté élèves
   Style "autocollants" : traits épais, ombres franches, couleurs vives.
   ========================================================================= */

:root {
  --encre: #2B2340;
  --creme: #FFF8EC;
  --papier: #FFFFFF;
  --jaune: #FFD166;
  --orange: #FF9F43;
  --corail: #FF7B6B;
  --rose: #F9A8D4;
  --vert: #7BD389;
  --menthe: #7FE0D4;
  --bleu: #6FB3F2;
  --ciel: #A9DCFA;
  --violet: #B79CED;
  --gris: #D6D8E2;
  --trait: 3px;
  --rayon: 20px;
  --ombre: 5px 5px 0 var(--encre);
  --police-titre: "Fredoka", "Nunito", "Segoe UI", system-ui, sans-serif;
  --police: "Nunito", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--police);
  font-weight: 600;
  font-size: 17px;
  line-height: 1.45;
  color: var(--encre);
  background-color: var(--creme);
  background-image: radial-gradient(rgba(43, 35, 64, .10) 1.4px, transparent 1.6px);
  background-size: 26px 26px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3 { font-family: var(--police-titre); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: .01em; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }

/* --- En-tête ------------------------------------------------------------ */
.entete {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 24px clamp(16px, 4vw, 40px) 16px; /* un peu plus haut : le gyrophare dépasse de la pastille */
}
.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--police-titre); font-weight: 700; font-size: 1.35rem; }
.logo-pastille {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; position: relative;
  background: var(--jaune); border: var(--trait) solid var(--encre); box-shadow: 3px 3px 0 var(--encre);
  font-size: 1.2rem; transform: rotate(-6deg);
}
.logo-pastille .marque-yeux { width: 40px; height: 40px; }
/* Gyrophare « pin-pon » vissé sur le toit de la pastille, coin gauche, un peu penché */
.marque-gyrophare { position: absolute; left: -2px; top: -19px; width: 28px; height: 23px; transform: rotate(-12deg); transform-origin: 50% 100%; }
.logo-texte { display: flex; flex-direction: column; line-height: 1.05; }
.logo-slogan { font-family: var(--police); font-size: .78rem; font-weight: 800; opacity: .7; }
.moi { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.moi-carte {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  background: var(--papier); border: var(--trait) solid var(--encre); border-radius: 999px;
  padding: 4px 16px 4px 4px; box-shadow: 3px 3px 0 var(--encre);
}
.moi-enveloppe {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--papier); border: var(--trait) solid var(--encre); box-shadow: 3px 3px 0 var(--encre); color: var(--encre); transition: transform .1s;
}
.moi-enveloppe .ico { width: 22px; height: 22px; }
.moi-enveloppe:hover { transform: translate(-1px, -1px) rotate(-6deg); }
.moi-enveloppe.a-du-nouveau { background: var(--jaune); animation: enveloppe-tremble 1.2s ease-in-out 3; }
.moi-enveloppe-nb { position: absolute; top: -8px; right: -8px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; background: var(--corail); border: 2px solid var(--encre); font-size: .8rem; font-weight: 800; display: grid; place-items: center; }
@keyframes enveloppe-tremble { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-10deg); } 40% { transform: rotate(8deg); } 60% { transform: rotate(-6deg); } 80% { transform: rotate(4deg); } }
.moi-prenom { font-weight: 800; }
.moi-etoiles { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: #B8860B; }
.moi-etoiles .ico { width: 18px; height: 18px; color: #F2B705; }

/* --- Boutons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 14px; border: var(--trait) solid var(--encre);
  background: var(--papier); color: var(--encre); font-weight: 800; text-decoration: none; cursor: pointer;
  box-shadow: 4px 4px 0 var(--encre); transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--encre); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--encre); }
.btn .ico { width: 20px; height: 20px; }
.btn-jaune { background: var(--jaune); }
.btn-rose { background: var(--rose); }
.btn-vert { background: var(--vert); }
.btn-blanc { background: var(--papier); }
.btn-petit { padding: 8px 14px; font-size: .95rem; box-shadow: 3px 3px 0 var(--encre); border-radius: 12px; }
.btn-grand { padding: 16px 32px; font-size: 1.25rem; font-family: var(--police-titre); }
.lien-bouton { background: none; border: 0; padding: 8px; text-decoration: underline; cursor: pointer; opacity: .75; }
.lien-bouton:hover { opacity: 1; }

/* --- Structure ---------------------------------------------------------- */
.contenu { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 8px clamp(16px, 4vw, 40px) 48px; }
.pied { text-align: center; padding: 20px; opacity: .55; font-size: .9rem; }
.pied a { color: inherit; font-weight: 800; }
.centre { text-align: center; }
.bandeau { margin: 12px 0 28px; }
.bandeau-eleve { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.titre-geant { font-size: clamp(2rem, 5vw, 3rem); }
.sous-titre { margin: 6px 0 0; font-size: 1.15rem; opacity: .8; }
.titre-section { font-size: 1.6rem; margin: 36px 0 16px; display: flex; align-items: baseline; gap: 12px; }
.titre-section small { font-size: 1rem; opacity: .6; font-family: var(--police); }
.titre-classe {
  display: inline-block; font-size: 1.3rem; margin: 24px 0 14px; padding: 4px 18px; border-radius: 999px;
  background: var(--cc, var(--jaune)); border: var(--trait) solid var(--encre); box-shadow: 3px 3px 0 var(--encre); transform: rotate(-1.5deg);
}
.message {
  display: inline-block; margin: 14px 0 0; padding: 10px 18px; border-radius: 14px;
  background: var(--papier); border: var(--trait) solid var(--encre); box-shadow: 3px 3px 0 var(--encre);
}
.message-info { background: var(--ciel); }
.message-bravo { background: var(--vert); }

/* --- Avatars ------------------------------------------------------------ */
.avatar {
  display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%;
  background: var(--av, var(--jaune)); border: var(--trait) solid var(--encre); overflow: hidden; flex: none;
}
.avatar svg { width: 76%; height: 76%; }
.avatar-petit { width: 44px; height: 44px; border-width: 2.5px; }
.avatar-grand { width: 132px; height: 132px; box-shadow: var(--ombre); }
.avatar-geant { width: 180px; height: 180px; box-shadow: 6px 6px 0 var(--encre); }

/* --- Grille des élèves -------------------------------------------------- */
.grille-eleves { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 18px; }
.carte-eleve {
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px 8px 14px;
  background: var(--papier); border: var(--trait) solid var(--encre); border-radius: var(--rayon);
  box-shadow: var(--ombre); cursor: pointer; transition: transform .1s, box-shadow .1s;
}
.carte-eleve:hover, .carte-eleve:focus-visible { transform: translate(-2px, -2px) rotate(-1deg); box-shadow: 7px 7px 0 var(--encre); outline: none; }
.carte-eleve:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--encre); }
.carte-prenom { font-family: var(--police-titre); font-weight: 600; font-size: 1.15rem; word-break: break-word; }

/* --- Modale code -------------------------------------------------------- */
.modal { border: 0; padding: 0; background: transparent; max-width: none; width: min(420px, 94vw); }
.modal::backdrop { background: rgba(43, 35, 64, .6); }
.modal-boite {
  position: relative; margin: 0; padding: 28px 24px 18px; text-align: center;
  background: var(--papier); border: var(--trait) solid var(--encre); border-radius: 28px; box-shadow: 8px 8px 0 var(--encre);
}
.modal-fermer {
  position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: var(--trait) solid var(--encre);
  background: var(--corail); font-size: 1.5rem; line-height: 1; cursor: pointer; box-shadow: 2px 2px 0 var(--encre);
}
.modal-avatar { display: flex; justify-content: center; margin-bottom: 8px; }
.modal-avatar .avatar { width: 96px; height: 96px; }
.modal-titre { font-family: var(--police-titre); font-size: 1.7rem; margin: 4px 0 0; }
.modal-sous { margin: 2px 0 14px; opacity: .8; }
.points { display: flex; justify-content: center; gap: 14px; margin-bottom: 8px; }
.points i { width: 22px; height: 22px; border-radius: 50%; border: var(--trait) solid var(--encre); background: var(--papier); transition: background .1s, transform .1s; }
.points i.plein { background: var(--encre); transform: scale(1.15); }
.modal-message { min-height: 1.4em; margin: 0 0 8px; font-weight: 800; }
.modal-message.oups { color: #D64545; }
.modal-message.bravo { color: #2E8B57; }
.pave { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 280px; margin: 0 auto 10px; }
.touche {
  height: 64px; border-radius: 16px; border: var(--trait) solid var(--encre); background: var(--papier);
  font-family: var(--police-titre); font-size: 1.7rem; font-weight: 600; cursor: pointer; box-shadow: 4px 4px 0 var(--encre);
  transition: transform .06s, box-shadow .06s; -webkit-user-select: none; user-select: none;
}
.touche:hover { background: var(--creme); }
.touche:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--encre); }
.touche-effacer { background: var(--rose); font-size: 1.3rem; }
.touche-ok { background: var(--vert); font-size: 1.2rem; }
.attente .touche { opacity: .5; pointer-events: none; }
.secoue { animation: secouer .45s; }
@keyframes secouer {
  10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); }
}

/* --- Accueil élève ------------------------------------------------------ */
.compteurs { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.compteur {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
  background: var(--pc, var(--papier)); border: var(--trait) solid var(--encre); box-shadow: 3px 3px 0 var(--encre); font-size: .95rem;
}
.compteur .ico { width: 18px; height: 18px; }
.compteur b { font-size: 1.1rem; }

.pastille {
  display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; flex: none;
  background: var(--pc, var(--jaune)); border: var(--trait) solid var(--encre); color: var(--encre);
}
.pastille .ico { width: 32px; height: 32px; }
.pastille-grande { width: 120px; height: 120px; box-shadow: var(--ombre); }
.pastille-grande .ico { width: 64px; height: 64px; }

.grille-jeux { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.carte-jeu {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center;
  padding: 16px 18px; text-decoration: none; background: var(--papier); border: var(--trait) solid var(--encre);
  border-radius: var(--rayon); box-shadow: var(--ombre); transition: transform .1s, box-shadow .1s; position: relative; overflow: hidden;
}
.carte-jeu::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 10px; background: var(--pc); }
.carte-jeu:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--encre); }
.carte-jeu .pastille { grid-row: 1 / 4; margin-left: 4px; }
.carte-jeu-nom { font-family: var(--police-titre); font-size: 1.3rem; font-weight: 600; padding-right: 8px; }
.carte-jeu-desc { font-size: .92rem; opacity: .75; }
/* Étoiles gagnées par l'élève dans ce jeu (3e ligne de la carte) */
.carte-jeu-etoiles { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: .85rem; font-weight: 800; opacity: .6; }
.carte-jeu-etoiles .ico { width: 20px; height: 20px; flex: none; }
.carte-jeu-etoiles.a-des-etoiles { opacity: 1; color: #B8860B; }
.carte-jeu-etoiles b { font-size: 1.05rem; }
/* Autocollant en coin : « Nouveau ! », « Nouveau sujet ! », « Réponse reçue ! » */
.autocollant {
  position: absolute; top: 8px; right: 12px; padding: 3px 14px; font-family: var(--police-titre); font-size: .95rem; font-weight: 600;
  color: var(--encre); background: var(--jaune); border: 3px solid var(--encre); border-radius: 999px; box-shadow: 3px 3px 0 var(--encre);
  transform: rotate(4deg); animation: autocollant-pose .5s backwards;
}
.autocollant-reponse { background: var(--ciel); }
.carte-jeu-avant { padding-top: 46px; box-shadow: 6px 6px 0 var(--pc), 6px 6px 0 3px var(--encre); }
.titre-section .titre-nouveaute { display: inline-block; margin-left: 4px; padding: 3px 12px; font-size: .95rem; font-family: var(--police); font-weight: 800; opacity: 1; color: var(--encre); background: var(--jaune); border: 2px solid var(--encre); border-radius: 999px; transform: rotate(-2deg); }
@keyframes autocollant-pose { from { transform: rotate(-20deg) scale(1.6); opacity: 0; } to { transform: rotate(6deg) scale(1); opacity: 1; } }

.grille-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.badge {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; text-align: center;
  background: var(--papier); border: var(--trait) solid var(--encre); border-radius: var(--rayon); box-shadow: var(--ombre);
}
.badge-nom { font-family: var(--police-titre); font-weight: 600; font-size: 1.05rem; }
.badge-info { font-size: .82rem; opacity: .75; line-height: 1.3; }
.badge-verrou { background: #F4F1EA; border-style: dashed; box-shadow: none; }
.badge-verrou .pastille { filter: grayscale(1) opacity(.45); }
.jauge { width: 100%; height: 12px; border-radius: 999px; border: 2px solid var(--encre); background: var(--papier); overflow: hidden; margin-top: 4px; }
.jauge i { display: block; height: 100%; background: var(--vert); border-radius: 999px; }
.badge-progres { font-size: .8rem; font-weight: 800; opacity: .7; }

/* --- Profil (avatar) ---------------------------------------------------- */
.profil { display: grid; grid-template-columns: 240px 1fr; gap: 32px; align-items: start; }
.profil-apercu {
  position: sticky; top: 16px; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 24px 16px;
  background: var(--papier); border: var(--trait) solid var(--encre); border-radius: var(--rayon); box-shadow: var(--ombre);
}
.profil-prenom { font-family: var(--police-titre); font-size: 1.5rem; margin: 0; }
.profil-choix .titre-section { margin-top: 0; }
.profil-choix .titre-section + .choix-couleurs, .profil-choix .titre-section { margin-bottom: 14px; }
.choix-avatars { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; margin-bottom: 32px; }
.choix-avatar input, .choix-couleur input { position: absolute; opacity: 0; width: 0; height: 0; }
.choix-avatar { cursor: pointer; display: flex; justify-content: center; }
.choix-avatar .avatar { width: 78px; height: 78px; transition: transform .1s; }
.choix-avatar:hover .avatar { transform: scale(1.06); }
.choix-avatar input:checked + .avatar { box-shadow: 0 0 0 4px var(--papier), 0 0 0 8px var(--encre); transform: scale(1.06); }
/* Personnages « à venir » : visibles, grisés, cadenas, jamais sélectionnables. */
.avenir-explication { margin: -6px 0 14px; font-size: 1rem; }
.choix-avatar-avenir { cursor: default; position: relative; flex-direction: column; align-items: center; gap: 6px; }
.choix-avatar-avenir .avatar { filter: grayscale(.85) contrast(.85); opacity: .75; }
.choix-avatar-avenir:hover .avatar { transform: none; filter: grayscale(.4); opacity: .95; }
.avatar-cadenas {
  position: absolute; top: -4px; right: calc(50% - 46px); display: grid; place-items: center; width: 28px; height: 28px;
  border-radius: 50%; background: var(--jaune); border: 2px solid var(--encre); box-shadow: 2px 2px 0 var(--encre);
}
.avatar-cadenas svg { width: 16px; height: 16px; }
.avatar-avenir-nom { font-size: .8rem; font-weight: 800; text-align: center; opacity: .75; line-height: 1.15; }
.choix-couleurs { display: flex; flex-wrap: wrap; gap: 12px; }
.choix-couleur { cursor: pointer; }
.choix-couleur span { display: block; width: 52px; height: 52px; border-radius: 14px; background: var(--av); border: var(--trait) solid var(--encre); box-shadow: 3px 3px 0 var(--encre); }
.choix-couleur input:checked + span { outline: 4px solid var(--encre); outline-offset: 3px; }

/* --- Jeux --------------------------------------------------------------- */
.jeu-entete { display: flex; align-items: center; gap: 16px; margin: 8px 0 24px; }
.titre-jeu { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.jeu-zone { max-width: 640px; margin: 0 auto; }
.jeu-carte {
  display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 32px 24px; text-align: center;
  background: var(--papier); border: var(--trait) solid var(--encre); border-radius: 28px; box-shadow: 7px 7px 0 var(--encre);
}
.jeu-texte { margin: 0; font-size: 1.1rem; }
.petit { font-size: .92rem; opacity: .75; }
.jeu-progression { margin: 0; font-weight: 800; opacity: .6; }
.jeu-question { margin: 0; font-family: var(--police-titre); font-size: clamp(2.2rem, 7vw, 3.4rem); }
.jeu-reponse { display: flex; gap: 12px; }
.jeu-reponse input {
  width: 160px; padding: 12px 16px; font-family: var(--police-titre); font-size: 2rem; text-align: center;
  border: var(--trait) solid var(--encre); border-radius: 16px; box-shadow: inset 3px 3px 0 rgba(43, 35, 64, .12); background: var(--creme);
}
.jeu-reponse input:focus { outline: 4px solid var(--jaune); outline-offset: 2px; }
.jeu-retour { min-height: 1.5em; margin: 0; font-weight: 800; }
.jeu-retour.bravo { color: #2E8B57; }
.jeu-retour.oups { color: #D64545; }
.jeu-score { margin: 0; font-family: var(--police-titre); font-size: 3.4rem; }
.jeu-etoiles { display: flex; gap: 8px; margin: 0; }
.etoile-gagnee { width: 56px; height: 56px; color: var(--gris); }
.etoile-gagnee.pleine { color: #F2B705; animation: pop .4s backwards; }
.etoile-gagnee:nth-child(2).pleine { animation-delay: .15s; }
.etoile-gagnee:nth-child(3).pleine { animation-delay: .3s; }
@keyframes pop { from { transform: scale(0) rotate(-30deg); } 70% { transform: scale(1.25); } to { transform: scale(1); } }

/* --- Fête des badges ---------------------------------------------------- */
.fete { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(43, 35, 64, .6); padding: 16px; }
.fete-boite {
  position: relative; overflow: hidden; width: min(420px, 100%); padding: 32px 24px 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--papier); border: var(--trait) solid var(--encre); border-radius: 28px; box-shadow: 8px 8px 0 var(--encre);
  animation: pop .5s backwards;
}
.fete-titre { margin: 0; font-family: var(--police-titre); font-size: 1.4rem; opacity: .7; }
.fete-badge { margin: 8px 0; animation: pop .6s .2s backwards; }
.fete-nom { margin: 0; font-family: var(--police-titre); font-size: 2rem; }
.fete-desc { margin: 0 0 12px; opacity: .8; }
.confettis { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confettis i {
  position: absolute; top: -12px; left: calc(var(--i) * 5.6% + 2%); width: 10px; height: 14px; border-radius: 3px;
  background: var(--jaune); opacity: 0; animation: tomber 2.6s ease-in 0s 1 both;
}
.confettis i:nth-child(3n) { background: var(--corail); } .confettis i:nth-child(3n+1) { background: var(--bleu); }
.confettis i:nth-child(4n) { background: var(--vert); } .confettis i:nth-child(5n) { background: var(--violet); width: 8px; height: 8px; border-radius: 50%; }
.confettis i:nth-child(2n) { animation-delay: .25s; } .confettis i:nth-child(3n) { animation-delay: .5s; }
.confettis i:nth-child(5n) { animation-delay: .8s; } .confettis i:nth-child(7n) { animation-delay: .1s; }
@keyframes tomber { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(420px) rotate(540deg); } }

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .entete { padding: 22px 16px 12px; }
  .logo-texte { display: none; }
  .grille-eleves { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
  .avatar { width: 68px; height: 68px; }
  .carte-eleve { padding: 12px 6px 10px; }
  .profil { grid-template-columns: 1fr; }
  .profil-apercu { position: static; }
  .bandeau-eleve { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* --- V2 : code de classe -------------------------------------------------- */
.page-classe-code .bandeau { margin-top: 32px; }
.form-classe { display: flex; flex-direction: column; align-items: center; gap: 20px; margin: 8px auto 0; }
.champ-code-classe {
  width: min(420px, 92vw); padding: 14px 10px 14px 24px; text-align: center; text-transform: uppercase;
  font-family: var(--police-titre); font-size: clamp(2.2rem, 9vw, 3.4rem); letter-spacing: .28em;
  border: var(--trait) solid var(--encre); border-radius: 22px; background: var(--papier); box-shadow: var(--ombre);
}
/* Présentation du site (page « Quelle est ta classe ? ») : deux cartes autocollants, promesses en étiquettes */
.presentation { max-width: 960px; margin: 64px auto 0; text-align: center; }
.presentation-titre { font-size: clamp(1.5rem, 4vw, 2rem); margin-bottom: 22px; }
.presentation-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; align-items: stretch; }
.presentation-carte {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 44px 24px 26px;
  background: var(--papier); border: var(--trait) solid var(--encre); border-radius: var(--rayon); box-shadow: var(--ombre); text-align: center;
}
.presentation-eleves { transform: rotate(-1.2deg); }
.presentation-profs { transform: rotate(1deg); }
.presentation-autocollant {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%) rotate(-3deg); white-space: nowrap;
  padding: 6px 18px; border-radius: 999px; border: var(--trait) solid var(--encre); box-shadow: 3px 3px 0 var(--encre);
  font-family: var(--police-titre); font-size: 1.1rem; background: var(--jaune);
}
.presentation-profs .presentation-autocollant { background: var(--ciel); }
.presentation-pastille { width: 84px; height: 84px; margin-bottom: 8px; box-shadow: 4px 4px 0 var(--encre); }
.presentation-pastille .ico { width: 46px; height: 46px; }
.presentation-carte p { margin: 6px 0; line-height: 1.5; }
.presentation-boutons { margin-top: auto; padding-top: 12px; display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.presentation-carte p:last-of-type { margin-bottom: 10px; }
.presentation-promesse { margin: 26px 0 0; line-height: 2; }
.presentation-promesse small { opacity: .7; }
.presentation-etiquette {
  display: inline-flex; align-items: center; gap: 6px; margin: 0 4px; padding: 5px 14px; border-radius: 999px;
  border: 2px solid var(--encre); background: var(--vert); font-weight: 800; font-size: .95rem; line-height: 1.2;
}
.presentation-etiquette:nth-child(2) { background: var(--rose); }
.presentation-etiquette:nth-child(3) { background: var(--menthe); }
.presentation-etiquette .ico { width: 18px; height: 18px; }
.champ-code-classe:focus { outline: 5px solid var(--jaune); outline-offset: 3px; }
.champ-code-classe::placeholder { opacity: .25; }
.message-oups { background: var(--rose); }
.lien-changer-classe { display: inline-block; margin-top: 32px; text-decoration: underline; font-size: 1rem; }
.etiquette-classe-eleve {
  display: inline-block; margin: 8px 0 0; padding: 3px 14px; border-radius: 999px; font-family: var(--police-titre); font-size: 1rem;
  background: var(--cc, var(--jaune)); border: 2.5px solid var(--encre); box-shadow: 2px 2px 0 var(--encre);
}
.message-apercu { margin: 0; padding: 6px 14px; font-size: .9rem; }

/* --- V2 : jeux en bac à sable (iframe) -------------------------------------- */
.cadre-jeu {
  width: 100%; max-width: 960px; margin: 0 auto; background: var(--papier); border: var(--trait) solid var(--encre);
  border-radius: 24px; box-shadow: 7px 7px 0 var(--encre); overflow: hidden;
}
.cadre-jeu iframe { display: block; width: 100%; height: min(78vh, 720px); border: 0; background: #fff; }
.jeu-competence { text-align: center; opacity: .75; margin: 0 0 18px; }
@media (max-width: 720px) {
  .cadre-jeu { border-radius: 16px; box-shadow: 4px 4px 0 var(--encre); }
  .cadre-jeu iframe { height: calc(100vh - 150px); }
  .message-apercu { display: none; }
}

/* Texte libre (jeu complet) */
.jeu-zone-large { max-width: 820px; }
.fil-jeu { margin: 0 0 12px; font-weight: 800; }
.fil-jeu a { text-decoration: none; }
.liste-sujets { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.liste-autres-sujets { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.sujet-carte { align-items: flex-start; text-align: left; gap: 10px; padding: 22px 22px 20px; }
.sujet-titre { margin: 0; font-family: var(--police-titre); font-size: 1.5rem; }
.sujet-consigne { font-size: 1rem; line-height: 1.5; }
.sujet-etat { display: flex; align-items: center; gap: 10px; margin: 0; flex-wrap: wrap; }
.etiquette-texte { display: inline-block; padding: 3px 12px; border-radius: 999px; border: 2px solid var(--encre); font-weight: 800; font-size: .85rem; background: var(--papier); }
.etiquette-nouveau, .etiquette-brouillon { background: var(--creme); }
.etiquette-remis { background: var(--jaune); }
.etiquette-annote { background: var(--ciel); }
.etiquette-termine { background: var(--vert); }
.sujet-etoiles { display: inline-flex; gap: 2px; }
.sujet-etoiles i { display: inline-block; width: 22px; height: 22px; opacity: .25; }
.sujet-etoiles i.pleine { opacity: 1; }
.sujet-etoiles svg { width: 100%; height: 100%; }
.texte-sujet, .texte-editeur, .texte-lecture, .texte-annotation, .texte-intro { align-items: stretch; text-align: left; margin-bottom: 20px; }
.texte-annotation { background: var(--ciel); }
.annotation-de { margin: 0; font-weight: 800; }
.annotation-texte { line-height: 1.55; }
.editeur-label { margin: 0; font-family: var(--police-titre); font-size: 1.3rem; }
.texte-editeur textarea {
  width: 100%; box-sizing: border-box; min-height: 320px; padding: 16px; font: inherit; font-size: 1.1rem; line-height: 1.6;
  border: var(--trait) solid var(--encre); border-radius: 16px; background: var(--creme); box-shadow: inset 3px 3px 0 rgba(43, 35, 64, .12); resize: vertical;
}
.texte-editeur textarea:focus { outline: 4px solid var(--jaune); outline-offset: 2px; }
.editeur-barre { margin: 0; font-weight: 700; opacity: .7; font-size: .95rem; }
.editeur-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.texte-rendu { white-space: pre-wrap; line-height: 1.6; font-size: 1.1rem; padding: 16px; background: var(--creme); border-radius: 16px; border: 2px solid var(--encre); }
@media (max-width: 600px) { .editeur-actions { justify-content: stretch; } .editeur-actions .btn { flex: 1; } }

/* Textes riches (Textes libres) : rendu, éditeur, annotations */
.texte-riche { line-height: 1.6; font-size: 1.05rem; font-weight: 500; }
.texte-riche b { font-weight: 800; }
.texte-riche h3 { margin: .4em 0 .2em; font-size: 1.3em; }
.texte-riche p { margin: 0 0 .5em; }
.texte-riche ul, .texte-riche ol { margin: 0 0 .5em; padding-left: 1.6em; }
.texte-riche mark { background: #FFE58A; border-radius: 4px; padding: 0 2px; box-shadow: 0 2px 0 #E4B400; cursor: help; counter-increment: note; }
.texte-riche { counter-reset: note; }
.texte-riche mark::after { content: counter(note); display: inline-block; min-width: 1.3em; height: 1.3em; margin-left: 3px; border-radius: 999px; background: #2B2340; color: #fff; font-size: .7em; line-height: 1.3em; text-align: center; font-weight: 800; vertical-align: super; }
.liste-notes { margin: 6px 0 0; padding-left: 1.4em; line-height: 1.5; }
.liste-notes li { margin-bottom: 4px; }
.liste-notes .corr { color: #1F7A45; font-weight: 700; }
.barre-editeur { display: flex; gap: 6px; flex-wrap: wrap; }
.barre-editeur button { font: inherit; font-weight: 800; padding: 6px 12px; border-radius: 10px; border: 2px solid #2B2340; background: #fff; cursor: pointer; box-shadow: 2px 2px 0 #2B2340; }
.barre-editeur button.actif { background: #FFD166; }
.barre-editeur button:active { transform: translate(2px, 2px); box-shadow: none; }
.editeur-zone { min-height: 320px; padding: 16px; background: #FFF8EC; border: 3px solid #2B2340; border-radius: 16px; box-shadow: inset 3px 3px 0 rgba(43, 35, 64, .12); outline: none; }
.editeur-zone:focus { outline: 4px solid #FFD166; outline-offset: 2px; }
.editeur-zone:empty::before, .editeur-zone[data-placeholder]:has(> p:only-child > br:only-child)::before { content: attr(data-placeholder); color: #8b859a; position: absolute; pointer-events: none; }
.editeur-zone { position: relative; }

/* --- Boîte à messages (boite.php) --------------------------------------- */
.liste-fils { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.carte-fil {
  position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; padding: 12px 16px 12px 12px;
  text-decoration: none; background: var(--papier); border: var(--trait) solid var(--encre); border-radius: 16px; box-shadow: 4px 4px 0 var(--encre);
  border-left-width: 10px; border-left-color: var(--pc);
}
.carte-fil .pastille { grid-row: 1 / 3; }
.carte-fil-titre { font-family: var(--police-titre); font-size: 1.15rem; font-weight: 600; padding-right: 140px; }
.carte-fil-info { font-size: .85rem; opacity: .7; }
.carte-fil-clos { opacity: .7; }
.carte-fil .autocollant { top: 50%; transform: translateY(-50%) rotate(-3deg); animation: none; }
.carte-fil .etiquette-texte { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); }
.boite-fil { display: grid; gap: 14px; max-width: 760px; }
.boite-message { display: flex; gap: 12px; align-items: flex-start; }
.boite-message-prof { flex-direction: row-reverse; }
.avatar-prof { background: var(--ciel); color: var(--encre); }
.avatar-prof .ico { width: 55%; height: 55%; }
.boite-bulle { flex: 1; padding: 12px 16px; background: var(--papier); border: var(--trait) solid var(--encre); border-radius: 18px; box-shadow: 4px 4px 0 var(--encre); }
.boite-message-prof .boite-bulle { background: var(--ciel); }
.boite-de { margin: 0 0 6px; font-weight: 800; }
.boite-de small { font-weight: 600; opacity: .6; margin-left: 6px; }
.boite-texte { margin: 0; line-height: 1.5; }
.boite-formulaire { align-items: stretch; text-align: left; max-width: 760px; }
.boite-label { font-weight: 800; margin: 6px 0 -6px; }
.boite-label small { font-weight: 600; opacity: .6; }
.boite-champ, .boite-zone, .boite-select { width: 100%; padding: 10px 14px; border: var(--trait) solid var(--encre); border-radius: 14px; background: var(--creme); box-shadow: inset 3px 3px 0 rgba(43, 35, 64, .12); }
.boite-zone { resize: vertical; line-height: 1.5; }
.boite-champ:focus, .boite-zone:focus, .boite-select:focus { outline: 4px solid var(--jaune); outline-offset: 2px; }
.boite-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.boite-type { display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 8px; border: var(--trait) solid var(--encre); border-radius: 14px; background: var(--papier); cursor: pointer; font-weight: 800; box-shadow: 3px 3px 0 var(--encre); }
.boite-type input { position: absolute; opacity: 0; width: 0; height: 0; }
.boite-type:has(input:checked) { background: var(--pc); transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--encre); }
.boite-type:has(input:focus-visible) { outline: 4px solid var(--jaune); }
.boite-aide { margin: 0; font-size: .95rem; opacity: .8; }
.etiquette-boite { background: var(--pc); }
.accueil-boite { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.accueil-boite .autocollant { position: static; transform: rotate(-3deg); animation: none; }
