/* propre.css : passe « propre » de l'accueil (chargée après accueil.css).
   Principes : fond d'animal seulement dans le héros ; ailleurs un seul crème uni du thème ; aucune ombre de texte ;
   grille de 4 px ; logo pixel recoloré par compagnon ; lisibilité par la couleur du texte, jamais par un halo. */

/* ---------- jetons par compagnon ----------
   --lg-* : les 6 couleurs du logo. contour = --t (foncé du compagnon), face = crème clair, épaisseur = jaune du thème.
   --tx : couleur du texte posé sur le fond d'animal du héros (rapport ≥ 4,5:1 mesuré, voir rapport). */
html[data-animal] {
  --lg-c: var(--t);
  --lg-r: color-mix(in srgb, var(--p) 55%, #fff);
  --lg-f: var(--p);
  --lg-fo: var(--c);
  --lg-e: var(--j);
  --lg-eo: var(--jo);
  --tx: var(--t);
  --tx2: var(--t2);
}

/* ---------- socle : un seul crème uni, sans quadrillage ---------- */
html[data-animal] body { background: var(--c); background-image: none; font-weight: 500; }
html[data-animal] body, html[data-animal] .hero, html[data-animal] .hero * , html[data-animal] .titre-sect, html[data-animal] .intro,
html[data-animal] .carte p, html[data-animal] .c-titre, html[data-animal] .ecrans-notes li, html[data-animal] .aide { text-shadow: none; }
html[data-animal] h1, html[data-animal] h2, html[data-animal] h3, html[data-animal] .h1-nomki { text-shadow: none; }
html[data-animal] .trio, html[data-animal] .quoi, html[data-animal] .amis, html[data-animal] .bande,
html[data-animal] .ecrans, html[data-animal] .fin, html[data-animal] .pied, html[data-animal] #trois { background: none; background-color: transparent; background-image: none; }
.quoi::before, .amis::before, .trio::before, .fin::before { display: none; }
html[data-animal] .titre-sect { color: var(--t); font-weight: 700; margin: 0 auto 8px; }
html[data-animal] .intro { color: var(--t2); font-weight: 500; font-size: 20px; margin: 0 auto 32px; max-width: 44ch; }

/* ---------- logo ---------- */
.logo-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.logotype { display: block; flex: none; shape-rendering: crispEdges; image-rendering: pixelated; overflow: visible; filter: none; margin: 0; }
.logo .logotype { width: 186px; height: 43px; }
.h1-nomki .logotype { width: 558px; height: 129px; max-width: 100%; }
html[data-animal] .h1-nomki { display: block; font-size: 0; line-height: 0; letter-spacing: 0; margin: 0 0 16px; }
.logo { padding: 6px 16px; gap: 0; }
.logo-tete { display: none; }

/* ---------- en-tête : une seule ligne ---------- */
.top { position: absolute; inset: 16px 16px auto; align-items: center; }
.top-droite { display: flex; align-items: center; gap: 12px; }
.top-droite .nk-b--cpt { min-height: 56px; padding: 0 20px 4px; margin: 0; }
.choix-haut { gap: 4px; padding: 4px; box-shadow: 0 3px 0 var(--jo); }
.choix-haut button { width: 44px; height: 44px; }

/* ---------- héros : seul endroit où vit le fond d'animal ---------- */
.hero > .fond { position: absolute; inset: 0; z-index: 0; }
.hero > .fond i { background-position: center bottom; }
html[data-animal] .hero { background: none; border-bottom: 4px solid var(--t2); }
html[data-animal] .hero-texte h1, html[data-animal] .hero-texte p, html[data-animal] .aide, html[data-animal] .hero-texte .h1-ligne,
html[data-animal] .hero-texte .hero-sous, html[data-animal] .hero-texte .apercu { text-shadow: none; font-weight: 600; color: var(--tx); }
html[data-animal] .hero-texte .h1-ligne { font-weight: 700; margin-top: 12px; }
html[data-animal] .hero-sous { margin-bottom: 24px; max-width: 32ch; }
html[data-animal] .hero-sous .apercu { margin-top: 8px; font-size: 16px; color: var(--tx2); font-weight: 600; }
html[data-animal] .aide { font-weight: 600; font-size: 15px; color: var(--tx); }
.hero-texte { margin-top: 0; }

/* ---------- sections : rythme sur grille de 4 px ---------- */
.bande, .ecrans, .quoi, .amis, .fin { padding-left: 5vw; padding-right: 5vw; }
html[data-animal] .bande { padding-top: 80px; padding-bottom: 0; }
html[data-animal] .ecrans { padding-top: 80px; padding-bottom: 0; }
html[data-animal] .quoi { padding-top: 96px; padding-bottom: 0; }
html[data-animal] .amis { padding-top: 96px; padding-bottom: 0; gap: 0; }
html[data-animal] .fin { padding-top: 96px; padding-bottom: 80px; }

/* « Choisis le tien » : 7 en rangée (4 + 3 centrés quand l'écran est étroit) */
html[data-animal] .bande .choix { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 12px; max-width: 1200px; margin: 0 auto; padding: 8px 0 12px; overflow: visible; }
html[data-animal] .bande .choix button { flex: none; width: 152px; height: 216px; padding: 8px 8px 12px; scroll-snap-align: none; }
html[data-animal] .bande .choix .spr { width: 134px; height: 136px; zoom: 1; }
html[data-animal] .bande .choix .nom { margin-top: 4px; font-size: 18px; }

/* « Voilà l'appli » : le téléphone et ses notes côte à côte, sans vide */
html[data-animal] .ecrans-corps { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 360px); gap: 48px; align-items: center; justify-content: center; margin: 0 auto; }
html[data-animal] .ecrans .appli-grand { width: 100%; max-width: 420px; margin: 0; }
html[data-animal] .ecrans .ecrans-notes { display: grid; }
html[data-animal] .ecrans-notes li { font-size: 17px; font-weight: 500; }
html[data-animal] .ecrans-notes b { font-size: 19px; font-weight: 700; }

/* captures fixes de la vraie appli */
.capt { display: block; width: 100%; height: auto; aspect-ratio: 420 / 760; border-radius: 20px; image-rendering: auto; background: var(--co); filter: drop-shadow(0 6px 0 color-mix(in srgb, var(--d) 22%, transparent)); }
.capt-haut { aspect-ratio: 420 / 470; object-fit: cover; object-position: top; }
.quoi .grille3 { gap: 32px; max-width: 1120px; margin: 0 auto; align-items: start; }
.carte-ecran { padding: 0; gap: 12px; }
html[data-animal] .carte-ecran .c-titre { font-size: 20px; font-weight: 700; }
html[data-animal] .carte-ecran p { padding: 0 8px; font-size: 17px; font-weight: 500; color: var(--t2); }
.carte-ecran .capt { max-width: 340px; }

/* « Avec tes amis » : serré */
html[data-animal] .amis .titre-sect, html[data-animal] .amis .intro { margin-inline: auto; }
.amis-corps { grid-template-columns: minmax(0, 340px) minmax(0, 360px); gap: 48px; margin-top: 0; align-items: center; }
.amis-corps .carte-amis { gap: 12px; }
.amis-liste li { box-shadow: inset 0 3px 0 #fff; }
html[data-animal] .amis-liste li > span:not(.pg-ico) { font-weight: 500; }

/* pied de page sobre */
html[data-animal] .pied { border-top: 2px solid var(--co); padding: 32px 6vw 40px; color: var(--t2); }
html[data-animal] .pied p { font-weight: 500; font-size: 15px; }
html[data-animal] .pied-liens { font-size: 15px !important; }
html[data-animal] .pied a { color: var(--t); }

/* ---------- mobile ---------- */
@media (max-width: 980px) {
  html[data-animal] .ecrans-corps, .amis-corps { grid-template-columns: minmax(0, 420px); gap: 32px; }
  html[data-animal] .ecrans .ecrans-notes { max-width: 420px; margin-inline: auto; }
  .quoi .grille3 { grid-template-columns: minmax(0, 340px); justify-content: center; gap: 40px; }
  .h1-nomki .logotype { width: 372px; height: 86px; }
}
@media (max-width: 720px) {
  .top { inset: 8px 8px auto; }
  .logo { padding: 4px; } .logo .logotype { display: none; } .logo-tete { display: block; }
  .top-droite { gap: 6px; }
  .top-droite .nk-b--cpt { min-height: 46px; padding: 0 12px 4px; font-size: 16px; }
  .top-droite .cpt-ico { display: none; }
  .choix-haut button { width: 30px; height: 30px; background-size: 26px 26px; }
  .choix-haut { gap: 0; padding: 3px; }
  .h1-nomki .logotype { width: 100%; max-width: 362px; height: auto; aspect-ratio: 186 / 43; }
  html[data-animal] .intro { font-size: 18px; margin-bottom: 24px; }
  html[data-animal] .bande { padding: 56px 14px 0; } html[data-animal] .ecrans { padding: 56px 14px 0; }
  html[data-animal] .quoi, html[data-animal] .amis, html[data-animal] .fin { padding-top: 64px; padding-inline: 14px; }
  html[data-animal] .fin { padding-bottom: 56px; }
  html[data-animal] .bande .choix { gap: 12px 8px; margin-inline: 0; padding: 4px 0 8px; overflow: visible; flex-wrap: wrap; justify-content: center; }
  html[data-animal] .bande .choix button { width: calc((100% - 24px) / 4); height: 112px; padding: 4px 2px 6px; }
  html[data-animal] .bande .choix .spr { width: 100%; height: 72px; zoom: .5; }
  html[data-animal] .bande .choix .nom { font-size: 13px; padding: 0; margin-top: 2px; }
}
@media (max-width: 400px) { .top-droite .nk-b--cpt { font-size: 0; padding: 0 10px; gap: 0; } .top-droite .nk-b--cpt .cpt-ico { display: block; } }

/* « Choisis le tien » : 7 cartes sur une seule ligne dès 1280 px ; de 721 à 1279 px, 4 + 3 centrées (jamais 6 + 1 seul) */
@media (min-width: 721px) and (max-width: 1279px) { html[data-animal] .bande .choix { max-width: 660px; } }
@media (min-width: 1280px) { html[data-animal] .bande .choix { flex-wrap: nowrap; gap: 10px; } html[data-animal] .bande .choix button { width: 140px; } }

/* compagnon de la page : effacé tant qu'il n'est pas entièrement visible (jamais coupé par le bord de la fenêtre) */
#scene .pet, #scene .parole, #sortie .pet { transition: opacity .2s ease; }
#scene.nk-hors .parole, .pet.nk-hors { opacity: 0 !important; }

/* masquage immédiat (jamais d'animal à moitié visible), réapparition en fondu */
#scene.nk-hors .parole, #scene .pet.nk-hors, #sortie .pet.nk-hors { transition: none !important; }
