/* ============================================================
   Le Laboratoire des Savoirs — feuille de style
   Thème : laboratoire en sous-sol, cuivre et verre, lumière chaude
   ============================================================ */

:root {
  /* fonds : on reste lumineux et coloré, jamais gris */
  --nuit:        #1d6f80;
  --nuit-clair:  #2a93a6;
  --mur:         #35bfd0;
  --mur-clair:   #6fe0ec;
  --cuivre:      #f0a93c;
  --cuivre-vif:  #ffd34e;
  --laiton:      #ffd76b;
  --verre:       #6fe0ec;
  --verre-pale:  #dff6fb;
  --lueur:       #fff07a;

  --papier:      #fffdf2;
  --papier-ombre:#e8dcc0;
  --encre:       #2b2018;
  --encre-pale:  #7a6a55;

  --juste:       #4fc98a;
  --juste-fonce: #23794f;
  --faux:        #ff6b5e;
  --faux-fonce:  #b83426;

  --maths:       #4d96ff;
  --francais:    #ff6b5e;
  --monde:       #4fc98a;
  --bonus:       #9b6bdb;

  --rouge:       #ff6b5e;
  --orange:      #ff8a3d;
  --jaune:       #ffd34e;
  --vert:        #4fc98a;
  --turquoise:   #35bfd0;
  --bleu:        #4d96ff;
  --violet:      #9b6bdb;
  --rose:        #ff87c3;

  --ombre-douce: 0 5px 0 rgba(43,32,24,.28), 0 8px 22px rgba(0,0,0,.22);
  --ombre-forte: 0 8px 0 rgba(43,32,24,.3), 0 18px 44px rgba(0,0,0,.34);
  --rayon:       20px;
  --trait:       4px solid #2b2018;

  --titre: "Segoe UI Semibold", "Trebuchet MS", Verdana, sans-serif;
  --texte: "Segoe UI", "Trebuchet MS", Verdana, sans-serif;
}

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

html, body {
  height: 100%;
  overflow: hidden;
  font-family: var(--texte);
  background: var(--nuit);
  color: var(--papier);
  user-select: none;
  -webkit-user-select: none;
}

body { display: flex; flex-direction: column; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
button:focus-visible { outline: 3px solid var(--lueur); outline-offset: 3px; }

/* ===================== Écrans ===================== */

.ecran {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
}
.ecran.actif { display: flex; }

#zone { position: relative; flex: 1; overflow: hidden; }

/* ===================== Accueil / profils ===================== */

#ecran-accueil {
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 24%, #6fe0ec 0%, #35bfd0 42%, #1d8fa3 100%);
  text-align: center;
  padding: 24px;
  overflow: hidden;
}
/* bulles décoratives */
#ecran-accueil::before,
#ecran-accueil::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: #ffffff;
  opacity: .12;
  pointer-events: none;
}
#ecran-accueil::before { width: 420px; height: 420px; left: -120px; bottom: -150px; }
#ecran-accueil::after  { width: 300px; height: 300px; right: -90px; top: -90px; }

.logo-titre {
  font-family: var(--titre);
  font-size: clamp(32px, 5.4vw, 66px);
  letter-spacing: .5px;
  color: #ffd34e;
  -webkit-text-stroke: 4px #2b2018;
  paint-order: stroke fill;
  text-shadow: 0 7px 0 #2b2018;
  margin-bottom: 14px;
  position: relative;
}
.logo-sous {
  display: inline-block;
  font-size: clamp(13px, 1.6vw, 18px);
  color: #2b2018;
  background: #ffd34e;
  border: var(--trait);
  border-radius: 30px;
  padding: 7px 22px;
  margin-bottom: 32px;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-weight: 700;
  box-shadow: var(--ombre-douce);
  position: relative;
}

.profils {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 900px;
  margin-bottom: 26px;
  position: relative;
}

.profil {
  width: 170px;
  padding: 20px 14px 18px;
  background: var(--papier);
  border: var(--trait);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-douce);
  transition: transform .14s ease, box-shadow .14s ease;
  position: relative;
}
.profil:hover { transform: translateY(-6px) rotate(-1.5deg); box-shadow: var(--ombre-forte); }
.profil .avatar {
  font-size: 48px; line-height: 1; margin-bottom: 8px;
  filter: drop-shadow(0 3px 0 rgba(43,32,24,.18));
}
.profil .pnom {
  font-family: var(--titre);
  font-size: 20px;
  color: var(--encre);
  word-break: break-word;
}
.profil .pdetail {
  display: inline-block;
  font-size: 12.5px; color: var(--encre); margin-top: 7px;
  background: var(--jaune); border: 3px solid var(--encre);
  border-radius: 20px; padding: 2px 11px; font-weight: 700;
}
.profil .psupp {
  position: absolute; top: -12px; right: -12px;
  width: 30px; height: 30px; line-height: 24px;
  font-size: 15px; color: var(--papier); background: #8a9bb0;
  border: 3px solid var(--encre); border-radius: 50%;
}
.profil .psupp:hover { background: var(--faux); }
.profil.ajout {
  background: rgba(255,255,255,.22);
  border-style: dashed;
  color: var(--papier);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 154px;
}
.profil.ajout .pnom { color: var(--papier); }
.profil.ajout:hover { background: rgba(255,255,255,.4); }

.lien-parent {
  font-size: 14px;
  color: #8ba0b1;
  text-decoration: underline;
  padding: 8px 12px;
  border-radius: 10px;
}
.lien-parent:hover { color: var(--lueur); }

/* ===================== Formulaire ===================== */

.panneau-form {
  background: linear-gradient(170deg, #35485a, #22303e);
  border: 2px solid #4a6373;
  border-radius: var(--rayon);
  padding: 28px 30px;
  box-shadow: var(--ombre-forte);
  max-width: 460px;
  text-align: left;
}
.panneau-form h2 { font-family: var(--titre); font-size: 23px; margin-bottom: 18px; color: var(--lueur); }
.champ { margin-bottom: 18px; }
.champ label { display: block; font-size: 13.5px; color: #a8bccd; margin-bottom: 7px; letter-spacing: .4px; }
.champ input[type=text] {
  width: 100%;
  padding: 12px 14px;
  font-size: 18px;
  font-family: inherit;
  border-radius: 12px;
  border: 2px solid #4a6373;
  background: #1a242e;
  color: var(--papier);
}
.champ input[type=text]:focus { outline: none; border-color: var(--cuivre-vif); }

.choix-avatars { display: flex; gap: 9px; flex-wrap: wrap; }
.choix-avatars button {
  font-size: 27px; width: 52px; height: 52px; border-radius: 12px;
  background: #1a242e; border: 2px solid #3c5262;
}
.choix-avatars button.sel { border-color: var(--cuivre-vif); background: #2c3e4e; }

.choix-niveaux { display: flex; gap: 10px; }
.choix-niveaux button {
  flex: 1; padding: 13px 8px; border-radius: 12px;
  background: #1a242e; border: 2px solid #3c5262;
  font-family: var(--titre); font-size: 16px; color: var(--papier);
}
.choix-niveaux button small { display: block; font-family: var(--texte); font-size: 11px; color: #8ba0b1; margin-top: 3px; font-weight: normal; }
.choix-niveaux button.sel { border-color: var(--cuivre-vif); background: #2c3e4e; }

.boutons-form { display: flex; gap: 10px; margin-top: 22px; }

/* ===================== Boutons ===================== */

.btn {
  padding: 13px 24px;
  border-radius: 14px;
  font-family: var(--titre);
  font-size: 16.5px;
  background: var(--jaune);
  color: var(--encre);
  border: var(--trait);
  box-shadow: 0 5px 0 #2b2018;
  transition: transform .09s ease, box-shadow .09s ease, filter .12s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #2b2018; }
.btn.secondaire { background: var(--papier); }
.btn.secondaire:active { box-shadow: 0 1px 0 #2b2018; }
.btn.grand { font-size: 19px; padding: 16px 34px; }
.btn:disabled { opacity: .5; cursor: default; filter: grayscale(.5); }
.btn:disabled:active { transform: none; }

/* ===================== Laboratoire ===================== */

#ecran-labo { background: #0d1218; }

#labo-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* la scène s'arrête au-dessus de la barre d'ateliers,
   sinon le sol et les objets posés dessus passent dessous */
#labo-svg-hote {
  position: absolute;
  inset: 0 0 var(--hbarre, 96px) 0;
  display: flex;
  background: #2a93a6;
}
#labo-svg { width: 100%; height: 100%; display: block; }

/* objets cliquables de la scène */
#labo-svg .objet { cursor: pointer; }
#labo-svg .objet > .halo {
  opacity: 0;
  transition: opacity .18s ease;
}
#labo-svg .objet:hover > .halo { opacity: 1; }
#labo-svg .objet .corps { transition: transform .18s ease; transform-box: fill-box; transform-origin: center; }
#labo-svg .objet:hover .corps { transform: scale(1.045); }
#labo-svg .objet.fini .pastille-fond { fill: var(--juste); }

/* ===== barre d'ateliers, en bas de la scène ===== */
#barre-ateliers {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 11px 14px 13px;
  background: var(--orange);
  border-top: 5px solid var(--encre);
  z-index: 6;
}
#barre-ateliers .ico {
  width: 53px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform .12s ease;
}
#barre-ateliers .ico:hover { transform: translateY(-5px) scale(1.06); }
#barre-ateliers .ico .rond {
  width: 45px; height: 45px;
  border-radius: 50%;
  background: var(--c);
  border: var(--trait);
  box-shadow: 0 4px 0 var(--encre);
  display: flex; align-items: center; justify-content: center;
  font-size: 25px;
  line-height: 1;
}
#barre-ateliers .ico:active .rond { transform: translateY(3px); box-shadow: 0 1px 0 var(--encre); }
#barre-ateliers .ico .lib {
  font-size: 9.8px;
  font-weight: 700;
  color: var(--encre);
  text-align: center;
  line-height: 1.15;
  letter-spacing: .1px;
}
#barre-ateliers .ico .coche {
  position: absolute;
  top: -5px; right: 2px;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: var(--vert);
  border: 3px solid var(--encre);
  color: #0d3f27;
  font-size: 12px;
  display: none;
  align-items: center; justify-content: center;
}
#barre-ateliers .ico.fini .coche { display: flex; }

/* bulle du professeur */
#bulle-prof {
  position: absolute;
  left: 50%;
  bottom: calc(var(--hbarre, 96px) + 42px);
  transform: translate(-50%, 14px);
  max-width: 400px;
  background: var(--papier);
  color: var(--encre);
  border: var(--trait);
  border-radius: 18px;
  padding: 13px 20px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  box-shadow: var(--ombre-forte);
  pointer-events: none;
  opacity: 0;
  transition: opacity .4s ease, transform .4s ease;
  z-index: 4;
}
#bulle-prof.vu { opacity: 1; transform: translate(-50%, 0); }
#bulle-prof::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -18px;
  margin-left: -14px;
  border: 14px solid transparent;
  border-top-color: var(--encre);
  border-bottom: 0;
}

/* bulle de nom au survol */
#etiquette {
  position: absolute;
  pointer-events: none;
  background: rgba(10,14,19,.95);
  border: 1.5px solid var(--cuivre);
  border-radius: 11px;
  padding: 7px 13px;
  font-size: 14.5px;
  font-family: var(--titre);
  color: var(--lueur);
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, -140%);
  transition: opacity .13s ease;
  box-shadow: var(--ombre-douce);
  z-index: 5;
}
#etiquette small { display: block; font-family: var(--texte); font-size: 11.5px; color: #9fb3c4; font-weight: normal; }
#etiquette.vu { opacity: 1; }

/* ===================== Barre du haut ===================== */

.barre {
  height: 68px;
  flex: 0 0 68px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  background: var(--orange);
  border-bottom: 5px solid var(--encre);
  z-index: 10;
}
.barre .qui { display: flex; align-items: center; gap: 10px; }
.barre .qui .av {
  font-size: 28px; background: var(--papier); border: 3px solid var(--encre);
  border-radius: 50%; width: 46px; height: 46px;
  display: flex; align-items: center; justify-content: center;
}
.barre .qui .nm { font-family: var(--titre); font-size: 18px; color: var(--encre); }
.barre .qui .nv {
  font-size: 11.5px; padding: 4px 11px; border-radius: 20px;
  background: var(--papier); border: 3px solid var(--encre);
  color: var(--encre); font-weight: bold; letter-spacing: .5px;
}
.barre .esp { flex: 1; }
.barre .compteur {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--titre); font-size: 20px; color: var(--encre);
  background: var(--jaune); border: 3px solid var(--encre);
  padding: 6px 18px; border-radius: 24px;
}
.barre .btn { padding: 9px 17px; font-size: 14.5px; }

/* ===================== Activité ===================== */

#ecran-activite { background: radial-gradient(ellipse at 50% 0%, #6fe0ec, #2a93a6 70%, #1d6f80); }

#act-corps {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* surtout pas justify-content: center — quand la fiche est plus haute
     que l'écran, le centrage flex rogne le haut et le rend inatteignable.
     Les marges automatiques centrent sans jamais couper. */
  justify-content: flex-start;
  padding: 20px 24px 28px;
  overflow-y: auto;
}
#act-corps > * { margin-top: auto; margin-bottom: auto; }

.fiche {
  background: var(--papier);
  color: var(--encre);
  border: 5px solid var(--encre);
  border-radius: 24px;
  padding: 28px 36px 32px;
  width: min(840px, 100%);
  box-shadow: 0 9px 0 var(--encre), 0 20px 44px rgba(0,0,0,.3);
  position: relative;
}

.fiche .consigne {
  font-size: 14.5px;
  color: var(--encre-pale);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  margin-bottom: 14px;
  font-weight: 600;
}

.fiche .enonce {
  font-family: var(--titre);
  font-size: clamp(22px, 3.3vw, 35px);
  line-height: 1.35;
  margin-bottom: 26px;
}
.fiche .enonce .trou {
  display: inline-block;
  min-width: 2.4em;
  border-bottom: 3px solid var(--cuivre);
  text-align: center;
  color: var(--cuivre);
}
.fiche .enonce em { color: var(--francais); font-style: normal; font-weight: bold; }
.fiche .sous-enonce { font-size: 16px; color: var(--encre-pale); margin: -14px 0 24px; line-height: 1.5; }

/* calcul posé en colonne */
.calcul-pose {
  font-family: "Consolas", "Courier New", monospace;
  font-size: clamp(30px, 4.6vw, 48px);
  line-height: 1.22;
  text-align: right;
  display: inline-block;
  margin-bottom: 24px;
  padding-right: 6px;
}
.calcul-pose .ligne-barre { border-bottom: 4px solid var(--encre); padding-bottom: 5px; }

/* réponses à choix */
.choix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 13px;
}
.choix.deux { grid-template-columns: repeat(2, 1fr); }
.choix.quatre { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }

.rep {
  padding: 19px 16px;
  border-radius: 16px;
  background: #fff;
  border: var(--trait);
  font-family: var(--titre);
  font-size: clamp(19px, 2.5vw, 26px);
  color: var(--encre);
  transition: transform .1s ease, background .14s ease;
  box-shadow: 0 5px 0 var(--encre);
}
.rep:hover:not(:disabled) { background: var(--jaune); transform: translateY(-3px); box-shadow: 0 8px 0 var(--encre); }
.rep:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--encre); }
.rep.ok   { background: var(--vert);  color: #0d3f27; }
.rep.ko   { background: var(--faux);  color: #fff; }
.rep:disabled { cursor: default; }

/* saisie libre */
.zone-saisie { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.zone-saisie input {
  font-family: var(--titre);
  font-size: clamp(26px, 3.6vw, 40px);
  width: 220px;
  padding: 10px 16px;
  text-align: center;
  border-radius: 16px;
  border: var(--trait);
  background: #fff;
  color: var(--encre);
  box-shadow: inset 0 4px 0 rgba(43,32,24,.09);
}
.zone-saisie input:focus { outline: none; background: #fffbe8; }
.zone-saisie input.ok { background: var(--vert); color: #0d3f27; }
.zone-saisie input.ko { background: var(--faux); color: #fff; }
.zone-saisie input.large { width: min(420px, 100%); font-size: clamp(20px, 2.6vw, 28px); }

/* pavé numérique tactile/souris */
.pave { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; width: 260px; margin-top: 18px; }
.pave button {
  padding: 14px 0; border-radius: 14px; background: #fff;
  border: var(--trait); box-shadow: 0 5px 0 var(--encre);
  font-family: var(--titre); font-size: 24px; color: var(--encre);
  transition: background .12s ease;
}
.pave button:hover { background: var(--jaune); }
.pave button:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--encre); }
.pave button.util { background: var(--orange); font-size: 19px; }

/* mise en ordre */
.ordre-zone { display: flex; flex-wrap: wrap; gap: 11px; margin-bottom: 18px; min-height: 70px;
  padding: 12px; border-radius: 16px; background: #fff8e4; border: 4px dashed #c9b893; }
.ordre-zone.cible { border-color: var(--orange); background: #fff2d2; }
.jeton {
  padding: 12px 19px; border-radius: 14px; background: #fff;
  border: var(--trait); box-shadow: 0 5px 0 var(--encre);
  font-family: var(--titre); font-size: 21px; color: var(--encre);
  transition: background .12s ease, transform .1s ease;
}
.jeton:hover { background: var(--jaune); transform: translateY(-2px); }
.jeton.pose { background: var(--turquoise); color: #06343a; }

/* association / paires */
.paires { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.paires .col { display: flex; flex-direction: column; gap: 11px; }
.paires .pz {
  padding: 14px 17px; border-radius: 14px; background: #fff;
  border: var(--trait); box-shadow: 0 5px 0 var(--encre);
  font-family: var(--titre); font-size: 19px; text-align: left;
}
.paires .pz.sel { background: var(--jaune); }
.paires .pz.ok { background: var(--vert); color: #0d3f27; }

/* horloge */
.horloge-boite { display: flex; justify-content: center; margin-bottom: 24px; }

/* carte d'Europe */
.carte-boite { display: flex; justify-content: center; margin-bottom: 20px; }
.carte-boite svg { max-width: 100%; height: auto; }
.carte-boite .pays {
  fill: var(--cp);
  cursor: pointer;
  transition: filter .14s ease, transform .14s ease;
  transform-box: fill-box;
  transform-origin: center;
}
.carte-boite .pays:hover { filter: brightness(1.18) saturate(1.3); transform: scale(1.04); }
.carte-boite .pays.ok { fill: var(--juste); filter: none; }
.carte-boite .pays.ko { fill: var(--faux); filter: none; }
.carte-boite .pays.fige { pointer-events: none; }

/* progression de l'exercice */
.progress-exo {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 20px;
}
.progress-exo .pip {
  width: 15px; height: 15px; border-radius: 50%;
  background: rgba(0,0,0,.12); border: 2px solid transparent;
}
.progress-exo .pip.j { background: var(--juste); }
.progress-exo .pip.f { background: var(--faux); }
.progress-exo .pip.c { background: #fff; border-color: var(--cuivre); }
.progress-exo .txt { margin-left: auto; font-size: 14px; color: var(--encre-pale); font-weight: 600; }

/* retour juste/faux */
.retour {
  margin-top: 22px;
  padding: 15px 20px;
  border-radius: 16px;
  border: var(--trait);
  font-size: 17.5px;
  line-height: 1.5;
  display: none;
  align-items: center;
  gap: 13px;
  box-shadow: 0 5px 0 var(--encre);
}
.retour.vu { display: flex; }
.retour .ic { font-size: 30px; flex: 0 0 auto; }
.retour.j { background: #c9f3dd; color: #0d3f27; }
.retour.f { background: #ffd9d4; color: #7d2417; }
.retour strong { font-family: var(--titre); }

.barre-bas { display: flex; gap: 11px; margin-top: 22px; justify-content: flex-end; }

/* ===================== Bilan de fin ===================== */

.bilan { text-align: center; }
.bilan .score-cercle {
  width: 172px; height: 172px; border-radius: 50%;
  margin: 6px auto 22px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: conic-gradient(var(--juste) var(--part), #e6ddcb 0);
  border: var(--trait);
  box-shadow: 0 6px 0 var(--encre);
  position: relative;
}
.bilan .score-cercle::after {
  content: ""; position: absolute; inset: 16px; border-radius: 50%;
  background: var(--papier); border: 4px solid var(--encre);
}
.bilan .score-cercle .v { position: relative; font-family: var(--titre); font-size: 42px; color: var(--encre); }
.bilan .score-cercle .l { position: relative; font-size: 13px; color: var(--encre-pale); letter-spacing: 1px; }
.bilan h2 { font-family: var(--titre); font-size: 29px; margin-bottom: 10px; }
.bilan p { font-size: 17px; color: var(--encre-pale); line-height: 1.55; margin-bottom: 8px; }
.bilan .etoiles { font-size: 44px; letter-spacing: 7px; margin: 14px 0 8px; }
.bilan .revoir {
  text-align: left; background: #fffdf8; border: 2px solid var(--papier-ombre);
  border-radius: 14px; padding: 15px 18px; margin: 20px 0 4px; max-height: 190px; overflow-y: auto;
}
.bilan .revoir h3 { font-family: var(--titre); font-size: 15px; margin-bottom: 9px; color: var(--encre-pale); text-transform: uppercase; letter-spacing: 1px; }
.bilan .revoir li { font-size: 15.5px; margin-bottom: 7px; list-style: none; line-height: 1.45; }
.bilan .revoir li b { color: var(--juste-fonce); }

/* ===================== Carnet du professeur ===================== */

#ecran-carnet { background: linear-gradient(160deg, #202c39, #141b24); }
#carnet-corps { flex: 1; overflow-y: auto; padding: 24px; }
.carnet-fiche {
  background: var(--papier); color: var(--encre);
  border-radius: 20px; padding: 26px 30px;
  max-width: 1000px; margin: 0 auto; box-shadow: var(--ombre-forte);
}
.carnet-fiche h2 { font-family: var(--titre); font-size: 25px; margin-bottom: 4px; }
.carnet-fiche .intro { color: var(--encre-pale); font-size: 15px; margin-bottom: 22px; line-height: 1.5; }
.carnet-fiche table { width: 100%; border-collapse: collapse; font-size: 15px; }
.carnet-fiche th {
  text-align: left; padding: 9px 10px; border-bottom: 2.5px solid var(--papier-ombre);
  font-size: 12.5px; text-transform: uppercase; letter-spacing: .9px; color: var(--encre-pale);
}
.carnet-fiche td { padding: 10px; border-bottom: 1px solid var(--papier-ombre); }
.carnet-fiche td.mat { font-size: 12px; text-transform: uppercase; letter-spacing: .7px; font-weight: 700; }
.carnet-fiche .jauge { height: 11px; border-radius: 7px; background: #e6ddcb; overflow: hidden; min-width: 90px; }
.carnet-fiche .jauge i { display: block; height: 100%; border-radius: 7px; background: var(--juste); }
.carnet-fiche .jauge i.moyen { background: var(--cuivre); }
.carnet-fiche .jauge i.faible { background: var(--faux); }
.carnet-fiche .vide { color: var(--encre-pale); font-style: italic; }
.carnet-resume { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.carnet-resume .bloc {
  flex: 1; min-width: 150px; background: #fffdf8; border: 2px solid var(--papier-ombre);
  border-radius: 14px; padding: 15px 17px;
}
.carnet-resume .bloc .g { font-family: var(--titre); font-size: 31px; }
.carnet-resume .bloc .p { font-size: 12.5px; color: var(--encre-pale); text-transform: uppercase; letter-spacing: .9px; margin-top: 2px; }

/* ===================== Jeux bonus ===================== */

#jeu-canvas { border-radius: 18px; border: var(--trait); background: #0b1a2a; max-width: 100%; }
.jeu-info {
  display: inline-block;
  font-family: var(--titre); font-size: 17px; color: var(--encre);
  background: var(--jaune); border: 3px solid var(--encre); border-radius: 22px;
  padding: 5px 18px; margin-bottom: 16px;
}

/* ----- choix du jeu ----- */
.choix-jeux {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 15px;
  margin-top: 6px;
}
.carte-jeu {
  display: flex; flex-direction: column; align-items: center; gap: 7px;
  padding: 20px 16px 18px;
  background: var(--c);
  border: var(--trait);
  border-radius: 18px;
  box-shadow: 0 6px 0 var(--encre);
  color: #fffdf2;
  transition: transform .12s ease, box-shadow .12s ease;
}
.carte-jeu:hover { transform: translateY(-5px); box-shadow: 0 11px 0 var(--encre); }
.carte-jeu:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--encre); }
.carte-jeu .cj-ic {
  font-size: 40px; line-height: 1;
  background: #fffdf2; border: 3px solid var(--encre); border-radius: 50%;
  width: 70px; height: 70px; display: flex; align-items: center; justify-content: center;
}
.carte-jeu .cj-nom { font-family: var(--titre); font-size: 19px; }
.carte-jeu .cj-desc { font-size: 13.5px; line-height: 1.4; opacity: .95; }

/* ----- memory ----- */
.memory-grille {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
}
.memory-grille .carte {
  position: relative;
  aspect-ratio: 3 / 4;
  border: var(--trait);
  border-radius: 14px;
  box-shadow: 0 5px 0 var(--encre);
  background: var(--bleu);
  font-family: var(--titre);
  transition: transform .14s ease, background .14s ease;
}
.memory-grille .carte:hover:not(.trouvee) { transform: translateY(-4px); }
.memory-grille .carte .dos,
.memory-grille .carte .face {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(15px, 2.1vw, 21px);
  padding: 4px;
  text-align: center;
  line-height: 1.2;
}
.memory-grille .carte .dos { color: #fffdf2; font-size: 34px; }
.memory-grille .carte .face { color: var(--encre); opacity: 0; }
.memory-grille .carte.vue,
.memory-grille .carte.trouvee { background: #fffdf2; }
.memory-grille .carte.vue .dos,
.memory-grille .carte.trouvee .dos { opacity: 0; }
.memory-grille .carte.vue .face,
.memory-grille .carte.trouvee .face { opacity: 1; }
.memory-grille .carte.trouvee { background: var(--vert); cursor: default; }
.memory-grille .carte.trouvee .face { color: #0d3f27; }

/* ----- taupes ----- */
.taupes-pre {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 660px;
  margin: 0 auto;
  padding: 14px;
  background: #8ad86f;
  border: var(--trait);
  border-radius: 20px;
}
.taupes-pre .trou {
  position: relative;
  aspect-ratio: 1;
  display: flex; align-items: flex-end; justify-content: center;
  overflow: hidden;
}
.taupes-pre .butte {
  position: absolute; left: 2%; right: 2%; bottom: 0; height: 34%;
  background: #6b4a2e;
  border: 4px solid var(--encre);
  border-radius: 50% 50% 14px 14px / 80% 80% 14px 14px;
  z-index: 3;
}
.taupes-pre .taupe {
  position: absolute; bottom: 20%; width: 92%; height: 62%;
  border-radius: 46% 46% 28% 28%;
  background: #b98a5e;
  border: var(--trait);
  transform: translateY(135%);
  transition: transform .18s ease, background .15s ease;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.taupes-pre .taupe.dehors { transform: translateY(0); }
.taupes-pre .taupe .tv {
  font-family: var(--titre);
  font-size: clamp(12px, 1.7vw, 18px);
  color: var(--encre);
  background: #fffdf2;
  border: 3px solid var(--encre);
  border-radius: 20px;
  padding: 2px 8px;
  max-width: 96%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.taupes-pre .taupe.touchee { background: var(--jaune); }

/* ----- labyrinthe ----- */
.laby-grille {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 7px;
  max-width: 520px;
  margin: 0 auto;
  padding: 12px;
  background: #cfe8f5;
  border: var(--trait);
  border-radius: 18px;
}
.laby-grille .case {
  position: relative;
  aspect-ratio: 1;
  border: 3px solid var(--encre);
  border-radius: 11px;
  background: #fffdf2;
  font-family: var(--titre);
  font-size: clamp(13px, 1.8vw, 19px);
  color: var(--encre);
  transition: transform .1s ease, background .14s ease;
}
.laby-grille .case.voisine { background: var(--jaune); cursor: pointer; }
.laby-grille .case.voisine:hover { transform: scale(1.07); }
.laby-grille .case.passee { background: #bfe6cf; }
.laby-grille .case.ici { background: var(--bleu); color: #fffdf2; box-shadow: 0 0 0 4px var(--encre); z-index: 2; }
.laby-grille .case.depart { outline: 3px dashed var(--vert); outline-offset: -7px; }
.laby-grille .case.arrivee { background: #ffe9a8; }
.laby-grille .case.interdite { background: var(--faux); color: #fff; }
.laby-grille .case .drapeau { position: absolute; top: -6px; right: -4px; font-size: 15px; }

/* ===================== Animations ===================== */

@keyframes secoue {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(4px); }
}
.secoue { animation: secoue .42s ease; }

@keyframes pop {
  0%   { transform: scale(.82); opacity: 0; }
  60%  { transform: scale(1.03); }
  100% { transform: scale(1); opacity: 1; }
}
.pop { animation: pop .26s ease both; }

@keyframes monte {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.monte { animation: monte .3s ease both; }

@keyframes scintille {
  0%,100% { opacity: .55; }
  50%     { opacity: 1; }
}

/* ===== vie des personnages ===== */

/* paupières : fermées 2 % du temps, ce qui suffit à donner un clignement */
@keyframes cligne {
  0%, 94%, 100% { transform: scaleY(0); }
  96%, 98%      { transform: scaleY(1); }
}
#labo-svg .paupiere {
  transform-box: fill-box;
  transform-origin: top center;
  animation: cligne 5.4s infinite;
}
#labo-svg #robot .paupiere { animation-duration: 4.1s; }

/* respiration */
@keyframes respire {
  0%, 100% { transform: translateY(0) scale(1); }
  50%      { transform: translateY(-5px) scale(1.012); }
}
#labo-svg .buste {
  transform-box: fill-box;
  transform-origin: bottom center;
  animation: respire 4.2s ease-in-out infinite;
}

/* le robot flotte */
@keyframes flotteRobot {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%      { transform: translateY(-9px) rotate(1deg); }
}
#labo-svg .flotte {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: flotteRobot 3.4s ease-in-out infinite;
}
@keyframes pulseAntenne {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}
#labo-svg .antenne { animation: pulseAntenne 1.5s ease-in-out infinite; }

/* salut du professeur */
@keyframes salue {
  0%, 88%, 100% { transform: rotate(0deg); }
  91%  { transform: rotate(-17deg); }
  94%  { transform: rotate(10deg); }
  97%  { transform: rotate(-12deg); }
}
#labo-svg .main-salut {
  transform-box: fill-box;
  transform-origin: 80% 100%;
  animation: salue 7s ease-in-out infinite;
}

/* personnages cliquables */
#labo-svg .objet-perso { cursor: pointer; }
#labo-svg .objet-perso:hover .buste,
#labo-svg .objet-perso:hover .flotte { filter: brightness(1.08); }

/* réaction : petit sursaut joyeux */
@keyframes sursaute {
  0%   { transform: translateY(0) scale(1); }
  30%  { transform: translateY(-22px) scale(1.06); }
  55%  { transform: translateY(0) scale(.96); }
  75%  { transform: translateY(-9px) scale(1.02); }
  100% { transform: translateY(0) scale(1); }
}
#labo-svg .saute {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: sursaute .62s ease-out;
}

@keyframes flotte {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-7px); }
}

/* étoile qui vole vers le compteur */
.etoile-vol {
  position: fixed; z-index: 60; font-size: 34px; pointer-events: none;
  transition: transform .75s cubic-bezier(.4,-0.2,.6,1), opacity .75s ease;
}

/* confettis de fin */
.confetti { position: fixed; width: 11px; height: 15px; z-index: 55; pointer-events: none; border-radius: 2px; }

/* ===================== Divers ===================== */

.cache { display: none !important; }

#bruit-off {
  position: absolute; top: 14px; right: 16px; z-index: 11;
  font-size: 20px; background: rgba(0,0,0,.4); border-radius: 50%;
  width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
}
#bruit-off:hover { background: rgba(0,0,0,.65); }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,.18); }
::-webkit-scrollbar-thumb { background: #4e687a; border-radius: 7px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #63808f; }

/* ============================================================
   CHOIX DU THÈME dans un atelier
   ============================================================ */
.themes-grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 12px;
  margin: 4px 0 12px;
}
.carte-theme {
  display: flex; align-items: center; gap: 13px;
  text-align: left;
  padding: 13px 15px;
  background: var(--c);
  border: var(--trait);
  border-radius: 16px;
  box-shadow: 0 5px 0 var(--encre);
  color: #fffdf2;
  transition: transform .12s ease, box-shadow .12s ease;
  width: 100%;
}
.carte-theme:hover { transform: translateY(-4px); box-shadow: 0 9px 0 var(--encre); }
.carte-theme:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--encre); }
.carte-theme.melange { margin-top: 2px; }
.carte-theme .ct-ic {
  flex: 0 0 auto;
  font-size: 26px; line-height: 1;
  background: #fffdf2; border: 3px solid var(--encre); border-radius: 50%;
  width: 50px; height: 50px;
  display: flex; align-items: center; justify-content: center;
}
.carte-theme .ct-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.carte-theme .ct-txt b { font-family: var(--titre); font-size: 18px; font-weight: normal; }
.carte-theme .ct-txt small { font-size: 12.5px; line-height: 1.35; opacity: .95; }

/* ============================================================
   TEXTE D'APPUI (lecture, tableaux, phrases à analyser)
   ============================================================ */
.passage {
  background: #fff9ea;
  border: 3px solid var(--encre);
  border-left: 11px solid var(--cuivre);
  border-radius: 13px;
  padding: 15px 19px;
  margin: 0 0 20px;
  font-size: 17.5px;
  line-height: 1.62;
  text-align: left;
  max-height: 34vh;
  overflow-y: auto;
}
.passage h4 {
  font-family: var(--titre);
  font-size: 21px;
  margin: 0 0 8px;
  color: var(--cuivre);
}
.passage p { margin: 0; }
.tab-horaires {
  border-collapse: collapse;
  margin: 0 auto;
  font-size: 17px;
}
.tab-horaires th, .tab-horaires td {
  border: 2px solid var(--encre);
  padding: 7px 15px;
  text-align: center;
}
.tab-horaires th { background: var(--jaune); font-weight: 700; }
.tab-horaires td { background: #fffdf4; }

/* ============================================================
   FIGURES GÉOMÉTRIQUES ET GRAPHIQUES
   ============================================================ */
.figure-boite {
  display: flex;
  justify-content: center;
  margin: 0 auto 22px;
  max-width: 100%;
}
.figure-boite svg { max-width: 100%; height: auto; }

/* ============================================================
   SÉLECTION MULTIPLE
   ============================================================ */
.choix.multi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.choix.multi .rep { position: relative; }
.choix.multi .rep.sel {
  background: var(--jaune);
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--encre), inset 0 0 0 4px var(--encre);
}
.choix.multi .rep.sel::after {
  content: "✓";
  position: absolute; top: -9px; right: -7px;
  width: 25px; height: 25px; border-radius: 50%;
  background: var(--vert); border: 3px solid var(--encre);
  color: #0d3f27; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
@media (max-width: 680px) { .choix.multi { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================
   DIVERS
   ============================================================ */
#musique-off {
  position: absolute; top: 14px; right: 66px; z-index: 11;
  font-size: 18px; background: rgba(0,0,0,.4); border-radius: 50%;
  width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
}
#musique-off:hover { background: rgba(0,0,0,.65); }
#musique-off.eteint { opacity: .55; }

/* sous-lignes du carnet : le détail par thème */
#carnet-corps tr.sous-ligne td {
  font-size: 13.5px;
  color: var(--encre-pale);
  padding-top: 3px; padding-bottom: 3px;
}
#carnet-corps tr.sous-ligne td:first-child { padding-left: 22px; }
#carnet-corps tr.sous-ligne .jauge { height: 7px; }

/* quatre niveaux au lieu de trois : on laisse la rangée s'adapter */
.choix-niveaux { flex-wrap: wrap; }

/* ============================================================
   LE REFUGE — la pièce qui se remplit
   ============================================================ */
#refuge-wrap { position: absolute; inset: 0; overflow: hidden; }
#refuge-svg-hote { position: absolute; inset: 0; display: flex; background: #f6dfae; }
#refuge-svg-hote svg { width: 100%; height: 100%; display: block; }

#etiquette-r {
  position: absolute; z-index: 12; pointer-events: none;
  transform: translate(-50%, -140%);
  background: var(--encre); color: #fffdf2;
  padding: 8px 14px; border-radius: 12px;
  font-size: 15px; font-weight: 700; line-height: 1.25;
  white-space: nowrap; opacity: 0;
  transition: opacity .12s ease;
  box-shadow: 0 5px 0 rgba(0,0,0,.3);
}
#etiquette-r.vu { opacity: 1; }
#etiquette-r small { display: block; font-weight: 400; font-size: 12.5px; opacity: .8; }

#refuge-vide {
  position: absolute; z-index: 11;
  left: 50%; bottom: 36px; transform: translateX(-50%);
  max-width: 520px; text-align: center;
  background: var(--papier); color: var(--encre);
  border: 5px solid var(--encre); border-radius: 18px;
  padding: 16px 24px; font-size: 16px; line-height: 1.5;
  box-shadow: 0 7px 0 var(--encre);
}
#refuge-vide strong { display: block; font-family: var(--titre); font-size: 21px; margin-bottom: 5px; }
#refuge-vide.cache { display: none; }

/* arrivée d'un objet acheté */
#deco-achats .deco { animation: arriveDeco .55s cubic-bezier(.2,1.5,.5,1) both; transform-box: fill-box; transform-origin: 50% 90%; }
@keyframes arriveDeco { from { transform: scale(.3) translateY(26px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- les objets animés ---- */
.lueur { animation: respireLueur 3.4s ease-in-out infinite; }
@keyframes respireLueur { 0%,100% { opacity: .32; } 50% { opacity: .55; } }

.tourne-mobile { animation: tourneMobile 14s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 0%; }
@keyframes tourneMobile { 0%,100% { transform: rotate(-9deg); } 50% { transform: rotate(9deg); } }

.balance-plante { animation: balancePlante 5.2s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 0%; }
@keyframes balancePlante { 0%,100% { transform: rotate(-3.5deg); } 50% { transform: rotate(3.5deg); } }

.eclairs { animation: eclaire 1.1s steps(3) infinite; transform-box: fill-box; transform-origin: 50% 50%; }
@keyframes eclaire { 0% { transform: rotate(0deg); opacity: .9; } 33% { transform: rotate(120deg); opacity: .6; } 66% { transform: rotate(240deg); opacity: 1; } 100% { transform: rotate(360deg); opacity: .9; } }

.poisson-a { animation: nageA 11s linear infinite; }
.poisson-b { animation: nageB 15s linear infinite; }
.poisson-c { animation: nageC 9s linear infinite; }
@keyframes nageA { 0% { transform: translateX(-36px); } 48% { transform: translateX(44px); } 50% { transform: translateX(44px) scaleX(-1); } 98% { transform: translateX(-36px) scaleX(-1); } 100% { transform: translateX(-36px); } }
@keyframes nageB { 0% { transform: translate(40px,0) scaleX(-1); } 48% { transform: translate(-34px,8px) scaleX(-1); } 50% { transform: translate(-34px,8px); } 98% { transform: translate(40px,0); } 100% { transform: translate(40px,0) scaleX(-1); } }
@keyframes nageC { 0% { transform: translateX(-28px); } 48% { transform: translateX(34px); } 50% { transform: translateX(34px) scaleX(-1); } 98% { transform: translateX(-28px) scaleX(-1); } 100% { transform: translateX(-28px); } }
.bulles { animation: monteBulles 3.6s linear infinite; }
@keyframes monteBulles { from { transform: translateY(16px); opacity: 0; } 20% { opacity: .65; } 90% { opacity: .2; } to { transform: translateY(-78px); opacity: 0; } }

.roule-pignon { animation: roulePignon 17s ease-in-out infinite; }
@keyframes roulePignon { 0%,100% { transform: translateX(-120px); } 48% { transform: translateX(210px); } 52% { transform: translateX(210px) scaleX(-1); } 96% { transform: translateX(-120px) scaleX(-1); } }
.antenne-pignon { animation: clignoteAntenne 1.5s ease-in-out infinite; }
@keyframes clignoteAntenne { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.guirlande-ampoules g:nth-child(odd) circle { animation: clignoteAmpoule 2.4s ease-in-out infinite; }
.guirlande-ampoules g:nth-child(even) circle { animation: clignoteAmpoule 2.4s ease-in-out infinite 1.2s; }
@keyframes clignoteAmpoule { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

.aiguilles-coucou { animation: tourneAiguille 20s linear infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes tourneAiguille { to { transform: rotate(360deg); } }
.balancier { animation: balancePendule 2s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 0%; }
@keyframes balancePendule { 0%,100% { transform: rotate(-11deg); } 50% { transform: rotate(11deg); } }
.coucou-oiseau { animation: sortCoucou 8s ease-in-out infinite; }
@keyframes sortCoucou { 0%,88%,100% { transform: translateY(0); opacity: 0; } 92%,96% { transform: translateY(-11px); opacity: 1; } }

/* ============================================================
   MES TRÉSORS — réserve, album, badges
   ============================================================ */
#tresors-corps {
  position: absolute; inset: 72px 0 0 0;
  overflow-y: auto;
  padding: 22px clamp(16px, 4vw, 54px) 54px;
}
.onglets { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.onglets button {
  padding: 11px 20px; border-radius: 14px;
  border: var(--trait); background: var(--papier); color: var(--encre);
  font-size: 16px; font-weight: 700;
  box-shadow: 0 4px 0 var(--encre);
}
.onglets button:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--encre); }
.onglets button.sel { background: var(--jaune); transform: translateY(2px); box-shadow: 0 2px 0 var(--encre); }

.intro-onglet {
  background: var(--papier); color: var(--encre);
  border: 4px solid var(--encre); border-radius: 15px;
  padding: 13px 19px; margin: 0 0 20px;
  font-size: 16px; line-height: 1.5;
}

/* ---- la réserve ---- */
.grille-decos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.carte-deco {
  display: flex; align-items: center; gap: 13px;
  background: var(--papier); color: var(--encre);
  border: var(--trait); border-radius: 16px;
  padding: 12px 15px; box-shadow: 0 5px 0 var(--encre);
}
.carte-deco.acquis { background: #d9f3e0; }
.carte-deco.trop-cher { opacity: .62; }
.carte-deco .cd-ic {
  flex: 0 0 auto; font-size: 30px; line-height: 1;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--jaune); border: 3px solid var(--encre);
  display: flex; align-items: center; justify-content: center;
}
.carte-deco .cd-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.carte-deco .cd-txt b { font-family: var(--titre); font-size: 18px; font-weight: normal; }
.carte-deco .cd-txt small { font-size: 13px; line-height: 1.35; color: var(--encre-pale); }
.carte-deco .cd-prix { flex: 0 0 auto; font-size: 16px; padding: 9px 14px; white-space: nowrap; }
.carte-deco .cd-prix:disabled { opacity: .45; }
.carte-deco .cd-etat { flex: 0 0 auto; font-weight: 700; color: #1c6b40; font-size: 15px; }

.apercu-deco {
  background: #f6dfae; border: 4px solid var(--encre); border-radius: 15px;
  margin: 6px 0 12px; overflow: hidden; height: 190px;
  display: flex; align-items: center; justify-content: center;
}
.apercu-svg { width: 100%; height: 100%; }

/* ---- l'album ---- */
.titre-cat {
  font-family: var(--titre); font-size: 22px; font-weight: normal;
  margin: 24px 0 11px; display: flex; align-items: baseline; gap: 11px;
}
.titre-cat span { font-size: 15px; color: var(--encre-pale); font-family: inherit; }
.grille-cartes { display: grid; grid-template-columns: repeat(auto-fill, minmax(174px, 1fr)); gap: 13px; }
.carte-collec {
  background: var(--papier); color: var(--encre);
  border: 4px solid var(--encre); border-left: 10px solid var(--c, var(--cuivre));
  border-radius: 14px; padding: 13px 14px;
  box-shadow: 0 5px 0 var(--encre);
  display: flex; flex-direction: column; gap: 5px; text-align: center;
}
.carte-collec .cc-ic { font-size: 40px; line-height: 1.1; }
.carte-collec .cc-nom { font-family: var(--titre); font-size: 16.5px; }
.carte-collec .cc-fait { font-size: 12.8px; line-height: 1.4; color: var(--encre-pale); }
.carte-collec .cc-cat { font-size: 12.5px; color: var(--encre-pale); margin-top: 3px; }
.carte-collec.vide {
  background: repeating-linear-gradient(45deg, #efe4cd, #efe4cd 9px, #e6d8bb 9px, #e6d8bb 18px);
  border-left-color: var(--encre); box-shadow: none; opacity: .72;
}
.carte-collec.vide .cc-ic { opacity: .45; }
.carte-collec.vide .cc-nom { color: var(--encre-pale); font-size: 14px; }
.carte-collec.grande { max-width: 330px; margin: 6px auto 4px; border-width: 5px; }
.carte-collec.grande .cc-ic { font-size: 62px; }
.carte-collec.grande .cc-nom { font-size: 23px; }
.carte-collec.grande .cc-fait { font-size: 14.5px; }

/* ---- les badges ---- */
.grille-badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(282px, 1fr)); gap: 13px; }
.badge {
  display: flex; align-items: center; gap: 13px;
  background: var(--papier); color: var(--encre);
  border: var(--trait); border-radius: 16px;
  padding: 11px 15px; box-shadow: 0 5px 0 var(--encre);
}
.badge .bg-ic {
  flex: 0 0 auto; font-size: 28px; line-height: 1;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--jaune); border: 3px solid var(--encre);
  display: flex; align-items: center; justify-content: center;
}
.badge .bg-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.badge .bg-txt b { font-family: var(--titre); font-size: 17.5px; font-weight: normal; }
.badge .bg-txt small { font-size: 13px; line-height: 1.35; color: var(--encre-pale); }
.badge.verrouille { opacity: .52; }
.badge.verrouille .bg-ic { background: #ded2bb; }
.badge.gagne { background: #fff3c4; }

/* ============================================================
   L'ANNONCE DES GAINS
   ============================================================ */
.gain-fond {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(20,12,4,.62);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fondApparait .22s ease both;
}
@keyframes fondApparait { from { opacity: 0; } to { opacity: 1; } }
.gain-boite {
  background: var(--papier); color: var(--encre);
  border: 5px solid var(--encre); border-radius: 24px;
  box-shadow: 0 9px 0 var(--encre), 0 22px 50px rgba(0,0,0,.4);
  padding: 24px 28px 22px; text-align: center;
  width: min(430px, 100%); max-height: 88vh; overflow-y: auto;
}
.gain-titre {
  font-family: var(--titre); font-size: 25px;
  color: var(--cuivre); margin-bottom: 10px;
}
.gain-titre.second { margin-top: 20px; }
.gain-badges { display: flex; flex-direction: column; gap: 9px; }
.gain-badges .badge { text-align: left; }
