/* ==========================================================================
   ÉVIDENCE — Esprit Singulier
   Écran 1 : Accueil (étape 4 du cahier des charges)
   Palette officielle : bleu profond #17324D, turquoise #22B8C7,
   corail #F26C63, jaune doré #F2B84B, ivoire #FAF8F4
   Polices de la marque : Fraunces (titres) + Inter (texte)
   ========================================================================== */

:root {
  --bleu-profond: #17324D;
  --turquoise: #22B8C7;
  --corail: #F26C63;
  --jaune-dore: #F2B84B;
  --ivoire: #FAF8F4;
  --texte: #17324D;
  --texte-doux: rgba(23, 50, 77, 0.85);
  --noir-doux: #3B4653;
  --fond-barre: #F0EBE2;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--ivoire);
  color: var(--texte);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ---------- En-tête : monogramme ES original ---------- */

.entete {
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 20px 16px 4px;
}

.entete-monogramme {
  height: 64px;
  width: auto;
}

/* ---------- Accueil ---------- */

.accueil {
  width: 100%;
  max-width: 520px;
  padding: 0 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.accueil-visuel {
  width: 100%;
  margin-top: 28px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(23, 50, 77, 0.12);
}

.accueil-visuel img {
  display: block;
  width: 100%;
  height: auto;
}

.accueil-texte {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.accueil-parcours {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--turquoise);
}

.accueil-intro {
  font-size: 24px;
  line-height: 1.6;
  color: var(--texte-doux);
}

.accueil-signature-phrase {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--turquoise);
}

/* ---------- Actions ---------- */

.accueil-actions {
  margin-top: 48px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.btn {
  display: block;
  width: 100%;
  padding: 18px 12px;
  border-radius: 999px;
  font-size: 22px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  white-space: normal;
  line-height: 1.3;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-principal {
  background: var(--corail);
  color: #fff;
  box-shadow: 0 8px 24px rgba(242, 108, 99, 0.35);
}

.btn-principal:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(242, 108, 99, 0.45);
}

.btn-secondaire {
  background: transparent;
  color: var(--bleu-profond);
  border: 2px solid rgba(23, 50, 77, 0.25);
}

.btn-secondaire:hover {
  border-color: var(--turquoise);
  color: var(--turquoise);
}


/* ==========================================================================
   Étape 6 : navigation + écrans internes
   ========================================================================== */

/* Barre du bas : la page NE défile plus au niveau du document. Le corps
   est un conteneur plein écran (100% de la hauteur visible, stable sur
   iOS Safari) avec une zone centrale qui défile en interne et la barre en
   pied de ce conteneur. Conséquence : Safari ne replie plus jamais sa
   propre barre d'outils au défilement, donc la barre ES ne subit plus
   aucune secousse quand on tape un pictogramme (position:fixed suivait le
   viewport visuel et sautait avec les barres Safari). */
html, body {
  height: 100%;
}

body.avec-nav {
  padding-bottom: 0;
  min-height: 0;
  overflow: hidden;
}

.defile {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* ---------- Barre haute : logo + menu ---------- */

.barre-haut {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--fond-barre);
}

.logo-haut img {
  height: 46px;
  width: auto;
  display: block;
}

.menu-haut {
  position: relative;
}

.menu-haut summary {
  list-style: none;
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
  color: var(--bleu-profond);
  border: 2px solid rgba(23, 50, 77, 0.25);
  border-radius: 999px;
  padding: 10px 22px;
  background: #fff;
}

.menu-haut summary::-webkit-details-marker { display: none; }

.menu-haut summary::after { content: ' \25BE'; }

.menu-haut[open] summary {
  border-color: var(--bleu-profond);
}

.menu-haut-liste {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: #fff;
  border: 2px solid rgba(23, 50, 77, 0.16);
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(23, 50, 77, 0.16);
  padding: 10px;
  min-width: 240px;
  z-index: 50;
}

.menu-haut-liste a {
  display: block;
  font-size: 18px;
  font-weight: 600;
  color: var(--bleu-profond);
  text-decoration: none;
  padding: 12px 16px;
  border-radius: 10px;
}

.menu-haut-liste a:hover { background: var(--ivoire); }

/* ---------- En-tête des écrans internes ---------- */

.entete-ecran {
  width: 100%;
  max-width: 720px;
  padding: 36px 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
}

.lien-retour {
  position: absolute;
  left: 20px;
  top: 20px;
  font-size: 18px;
  font-weight: 600;
  color: var(--bleu-profond);
  text-decoration: none;
}

.lien-retour:hover {
  color: var(--turquoise);
}

.entete-monogramme-petit {
  height: 48px;
  width: auto;
  margin-top: 12px;
}

.titre-ecran {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--noir-doux);
  margin-top: 22px;
}

.philosophie {
  font-size: 20px;
  font-weight: 500;
  color: var(--turquoise);
  margin-top: 24px;
}

.legende-niveaux {
  font-size: 18px;
  line-height: 1.55;
  color: var(--texte-doux);
  margin-top: 64px;
}

/* ---------- Puces secondaires ---------- */

.puces-secondaires {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 44px 0;
}

.puce-lien {
  font-size: 17px;
  font-weight: 600;
  color: var(--bleu-profond);
  text-decoration: none;
  border: 2px solid rgba(23, 50, 77, 0.25);
  border-radius: 999px;
  padding: 10px 20px;
}

.puce-lien:hover {
  border-color: var(--turquoise);
  color: var(--turquoise);
}

/* ---------- Le chemin des 8 thèmes ---------- */

.cheminement {
  width: 100%;
  max-width: 720px;
  padding: 0 20px 20px;
}

.chemin {
  list-style: none;
  margin-top: 24px;
  position: relative;
}

.chemin::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 20px;
  bottom: 20px;
  width: 3px;
  border-radius: 3px;
  background: repeating-linear-gradient(
    to bottom,
    rgba(34, 184, 199, 0.55) 0 10px,
    transparent 10px 20px
  );
}

.etape {
  position: relative;
  padding-left: 68px;
  margin-bottom: 46px;
}

.medaillon {
  position: absolute;
  left: 0;
  top: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 26px;
  font-weight: 600;
  color: #fff;
  background: var(--bleu-profond);
  box-shadow: 0 6px 16px rgba(23, 50, 77, 0.25);
  z-index: 1;
}

.teinte-turquoise .medaillon { background: var(--turquoise); }
.teinte-corail .medaillon { background: var(--corail); }
.teinte-dore .medaillon { background: var(--jaune-dore); }
.teinte-bleu .medaillon { background: var(--bleu-profond); }

.carte-theme {
  background: #fff;
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 28px rgba(23, 50, 77, 0.10);
  border-top: 5px solid var(--bleu-profond);
}

.teinte-turquoise .carte-theme { border-top-color: var(--turquoise); }
.teinte-corail .carte-theme { border-top-color: var(--corail); }
.teinte-dore .carte-theme { border-top-color: var(--jaune-dore); }
.teinte-bleu .carte-theme { border-top-color: var(--bleu-profond); }

.theme-titre {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 25px;
  font-weight: 600;
  color: var(--noir-doux);
  line-height: 1.3;
}

.theme-objectif {
  font-size: 19px;
  line-height: 1.55;
  color: var(--texte-doux);
  margin-top: 10px;
}

.theme-exercices {
  list-style: none;
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-exercices li {
  font-size: 18px;
  line-height: 1.45;
  color: var(--texte);
  padding-left: 22px;
  position: relative;
}

.theme-exercices li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--turquoise);
}

.theme-decouverte {
  font-size: 17px;
  font-weight: 600;
  color: var(--turquoise);
  margin-top: 22px;
}

.btn-theme {
  margin-top: 24px;
  width: auto;
  display: inline-block;
  padding: 14px 36px;
}

.badge-verrou {
  display: inline-block;
  margin-top: 18px;
  font-size: 16px;
  font-weight: 600;
  color: var(--texte-doux);
  border: 2px dashed rgba(23, 50, 77, 0.3);
  border-radius: 999px;
  padding: 10px 22px;
}

.badge-termine {
  display: inline-block;
  margin-top: 18px;
  font-size: 16px;
  font-weight: 600;
  color: var(--bleu-profond);
  border: 2px solid var(--bleu-profond);
  border-radius: 999px;
  padding: 10px 22px;
}

.teinte-turquoise .badge-termine { border-color: var(--turquoise); }
.teinte-corail .badge-termine { border-color: var(--corail); }
.teinte-dore .badge-termine { border-color: var(--jaune-dore); }
.teinte-bleu .badge-termine { border-color: var(--bleu-profond); }

.etape.verrouille .carte-theme {
  opacity: 0.62;
}

/* ---------- Page repère « bientôt » ---------- */

.bientot {
  width: 100%;
  max-width: 720px;
  padding: 30px 24px;
  text-align: center;
}

.bientot-texte {
  font-size: 20px;
  line-height: 1.6;
  color: var(--texte-doux);
}

/* ---------- Barre de navigation principale ---------- */

.barre-nav {
  flex: 0 0 auto;
  width: 100%;
  background: var(--fond-barre);
  border-top: 1px solid rgba(23, 50, 77, 0.12);
  display: flex;
  justify-content: stretch;
  padding: 8px 4px calc(10px + env(safe-area-inset-bottom, 0px));
}

.nav-item {
  /* 5 cases de largeur strictement égale : la position des icônes ne dépend
     jamais de la largeur du texte (police en cours de chargement ou non). */
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--texte-doux);
  font-size: 14px;
  font-weight: 600;
  padding: 4px 8px;
  -webkit-tap-highlight-color: transparent;
}

.nav-item svg {
  width: 26px;
  height: 26px;
}

.nav-item span {
  /* Hauteur de ligne figée et jamais de retour à la ligne : la hauteur de
     la barre ne dépend plus de la police chargée, l'icône ne bouge plus. */
  line-height: 17px;
  white-space: nowrap;
}

.nav-item.actif {
  color: var(--turquoise);
}

.nav-item:hover {
  color: var(--bleu-profond);
}

.nav-item.actif:hover {
  color: var(--turquoise);
}

/* Pendant la saisie (clavier ouvert) : la barre du bas disparaît
   complètement au lieu de remonter au-dessus du clavier iPhone. */
body.saisie-en-cours .barre-nav {
  display: none;
}

/* ---------- Ordinateur ---------- */

@media (min-width: 768px) {
  .entete-monogramme {
    height: 72px;
  }

  .accueil {
    max-width: 960px;
    padding-top: 0;
  }

  .accueil-parcours {
    font-size: 22px;
  }

  .accueil-intro {
    font-size: 32px;
    line-height: 1.5;
  }

  .accueil-signature-phrase {
    font-size: 38px;
  }

  .accueil-actions {
    flex-direction: row;
    justify-content: center;
  }

  .accueil-actions .btn {
    width: auto;
    flex-shrink: 0;
    padding: 20px 48px;
    font-size: 26px;
  }

  /* Écrans internes : même montée en gamme que l'accueil */
  .entete-ecran,
  .cheminement,
  .bientot {
    max-width: 960px;
  }

  .titre-ecran {
    font-size: 42px;
  }

  .philosophie {
    font-size: 26px;
  }

  .legende-niveaux {
    font-size: 22px;
  }

  .puce-lien {
    font-size: 20px;
    padding: 12px 26px;
  }

  .lien-retour {
    font-size: 21px;
  }

  .logo-haut img { height: 56px; }

  .menu-haut summary { font-size: 20px; padding: 12px 26px; }

  .theme-titre {
    font-size: 32px;
  }

  .theme-objectif {
    font-size: 24px;
  }

  .theme-exercices li {
    font-size: 22px;
  }

  .theme-exercices li::before {
    top: 12px;
  }

  .theme-decouverte {
    font-size: 21px;
  }

  .btn-theme {
    font-size: 24px;
    padding: 16px 44px;
  }

  .badge-verrou {
    font-size: 20px;
  }

  .medaillon {
    width: 64px;
    height: 64px;
    font-size: 30px;
  }

  .chemin::before {
    left: 31px;
  }

  .etape {
    padding-left: 84px;
  }

  .bientot-texte {
    font-size: 26px;
  }

  .barre-nav {
    width: 720px;
    border: 1px solid rgba(23, 50, 77, 0.12);
    border-bottom: none;
    border-radius: 24px 24px 0 0;
    padding-bottom: 10px;
  }

  .nav-item {
    font-size: 16px;
  }

  .nav-item svg {
    width: 30px;
    height: 30px;
  }
}

/* ---------- Grand écran : chemin large en zigzag (>= 1024 px) ---------- */

@media (min-width: 1024px) {
  .entete-ecran,
  .cheminement,
  .bientot {
    max-width: 1180px;
  }

  .chemin::before {
    left: 50%;
    transform: translateX(-50%);
  }

  .etape {
    width: 46%;
    padding-left: 0;
    margin-bottom: 40px;
  }

  .etape:nth-child(odd) {
    margin-right: 54%;
  }

  .etape:nth-child(even) {
    margin-left: 54%;
    margin-top: -150px;
  }

  .etape:nth-child(odd) .medaillon {
    left: auto;
    right: -82px;
  }

  .etape:nth-child(even) .medaillon {
    left: -82px;
  }
}

/* ---------- Grand écran : accueil en deux colonnes (>= 1024 px) ---------- */

@media (min-width: 1024px) {
  .accueil {
    max-width: 1180px;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    grid-template-areas:
      "visuel texte"
      "actions actions";
    align-items: center;
    align-content: center;
    gap: 20px 64px;
    text-align: center;
  }

  .accueil-visuel {
    grid-area: visuel;
    margin-top: 0;
  }

  .accueil-texte {
    grid-area: texte;
    margin-top: 0;
    align-self: end;
  }

  .accueil-actions {
    grid-area: actions;
    margin-top: 8px;
    align-self: start;
    justify-content: center;
  }

  .accueil-actions .btn {
    padding: 20px 36px;
  }
}

/* ==========================================================================
   Étape : moteur d'exercices — écrans 5 (thème), 6 (exercice), 7 (découverte)
   Mobile d'abord, textes gros comme validé. Règles large écran en bas.
   ========================================================================== */

.theme-numero {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--turquoise);
  margin: 10px 0 4px;
}

.theme-objectif-page {
  font-size: 22px;
  line-height: 1.5;
  color: var(--texte-doux);
  max-width: 640px;
  margin: 24px auto 0;
  text-align: center;
}

.contenu-theme,
.contenu-exercice {
  width: 100%;
  max-width: 760px;
  padding: 8px 20px 120px;
}

.sous-titre-section {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--turquoise);
  margin: 78px 0 64px;
}

.teinte-corail .sous-titre-section { color: var(--turquoise); }

/* ---------- Progression du thème ---------- */

.bloc-progression {
  background: #fff;
  border-radius: 20px;
  padding: 28px 30px;
  margin-top: 44px;
  border: 2px solid rgba(23, 50, 77, 0.14);
  box-shadow: 0 12px 30px rgba(23, 50, 77, 0.10);
}

.progression-texte {
  font-size: 21px;
  line-height: 1.45;
}

.progression-pistes {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 0;
}

.progression-pastille {
  width: 48px;
  height: 14px;
  border-radius: 999px;
  background: rgba(23, 50, 77, 0.24);
}

.teinte-turquoise .progression-pastille.faite { background: var(--turquoise); }
.teinte-corail .progression-pastille.faite { background: var(--corail); }
.teinte-dore .progression-pastille.faite { background: var(--jaune-dore); }
.teinte-bleu .progression-pastille.faite { background: var(--bleu-profond); }

/* ---------- Les trois temps ---------- */

.niveaux-explication {
  list-style: none;
  display: grid;
  gap: 32px;
}

.niveaux-explication li {
  background: #fff;
  border-radius: 18px;
  padding: 24px 26px;
  border: 2px solid rgba(23, 50, 77, 0.14);
  box-shadow: 0 10px 24px rgba(23, 50, 77, 0.08);
}

.niveaux-explication h3 { color: var(--turquoise); }

.niveaux-explication h3 {
  font-family: 'Fraunces', serif;
  font-size: 23px;
  font-weight: 600;
  margin-bottom: 6px;
}

.niveaux-explication p {
  font-size: 20px;
  line-height: 1.45;
  color: var(--texte-doux);
}

/* ---------- Cartes exercices ---------- */

.liste-exercices {
  list-style: none;
  display: grid;
  gap: 40px;
}

.carte-exercice {
  background: #fff;
  border-radius: 20px;
  padding: 28px 30px;
  border: 2px solid rgba(23, 50, 77, 0.14);
  box-shadow: 0 12px 30px rgba(23, 50, 77, 0.10);
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}

.exercice-entete {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.exercice-numero {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  background: var(--turquoise);
}

.teinte-corail .exercice-numero { background: var(--corail); }
.teinte-dore .exercice-numero { background: var(--jaune-dore); color: var(--bleu-profond); }
.teinte-bleu .exercice-numero { background: var(--bleu-profond); }

.exercice-titre {
  font-family: 'Fraunces', serif;
  font-size: 25px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--noir-doux);
}

.exercice-etat {
  font-size: 18px;
  font-weight: 600;
  color: var(--texte-doux);
}

.carte-exercice.terminee .exercice-etat { color: var(--turquoise); }

/* ---------- Découverte ---------- */

.carte-decouverte {
  margin-top: 40px;
  border-radius: 20px;
  padding: 32px;
  background: linear-gradient(135deg, rgba(242, 184, 75, 0.16), rgba(34, 184, 199, 0.12));
  border: 2px solid rgba(242, 184, 75, 0.55);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

.carte-decouverte.decouverte-verrouillee {
  opacity: 0.75;
  border-style: dashed;
}

.decouverte-etiquette {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--turquoise);
}

.decouverte-titre {
  font-family: 'Fraunces', serif;
  font-size: 27px;
  font-weight: 600;
  color: var(--noir-doux);
}

.decouverte-texte {
  font-size: 21px;
  line-height: 1.5;
  color: var(--texte-doux);
}

/* ---------- Écran exercice ---------- */

.titre-exercice {
  font-size: 32px;
  line-height: 1.2;
}

.note-sauvegarde {
  font-size: 17px;
  color: var(--texte-doux);
  margin-top: 24px;
}

.progression-exercice {
  margin: 44px 0 70px;
}



.barre-progression {
  display: flex;
  gap: 8px;
  height: 14px;
}

.barre-progression .segment {
  flex: 1 1 0;
  border-radius: 999px;
  background: rgba(23, 50, 77, 0.14);
  transition: background-color 0.3s ease;
}

.barre-progression .segment.seg1.rempli { background: #17324D; }
.barre-progression .segment.seg2.rempli { background: #22B8C7; }
.barre-progression .segment.seg3.rempli { background: #F26C63; }

.niveau-etiquette {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--turquoise);
  margin-bottom: 14px;
}

.vue-exercice .niveau-etiquette,
.vue-exercice .niveau-nom { color: var(--turquoise); }

.niveau-nom {
  font-family: 'Fraunces', serif;
  font-size: 30px;
  font-weight: 600;
  margin-bottom: 64px;
}

.niveau-texte p {
  font-size: 22px;
  line-height: 1.55;
  margin-bottom: 30px;
}

.niveau-questions {
  display: grid;
  gap: 40px;
  margin-top: 46px;
}

.question-bloc {
  padding: 0;
}

.question-texte {
  display: block;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--noir-doux);
  margin-bottom: 16px;
}

.question-reponse:disabled {
  background: rgba(23, 50, 77, 0.05);
  color: var(--texte);
  -webkit-text-fill-color: var(--texte);
  opacity: 1;
  cursor: default;
}

.question-reponse {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 20px;
  line-height: 1.5;
  color: var(--texte);
  background: var(--ivoire);
  border: 2px solid rgba(23, 50, 77, 0.34);
  border-radius: 14px;
  padding: 16px 18px;
  resize: vertical;
  min-height: 92px;
}

.question-reponse:focus {
  outline: none;
  border-color: var(--turquoise);
}

.teinte-corail .question-reponse:focus { border-color: var(--corail); }
.teinte-dore .question-reponse:focus { border-color: var(--jaune-dore); }
.teinte-bleu .question-reponse:focus { border-color: var(--bleu-profond); }

/* Boutons principaux aux couleurs du thème sur les pages des thèmes 3 à 8
   (thèmes 1 et 2 conservent le rendu validé). Bouton or : texte bleu
   profond pour la lisibilité. */
body.theme-3 .btn-principal, body.theme-7 .btn-principal {
  background: var(--jaune-dore);
  color: var(--bleu-profond);
  box-shadow: 0 8px 24px rgba(242, 184, 75, 0.4);
}
body.theme-3 .btn-principal:hover, body.theme-7 .btn-principal:hover {
  box-shadow: 0 10px 28px rgba(242, 184, 75, 0.5);
}
body.theme-4 .btn-principal, body.theme-8 .btn-principal {
  background: var(--bleu-profond);
  color: #fff;
  box-shadow: 0 8px 24px rgba(23, 50, 77, 0.35);
}
body.theme-4 .btn-principal:hover, body.theme-8 .btn-principal:hover {
  box-shadow: 0 10px 28px rgba(23, 50, 77, 0.45);
}
body.theme-5 .btn-principal {
  background: var(--turquoise);
  color: #fff;
  box-shadow: 0 8px 24px rgba(34, 184, 199, 0.35);
}
body.theme-5 .btn-principal:hover {
  box-shadow: 0 10px 28px rgba(34, 184, 199, 0.45);
}

.bilan-titre {
  font-family: 'Fraunces', serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--turquoise);
  margin-top: 74px;
  margin-bottom: 64px;
}

#vue-decouverte {
  margin-top: 64px;
}

.exercice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin-top: 62px;
}

.temoin-sauvegarde {
  font-size: 17px;
  font-weight: 600;
  color: var(--turquoise);
  opacity: 0;
  transition: opacity 0.3s;
  width: 100%;
}

.temoin-sauvegarde.visible { opacity: 1; }

.fin-exercice {
  background: #fff;
  border-radius: 22px;
  padding: 38px 34px;
  border: 2px solid rgba(23, 50, 77, 0.14);
  box-shadow: 0 14px 34px rgba(23, 50, 77, 0.10);
}

.fin-bravo { color: var(--turquoise); }

.fin-bravo {
  font-family: 'Fraunces', serif;
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 12px;
}

.fin-texte {
  font-size: 21px;
  line-height: 1.5;
  color: var(--texte-doux);
}

/* ==========================================================================
   Grand écran (à partir de 1024 px) : la largeur est utilisée,
   jamais une colonne étroite type téléphone.
   ========================================================================== */

@media (min-width: 1024px) {

  .contenu-theme,
  .contenu-exercice {
    max-width: 1180px;
    padding-left: 40px;
    padding-right: 40px;
  }

  .theme-objectif-page {
    font-size: 26px;
    max-width: 860px;
  }

  .sous-titre-section { font-size: 32px; }

  .niveaux-explication {
    grid-template-columns: repeat(3, 1fr);
    gap: 22px;
  }

  .niveaux-explication h3 { font-size: 26px; }
  .niveaux-explication p { font-size: 22px; }

  .liste-exercices {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }

  .exercice-titre { font-size: 28px; }
  .exercice-etat { font-size: 20px; }

  .carte-decouverte {
    padding: 34px 40px;
  }

  .decouverte-titre { font-size: 34px; }
  .decouverte-texte { font-size: 24px; max-width: 900px; }

  /* Exercice : question à gauche, réponse à droite */
  .titre-exercice { font-size: 42px; }
  .note-sauvegarde { font-size: 19px; }

  .barre-progression { height: 18px; }
  .progression-exercice { padding: 0; }

  .niveau-etiquette { font-size: 20px; }
  .niveau-nom { font-size: 40px; }
  .niveau-texte p { font-size: 26px; max-width: 980px; }

  .question-bloc {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
    padding: 0;
  }

  .question-texte { font-size: 24px; margin-bottom: 0; }
  .question-reponse { font-size: 22px; min-height: 120px; }

  .bilan-titre { font-size: 32px; }

  .fin-bravo { font-size: 40px; }
  .fin-texte { font-size: 24px; }
}

/* Écrans thème / exercice / découverte : dégager le lien retour absolu */
.entete-ecran .lien-retour + * {
  margin-top: 64px;
}
