/* noyau.css : tokens et socle visuel de la plateforme Devoirs (lot 1).
   Mobile-first (iPhone), sobre et gai, sans framework ni fonte externe. */

/* ------------------------------------------------------------ tokens */
:root {
  --fond: #f6f4ef;
  --carte: #ffffff;
  --encre: #2b2b33;
  --encre-douce: #6d6d78;
  --marque: #4f6df5;
  --sur-marque: #ffffff;
  --succes: #2e9e6b;
  --erreur: #d0454f;
  --bordure: #e3e0d8;
  --ombre: 0 0.125rem 0.5rem rgba(43, 43, 51, 0.08);
  --rayon: 1.25rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #15151c;
    --carte: #22222d;
    --encre: #f0efe9;
    --encre-douce: #a5a5b0;
    --marque: #8ba0ff;
    --sur-marque: #10131f;
    --succes: #55c793;
    --erreur: #ff7f88;
    --bordure: #33333f;
    --ombre: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.35);
  }
}

/* ------------------------------------------------------------ socle */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--fond);
  color: var(--encre);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 0.1875rem solid var(--marque);
  outline-offset: 0.125rem;
  border-radius: 0.375rem;
}

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

/* ------------------------------------------------------------ gabarit */
.application {
  max-width: 26rem;
  margin: 0 auto;
  padding: 1.25rem 1.25rem 2.5rem;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Tablette (les enfants travaillent sur iPad mini) : meme gabarit a une
   colonne, un cran plus grand. Tout le CSS est en rem : monter la taille
   racine grossit boutons, cartes et textes d'un bloc, et la colonne
   elargie remplit l'ecran sans etirer les lignes de lecture. */
@media (min-width: 40em) {
  html {
    font-size: 112.5%;
  }

  .application {
    max-width: 34rem;
  }
}

.ecran {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

.ecran[hidden] {
  display: none;
}

.ecran-centre {
  justify-content: center;
  align-items: center;
  text-align: center;
}

.titre-app {
  font-size: 2.25rem;
  margin: 1rem 0 0;
  text-align: center;
  letter-spacing: 0.02em;
}

.sous-titre {
  font-size: 1.375rem;
  margin: 0.5rem 0 0;
}

.texte-doux {
  color: var(--encre-douce);
  text-align: center;
  margin: 0;
}

/* ------------------------------------------------------------ boutons */
.bouton {
  min-height: 2.75rem; /* cible tactile 44 px minimum */
  padding: 0.625rem 1.25rem;
  border-radius: var(--rayon);
  border: 0.0625rem solid var(--bordure);
  background: var(--carte);
  box-shadow: var(--ombre);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.bouton:active {
  transform: scale(0.97);
}

.bouton-principal {
  background: var(--marque);
  color: var(--sur-marque);
  border-color: var(--marque);
  font-weight: 600;
}

.bouton-secondaire {
  color: var(--encre-douce);
}

.lien-discret {
  background: none;
  border: none;
  color: var(--encre-douce);
  text-decoration: underline;
  min-height: 2.75rem;
  padding: 0.5rem;
  cursor: pointer;
  align-self: center;
}

.bouton-retour {
  align-self: flex-start;
  text-decoration: none;
}

/* ------------------------------------------------------------ cartes enfants */
.liste-enfants {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.carte-enfant {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  min-height: 8.75rem;
  border-radius: var(--rayon);
  border: 0.0625rem solid var(--bordure);
  background: var(--carte);
  box-shadow: var(--ombre);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.carte-enfant:active {
  transform: scale(0.96);
}

.carte-enfant-avatar {
  font-size: 3.5rem;
  line-height: 1;
}

.carte-enfant-prenom {
  font-size: 1.375rem;
  font-weight: 600;
}

/* ------------------------------------------------------------ ecran PIN */
.entete-pin {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.avatar-grand {
  font-size: 4rem;
  line-height: 1;
}

.pin-prenom {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

.pin-points {
  display: flex;
  justify-content: center;
  gap: 0.625rem;
  min-height: 1.25rem;
}

.pin-point {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 0.125rem solid var(--encre-douce);
  background: transparent;
}

.pin-point-plein {
  background: var(--marque);
  border-color: var(--marque);
}

.pave-numerique {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.touche {
  min-height: 4rem; /* gros boutons pour petites mains */
  font-size: 1.75rem;
  font-weight: 600;
  border-radius: var(--rayon);
  border: 0.0625rem solid var(--bordure);
  background: var(--carte);
  box-shadow: var(--ombre);
  cursor: pointer;
  transition: transform 0.08s ease;
}

.touche:active {
  transform: scale(0.94);
}

.touche-action {
  font-size: 1rem;
  color: var(--encre-douce);
}

.touche-valider {
  background: var(--marque);
  color: var(--sur-marque);
  border-color: var(--marque);
}

/* ------------------------------------------------------------ formulaire parent */
.formulaire {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.etiquette {
  font-weight: 600;
  margin-top: 0.5rem;
}

.champ {
  font: inherit;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  border: 0.0625rem solid var(--bordure);
  background: var(--carte);
  color: var(--encre);
}

/* ------------------------------------------------------------ accueil */
.entete-accueil {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.accueil-bonjour {
  font-size: 1.75rem;
  margin: 0;
  text-align: center;
}

.liste-programmes {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.carte-programme {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  min-height: 2.75rem;
  border-radius: var(--rayon);
  border: 0.0625rem solid var(--bordure);
  background: var(--carte);
  box-shadow: var(--ombre);
}

.carte-programme-emoji {
  font-size: 2rem;
  line-height: 1;
}

.carte-programme-titre {
  display: block;
  font-size: 1.125rem;
}

.carte-programme-niveau {
  color: var(--encre-douce);
}

.carte-placeholder {
  text-align: center;
  color: var(--encre-douce);
  border: 0.125rem dashed var(--bordure);
  border-radius: var(--rayon);
  padding: 1.25rem;
  margin: 0;
}

.liste-parent-enfants {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ligne-enfant {
  background: var(--carte);
  border: 0.0625rem solid var(--bordure);
  border-radius: var(--rayon);
  padding: 0.75rem 1.25rem;
  font-size: 1.125rem;
}

/* ------------------------------------------------------------ messages */
.message-erreur {
  color: var(--erreur);
  text-align: center;
  font-weight: 600;
  margin: 0;
}

.message-succes {
  color: var(--succes);
  text-align: center;
  font-weight: 600;
  margin: 0;
}

/* ============================================================ lot 2 : quiz */

/* ------------------------------------------------------------ carte matiere cliquable */
.carte-programme-bouton {
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.carte-programme-bouton:active {
  transform: scale(0.97);
}

.carte-programme-fleche {
  margin-left: auto;
  font-size: 1.75rem;
  color: var(--encre-douce);
  line-height: 1;
}


/* Garde globale : l'attribut hidden gagne toujours, meme contre un display
   pose par une classe (flex/grid). Sans elle, un bandeau .bandeau-reprise
   reste visible malgre bandeau.hidden = true. */
[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------ bandeaux */
.bandeau-diagnostic,
.bandeau-reprise {
  border: 0.125rem solid var(--marque);
  background: var(--carte);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bandeau-texte {
  margin: 0;
  font-weight: 600;
}

.bandeau-boutons {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------ choisir une session */
.entete-choix {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.bouton-large {
  width: 100%;
  min-height: 3.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.choix-nombre {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.groupe-nombre {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.bouton-nombre {
  min-height: 2.75rem;
  border-radius: 0.75rem;
  border: 0.0625rem solid var(--bordure);
  background: var(--carte);
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
}

.bouton-nombre-actif {
  background: var(--marque);
  color: var(--sur-marque);
  border-color: var(--marque);
}

/* ------------------------------------------------------------ quiz */
.entete-quiz {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quiz-compteur {
  color: var(--encre-douce);
  font-weight: 600;
}

.barre-progression {
  height: 0.625rem;
  border-radius: 0.375rem;
  background: var(--bordure);
  overflow: hidden;
}

.barre-progression-remplie {
  height: 100%;
  width: 0%;
  background: var(--marque);
  border-radius: 0.375rem;
  transition: width 0.25s ease;
}

.carte-enonce {
  background: var(--carte);
  border: 0.0625rem solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 1.25rem;
  font-size: 1.25rem;
  overflow-x: auto;
}

.formulaire-quiz {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ligne-champ {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.champ-quiz {
  font-size: 1.25rem;
  min-height: 3rem;
}

.champ-ok {
  border: 0.125rem solid var(--succes);
}

.champ-erreur {
  border: 0.125rem solid var(--erreur);
}

.quiz-feedback {
  border-radius: var(--rayon);
  padding: 0.875rem 1rem;
}

.quiz-feedback-ok {
  border: 0.125rem solid var(--succes);
}

.quiz-feedback-ok .feedback-titre {
  color: var(--succes);
}

.quiz-feedback-erreur {
  border: 0.125rem solid var(--erreur);
}

.quiz-feedback-erreur .feedback-titre {
  color: var(--erreur);
}

.quiz-feedback-neutre {
  border: 0.125rem dashed var(--bordure);
  color: var(--encre-douce);
}

.feedback-titre {
  margin: 0;
  font-weight: 700;
  font-size: 1.125rem;
}

.feedback-attendu {
  margin: 0.25rem 0 0;
}

/* ------------------------------------------------------------ bilan */
.bilan-tete {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  text-align: center;
  margin-top: 0.5rem;
}

.bilan-emoji {
  font-size: 4rem;
  line-height: 1;
}

.bilan-score {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0;
}

.bilan-serveur {
  text-align: center;
  font-weight: 600;
  color: var(--marque);
  margin: 0;
}

.titre-section {
  font-size: 1.125rem;
  margin: 0.75rem 0 0.25rem;
}

.liste-revoir {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ligne-revoir {
  background: var(--carte);
  border: 0.0625rem solid var(--bordure);
  border-radius: 0.75rem;
  padding: 0.625rem 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.revoir-enonce {
  font-weight: 600;
}

.revoir-attendu {
  color: var(--encre-douce);
}

/* ------------------------------------------------------------ mes progres */
.stats-totaux {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.tuile-stat {
  background: var(--carte);
  border: 0.0625rem solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 0.875rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.125rem;
  text-align: center;
}

.tuile-valeur {
  font-size: 1.5rem;
}

.tuile-libelle {
  color: var(--encre-douce);
  font-size: 0.875rem;
}

.ligne-module {
  background: var(--carte);
  border: 0.0625rem solid var(--bordure);
  border-radius: 0.75rem;
  padding: 0.625rem 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin-bottom: 0.5rem;
}

.ligne-module-tete {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.ligne-module-titre {
  font-weight: 600;
}

.ligne-module-taux {
  color: var(--encre-douce);
}

.barre-taux {
  height: 0.5rem;
  border-radius: 0.25rem;
  background: var(--bordure);
  overflow: hidden;
}

.barre-taux-remplie {
  height: 100%;
  background: var(--succes);
  border-radius: 0.25rem;
}

.liste-sessions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ligne-session {
  background: var(--carte);
  border: 0.0625rem solid var(--bordure);
  border-radius: 0.75rem;
  padding: 0.625rem 0.875rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ligne-session-date {
  color: var(--encre-douce);
  font-size: 0.9375rem;
}

.ligne-session-mode {
  flex: 1;
}

.ligne-session-score {
  font-weight: 700;
}

/* ============================================================ lot 3 : modules d'ete */

/* ------------------------------------------------------------ champ QCM
   Rendu par quiz.js (champ de type "qcm") : une colonne de GROS boutons
   tactiles ; etat choisi, puis juste / faux / bonne reponse au feedback. */
.quiz-qcm {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-top: 0.25rem;
}

.quiz-qcm-option {
  min-height: 3.5rem; /* gros boutons pour petites mains, cible tactile large */
  padding: 0.75rem 1rem;
  font-size: 1.25rem;
  font-weight: 700;
  text-align: center;
  border-radius: var(--rayon);
  border: 0.125rem solid var(--bordure);
  background: var(--carte);
  box-shadow: var(--ombre);
  color: var(--encre);
  cursor: pointer;
  transition: transform 0.08s ease;
  overflow-wrap: anywhere;
}

.quiz-qcm-option:active {
  transform: scale(0.97);
}

.quiz-qcm-option.quiz-qcm-choisi {
  background: var(--marque);
  border-color: var(--marque);
  color: var(--sur-marque);
}

.quiz-qcm-option:disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
}

.quiz-qcm-option.quiz-qcm-juste {
  background: var(--succes);
  border-color: var(--succes);
  color: var(--sur-marque);
  opacity: 1;
}

.quiz-qcm-option.quiz-qcm-faux {
  background: var(--erreur);
  border-color: var(--erreur);
  color: var(--sur-marque);
  opacity: 1;
}

.quiz-qcm-option.quiz-qcm-attendu {
  border: 0.1875rem dashed var(--succes);
  color: var(--succes);
  font-weight: 800;
  opacity: 1;
}

/* ------------------------------------------------------------ anglais d'ete
   Rendus par matieres/anglais.js ; styles ici car noyau.css est le fichier
   CSS du lot (matieres.css n'est pas touchee). */

/* consigne au-dessus de l'enonce (phrase a trou, QCM de phonologie) */
.mat-anglais-consigne {
  color: var(--encre-douce);
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0 0 0.375rem;
}

/* phrase a trou : la phrase en gros, le trou bien visible */
.mat-anglais-phrase {
  font-size: 1.5rem;
  line-height: 1.7;
  font-weight: 600;
  margin: 0.5rem 0;
  overflow-wrap: anywhere;
}

.mat-anglais-trou {
  display: inline-block;
  min-width: 4.5rem;
  border-bottom: 0.1875rem dashed var(--marque);
  margin: 0 0.25rem;
}

.mat-anglais-infinitif {
  color: var(--encre-douce);
  font-style: italic;
  font-weight: 600;
  white-space: nowrap;
}

/* phonetique bien lisible (sons de l'anglais) */
.mat-anglais-phonetique {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.03125rem;
  color: var(--succes);
  margin: 0.375rem 0;
}

/* selecteur de session : modules en cases a cocher */
.mat-anglais-modules {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.mat-anglais-module {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  padding: 0.375rem 0.75rem;
  border: 0.0625rem solid var(--bordure);
  border-radius: 0.75rem;
  background: var(--carte);
  font-weight: 600;
  cursor: pointer;
}

.mat-anglais-module-case {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--marque);
  cursor: pointer;
  flex: none;
}

/* la plage de verbes, grisee quand le module verbes est decoche */
.mat-anglais-plage-bloc {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mat-anglais-plage-inactive {
  opacity: 0.45;
  pointer-events: none;
}

/* ============================================================ lot 4 : programmes de rentree */

/* vocabulaire anglais : le sens demande, en clair sous le mot en tres gros */
.mat-anglais-sens {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--encre-douce);
  margin: 0.25rem 0 0.5rem;
}

/* division posee (maths CM1) : les champs Quotient et Reste cote a cote
   (classe posee par MatiereMaths.decorerChamps sur le conteneur des champs,
   affichage division_posee) */
.mat-champs-division {
  display: grid;
  grid-template-columns: repeat(2, minmax(5.5rem, 1fr));
  gap: 0.75rem;
  align-items: end;
}

/* ============================================================ couche pedagogique */

/* ------------------------------------------------------------ ecran lecon
   Le corps_html est seme cote serveur (contenu de confiance, balises sures).
   Typographie pensee pour lire sur mobile : interligne genereux, tableaux
   qui defilent dans leur cadre, encadres .piege et .astuce rediges dans les
   lecons (ex. <p class="piege">...</p>). */
.lecon-contenu {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lecon-article {
  background: var(--carte);
  border: 0.0625rem solid var(--bordure);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 1.25rem;
}

.lecon-titre-section {
  font-size: 1.25rem;
  margin: 0 0 0.625rem;
}

.lecon-corps {
  font-size: 1.0625rem;
  line-height: 1.65;
}

.lecon-corps h3 {
  font-size: 1.125rem;
  margin: 1.25rem 0 0.5rem;
}

.lecon-corps h3:first-child {
  margin-top: 0;
}

.lecon-corps p {
  margin: 0.625rem 0;
}

.lecon-corps p:first-child {
  margin-top: 0;
}

.lecon-corps p:last-child {
  margin-bottom: 0;
}

.lecon-corps ul,
.lecon-corps ol {
  margin: 0.625rem 0;
  padding-left: 1.375rem;
}

.lecon-corps li {
  margin: 0.3125rem 0;
}

.lecon-corps code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9375em;
  background: var(--fond);
  border: 0.0625rem solid var(--bordure);
  border-radius: 0.375rem;
  padding: 0.0625rem 0.3125rem;
}

/* tableaux : jamais plus larges que l'ecran, ils defilent dans leur cadre */
.lecon-corps table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 0.75rem 0;
}

.lecon-corps th,
.lecon-corps td {
  border: 0.0625rem solid var(--bordure);
  padding: 0.4375rem 0.625rem;
  text-align: left;
}

.lecon-corps thead th {
  background: var(--fond);
}

/* encadres pieges et astuces, rediges dans le corps des lecons */
.lecon-corps .piege,
.lecon-corps .astuce {
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
}

.lecon-corps .piege {
  border: 0.125rem solid var(--erreur);
  background: rgba(208, 69, 79, 0.08);
  background: color-mix(in srgb, var(--erreur) 10%, transparent);
}

.lecon-corps .astuce {
  border: 0.125rem solid var(--succes);
  background: rgba(46, 158, 107, 0.08);
  background: color-mix(in srgb, var(--succes) 10%, transparent);
}

/* ------------------------------------------------------------ bandeau premiere fois
   "Nouveau ! Lis d'abord la lecon" : doux, jamais bloquant (Plus tard). */
.bandeau-lecon {
  border: 0.125rem dashed var(--marque);
  background: var(--carte);
  border-radius: var(--rayon);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ------------------------------------------------------------ selecteur anglais :
   actions pedagogiques par module (La lecon / Apprendre) */
.mat-anglais-module-bloc {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.mat-anglais-module-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-left: 0.75rem;
}

/* selecteur maths : zone d'actions pedagogiques d'un module ou d'un theme
   (La leçon / Apprendre), meme esprit que les actions du selecteur anglais */
.mat-maths-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.125rem 0 0.375rem 0.75rem;
}

.bouton-pedago {
  min-height: 2.5rem;
  padding: 0.375rem 0.875rem;
  border-radius: 0.75rem;
  border: 0.0625rem solid var(--bordure);
  background: var(--fond);
  color: var(--encre);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.bouton-pedago:active {
  transform: scale(0.96);
}

/* ------------------------------------------------------------ rappel de regle
   Sous la correction, seulement quand la reponse est fausse : discret. */
.quiz-rappel {
  margin-top: 0.625rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.75rem;
  border: 0.0625rem solid var(--bordure);
  background: var(--fond);
  color: var(--encre);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.quiz-rappel-texte {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
}

.quiz-rappel-lien {
  align-self: flex-start;
  min-height: 2.25rem;
  padding: 0.25rem 0;
}

/* ------------------------------------------------------------ mode Apprendre :
   grande carte tactile avec retournement sobre. Le retournement est une
   transition CSS : la garde globale prefers-reduced-motion (en tete de
   fichier) la coupe deja ; le bloc dedie ci-dessous l'explicite. */
.carte-apprendre {
  perspective: 60rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.carte-apprendre-interieur {
  display: grid;
  transform-style: preserve-3d;
  transition: transform 0.45s ease;
  min-height: 14rem;
}

.carte-apprendre-retournee .carte-apprendre-interieur {
  transform: rotateY(180deg);
}

.carte-apprendre-face {
  grid-area: 1 / 1;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  text-align: center;
  padding: 1.5rem 1.25rem;
  border-radius: var(--rayon);
  border: 0.0625rem solid var(--bordure);
  background: var(--carte);
  box-shadow: var(--ombre);
  overflow-wrap: anywhere;
}

.carte-apprendre-verso {
  transform: rotateY(180deg);
  border-color: var(--marque);
}

.apprendre-recto-texte {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
}

.apprendre-verso-texte {
  font-size: 1.625rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--marque);
}

.apprendre-complement {
  font-size: 1.125rem;
  color: var(--encre-douce);
}

/* cartes de tables (Apprendre maths, module calcul_mental) : les chiffres
   en tres gros, lisibles a bout de bras ("7 × 8" au recto, "56" au verso). */
.carte-apprendre-chiffres .apprendre-recto-texte {
  font-size: 3.5rem;
  letter-spacing: 0.04em;
}

.carte-apprendre-chiffres .apprendre-verso-texte {
  font-size: 4rem;
}

.apprendre-boutons {
  display: flex;
  gap: 0.75rem;
}

.apprendre-boutons .bouton {
  flex: 1;
  min-height: 3.25rem;
  font-size: 1.0625rem;
  font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
  .carte-apprendre-interieur {
    transition: none;
  }
}

/* ------------------------------------------------------------ lot lecture :
   bibliotheque, chapitres, liseuse (static/lecture.js). Tout en tokens :
   sombre et clair suivent la preference systeme comme le reste de l'app. */

.liste-livres {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.carte-livre {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  text-align: left;
  padding: 1rem;
  border-radius: var(--rayon);
  border: 0.0625rem solid var(--bordure);
  background: var(--carte);
  box-shadow: var(--ombre);
  cursor: pointer;
}

.carte-livre-emoji {
  font-size: 2.25rem;
}

.carte-livre-infos {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.carte-livre-titre {
  font-size: 1.0625rem;
}

.carte-livre-auteur {
  color: var(--encre-douce);
  font-size: 0.875rem;
}

.barre-livre {
  display: block;
  height: 0.375rem;
  border-radius: 999px;
  background: var(--bordure);
  overflow: hidden;
  margin-top: 0.25rem;
}

.barre-livre-remplie {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--succes);
}

.carte-livre-compte {
  color: var(--encre-douce);
  font-size: 0.8125rem;
}

/* liste des chapitres : numero + titre a gauche, badge d'etat a droite */
.liste-chapitres {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ligne-chapitre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-align: left;
  padding: 0.75rem 0.875rem;
  border-radius: 1rem;
  border: 0.0625rem solid var(--bordure);
  background: var(--carte);
  box-shadow: var(--ombre);
  cursor: pointer;
}

.ligne-chapitre-infos {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.ligne-chapitre-titre {
  font-weight: 600;
}

.ligne-chapitre-mots {
  color: var(--encre-douce);
  font-size: 0.75rem;
}

.badge-chapitre {
  border-radius: 999px;
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.badge-a-lire {
  color: var(--encre-douce);
  border: 0.0625rem solid var(--bordure);
}

.badge-en-cours {
  background: var(--marque);
  color: var(--sur-marque);
}

.badge-lu {
  background: var(--succes);
  color: #ffffff;
}

/* liseuse : outils (retour, A- / A+) et progression restent sous le pouce,
   le texte defile en dessous avec une typographie de lecture posee. */
.entete-liseuse {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--fond);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.25rem 0 0.5rem;
}

.liseuse-outils {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.liseuse-taille {
  display: flex;
  gap: 0.5rem;
}

.bouton-taille {
  min-height: 2.25rem;
  min-width: 2.75rem;
  padding: 0.25rem 0.625rem;
  border-radius: 0.75rem;
  font-weight: 600;
}

.bouton-taille:disabled {
  opacity: 0.4;
  cursor: default;
}

.liseuse-titre {
  font-size: 1.25rem;
  text-align: center;
  margin: 0.25rem 0 0;
}

.liseuse-texte {
  font-family: "Iowan Old Style", Charter, Georgia, "Times New Roman", serif;
  font-size: 1.1875rem;   /* pilote par A- / A+ (lecture.js) */
  line-height: 1.7;
  overflow-wrap: break-word;
}

.liseuse-texte p {
  margin: 0 0 1rem;
}

.liseuse-texte img {
  max-width: 100%;
  height: auto;
}

.liseuse-fin {
  margin-top: 2rem;
  padding-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.liseuse-suite {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* enonce du questionnaire de lecture, dans le moteur de quiz existant */
.mat-lecture-enonce {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.5;
}
