/* Carnet de voyage : papier crème, encre, tampons. Pensé d'abord pour une
   tablette tenue à la main (grandes cibles tactiles), puis pour l'ordinateur. */

:root {
  --papier: #fbf6ea;
  --papier-2: #f3ead3;
  --carte: #fffdf7;
  --encre: #2b2a33;
  --encre-douce: #6b6760;
  --trait: #e2d6b8;
  --accent: #00798c;
  --accent-fonce: #005f6e;
  --tampon: #c0392b;
  --or: #f2a900;
  --vert: #2e8b57;
  --vert-clair: #e3f4e9;
  --rouge: #c8414b;
  --rouge-clair: #fde8e8;
  --orange-clair: #fff1dc;
  --bleu-clair: #e5f3f6;
  --rayon: 16px;
  --ombre: 0 2px 0 rgba(90, 70, 30, 0.08), 0 8px 24px rgba(90, 70, 30, 0.08);
  font-family: ui-rounded, 'SF Pro Rounded', 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--encre);
  background: var(--papier);
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--papier);
  background-image: radial-gradient(rgba(120, 95, 40, 0.13) 1px, transparent 1px);
  background-size: 22px 22px;
  font-size: 18px;
  line-height: 1.5;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
a { color: var(--accent-fonce); }
img { max-width: 100%; }
[hidden] { display: none !important; }
.discret { color: var(--encre-douce); font-size: 0.9em; }
.centre-texte { text-align: center; }
.cache { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.erreur { color: var(--rouge); font-weight: 600; min-height: 1em; margin: 0.5em 0; }
.erreur:empty { display: none; }

/* ---------------------------------------------------------------- Structure */

.page { max-width: 760px; margin: 0 auto; padding: 16px 16px 110px; }
.page.large { max-width: 1100px; padding-bottom: 40px; }
.centre { min-height: 100vh; display: grid; place-items: center; padding: 16px; }

.carte-papier {
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 20px;
  margin: 0 0 16px;
}

.entete {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(251, 246, 234, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--trait);
}
.entete-titre { font-weight: 800; font-size: 1.1rem; text-decoration: none; color: var(--encre); margin-right: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entete.parent { flex-wrap: wrap; }
.entete.parent .outils { display: flex; gap: 8px; flex-wrap: wrap; }
.compteur {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0 10px;
  align-items: center;
  text-decoration: none;
  color: var(--encre);
  background: var(--carte);
  border: 1px solid var(--trait);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.85rem;
}
.compteur-niveau { font-weight: 700; }
.compteur-miles { font-weight: 700; color: var(--accent-fonce); }
.compteur .barre { grid-column: 1 / -1; }
.indicateur { font-size: 0.8rem; background: var(--orange-clair); border-radius: 999px; padding: 3px 10px; }
.bandeau-apercu { background: #333; color: #fff; text-align: center; padding: 6px; font-size: 0.85rem; }
.bandeau-apercu a { color: #ffd166; }

.navigation {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 247, 0.96);
  border-top: 1px solid var(--trait);
}
.navigation a {
  flex: 0 1 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--encre-douce);
  border-radius: 12px;
  padding: 4px;
}
.navigation a span { font-size: 0.8rem; font-weight: 700; }
.navigation a.actif { color: var(--accent-fonce); background: var(--bleu-clair); }

/* ---------------------------------------------------------------- Boutons */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 48px;
  padding: 10px 20px;
  border-radius: 14px;
  border: 2px solid var(--trait);
  background: var(--carte);
  color: var(--encre);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--trait);
  transition: transform 0.08s;
  touch-action: manipulation;
}
.bouton:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--trait); }
.bouton:disabled { opacity: 0.5; cursor: default; }
.bouton.principal { background: var(--accent); border-color: var(--accent-fonce); color: #fff; box-shadow: 0 3px 0 var(--accent-fonce); }
.bouton.grand { font-size: 1.2rem; min-height: 60px; padding: 14px 28px; }
.bouton.petit { min-height: 38px; padding: 6px 14px; font-size: 0.9rem; }
.bouton.discret { background: transparent; box-shadow: none; border-color: transparent; color: var(--encre-douce); font-weight: 600; }
.bouton-icone { background: none; border: none; font-size: 1.3rem; cursor: pointer; padding: 6px; border-radius: 10px; min-width: 44px; min-height: 44px; }
.bouton-icone:hover { background: var(--papier-2); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 16px 0; }
.outils { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 8px; }
.retour-lien { display: inline-block; margin: 4px 0 12px; font-weight: 700; text-decoration: none; padding: 8px 0; }
.secoue { animation: secoue 0.35s; }
@keyframes secoue { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.pastille { display: inline-block; font-size: 0.75rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; margin-left: 8px; background: var(--tampon); color: #fff; vertical-align: middle; }
.pastille.bonus { background: var(--or); color: #3a2a00; }
.pastille.ok { background: var(--vert); }
.pastille.encours { background: var(--accent); }
.pastille.ferme { background: #999; }

.barre { height: 10px; background: var(--papier-2); border-radius: 999px; overflow: hidden; }
.barre > * { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #3fb0a9); border-radius: 999px; transition: width 0.4s; }
.barre.mini { height: 5px; }
.barre.chrono > * { background: linear-gradient(90deg, var(--or), var(--tampon)); transition: width 0.1s linear; }

/* ---------------------------------------------------------------- Connexion */

.connexion { width: min(420px, 100%); text-align: center; }
.connexion-logo { font-size: 4rem; }
.connexion label { display: grid; gap: 6px; text-align: left; font-weight: 700; margin: 16px 0; }
.connexion input, .champ {
  font: inherit;
  font-size: 1.1rem;
  padding: 12px 14px;
  border: 2px solid var(--trait);
  border-radius: 12px;
  background: #fff;
  width: 100%;
  color: var(--encre);
}
.connexion input:focus, .champ:focus, .trou:focus { outline: 3px solid rgba(0, 121, 140, 0.35); border-color: var(--accent); }

/* ---------------------------------------------------------------- Accueil et carte */

.accueil { text-align: center; margin: 8px 0 20px; }
.continuer { flex-direction: column; gap: 2px; width: 100%; max-width: 520px; }
.continuer small { font-weight: 600; opacity: 0.9; font-size: 0.85rem; }

.mot-parents { border-left: 6px solid var(--tampon); }
.mot-parents.nouveau { animation: apparait 0.5s; }
.manuscrit { font-size: 1.15rem; white-space: pre-wrap; font-style: italic; }

.carte-voyage { position: relative; margin: 10px 0 30px; }
.carte-voyage > div:first-child, .trace { position: absolute; inset: 0; width: 100%; height: 100%; }
.trace path { fill: none; stroke-linecap: round; }
.trace-reste { stroke: #c9b98f; stroke-width: 4; stroke-dasharray: 2 10; }
.trace-fait { stroke: var(--tampon); stroke-width: 5; }

.etape {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--encre);
  width: 150px;
}
.etape-rond {
  position: relative;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  font-size: 2.3rem;
  border-radius: 50%;
  background: var(--carte);
  border: 4px solid var(--trait);
  box-shadow: var(--ombre);
  transition: transform 0.15s;
}
a.etape:hover .etape-rond { transform: scale(1.07); }
.etape-nom { margin-top: 6px; text-align: center; font-weight: 800; font-size: 0.95rem; background: rgba(251, 246, 234, 0.9); border-radius: 8px; padding: 0 6px; line-height: 1.25; }
.etape-nom small { display: block; font-weight: 600; color: var(--encre-douce); font-size: 0.75rem; }
.etape.fini .etape-rond { border-color: var(--tampon); border-style: double; border-width: 6px; }
.etape.courant .etape-rond { border-color: var(--accent); animation: pulse 1.8s infinite; }
.etape.ferme { opacity: 0.55; }
.etape.ferme .etape-rond { font-size: 1.6rem; filter: grayscale(1); }
.etape-coche { position: absolute; right: -6px; bottom: -4px; width: 28px; height: 28px; display: grid; place-items: center; font-size: 0.95rem; font-weight: 900; color: #fff; background: var(--tampon); border-radius: 50%; border: 2px solid #fff; }
.etape-avion { position: absolute; top: -18px; right: -20px; font-size: 1.7rem; animation: vole 2.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(0, 121, 140, 0.45); } 50% { box-shadow: 0 0 0 14px rgba(0, 121, 140, 0); } }
@keyframes vole { 50% { transform: translate(4px, -6px) rotate(8deg); } }
@keyframes apparait { from { opacity: 0; transform: translateY(10px); } }

/* ---------------------------------------------------------------- Étape du jour */

.etape-tete { display: flex; gap: 16px; align-items: center; position: relative; flex-wrap: wrap; }
.etape-tete h1 small { font-weight: 600; color: var(--encre-douce); font-size: 1rem; }
.etape-tete > div:nth-child(2) { flex: 1 1 240px; }
.etape-emoji { font-size: 3.4rem; }
.mot-maitresse { background: var(--orange-clair); border-radius: 10px; padding: 8px 12px; margin: 8px 0 0; }
.savais-tu { background: var(--bleu-clair); border: 2px dashed #9cc9d3; border-radius: var(--rayon); padding: 12px 16px; margin-bottom: 16px; }
.progression-jour { display: flex; align-items: center; gap: 12px; margin: 0 4px 12px; font-weight: 700; font-size: 0.9rem; }
.progression-jour .barre { flex: 1; }

.activites { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.activite {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--carte);
  border: 1px solid var(--trait);
  border-left: 8px solid var(--matiere, var(--accent));
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  text-decoration: none;
  color: var(--encre);
  transition: transform 0.1s;
}
.activite:hover { transform: translateX(3px); }
.activite.faite { background: #fbfdf9; }
.activite-emoji { font-size: 1.8rem; }
.activite-texte { flex: 1; display: grid; }
.activite-titre { font-weight: 800; }
.activite-infos { font-size: 0.82rem; color: var(--encre-douce); }
.matiere { color: var(--matiere); font-weight: 700; }
.activite-etat { font-size: 1.3rem; color: #b9ad8c; white-space: nowrap; }
.etoiles { color: var(--or); letter-spacing: 1px; }

/* Tampon de l'étape */
.tampon {
  display: inline-grid;
  justify-items: center;
  align-content: center;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 4px double var(--tampon);
  color: var(--tampon);
  transform: rotate(var(--rotation, -8deg));
  text-align: center;
  padding: 10px;
  background: rgba(192, 57, 43, 0.04);
  animation: tamponne 0.45s cubic-bezier(0.2, 1.6, 0.4, 1);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.etape-tete .tampon { position: absolute; right: 10px; top: -14px; width: 104px; height: 104px; opacity: 0.85; }
.tampon-emoji { font-size: 2rem; line-height: 1.1; }
.tampon-lieu { font-size: 0.72rem; line-height: 1.1; }
.tampon-jour { font-size: 0.62rem; opacity: 0.8; }
.tampon.petit { width: 116px; height: 116px; }
.tampon.vide { border-style: dashed; border-color: #cdbf9b; color: #b5a77f; background: none; animation: none; }
@keyframes tamponne { from { transform: scale(2.2) rotate(var(--rotation, -8deg)); opacity: 0; } }

/* ---------------------------------------------------------------- Activité */

.activite-tete { border-left: 8px solid var(--matiere); padding-left: 14px; margin-bottom: 16px; }
.matiere-puce { font-weight: 700; color: var(--matiere); font-size: 0.9rem; }
.consigne { font-size: 1.05rem; }
.intro p { margin: 0.6em 0; }
.paliers { display: grid; gap: 4px; color: var(--encre-douce); }
.paliers span::first-letter { color: var(--or); }

/* Leçon : classes utilisables dans le HTML du contenu */
.lecon { font-size: 1.08rem; line-height: 1.65; }
.lecon h2 { color: var(--accent-fonce); margin-top: 1.2em; }
.lecon h2:first-child { margin-top: 0; }
.lecon h3 { margin-top: 1em; }
.lecon table { border-collapse: collapse; margin: 12px 0; width: 100%; display: block; overflow-x: auto; }
.lecon th, .lecon td { border: 1px solid var(--trait); padding: 6px 10px; text-align: left; }
.lecon th { background: var(--papier-2); }
.lecon .regle { background: #fff7d1; border: 2px solid #f0d36b; border-radius: 12px; padding: 12px 16px; margin: 14px 0; }
.lecon .regle::before { content: '📌 À retenir'; display: block; font-weight: 800; margin-bottom: 4px; }
.lecon .exemple { background: var(--bleu-clair); border-radius: 12px; padding: 10px 16px; margin: 12px 0; }
.lecon .exemple::before { content: '🔎 Exemple'; display: block; font-weight: 800; margin-bottom: 4px; }
.lecon .attention { background: var(--rouge-clair); border-radius: 12px; padding: 10px 16px; margin: 12px 0; }
.lecon .attention::before { content: '⚠️ Attention'; display: block; font-weight: 800; margin-bottom: 4px; }
.lecon mark { background: #ffe58f; border-radius: 4px; padding: 0 3px; }
.liens ul { margin: 0; }

/* ---------------------------------------------------------------- Questions */

.question-tete { display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--encre-douce); font-size: 0.9rem; margin-bottom: 14px; }
.question-tete .barre { flex: 1; }
.enonce { display: flex; gap: 8px; align-items: flex-start; font-size: 1.2rem; font-weight: 700; margin-bottom: 16px; }
.enonce > div { flex: 1; }
.illustration { display: block; margin: 0 auto 16px; max-height: 320px; border-radius: 12px; }
.aide { color: var(--encre-douce); font-size: 0.9rem; margin: 0 0 8px; }

.choix-liste { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.choix-liste.larges { grid-template-columns: 1fr; }
.choix, .assoc, .etiquette {
  font: inherit;
  font-size: 1.05rem;
  text-align: left;
  padding: 14px 16px;
  min-height: 54px;
  border: 2px solid var(--trait);
  border-radius: 14px;
  background: #fff;
  color: var(--encre);
  cursor: pointer;
  box-shadow: 0 3px 0 var(--trait);
  touch-action: manipulation;
}
.choix.choisi { border-color: var(--accent); background: var(--bleu-clair); box-shadow: 0 3px 0 var(--accent); }
.choix.bon, .assoc.bon { border-color: var(--vert); background: var(--vert-clair); box-shadow: 0 3px 0 var(--vert); }
.choix.faux, .assoc.faux { border-color: var(--rouge); background: var(--rouge-clair); box-shadow: 0 3px 0 var(--rouge); }
.choix:disabled { cursor: default; opacity: 0.75; }

.saisie { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 700; }
.saisie .champ { max-width: 320px; }
.champ.bon, .trou.bon { border-color: var(--vert); background: var(--vert-clair); }
.champ.faux, .trou.faux { border-color: var(--rouge); background: var(--rouge-clair); }
.correction { color: var(--vert); font-weight: 600; margin: 10px 0 0; }
.correction:empty { display: none; }
.correction ul { margin: 4px 0; }

.texte-trous { font-size: 1.2rem; line-height: 2.3; }
.trou-conteneur { display: inline-flex; flex-direction: column; vertical-align: middle; line-height: 1.2; }
.trou {
  font: inherit;
  font-weight: 700;
  padding: 4px 8px;
  border: 2px solid var(--trait);
  border-bottom: 3px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  color: var(--encre);
  min-height: 40px;
}
select.trou { padding-right: 4px; }
.trou:disabled { opacity: 1; color: var(--encre); }
.correction-trou { font-size: 0.8rem; color: var(--vert); font-weight: 800; text-align: center; }

.assoc-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.assoc-col { display: grid; gap: 10px; align-content: start; }
.assoc { --lien: transparent; border-left: 10px solid var(--lien); }
.assoc.lie { border-left-color: var(--lien); }
.assoc.selection { border-color: var(--accent); background: var(--bleu-clair); box-shadow: 0 0 0 3px rgba(0, 121, 140, 0.3); }

.ordre-reponse, .ordre-reserve { display: flex; flex-wrap: wrap; gap: 10px; min-height: 70px; padding: 12px; border-radius: 14px; }
.ordre-reponse { background: var(--papier-2); border: 2px dashed #cdbf9b; margin-bottom: 12px; align-items: center; }
.ordre-reponse.bon { border-color: var(--vert); background: var(--vert-clair); }
.ordre-reponse.faux { border-color: var(--rouge); background: var(--rouge-clair); }
.etiquette { padding: 10px 14px; min-height: 48px; }

.ecoute { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ecoute audio { width: 100%; }
.dictee, .redaction { font-size: 1.15rem; line-height: 1.7; resize: vertical; }
.mot-ok { color: var(--vert); }
.mot-faux { color: var(--rouge); text-decoration: line-through; text-decoration-thickness: 2px; }
.mot-manque { background: #ffe0a3; border-radius: 4px; padding: 0 3px; font-weight: 700; }

.retour { margin-top: 16px; padding: 0; border-radius: 12px; }
.retour:empty { display: none; }
.retour.info, .retour.presque, .retour.bravo, .retour.rate { padding: 12px 16px; animation: apparait 0.25s; }
.retour p { margin: 6px 0 0; }
.retour.info { background: var(--papier-2); }
.retour.presque { background: var(--orange-clair); }
.retour.bravo { background: var(--vert-clair); color: #1c5e39; font-size: 1.1rem; }
.retour.rate { background: var(--rouge-clair); }

/* Résultat */
.grandes-etoiles { font-size: 4rem; letter-spacing: 6px; color: #e8dfc7; }
.grandes-etoiles .pleine { color: var(--or); display: inline-block; animation: etoile 0.5s backwards; text-shadow: 0 2px 0 #c98a00; }
@keyframes etoile { from { transform: scale(0) rotate(-90deg); } }
.score { font-size: 1.6rem; font-weight: 800; margin: 4px 0; }
.erreurs { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.erreurs li { border-bottom: 1px solid var(--trait); padding-bottom: 10px; }
.erreurs p { margin: 2px 0; }
.erreurs .mot-faux { text-decoration: none; font-weight: 700; }
.erreurs .mot-ok { font-weight: 700; }

/* Calcul mental */
.calcul { text-align: center; }
.calcul-tete { display: flex; align-items: center; gap: 14px; font-size: 1.3rem; font-weight: 800; }
.calcul-tete .barre { flex: 1; height: 14px; }
.calcul-question { font-size: 3rem; font-weight: 800; margin: 20px 0 8px; font-variant-numeric: tabular-nums; }
.calcul-saisie { font-size: 2.4rem; font-weight: 800; min-height: 64px; border-bottom: 4px solid var(--trait); width: min(280px, 80%); margin: 0 auto 18px; font-variant-numeric: tabular-nums; }
.calcul-saisie.bon { color: var(--vert); border-color: var(--vert); }
.calcul-saisie.faux { color: var(--rouge); border-color: var(--rouge); font-size: 1.8rem; }
.pave { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 330px; margin: 0 auto; }
.touche { font: inherit; font-size: 1.7rem; font-weight: 800; min-height: 64px; border-radius: 16px; border: 2px solid var(--trait); background: #fff; box-shadow: 0 4px 0 var(--trait); cursor: pointer; touch-action: manipulation; color: var(--encre); }
.touche:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--trait); }
.touche.ok { background: var(--accent); color: #fff; border-color: var(--accent-fonce); box-shadow: 0 4px 0 var(--accent-fonce); font-size: 1.3rem; }

/* Rédaction et photo */
.ligne { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.envoi { border-top: 1px solid var(--trait); padding-top: 8px; margin-top: 8px; }
.texte-envoye { white-space: pre-wrap; font-size: 1.02rem; }
.apercu-photo img { max-height: 340px; border-radius: 12px; margin-top: 14px; box-shadow: var(--ombre); }
.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.galerie img { border-radius: 10px; aspect-ratio: 3 / 4; object-fit: cover; width: 100%; }

/* ---------------------------------------------------------------- Fête */

.fete { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(43, 42, 51, 0.45); padding: 16px; animation: apparait 0.3s; }
.fete-boite { width: min(440px, 100%); text-align: center; display: grid; gap: 12px; justify-items: center; max-height: 90vh; overflow: auto; }
.confettis { position: fixed; inset: 0; z-index: 60; pointer-events: none; }

/* ---------------------------------------------------------------- Carnet */

.profil { text-align: center; }
.profil-emoji { font-size: 3.6rem; }
.profil .barre { max-width: 420px; margin: 8px auto; height: 14px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 16px; }
.stats > div { display: grid; background: var(--papier-2); border-radius: 12px; padding: 10px; text-align: center; }
.stats strong { font-size: 1.4rem; }
.stats span { font-size: 0.8rem; color: var(--encre-douce); }
.stats.grandes { margin: 0 0 16px; }
.titre-section { margin: 26px 4px 12px; }
.tampons { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 14px; justify-items: center; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge { display: grid; justify-items: center; text-align: center; gap: 2px; padding: 14px 10px; border-radius: var(--rayon); border: 2px dashed var(--trait); color: #a99f86; }
.badge .badge-emoji { font-size: 2.2rem; filter: grayscale(1); opacity: 0.45; }
.badge small { font-size: 0.78rem; }
.badge.gagne { border: 2px solid var(--or); background: #fffaf0; color: var(--encre); box-shadow: var(--ombre); }
.badge.gagne .badge-emoji { filter: none; opacity: 1; }
.fete .badge { width: 100%; }
.bareme ul { padding-left: 1.2em; }

/* ---------------------------------------------------------------- Parent */

.tableau { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.tableau th, .tableau td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--trait); vertical-align: top; }
.tableau th { font-size: 0.8rem; color: var(--encre-douce); text-transform: uppercase; letter-spacing: 0.4px; }
.tableau tr.a-faire td { color: var(--encre-douce); }
.tableau tr.detail > td { padding-top: 0; }
.tableau details summary { cursor: pointer; color: var(--accent-fonce); font-weight: 600; padding: 4px 0; }
.tableau.reponses { background: #fff; border-radius: 8px; }
.tableau .erreur-ligne td { background: var(--rouge-clair); }
.jour-parent { overflow-x: auto; }
.jour-parent .ligne { justify-content: flex-start; margin: 0 0 8px; }
.jour-parent h2 { margin: 0; }
.photo-parent { max-height: 260px; border-radius: 8px; margin-top: 4px; }
.messages { padding-left: 1.2em; }
.case { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.case input { width: 22px; height: 22px; }

@media (max-width: 520px) {
  body { font-size: 17px; }
  h1 { font-size: 1.45rem; }
  .carte-papier { padding: 16px; }
  .compteur-niveau { display: none; }
  .entete { gap: 6px; padding: 8px 10px; }
  .indicateur { font-size: 0.7rem; padding: 2px 6px; }
  .compteur { grid-template-columns: auto; }
  .etape { width: 120px; }
  .etape-rond { width: 64px; height: 64px; font-size: 2rem; }
  .etape-tete .tampon { width: 84px; height: 84px; top: -10px; right: 4px; }
  .etape-tete .tampon .tampon-lieu, .etape-tete .tampon .tampon-jour { display: none; }
  .assoc-grille { gap: 8px; }
  .assoc { font-size: 0.95rem; padding: 10px; }
  .grandes-etoiles { font-size: 3rem; }
  .calcul-question { font-size: 2.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  body { background: #fff; font-size: 11pt; }
  .pas-imprime, .navigation, .bouton, .bouton-icone { display: none !important; }
  .entete { position: static; background: none; border: none; }
  .carte-papier { box-shadow: none; break-inside: avoid-page; border-color: #ccc; }
  .tableau .erreur-ligne td { background: #fbe3e3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  details > summary { list-style: none; }
}
