/* La Maison — feuille de style unique.
   Identité : nuit violette, accents « bonbon » (corail, soleil, menthe),
   formes très arrondies, typographie arrondie du système. */

:root {
  --fond: #f6f3ff;
  --fond-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #efeaff;
  --texte: #1b1530;
  --texte-doux: #6a6385;
  --bordure: #e3dcf7;
  --ombre: 0 8px 24px rgba(40, 20, 90, .10);
  --ombre-forte: 0 18px 40px rgba(40, 20, 90, .22);
  --accent: #ff5f45;
  --accent-2: #ffc93c;
  --menthe: #19c37d;
  --ciel: #2f9bff;
  --danger: #e5484d;
  --attention: #f59e0b;
  --perso: #7c5cff;
  --nuit: #120d24;
  --nuit-2: #1d1638;
  --rayon: 22px;
  --rayon-s: 14px;
  --police: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --haut-sur: env(safe-area-inset-top, 0px);
  --bas-sur: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #0f0b1e;
    --fond-2: #161029;
    --surface: #1d1636;
    --surface-2: #271e48;
    --texte: #f4f1ff;
    --texte-doux: #a59fc4;
    --bordure: #2e2552;
    --ombre: 0 8px 24px rgba(0, 0, 0, .35);
    --ombre-forte: 0 18px 40px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #0f0b1e; --fond-2: #161029; --surface: #1d1636; --surface-2: #271e48;
  --texte: #f4f1ff; --texte-doux: #a59fc4; --bordure: #2e2552;
  --ombre: 0 8px 24px rgba(0, 0, 0, .35); --ombre-forte: 0 18px 40px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police);
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
a { color: inherit; }

/* L'écran « Qui est-ce ? » reste sombre, quel que soit le thème. */
html[data-ecran="qui"] body, html[data-role="aucun"] body { background: var(--nuit); color: #fff; }

.demarrage { min-height: 100vh; display: grid; place-items: center; background: var(--nuit); }
.centre { min-height: 70vh; display: grid; place-items: center; align-content: center; gap: 16px; text-align: center; padding: 24px; }

/* ---------- Logo ---------- */
.logo-maison {
  font-weight: 900; font-size: 30px; letter-spacing: -.5px;
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 60%, #ff8fd8);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  display: inline-flex; align-items: center; gap: 8px;
}
.logo-maison::before {
  content: ""; width: 26px; height: 26px; flex: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  clip-path: polygon(50% 0, 100% 42%, 88% 42%, 88% 100%, 12% 100%, 12% 42%, 0 42%);
  border-radius: 4px;
}

/* ---------- Qui est-ce ? ---------- */
.qui {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  padding: calc(32px + var(--haut-sur)) 16px calc(32px + var(--bas-sur));
  background: radial-gradient(1200px 600px at 50% -10%, #3a2378 0%, transparent 60%), var(--nuit);
  color: #fff;
}
.qui-titre { font-size: clamp(28px, 7vw, 44px); font-weight: 800; }
.qui-enfants { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(14px, 4vw, 34px); }
.qui-parents { display: flex; justify-content: center; gap: 24px; }
.tuile { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #cfc8ef; transition: color .2s; }
.tuile-image {
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--couleur) 70%, #fff), var(--couleur) 70%);
  border-radius: 28%; box-shadow: 0 12px 30px color-mix(in srgb, var(--couleur) 45%, transparent);
  transition: transform .25s cubic-bezier(.3, 1.6, .5, 1), box-shadow .25s, outline-color .2s;
  outline: 3px solid transparent; outline-offset: 4px;
}
.tuile-grande .tuile-image { width: clamp(96px, 26vw, 150px); aspect-ratio: 1; }
.tuile-grande .tuile-emoji { font-size: clamp(48px, 13vw, 76px); }
.tuile-petite .tuile-image { width: 72px; aspect-ratio: 1; }
.tuile-petite .tuile-emoji { font-size: 36px; }
.tuile-nom { font-weight: 700; font-size: 18px; }
.tuile-petite .tuile-nom { font-size: 15px; }
.tuile:hover, .tuile:focus-visible { color: #fff; }
.tuile:hover .tuile-image, .tuile:focus-visible .tuile-image { transform: scale(1.08); outline-color: #fff; }
.tuile:active .tuile-image { transform: scale(.94); }
.qui-admin { color: #6f6797; font-size: 13px; text-decoration: underline; margin-top: 12px; padding: 8px; }

.saisie {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: calc(24px + var(--haut-sur)) 24px calc(24px + var(--bas-sur));
  background: radial-gradient(900px 500px at 50% 0%, color-mix(in srgb, var(--couleur) 45%, transparent), transparent 70%), var(--nuit);
  color: #fff; opacity: 0; transform: scale(1.06); transition: opacity .3s, transform .35s cubic-bezier(.2, 1.2, .4, 1);
}
.saisie.visible { opacity: 1; transform: none; }
.saisie.reussi { opacity: 0; transform: scale(.9); }
.saisie.secoue .pave-points, .saisie.secoue .saisie-form { animation: secoue .45s; }
.saisie.occupe { pointer-events: none; }
.saisie.occupe .pave-points i.plein { animation: pulse .7s infinite alternate; }
.saisie-retour { position: absolute; top: calc(16px + var(--haut-sur)); left: 16px; font-size: 26px; width: 48px; height: 48px; border-radius: 50%; background: #ffffff14; }
.saisie-profil { display: flex; flex-direction: column; align-items: center; gap: 10px; animation: entree .45s cubic-bezier(.2, 1.4, .4, 1); }
.saisie-profil .tuile-image { width: 96px; aspect-ratio: 1; }
.saisie-profil .tuile-emoji { font-size: 50px; }
.saisie-message { margin: 0; color: #cfc8ef; min-height: 1.4em; text-align: center; }
.saisie-message.erreur { color: #ff9b8a; font-weight: 700; }
.pave-points { display: flex; gap: 18px; }
.pave-points i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #ffffff88; transition: background .15s, transform .15s; }
.pave-points i.plein { background: #fff; border-color: #fff; transform: scale(1.1); }
.pave { display: grid; grid-template-columns: repeat(3, 76px); gap: 16px; animation: entree .5s .05s both cubic-bezier(.2, 1.4, .4, 1); }
.pave-touche { width: 76px; height: 76px; border-radius: 50%; background: #ffffff16; font-size: 30px; font-weight: 600; transition: background .15s, transform .1s; }
.pave-touche:active { background: var(--couleur); transform: scale(.92); }
.pave-effacer { background: transparent; font-size: 24px; }
.saisie-form { display: flex; flex-direction: column; gap: 14px; width: min(340px, 100%); animation: entree .5s .05s both cubic-bezier(.2, 1.4, .4, 1); }
.champ-sombre { background: #ffffff14 !important; border-color: #ffffff30 !important; color: #fff !important; }

@keyframes secoue { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
@keyframes pulse { to { opacity: .35; } }
@keyframes entree { from { opacity: 0; transform: translateY(24px) scale(.96); } }

/* ---------- Mise en page générale ---------- */
.ecran { min-height: 100vh; padding-bottom: calc(96px + var(--bas-sur)); }
.page { padding: calc(16px + var(--haut-sur)) 16px 24px; max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.page.etroite { max-width: 480px; }
.page-titre { display: flex; align-items: center; gap: 12px; }
.page-titre h1 { font-size: 26px; font-weight: 800; flex: 1; }
.retour { width: 42px; height: 42px; border-radius: 50%; background: var(--surface); box-shadow: var(--ombre); font-size: 20px; flex: none; }
.vide { color: var(--texte-doux); text-align: center; padding: 18px; }
.petit { font-size: 13px; color: var(--texte-doux); }
.section-titre { font-size: 19px; font-weight: 800; margin: 6px 0 -6px; display: flex; align-items: center; gap: 8px; }

/* Barre du haut (enfant) */
.barre-haut {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(10px + var(--haut-sur)) 16px 10px;
  background: color-mix(in srgb, var(--fond) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.barre-haut .logo-maison { font-size: 20px; flex: 1; }
.barre-haut .logo-maison::before { width: 20px; height: 20px; }
.pastille {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  background: var(--surface); box-shadow: var(--ombre); font-weight: 700; font-size: 14px; white-space: nowrap;
}
.pastille-tirelire { background: linear-gradient(135deg, #ffe7a3, #ffc93c); color: #4a3200; }
.pastille-serie { background: linear-gradient(135deg, #ffd0c4, #ff8a6b); color: #4d1300; }
.pastille-cloche { position: relative; width: 38px; height: 38px; padding: 0; justify-content: center; }
.pastille-cloche b { position: absolute; top: -3px; right: -3px; background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; }
.jauge { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.jauge > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: inherit; transition: width .6s; }

/* Barre d'onglets du bas */
.onglets {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  padding: 8px 8px calc(8px + var(--bas-sur));
  background: color-mix(in srgb, var(--fond-2) 88%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--bordure);
}
.onglet { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: var(--texte-doux); padding: 4px 10px; border-radius: 14px; text-decoration: none; min-width: 64px; }
.onglet span { font-size: 23px; line-height: 1; transition: transform .2s; }
.onglet.actif { color: var(--perso); }
.onglet.actif span { transform: translateY(-2px) scale(1.12); }

/* ---------- Bannière vedette ---------- */
.vedette {
  position: relative; overflow: hidden; margin: 4px 16px 0;
  border-radius: 28px; min-height: 300px; padding: 22px;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 10px;
  color: #fff; box-shadow: var(--ombre-forte);
  background:
    radial-gradient(600px 300px at 85% 10%, color-mix(in srgb, var(--teinte, var(--accent)) 85%, #fff) 0%, transparent 55%),
    linear-gradient(160deg, var(--teinte, var(--accent)) 0%, #2a1660 95%);
}
.vedette-emoji { position: absolute; right: -10px; top: -6px; font-size: 170px; opacity: .9; transform: rotate(-12deg); filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .3)); pointer-events: none; }
.vedette-etiquette { align-self: flex-start; padding: 5px 12px; border-radius: 999px; background: #ffffff2e; backdrop-filter: blur(6px); font-weight: 800; font-size: 13px; letter-spacing: .3px; text-transform: uppercase; }
.vedette h2 { font-size: clamp(26px, 7vw, 38px); font-weight: 900; max-width: 80%; text-shadow: 0 2px 12px rgba(0, 0, 0, .25); }
.vedette-infos { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-weight: 600; opacity: .95; }
.vedette-prix { font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; }
.vedette-prix.monte { animation: monte .6s; }
.vedette-chrono { font-size: 44px; font-weight: 900; font-variant-numeric: tabular-nums; }
.vedette .bouton { align-self: stretch; }
@keyframes monte { 40% { transform: translateY(-4px) scale(1.06); color: #fff3b0; } }

/* ---------- Rangées horizontales ---------- */
.rangee { display: flex; flex-direction: column; gap: 8px; }
.rangee-titre { padding: 0 16px; font-size: 19px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.rangee-titre small { font-size: 13px; color: var(--texte-doux); font-weight: 600; }
.rangee-defile {
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 4px 16px 14px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.rangee-defile::-webkit-scrollbar { display: none; }
.rangee-defile > * { scroll-snap-align: start; flex: none; }

.carte-tache {
  position: relative; width: 168px; min-height: 196px; border-radius: var(--rayon); padding: 14px;
  display: flex; flex-direction: column; gap: 6px; text-align: left; overflow: hidden;
  background: var(--surface); box-shadow: var(--ombre); transition: transform .2s;
}
.carte-tache:active { transform: scale(.96); }
.carte-tache-image { height: 82px; margin: -14px -14px 4px; display: grid; place-items: center; font-size: 46px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--teinte, var(--accent)) 30%, var(--surface)), color-mix(in srgb, var(--teinte, var(--accent)) 70%, var(--surface))); }
.carte-tache h3 { font-size: 15px; font-weight: 800; line-height: 1.2; }
.carte-tache .prix { margin-top: auto; font-size: 20px; font-weight: 900; color: var(--menthe); font-variant-numeric: tabular-nums; }
.carte-tache .detail { font-size: 12px; color: var(--texte-doux); font-weight: 600; }
.carte-tache.grisee { opacity: .5; filter: grayscale(.7); }
.carte-tache.creer .carte-tache-image { background: linear-gradient(140deg, #d9f7e8, #8be3b9); }
.badge-coin { position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; color: #fff; background: var(--danger); z-index: 1; }
.badge-coin.equipe { background: var(--ciel); }
.badge-coin.monte { background: var(--menthe); }
.badge-coin.perso { background: var(--perso); }

.carte-personne { width: 150px; border-radius: var(--rayon); padding: 14px; background: var(--surface); box-shadow: var(--ombre); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.carte-personne strong { font-size: 15px; }
.carte-personne span.petit { min-height: 2.6em; }

/* ---------- Composants ---------- */
.avatar { display: inline-grid; place-items: center; background: var(--couleur, var(--perso)); border-radius: 30%; flex: none; line-height: 1; }
.avatar-s { width: 28px; height: 28px; font-size: 16px; }
.avatar-m { width: 40px; height: 40px; font-size: 22px; }
.avatar-l { width: 72px; height: 72px; font-size: 40px; }
.avatar-xl { width: 110px; height: 110px; font-size: 62px; }

.carte { background: var(--surface); border-radius: var(--rayon); padding: 18px; box-shadow: var(--ombre); display: flex; flex-direction: column; gap: 10px; }
.carte h2 { font-size: 18px; font-weight: 800; }
.carte-intro { align-items: center; text-align: center; background: linear-gradient(160deg, color-mix(in srgb, var(--couleur) 25%, var(--surface)), var(--surface)); }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 999px; font-weight: 800; font-size: 16px;
  transition: transform .12s, filter .2s, opacity .2s; text-decoration: none; text-align: center;
}
.bouton:active { transform: scale(.96); }
.bouton:disabled { opacity: .45; pointer-events: none; }
.bouton.principal { background: linear-gradient(135deg, var(--accent), #ff8a3d); color: #fff; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 40%, transparent); }
.bouton.succes { background: linear-gradient(135deg, #19c37d, #10a868); color: #fff; }
.bouton.danger { background: var(--danger); color: #fff; }
.bouton.secondaire { background: var(--surface-2); color: var(--texte); }
.bouton.blanc { background: #fff; color: #1b1530; box-shadow: 0 10px 24px rgba(0, 0, 0, .25); }
.bouton.geant { min-height: 60px; font-size: 19px; }
.bouton.large { width: 100%; }
.bouton.petit-bouton { min-height: 36px; padding: 0 14px; font-size: 14px; }
.rangee-boutons { display: flex; gap: 10px; flex-wrap: wrap; }
.rangee-boutons > .bouton { flex: 1; }

.formulaire { display: flex; flex-direction: column; gap: 12px; }
.champ, select.champ, textarea.champ {
  width: 100%; min-height: 50px; padding: 12px 16px; border-radius: var(--rayon-s);
  border: 2px solid var(--bordure); background: var(--surface); outline: none; transition: border-color .2s; font-size: 16px;
}
.champ:focus { border-color: var(--perso); }
textarea.champ { min-height: 90px; resize: vertical; }
label.etiquette { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; }
label.case { display: flex; align-items: center; gap: 10px; font-weight: 600; min-height: 40px; }
label.case input { width: 22px; height: 22px; accent-color: var(--perso); }

.etat { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: var(--surface-2); color: var(--texte-doux); }
.etat.validee { background: #d4f7e6; color: #0b7a4b; }
.etat.refusee { background: #ffe0dd; color: #b42318; }
.etat.a_verifier, .etat.contestee, .etat.analyse { background: #fff1d1; color: #915b00; }
.etat.reservee { background: #dcecff; color: #1d5fb8; }

.liste { display: flex; flex-direction: column; gap: 8px; }
.ligne { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: var(--rayon-s); box-shadow: var(--ombre); }
.ligne-corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ligne-corps strong { overflow: hidden; text-overflow: ellipsis; }
.ligne .montant { font-weight: 900; font-variant-numeric: tabular-nums; }
.montant.positif { color: var(--menthe); }
.montant.negatif { color: var(--danger); }

/* Tâche en détail */
.photos-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.photo-cadre { position: relative; aspect-ratio: 3 / 4; border-radius: var(--rayon-s); overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--texte-doux); font-weight: 700; }
.photo-cadre img { width: 100%; height: 100%; object-fit: cover; }
.photo-cadre .legende { position: absolute; left: 8px; top: 8px; padding: 3px 9px; border-radius: 999px; background: #000a; color: #fff; font-size: 12px; }
.checklist { display: flex; flex-direction: column; gap: 6px; }
.checklist label { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--rayon-s); background: var(--surface-2); font-weight: 700; }
.checklist input { width: 24px; height: 24px; accent-color: var(--menthe); }
.chrono-geant { font-size: 64px; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.chrono-geant.presque { color: var(--danger); animation: pulse .8s infinite alternate; }
.analyse-ia { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px; text-align: center; }
.analyse-ia .loupe { font-size: 64px; animation: balaye 1.6s ease-in-out infinite; }
@keyframes balaye { 50% { transform: translateX(24px) rotate(12deg); } }
.verdict { border-radius: var(--rayon); padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.verdict.ok { background: #d4f7e6; color: #08583a; }
.verdict.ko { background: #ffe0dd; color: #8a1a12; }
.verdict.attente { background: #fff1d1; color: #6e4500; }

/* Tirelire */
.tirelire-tete { text-align: center; padding: 28px 18px; border-radius: 28px; color: #4a3200; background: radial-gradient(400px 200px at 50% 0%, #fff6d6, transparent), linear-gradient(160deg, #ffd96b, #ffb21e); box-shadow: var(--ombre-forte); }
.tirelire-tete .cochon-geant { font-size: 72px; }
.tirelire-tete .solde { font-size: 46px; font-weight: 900; font-variant-numeric: tabular-nums; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--texte-doux); font-weight: 600; }

/* Classement */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 12px; padding-top: 12px; }
.podium-marche { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 30%; max-width: 130px; }
.podium-socle { width: 100%; border-radius: 16px 16px 6px 6px; display: grid; place-items: center; font-size: 26px; font-weight: 900; color: #fff; background: var(--couleur); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border-radius: var(--rayon-s); background: var(--surface); box-shadow: var(--ombre); text-align: center; font-size: 12px; font-weight: 700; }
.badge span { font-size: 34px; }
.badge.verrouille { opacity: .35; filter: grayscale(1); }

/* Tableaux (parent, admin) */
.tableau-conteneur { overflow-x: auto; border-radius: var(--rayon-s); box-shadow: var(--ombre); }
table.tableau { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 14px; }
.tableau th, .tableau td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--bordure); white-space: nowrap; }
.tableau th { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--texte-doux); }
.tableau td.nombre { text-align: right; font-variant-numeric: tabular-nums; }
.barres { display: flex; flex-direction: column; gap: 8px; }
.barre { display: grid; grid-template-columns: 90px 1fr 70px; align-items: center; gap: 10px; font-size: 14px; font-weight: 700; }
.barre-piste { height: 14px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.barre-piste i { display: block; height: 100%; border-radius: inherit; background: var(--couleur, var(--perso)); }
.menu-parent { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.menu-parent a { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: var(--rayon); background: var(--surface); box-shadow: var(--ombre); text-decoration: none; font-weight: 800; }
.menu-parent a span { font-size: 30px; }
.bouton-rapide { width: 132px; min-height: 120px; border-radius: var(--rayon); padding: 14px; display: flex; flex-direction: column; justify-content: space-between; text-align: left; background: var(--surface); box-shadow: var(--ombre); font-weight: 800; font-size: 14px; }
.bouton-rapide span { font-size: 34px; }
.bouton-rapide.urgent { background: linear-gradient(140deg, #ff6b4a, #e5484d); color: #fff; }
.onglets-choix { display: flex; gap: 6px; padding: 4px; border-radius: 999px; background: var(--surface-2); overflow-x: auto; }
.onglets-choix button { flex: 1; padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.onglets-choix button.actif { background: var(--surface); box-shadow: var(--ombre); }
.couleurs { display: flex; flex-wrap: wrap; gap: 10px; }
.couleurs button { width: 40px; height: 40px; border-radius: 50%; background: var(--c); border: 3px solid transparent; }
.couleurs button.choisi { border-color: var(--texte); transform: scale(1.1); }
.emojis { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.emojis button { font-size: 30px; height: 52px; border-radius: 14px; background: var(--surface-2); }
.emojis button.choisi { outline: 3px solid var(--perso); }

/* ---------- Modale, toasts ---------- */
.modale-fond { position: fixed; inset: 0; z-index: 80; background: rgba(10, 6, 25, .55); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .25s; padding: 12px; }
.modale-fond.visible { opacity: 1; }
.modale { width: min(480px, 100%); max-height: 88vh; overflow: auto; background: var(--fond-2); border-radius: 26px; padding: 22px; padding-bottom: calc(22px + var(--bas-sur)); transform: translateY(40px); transition: transform .3s cubic-bezier(.2, 1.3, .4, 1); display: flex; flex-direction: column; gap: 14px; }
.modale-fond.visible .modale { transform: none; }
.modale-texte { margin: 0 0 4px; font-size: 17px; font-weight: 700; }
@media (min-width: 700px) { .modale-fond { align-items: center; } }

#toasts { position: fixed; left: 0; right: 0; bottom: calc(92px + var(--bas-sur)); z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { max-width: 460px; padding: 12px 18px; border-radius: 16px; background: #1b1530; color: #fff; font-weight: 700; box-shadow: var(--ombre-forte); opacity: 0; transform: translateY(16px); transition: opacity .3s, transform .3s; }
.toast.visible { opacity: 1; transform: none; }
.toast-succes { background: #0f9e63; }
.toast-erreur { background: #c4302b; }

/* ---------- Animations ludiques ---------- */
.confettis { position: fixed; inset: 0; pointer-events: none; z-index: 120; overflow: hidden; }
.confettis i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: tombe linear forwards; }
@keyframes tombe { to { transform: translateY(110vh) rotate(720deg); } }
.piece-qui-tombe { position: fixed; left: 50%; top: 30%; z-index: 120; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.piece-qui-tombe .piece { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 900; color: #7a4b00; background: radial-gradient(circle at 35% 30%, #fff3b0, #ffc93c 55%, #e09a00); box-shadow: 0 6px 18px #e09a0088; animation: piece 1.4s cubic-bezier(.5, 0, .7, 1) forwards; }
.piece-qui-tombe .piece-texte { font-weight: 900; font-size: 22px; color: var(--menthe); animation: entree .4s both; text-shadow: 0 2px 8px #0003; }
.piece-qui-tombe .cochon { font-size: 80px; margin-top: 40px; animation: cochon 1.6s .9s; }
@keyframes piece { 0% { transform: translateY(-80px) rotateY(0); } 70% { transform: translateY(120px) rotateY(720deg); opacity: 1; } 100% { transform: translateY(150px) rotateY(900deg) scale(.4); opacity: 0; } }
@keyframes cochon { 30% { transform: scale(1.2) rotate(-8deg); } 60% { transform: scale(.95) rotate(6deg); } }

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

/* Impression (export mensuel) */
@media print {
  .onglets, .barre-haut, .pas-imprime, #toasts { display: none !important; }
  body { background: #fff; color: #000; }
  .carte, .tableau-conteneur, .ligne { box-shadow: none; border: 1px solid #ccc; }
  .ecran { padding: 0; }
}

/* =====================================================================
   Accueil, fiche, décors (ajouts)
   ===================================================================== */
.accueil { display: flex; flex-direction: column; gap: 18px; }
.barre-haut { flex-wrap: wrap; }
.barre-progression { flex-basis: 100%; height: 4px; border-radius: 999px; background: linear-gradient(90deg, var(--accent-2), var(--accent)) 0 0 / var(--pct, 0%) 100% no-repeat, var(--surface-2); }
.barre-haut small { font-weight: 600; opacity: .7; }
.centre-texte { text-align: center; }

.bandeaux { display: flex; flex-direction: column; gap: 8px; padding: 0 16px; }
.page .bandeaux { padding: 0; }
.bandeau { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 18px; background: var(--surface); box-shadow: var(--ombre); text-decoration: none; }
.bandeau-happy { color: #fff; background: linear-gradient(110deg, #ff5f45, #ffc93c, #ff8fd8, #7c5cff); background-size: 300% 100%; animation: arc-en-ciel 4s linear infinite; }
.bandeau-fete { background: linear-gradient(120deg, #ffe1f3, #fff1c4); color: #5b1d48; }
.bandeau-nuit { background: linear-gradient(120deg, #1d1638, #3a2378); color: #e9e4ff; }
.bandeau-wrapped { margin: 0 16px; color: #fff; background: linear-gradient(120deg, #7c5cff, #e052b4); }
.page .bandeau-wrapped { margin: 0; }
@keyframes arc-en-ciel { to { background-position: 300% 0; } }

.vedette-vide { --teinte: #7c5cff; }
.vedette-mystere { --teinte: #7c5cff; }
.vedette-mystere .vedette-emoji { animation: flotte 3s ease-in-out infinite; }
.vedette-raison { margin: 0; font-weight: 700; font-size: 14px; opacity: .9; }
.vedette .rangee-boutons .bouton.blanc { flex: 1; }
.vedette-info { flex: 0 0 60px !important; background: #ffffff33 !important; color: #fff !important; }
.vedette-chrono.presque { color: #fff3b0; animation: pulse .8s infinite alternate; }
@keyframes flotte { 50% { transform: rotate(-4deg) translateY(-10px); } }

.badge-coin.nouveau { background: linear-gradient(135deg, #7c5cff, #e052b4); }
.badge-coin.mystere { background: #7c5cff; }
.carte-mystere .carte-tache-image { background: repeating-linear-gradient(45deg, #7c5cff, #7c5cff 12px, #9b82ff 12px, #9b82ff 24px); }
.carte-tache .prix.monte, .vedette-prix.monte { animation: monte .6s; }

/* Top 3 : grands numéros derrière les cartes */
.top3 .rangee-defile { gap: 0; padding-left: 8px; }
.top3-element { display: flex; align-items: flex-end; position: relative; padding-right: 12px; }
.top3-numero {
  font-size: 150px; font-weight: 900; line-height: .8; margin-right: -26px; z-index: 0;
  color: var(--fond); -webkit-text-stroke: 4px var(--texte-doux); letter-spacing: -8px; user-select: none;
}
.top3-element .carte-tache { z-index: 1; }

/* Calendrier de l'Avent */
.case-avent { width: 64px; height: 76px; border-radius: 16px; display: grid; place-items: center; font-size: 22px; font-weight: 900;
  background: linear-gradient(160deg, #c81d3a, #8f1028); color: #ffe8a3; box-shadow: var(--ombre); }
.case-avent.ouvrable { animation: pulse 1s infinite alternate; outline: 3px solid #ffd23f; }
.case-avent.ouverte { background: linear-gradient(160deg, #1f8a4c, #136136); font-size: 30px; }
.case-avent.passee { opacity: .4; }
.case-avent:disabled { cursor: default; }

/* Accueil parent */
.enveloppe-ligne { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.enveloppe-montant { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.bouton-rapide.happy { background: linear-gradient(140deg, #ffc93c, #ff8fd8); color: #4a1a3a; }
a.bouton-rapide, a.carte-personne, a.carte-tache { text-decoration: none; color: inherit; }

/* Fiche tâche */
.fiche { padding-bottom: 120px; }
.fiche-tete { position: relative; overflow: hidden; color: #fff; padding: calc(64px + var(--haut-sur)) 20px 24px; border-radius: 0 0 32px 32px;
  background: radial-gradient(500px 260px at 90% 0%, color-mix(in srgb, var(--teinte) 80%, #fff), transparent 60%), linear-gradient(160deg, var(--teinte), #2a1660); }
.fiche-retour { position: absolute; top: calc(12px + var(--haut-sur)); left: 16px; background: #ffffff30; color: #fff; box-shadow: none; }
.fiche-emoji { position: absolute; right: -6px; top: 20px; font-size: 130px; opacity: .85; transform: rotate(-10deg); pointer-events: none; }
.fiche-titre { position: relative; display: flex; flex-direction: column; gap: 10px; max-width: 78%; }
.fiche-titre h1 { font-size: 30px; font-weight: 900; }
.fiche-prix { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-weight: 700; }
.barre-action { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 12px 16px calc(12px + var(--bas-sur));
  background: color-mix(in srgb, var(--fond) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); display: flex; flex-direction: column; gap: 6px; }
.carte-chrono { align-items: center; }
.etapes-parcours { display: flex; gap: 6px; font-size: 12px; font-weight: 800; color: var(--texte-doux); flex-wrap: wrap; justify-content: center; }
.etapes-parcours span { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); }
.etapes-parcours .active { background: var(--perso); color: #fff; }
.etapes-parcours .faite { background: #d4f7e6; color: #0b7a4b; }
.liste-etapes { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.rangee-avatars { display: flex; gap: 14px; flex-wrap: wrap; }
.avatar-nom { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.ligne-simple { flex-direction: row; align-items: center; }
.verdict-montant { font-size: 28px; font-weight: 900; margin: 0; }
.verdict-explication { font-style: italic; margin: 0; }
.verdict-bloc { display: flex; flex-direction: column; gap: 14px; }
.carte-echange { border: 3px solid var(--ciel); }
.carte-mystere-info { background: linear-gradient(160deg, color-mix(in srgb, #7c5cff 25%, var(--surface)), var(--surface)); }
.courbe { width: 100%; height: auto; }
.courbe-legende { font-size: 11px; font-weight: 700; fill: var(--texte-doux); font-family: var(--police); }
.courbe-legende.fort { fill: var(--menthe); font-size: 13px; }

/* Comparateur avant / après */
.comparateur { position: relative; aspect-ratio: 3 / 4; max-height: 70vh; border-radius: var(--rayon-s); overflow: hidden; background: var(--surface-2); user-select: none; touch-action: pan-y; }
.comparateur img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.comparateur-avant { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos, 50%)) 0 0); }
.comparateur-poignee { position: absolute; top: 0; bottom: 0; left: var(--pos, 50%); width: 3px; background: #fff; transform: translateX(-50%); box-shadow: 0 0 10px #0006; pointer-events: none; }
.comparateur-poignee span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #1b1530; display: grid; place-items: center; font-weight: 900; }
.comparateur .legende { position: absolute; top: 10px; padding: 3px 10px; border-radius: 999px; background: #000a; color: #fff; font-size: 12px; font-weight: 700; }
.comparateur .legende.gauche { left: 10px; }
.comparateur .legende.droite { right: 10px; }
.comparateur-curseur { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }

/* Décors de saison : une frise d'emojis sous la barre du haut */
html[data-saison] .accueil > .barre-haut::after {
  position: absolute; right: 12px; bottom: -14px; font-size: 22px; letter-spacing: 6px; opacity: .85; pointer-events: none;
}
html[data-saison="halloween"] .accueil > .barre-haut::after { content: "🎃🦇👻"; }
html[data-saison="noel"] .accueil > .barre-haut::after { content: "🎄⭐🎁"; }
html[data-saison="hiver"] .accueil > .barre-haut::after { content: "❄️⛄"; }
html[data-saison="printemps"] .accueil > .barre-haut::after { content: "🌸🌷"; }
html[data-saison="ete"] .accueil > .barre-haut::after { content: "☀️🏖️"; }
html[data-saison="rentree"] .accueil > .barre-haut::after { content: "🎒✏️"; }
html[data-saison="automne"] .accueil > .barre-haut::after { content: "🍂🍁"; }
html[data-saison="noel"] .vedette::after, html[data-saison="hiver"] .vedette::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(#fff 1.5px, transparent 2px), radial-gradient(#fff 1px, transparent 1.5px);
  background-size: 60px 60px, 34px 34px; background-position: 0 0, 17px 23px; animation: neige 12s linear infinite;
}
html[data-saison="halloween"] .vedette { background: radial-gradient(600px 300px at 85% 10%, #ff9a3c 0%, transparent 55%), linear-gradient(160deg, #ff7a1a 0%, #2a0f3d 95%); }
@keyframes neige { to { background-position: 0 600px, 17px 363px; } }

/* Jour de fête de l'enfant */
html[data-fete="oui"] body { background: linear-gradient(180deg, #fff0f8, var(--fond) 380px); }
html[data-fete="oui"] .vedette { background: linear-gradient(135deg, #ff5fa2, #ffc93c 50%, #7c5cff); }

/* Intro : la maison dont les fenêtres s'allument */
.intro { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: var(--nuit); transition: opacity .35s; }
.intro.fini { opacity: 0; pointer-events: none; }
.intro svg { width: 150px; height: 150px; }
.intro .fenetre { fill: #2b2150; animation: allume .25s forwards; }
.intro .fenetre:nth-of-type(1) { animation-delay: .25s; }
.intro .fenetre:nth-of-type(2) { animation-delay: .4s; }
.intro .fenetre:nth-of-type(3) { animation-delay: .55s; }
.intro .fenetre:nth-of-type(4) { animation-delay: .7s; }
.intro .toit { animation: entree .5s cubic-bezier(.2, 1.4, .4, 1); transform-origin: center; }
@keyframes allume { to { fill: #ffd23f; filter: drop-shadow(0 0 6px #ffd23f); } }
.pastille { text-decoration: none; color: inherit; }
.pastille-tirelire { color: #4a3200; }
.barre-haut .logo-maison { white-space: nowrap; min-width: 0; }
@media (max-width: 420px) {
  .barre-haut .logo-maison { font-size: 0; gap: 0; flex: 1; }
  .barre-haut .logo-maison::before { width: 28px; height: 28px; }
}

/* Récap « Wrapped » */
.story { position: fixed; inset: 0; z-index: 90; background: #000; color: #fff; }
.story-barres { position: absolute; top: calc(10px + var(--haut-sur)); left: 10px; right: 10px; display: flex; gap: 4px; z-index: 3; }
.story-barres i { flex: 1; height: 3px; border-radius: 3px; background: #ffffff44; overflow: hidden; }
.story-barres i b { display: block; height: 100%; width: 0; background: #fff; }
.story-barres i.fini b { width: 100%; }
.story-barres i.actif b { animation: barre-story 6s linear forwards; }
@keyframes barre-story { to { width: 100%; } }
.story-fermer { position: absolute; top: calc(22px + var(--haut-sur)); right: 12px; z-index: 4; font-size: 22px; width: 44px; height: 44px; color: #fff; }
.story-scene, .story-ecran { position: absolute; inset: 0; }
.story-ecran { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 40px 24px; text-align: center; animation: entree .5s cubic-bezier(.2, 1.3, .4, 1); }
.story-gros { font-size: clamp(40px, 13vw, 72px); font-weight: 900; line-height: 1.05; letter-spacing: -1px; text-shadow: 0 4px 24px #0004; }
.story-texte { margin: 0; font-size: 20px; font-weight: 700; opacity: .92; }
.story-emoji { font-size: 90px; animation: flotte 3s ease-in-out infinite; }
.story-badges { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
.story-badges > div { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 800; background: #ffffff22; padding: 14px; border-radius: 18px; min-width: 120px; }
.story-badges span { font-size: 44px; }
.story-zone { position: absolute; top: 0; bottom: 0; z-index: 2; }
.story-zone.gauche { left: 0; width: 30%; }
.story-zone.droite { right: 0; width: 70%; }
.vedette > *:not(.vedette-emoji) { position: relative; z-index: 1; }
.vedette-emoji { z-index: 0; opacity: .6; }
.fiche-titre { z-index: 1; }
.fiche-emoji { opacity: .55; }
.fiche-titre .etat { align-self: flex-start; }
a.ligne, a.carte, a.bandeau { text-decoration: none; color: inherit; }
