/* L'Œuf — style « livre d'images » : contours à l'encre, couleurs franches, gros boutons au doigt. */
[hidden] { display: none !important; }

:root {
  --encre: #2b2340;
  --papier: #ffffff;
  --ciel-haut: #7cc8f2;
  --ciel-bas: #d6f0ff;
  --colline: #8fd694;
  --colline-ombre: #6fbf7a;
  --astre: #ffd166;
  --soleil-halo: rgba(255, 209, 102, .35);
  --oui: #b8f0a4;
  --non: #ffc2cc;
  --peutetre: #e3d4ff;
  --accent: #ffd166;
  --police: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", "Arial Rounded MT Bold", "Trebuchet MS", system-ui, sans-serif;
  --ombre-dure: 0 5px 0 var(--encre);
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  min-height: 100dvh;
  font-family: var(--police);
  color: var(--encre);
  background: linear-gradient(to bottom, var(--ciel-haut), var(--ciel-bas) 70%);
  display: flex;
  flex-direction: column;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}

/* ── Moments de la journée ─────────────────────────────────────────────── */
body.moment-matin { --ciel-haut: #ffc7a8; --ciel-bas: #fff0d9; }
body.moment-soir  { --ciel-haut: #ff9f7a; --ciel-bas: #ffd9a8; --colline: #7cbf83; --colline-ombre: #5fa56b; }
body.moment-nuit  {
  --ciel-haut: #1d1b4a; --ciel-bas: #3d3a7a; --colline: #3f6e57; --colline-ombre: #2f5644;
  --astre: #f4f1ff; --soleil-halo: rgba(244, 241, 255, .18);
}
body.saison-automne { --colline: #d9b25f; --colline-ombre: #c49a45; }
body.saison-hiver   { --colline: #eef4fb; --colline-ombre: #d3e0ee; }
body.saison-hiver.moment-nuit { --colline: #9aa6c9; --colline-ombre: #7f8bb0; }

/* ── Décor ─────────────────────────────────────────────────────────────── */
.decor { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.astre {
  position: absolute; top: 7vh; right: 9vw;
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--astre);
  border: 3px solid var(--encre);
  box-shadow: 0 0 0 14px var(--soleil-halo);
}
.moment-nuit .astre { box-shadow: 0 0 0 14px var(--soleil-halo), inset -16px -6px 0 0 #d8d2ef; }
.nuage {
  position: absolute; height: 26px; border-radius: 20px;
  background: var(--papier); border: 3px solid var(--encre); opacity: .9;
}
.nuage::before {
  content: ""; position: absolute; left: 22%; bottom: 8px; width: 46%; height: 34px;
  border-radius: 50%; background: inherit; border: 3px solid var(--encre); border-bottom: none;
}
.nuage::after { content: ""; position: absolute; left: 8%; right: 8%; bottom: 0; height: 18px; background: inherit; border-radius: 16px; }
.nuage.n1 { top: 16vh; left: -20vw; width: 110px; animation: derive 70s linear infinite; }
.nuage.n2 { top: 30vh; left: -20vw; width: 80px; animation: derive 95s linear infinite -40s; }
.moment-nuit .nuage { opacity: .25; }
.etoiles { position: absolute; inset: 0 0 40% 0; opacity: 0; }
.moment-nuit .etoiles {
  opacity: 1;
  background-image:
    radial-gradient(2px 2px at 12% 20%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 32% 8%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 48% 28%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 66% 14%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 84% 32%, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 22% 40%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 74% 44%, #fff 50%, transparent 51%);
}
.colline {
  position: absolute; left: -15vw; right: -15vw; bottom: -30vh; height: 58vh;
  background: var(--colline);
  border-top: 4px solid var(--encre);
  border-radius: 50% 50% 0 0 / 22% 22% 0 0;
  box-shadow: inset 0 18px 0 0 var(--colline-ombre);
}
.saison-printemps .colline {
  background-image:
    radial-gradient(5px 5px at 18% 12%, #ff8fa3 60%, transparent 62%),
    radial-gradient(5px 5px at 42% 7%, #fff 60%, transparent 62%),
    radial-gradient(5px 5px at 63% 11%, #ffd166 60%, transparent 62%),
    radial-gradient(5px 5px at 82% 9%, #ff8fa3 60%, transparent 62%);
}
.saison-hiver .saisonnier {
  position: absolute; inset: -100px 0 0 0;
  background-image:
    radial-gradient(3px 3px at 10% 10%, #fff 60%, transparent 62%),
    radial-gradient(4px 4px at 35% 30%, #fff 60%, transparent 62%),
    radial-gradient(3px 3px at 60% 15%, #fff 60%, transparent 62%),
    radial-gradient(4px 4px at 85% 40%, #fff 60%, transparent 62%),
    radial-gradient(3px 3px at 25% 60%, #fff 60%, transparent 62%),
    radial-gradient(3px 3px at 75% 75%, #fff 60%, transparent 62%);
  background-size: 100% 100px;
  animation: neige 9s linear infinite;
  opacity: .9;
}
.saison-automne .saisonnier {
  position: absolute; top: -20px; left: 30%; width: 14px; height: 9px;
  background: #e07a3f; border: 2px solid var(--encre); border-radius: 0 80% 0 80%;
  animation: feuille 12s ease-in-out infinite;
}

/* ── Textes et boutons ─────────────────────────────────────────────────── */
.titre {
  font-size: clamp(2.8rem, 12vw, 4.6rem);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
  color: var(--papier);
  -webkit-text-stroke: 3px var(--encre);
  paint-order: stroke fill;
  text-shadow: 0 6px 0 var(--encre);
}
.moment-nuit .consigne, .moment-nuit .message, .moment-nuit .diagnostic p { color: #fff; }
.consigne { font-size: 1.25rem; font-weight: 700; margin: .9rem 0 1.4rem; max-width: 30ch; }

.bouton, .reponse {
  font: inherit;
  font-weight: 800;
  color: var(--encre);
  background: var(--papier);
  border: 3px solid var(--encre);
  border-radius: 18px;
  box-shadow: var(--ombre-dure);
  cursor: pointer;
  text-decoration: none;
  transition: transform .08s, box-shadow .08s;
  touch-action: manipulation;
}
.bouton { display: inline-block; padding: .7rem 1.3rem; font-size: 1.1rem; }
.bouton:active, .reponse:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 2px 0 var(--encre); }
:focus-visible { outline: 4px solid #4361ee; outline-offset: 3px; }

.bouton-rond {
  display: grid; place-items: center;
  width: 56px; height: 56px;
  background: var(--papier);
  border: 3px solid var(--encre); border-radius: 50%;
  box-shadow: 0 4px 0 var(--encre);
  color: var(--encre);
  cursor: pointer;
}
.bouton-rond svg, .ecouter svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.bouton-rond:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--encre); }

/* ── Le nid (accueil) ──────────────────────────────────────────────────── */
.nid {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 8vh 20px 32px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.premier-oeuf {
  background: none; border: none; padding: 0; cursor: pointer;
  width: min(62vw, 260px);
  position: relative;
}
.premier-oeuf svg { width: 100%; height: auto; display: block; animation: attente 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
.dortoir {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 22px 14px;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  width: 100%;
}
.couchette {
  display: flex; flex-direction: column; align-items: center;
  width: 100%; padding: 4px 0 0;
  color: var(--encre); text-decoration: none;
  background: none; border: none; font: inherit; cursor: pointer;
  position: relative;
}
.couchette svg { width: 120px; height: 120px; position: relative; z-index: 1; }
.couchette::before { /* le nid tressé */
  content: ""; position: absolute; top: 100px; width: 128px; height: 32px;
  background: repeating-linear-gradient(115deg, #c08552 0 6px, #a86f3e 6px 11px);
  border: 3px solid var(--encre); border-radius: 0 0 64px 64px / 0 0 38px 38px;
  z-index: 2;
}
.couchette.nouvelle::before { background: repeating-linear-gradient(115deg, #e9d3b3 0 6px, #dcc19a 6px 11px); }
.plus {
  width: 120px; height: 120px; display: grid; place-items: center;
  font-size: 3.2rem; font-weight: 900; color: var(--encre);
  opacity: .55;
}
.etiquette {
  margin-top: 22px; font-weight: 800; font-size: 1.05rem;
  background: var(--papier); border: 3px solid var(--encre); border-radius: 12px;
  padding: .15rem .65rem; position: relative; z-index: 3;
}
.jours { font-size: .9rem; font-weight: 700; margin-top: .3rem; }
.moment-nuit .jours { color: #fff; }
.couchette:active svg { transform: translateY(3px); }
.message { min-height: 1.5em; font-weight: 700; }

/* ── La créature ───────────────────────────────────────────────────────── */
.page-creature { height: 100dvh; overflow: hidden; }
.barre { display: flex; justify-content: space-between; padding: 12px 14px 0; }
.scene {
  flex: 1;
  min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  gap: 14px;
  padding: 0 14px;
}
.bulle {
  position: relative;
  max-width: min(92vw, 520px);
  min-height: 64px;
  background: var(--papier);
  border: 3px solid var(--encre);
  border-radius: 24px;
  padding: .8rem 3.4rem .8rem 1.1rem;
  box-shadow: var(--ombre-dure);
}
.bulle::after { /* la queue de la bulle, vers la créature */
  content: ""; position: absolute; left: 50%; bottom: -16px; width: 22px; height: 22px;
  background: var(--papier); border-right: 3px solid var(--encre); border-bottom: 3px solid var(--encre);
  transform: translateX(-50%) rotate(45deg);
}
.bulle p { margin: 0; font-size: clamp(1.2rem, 4.6vw, 1.55rem); font-weight: 800; line-height: 1.3; }
.bulle.narrateur { background: #fff7d6; }
.bulle.narrateur::after { background: #fff7d6; }
.bulle.narrateur p { font-style: italic; font-weight: 700; }
.bulle.arrive { animation: bulle .28s ease-out; }
.ecouter {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; display: grid; place-items: center;
  background: none; border: none; color: var(--encre); cursor: pointer; border-radius: 50%;
}
.ecouter:active { background: #f0ecff; }

.tableau { display: flex; align-items: flex-end; justify-content: center; gap: 4px; width: 100%; }
.carte-question {
  width: clamp(96px, 28vw, 150px);
  aspect-ratio: 1;
  background: var(--papier);
  border: 3px solid var(--encre);
  border-radius: 20px;
  box-shadow: var(--ombre-dure);
  padding: 8px;
  transform: rotate(-4deg);
  margin-bottom: 16%;
  animation: carte .35s ease-out;
}
.carte-question svg { width: 100%; height: 100%; display: block; }
.habitat { position: relative; width: clamp(160px, 52vw, 290px); }
svg.creature { display: block; width: 100%; height: auto; overflow: visible; }

/* Animations de la créature (déclenchées par des classes) */
.creature .corps-anime { transform-box: fill-box; transform-origin: 50% 100%; }
.creature .ombre { fill: rgba(43, 35, 64, .18); }
.page-creature .creature .corps-anime { animation: respire 3.4s ease-in-out infinite; }
.creature.tapote .corps-anime { animation: tapote .7s ease-in-out; }
.creature.saute .corps-anime { animation: saute .6s ease-out; }
.creature.eclosion .corps-anime { animation: eclosion 1.5s ease-in-out; }
.creature.apparition .corps-anime { animation: apparition 1s cubic-bezier(.3, 1.6, .5, 1); }
.creature.grandit .corps-anime { animation: grandit 1.2s ease-in-out; }
.creature.reveil .corps-anime { animation: tapote 1.4s ease-in-out; }
.creature .yeux { transform-box: fill-box; transform-origin: 50% 50%; }
.creature.cligne .yeux { transform: scaleY(.1); }
.creature .oeil-ferme { display: none; }
.creature[data-emotion="endormie"] .oeil-ouvert { display: none; }
.creature[data-emotion="endormie"] .oeil-ferme { display: inline; }
.creature .pupilles, .creature .silhouette { transition: transform .25s ease-out; }
.creature .lumiere { opacity: 0; transition: opacity .6s; }
.creature.lumineux .lumiere { opacity: 1; }
.creature .coeur { transform-box: fill-box; transform-origin: 50% 50%; animation: bat 1.1s ease-in-out infinite; }
.creature.coeur-vite .coeur { animation-duration: .45s; }
.creature .antenne { animation: luit 2.4s ease-in-out infinite; }
.creature .extra { opacity: 0; transition: opacity .3s; }
.creature text { font: 900 34px var(--police); fill: var(--encre); }
.creature[data-emotion="perplexe"] .extra-perplexe,
.creature[data-emotion="fiere"] .extra-fiere,
.creature[data-emotion="endormie"] .extra-endormie { opacity: 1; }
.creature .extra-endormie text { font-size: 26px; }
.page-creature .creature[data-emotion="endormie"] .corps-anime { animation-duration: 5s; }
.creature .z1 { animation: zz 2.4s ease-in-out infinite; }
.creature .z2 { animation: zz 2.4s ease-in-out infinite .8s; }

/* Les rêves : les mots du jour flottent au-dessus d'elle */
.reves { position: absolute; inset: -40% 0 40% 0; pointer-events: none; }
.reve {
  position: absolute; left: 50%; bottom: 0;
  padding: .3rem .8rem;
  background: rgba(255, 255, 255, .9);
  border: 3px solid var(--encre); border-radius: 999px;
  font-weight: 800;
  opacity: 0;
  animation: reve 9s ease-in-out infinite;
  animation-delay: calc(var(--i) * 1.3s);
  translate: calc(var(--x) * 1px - 50%) 0;
}

/* ── Les choix ─────────────────────────────────────────────────────────── */
.choix {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 16px 14px calc(18px + env(safe-area-inset-bottom, 0));
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  min-height: 112px;
}
.choix[data-type="orthographe"] { grid-template-columns: repeat(2, 1fr); }
.choix[data-type="dodo"] { grid-template-columns: 1fr; max-width: 360px; }
.reponse {
  min-height: 68px;
  padding: .5rem .4rem;
  font-size: clamp(1.15rem, 5vw, 1.5rem);
  animation: pousse .3s ease-out backwards;
}
.reponse:nth-child(2) { animation-delay: .06s; }
.reponse:nth-child(3) { animation-delay: .12s; }
.reponse.image { aspect-ratio: 1; padding: 6px; }
.reponse.image svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.reponse.oui { background: var(--oui); }
.reponse.non { background: var(--non); }
.reponse.peutetre { background: var(--peutetre); font-size: clamp(.95rem, 3.8vw, 1.2rem); }
.reponse.dodo { display: grid; place-items: center; background: #e3d4ff; }
.reponse:disabled { cursor: default; }
.reponse:disabled:not(.choisi) { opacity: .45; }
.reponse.bon { background: var(--accent); animation: bon .5s ease-out; }
.reponse.hesite { animation: hesite .5s ease-in-out; }

/* ── Journal ───────────────────────────────────────────────────────────── */
.journal {
  border: 3px solid var(--encre); border-radius: 22px; padding: 0;
  width: min(92vw, 520px); max-height: 82dvh;
  box-shadow: 0 8px 0 var(--encre);
  color: var(--encre);
}
.journal::backdrop { background: rgba(43, 35, 64, .45); }
.page-journal {
  padding: 1.2rem 1.4rem 1.4rem;
  background: repeating-linear-gradient(to bottom, #fffdf4 0 31px, #e4ddf5 31px 33px);
  font-family: var(--police);
}
.page-journal h2 { margin: 0 0 .6rem; font-size: 1.6rem; font-weight: 900; }
.aujourdhui { font-weight: 800; font-size: 1.1rem; line-height: 33px; margin: 0 0 .6rem; }
.pages { list-style: none; margin: 0 0 1rem; padding: 0; }
.pages li { line-height: 33px; font-size: 1.05rem; padding: 0 0 .2rem; }

/* ── Diagnostic et erreurs ─────────────────────────────────────────────── */
.diagnostic { text-align: left; align-items: stretch; }
.verifs, .erreurs { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 10px; }
.verifs li, .erreurs li {
  background: var(--papier); border: 3px solid var(--encre); border-radius: 14px; padding: .6rem .9rem;
  display: flex; flex-direction: column; gap: .2rem;
}
.verifs .ko { background: #ffe1e6; }
.verifs span { font-size: .95rem; }
.erreur {
  white-space: pre-wrap; text-align: left; background: var(--papier);
  border: 3px solid var(--encre); border-radius: 14px; padding: 1rem; max-width: 60ch; font-family: inherit;
}

/* ── Petits écrans et écrans bas ───────────────────────────────────────── */
@media (max-width: 360px) {
  .choix { gap: 8px; padding-inline: 8px; }
  .reponse { min-height: 60px; }
  .bulle { padding-right: 2.8rem; }
}
@media (max-height: 600px) {
  .habitat { width: clamp(130px, 34vh, 220px); }
  .carte-question { width: clamp(80px, 20vh, 120px); }
}

/* ── Images clés ───────────────────────────────────────────────────────── */
@keyframes respire { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.02, .985); } }
@keyframes tapote { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-7deg); } 45% { transform: rotate(6deg); } 70% { transform: rotate(-3deg); } }
@keyframes saute { 0%, 100% { transform: translateY(0) scale(1, 1); } 25% { transform: translateY(0) scale(1.06, .92); } 55% { transform: translateY(-16%) scale(.96, 1.05); } }
@keyframes eclosion {
  0%, 100% { transform: rotate(0); } 10% { transform: rotate(-6deg); } 20% { transform: rotate(6deg); }
  30% { transform: rotate(-9deg); } 40% { transform: rotate(9deg); } 55% { transform: rotate(-12deg) scale(1.03); }
  70% { transform: rotate(12deg) scale(1.05); } 85% { transform: scale(1.12, .9); }
}
@keyframes apparition { 0% { transform: scale(.3) translateY(20%); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes grandit { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.15); } 60% { transform: scale(.95); } }
@keyframes bat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.25); } 30% { transform: scale(1); } 45% { transform: scale(1.18); } }
@keyframes luit { 0%, 100% { fill: #ffd166; } 50% { fill: #fff3b0; } }
@keyframes zz { 0%, 100% { transform: translateY(0); opacity: .4; } 50% { transform: translateY(-6px); opacity: 1; } }
@keyframes reve { 0% { opacity: 0; transform: translateY(0) scale(.8); } 15% { opacity: 1; } 70% { opacity: .9; } 100% { opacity: 0; transform: translateY(-120px) scale(1.05); } }
@keyframes bulle { from { transform: scale(.94); } to { transform: scale(1); } }
@keyframes carte { from { transform: rotate(-12deg) scale(.6); opacity: 0; } to { transform: rotate(-4deg) scale(1); opacity: 1; } }
@keyframes pousse { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes bon { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes hesite { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes attente { 0%, 82%, 100% { transform: rotate(0); } 88% { transform: rotate(-5deg); } 94% { transform: rotate(4deg); } }
@keyframes derive { from { transform: translateX(0); } to { transform: translateX(140vw); } }
@keyframes neige { from { transform: translateY(0); } to { transform: translateY(100px); } }
@keyframes feuille { 0% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(18vw, 50vh) rotate(200deg); } 100% { transform: translate(-6vw, 105vh) rotate(420deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reve { opacity: 1; position: static; display: inline-block; margin: 4px; translate: none; }
  .reves { position: static; display: flex; flex-wrap: wrap; justify-content: center; }
}

/* ═══ V3 : nouvelles pages et interactions ═══════════════════════════════ */
.titre.petit { font-size: clamp(2rem, 9vw, 3.2rem); }
.barre-droite { display: flex; gap: 10px; }
.liens-bas { margin-top: auto; padding-top: 2rem; display: flex; flex-direction: column; gap: .6rem; align-items: center; }
.liens-bas a, .page-parents a { color: var(--encre); font-weight: 800; }
.moment-nuit .liens-bas a { color: #fff; }
.message.alerte, .alerte { background: #fff3c4; border: 3px solid var(--encre); border-radius: 14px; padding: .6rem .9rem; color: var(--encre); }
.aide-parent { font-size: .95rem; max-width: 46ch; margin: 0 0 1rem; background: rgba(255,255,255,.85); border-radius: 12px; padding: .5rem .8rem; color: var(--encre); }
.premier-oeuf { display: block; }

/* Le jardin */
.jardin { width: 100%; margin-top: 2.2rem; padding: 1rem 1rem 1.4rem; background: rgba(255,255,255,.55); border: 3px solid var(--encre); border-radius: 24px; }
.jardin h2 { margin: 0 0 .2rem; font-size: 1.5rem; font-weight: 900; }
.jardin p { margin: 0 0 1rem; font-weight: 700; }
.couchette.fleurie::before { background: repeating-linear-gradient(115deg, #95d5b2 0 6px, #74c69d 6px 11px); }
.au-jardin .decor .colline { box-shadow: inset 0 18px 0 0 var(--colline-ombre), inset 0 40px 0 0 rgba(255, 143, 171, .15); }

/* Choisir la taille de l'œuf */
.tailles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; width: 100%; }
.taille {
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  background: rgba(255,255,255,.75); border: 3px solid var(--encre); border-radius: 22px; box-shadow: var(--ombre-dure);
  padding: 1rem .6rem; font: inherit; color: var(--encre); cursor: pointer;
}
.taille svg { width: calc(110px * var(--taille, 1)); height: calc(110px * var(--taille, 1)); }
.taille .etiquette { margin-top: .2rem; }
.taille .aide { font-size: .9rem; font-weight: 600; }
.taille:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--encre); }

/* Le chant secret */
.portee { list-style: none; display: flex; gap: 6px; justify-content: center; padding: 0; margin: .4rem 0 1rem; flex-wrap: wrap; }
.portee li {
  width: 54px; height: 54px; border: 3px dashed var(--encre); border-radius: 14px; background: rgba(255,255,255,.8);
  display: grid; place-items: center; padding: 4px; position: relative;
}
.portee li:has(svg) { border-style: solid; background: #fff; }
.portee.grande li { width: 52px; height: 52px; }
.portee li svg { width: 100%; height: 100%; }
.portee li span { position: absolute; top: 100%; font-size: .75rem; font-weight: 700; margin-top: 2px; }
.portee li.chante { transform: scale(1.2); background: #fff3b0; transition: transform .15s; }
.page-parents .portee { justify-content: flex-start; margin-bottom: 1.6rem; }
.clavier { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; width: 100%; max-width: 480px; }
.clavier.attente { opacity: .5; pointer-events: none; }
.touche { aspect-ratio: 1; background: #fff; border: 3px solid var(--encre); border-radius: 14px; box-shadow: 0 4px 0 var(--encre); padding: 4px; cursor: pointer; }
.touche:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--encre); }
.touche svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.actions-chant { margin-top: 1rem; }
.candidats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; width: 100%; max-width: 420px; }
.candidat { background: rgba(255,255,255,.75); border: 3px solid var(--encre); border-radius: 22px; padding: 8px; cursor: pointer; box-shadow: var(--ombre-dure); }
.candidat svg { width: 100%; height: auto; }

/* Questions */
.carte-question .indice { margin: 4px 0 0; text-align: center; font-weight: 900; font-size: 1.3rem; letter-spacing: .05em; }
.carte-question:has(.indice) { aspect-ratio: auto; }
.carte-question:has(.indice) svg { height: auto; aspect-ratio: 1; }
.reponse.image { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.reponse.image .nom { font-size: .95rem; line-height: 1.1; }
.reponse.image:has(.nom) svg { height: auto; flex: 1; min-height: 0; }
.choix[data-nombre="2"] { grid-template-columns: repeat(2, 1fr); }
.choix[data-longues] { grid-template-columns: 1fr; }
.choix[data-longues] .reponse { font-size: clamp(1rem, 4vw, 1.15rem); min-height: 56px; text-align: left; padding: .6rem .9rem; }
.choix[data-type="phrase_erreur"] { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.reponse.jeton { min-height: 58px; padding: .4rem .9rem; background: #fffdf4; border-style: dashed; }
.choix[data-type="calme"] { grid-template-columns: repeat(2, 1fr); }
.reponse.calme { background: #e3d4ff; display: grid; place-items: center; text-decoration: none; font-size: clamp(1rem, 4.2vw, 1.25rem); }
.reponse.calme.parents { background: #fff; font-size: .95rem; }

/* Dodo */
.carte-reveil { transform: rotate(-3deg); aspect-ratio: auto; display: grid; place-items: center; width: clamp(120px, 34vw, 170px); }
.reveil { display: flex; flex-direction: column; align-items: center; gap: .4rem; text-align: center; font-weight: 800; font-size: .95rem; }
.lune-reveil {
  width: 54px; height: 54px; border-radius: 50%; border: 3px solid var(--encre);
  background: conic-gradient(#ffd166 calc(var(--plein) * 360deg), #e8e3f5 0);
}
.couverture {
  position: absolute; left: 6%; right: 6%; bottom: 3%; height: 0;
  background: repeating-linear-gradient(45deg, #a2d2ff 0 12px, #cde7ff 12px 24px);
  border: 4px solid var(--encre); border-radius: 30px 30px 18px 18px;
  transition: height .9s cubic-bezier(.3, 1.3, .5, 1); opacity: 0;
}
.couverture.posee { height: 46%; opacity: 1; }

/* Étincelle d'une déduction, œuf pondu */
.habitat.etincelle::after {
  content: ""; position: absolute; inset: -10%; pointer-events: none;
  background: radial-gradient(circle at 30% 30%, #fff3b0 0 4px, transparent 5px), radial-gradient(circle at 70% 20%, #ffd166 0 5px, transparent 6px),
    radial-gradient(circle at 80% 60%, #fff3b0 0 4px, transparent 5px), radial-gradient(circle at 20% 70%, #ffd166 0 5px, transparent 6px);
  animation: scintille 1.4s ease-out;
}
.oeuf-pondu { position: absolute; width: 38%; right: -18%; bottom: 0; animation: apparition 1s cubic-bezier(.3, 1.6, .5, 1); }

/* Journal, souvenirs, album, constellation */
.pages li.histoire { background: #fff3c4; border-radius: 10px; padding: 0 .5rem; }
.page-journal h3 { margin: 1rem 0 .4rem; font-size: 1.2rem; }
.souvenirs { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .6rem; }
.souvenirs li { display: flex; gap: .7rem; align-items: flex-start; }
.souvenirs svg { width: 56px; height: 56px; flex: none; }
.souvenirs p { margin: .2rem 0 0; line-height: 1.4; }
.figure-souvenir { width: 120px; margin: 0 auto; }
.figure-souvenir svg { width: 100%; height: auto; }
.souvenir p { line-height: 1.5; font-size: 1.1rem; }
.album { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 10px; }
.carte-mot {
  width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #fff; border: 3px solid var(--encre); border-radius: 14px; padding: 6px; font: inherit; font-weight: 800; color: var(--encre); cursor: pointer;
}
.carte-mot svg { width: 56px; height: 56px; }
.carte-mot.pale { opacity: .55; }
.tete { background: #1d1b4a; color: #fff; }
.page-tete { padding: 1.2rem; font-family: var(--police); }
.page-tete h2 { margin: 0; }
.legende { font-size: .95rem; opacity: .85; }
.ciel-tete { min-height: 200px; }
.constellation { width: 100%; height: auto; display: block; }
.constellation .fil { stroke: #b8b4ff; stroke-width: 1.4; }
.constellation .fil.deduit { stroke: #ffd166; stroke-dasharray: 4 3; }
.constellation .fil.neuf { stroke-width: 2.4; }
.constellation .etoile circle { fill: #fff; }
.constellation .etoile.grande circle { fill: #ffd166; }
.constellation .etoile.neuve circle { fill: #ffd166; animation: luitEtoile 1.6s ease-in-out infinite; }
.constellation text { fill: #fff; font: 700 10px var(--police); text-anchor: middle; }
.tete .bouton { margin-top: .6rem; }

/* Espace parent */
.parents { width: 100%; max-width: 820px; margin: 0 auto; padding: 4vh 18px 40px; }
.parents section, .porte, .fiche { background: rgba(255,255,255,.92); border: 3px solid var(--encre); border-radius: 20px; padding: 1rem 1.2rem; margin: 1rem 0; }
.parents h2 { margin: 0 0 .5rem; font-size: 1.4rem; }
.parents h3 { margin: 0 0 .4rem; font-size: 1.25rem; }
.parents h3 small { font-weight: 600; font-size: .9rem; }
.parents h4 { margin: 1rem 0 .3rem; }
.parents p { line-height: 1.5; }
.fiche { background: #fffdf4; }
.parents section .fiche { margin: .8rem 0; }
.nombre-lettres { font-size: 1.4rem; font-weight: 900; }
.porte input[name="reponse"] { font: inherit; font-size: 1.4rem; padding: .4rem .6rem; border: 3px solid var(--encre); border-radius: 12px; width: 9ch; margin: 0 .6rem; }
.ligne { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.bouton.secondaire { font-size: .95rem; padding: .45rem .9rem; box-shadow: 0 3px 0 var(--encre); }
select { font: inherit; padding: .3rem; border: 3px solid var(--encre); border-radius: 10px; }
.tableau-defile { overflow-x: auto; }
.parents table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .95rem; }
.parents th, .parents td { border-bottom: 2px solid #e4ddf5; padding: .4rem; text-align: left; vertical-align: top; }
.mots { font-size: .95rem; }
.secours { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; margin: .6rem 0; }
.qr-cadre { width: 180px; border: 3px solid var(--encre); border-radius: 12px; overflow: hidden; background: #fff; }
.qr-cadre svg { display: block; width: 100%; height: auto; }
.lien { width: min(100%, 420px); font: inherit; font-size: .9rem; padding: .4rem; border: 2px solid var(--encre); border-radius: 8px; }
details.danger summary { cursor: pointer; font-weight: 700; margin-top: 1rem; }

@keyframes scintille { 0% { opacity: 0; transform: scale(.6); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.25); } }
@keyframes luitEtoile { 0%, 100% { opacity: .6; } 50% { opacity: 1; } }

.reponse { hyphens: auto; overflow-wrap: break-word; }
.reponse.long { font-size: clamp(.9rem, 3.6vw, 1.15rem); }
