/* Pompons : la nuit des bonbons.
   Un seul thème voulu (ciel de nuit, couleurs de bonbons, contours d'encre façon autocollant).
   Aucune règle de style dans le HTML : tout passe par ce fichier (CSP stricte dans l'application web). */

@font-face {
  font-family: "Pompons Fredoka";
  src: url(fredoka.woff) format("woff");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --nuit: #17324A;
  --nuit-2: #1F4766;
  --nuit-3: #2E2A66;
  --encre: #2A1838;
  --creme: #FFF4E2;
  --creme-2: #FFE5BF;
  --citrouille: #FF7A1A;
  --beurre: #FFD23F;
  --gomme: #FF6FB5;
  --slime: #7BE36A;
  --lagon: #3EC7E8;
  --lilas: #A98BFF;
  --rouge: #FF4D5E;
  --texte: var(--creme);
  --texte-doux: #C9DDF0;
  --voile: rgba(14, 18, 44, 0.86);
  --contour: 3px 0 0 var(--encre), -3px 0 0 var(--encre), 0 3px 0 var(--encre), 0 -3px 0 var(--encre),
    2px 2px 0 var(--encre), -2px -2px 0 var(--encre), 2px -2px 0 var(--encre), -2px 2px 0 var(--encre);
  --police: "Pompons Fredoka", ui-rounded, "Arial Rounded MT Bold", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
  box-sizing: border-box;
  height: 100%;
  background: var(--nuit);
}

*, *::before, *::after { box-sizing: inherit; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  margin: 0;
  background: var(--nuit);
  color: var(--texte);
  font-family: var(--police);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.35;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}

button { font: inherit; color: inherit; }
svg { display: block; }
h1, h2, h3, p { margin: 0; }
.visuellement-cache {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Mise en page générale ---------- */
.app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  overflow: hidden;
  isolation: isolate;
  background: var(--nuit);
}

.scene {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
}

.ecran {
  grid-area: 1 / 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: entrer 0.3s ease-out;
}

.titre-ecran {
  font-size: clamp(26px, 7vw, 40px);
  font-weight: 700;
  color: var(--creme);
  text-shadow: var(--contour), 0 6px 0 var(--encre);
  letter-spacing: 0.01em;
  text-align: center;
  text-wrap: balance;
  padding-block: 4px 10px;
}

/* ---------- Décor : ciel de nuit ---------- */
.decor {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(60% 40% at 82% 14%, rgba(255, 233, 180, 0.22), rgba(255, 233, 180, 0) 70%),
    linear-gradient(180deg, #132A40 0%, var(--nuit) 28%, var(--nuit-2) 62%, var(--nuit-3) 100%);
}
.etoiles-ciel { position: absolute; inset: 0; width: 100%; height: 72%; }
.etoiles-ciel circle { fill: #FFF4E2; animation: briller 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.etoiles-ciel .e2 { animation-delay: -1.1s; animation-duration: 2.6s; }
.etoiles-ciel .e3 { animation-delay: -2.2s; animation-duration: 3.8s; }
.lune {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 74px);
  right: max(6%, env(safe-area-inset-right, 0px));
  width: clamp(64px, 15vw, 128px);
  animation: flotter-lune 9s ease-in-out infinite;
}
.nuage { position: absolute; opacity: 0.5; }
.nuage-1 { top: 24%; width: clamp(110px, 26vw, 220px); animation: derive 70s linear infinite; }
.nuage-2 { top: 40%; width: clamp(80px, 18vw, 160px); opacity: 0.32; animation: derive 95s linear infinite; animation-delay: -40s; }
.chauve-souris {
  position: absolute;
  top: 18%;
  left: 0;
  width: 54px;
  opacity: 0;
  animation: voler-chauve 26s linear infinite;
  animation-delay: 6s;
}
.chauve-souris .aile { transform-box: fill-box; animation: battre 0.28s ease-in-out infinite alternate; }
.chauve-souris .aile-g { transform-origin: 100% 50%; }
.chauve-souris .aile-d { transform-origin: 0% 50%; }
.collines {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: clamp(150px, 30vh, 300px);
}
.citrouille-lueur .lueur { animation: vaciller-lueur 2.4s ease-in-out infinite; }
/* Les décorations du centre des collines servent aux cellulaires; les grands écrans voient celles des côtés. */
@media (min-width: 700px) { .collines .deco-centre { display: none; } }
.citrouille-lueur.l2 .lueur { animation-delay: -1.2s; }

/* ---------- Barre du haut ---------- */
.barre-haut {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding-block: 8px;
}
.barre-haut .espace { flex: 1 1 auto; }
.compteur {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 50px;
  padding: 0 18px 0 6px;
  background: var(--creme);
  color: var(--encre);
  border: 3px solid var(--encre);
  border-radius: 999px;
  box-shadow: 0 4px 0 var(--encre);
  font-weight: 700;
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  min-width: 96px;
}
.compteur .icone { width: 40px; height: 40px; flex: none; }
.compteur.bosse { animation: bosse 0.38s ease-out; }
.compteur.depense { animation: secouer-doux 0.4s ease-out; }
.btn-parents {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 14px 0 10px;
  border-radius: 999px;
  border: 2px solid rgba(255, 244, 226, 0.5);
  background: rgba(255, 244, 226, 0.1);
  color: var(--creme);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn-parents .icone { width: 22px; height: 22px; }
.btn-parents:focus-visible, .dock-btn:focus-visible, .carte-pompon:focus-visible, .carte-objet:focus-visible,
.carte-paire:focus-visible, .scene-pompon:focus-visible, .bulle-astuce:focus-visible, .onglet:focus-visible,
.onglet-parents:focus-visible, .interrupteur:focus-visible, .segment:focus-visible, .touche:focus-visible,
.oeuf-boite:focus-visible, .btn:focus-visible {
  outline: 4px solid var(--beurre);
  outline-offset: 4px;
}

/* ---------- Boutons autocollants ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px 24px;
  border: 3px solid var(--encre);
  border-radius: 999px;
  background: var(--beurre);
  color: var(--encre);
  box-shadow: 0 5px 0 var(--encre);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.1;
  cursor: pointer;
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, filter 0.15s;
  text-align: center;
}
.btn .icone { width: 30px; height: 30px; flex: none; }
.btn:active, .btn.enfonce { transform: translateY(4px); box-shadow: 0 1px 0 var(--encre); }
.btn[disabled] { filter: saturate(0.25) brightness(0.8); cursor: default; }
.btn[disabled]:active { transform: none; box-shadow: 0 5px 0 var(--encre); }
.btn-citrouille { background: var(--citrouille); }
.btn-gomme { background: var(--gomme); }
.btn-lagon { background: var(--lagon); }
.btn-slime { background: var(--slime); }
.btn-lilas { background: var(--lilas); }
.btn-creme { background: var(--creme); }
.btn-encre { background: var(--encre); color: var(--creme); border-color: var(--creme); box-shadow: 0 5px 0 rgba(0, 0, 0, 0.45); }
.btn-petit { min-height: 46px; font-size: 18px; padding: 6px 18px; }
.btn-petit .icone { width: 24px; height: 24px; }
.btn-rond { width: 58px; height: 58px; min-height: 0; padding: 0; flex: none; }
.btn-rond .icone { width: 32px; height: 32px; }
.btn-grand { min-height: 74px; font-size: clamp(26px, 7vw, 34px); padding: 12px 44px; box-shadow: 0 7px 0 var(--encre); }
.btn-grand .icone { width: 40px; height: 40px; }
.btn-grand:active { transform: translateY(6px); box-shadow: 0 1px 0 var(--encre); }

/* ---------- Dock (navigation des enfants) ---------- */
.dock {
  position: relative;
  z-index: 6;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(6px, 3vw, 26px);
  padding-block: 4px 10px;
}
.dock-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: clamp(70px, 21vw, 92px);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  border-radius: 18px;
}
.dock-rond {
  display: grid;
  place-items: center;
  width: clamp(60px, 17vw, 74px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid var(--encre);
  box-shadow: 0 5px 0 var(--encre);
  background: var(--creme);
  transition: transform 0.08s, box-shadow 0.08s;
}
.dock-rond .icone { width: 64%; height: 64%; }
.dock-btn:active .dock-rond { transform: translateY(4px); box-shadow: 0 1px 0 var(--encre); }
.dock-oeufs .dock-rond { background: var(--beurre); }
.dock-costumes .dock-rond { background: var(--gomme); }
.dock-collection .dock-rond { background: var(--lagon); }
.dock-jeux .dock-rond { background: var(--slime); }
.dock-nom {
  font-size: 15px;
  font-weight: 700;
  color: var(--creme);
  text-shadow: 2px 0 0 var(--encre), -2px 0 0 var(--encre), 0 2px 0 var(--encre), 0 -2px 0 var(--encre), 0 3px 0 var(--encre);
  white-space: nowrap;
}
.dock-btn[aria-current="page"] .dock-rond { transform: translateY(-4px) scale(1.06); box-shadow: 0 9px 0 var(--encre), 0 0 0 5px rgba(255, 244, 226, 0.35); }
.pastille {
  position: absolute;
  top: -4px;
  right: 6px;
  display: grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--rouge);
  color: var(--creme);
  border: 3px solid var(--encre);
  font-size: 15px;
  font-weight: 700;
  animation: pulser 1.4s ease-in-out infinite;
}

/* ---------- Pompon (personnage vivant) ---------- */
.pompon-place { position: relative; width: var(--taille, 200px); max-width: 100%; aspect-ratio: 1; flex: none; }
.pompon-boite { position: absolute; inset: 0; }
.pompon-ombre {
  position: absolute;
  left: 25%;
  bottom: 1.5%;
  width: 50%;
  height: 7%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(8, 4, 26, 0.5), rgba(8, 4, 26, 0));
  transform-origin: 50% 50%;
}
.pompon-corps { position: absolute; inset: 0; transform-origin: 50% 96%; }
.pompon-respire { width: 100%; height: 100%; transform-origin: 50% 96%; animation: respirer 3.4s ease-in-out infinite; }
.flotte .pompon-respire { animation: flotter 3s ease-in-out infinite; }
.flotte .pompon-ombre { animation: ombre-flotte 3s ease-in-out infinite; }
.pompon { width: 100%; height: 100%; overflow: visible; }
.pompon .y, .pompon .b { display: none; }
.pompon[data-yeux="normal"] .y-normal, .pompon[data-yeux="ecrase"] .y-ecrase, .pompon[data-yeux="content"] .y-content,
.pompon[data-yeux="etourdi"] .y-etourdi, .pompon[data-yeux="dodo"] .y-dodo, .pompon[data-yeux="surpris"] .y-surpris,
.pompon[data-yeux="beurk"] .y-beurk { display: inline; }
.pompon[data-bouche="sourire"] .b-sourire, .pompon[data-bouche="ouverte"] .b-ouverte, .pompon[data-bouche="grand"] .b-grand,
.pompon[data-bouche="ondule"] .b-ondule, .pompon[data-bouche="o"] .b-o, .pompon[data-bouche="beurk"] .b-beurk { display: inline; }
.pompon .regard { transition: transform 0.22s ease-out; }
.pompon .y-normal, .pompon .y-surpris { transform-box: fill-box; transform-origin: center; transition: transform 0.07s; }
.pompon.cligne .y-normal, .pompon.cligne .y-surpris { transform: scaleY(0.1); }
.pompon[data-yeux="etourdi"] .spirale { transform-box: fill-box; transform-origin: center; animation: tourner 0.9s linear infinite; }
.pompon .scintille { transform-box: fill-box; transform-origin: center; animation: scintiller 1.9s ease-in-out infinite; }
.pompon .sd1 { animation-delay: -0.5s; }
.pompon .sd2 { animation-delay: -1s; }
.pompon .sd3 { animation-delay: -1.4s; }
.pompon .aura { transform-box: fill-box; transform-origin: center; animation: tourner 14s linear infinite; }
.pompon .bulle-flotte { transform-box: fill-box; transform-origin: center; animation: flotter-bulle 3.6s ease-in-out infinite; }
.pompon .bulle-flotte.sd1 { animation-delay: -1.2s; }
.pompon .bulle-flotte.sd2 { animation-delay: -2.4s; }
.zzz { position: absolute; top: 4%; right: 6%; width: 30%; height: 34%; pointer-events: none; }
.zzz svg {
  position: absolute;
  bottom: 0;
  left: 10%;
  width: 26%;
  height: auto;
  opacity: 0;
  animation: zzz 2.4s ease-out infinite;
}
.zzz svg:nth-child(2) { animation-delay: 0.8s; left: 36%; width: 32%; }
.zzz svg:nth-child(3) { animation-delay: 1.6s; left: 62%; width: 38%; }

/* ---------- Écran titre ---------- */
.ecran-titre { justify-content: center; gap: clamp(10px, 2.4vh, 26px); text-align: center; padding-bottom: 8px; }
.logo {
  display: flex;
  justify-content: center;
  font-size: clamp(58px, 17vw, 128px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  padding-top: 6px;
}
.logo span {
  display: inline-block;
  text-shadow: 4px 0 0 var(--encre), -4px 0 0 var(--encre), 0 4px 0 var(--encre), 0 -4px 0 var(--encre),
    3px 3px 0 var(--encre), -3px -3px 0 var(--encre), 3px -3px 0 var(--encre), -3px 3px 0 var(--encre), 0 9px 0 var(--encre);
  animation: lettre 2.8s ease-in-out infinite;
}
.logo .l1 { color: var(--citrouille); }
.logo .l2 { color: var(--beurre); animation-delay: 0.12s; }
.logo .l3 { color: var(--gomme); animation-delay: 0.24s; }
.logo .l4 { color: var(--slime); animation-delay: 0.36s; }
.logo .l5 { color: var(--lagon); animation-delay: 0.48s; }
.logo .l6 { color: var(--lilas); animation-delay: 0.6s; }
.logo .l7 { color: var(--citrouille); animation-delay: 0.72s; }
.logo .l8 { color: var(--beurre); animation-delay: 0.84s; }
.sous-titre { font-size: clamp(17px, 4.4vw, 22px); color: var(--texte-doux); font-weight: 600; }
.titre-pompons { display: flex; align-items: flex-end; justify-content: center; gap: clamp(0px, 1vw, 12px); }
.titre-pompons .mini-titre { width: clamp(84px, 24vw, 150px); aspect-ratio: 1; animation: sautiller 1.6s ease-in-out infinite; transform-origin: 50% 96%; }
.titre-pompons .mini-titre.centre { width: clamp(118px, 34vw, 210px); animation-delay: 0.25s; }
.titre-pompons .mini-titre.droite { animation-delay: 0.5s; }
.promesse-courte {
  max-width: 36ch;
  padding: 6px 14px;
  border-radius: 16px;
  background: rgba(16, 26, 56, 0.72);
  font-size: 15px;
  font-weight: 600;
  color: var(--texte-doux);
  text-wrap: balance;
}
.promesse-courte .point { color: var(--beurre); }

/* ---------- Accueil ---------- */
.accueil-pile {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.4vh, 14px);
}
/* La bulle a une place fixe : le Pompon ne bouge jamais quand le texte change. */
.bulle-zone {
  flex: none;
  width: 100%;
  height: calc(3.6em + 34px);
  font-size: clamp(18px, 4.8vw, 24px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.bulle-texte {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.bulle-astuce {
  position: relative;
  max-width: min(94%, 430px);
  max-height: 100%;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 10px 20px;
  border: 3px solid var(--encre);
  border-radius: 26px;
  background: var(--creme);
  color: var(--encre);
  box-shadow: 0 5px 0 var(--encre);
  font-size: 1em;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-wrap: balance;
  cursor: pointer;
  margin-bottom: 14px;
}
.bulle-astuce::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -13px;
  width: 22px;
  height: 22px;
  translate: -50% 0;
  rotate: 45deg;
  background: var(--creme);
  border-right: 3px solid var(--encre);
  border-bottom: 3px solid var(--encre);
}
.bulle-astuce.change { animation: bulle-change 0.35s ease-out; }
.bulle-astuce .icone-voix { flex: none; width: 22px; height: 22px; margin-left: 6px; opacity: 0.55; }
.scene-pompon {
  position: relative;
  --taille: min(66vw, 38vh, 330px);
  width: var(--taille);
  max-width: 100%;
  aspect-ratio: 1;
  touch-action: none;
  cursor: pointer;
  border-radius: 40%;
}
.socle {
  position: absolute;
  left: -16%;
  right: -16%;
  bottom: -9%;
  height: 30%;
  z-index: -1;
  pointer-events: none;
}
.plaque-nom {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--encre);
  border: 3px solid rgba(255, 244, 226, 0.85);
  color: var(--creme);
  font-size: clamp(19px, 5vw, 24px);
  font-weight: 700;
}
.etoiles { display: inline-flex; gap: 2px; }
.etoiles .icone { width: 18px; height: 18px; }
.jauge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: rgba(16, 26, 56, 0.72);
  border: 2px solid rgba(255, 244, 226, 0.35);
}
.jauge .icone { width: 30px; height: 30px; }
.jauge-points { display: flex; gap: 5px; }
.jauge-points i {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--encre);
  background: rgba(255, 244, 226, 0.25);
  transition: background 0.15s, transform 0.15s;
}
.jauge-points i.plein { background: var(--beurre); transform: scale(1.15); }

/* ---------- Œufs ---------- */
/* Ancré en haut : l'œuf ne saute pas quand le texte ou les boutons du dessous changent. */
.ecran-oeufs { justify-content: flex-start; gap: clamp(6px, 1.6vh, 14px); text-align: center; padding-top: clamp(0px, 2.5vh, 28px); }
.oeuf-zone {
  position: relative;
  width: min(64vw, 36vh, 300px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin-top: 8px;
}
.coussin { position: absolute; left: -12%; right: -12%; bottom: -6%; height: 34%; pointer-events: none; }
.oeuf-boite {
  position: relative;
  width: 72%;
  aspect-ratio: 200 / 220;
  margin-bottom: 14%;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  transform-origin: 50% 92%;
  border-radius: 50%;
  touch-action: manipulation;
}
.oeuf-boite svg { width: 100%; height: 100%; overflow: visible; }
.oeuf-boite.attend { animation: oeuf-attend 2.2s ease-in-out infinite; }
.oeuf-boite.pret { animation: oeuf-pret 1.1s ease-in-out infinite; }
.oeuf-boite.vacille { animation: vaciller 0.45s ease-in-out; }
.oeuf-boite .fissure { opacity: 0; transition: opacity 0.12s; }
.oeuf-boite.f1 .fissure-1, .oeuf-boite.f2 .fissure-1, .oeuf-boite.f2 .fissure-2 { opacity: 1; }
.oeuf-boite.verrouille svg { filter: saturate(0.4) brightness(0.75); }
.oeuf-boite .coquille-haut, .oeuf-boite .coquille-bas { transform-box: fill-box; display: none; }
.oeuf-boite.ouvert .coquille-haut, .oeuf-boite.ouvert .coquille-bas { display: inline; }
.oeuf-boite.ouvert .coquille-entiere, .oeuf-boite.ouvert .ombre-oeuf { display: none; }
.oeuf-boite.ouvert .coquille-haut { animation: coquille-haut 0.8s ease-out forwards; transform-origin: 30% 100%; }
.oeuf-boite.ouvert .coquille-bas { animation: coquille-bas 0.9s ease-in forwards; transform-origin: 50% 100%; }
.main-indice {
  position: absolute;
  right: 2%;
  bottom: 22%;
  width: 26%;
  pointer-events: none;
  animation: tapoter 1s ease-in-out infinite;
}
.rayons {
  position: absolute;
  inset: -40%;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, var(--rc, rgba(255, 210, 63, 0.55)) 0deg 9deg, rgba(0, 0, 0, 0) 9deg 24deg);
  -webkit-mask: radial-gradient(closest-side, #000 22%, rgba(0, 0, 0, 0) 70%);
  mask: radial-gradient(closest-side, #000 22%, rgba(0, 0, 0, 0) 70%);
  animation: tourner 12s linear infinite, apparaitre 0.5s ease-out;
  pointer-events: none;
}
.rayons.r0 { --rc: rgba(123, 227, 106, 0.55); }
.rayons.r1 { --rc: rgba(62, 199, 232, 0.6); }
.rayons.r2 { --rc: rgba(169, 139, 255, 0.65); }
.rayons.r3 { --rc: rgba(255, 210, 63, 0.75); }
.eclosion { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.eclosion .pompon-place { --taille: 100%; width: 92%; animation: eclore 0.75s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.oeuf-texte { min-height: 2.6em; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.oeuf-message { font-size: clamp(18px, 4.8vw, 23px); font-weight: 600; max-width: 30ch; text-wrap: balance; }
.nom-eclos {
  font-size: clamp(30px, 8vw, 44px);
  font-weight: 700;
  color: var(--creme);
  text-shadow: var(--contour), 0 6px 0 var(--encre);
}
.etiquettes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.etiquette {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 999px;
  border: 3px solid var(--encre);
  color: var(--encre);
  font-size: 17px;
  font-weight: 700;
  background: var(--creme);
}
.etiquette .icone { width: 18px; height: 18px; }
.etiquette.nouveau { background: var(--rouge); color: var(--creme); animation: pulser 1.2s ease-in-out infinite; }
.etiquette.r0 { background: var(--slime); }
.etiquette.r1 { background: var(--lagon); }
.etiquette.r2 { background: var(--lilas); }
.etiquette.r3 { background: var(--beurre); }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding-bottom: 6px; }
.progres-bonbons { display: flex; align-items: center; gap: 10px; }
.bocal {
  position: relative;
  width: min(220px, 60vw);
  height: 22px;
  border-radius: 999px;
  border: 3px solid var(--encre);
  background: rgba(255, 244, 226, 0.2);
  overflow: hidden;
}
.bocal i { position: absolute; inset: 0 auto 0 0; width: 0%; background: repeating-linear-gradient(-45deg, var(--gomme) 0 10px, #FF8CC4 10px 20px); transition: width 0.5s ease-out; }

/* ---------- Collection ---------- */
.ecran-collection, .ecran-costumes, .ecran-jeux { padding-top: 2px; }
.entete-ecran { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; }
.progres { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.progres .barre { width: min(200px, 46vw); height: 18px; border-radius: 999px; border: 3px solid var(--encre); background: rgba(255, 244, 226, 0.2); overflow: hidden; }
.progres .barre i { display: block; height: 100%; width: 0%; background: var(--lagon); transition: width 0.5s ease-out; }
.defilement {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  touch-action: pan-y;
}
.grille-collection {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 12px;
  width: min(100%, 820px);
  margin: 0 auto;
  padding: 10px 2px 18px;
}
.carte-pompon {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 8px;
  border: 3px solid var(--encre);
  border-radius: 22px;
  background: var(--creme);
  color: var(--encre);
  box-shadow: 0 5px 0 var(--encre);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
  min-width: 0;
}
.carte-pompon:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--encre); }
.carte-pompon .mini { width: 100%; aspect-ratio: 1; }
.carte-pompon .mini svg { width: 100%; height: 100%; overflow: visible; }
.carte-pompon .nom { font-size: 15px; font-weight: 700; line-height: 1.1; text-align: center; overflow-wrap: anywhere; }
.carte-pompon .bande { position: absolute; top: 8px; left: 10px; display: flex; gap: 1px; }
.carte-pompon .bande .icone { width: 13px; height: 13px; }
.carte-pompon.r0 { background: #F1FBEA; }
.carte-pompon.r1 { background: #E6F8FD; }
.carte-pompon.r2 { background: #F1ECFF; }
.carte-pompon.r3 { background: #FFF6D2; }
.carte-pompon.inconnu {
  background: rgba(255, 244, 226, 0.08);
  border: 3px dashed rgba(255, 244, 226, 0.45);
  box-shadow: none;
  color: var(--creme);
  cursor: default;
}
.carte-pompon.inconnu .mini { opacity: 0.5; }
.carte-pompon.inconnu .point-interrogation {
  position: absolute;
  inset: 8px 0 auto;
  display: grid;
  place-items: center;
  aspect-ratio: 1.2;
  font-size: 40px;
  font-weight: 700;
  color: var(--creme);
  text-shadow: var(--contour);
}
.carte-pompon .badge-ami {
  position: absolute;
  top: -10px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--encre);
  background: var(--gomme);
}
.carte-pompon .badge-ami .icone { width: 20px; height: 20px; }
.carte-pompon.choisi { animation: sauter-carte 0.45s ease-out; }
.carte-bientot {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-radius: 22px;
  border: 3px dashed rgba(255, 244, 226, 0.45);
  color: var(--texte-doux);
  font-weight: 600;
}
.carte-bientot .icone { width: 52px; height: 52px; flex: none; }

/* ---------- Costumes ---------- */
.ecran-costumes { gap: 6px; }
.costumes-mise-en-page { flex: 1 1 auto; min-height: 0; width: min(100%, 900px); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cabine { position: relative; display: flex; align-items: center; justify-content: center; gap: 12px; max-width: 100%; }
.cabine .pompon-place { --taille: min(44vw, 25vh, 230px); }
.cabine .projecteur-cabine {
  position: absolute;
  inset: -6% -20% 0;
  z-index: -1;
  background: radial-gradient(50% 55% at 50% 60%, rgba(255, 244, 226, 0.22), rgba(255, 244, 226, 0));
  pointer-events: none;
}
.btn-defile { flex-direction: column; gap: 2px; min-width: 96px; max-width: 136px; padding: 10px 12px; font-size: 18px; white-space: normal; }
.btn-defile .icone { width: 34px; height: 34px; }
.costumes-panneau { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.onglets { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.onglet {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 70px;
  padding: 6px 8px 4px;
  border: 3px solid var(--encre);
  border-radius: 18px;
  background: rgba(255, 244, 226, 0.85);
  color: var(--encre);
  box-shadow: 0 4px 0 var(--encre);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.onglet .icone { width: 34px; height: 34px; }
.onglet[aria-selected="true"] { background: var(--beurre); transform: translateY(-3px); box-shadow: 0 7px 0 var(--encre); }
.grille-objets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  width: min(100%, 640px);
  margin: 0 auto;
  padding: 8px 2px 14px;
}
.carte-objet {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 6px 10px;
  border: 3px solid var(--encre);
  border-radius: 20px;
  background: var(--creme);
  color: var(--encre);
  box-shadow: 0 5px 0 var(--encre);
  cursor: pointer;
  min-width: 0;
  transition: transform 0.08s, box-shadow 0.08s;
}
.carte-objet:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--encre); }
.carte-objet .dessin { width: 70%; aspect-ratio: 1; }
.carte-objet .dessin svg { width: 100%; height: 100%; overflow: visible; }
.carte-objet .nom { font-size: 14px; font-weight: 700; line-height: 1.1; text-align: center; min-height: 2.2em; display: grid; place-items: center; overflow-wrap: anywhere; }
.prix {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 10px 2px 4px;
  border-radius: 999px;
  border: 2.5px solid var(--encre);
  background: var(--beurre);
  font-size: 17px;
  font-weight: 700;
}
.prix .icone { width: 24px; height: 24px; }
.carte-objet.porte { background: #E3F8FD; box-shadow: 0 5px 0 var(--encre), 0 0 0 4px var(--lagon); }
.carte-objet .coche {
  position: absolute;
  top: -10px;
  right: -8px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid var(--encre);
  background: var(--lagon);
}
.carte-objet .coche .icone { width: 20px; height: 20px; }
.carte-objet.confirme { background: #FFF0D6; box-shadow: 0 5px 0 var(--encre), 0 0 0 4px var(--citrouille); animation: pulser-carte 0.9s ease-in-out infinite; }
.carte-objet.confirme .prix { background: var(--citrouille); }
.carte-objet.secoue { animation: secouer 0.45s ease-out; }
.message-costume { min-height: 1.4em; text-align: center; font-weight: 600; color: var(--creme); font-size: 18px; }

/* ---------- Défilé ---------- */
.defile {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  background: radial-gradient(70% 60% at 50% 70%, #4A2E7A 0%, #2A1838 70%, #1A0F26 100%);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.defile .faisceau {
  position: absolute;
  top: -10%;
  width: 46vmax;
  height: 120%;
  background: linear-gradient(180deg, rgba(255, 244, 200, 0.42), rgba(255, 244, 200, 0.05) 80%, rgba(255, 244, 200, 0));
  clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%);
  transform-origin: 50% 0;
  pointer-events: none;
}
.defile .faisceau.f1 { left: 4%; animation: balayer 3.2s ease-in-out infinite alternate; }
.defile .faisceau.f2 { right: 4%; animation: balayer 3.6s ease-in-out infinite alternate-reverse; }
.defile .rideau {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 52%;
  background: repeating-linear-gradient(90deg, #C3203B 0 22px, #E8344E 22px 40px, #A3172F 40px 52px);
  box-shadow: inset 0 -30px 40px rgba(0, 0, 0, 0.35);
  transition: transform 0.9s cubic-bezier(0.6, 0, 0.3, 1);
  border-bottom: 6px solid #FFD23F;
}
.defile .rideau-g { left: 0; border-right: 4px solid var(--encre); }
.defile .rideau-d { right: 0; border-left: 4px solid var(--encre); }
.defile.ouvert .rideau-g { transform: translateX(-88%); }
.defile.ouvert .rideau-d { transform: translateX(88%); }
.defile .lambrequin {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 9%;
  background: radial-gradient(circle at 50% 0, #E8344E 62%, rgba(0, 0, 0, 0) 64%) 0 0 / 80px 100% repeat-x;
  filter: drop-shadow(0 4px 0 #A3172F);
  z-index: 3;
}
.defile .piste {
  position: absolute;
  left: 50%;
  bottom: 6%;
  width: min(120vw, 1100px);
  height: 26%;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, #FF8CC4 0%, #E85FA3 60%, #9E3B7A 100%);
  border: 4px solid var(--encre);
}
.defile-pompon { position: absolute; left: 50%; bottom: 14%; translate: -50% 0; z-index: 2; }
.defile-pompon .pompon-place { --taille: min(56vw, 42vh, 360px); }
.defile-texte {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 12%);
  left: max(16px, env(safe-area-inset-left, 0px));
  right: max(16px, env(safe-area-inset-right, 0px));
  z-index: 4;
  text-align: center;
  font-size: clamp(30px, 8vw, 54px);
  font-weight: 700;
  color: var(--beurre);
  text-shadow: var(--contour), 0 7px 0 var(--encre);
  text-wrap: balance;
  opacity: 0;
  transition: opacity 0.4s, transform 0.4s;
  transform: scale(0.8);
}
.defile-texte.visible { opacity: 1; transform: scale(1); }
.defile .eclair { position: absolute; inset: 0; z-index: 5; background: #FFF8E8; opacity: 0; pointer-events: none; }
.defile .eclair.go { animation: eclair 0.35s ease-out; }
.defile .btn-fermer {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  right: max(16px, env(safe-area-inset-right, 0px));
  z-index: 6;
}

/* ---------- Jeux ---------- */
.ecran-jeux { gap: 6px; }
.cartes-jeux {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 6px 2px 16px;
}
.carte-jeu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 14px 16px;
  border: 3px solid var(--encre);
  border-radius: 26px;
  background: var(--creme);
  color: var(--encre);
  box-shadow: 0 6px 0 var(--encre);
  text-align: center;
  min-width: 0;
}
.carte-jeu .illustration { width: 100%; max-width: 320px; aspect-ratio: 16 / 9; border-radius: 18px; border: 3px solid var(--encre); overflow: hidden; }
.carte-jeu .illustration > svg { width: 100%; height: 100%; }
.carte-jeu h3 { font-size: 25px; font-weight: 700; }
.carte-jeu p { font-size: 17px; font-weight: 500; max-width: 30ch; }
.carte-jeu .record { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 16px; color: #6A4A8C; }
.carte-jeu .record .icone { width: 22px; height: 22px; }
.niveaux { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn-niveau { flex-direction: column; gap: 2px; min-width: 84px; padding: 8px 12px; }
.btn-niveau .cartes-mini { display: grid; grid-template-columns: repeat(3, 10px); gap: 3px; }
.btn-niveau .cartes-mini.c4 { grid-template-columns: repeat(4, 10px); }
.btn-niveau .cartes-mini i { width: 10px; height: 13px; border-radius: 3px; background: var(--encre); }
.btn-niveau span { font-size: 15px; }

/* HUD des mini-jeux */
.hud { display: flex; align-items: center; gap: 12px; width: min(100%, 760px); padding-block: 2px 8px; }
.minuterie { flex: 1 1 auto; height: 26px; border-radius: 999px; border: 3px solid var(--encre); background: rgba(255, 244, 226, 0.18); overflow: hidden; }
.minuterie i {
  display: block;
  height: 100%;
  width: 100%;
  background: repeating-linear-gradient(-45deg, #FF4D5E 0 12px, #FFF4E2 12px 24px);
  transform-origin: 0 50%;
}
.minuterie.presse i { animation: clignoter 0.5s steps(2) infinite; }
.score-jeu { display: inline-flex; align-items: center; gap: 6px; height: 50px; padding: 0 16px 0 6px; border-radius: 999px; border: 3px solid var(--encre); background: var(--creme); color: var(--encre); font-size: 25px; font-weight: 700; box-shadow: 0 4px 0 var(--encre); font-variant-numeric: tabular-nums; min-width: 88px; }
.score-jeu .icone { width: 38px; height: 38px; }
.zone-jeu { position: relative; flex: 1 1 auto; min-height: 0; width: 100%; touch-action: none; }
.zone-jeu canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.compte-rebours {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: clamp(90px, 30vw, 200px);
  font-weight: 700;
  color: var(--beurre);
  text-shadow: 6px 0 0 var(--encre), -6px 0 0 var(--encre), 0 6px 0 var(--encre), 0 -6px 0 var(--encre),
    4px 4px 0 var(--encre), -4px -4px 0 var(--encre), 4px -4px 0 var(--encre), -4px 4px 0 var(--encre), 0 12px 0 var(--encre);
  pointer-events: none;
}
.compte-rebours span { animation: compte 0.8s ease-out both; }
.consigne-jeu {
  position: absolute;
  left: 50%;
  top: 8%;
  translate: -50% 0;
  width: min(92%, 420px);
  padding: 10px 16px;
  border-radius: 22px;
  border: 3px solid var(--encre);
  background: var(--creme);
  color: var(--encre);
  box-shadow: 0 5px 0 var(--encre);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}
.consigne-jeu .exemples { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 6px; }
.consigne-jeu .exemples svg { width: 44px; height: 44px; }
.consigne-jeu .exemples .non { position: relative; }
.consigne-jeu .exemples .non::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; border: 4px solid var(--rouge); background: linear-gradient(45deg, rgba(0, 0, 0, 0) 45%, var(--rouge) 45% 55%, rgba(0, 0, 0, 0) 55%); }

.plateau-zone { flex: 1 1 auto; min-height: 0; width: 100%; display: grid; place-items: center; }
.plateau { display: grid; gap: var(--ecart, 12px); grid-template-columns: repeat(var(--colonnes, 3), var(--carte-l, 90px)); }
.carte-paire {
  width: var(--carte-l, 90px);
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 0;
  background: none;
  perspective: 700px;
  cursor: pointer;
  border-radius: 18px;
}
.carte-paire .interieur { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 0.38s ease-out; }
.carte-paire.retournee .interieur, .carte-paire.trouvee .interieur { transform: rotateY(180deg); }
.carte-paire .face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 3px solid var(--encre);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--encre);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.carte-paire .dos {
  background: repeating-linear-gradient(45deg, #8C6BF0 0 12px, var(--lilas) 12px 24px);
  color: var(--creme);
  font-size: calc(var(--carte-l, 90px) * 0.48);
  font-weight: 700;
  text-shadow: var(--contour);
}
.carte-paire .devant { transform: rotateY(180deg); background: var(--creme); }
.carte-paire .devant svg { width: 78%; height: 78%; }
.carte-paire .fond-lanterne { background: #FFE7CC; }
.carte-paire .fond-bonbon { background: #FFE0F0; }
.carte-paire .fond-sucette { background: #DDF6FD; }
.carte-paire .fond-etoile { background: #FFF6CC; }
.carte-paire .fond-lune { background: #E8E2FF; }
.carte-paire .fond-gateau { background: #E4F9E0; }
.carte-paire.trouvee .devant { box-shadow: 0 4px 0 var(--encre), 0 0 0 4px var(--slime); }
.carte-paire.trouvee .interieur { animation: bravo-carte 0.5s ease-out 0.38s; }
.carte-paire.non .interieur { animation: non-carte 0.4s ease-out 0.2s; }

/* Résultats (mini-jeux) */
.resultats {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(14, 18, 44, 0.55);
  animation: apparaitre 0.3s ease-out;
}
.carte-resultats {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(100%, 420px);
  padding: 18px 18px 20px;
  border: 3px solid var(--encre);
  border-radius: 28px;
  background: var(--creme);
  color: var(--encre);
  box-shadow: 0 7px 0 var(--encre);
  text-align: center;
  animation: eclore 0.55s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.carte-resultats h2 { font-size: clamp(32px, 9vw, 44px); font-weight: 700; color: var(--citrouille); text-shadow: 2px 2px 0 var(--encre); }
.carte-resultats .pompon-place { --taille: min(36vw, 22vh, 170px); }
.carte-resultats .gros-chiffre { display: inline-flex; align-items: center; gap: 8px; font-size: 44px; font-weight: 700; }
.carte-resultats .gros-chiffre .icone { width: 52px; height: 52px; }
.carte-resultats p { font-size: 19px; font-weight: 600; }
.carte-resultats .record-neuf { display: inline-flex; align-items: center; gap: 6px; padding: 4px 14px; border-radius: 999px; background: var(--beurre); border: 3px solid var(--encre); font-weight: 700; }
.carte-resultats .record-neuf .icone { width: 22px; height: 22px; }

/* ---------- Coin des parents ---------- */
.ecran-parents { justify-content: center; padding-block: 6px 12px; }
.carte-parents {
  display: flex;
  flex-direction: column;
  width: min(100%, 760px);
  max-height: 100%;
  min-height: 0;
  border: 3px solid var(--encre);
  border-radius: 28px;
  background: var(--creme);
  color: var(--encre);
  box-shadow: 0 7px 0 var(--encre);
  overflow: hidden;
  -webkit-user-select: text;
  user-select: text;
}
.barriere { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px 18px 18px; text-align: center; }
.barriere .icone-grande { width: 54px; height: 54px; }
.barriere h2 { font-size: 26px; font-weight: 700; }
.barriere .intro { font-size: 17px; max-width: 34ch; color: #4B3A5E; }
.barriere .question { font-size: 23px; font-weight: 700; color: var(--encre); }
.saisie { display: flex; gap: 10px; }
.saisie span {
  display: grid;
  place-items: center;
  width: 54px;
  height: 62px;
  border-radius: 14px;
  border: 3px solid var(--encre);
  background: #FFFFFF;
  font-size: 32px;
  font-weight: 700;
}
.saisie.erreur { animation: secouer 0.45s ease-out; }
.clavier { display: grid; grid-template-columns: repeat(3, 72px); gap: 10px; }
.touche {
  height: 60px;
  border: 3px solid var(--encre);
  border-radius: 16px;
  background: var(--lagon);
  color: var(--encre);
  box-shadow: 0 4px 0 var(--encre);
  font-size: 27px;
  font-weight: 700;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.touche:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--encre); }
.touche .icone { width: 30px; height: 30px; }
.touche.vide { visibility: hidden; }
.barriere .erreur-texte { min-height: 1.3em; color: #B3123A; font-weight: 700; font-size: 16px; }
.barriere-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.parents-entete {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 14px 16px 10px;
  border-bottom: 3px solid var(--encre);
  background: var(--creme-2);
}
.parents-entete > .icone { width: 40px; height: 40px; flex: none; }
.parents-entete h2 { flex: 1 1 150px; font-size: clamp(19px, 5vw, 23px); font-weight: 700; min-width: 0; line-height: 1.15; }
.parents-entete .btn { flex: none; white-space: nowrap; }
.onglets-parents { display: flex; gap: 8px; padding: 10px 14px; overflow-x: auto; scrollbar-width: none; border-bottom: 2px solid rgba(42, 24, 56, 0.15); flex: none; }
.onglets-parents::-webkit-scrollbar { display: none; }
.onglet-parents {
  flex: none;
  padding: 8px 14px;
  border: 2.5px solid var(--encre);
  border-radius: 999px;
  background: #FFFFFF;
  color: var(--encre);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.onglet-parents[aria-selected="true"] { background: var(--encre); color: var(--creme); }
.panneau-parents { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 18px 22px; touch-action: pan-y; }
.reglages { display: flex; flex-direction: column; gap: 4px; }
.reglage { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding: 12px 0; border-bottom: 2px solid rgba(42, 24, 56, 0.12); }
.reglage:last-child { border-bottom: 0; }
.reglage-texte { flex: 1 1 170px; min-width: 0; }
.reglage-nom { display: block; font-size: 18px; font-weight: 700; }
.reglage-aide { display: block; font-size: 15px; color: #5A4A6E; margin-top: 2px; }
.segments { display: inline-flex; border: 2.5px solid var(--encre); border-radius: 999px; overflow: hidden; flex: none; }
.segment {
  padding: 8px 16px;
  border: 0;
  background: #FFFFFF;
  color: var(--encre);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  min-height: 44px;
}
.segment + .segment { border-left: 2.5px solid var(--encre); }
.segment[aria-pressed="true"] { background: var(--encre); color: var(--creme); }
.interrupteur {
  position: relative;
  flex: none;
  width: 64px;
  height: 38px;
  border-radius: 999px;
  border: 2.5px solid var(--encre);
  background: #D9D0E3;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s;
}
.interrupteur::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 2.5px solid var(--encre);
  background: #FFFFFF;
  transition: transform 0.18s ease-out;
}
.interrupteur[aria-checked="true"] { background: var(--slime); }
.interrupteur[aria-checked="true"]::after { transform: translateX(26px); }
.temps-jour { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; }
.temps-jour .icone { width: 26px; height: 26px; }
.zone-danger { margin-top: 10px; padding: 14px; border-radius: 18px; border: 2.5px dashed #C23B5A; background: #FFF0F0; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.zone-danger .rangee { display: flex; flex-wrap: wrap; gap: 10px; }
.btn-danger { background: #FF8A9A; }
.message-parents { min-height: 1.3em; font-weight: 700; color: #1E7A3A; }
.installer { margin-top: 10px; padding: 14px; border-radius: 18px; border: 2.5px solid var(--encre); background: #E6F8FD; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.installer ol { margin: 0; padding-left: 1.3em; font-size: 16px; }

/* ---------- Installation depuis l'écran titre ---------- */
.voile.voile-feuille { place-items: end center; padding: max(10px, env(safe-area-inset-top, 0px)) 10px 0; }
.feuille-installer {
  position: relative;
  width: min(100%, 480px);
  max-height: calc(100dvh - 30px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 20px calc(18px + env(safe-area-inset-bottom, 0px));
  border: 3px solid var(--encre);
  border-bottom: none;
  border-radius: 28px 28px 0 0;
  background: var(--creme);
  color: var(--encre);
  box-shadow: 0 -7px 0 rgba(0, 0, 0, 0.25);
  text-align: center;
  animation: glisser-feuille 0.35s ease-out;
}
@keyframes glisser-feuille { from { transform: translateY(70px); opacity: 0; } to { transform: none; opacity: 1; } }
.feuille-fermer { position: absolute; top: 12px; right: 12px; width: 46px; height: 46px; }
.feuille-fermer .icone { width: 24px; height: 24px; }
.feuille-icone-titre { display: grid; place-items: center; width: 74px; height: 74px; border-radius: 22px; background: #E6F8FD; border: 2.5px solid var(--encre); }
.feuille-icone-titre .icone { width: 48px; height: 48px; }
.feuille-installer h2 { font-size: clamp(24px, 6.4vw, 30px); font-weight: 700; }
.feuille-intro { font-size: 16.5px; line-height: 1.4; color: #4B3A5E; max-width: 34ch; }
.etapes-installer { list-style: none; margin: 2px 0 4px; padding: 0; display: flex; flex-direction: column; gap: 10px; width: 100%; }
.etapes-installer li { display: flex; align-items: center; gap: 12px; text-align: left; background: #FFFFFF; border: 2.5px solid var(--encre); border-radius: 18px; padding: 10px 12px; }
.etape-visuel { flex: none; width: 58px; height: 58px; display: grid; place-items: center; border-radius: 14px; background: #E6F8FD; border: 2px solid rgba(42, 24, 56, 0.18); }
.etape-visuel .icone { width: 40px; height: 40px; }
.etape-texte { display: flex; align-items: center; gap: 9px; font-size: 17px; font-weight: 600; line-height: 1.3; }
.etape-num { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--citrouille); border: 2px solid var(--encre); font-size: 15px; font-weight: 700; }
.texte-legal { font-size: 16px; line-height: 1.55; color: #33223F; max-width: 68ch; }
.texte-legal h3 { font-size: 19px; font-weight: 700; color: var(--encre); margin: 18px 0 6px; }
.texte-legal h3:first-child { margin-top: 0; }
.texte-legal p { margin: 0 0 8px; }
.texte-legal ul { margin: 0 0 10px; padding-left: 1.25em; }
.texte-legal li { margin-bottom: 4px; }
.texte-legal .date { font-size: 14px; color: #6A5A7E; margin-bottom: 12px; }
.texte-legal .en-bref { padding: 12px 14px; border-radius: 16px; background: #F1FBEA; border: 2.5px solid #4FA83B; margin-bottom: 12px; }
.texte-legal .en-bref ul { margin-bottom: 0; }
.promesses { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; margin-bottom: 14px; }
.promesse {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border-radius: 18px;
  border: 2.5px solid var(--encre);
  background: #FFFFFF;
}
.promesse .icone { width: 40px; height: 40px; flex: none; }
.promesse strong { display: block; font-size: 17px; }
.promesse span { display: block; font-size: 15px; color: #4B3A5E; margin-top: 2px; }
.courriel-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 10px; }
.courriel { font-weight: 700; padding: 6px 12px; border-radius: 12px; background: #FFFFFF; border: 2px solid rgba(42, 24, 56, 0.25); -webkit-user-select: all; user-select: all; overflow-wrap: anywhere; }

/* ---------- Pause ---------- */
.voile {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding-top: max(16px, env(safe-area-inset-top, 0px));
  padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--voile);
  animation: apparaitre 0.4s ease-out;
  overflow-y: auto;
}
.carte-pause {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(100%, 460px);
  padding: 18px;
  border: 3px solid var(--encre);
  border-radius: 28px;
  background: var(--creme);
  color: var(--encre);
  box-shadow: 0 7px 0 var(--encre);
  text-align: center;
}
.carte-pause h2 { font-size: clamp(26px, 7vw, 32px); font-weight: 700; }
.carte-pause .pompon-place { --taille: min(42vw, 24vh, 190px); }
.idees-pause { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; padding: 0; margin: 0; list-style: none; }
.idees-pause li { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 92px; font-weight: 700; font-size: 15px; }
.idees-pause .icone { width: 54px; height: 54px; }
.carte-pause .barriere { padding: 6px 0 0; }

/* ---------- Effets ---------- */
.toile-effets { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 60; pointer-events: none; }
.bonbon-volant { position: fixed; left: 0; top: 0; z-index: 61; width: 42px; height: 42px; pointer-events: none; }
.bonbon-volant svg { width: 100%; height: 100%; }

/* ---------- Animations ---------- */
@keyframes entrer { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes apparaitre { from { opacity: 0; } to { opacity: 1; } }
@keyframes briller { 0%, 100% { opacity: 0.35; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes flotter-lune { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(8px) rotate(2deg); } }
@keyframes derive { from { transform: translateX(-30vw); } to { transform: translateX(130vw); } }
@keyframes voler-chauve {
  0% { transform: translate(-80px, 0) scale(0.8); opacity: 0; }
  4% { opacity: 0.9; }
  25% { transform: translate(30vw, -30px) scale(0.85); }
  50% { transform: translate(60vw, 20px) scale(0.75); opacity: 0.9; }
  56% { opacity: 0; transform: translate(70vw, -10px) scale(0.7); }
  100% { opacity: 0; transform: translate(110vw, 0) scale(0.7); }
}
@keyframes battre { from { transform: scaleY(1); } to { transform: scaleY(0.45); } }
@keyframes vaciller-lueur { 0%, 100% { opacity: 0.85; } 40% { opacity: 1; } 55% { opacity: 0.7; } 70% { opacity: 0.95; } }
@keyframes respirer { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.018, 0.976); } }
@keyframes flotter { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6%); } }
@keyframes ombre-flotte { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.8); opacity: 0.7; } }
@keyframes tourner { to { transform: rotate(360deg); } }
@keyframes scintiller { 0%, 100% { opacity: 0.4; transform: scale(0.7) rotate(0deg); } 50% { opacity: 1; transform: scale(1.15) rotate(20deg); } }
@keyframes flotter-bulle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes zzz { 0% { opacity: 0; transform: translate(0, 0) scale(0.6); } 25% { opacity: 1; } 100% { opacity: 0; transform: translate(18px, -60px) scale(1.2); } }
@keyframes lettre { 0%, 100% { transform: translateY(0) rotate(0deg); } 30% { transform: translateY(-9%) rotate(-4deg); } 60% { transform: translateY(2%) rotate(3deg); } }
@keyframes sautiller { 0%, 100% { transform: translateY(0) scale(1, 1); } 30% { transform: translateY(-9%) scale(0.97, 1.04); } 55% { transform: translateY(0) scale(1.06, 0.94); } 75% { transform: translateY(0) scale(0.99, 1.01); } }
@keyframes bosse { 0% { transform: scale(1); } 40% { transform: scale(1.16); } 100% { transform: scale(1); } }
@keyframes secouer-doux { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes secouer { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-9px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-6px); } 80% { transform: translateX(4px); } }
@keyframes pulser { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes pulser-carte { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes bulle-change { 0% { transform: scale(0.9); opacity: 0.4; } 60% { transform: scale(1.04); opacity: 1; } 100% { transform: scale(1); } }
@keyframes oeuf-attend { 0%, 100% { transform: rotate(0deg); } 88% { transform: rotate(0deg); } 92% { transform: rotate(-5deg); } 96% { transform: rotate(4deg); } }
@keyframes oeuf-pret { 0%, 100% { transform: rotate(0deg) scale(1); } 25% { transform: rotate(-3deg) scale(1.02); } 75% { transform: rotate(3deg) scale(1.02); } }
@keyframes vaciller { 0%, 100% { transform: rotate(0deg) scale(1); } 20% { transform: rotate(-11deg) scale(1.04, 0.97); } 45% { transform: rotate(9deg) scale(0.98, 1.03); } 70% { transform: rotate(-5deg); } 85% { transform: rotate(3deg); } }
@keyframes coquille-haut { 0% { transform: translate(0, 0) rotate(0deg); opacity: 1; } 100% { transform: translate(-40%, -90%) rotate(-55deg); opacity: 0; } }
@keyframes coquille-bas { 0% { transform: translate(0, 0); opacity: 1; } 60% { opacity: 1; } 100% { transform: translate(0, 30%) scale(0.9); opacity: 0; } }
@keyframes tapoter { 0%, 100% { transform: translate(0, 0) rotate(-12deg); } 50% { transform: translate(-10%, -12%) rotate(-12deg) scale(0.92); } }
@keyframes eclore { 0% { transform: scale(0.2); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
@keyframes sauter-carte { 0% { transform: translateY(0); } 40% { transform: translateY(-10px) scale(1.04); } 100% { transform: translateY(0); } }
@keyframes balayer { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
@keyframes eclair { 0% { opacity: 0; } 15% { opacity: 0.55; } 100% { opacity: 0; } }
@keyframes clignoter { 50% { opacity: 0.45; } }
@keyframes compte { 0% { transform: scale(2.2); opacity: 0; } 30% { transform: scale(1); opacity: 1; } 80% { opacity: 1; } 100% { transform: scale(0.8); opacity: 0; } }
@keyframes bravo-carte { 0% { transform: rotateY(180deg) scale(1); } 50% { transform: rotateY(180deg) scale(1.12); } 100% { transform: rotateY(180deg) scale(1); } }
@keyframes non-carte { 0%, 100% { transform: rotateY(180deg) translateX(0); } 30% { transform: rotateY(180deg) translateX(-6px); } 60% { transform: rotateY(180deg) translateX(6px); } }

/* Animations réduites : le réglage du coin des parents ou celui de l'appareil. */
.anim-reduites .decor *, .anim-reduites .logo span, .anim-reduites .titre-pompons .mini-titre,
.anim-reduites .pompon-respire, .anim-reduites .pompon-ombre, .anim-reduites .pompon .scintille, .anim-reduites .pompon .aura,
.anim-reduites .pompon .bulle-flotte, .anim-reduites .rayons, .anim-reduites .pastille, .anim-reduites .oeuf-boite.attend,
.anim-reduites .oeuf-boite.pret, .anim-reduites .main-indice, .anim-reduites .etiquette.nouveau, .anim-reduites .carte-objet.confirme,
.anim-reduites .defile .faisceau, .anim-reduites .minuterie.presse i, .anim-reduites .zzz svg, .anim-reduites .pompon[data-yeux="etourdi"] .spirale {
  animation: none !important;
}
.anim-reduites .zzz svg { opacity: 1; }
.anim-reduites .zzz svg:nth-child(2) { transform: translateY(-40%); }
.anim-reduites .zzz svg:nth-child(3) { transform: translateY(-85%); }
.anim-reduites .chauve-souris, .anim-reduites .nuage { display: none; }
.anim-reduites .ecran, .anim-reduites .resultats, .anim-reduites .voile, .anim-reduites .feuille-installer, .anim-reduites .carte-resultats, .anim-reduites .eclosion .pompon-place { animation-duration: 0.01s !important; }
.anim-reduites .carte-paire .interieur { transition-duration: 0.01s; }
.anim-reduites .defile .rideau { transition-duration: 0.01s; }

/* ---------- Écrans larges et paysage ---------- */
@media (min-width: 760px) {
  .dock-nom { font-size: 17px; }
  .titre-ecran { padding-top: 6px; }
}
@media (min-width: 600px) and (min-aspect-ratio: 5/4) {
  .costumes-mise-en-page { flex-direction: row; align-items: stretch; gap: 26px; }
  .cabine { flex: 0 0 auto; align-self: center; flex-direction: column; align-items: center; }
  .cabine .pompon-place { --taille: min(30vw, 44vh, 320px); }
  .btn-defile { flex-direction: row; max-width: none; padding: 10px 22px; font-size: 21px; }
  .costumes-panneau { flex: 1 1 auto; min-width: 0; }
}
/* Grands écrans (ordinateur, grande tablette) : tout grossit un peu. */
@media (min-width: 1100px) and (min-height: 760px) {
  .scene-pompon { --taille: min(46vh, 420px); }
  .dock-rond { width: 82px; }
  .dock-btn { width: 100px; }
  .grille-collection { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); width: min(100%, 960px); gap: 16px; }
  .carte-pompon .nom { font-size: 17px; }
  .grille-objets { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); width: min(100%, 760px); gap: 16px; }
  .carte-objet .nom { font-size: 16px; }
  .onglet { min-width: 92px; font-size: 16px; }
  .onglet .icone { width: 42px; height: 42px; }
  .cabine .pompon-place { --taille: min(30vw, 46vh, 380px); }
  .oeuf-zone { width: min(40vh, 340px); }
  .cartes-jeux { width: min(100%, 900px); }
  .carte-jeu .illustration { max-width: 380px; }
}
/* Cellulaire couché : le menu passe à droite pour garder de la hauteur au jeu. */
@media (max-height: 560px) and (orientation: landscape) {
  .app { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); column-gap: 8px; }
  .lune { top: calc(env(safe-area-inset-top, 0px) + 58px); right: max(120px, calc(env(safe-area-inset-right, 0px) + 110px)); width: 56px; }
  .barre-haut { grid-column: 1 / -1; min-height: 54px; padding-block: 4px; }
  .scene { grid-column: 1; grid-row: 2; }
  .dock { grid-column: 2; grid-row: 2; flex-direction: column; justify-content: center; align-items: center; gap: 2px; padding-block: 0 6px; }
  .dock-btn { width: 74px; gap: 2px; }
  .compteur { height: 42px; font-size: 21px; }
  .compteur .icone { width: 32px; height: 32px; }
  .dock-rond { width: 48px; box-shadow: 0 4px 0 var(--encre); }
  .dock-nom { font-size: 12px; }
  .pastille { min-width: 22px; height: 22px; font-size: 13px; top: -6px; right: 8px; }
  .titre-ecran { font-size: 24px; padding-block: 0 4px; }
  .ecran-oeufs { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto 1fr auto 1fr; justify-items: center; column-gap: 24px; row-gap: 6px; padding-top: 0; }
  .ecran-oeufs .titre-ecran { grid-column: 1 / -1; grid-row: 1; }
  .ecran-oeufs .oeuf-zone { grid-column: 1; grid-row: 2 / 5; align-self: center; width: min(34vw, 50vh, 220px); margin-top: 0; }
  .ecran-oeufs .oeuf-texte { grid-column: 2; grid-row: 2; align-self: end; }
  .ecran-oeufs .actions { grid-column: 2; grid-row: 3; align-self: start; }
  .accueil-pile { display: grid; grid-template-columns: auto minmax(0, 340px); grid-template-rows: auto auto auto; column-gap: 22px; row-gap: 8px; align-content: center; justify-content: center; }
  .accueil-pile .scene-pompon { grid-column: 1; grid-row: 1 / 4; align-self: center; --taille: min(36vw, 52vh, 250px); }
  .accueil-pile .bulle-zone { grid-column: 2; grid-row: 1; font-size: 17px; justify-content: flex-start; }
  .accueil-pile .bulle-astuce { padding: 6px 14px; }
  .accueil-pile .plaque-nom { grid-column: 2; grid-row: 2; justify-self: start; }
  .accueil-pile .jauge { grid-column: 2; grid-row: 3; justify-self: start; }
  .ecran-titre { gap: 8px; }
  .logo { font-size: clamp(44px, 12vh, 80px); }
  .titre-pompons .mini-titre { width: clamp(60px, 18vh, 110px); }
  .titre-pompons .mini-titre.centre { width: clamp(80px, 26vh, 150px); }
  .btn-grand { min-height: 60px; font-size: 26px; }
  .cabine .pompon-place { --taille: min(28vw, 46vh, 200px); }
  .cartes-jeux { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .carte-jeu .illustration { max-width: 240px; }
  .nom-eclos { font-size: 28px; }
}
@media (max-width: 370px) {
  .dock { gap: 4px; }
  .dock-btn { width: 74px; }
  .dock-nom { font-size: 14px; }
  .btn-parents span { display: none; }
  .btn-parents { padding: 0 10px; }
  .btn { font-size: 19px; padding-inline: 18px; }
  .clavier { grid-template-columns: repeat(3, 64px); }
}
