/* =====================================================================
   LAMPION — interface enfant
   Mobile d'abord. Un seul frontend, deux ambiances (bleu nuit, rose prune)
   pilotées par des variables. Les illustrations des contes, elles, ne
   changent jamais de couleur : seule l'interface s'habille.
   ===================================================================== */

:root,
[data-theme="bleu"] {
  --fond:        #131A3E;
  --fond-2:      #1D2A60;
  --fond-3:      #0D1230;
  --voile:       rgba(255,255,255,.08);
  --voile-fort:  rgba(255,255,255,.14);
  --carte:       #223066;
  --carte-2:     #2B3B7A;
  --bord:        rgba(255,246,226,.18);
  --accent:      #5B4BD6;
  --accent-2:    #8A6BF0;
  --halo-1:      rgba(107,86,232,.55);
  --halo-2:      rgba(255,194,60,.16);
  --texte:       #FFF6E2;
  --doux:        #B9AFD8;
  --ombre-teinte: rgba(9,13,38,.55);
}

[data-theme="rose"],
html[data-theme-amorce="rose"] body {
  --fond:        #4C1236;
  --fond-2:      #7B1F57;
  --fond-3:      #350B25;
  --voile:       rgba(255,255,255,.09);
  --voile-fort:  rgba(255,255,255,.16);
  --carte:       #6C1E4E;
  --carte-2:     #862A62;
  --bord:        rgba(255,246,226,.2);
  --accent:      #E8509A;
  --accent-2:    #FF7FBE;
  --halo-1:      rgba(232,80,154,.45);
  --halo-2:      rgba(255,216,122,.18);
  --texte:       #FFF2E8;
  --doux:        #E3B7CE;
  --ombre-teinte: rgba(42,7,28,.55);
}

:root {
  /* L'or est l'identité commune aux deux ambiances : lanterne, récompenses,
     appels à l'action. Il ne change jamais avec le thème. */
  --or:        #FFC23C;
  --or-clair:  #FFE08A;
  --or-voile:  rgba(255,194,60,.14);
  --or-bord:   rgba(255,194,60,.45);
  --or-lueur:  rgba(255,194,60,.30);
  --juste:     #4FD39A;
  --juste-fond: rgba(79,211,154,.18);
  --faux:      #F2795E;
  --faux-fond: rgba(242,121,94,.16);
  --encre:     #2E1F48;
  --sur-clair: #2B2536;
  --titre:    "Baloo Bhaijaan 2", "Trebuchet MS", system-ui, sans-serif;
  --corps:    "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-l:      26px;
  --r-m:      18px;
  --r-s:      13px;
  --barre:    calc(68px + env(safe-area-inset-bottom));
  --ombre:    0 10px 26px rgba(0,0,0,.28);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html {
  background: var(--fond-3);
  -webkit-text-size-adjust: 100%;      /* Safari n'agrandit pas le texte en paysage */
  overscroll-behavior-y: none;          /* pas de rebond blanc derrière la page */
}

body {
  margin: 0;
  font-family: var(--corps);
  font-size: 16px;
  line-height: 1.5;
  color: var(--texte);
  background: var(--fond);
  background-image:
    radial-gradient(ellipse 120% 70% at 15% -10%, var(--halo-1), transparent 60%),
    radial-gradient(ellipse 90% 50% at 95% 10%, var(--halo-2), transparent 55%),
    linear-gradient(180deg, var(--fond-2) 0%, var(--fond) 48%, var(--fond-3) 100%);
  background-attachment: fixed;
  background-size: cover;
  min-height: 100vh;                     /* repli pour les Safari anciens */
  min-height: 100dvh;                    /* suit la barre d'URL qui se replie */
  padding-bottom: calc(var(--barre) + 14px);
  overflow-x: hidden;
  transition: color .25s;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

/* Un seul anneau de focus pour toute l'application, visible sur les deux
   ambiances. Il n'apparaît qu'au clavier : l'enfant au doigt ne le voit pas. */
:focus-visible {
  outline: 3px solid var(--or);
  outline-offset: 3px;
  border-radius: var(--r-s);
}
:focus:not(:focus-visible) { outline: none; }

::selection { background: var(--or); color: var(--encre); }

button:disabled, .bouton[disabled], .reponse[disabled] {
  opacity: .45; cursor: default; box-shadow: none;
}
button:disabled:active, .bouton[disabled]:active { transform: none; }
h1, h2, h3 { font-family: var(--titre); font-weight: 800; margin: 0; line-height: 1.15; }

.ecran { padding: 0 15px; max-width: 780px; margin: 0 auto; }

/* ------------------------------------------------- en-tête */

.entete {
  position: sticky; top: 0; z-index: 25;
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 11px) 15px 11px;
  background: linear-gradient(180deg, var(--fond-2) 12%, transparent);
  backdrop-filter: blur(9px);
}

.marque { display: flex; align-items: center; gap: 9px; min-width: 0; }
.marque-lanterne { width: 34px; flex: none; color: var(--or); filter: drop-shadow(0 0 9px var(--or-lueur)); }
.marque-lanterne svg { width: 100%; height: auto; display: block; }
.marque strong { display: block; font-family: var(--titre); font-size: 1.22rem; letter-spacing: .01em; }
.marque em {
  display: block; font-style: normal; font-size: .64rem; color: var(--doux);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw;
}
@media (max-width: 400px) {
  .marque em { display: none; }
  .marque-lanterne { width: 29px; }
  .pilule { padding: 6px 10px; font-size: .74rem; }
}

.reglages { margin-inline-start: auto; display: flex; gap: 7px; align-items: center; }

.pilule {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px;
  background: var(--voile); border: 1.5px solid var(--bord);
  border-radius: 999px; padding: 7px 12px;
  font-size: .8rem; font-weight: 700; cursor: pointer;
  transition: background .2s, transform .12s;
}
.pilule:active { transform: scale(.96); }
.pilule select {
  appearance: none; background: none; border: none; font: inherit; color: inherit;
  font-weight: 700; padding-inline-end: 12px; cursor: pointer;
}
.pilule select option { color: var(--sur-clair); }
.pastille-theme { width: 15px; height: 15px; border-radius: 50%; background: var(--accent); flex: none;
  box-shadow: 0 0 0 2px var(--voile-fort); }

/* ------------------------------------------------- héros de l'accueil */

.heros {
  position: relative; overflow: hidden;
  border-radius: var(--r-l);
  border: 1.5px solid var(--bord);
  background:
    radial-gradient(ellipse 80% 90% at 85% 30%, var(--or-voile), transparent 60%),
    linear-gradient(150deg, var(--carte-2), var(--carte));
  padding: 18px 16px 14px;
  margin-bottom: 16px;
  box-shadow: var(--ombre);
}
.heros-texte { position: relative; z-index: 2; max-width: 60%; }
.heros h1 { font-size: 1.85rem; margin-bottom: 4px; }
.heros p { margin: 0; color: var(--doux); font-size: .93rem; }

.heros-scene {
  position: absolute; inset-inline-end: -6px; bottom: -4px;
  width: 46%; max-width: 190px; z-index: 1; pointer-events: none;
}
.heros-scene svg { width: 100%; height: auto; display: block; }

.bulle {
  position: relative; z-index: 3; backdrop-filter: blur(3px);
  display: inline-block; margin: 12px 0 0;
  background: var(--voile-fort); border: 1.5px solid var(--bord);
  border-radius: 14px; padding: 8px 12px;
  font-size: .8rem; line-height: 1.35; max-width: 66%;
}

/* ------------------------------------------------- accès rapides */

.raccourcis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin: 0 0 22px; }
.raccourcis a {
  display: grid; justify-items: center; gap: 6px;
  background: var(--voile); border: 1.5px solid var(--bord);
  border-radius: var(--r-m); padding: 12px 4px 10px;
  font-size: .69rem; font-weight: 800; text-align: center; line-height: 1.2;
  transition: transform .12s, background .2s;
}
.raccourcis a:active { transform: scale(.95); background: var(--voile-fort); }
.raccourcis span {
  width: 34px; height: 34px; display: grid; place-items: center;
  border-radius: 50%; background: var(--accent); color: var(--texte);
}
.raccourcis svg { width: 19px; height: 19px; }

/* ------------------------------------------------- rubriques */

.rubrique {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 1.22rem; margin: 0 0 12px;
}
.rubrique a { font-family: var(--corps); font-size: .8rem; font-weight: 700; color: var(--or); }

/* ------------------------------------------------- cartes de contes */

.grille-contes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.grille-contes--large { grid-template-columns: repeat(2, 1fr); }

.carte-conte {
  display: flex; flex-direction: column;
  background: var(--carte); border: 1.5px solid var(--bord);
  border-radius: var(--r-m); overflow: hidden;
  box-shadow: var(--ombre);
  transition: transform .14s;
}
.carte-conte:active { transform: scale(.975); }

.carte-image { position: relative; display: block; line-height: 0; aspect-ratio: 4 / 3; background: var(--fond-3); }
.carte-image svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.carte-image::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 34%;
  background: linear-gradient(transparent, var(--ombre-teinte));
}
.carte-drapeau {
  position: absolute; inset-block-start: 8px; inset-inline-start: 8px; z-index: 2;
  background: var(--ombre-teinte); border-radius: 999px;
  padding: 2px 8px; font-size: .82rem; line-height: 1.5;
  backdrop-filter: blur(4px);
}

.carte-corps { display: block; padding: 10px 11px 12px; }
.carte-corps strong { display: block; font-family: var(--titre); font-size: .97rem; line-height: 1.2; margin-bottom: 5px; }
.carte-meta { display: flex; align-items: center; gap: 5px; font-size: .74rem; color: var(--doux); }
.carte-meta svg { width: 13px; height: 13px; flex: none; opacity: .85; }
.point { opacity: .45; }

/* ------------------------------------------------- explorer */

.titre-page { font-size: 1.6rem; margin: 4px 0 3px; }
.sous-titre { margin: 0 0 16px; color: var(--doux); font-size: .87rem; }

.pastilles {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 15px 14px;
  margin: 0 -15px; scrollbar-width: none;
}
.pastilles::-webkit-scrollbar { display: none; }
.pastille {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  background: var(--voile); border: 1.5px solid var(--bord); border-radius: 999px;
  padding: 8px 14px; font-size: .82rem; font-weight: 700; white-space: nowrap;
}
.pastille.on { background: var(--or); border-color: var(--or); color: var(--encre); }
.drapeau { font-size: .95rem; }

.vedette { margin-bottom: 16px; }
.vedette .carte-image { aspect-ratio: 16 / 10; }
.vedette .carte-corps { padding: 13px 15px 15px; }
.vedette .carte-corps strong { font-size: 1.2rem; }

/* ------------------------------------------------- fiche du conte */

.retour {
  display: inline-flex; align-items: center; gap: 5px;
  font-weight: 700; font-size: .87rem; color: var(--doux); margin: 2px 0 10px;
}

.fiche-image {
  position: relative; border-radius: var(--r-l); overflow: hidden;
  border: 1.5px solid var(--bord); aspect-ratio: 16 / 11; box-shadow: var(--ombre);
}
.fiche-image svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.fiche-image::after {
  content: ""; position: absolute; inset: auto 0 -1px 0; height: 52%;
  background: linear-gradient(transparent, var(--fond) 92%);
}

.fiche-corps { position: relative; margin-top: -52px; padding: 0 3px; z-index: 2; }
.fiche-corps .titre-page { font-size: 1.55rem; margin-bottom: 8px; }

.fiche-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: .82rem; color: var(--doux); margin: 0 0 12px;
}
.fiche-meta svg { width: 14px; height: 14px; flex: none; opacity: .85; }
.fiche-narrateur { display: block; width: 100%; color: var(--or-clair); font-size: .8rem; }
.fiche-resume { margin: 0 0 18px; font-size: 1rem; }

.actions { display: grid; gap: 9px; }

.bouton {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--titre); font-weight: 800; font-size: 1.05rem;
  color: var(--encre); background: linear-gradient(160deg, var(--or-clair), var(--or));
  border: none; border-radius: 999px; padding: 15px 20px;
  cursor: pointer; box-shadow: 0 8px 20px var(--or-lueur);
  transition: transform .12s;
}
.bouton:active { transform: scale(.97); }
.bouton--calme {
  background: var(--voile); color: var(--texte);
  border: 1.5px solid var(--bord); box-shadow: none;
}
.note { margin: 16px 0 0; font-size: .84rem; color: var(--doux); text-align: center; }

/* ------------------------------------------------- lecture immersive */

body[data-page="lecture"] { padding-bottom: 0; }
body[data-page="lecture"] .entete,
body[data-page="lecture"] .onglets { display: none; }

.lecture { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

.lecture-barre {
  display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 8px;
}
.lecture-titre { flex: 1; text-align: center; font-family: var(--titre); font-size: .97rem; }
.rond {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center;
  border-radius: 50%; background: var(--voile); border: 1.5px solid var(--bord);
  font-size: 1.1rem; cursor: pointer;
}
.rond.on { background: var(--or); color: var(--encre); border-color: var(--or); }
.rond:active { transform: scale(.93); }
#favori.on { animation: lp-coeur .32s ease-out; }
@keyframes lp-coeur { 0% { transform: scale(1); } 45% { transform: scale(1.28); } 100% { transform: scale(1); } }

.lp-lecteur { flex: 1; display: flex; flex-direction: column; padding: 0 14px 4px; }
.lp-lecteur .lp-texte { flex: 1 1 auto; min-height: 0; }
.lp-lecteur .lp-barre { flex: none; }



.modes {
  display: flex; gap: 7px; justify-content: center;
  padding: 10px 14px calc(env(safe-area-inset-bottom) + 14px);
}
.mode {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--voile); border: 1.5px solid var(--bord); border-radius: 999px;
  padding: 9px 16px; font-size: .84rem; font-weight: 700; cursor: pointer;
}
.mode.on { background: var(--or); border-color: var(--or); color: var(--encre); }

/* Le moteur fournit sa propre présentation minimale : on l'habille aux
   couleurs de Lampion sans toucher à son code. */
.lp-lecteur .lp-image { border-radius: var(--r-l); border: 1.5px solid var(--bord); box-shadow: var(--ombre); }
.lp-lecteur .lp-texte { font-size: 1.05rem; line-height: 1.7; }
.lp-lecteur .lp-points i.ici { background: var(--or); }
.lp-lecteur .lp-points i.lu { background: var(--accent-2); }
.lp-lecteur .lp-morale { border-color: var(--or-bord); color: var(--or-clair); }

.lp-lecteur .lp-barre { gap: 9px; margin-top: 16px; }
.lp-lecteur .lp-btn {
  font-family: var(--titre); font-weight: 800; border-radius: 999px;
  padding: 12px 22px; border: 1.5px solid var(--bord);
  background: var(--voile); color: var(--texte); box-shadow: none;
}
.lp-lecteur .lp-btn.lp-suite,
.lp-lecteur .lp-btn.lp-ecoute {
  background: linear-gradient(160deg, var(--or-clair), var(--or));
  color: var(--encre); border-color: transparent;
  box-shadow: 0 7px 18px var(--or-lueur);
}
.lp-lecteur .lp-btn[disabled] { opacity: .35; }

/* Écouter : l'illustration domine, le texte accompagne.
   Lire moi-même : le texte prend la première place. */
.lecture[data-mode="ecouter"] .lp-texte { font-size: .98rem; opacity: .92; }
.lecture[data-mode="lire"] .lp-texte { font-size: 1.18rem; line-height: 1.8; }
.lecture[data-mode="lire"] .lp-image { max-height: 34vh; }
.lecture[data-mode="lire"] .lp-image .lp-tableau { max-height: 34vh; object-fit: cover; }
.lecture[data-mode="lire"] .lp-btn.lp-ecoute { display: none; }

/* Progression de l'écoute : elle reste dans l'interface de Lampion. */
.lp-progression { display: flex; align-items: center; gap: 10px; padding: 0 14px 10px; }
.lp-progression-jauge {
  flex: 1; height: 6px; border-radius: 999px; background: var(--voile); overflow: hidden;
}
.lp-progression-jauge i { display: block; height: 100%; width: 0; background: var(--or); transition: width .2s linear; }
.lp-minutage { font-size: .78rem; font-weight: 700; color: var(--doux); font-variant-numeric: tabular-nums; }
.lp-lecteur .lp-btn.lp-ecoute-tout { background: var(--voile); color: var(--texte); border-color: var(--bord); }

/* ------------------------------------------------- feuillets (fin, quiz) */

.feuillet {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
  padding: calc(env(safe-area-inset-top) + 26px) 20px calc(env(safe-area-inset-bottom) + 26px);
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(ellipse 90% 60% at 50% 22%, var(--halo-1), transparent 65%),
    linear-gradient(180deg, var(--fond-2), var(--fond-3));
  text-align: center;
  animation: lp-monte .32s ease-out;
  overflow-y: auto;
}
@keyframes lp-monte { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

/* Sur un écran court — iPhone SE, ou paysage — le contenu du feuillet
   se met en haut et défile, au lieu d'être centré et coupé. */
@media (max-height: 680px) {
  .feuillet { justify-content: flex-start; gap: 10px; }
  .feuillet h2 { font-size: 1.5rem; }
  .fin-lanterne { width: 92px; }
  #quiz-question { font-size: 1.12rem; }
}

/* Sans cette règle, display:flex écrase l'attribut hidden et le panneau,
   invisible mais présent, intercepte tous les clics de l'écran. */
.feuillet[hidden], .reprise[hidden], [hidden] { display: none !important; }

.feuillet h2 { font-size: 1.9rem; }
.feuillet p { margin: 0; color: var(--doux); }

.fin-lanterne { width: 128px; margin: 0 auto; color: var(--or); animation: lp-arrive .55s cubic-bezier(.2,1.3,.4,1); }
.fin-lanterne svg { width: 100%; height: auto; filter: drop-shadow(0 0 26px var(--or-lueur)); }
@keyframes lp-arrive { from { transform: scale(.4) rotate(-9deg); opacity: 0; } to { transform: none; opacity: 1; } }

.fin-lueur { color: var(--or-clair); font-weight: 700; }

.etincelles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.etincelles i {
  position: absolute; width: 7px; height: 7px; border-radius: 50%;
  background: var(--or-clair); opacity: 0;
  animation: lp-etincelle 1.7s ease-out infinite;
}
@keyframes lp-etincelle {
  0% { opacity: 0; transform: translateY(10px) scale(.4); }
  35% { opacity: .95; }
  100% { opacity: 0; transform: translateY(-58px) scale(1.15); }
}

/* ------------------------------------------------- quiz */

.quiz-entete { display: flex; align-items: center; gap: 10px; }
.quiz-entete span { font-size: .84rem; color: var(--doux); }
.quiz-jauge { height: 7px; border-radius: 999px; background: var(--voile); overflow: hidden; }
.quiz-jauge i { display: block; height: 100%; background: var(--or); transition: width .3s; }

#quiz-question { font-size: 1.32rem; margin: 6px 0 4px; }

.quiz-reponses { display: grid; gap: 10px; }
.quiz-reponses--images { grid-template-columns: repeat(3, 1fr); }

.reponse {
  display: flex; align-items: center; gap: 11px; text-align: start;
  background: var(--carte); border: 2px solid var(--bord); border-radius: var(--r-m);
  padding: 11px 13px; font-weight: 700; font-size: .94rem; cursor: pointer;
  transition: transform .12s, border-color .2s, background .2s;
}
.reponse:active { transform: scale(.97); }
.reponse-vignette { width: 54px; flex: none; border-radius: 11px; overflow: hidden; background: var(--fond-3); line-height: 0; }
.reponse-vignette svg { width: 100%; height: auto; display: block; }

.quiz-reponses--images .reponse { flex-direction: column; gap: 7px; text-align: center; padding: 9px; font-size: .8rem; }
.quiz-reponses--images .reponse-vignette { width: 100%; aspect-ratio: 1; }
.quiz-reponses--images .reponse-vignette svg { height: 100%; object-fit: cover; }

.reponse.juste { border-color: var(--juste); background: var(--juste-fond); }
.reponse.fausse { border-color: var(--faux); background: var(--faux-fond); }
.quiz-retour { font-size: .92rem; color: var(--or-clair); }

/* ------------------------------------------------- mes lanternes */

.compteur {
  font-family: var(--corps); font-size: .8rem; font-weight: 700;
  background: var(--voile); border: 1.5px solid var(--bord);
  border-radius: 999px; padding: 3px 11px; margin-inline-start: 8px;
}

.grille-lanternes {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px;
  margin-bottom: 18px;
}
.lanterne-case {
  aspect-ratio: 3 / 4; display: grid; place-items: center;
  background: var(--voile); border: 1.5px solid var(--bord); border-radius: var(--r-m);
  padding: 9px; color: var(--doux);
}
.lanterne-case svg { width: 100%; height: auto; }
.lanterne-case .allumee { display: none; }
.lanterne-case.on {
  color: var(--or); background: var(--or-voile); border-color: var(--or-bord);
}
.lanterne-case.on .allumee { display: block; filter: drop-shadow(0 0 12px var(--or-lueur)); }
.lanterne-case.on .eteinte { display: none; }

/* ------------------------------------------------- barre d'onglets */

.onglets {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
  height: var(--barre); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--fond-3) 92%, transparent);
  backdrop-filter: blur(14px);
  border-top: 1.5px solid var(--bord);
}
.onglets a {
  display: grid; justify-items: center; align-content: center; gap: 3px;
  min-height: 44px; font-size: .67rem; font-weight: 700; color: var(--doux);
  transition: color .2s;
}
.onglets a:active { color: var(--texte); }
.onglets svg { width: 21px; height: 21px; }
.onglets a.on { color: var(--or); }

/* ------------------------------------------------- erreurs et écrans vides */

.erreur {
  min-height: 72vh; display: flex; flex-direction: column; justify-content: center;
  align-items: center; text-align: center; gap: 14px; padding: 30px 10px;
}
.erreur h1 { font-size: 1.7rem; }
.erreur p { margin: 0; color: var(--doux); max-width: 30ch; }
.erreur .actions { width: min(320px, 100%); }
.erreur-lanterne { width: 92px; color: var(--doux); opacity: .7; }
.erreur-lanterne svg { width: 100%; height: auto; }

.vide-illustre {
  display: grid; justify-items: center; gap: 10px; text-align: center;
  padding: 26px 14px; color: var(--doux);
  background: var(--voile); border: 1.5px dashed var(--bord); border-radius: var(--r-m);
}
.vide-illustre span { width: 54px; color: var(--or); opacity: .75; }
.vide-illustre span svg { width: 100%; height: auto; }

/* ------------------------------------------------- divers */

section + section { margin-top: 26px; }
.ecran > section:last-of-type { padding-bottom: 6px; }
.vide { color: var(--doux); font-style: italic; text-align: center; padding: 22px 0; }
.reprise { margin-bottom: 20px; }
.carte-reprise {
  display: flex; align-items: center; gap: 12px;
  background: var(--carte); border: 1.5px solid var(--bord);
  border-radius: var(--r-m); padding: 10px; overflow: hidden;
}
.carte-reprise .carte-image { width: 92px; flex: none; border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; }
.carte-reprise strong { display: block; font-family: var(--titre); }

[dir="rtl"] .heros-texte { text-align: right; }

/* Les suites de nombres et les durées gardent leur sens de lecture propre :
   « 5-7 ans » ou « 10 min » ne s'inversent pas en langue RTL. */
.carte-meta, .fiche-meta, .compteur, .quiz-entete span { unicode-bidi: isolate; }

@media (min-width: 620px) {
  .grille-contes { grid-template-columns: repeat(3, 1fr); }
  .grille-lanternes { grid-template-columns: repeat(6, 1fr); }
  .heros h1 { font-size: 2.2rem; }
}

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