/* CAT FRIENDS : composants et écrans */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; } /* couleur de fond : écrite dans chaque page (inc/gabarit.php), selon la page */

body {
  margin: 0;
  /* Toujours au moins la hauteur totale de l'écran (lvh), même pour une page courte (Galerie vide, Chat) */
  min-height: 100lvh;
  font-family: var(--police-texte);
  font-weight: 500;
  font-size: var(--texte);
  color: var(--blanc);
  background: transparent; /* la couleur unie est sur <html> (écrite dans la page) ; le dégradé est body::before */
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Fond dégradé fixe (background-attachment: fixed ne marche pas sur iPhone).
   Il déborde de 200 px en haut et en bas : Safari (iOS 26) affiche sous la Dynamic Island / la barre d'état
   et sous sa barre d'outils flottante ce que la page dessine au-delà de l'écran (correctif validé sur iPhone
   pour le portfolio). Sans ce débord, ces zones restaient d'une couleur unie. */
body { --fond-page: var(--fond-accueil); }
body.fond-connexion { --fond-page: var(--fond-connexion); }
body.fond-chat { --fond-page: var(--fond-chat); }
body.fond-galerie { --fond-page: var(--fond-galerie); }
body::before {
  content: '';
  position: fixed;
  inset: -200px 0;
  z-index: -1;
  background: var(--fond-page);
}
/* Sous la Dynamic Island / la barre d'état, sur les pages SANS en-tête (album, Labo…) : le dégradé de la page,
   net (le contenu qui défile passe dessous). Même dégradé et même cadrage que le fond ci-dessus.
   Sur les pages avec en-tête, c'est la teinte de l'en-tête qui passe sous la barre d'état. */
body:has(.barre-haut)::after { display: none; }
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  height: var(--haut-sur);
  background: var(--fond-page) 0 -200px / 100% calc(100lvh + 400px) no-repeat;
  pointer-events: none;
}

img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
p, h1, h2, h3 { margin: 0; }
a { color: inherit; text-decoration: none; } /* aucun lien souligné sur le site */

.visuellement-cache {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

[hidden] { display: none !important; }

/* ---------- Typographie ---------- */
.titre-page {
  font-family: var(--police-titre);
  font-weight: 400;
  font-size: var(--titre-xl);
  line-height: 50px;
  color: var(--titre-accueil);
  mix-blend-mode: lighten;
  white-space: nowrap;
}
.fond-chat .titre-page { color: var(--titre-chat); }
.fond-galerie .titre-page { color: var(--titre-galerie); }

.titre-carte {
  font-family: var(--police-titre);
  font-weight: 400;
  font-size: var(--titre-l);
  line-height: 38px;
  color: var(--blanc-90);
  mix-blend-mode: lighten;
  text-align: center;
}

.texte-aide { font-size: var(--texte); line-height: 20px; }

/* ---------- Avatars ---------- */
.avatar {
  flex-shrink: 0;
  display: block;
  padding: 0;
  border: 2px solid var(--blanc-90);
  border-radius: 50%;
  overflow: hidden;
  background: var(--rose-40);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--24 { width: 24px; height: 24px; border-width: 1.5px; }
.avatar--32 { width: 32px; height: 32px; }
.avatar--42 { width: 42px; height: 42px; }
.avatar--64 { width: 64px; height: 64px; }

/* ---------- Pastille rouge (SVG Figma de 81 px centré sur un point de 15 px) ---------- */
.pastille {
  position: absolute;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #ff3737;
  box-shadow: 0 4px 16px rgba(255, 89, 89, 0.9);
  pointer-events: none;
}
/* Rond dessiné en CSS : l'ancienne image (SVG Figma de 81 px) se plaçait mal sur iPhone */
.pastille img { display: none; }
.pastille--en-ligne { position: relative; display: inline-block; flex-shrink: 0; }

/* ---------- Barre du haut ---------- */
.barre-haut {
  /* Fixe : reste en haut quoi qu'il arrive (y compris quand on tire la page vers le bas sur iPhone) ;
     sa teinte sombre passe aussi sous la Dynamic Island / la barre d'état */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--noir-30);
  -webkit-backdrop-filter: var(--flou);
  backdrop-filter: var(--flou);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}
/* Le contenu commence sous l'en-tête fixe */
.barre-haut ~ .ecran { padding-top: calc(var(--haut-barre) + 24px); }
.barre-haut__contenu {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: var(--largeur-app);
  margin: 0 auto;
  padding: calc(var(--haut-sur) + 20px) 22px 9px;
}
.barre-haut__avatar { cursor: pointer; }

/* ---------- Barre du bas ---------- */
.barre-bas {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--largeur-app);
  margin: 0 auto;
  height: calc(68px + max(10px, var(--bas-sur))); /* juste la place des icônes, plus la barre d'accueil de l'iPhone */
  /* Les icônes descendent un peu dans la zone de la barre d'accueil : centrées au-dessus, elles paraissaient trop hautes */
  padding: 0 56px max(4px, calc(var(--bas-sur) * 0.45));
  border-radius: var(--rayon-carte) var(--rayon-carte) 0 0;
  background: var(--noir-30);
  -webkit-backdrop-filter: var(--flou);
  backdrop-filter: var(--flou);
  box-shadow: var(--relief);
}
@media (min-width: 403px) {
  .barre-bas { bottom: 12px; border-radius: var(--rayon-carte); height: 76px; padding-bottom: 0; }
}
.onglet {
  position: relative;
  display: flex;
  padding: 12px;
  border-radius: var(--rayon-rond);
  -webkit-tap-highlight-color: transparent;
}
.onglet > img {
  position: relative;
  width: 42px;
  height: 42px;
  opacity: 0.8;
  transition: transform 0.35s var(--ressort), opacity 0.2s;
}
/* Rond clair sous l'icône : grossit depuis le centre ; glisse d'un onglet à l'autre au changement de page */
.onglet__rond {
  position: absolute;
  inset: 0;
  border-radius: var(--rayon-rond);
  background: var(--blanc-30);
  box-shadow: var(--ombre-cta-petit), var(--reflet-cta-petit);
  opacity: 0;
  transform: scale(0.3);
  transition: transform 0.45s var(--ressort), opacity 0.2s;
}
.onglet.est-actif > img { opacity: 1; }
.onglet.est-actif .onglet__rond { opacity: 1; transform: none; view-transition-name: rond-actif; }
/* Appui : seule l'icône s'enfonce ; le rond reste sur l'onglet actif et glisse au changement de page
   (un rond qui apparaissait aussi sous l'onglet touché faisait doublon) */
.onglet.est-actif:active .onglet__rond { transform: scale(1.12); }
.onglet:active > img, .onglet.est-presse > img { opacity: 1; transform: scale(0.88); }
.onglet__pastille { left: 44px; top: 5px; animation: battement 2.4s ease-in-out infinite; }

/* ---------- Contenu ---------- */
.ecran {
  display: flex;
  flex-direction: column;
  gap: var(--ecart-cartes);
  max-width: var(--largeur-app);
  margin: 0 auto;
  padding: 24px var(--marge-ecran) calc(150px + var(--bas-sur));
}

/* ---------- Carte ---------- */
.carte {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 17px;
  padding: 32px 24px;
  border-radius: var(--rayon-carte);
  background: var(--noir-30);
  -webkit-backdrop-filter: var(--flou);
  backdrop-filter: var(--flou);
  box-shadow: var(--ombre-carte), var(--reflet-carte);
}
.carte__titre-groupe { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.carte__vide { text-align: center; opacity: 0.85; }

/* ---------- Bulle (statuts, messages) ---------- */
.bulle {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: var(--rayon-champ);
  background: var(--rose-40);
  box-shadow: var(--ombre-cta-petit), var(--reflet-cta-petit);
  line-height: 20px;
  overflow-wrap: anywhere;
}
.musique {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--texte-petit);
  line-height: 17px;
}
.musique img { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- Statuts ---------- */
.statut {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}
.statut .bulle { flex: 1; min-height: 42px; }
.statut__emoji {
  position: absolute;
  left: 28px;
  top: 26px;
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
}
.statut__pastille { left: 299px; left: calc(100% - 16px); top: 0; }

/* ---------- Boutons ---------- */
.bouton {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 53px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--rayon-bouton);
  background: var(--cta-soleil);
  box-shadow: var(--ombre-cta-gros), var(--reflet-cta-gros);
  font-weight: 700;
  font-size: var(--texte);
  line-height: 20px;
  color: var(--blanc);
  text-decoration: none;
  transition: transform 0.15s, filter 0.15s;
}
.bouton { transition: transform 0.3s var(--ressort), filter 0.15s; }
.bouton:active { transform: scale(0.93); transition-duration: 0.1s; }
.bouton:disabled { filter: grayscale(0.4); opacity: 0.7; }
.bouton--violet { background: var(--cta-violet); }
.bouton--large { width: 100%; }
.bouton img { width: 32px; height: 32px; }
.bouton--action {
  flex: 1;
  height: 60px;
  gap: 8px;
  text-align: left;
}
.bouton--action img { width: 24px; height: 24px; }
.actions { display: flex; gap: 8px; }

.bouton-rond {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  padding: 0;
  border: 0;
  border-radius: 50px;
  background: var(--rose-40);
  box-shadow: var(--ombre-cta-petit), var(--reflet-cta-petit);
}
.bouton-rond img { width: 24px; height: 24px; }
.bouton-rond--sombre {
  background: var(--noir-30);
  -webkit-backdrop-filter: var(--flou);
  backdrop-filter: var(--flou);
  box-shadow: var(--ombre-element), var(--reflet-carte);
}
.bouton-rond--sombre[data-sens='precedent'] img { transform: rotate(180deg); }

.lien-discret {
  padding: 8px;
  border: 0;
  background: none;
  font-weight: 500;
  color: var(--blanc-90);
  text-decoration: none;
}

/* ---------- Champs ---------- */
.champ-groupe { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.etiquette { font-weight: 700; line-height: 20px; }
.champ {
  width: 100%;
  min-height: 53px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--rayon-champ);
  background: var(--blanc-30);
  font-weight: 500;
  font-size: var(--texte);
  color: var(--blanc);
  outline: none;
}
.champ::placeholder { color: var(--blanc-60); }
.champ:focus-visible { box-shadow: 0 0 0 2px var(--blanc-60); }
textarea.champ { resize: none; line-height: 20px; padding-top: 16.5px; padding-bottom: 16.5px; display: block; }

.erreur {
  padding: 10px 12px;
  border-radius: var(--rayon-champ);
  background: rgba(120, 0, 30, 0.45);
  text-align: center;
  line-height: 20px;
}

/* ---------- Nouvelles ---------- */
.nouvelle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border-radius: var(--rayon-champ);
  background: var(--noir-30);
  box-shadow: var(--ombre-element), var(--reflet-carte);
  text-decoration: none;
}
.nouvelle__icone {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: var(--rayon-champ);
  background: var(--rose-40);
  box-shadow: inset 0 0 6px rgba(255, 255, 255, 0.25);
}
.nouvelle__icone img { width: 42px; height: 42px; }
.nouvelle__texte { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.nouvelle__titre { display: flex; align-items: center; gap: 6px; font-weight: 700; line-height: 20px; }
.nouvelle__detail { display: flex; align-items: center; gap: 8px; line-height: 20px; }
.avatars-empiles { display: flex; }
.avatars-empiles .avatar + .avatar { margin-left: -7px; }

/* ---------- Mini-Apps ---------- */
.mini-apps { display: flex; justify-content: center; gap: 12px; width: 100%; }
.mini-app {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 105px;
  font-weight: 700;
  font-size: var(--texte-petit);
  line-height: 17px;
}
.mini-app__icone {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: var(--rayon-champ);
  box-shadow: var(--ombre-cta-gros), var(--reflet-cta-petit);
}
.mini-app__icone img { width: 42px; height: 42px; }
.mini-app__icone--musique { background: var(--app-musique); }
.mini-app__icone--jeux { background: var(--app-jeux); }

/* ---------- Placard ---------- */
.placard { display: flex; flex-direction: column; align-items: center; gap: 17px; width: 100%; }
.placard__selecteur { display: flex; align-items: center; justify-content: center; gap: 32px; width: 100%; }
.placard__selecteur .bouton-rond:disabled { opacity: 0.35; cursor: default; }
.placard__image {
  width: 143px;
  height: 169px;
  object-fit: contain;
  filter: drop-shadow(5px 10px 10px rgba(0, 0, 0, 0.3));
}
.placard__nom { font-weight: 700; font-size: 24px; line-height: 29px; text-align: center; }
.placard__prix { line-height: 20px; text-align: center; }
.placard__texte { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Feuille (panneau qui monte du bas : Statut, Profil) ---------- */
.feuille { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.feuille__fond { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.15); animation: apparaitre 0.25s ease-out; }
.feuille__panneau {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 17px; /* espacement de la maquette (écran « Ajout Statut ») */
  width: 100%;
  max-width: var(--largeur-app);
  max-height: calc(100dvh - var(--haut-sur) - 40px);
  overflow-y: auto;
  padding: 32px 24px calc(40px + var(--bas-sur));
  border-radius: var(--rayon-carte) var(--rayon-carte) 0 0;
  background: var(--noir-30);
  -webkit-backdrop-filter: var(--flou-fort);
  backdrop-filter: var(--flou-fort);
  box-shadow: var(--relief); /* en relief : lumière sur le bord haut + ombre portée */
  animation: monter 0.35s var(--doux);
}
.feuille__entete { display: flex; align-items: flex-start; justify-content: space-between; }
.feuille__entete .titre-carte { text-align: left; }
.feuille__boutons { display: flex; gap: 8px; }
.feuille__pied { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.feuille .bouton { align-self: center; }
.feuille.se-ferme .feuille__panneau { animation: descendre 0.2s ease-in forwards; }
.feuille.se-ferme .feuille__fond { animation: disparaitre 0.2s ease-in forwards; }

.profil-photo { display: flex; align-items: center; gap: 12px; }
.profil-photo .bulle { flex: 1; }
.feuille .champ-groupe form { display: contents; }

/* Bulle cliquable (même style que les statuts) : profil, liens du compte */
.bulle--bouton {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 53px;
  border: 0;
  font-weight: 700;
  font-size: var(--texte);
  text-align: left;
  text-decoration: none;
  color: var(--blanc);
  cursor: pointer;
  transition: transform 0.25s var(--ressort), background-color 0.2s;
}
.bulle--bouton img { width: 24px; height: 24px; flex-shrink: 0; transition: transform 0.25s var(--ressort); }
.bulle--bouton:active { background: rgba(255, 202, 208, 0.5); }
.bulle--bouton:active { transform: scale(0.97); }
.bulle--bouton:focus-within { box-shadow: var(--ombre-cta-petit), var(--reflet-cta-petit), 0 0 0 2px var(--blanc-60); }

@keyframes monter { from { transform: translateY(100%); } }
@keyframes descendre { to { transform: translateY(100%); } }
@keyframes apparaitre { from { opacity: 0; } }
@keyframes disparaitre { to { opacity: 0; } }

/* ---------- Écran de connexion ---------- */
.connexion {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 77px;
  padding: calc(var(--haut-sur) + 96px) 22px 40px;
}
.motif {
  position: fixed;
  top: 0;
  left: 50%;
  width: var(--largeur-app);
  height: 100%;
  margin-left: calc(var(--largeur-app) / -2);
  pointer-events: none;
}
.motif img {
  position: absolute;
  width: 78px;
  height: 78px;
  opacity: 0.3;
  transform: rotate(18deg);
}
.logo {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 0;
  margin-left: -7px;
}
.logo img { width: 62px; height: 62px; margin-right: -7px; position: relative; z-index: 1; }
.logo span {
  font-family: var(--police-titre);
  font-size: var(--titre-xl);
  line-height: 50px;
  color: var(--blanc-90);
  mix-blend-mode: lighten;
  white-space: nowrap;
}
/* Logo en image (écran de connexion) : l'ombre déborde, l'image est un peu plus large que la carte */
.logo--image { margin: -12px 0 -8px; }
.logo--image img { width: 340px; max-width: calc(100vw - 16px); height: auto; margin: 0; }
.connexion .carte { width: 100%; max-width: 357px; padding: 32px; }
.connexion .titre-carte { font-size: var(--titre-xl); line-height: 50px; }
.connexion form { display: flex; flex-direction: column; width: 100%; }
.connexion .bouton { width: 100%; }

/* Choix du profil : grosses photos avec les prénoms, puis elles rétrécissent une fois le profil choisi */
.profils {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px 24px;
  margin: 0;
  padding: 0;
  border: 0;
  transition: gap 0.45s var(--ressort);
}
.profil { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; }
.profil input { position: absolute; opacity: 0; pointer-events: none; }
.profil__photo {
  width: 72px;
  height: 72px;
  transition: width 0.45s var(--ressort), height 0.45s var(--ressort), opacity 0.3s, transform 0.2s var(--ressort);
}
.profil:active .profil__photo { transform: scale(0.92); }
.profil:has(input:focus-visible) .avatar { box-shadow: 0 0 0 3px var(--blanc-60); }
.profil__nom {
  max-height: 20px;
  font-weight: 700;
  font-size: var(--texte-petit);
  line-height: 17px;
  transition: max-height 0.35s, opacity 0.25s;
}
.profil::after {
  content: '';
  width: 42px;
  height: 0;
  margin-top: -8px;
  border-radius: 52px;
  background: var(--blanc-90);
  opacity: 0;
  transform: scaleX(0.2);
  transition: opacity 0.25s, transform 0.4s var(--ressort), height 0.3s, margin 0.3s;
}

.connexion__suite {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: grid-template-rows 0.45s var(--ressort), opacity 0.3s, transform 0.45s var(--ressort), visibility 0s 0.45s;
}
.connexion__suite-interieur {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-height: 0;
  overflow: hidden;
  /* 3 px de marge autour (compensés) : le contour du champ sélectionné n'est plus coupé.
     Pas de marge haute tant que les champs sont repliés (sinon un vide restait sous les photos) */
  margin: 0 -3px;
  padding: 0 3px;
  transition: padding 0.45s var(--ressort);
}
.connexion form:has(.profils input:checked) .connexion__suite-interieur { padding: 28px 3px 3px; }

/* Profil choisi */
.connexion form:has(.profils input:checked) .profils { gap: 16px 38px; }
.connexion form:has(.profils input:checked) .profil__photo { width: 42px; height: 42px; }
.connexion form:has(.profils input:checked) .profil:not(:has(input:checked)) .profil__photo { opacity: 0.55; }
.connexion form:has(.profils input:checked) .profil__nom { max-height: 0; opacity: 0; }
.profil:has(input:checked)::after { height: 8px; margin-top: -6px; opacity: 1; transform: none; }
.connexion form:has(.profils input:checked) .connexion__suite {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: grid-template-rows 0.45s var(--ressort), opacity 0.3s 0.1s, transform 0.45s var(--ressort), visibility 0s;
}

/* Écran d'ouverture : le logo seul au centre, puis la carte apparaît */
.ouverture {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: var(--fond-connexion);
  animation: disparaitre 0.4s ease-in 0.9s forwards;
  pointer-events: none;
}

/* ---------- Chat ---------- */
.fond-chat .ecran { padding-bottom: 0; gap: 0; }
.fil {
  display: flex;
  flex-direction: column;
  padding: 8px 0 calc(var(--bas-barre) + var(--hauteur-saisie, 53px) + 24px);
}
.fil__jour {
  align-self: center;
  margin: 16px 0 8px;
  padding: 4px 12px;
  border-radius: var(--rayon-rond);
  background: var(--noir-30);
  font-size: 12px;
  line-height: 15px;
}
/* Messages façon Discord : tous à gauche, sans bulle ; photo + prénom + heure en tête de série */
.message {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 -10px;
  padding: 4px 10px;
  border-radius: var(--rayon-element);
  transition: background-color 0.15s;
}
.message:not(.message--suite) { margin-top: 12px; }
.message:active { background: rgba(0, 0, 0, 0.12); }
.avatar--40 { width: 40px; height: 40px; }
.message__avatar { margin-top: 2px; }
.message__corps { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.message__entete { display: flex; align-items: baseline; gap: 8px; }
.message__nom { font-weight: 700; line-height: 20px; }
.message__heure { font-size: 11px; line-height: 14px; opacity: 0.7; white-space: nowrap; }
.message__texte { line-height: 21px; white-space: pre-wrap; overflow-wrap: anywhere; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.message--suite { padding-left: 62px; }
.message--suite .message__heure {
  position: absolute;
  left: 10px;
  top: 7px;
  width: 40px;
  text-align: center;
  font-size: 10px;
  opacity: 0;
  transition: opacity 0.15s;
}
.message--suite:active .message__heure { opacity: 0.7; }
.message.est-nouveau { animation: message-arrive 0.45s var(--ressort); }
.message.est-nouveau .message__avatar { animation: pop 0.5s var(--ressort); }
@keyframes message-arrive { from { opacity: 0; transform: translateY(14px) scale(0.97); } }

.saisie-chat {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--bas-barre);
  z-index: 19;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: var(--largeur-app);
  margin: 0 auto;
  padding: 0 var(--marge-ecran);
}
/* Les messages qui passent derrière la zone de saisie sont floutés, pour ne pas se mélanger au texte tapé.
   Le flou descend jusqu'en bas de l'écran, derrière la barre de navigation. */
.saisie-chat::before {
  content: '';
  position: absolute;
  inset: -16px 0 calc(-1 * var(--bas-barre));
  z-index: -1;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 16px);
  mask-image: linear-gradient(to bottom, transparent, #000 16px);
  pointer-events: none;
}
.saisie-chat__modif {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 4px 14px;
  border-radius: var(--rayon-champ);
  background: var(--noir-30);
  font-weight: 700;
  font-size: var(--texte-petit);
}
.saisie-chat__modif .lien-discret { padding: 4px 8px; }
/* Barre d'écriture d'un seul tenant : bouton photo, texte, bouton d'envoi */
.saisie-chat__barre {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: 53px;
  padding: 6px;
  border-radius: 27px;
  background: var(--noir-30); /* sombre, comme le bandeau de modification et l indicateur « … écrit » */
  -webkit-backdrop-filter: var(--flou-fort);
  backdrop-filter: var(--flou-fort);
  box-shadow: var(--ombre-cta-petit), var(--reflet-cta-petit);
  transition: transform 0.4s var(--ressort);
}
/* Léger rebond quand on appuie sur la barre (s'enfonce puis revient en dépassant un peu) */
.saisie-chat__barre:active { transform: scale(0.975); transition-duration: 0.1s; }
.saisie-chat__photo, .saisie-chat__envoi {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 41px;
  height: 41px;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.15s;
}
.saisie-chat__photo { background: rgba(255, 255, 255, 0.18); }
.saisie-chat__photo img { width: 24px; height: 24px; }
.saisie-chat__envoi { background: var(--cta-violet); box-shadow: var(--reflet-cta-petit); }
.saisie-chat__envoi img { width: 22px; height: 22px; transform: rotate(-90deg); }
.saisie-chat__photo:active, .saisie-chat__envoi:active { transform: scale(0.88); }
.saisie-chat__envoi:disabled { opacity: 0.6; }
.saisie-chat__texte {
  flex: 1;
  min-width: 0;
  height: 41px;
  max-height: 140px;
  padding: 10px 6px;
  border: 0;
  background: none;
  font-size: var(--texte);
  line-height: 21px;
  color: var(--blanc);
  resize: none;
  outline: none;
}
.saisie-chat__texte::placeholder { color: var(--blanc-60); }

/* Photo choisie, en attente d'envoi */
.saisie-chat__apercu { position: relative; align-self: flex-start; animation: contenu-entre 0.25s var(--doux); }
.saisie-chat__apercu > img {
  display: block;
  max-width: 140px;
  max-height: 140px;
  border-radius: var(--rayon-element);
  box-shadow: var(--ombre-carte);
}
.saisie-chat__apercu .bouton-rond { position: absolute; top: -10px; right: -10px; width: 32px; height: 32px; background: rgba(60, 20, 70, 0.75); }
.saisie-chat__apercu .bouton-rond img { width: 18px; height: 18px; }

/* ---------- Bientôt (Galerie) ---------- */
.bientot { text-align: center; line-height: 22px; }
.bientot img { width: 98px; height: 98px; margin: 0 auto 8px; transform: rotate(-12deg); }

/* ---------- Membres (admin) ---------- */
.membre-ligne { display: flex; align-items: center; gap: 12px; width: 100%; }
.membre-ligne__nom { flex: 1; font-weight: 700; }
.badge { padding: 2px 8px; border-radius: var(--rayon-rond); background: var(--blanc-30); font-size: 12px; }
.carte form { display: flex; flex-direction: column; gap: 16px; width: 100%; }
.carte .bouton { align-self: center; }

/* ---------- Message éphémère ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: calc(var(--haut-sur) + 12px);
  z-index: 70;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: var(--rayon-bouton);
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: var(--flou);
  backdrop-filter: var(--flou);
  font-weight: 700;
  text-align: center;
  animation: apparaitre 0.2s, disparaitre 0.3s 2.7s forwards;
}

/* =====================================================================
   Animations
   ===================================================================== */

/* --- Changement de page (navigateurs récents : Chrome, Safari 18.2+) ---
   Le fond dégradé passe en fondu d'une couleur à l'autre, le contenu sort puis entre,
   la barre du bas reste en place et le rond clair glisse vers le nouvel onglet. */
/* La déclaration @view-transition est dans le <head> de chaque page (inc/gabarit.php) */
.barre-bas { view-transition-name: barre-bas; }
.barre-haut { view-transition-name: barre-haut; }
.titre-page { view-transition-name: titre-page; }
/* Chaque page a son propre nom : le contenu sort puis entre en fondu, sans être « déformé » d'une page
   à l'autre (le chat, très haut et défilé en bas, s'étirait). La classe commune porte l'animation. */
.ecran { view-transition-name: contenu; view-transition-class: contenu; }
/* Le chat (messages + barre de saisie floutée) n'est pas découpé en calques : la page entière apparaît
   et disparaît en fondu, avec son flou intact (découpée, la barre perdait son flou et clignotait) */
.fond-chat .ecran { view-transition-name: none; }
.ecran--galerie { view-transition-name: contenu-galerie; }
.ecran--album { view-transition-name: contenu-album; }


/* Fondu du fond d'une couleur de page à l'autre : volontairement lent */
::view-transition-group(root),
::view-transition-old(root),
::view-transition-new(root) { animation-duration: 0.7s; }

/* Ordre des calques pendant le changement de page : le contenu reste toujours sous les barres
   (sinon des albums passaient par-dessus la barre du bas) */
::view-transition-group(*.contenu) { z-index: 1; }
::view-transition-group(barre-haut), ::view-transition-group(barre-bas) { z-index: 5; }
::view-transition-group(titre-page) { z-index: 6; }
::view-transition-group(rond-actif) { z-index: 7; }

/* Pendant le changement de page, la barre du bas est remplacée par une image, qui perd son flou :
   on remet le flou sur son calque, avec les mêmes arrondis. Seulement pour elle : elle est sur les deux pages,
   donc son calque dure toute la transition. (La barre du chat et celle du haut n'existent pas sur toutes
   les pages : un flou sur leur calque restait après leur disparition et faisait « clignoter ».) */
::view-transition-group(barre-bas) {
  -webkit-backdrop-filter: var(--flou);
  backdrop-filter: var(--flou);
  border-radius: var(--rayon-carte) var(--rayon-carte) 0 0;
}
@media (min-width: 403px) {
  ::view-transition-group(barre-bas) { border-radius: var(--rayon-carte); }
}

/* Barres du haut et du bas : identiques d'une page à l'autre, donc pas de fondu entre l'ancienne et la nouvelle.
   Semi-transparentes, les deux images à moitié superposées s'éclaircissaient au milieu du changement de page
   (la barre « clignotait », vu sur iPhone). Seuls le rond de l'onglet actif et le titre bougent. */
::view-transition-old(barre-bas), ::view-transition-old(barre-haut) { display: none; }
::view-transition-new(barre-bas), ::view-transition-new(barre-haut) { animation: none; }
::view-transition-old(.contenu) { animation: contenu-sort 0.15s ease-in forwards; }
::view-transition-new(.contenu) { animation: contenu-entre 0.3s var(--doux) 0.08s backwards; }
::view-transition-group(rond-actif) { animation-duration: 0.35s; animation-timing-function: var(--doux); }
/* Titre de la page : simple fondu, sans changement d'échelle (« Accueil » et « Chat » n'ont pas la même largeur :
   sans ça, le navigateur étirait l'un vers l'autre) */
::view-transition-group(titre-page) { animation: none; }
/* Le titre est fusionné avec l'en-tête (mix-blend-mode: lighten). Pendant la transition il est dessiné à part et
   perdait ce mélange : sa teinte changeait d'un coup au début et à la fin (« clignotement »). On le remet sur son calque. */
::view-transition-group(titre-page) { mix-blend-mode: lighten; }
::view-transition-old(titre-page), ::view-transition-new(titre-page) {
  width: auto;
  height: 100%;
  animation-duration: 0.25s;
  /* « animation: none » sur le calque du titre annule aussi le maintien de fin d'animation :
     sans ça, l'ancien titre, une fois effacé, réapparaissait jusqu'à la fin du changement de page */
  animation-fill-mode: both;
}

@keyframes contenu-sort { to { opacity: 0; } }
@keyframes contenu-entre { from { opacity: 0; transform: translateY(8px); } }

/* Navigateurs sans transition entre pages (iPhone) : le contenu sort en fondu (JS), puis la nouvelle page
   entre en douceur, bloc par bloc (léger décalage de l'un à l'autre). Le chat entre d'un seul bloc. */
@keyframes page-entre { from { opacity: 0; transform: translateY(14px) scale(0.985); } }
@keyframes page-sort { to { opacity: 0; transform: translateY(-6px) scale(0.99); } }
/* :not(.construction) : à l'ouverture de l'app, les cartes de l'Accueil gardent leur apparition à elles */
.sans-vt:not(.construction) .ecran > * { animation: page-entre 0.55s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
.sans-vt:not(.construction) .ecran > :nth-child(2) { animation-delay: 0.05s; }
.sans-vt:not(.construction) .ecran > :nth-child(3) { animation-delay: 0.1s; }
.sans-vt:not(.construction) .ecran > :nth-child(4) { animation-delay: 0.15s; }
.sans-vt:not(.construction) .ecran > :nth-child(n+5) { animation-delay: 0.2s; }
.sans-vt .fond-chat .ecran { animation: contenu-entre 0.45s var(--doux) backwards; }
.sans-vt .fond-chat .ecran > * { animation: none; }
.sans-vt.page-sort .ecran { animation: page-sort 0.2s ease-in forwards; }

/* --- Photo de la barre du haut --- */
.barre-haut__avatar { transition: transform 0.4s var(--ressort); }
.barre-haut__avatar:active { transform: scale(0.9); }

/* --- Statuts : émoji qui se dandine, pastille qui bat --- */
.statut__emoji { animation: dandine 3.2s ease-in-out infinite; transform-origin: 50% 80%; }
.statut:nth-child(3n) .statut__emoji { animation-delay: -1.1s; }
.statut:nth-child(3n + 1) .statut__emoji { animation-delay: -2.2s; }
.statut__pastille, .nouvelle .pastille { animation: battement 2.4s ease-in-out infinite; }

@keyframes dandine { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-16deg); } 86% { transform: rotate(14deg); } 93% { transform: rotate(-6deg); } }
@keyframes battement { 0%, 60%, 100% { transform: scale(1); } 70% { transform: scale(1.35); } 80% { transform: scale(0.95); } 90% { transform: scale(1.15); } }
@keyframes pop { from { transform: scale(0.4); opacity: 0; } }

/* --- Nouvelles, Mini-Apps, Placard --- */
.nouvelle { transition: transform 0.3s var(--ressort); }
.nouvelle:active { transform: scale(0.97); }
.mini-app { cursor: pointer; padding: 0; border: 0; background: none; color: inherit; font-family: inherit; }
.mini-app__icone { transition: transform 0.35s var(--ressort); }
.mini-app.secoue .mini-app__icone { animation: secoue 0.5s ease-in-out; }
@keyframes secoue { 20%, 60% { transform: translateX(-6px) rotate(-6deg); } 40%, 80% { transform: translateX(6px) rotate(6deg); } }

.placard__image { transition: transform 0.4s var(--ressort); }
.placard__image.glisse-suivant { animation: glisse-suivant 0.45s var(--ressort); }
.placard__image.glisse-precedent { animation: glisse-precedent 0.45s var(--ressort); }
@keyframes glisse-suivant { from { opacity: 0; transform: translateX(60px) rotate(12deg) scale(0.8); } }
@keyframes glisse-precedent { from { opacity: 0; transform: translateX(-60px) rotate(-12deg) scale(0.8); } }
.bouton-rond { transition: transform 0.3s var(--ressort); }
.bouton-rond:active { transform: scale(0.88); }

/* --- Connexion : chats du fond (le logo ne bouge pas) --- */
.motif { animation: derive 18s ease-in-out infinite alternate; }
@keyframes derive { to { transform: translate(-18px, -36px); } }
.connexion .carte { animation: contenu-entre 0.4s var(--doux) 0.9s backwards; }

/* --- Chat : le bouton d'envoi s'envole --- */
.saisie-chat__envoi.envoi img { animation: envole 0.5s var(--ressort); }
@keyframes envole { 40% { transform: rotate(-90deg) translateX(16px) scale(0.6); opacity: 0; } 41% { transform: rotate(-90deg) translateX(-16px) scale(0.6); } }

/* --- Photo de profil changée --- */
.avatar.pop { animation: pop 0.5s var(--ressort); }

/* --- Message éphémère : tombe en rebondissant --- */
.toast { animation: toast-tombe 0.5s var(--ressort), disparaitre 0.3s 2.7s forwards; }
@keyframes toast-tombe { from { opacity: 0; transform: translate(-50%, -30px) scale(0.8); } }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition: none !important; }
}

/* Après un essai raté, pas d'écran d'ouverture : la carte s'affiche tout de suite */
.connexion--direct .carte { animation-delay: 0s; }

/* Choix de la couleur du prénom dans le chat (profil) */
fieldset.champ-groupe { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset.champ-groupe > legend { padding: 0; margin-bottom: 8px; }
.apercu-nom { font-weight: 700; line-height: 20px; transition: color 0.2s; }
.couleurs { display: flex; flex-wrap: wrap; gap: 6px; justify-content: space-between; }
.couleur {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12), var(--ombre-cta-petit);
  cursor: pointer;
  transition: transform 0.15s;
}
.couleur input { position: absolute; opacity: 0; pointer-events: none; }
.couleur:active { transform: scale(0.88); }
.couleur:has(input:checked) { box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.25), 0 0 0 5px var(--c); }
.couleur:has(input:focus-visible) { outline: 2px solid var(--blanc); outline-offset: 4px; }

/* Placard : le vêtement flotte doucement, seulement quand la carte est à l'écran (IntersectionObserver dans app.js).
   Animation de transform seule : calculée par la carte graphique, sans recalcul de la page. */
.placard__flotte { display: block; animation: flotte 3.6s ease-in-out infinite; animation-play-state: paused; will-change: transform; }
.placard__flotte.est-visible { animation-play-state: running; }
@keyframes flotte { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-9px) rotate(1.5deg); } }

/* ---------- Musique (Deezer) ---------- */
/* Ligne musique cliquable dans un statut : pochette + titre, toucher = écouter l'extrait */
.musique--lecture {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 500;
  font-size: var(--texte-petit);
  text-align: left;
  cursor: pointer;
}
.musique__pochette {
  position: relative;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.musique__pochette img { width: 100%; height: 100%; object-fit: cover; }
.musique__pochette--grande { width: 44px; height: 44px; border-radius: 8px; }
/* Triangle « lecture » par-dessus la pochette */
.musique__pochette::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.3) center / 45% no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 1l7 4-7 4z' fill='white'/%3E%3C/svg%3E");
}
.est-chargement .musique__pochette::after { animation: battement 0.9s ease-in-out infinite; }
/* En lecture : trois barres qui dansent à la place du triangle */
.est-lecture .musique__pochette::after {
  background: rgba(0, 0, 0, 0.35) center / 55% no-repeat
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Crect x='1' y='2' width='2' height='8' fill='white'%3E%3Canimate attributeName='height' values='8;3;8' dur='.8s' repeatCount='indefinite'/%3E%3Canimate attributeName='y' values='2;7;2' dur='.8s' repeatCount='indefinite'/%3E%3C/rect%3E%3Crect x='5' y='0' width='2' height='10' fill='white'%3E%3Canimate attributeName='height' values='4;10;4' dur='.6s' repeatCount='indefinite'/%3E%3Canimate attributeName='y' values='6;0;6' dur='.6s' repeatCount='indefinite'/%3E%3C/rect%3E%3Crect x='9' y='3' width='2' height='7' fill='white'%3E%3Canimate attributeName='height' values='7;2;7' dur='.7s' repeatCount='indefinite'/%3E%3Canimate attributeName='y' values='3;8;3' dur='.7s' repeatCount='indefinite'/%3E%3C/rect%3E%3C/svg%3E");
}

/* Panneau Statut : morceau choisi */
.musique-choisie { flex-direction: row; align-items: center; gap: 12px; }
.musique-choisie .musique--lecture { flex: 1; min-width: 0; gap: 12px; font-size: var(--texte); }
.musique-choisie__texte, .resultat__texte { display: flex; flex-direction: column; min-width: 0; }
.musique-choisie__titre, .resultat__titre { font-weight: 700; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.musique-choisie__artiste, .resultat__artiste { font-size: var(--texte-petit); line-height: 17px; opacity: 0.85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Panneau Statut : recherche et résultats */
.musique-recherche { display: flex; flex-direction: column; gap: 8px; }
.musique-recherche .champ::-webkit-search-cancel-button { filter: invert(1); }
.resultats { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; list-style: none; }
.resultats:empty { display: none; }
.resultat {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 6px;
  border: 0;
  border-radius: var(--rayon-element);
  background: var(--rose-40);
  color: var(--blanc);
  text-align: left;
  animation: contenu-entre 0.25s var(--doux) backwards;
}
.resultat:active { background: rgba(255, 202, 208, 0.55); transform: scale(0.98); }
.resultat img { width: 40px; height: 40px; border-radius: 6px; flex-shrink: 0; }
.resultats__vide { padding: 6px 2px; opacity: 0.85; }
.musique-source { font-size: 12px; line-height: 15px; opacity: 0.7; }
.musique--lecture { width: 100%; min-width: 0; }
.musique__libelle { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Chat : appui long, réactions, menu d'un message ---------- */
.message { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
.message.est-appuye { background: rgba(0, 0, 0, 0.16); transform: scale(0.985); transition: background-color 0.2s, transform 0.45s ease-out; }
.message__modifie { font-size: 11px; opacity: 0.65; }

.reactions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.reaction {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 9px;
  border: 1.5px solid transparent;
  border-radius: var(--rayon-rond);
  background: var(--noir-30);
  color: var(--blanc);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.reaction__emoji { font-size: 15px; }
.reaction.est-mienne { background: rgba(255, 255, 255, 0.25); border-color: var(--blanc-60); }
.reaction:active { transform: scale(0.9); }

.feuille__panneau--court { gap: 20px; }
.menu-message__apercu {
  max-height: 64px;
  overflow: hidden;
  padding: 0 4px;
  font-size: var(--texte-petit);
  line-height: 20px;
  opacity: 0.85;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.menu-message__reactions {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 10 émojis : deux lignes de 5 */
  gap: 2px;
  padding: 6px;
  border-radius: var(--rayon-champ);
  background: var(--rose-40);
  box-shadow: var(--ombre-cta-petit), var(--reflet-cta-petit);
}
.reaction-choix {
  height: 52px;
  padding: 0;
  border: 0;
  border-radius: var(--rayon-element);
  background: none;
  font-size: 24px;
  line-height: 1;
  transition: transform 0.2s;
}
.reaction-choix:active { transform: scale(1.25); }
.reaction-choix.est-mienne { background: rgba(255, 255, 255, 0.3); }
.bulle--danger.est-a-confirmer { background: rgba(225, 37, 94, 0.65); }

/* ---------- Statuts : titre de musique trop long qui défile tout seul ---------- */
.musique__libelle.est-defilant {
  text-overflow: clip;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8px, #000 calc(100% - 12px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 8px, #000 calc(100% - 12px), transparent);
}
.musique__libelle.est-defilant .defile {
  display: inline-block;
  padding: 0 8px;
  animation: defile var(--duree-defile, 8s) ease-in-out infinite alternate;
}
@keyframes defile {
  0%, 18% { transform: translateX(0); }
  82%, 100% { transform: translateX(var(--decalage)); }
}

/* ---------- Chat : photos ---------- */
.message__photo {
  display: block;
  width: min(100%, 240px);
  max-height: 320px;
  margin: 4px 0 2px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--rayon-element);
  background: var(--noir-30);
  box-shadow: var(--ombre-element);
  cursor: zoom-in;
}
.message__photo img { width: 100%; height: 100%; object-fit: cover; -webkit-user-drag: none; }

.visionneuse {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: calc(var(--haut-sur) + 16px) 12px calc(var(--bas-sur) + 16px);
  background: rgba(10, 0, 20, 0.88);
  -webkit-backdrop-filter: var(--flou);
  backdrop-filter: var(--flou);
  animation: apparaitre 0.2s ease-out;
}
.visionneuse > img { max-width: 100%; max-height: 100%; border-radius: 10px; animation: contenu-entre 0.25s var(--doux); }
.visionneuse .bouton-rond { position: absolute; top: calc(var(--haut-sur) + 12px); right: 12px; }
.visionneuse.se-ferme { animation: disparaitre 0.2s ease-in forwards; }

/* Réactions en images (émojis de la bande) */
img.reaction__emoji { width: 22px; height: 22px; }
.reaction-choix img { width: 36px; height: 36px; margin: 0 auto; }

/* Émoji choisi ou retiré : petit sursaut */
.reaction-choix.pop img, .reaction.pop { animation: sursaut 0.4s var(--ressort); }
@keyframes sursaut { 40% { transform: scale(1.3); } }


/* Pastille de réaction : émoji + photos de ceux qui ont réagi */
.reaction { gap: 5px; padding: 0 5px 0 7px; }
.reaction__visages { display: flex; align-items: center; }
.reaction__visage { width: 22px; height: 22px; border-width: 1.5px; }
.reaction__visage + .reaction__visage { margin-left: -6px; }
.reaction__plus { margin-left: 3px; padding-right: 3px; font-size: 12px; font-weight: 700; }

/* =====================================================================
   Galerie (maquette Figma : écrans « Galerie » et « Galerie Photo »)
   ===================================================================== */
.ecran--galerie, .ecran--album { gap: 0; }

/* --- Liste des albums : deux colonnes décalées --- */
.albums { display: grid; grid-template-columns: 1fr 1fr; gap: 27px; padding: 0 2px; }
.albums__colonne { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.tuile-album {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 186px;
  padding: 0 8px 8px;
  overflow: hidden;
  border-radius: var(--rayon-bouton);
  background: var(--noir-30);
  box-shadow: var(--ombre-carte);
  text-decoration: none;
  transition: transform 0.15s;
}
.tuile-album::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 6px rgba(255, 255, 255, 0.25); pointer-events: none; }
.tuile-album:active { transform: scale(0.96); }
.tuile-album > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tuile-album--vide { background: linear-gradient(180deg, #8a38f5 0%, #e1257d 100%); }
.tuile-album__titre {
  position: relative;
  width: 100%;
  max-width: 129px;
  padding: 10px;
  border-radius: var(--rayon-carte);
  background: var(--noir-30);
  -webkit-backdrop-filter: var(--flou);
  backdrop-filter: var(--flou);
  box-shadow: var(--ombre-element), var(--reflet-carte);
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  color: var(--blanc);
  overflow-wrap: anywhere;
}
.bouton--creer-album { width: 100%; height: 93px; gap: 8px; border-radius: var(--rayon-bouton); text-align: left; }
.bouton--creer-album img { width: 24px; height: 24px; }
.bandeau-choix {
  margin: 0 2px 20px;
  padding: 12px 16px;
  border-radius: var(--rayon-champ);
  background: var(--rose-40);
  box-shadow: var(--ombre-cta-petit), var(--reflet-cta-petit);
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

/* --- En-tête d'un album --- */
.album-entete { display: flex; flex-direction: column; gap: 12px; padding: 0 16px; }
.album-couverture {
  position: relative;
  height: 238px;
  margin-bottom: 12px;
  overflow: hidden;
  border-radius: var(--rayon-bouton);
  background: var(--noir-30);
  box-shadow: var(--ombre-carte);
}
.album-couverture::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 6px rgba(255, 255, 255, 0.25); pointer-events: none; }
.album-couverture > img { width: 100%; height: 100%; object-fit: cover; }
.album-couverture--vide { display: grid; place-items: center; background: linear-gradient(180deg, #8a38f5 0%, #e1257d 100%); }
.album-couverture > img.album-couverture__chat { width: 110px; height: 110px; object-fit: contain; transform: rotate(-10deg); }
.album-couverture .bouton-rond { position: absolute; top: 12px; z-index: 1; }
.album-couverture__retour { left: 12px; }
.album-couverture__retour img { transform: rotate(180deg); }
.album-couverture__modifier { right: 12px; }
.album-titre { font-family: var(--police-titre); font-weight: 400; font-size: var(--titre-l); line-height: 38px; color: var(--blanc); overflow-wrap: anywhere; }
.album-vague { width: 100%; height: 20px; }
.album-infos { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.album-info { display: flex; align-items: center; gap: 8px; font-size: var(--texte-petit); line-height: 17px; }
.album-info img { width: 24px; height: 24px; flex-shrink: 0; }
.album-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.album-participants { display: flex; align-items: center; flex-shrink: 0; }
.album-participants .avatar + .avatar { margin-left: -8px; }
.album-participants__plus { margin-left: 4px; font-weight: 700; font-size: var(--texte-petit); }
.bouton--ajouter-images { min-height: 44px; padding: 10px 14px; gap: 8px; box-shadow: var(--ombre-cta-gros), var(--reflet-cta-petit); white-space: nowrap; cursor: pointer; }
.bouton--ajouter-images img { width: 24px; height: 24px; }
.bouton--ajouter-images.est-en-avant { animation: appel 1.6s ease-in-out infinite; }
@keyframes appel { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); box-shadow: var(--ombre-cta-gros), var(--reflet-cta-petit), 0 0 0 6px rgba(255, 255, 255, 0.25); } }

/* --- Envoi des photos en cours --- */
.envoi-photos {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 20px 16px 0;
  padding: 12px 14px;
  border-radius: var(--rayon-champ);
  background: var(--rose-40);
  box-shadow: var(--ombre-cta-petit), var(--reflet-cta-petit);
  font-weight: 700;
  font-size: var(--texte-petit);
}
.envoi-photos__barre { height: 6px; overflow: hidden; border-radius: 3px; background: rgba(255, 255, 255, 0.3); }
.envoi-photos__barre span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--blanc); transition: width 0.3s; }

/* --- Grille des photos, par jour --- */
.album-outils { display: flex; align-items: center; justify-content: space-between; margin: 28px 16px 0; font-size: var(--texte-petit); }
.album-outils .lien-discret { padding: 4px 0; font-weight: 700; }
.est-en-selection .album-outils .lien-discret { opacity: 0.7; }
.album-jour { margin: 22px 16px 14px; font-weight: 500; font-size: var(--texte-petit); line-height: 17px; }
.album-grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 0 calc(15px - var(--marge-ecran)); }
.vignette {
  position: relative;
  aspect-ratio: 122 / 129;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: var(--noir-30);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.vignette > img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s; -webkit-user-drag: none; }
.vignette:active > img { transform: scale(0.95); }
.vignette__reactions {
  position: absolute;
  left: 5px;
  bottom: 5px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px 3px 4px;
  border-radius: var(--rayon-rond);
  background: rgba(0, 0, 0, 0.45);
  font-size: 13px;
  font-weight: 700;
}
.vignette__reactions img { width: 20px; height: 20px; }
.vignette__coche { display: none; }
.est-en-selection .vignette__coche {
  position: absolute;
  top: 6px;
  right: 6px;
  display: block;
  width: 22px;
  height: 22px;
  border: 2px solid var(--blanc);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
}
.vignette.est-choisie > img { transform: scale(0.88); border-radius: 8px; }
.vignette.est-choisie .vignette__coche {
  background: #8a38f5 center / 14px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1 5l3.5 3.5L11 1.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* --- Barre de sélection --- */
.barre-selection {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--bas-barre);
  z-index: 21;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: calc(var(--largeur-app) - 2 * var(--marge-ecran));
  margin: 0 auto;
  padding: 6px 6px 6px 16px;
  border-radius: 30px;
  background: var(--noir-30);
  -webkit-backdrop-filter: var(--flou-fort);
  backdrop-filter: var(--flou-fort);
  box-shadow: var(--ombre-carte), var(--reflet-carte);
  animation: contenu-entre 0.25s var(--doux);
}
.barre-selection .bouton { min-height: 44px; padding: 10px 18px; }

/* --- Visionneuse plein écran --- */
.visionneuse-galerie {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: #0c0216; /* opaque : la page ne transparaît pas derrière la photo */
  animation: apparaitre 0.2s ease-out;
}
.visionneuse-galerie.se-ferme { animation: disparaitre 0.2s ease-in forwards; }
.visionneuse-galerie__haut { display: flex; align-items: center; justify-content: space-between; padding: calc(var(--haut-sur) + 12px) 12px 8px; }
.visionneuse-galerie__compteur { font-weight: 700; font-size: var(--texte-petit); }
.visionneuse-galerie__espace { width: 44px; }
.visionneuse-galerie__piste {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.visionneuse-galerie__piste::-webkit-scrollbar { display: none; }
.visionneuse-galerie__diapo { flex: 0 0 100%; display: grid; place-items: center; padding: 8px; scroll-snap-align: center; scroll-snap-stop: always; }
.visionneuse-galerie__diapo img { max-width: 100%; max-height: 100%; border-radius: 10px; background: rgba(255, 255, 255, 0.06); object-fit: contain; }
.visionneuse-galerie__bas {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 16px calc(var(--bas-sur) + 18px);
}
.visionneuse-galerie__info { font-size: 13px; line-height: 16px; opacity: 0.8; text-align: center; }
/* Ligne des réactions : toujours une seule ligne, de hauteur fixe (même vide), pour que la photo ne bouge pas quand
   une réaction apparaît ou disparaît ; si elles sont nombreuses, la ligne défile sur le côté. La marge autour laisse
   la place aux petites animations des pastilles sans les couper. */
.visionneuse-galerie__bas .reactions {
  flex-wrap: nowrap;
  justify-content: flex-start;
  align-items: center;
  align-self: stretch;
  min-height: 44px;
  margin: -6px -16px;
  padding: 6px 16px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.visionneuse-galerie__bas .reactions::-webkit-scrollbar { display: none; }
.visionneuse-galerie__bas .reactions > :first-child { margin-left: auto; } /* centrées tant qu'elles tiennent */
.visionneuse-galerie__bas .reactions > :last-child { margin-right: auto; }
.visionneuse-galerie__bas .reaction { flex-shrink: 0; }
.visionneuse-galerie__boutons { display: flex; gap: 20px; }
.visionneuse-galerie__boutons .bouton-rond { width: 52px; height: 52px; }
.icone-telecharger { transform: rotate(90deg); }
.trois-points { font-size: 13px; letter-spacing: 1px; font-weight: 700; }

fieldset.champ-groupe > legend.etiquette { padding: 0; margin-bottom: 8px; }

/* Nouvelles : album (vignette sur fond flouté de la même photo, comme la maquette) */
.nouvelle--album { overflow: hidden; border-radius: var(--rayon-champ); }
.nouvelle__fond { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(14px) brightness(0.6); transform: scale(1.2); }
.nouvelle__album { position: relative; width: 64px; height: 64px; flex-shrink: 0; border-radius: var(--rayon-champ); object-fit: cover; box-shadow: var(--ombre-carte), inset 0 0 6px rgba(255, 255, 255, 0.25); }
.nouvelle--album .nouvelle__texte { position: relative; }
.nouvelle__nom { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nouvelle__titre { min-width: 0; }

/* « Sélectionner » et « Annuler » (galerie) : sans soulignement */

/* Bouton de suppression annulable : texte (confirmer) + poubelle / flèche retour (annuler) */
.suppression { padding: 0; gap: 0; }
.suppression__action, .suppression__icone { border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.suppression__action { flex: 1; min-height: 53px; padding: 10px 12px; text-align: left; font-weight: 700; }
.suppression__icone { display: grid; place-items: center; width: 53px; min-height: 53px; flex-shrink: 0; }
.suppression__icone img { width: 24px; height: 24px; }
.suppression.est-a-confirmer { background: rgba(225, 37, 94, 0.65); }
.suppression.est-a-confirmer .suppression__icone { border-left: 1px solid rgba(255, 255, 255, 0.3); }
.suppression__icone.pop img { animation: sursaut 0.4s var(--ressort); }

/* Nouvelles : sous-titre un peu plus petit pour que tout tienne sur une ligne */
.nouvelle__detail { font-size: var(--texte-petit); line-height: 17px; }
.nouvelle__detail .avatar--24 { width: 22px; height: 22px; }

/* « Ajouter à la Galerie » (Accueil) : liste des albums */
.choix-albums { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.choix-album { justify-content: flex-start; gap: 12px; padding: 8px; }
.choix-album__image { width: 48px; height: 48px; flex-shrink: 0; border-radius: var(--rayon-element); object-fit: cover; box-shadow: var(--ombre-element); }
.choix-album__image--vide { display: grid; place-items: center; background: linear-gradient(180deg, #8a38f5 0%, #e1257d 100%); }
.choix-album__texte { display: flex; flex-direction: column; min-width: 0; }
.choix-album__titre { font-weight: 700; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choix-album__nombre { font-weight: 500; font-size: var(--texte-petit); line-height: 17px; opacity: 0.85; }

/* Page d'un album : sans barre du haut, la couverture commence sous la barre d'état du téléphone */
.ecran--album { padding-top: calc(var(--haut-sur) + 16px); }

/* Album vide : seulement le bouton « Ajouter des images » (centré) et « Aucune image pour l'instant. » */
.ecran--album.est-vide .album-participants { display: none; }
.ecran--album.est-vide .album-actions { justify-content: center; }
.ecran--album [data-vide] { margin-top: 24px; }

/* Album (page sans barre du haut) : à l'ouverture ou à la sortie d'un album, la barre du haut n'est pas
   un calque à part. Elle part ou arrive avec le fond de page, son flou intact (seule, elle clignotait). */
.vt-sans-entete .barre-haut, .vt-sans-entete .titre-page { view-transition-name: none; }
/* Retour d'une mini-app : fondu court, pour que le flou de l'en-tête et de la barre du bas (perdu pendant
   la transition, la page étant une image figée) revienne tout de suite */
:root.vt-mini-app::view-transition-group(root),
:root.vt-mini-app::view-transition-old(root),
:root.vt-mini-app::view-transition-new(root) { animation-duration: 0.3s; }
/* Vers ou depuis une mini-app : la page d'en dessous reste figée (aucun élément ne passe par-dessus la mini-app) */
.vt-mini-app :is(.barre-haut, .titre-page, .barre-bas, .onglet__rond, .ecran) { view-transition-name: none !important; }

/* Connexion : message de première connexion (création du mot de passe) */
.connexion__accueil { margin-bottom: -12px; font-weight: 700; text-align: center; line-height: 20px; }

/* Connexion : le logo, au centre de l'écran d'ouverture, monte à sa place quand la carte apparaît */
.connexion > .logo { z-index: 61; } /* au-dessus de l'écran d'ouverture */
.connexion > .logo.logo--monte { animation: logo-monte 1.2s var(--doux) 0.75s backwards; }
@keyframes logo-monte { from { transform: translateY(var(--depart, 0)); } }

/* Statuts : musique plus visible (titre en 15 px, un cran sous le texte du statut ; pochette plus grande) */
.statut .musique--lecture { gap: 10px; font-size: 15px; line-height: 19px; }
.statut .musique__pochette { width: 36px; height: 36px; border-radius: 7px; }

/* ==========================================================================
   Connexion lente ou absente
   ========================================================================== */

/* --- Photos qui chargent : fond qui scintille, puis la photo apparaît en fondu --- */
@keyframes scintille { from { background-position: 100% 0; } to { background-position: 0 0; } }
.squelette,
:is(.vignette > img, .tuile-album > img, .album-couverture > img:not(.album-couverture__chat), .nouvelle__album,
  img.choix-album__image, .message__photo img, .avatar img, .musique__pochette img,
  .visionneuse-galerie__diapo img, .visionneuse > img):not(.est-chargee) {
  background-color: rgba(255, 255, 255, 0.1);
  background-image: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.22) 50%, transparent 70%);
  background-size: 300% 100%;
  animation: scintille 1.5s linear infinite;
}
img.est-apparue { animation: photo-apparait 0.35s ease-out; }
@keyframes photo-apparait { from { opacity: 0; } }

/* Squelettes (contenu chargé par le réseau : photos d'un album, messages du chat) */
.squelette-album .squelette { aspect-ratio: 122 / 129; }
.squelette-album__jour { display: block; width: 120px; height: 14px; border-radius: 7px; }
.squelette-message { display: flex; align-items: flex-start; gap: 12px; padding: 6px 0; }
.squelette-message__avatar { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; }
.squelette-message__lignes { display: flex; flex-direction: column; gap: 8px; flex: 1; padding-top: 4px; }
.squelette-message__lignes .squelette { height: 14px; border-radius: 7px; }

/* --- Bandeau « pas de connexion » (texte à personnaliser dans inc/gabarit.php) --- */
.bandeau-connexion {
  position: fixed;
  left: 50%;
  top: calc(var(--haut-sur) + 12px);
  z-index: 69;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 10px 16px 10px 12px;
  border-radius: var(--rayon-bouton);
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: var(--flou);
  backdrop-filter: var(--flou);
  box-shadow: var(--relief);
  transform: translateX(-50%);
  animation: toast-tombe 0.5s var(--ressort);
}
.bandeau-connexion[hidden] { display: none; }
/* Pendant un changement de page, le bandeau reste au-dessus du contenu qui arrive */
.bandeau-connexion { view-transition-name: bandeau-connexion; }
::view-transition-group(bandeau-connexion) { z-index: 8; animation: none; }
::view-transition-old(bandeau-connexion) { display: none; }
::view-transition-new(bandeau-connexion) { animation: none; }
.bandeau-connexion > img { width: 32px; height: 32px; flex-shrink: 0; }
.bandeau-connexion__textes { display: flex; flex-direction: column; min-width: 0; }
.bandeau-connexion__titre { font-weight: 700; line-height: 20px; }
.bandeau-connexion__texte { font-size: var(--texte-petit); line-height: 17px; opacity: 0.85; }
.bandeau-connexion__texte:empty { display: none; }
.bandeau-connexion__bouton {
  flex-shrink: 0;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--rayon-bouton);
  color: var(--blanc);
  font: inherit;
  font-weight: 700;
  font-size: var(--texte-petit);
  background: linear-gradient(45deg, #8a38f5 4%, #e1257d 97.5%);
  cursor: pointer;
}

/* --- Changement de page lent : barre qui file en haut de l'écran --- */
.chargement-page {
  position: fixed;
  top: var(--haut-sur);
  left: 0;
  right: 0;
  z-index: 80;
  height: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.chargement-page::before {
  content: '';
  position: absolute;
  inset: 0;
  width: 40%;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 30%, #fff 70%, rgba(255, 255, 255, 0));
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  animation: chargement-file 1.1s ease-in-out infinite;
}
@keyframes chargement-file { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.est-en-navigation .chargement-page { opacity: 1; }

/* --- Chat : message en attente d'envoi --- */
.message--en-attente { opacity: 0.6; }
.message__attente { display: none; font-size: 11px; line-height: 14px; opacity: 0.85; }
.message--sans-reseau .message__attente { display: block; }

/* --- Chat : « Léa écrit… » au-dessus de la barre de message (sans fond ni photo) --- */
.ecrit {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  max-width: 100%;
  padding: 0 6px; /* sans fond : posé sur le flou de la zone de saisie */
  font-size: var(--texte-petit);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  line-height: 17px;
  animation: apparaitre 0.25s;
}
.ecrit[hidden] { display: none; }
.ecrit__points { display: flex; gap: 3px; }
.ecrit__points span { width: 6px; height: 6px; border-radius: 50%; background: var(--blanc); animation: point-saute 1.2s ease-in-out infinite; }
.ecrit__points span:nth-child(2) { animation-delay: 0.15s; }
.ecrit__points span:nth-child(3) { animation-delay: 0.3s; }
@keyframes point-saute { 0%, 60%, 100% { transform: translateY(0); opacity: 0.6; } 30% { transform: translateY(-4px); opacity: 1; } }
.ecrit__texte { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }

/* Chat : le bouton photo se retire dès qu'on écrit (le texte prend la place), et revient si on efface tout */
.saisie-chat__photo {
  overflow: hidden;
  transition: transform 0.15s, width 0.3s var(--doux), margin 0.3s var(--doux), opacity 0.2s, visibility 0.3s;
}
.saisie-chat__barre:has(.saisie-chat__texte:not(:placeholder-shown)) .saisie-chat__photo {
  width: 0;
  margin-right: -4px; /* compense l'écart entre les boutons */
  opacity: 0;
  visibility: hidden;
}
/* Sans le bouton photo, le texte s'écarte un peu plus du bord arrondi */
.saisie-chat__texte { transition: padding-left 0.3s var(--doux); }
.saisie-chat__texte:not(:placeholder-shown) { padding-left: 14px; }

/* --- Chat : bouton + qui dévoile Images et GIF au-dessus de lui --- */
/* Bouton + (fond rond comme avant, icône sans cercle) : il tourne en × quand les choix sont ouverts */
.saisie-chat__plus img { transition: transform 0.3s var(--ressort); }
.saisie-chat__plus[aria-expanded='true'] img { transform: rotate(45deg); }
.choix-ajout {
  position: absolute;
  left: calc(var(--marge-ecran) - 0.5px); /* centrés sur l'axe du bouton + (41 px) */
  bottom: 63px; /* juste au-dessus de la barre (53 px) */
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.choix-ajout[hidden] { display: none; }
.choix-ajout__bouton {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--blanc);
  font: inherit;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.5px;
  background: var(--noir-30);
  -webkit-backdrop-filter: var(--flou-fort);
  backdrop-filter: var(--flou-fort);
  box-shadow: var(--ombre-cta-petit), var(--reflet-cta-petit);
  cursor: pointer;
  animation: choix-sort 0.3s var(--ressort) backwards;
}
.choix-ajout__bouton:nth-child(1) { animation-delay: 0.05s; } /* GIF, le plus haut, arrive juste après Images */
.choix-ajout__bouton img { width: 30px; height: 30px; }
.choix-ajout__bouton:active { transform: scale(0.88); }
@keyframes choix-sort { from { opacity: 0; transform: translateY(20px) scale(0.6); } }
/* Fermeture : le même mouvement à l'envers, GIF (le plus haut) part en premier */
.choix-ajout.est-fermeture { pointer-events: none; }
.choix-ajout.est-fermeture .choix-ajout__bouton { animation: choix-rentre 0.2s var(--doux) forwards; }
.choix-ajout.est-fermeture .choix-ajout__bouton:nth-child(1) { animation-delay: 0s; }
.choix-ajout.est-fermeture .choix-ajout__bouton:nth-child(2) { animation-delay: 0.05s; }
@keyframes choix-rentre { to { opacity: 0; transform: translateY(20px) scale(0.6); } }

/* --- Panneau GIF --- */
.feuille__panneau--gif { height: calc(100dvh - var(--haut-sur) - 80px); }
.gif-grille { columns: 2; column-gap: 6px; }
.gif-choix {
  display: block;
  width: 100%;
  margin: 0 0 6px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--rayon-element);
  background: none;
  break-inside: avoid;
  cursor: pointer;
}
.gif-choix img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gif-choix:active { transform: scale(0.96); }
:is(.gif-choix img):not(.est-chargee) {
  background-color: rgba(255, 255, 255, 0.1);
  background-image: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.22) 50%, transparent 70%);
  background-size: 300% 100%;
  animation: scintille 1.5s linear infinite;
}
.gif-message { margin: 0; text-align: center; opacity: 0.85; }
.gif-source { margin: 0; font-size: 11px; text-align: center; opacity: 0.6; }

/* --- Mini-Apps : Le Labo (noir et rose), pastille de nouveauté, apps pas encore disponibles grisées --- */
.mini-app__icone { position: relative; }
.mini-app__icone--minou { background: linear-gradient(180deg, #ffe3c9, #f9c9a6); box-shadow: var(--ombre-cta-gros), inset 0 0 0 2.5px #6b4a50; }
.mini-app__icone--minou img { width: 46px; height: 46px; }
.mini-app__icone--labo { background: #0d0b0c; box-shadow: var(--ombre-cta-gros), 0 0 12px rgba(255, 79, 139, 0.45), inset 0 0 0 2.5px #ff4f8b, inset 0 0 14px rgba(255, 79, 139, 0.35); }
.mini-app__pastille { left: 50px; top: -6px; animation: battement 2.4s ease-in-out infinite; }
.mini-app--bientot { opacity: 0.55; }
.mini-app--bientot .mini-app__icone { filter: grayscale(1); }
.nouvelle__icone--labo { background: #0d0b0c; box-shadow: inset 0 0 0 2.5px #ff4f8b, inset 0 0 14px rgba(255, 79, 139, 0.35); }
.mini-apps { gap: 6px; }
.mini-app { flex: 1 1 0; min-width: 0; max-width: 105px; text-align: center; }

/* --- Profil > Notifications : un interrupteur par type --- */
.choix-notifs { gap: 4px; padding: 6px 12px; }
.interrupteur { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; cursor: pointer; }
.interrupteur + .interrupteur { border-top: 1px solid rgba(255, 255, 255, 0.15); }
.interrupteur input { position: absolute; opacity: 0; pointer-events: none; }
.interrupteur__piste {
  position: relative;
  flex-shrink: 0;
  width: 46px;
  height: 28px;
  border-radius: 14px;
  background: var(--noir-30);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: background-color 0.25s;
}
.interrupteur__piste::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blanc);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s var(--ressort);
}
.interrupteur input:checked + .interrupteur__piste { background: var(--cta-violet); }
.interrupteur input:checked + .interrupteur__piste::after { transform: translateX(18px); }
.interrupteur input:focus-visible + .interrupteur__piste { box-shadow: 0 0 0 3px var(--blanc-60); }

/* ==========================================================================
   Intro : toute première ouverture de l'app (écran de connexion), une seule fois par appareil.
   1. « toucher pour commencer » (le son n'est permis qu'après un toucher)
   2. Montée sourde : le logo se dévoile doucement dans le noir
   3. Impact (≈ 2,4 s) : flash, secousse, le logo s'allume
   4. « L'app est enfin là ! », puis fondu vers la connexion (js/intro.js)
   ========================================================================== */
/* Guide d'installation (téléphone, app pas encore sur l'écran d'accueil) : page toute simple, fond blanc */
.guide-install { display: none; }
html.guide { background-color: #f7f4f5 !important; } /* la couleur de fond écrite dans la page est orange */
.guide body::before { background: #f7f4f5; }
.guide .guide-install {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  overflow-y: auto;
  padding: calc(var(--haut-sur) + 32px) 28px calc(32px + var(--bas-sur));
  background: #f7f4f5;
  color: #1d1a1b;
  font-family: var(--police-texte);
  text-align: center;
}
.guide :is(.connexion, .ouverture, main) { display: none; }
.guide-install__icone-app { width: 96px; height: 96px; border-radius: 22px; box-shadow: 0 10px 24px rgba(225, 37, 94, 0.3); }
/* Carte claire, même mise en page que les cartes de l'app */
.guide-install__carte {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  width: 100%;
  max-width: 357px;
  padding: 30px 26px;
  border-radius: var(--rayon-carte);
  background: #fff;
  box-shadow: 0 10px 30px rgba(29, 26, 27, 0.1), 0 0 0 1px rgba(29, 26, 27, 0.06);
  animation: contenu-entre 0.6s var(--doux) 0.1s backwards;
}
.guide-install__titre { font-size: 22px; font-weight: 700; line-height: 29px; }
.guide-install__etapes {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 320px;
  margin: 0;
  padding-left: 22px;
  text-align: left;
  font-size: 16px;
  font-weight: 500;
  line-height: 23px;
  color: #4a4447;
}
.guide-install__etapes[hidden] { display: none; }
.guide-install__icone { display: inline-grid; place-items: center; width: 26px; height: 26px; margin: -4px 2px; border-radius: 7px; background: #f1edef; vertical-align: middle; }
.guide-install__icone img { filter: invert(1); }
.guide-install__bouton {
  margin-bottom: 18px;
  padding: 14px 28px;
  border: 0;
  border-radius: var(--rayon-bouton);
  background: var(--cta-violet);
  color: #fff;
  font-family: var(--police-texte);
  font-size: 16px;
  font-weight: 700;
}

.intro-ecran { display: none; }
/* Pendant l'intro, tout est noir, y compris le fond de la fenêtre (visible quand on tire l'écran) */
html.intro { background-color: #000 !important; }
.intro body::before { background: #000; }
.intro .intro-ecran {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #000;
}
.intro-fin .intro-ecran { animation: disparaitre 0.9s ease-in forwards; }
/* Pendant l'intro, l'écran de connexion attend (ses animations repartent quand l'intro s'efface) */
.intro :is(.connexion, .connexion *, .ouverture, .ouverture *) { animation-play-state: paused !important; }

/* 1. Départ */
.intro__depart {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 0;
  background: none;
  color: var(--blanc-60);
  font-family: var(--police-texte);
  font-size: var(--texte);
  font-weight: 500;
  cursor: pointer;
}
.intro__point { width: 8px; height: 8px; border-radius: 50%; background: #ff4f8b; box-shadow: 0 0 14px 4px rgba(255, 79, 139, 0.6); animation: intro-respire 3.2s ease-in-out infinite; }
/* Respiration : inspire (grossit, s'illumine), expire (revient), sans pause */
@keyframes intro-respire {
  0%, 100% { transform: scale(1); box-shadow: 0 0 10px 3px rgba(255, 79, 139, 0.45); }
  50% { transform: scale(1.9); box-shadow: 0 0 22px 8px rgba(255, 79, 139, 0.7); }
}
.intro-lancee .intro__depart { animation: disparaitre 0.4s ease-out forwards; pointer-events: none; }

/* La scène n'existe qu'une fois lancée */
.intro__scene { position: relative; display: flex; flex-direction: column; align-items: center; gap: 28px; padding: 0 24px; visibility: hidden; }
.intro-lancee .intro__scene { visibility: visible; animation: intro-secousse 0.45s linear 2.4s; }
@keyframes intro-secousse {
  10% { transform: translate(-6px, 3px); } 25% { transform: translate(5px, -4px); }
  40% { transform: translate(-4px, -2px); } 55% { transform: translate(3px, 3px); }
  70% { transform: translate(-2px, 1px); } 85% { transform: translate(1px, -1px); }
}

/* Halo : couve pendant la montée, explose à l'impact puis respire */
.intro__lueur {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 560px;
  height: 560px;
  margin: -280px 0 0 -280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(225, 37, 94, 0.42) 0%, rgba(243, 139, 75, 0.12) 38%, transparent 68%);
  opacity: 0;
}
.intro-lancee .intro__lueur { animation: intro-lueur-monte 2.4s ease-in 0.2s forwards, intro-lueur-impact 2.6s cubic-bezier(0.16, 1, 0.3, 1) 2.4s forwards; }
@keyframes intro-lueur-monte { from { opacity: 0; transform: scale(0.4); } to { opacity: 0.35; transform: scale(0.7); } }
@keyframes intro-lueur-impact { from { opacity: 1; transform: scale(1.35); } to { opacity: 0.75; transform: scale(1); } }

/* Logo : se dévoile très doucement (balayage flou, à peine visible), puis s'allume d'un coup à l'impact */
.intro__logo { position: relative; width: min(330px, 80vw); }
.intro__logo img { width: 100%; height: auto; opacity: 0; }
.intro-lancee .intro__logo img {
  -webkit-mask: linear-gradient(100deg, #000 40%, transparent 60%) 100% 0 / 260% 100% no-repeat;
  mask: linear-gradient(100deg, #000 40%, transparent 60%) 100% 0 / 260% 100% no-repeat;
  animation: intro-logo-devoile 2s cubic-bezier(0.45, 0, 0.2, 1) 0.4s forwards, intro-logo-allume 1.6s cubic-bezier(0.16, 1, 0.3, 1) 2.4s forwards;
}
@keyframes intro-logo-devoile {
  from { opacity: 0.25; filter: brightness(0.35) blur(5px); -webkit-mask-position: 100% 0; mask-position: 100% 0; }
  to { opacity: 0.45; filter: brightness(0.45) blur(1.5px); -webkit-mask-position: 0 0; mask-position: 0 0; }
}
@keyframes intro-logo-allume {
  0% { opacity: 1; filter: brightness(2.4); -webkit-mask-position: 0 0; mask-position: 0 0; }
  20% { filter: brightness(1.3); }
  100% { opacity: 1; filter: brightness(1); -webkit-mask-position: 0 0; mask-position: 0 0; }
}
/* Glitch de couleurs puis lueur : sur le conteneur (sur l'image, le masque coupait la lueur en rectangle) */
.intro-lancee .intro__logo { animation: intro-logo-glitch 1.6s cubic-bezier(0.16, 1, 0.3, 1) 2.4s forwards; }
@keyframes intro-logo-glitch {
  0% { filter: drop-shadow(-4px 0 0 rgba(0, 255, 255, 0.7)) drop-shadow(4px 0 0 rgba(255, 0, 90, 0.7)); transform: scale(1.06); }
  12% { filter: drop-shadow(3px 0 0 rgba(0, 255, 255, 0.5)) drop-shadow(-3px 0 0 rgba(255, 0, 90, 0.5)); transform: scale(0.99) translateX(-2px); }
  20% { filter: drop-shadow(0 0 0 transparent) drop-shadow(0 0 0 transparent); transform: none; }
  100% { filter: drop-shadow(0 0 16px rgba(255, 79, 139, 0.45)) drop-shadow(0 0 0 transparent); transform: none; }
}
/* Reflet qui file sur le logo juste après l'impact */
.intro__eclat {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, 0.9) 50%, transparent 60%) 120% 0 / 300% 100% no-repeat;
  -webkit-mask: url('/assets/images/logo-cat-friends.webp') center / contain no-repeat;
  mask: url('/assets/images/logo-cat-friends.webp') center / contain no-repeat;
  mix-blend-mode: screen;
  opacity: 0;
}
.intro-lancee .intro__eclat { animation: intro-eclat 1s ease-in-out 2.9s; }
@keyframes intro-eclat { from { opacity: 1; background-position: 120% 0; } to { opacity: 1; background-position: -20% 0; } }

/* Flash blanc à l'impact */
.intro__flash { position: fixed; inset: 0; background: radial-gradient(circle at 50% 50%, #fff 0%, rgba(255, 200, 220, 0.6) 30%, transparent 70%); opacity: 0; pointer-events: none; }
.intro-lancee .intro__flash { animation: intro-flash 0.7s ease-out 2.4s; }
@keyframes intro-flash { from { opacity: 0.85; } to { opacity: 0; } }

/* Texte : apparaît en grésillant */
.intro__texte {
  position: relative;
  font-family: var(--police-titre);
  font-size: 24px;
  line-height: 30px;
  text-align: center;
  color: var(--titre-galerie);
  text-shadow: 0 0 18px rgba(225, 37, 94, 0.7);
  opacity: 0;
}
.intro-lancee .intro__texte { animation: intro-texte 0.9s steps(1) 3.3s forwards; }
@keyframes intro-texte {
  0% { opacity: 0.6; transform: translateX(-3px); } 8% { opacity: 0; } 16% { opacity: 0.9; transform: translateX(2px); }
  24% { opacity: 0.2; } 32% { opacity: 1; transform: none; } 100% { opacity: 1; transform: none; }
}

/* ==========================================================================
   Cartes d'accueil d'un nouveau membre (bienvenue.php) : fond aux chats de la connexion, une carte à la fois
   ========================================================================== */
.accueil-cartes {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center; /* cartes toujours centrées sur la hauteur */
  padding: calc(var(--haut-sur) + 64px) 22px calc(40px + var(--bas-sur));
}
/* Points de progression fixés en haut : ils ne bougent pas quand la hauteur de la carte change */
.accueil-cartes__points { position: absolute; top: calc(var(--haut-sur) + 28px); left: 50%; display: flex; gap: 8px; transform: translateX(-50%); }
.accueil-cartes__point {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: var(--blanc-60);
  opacity: 0.6;
  transition: width 0.45s var(--ressort), opacity 0.3s, background-color 0.3s;
}
.accueil-cartes__point.est-fait { opacity: 1; }
.accueil-cartes__point.est-actif { width: 28px; opacity: 1; background: var(--blanc); }
.accueil-cartes__pile { position: relative; display: grid; width: 100%; max-width: 357px; }

.etape { align-items: center; gap: 20px; padding: 32px 26px; text-align: center; }
.etape[hidden] { display: none; }
.etape .titre-carte { font-size: var(--titre-xl); line-height: 50px; }
.etape__texte { line-height: 22px; opacity: 0.92; }
.etape__texte--petit { font-size: var(--texte-petit); line-height: 19px; }
.etape__image { width: 96px; height: 96px; border-radius: 22px; box-shadow: var(--ombre-cta-gros); }
.etape__image--chat { width: 110px; height: 110px; border-radius: 0; box-shadow: none; }
/* Le chat se balance doucement (déclaré après l'apparition des éléments, pour ne pas être remplacé) */
@keyframes etape-chat { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
.etape__liste { display: flex; flex-direction: column; gap: 10px; width: 100%; margin: 0; padding: 14px 16px 14px 34px; border-radius: var(--rayon-champ); background: var(--noir-30); text-align: left; font-size: var(--texte-petit); line-height: 20px; }
div.etape__liste { padding-left: 16px; }
div.etape__liste ol { display: flex; flex-direction: column; gap: 10px; margin: 0; padding-left: 18px; }
.etape__liste[hidden] { display: none; }
.etape__icone { display: inline-grid; place-items: center; width: 26px; height: 26px; margin: -4px 2px; border-radius: 7px; background: rgba(255, 255, 255, 0.18); vertical-align: middle; }
.etape__avatar { width: 120px; height: 120px; box-shadow: var(--ombre-cta-gros); }
.etape__choix-photo { align-self: stretch; flex-direction: row; justify-content: space-between; cursor: pointer; }
.etape__prenom { font-size: 26px; line-height: 32px; }
.etape__prenom.pop { animation: pop 0.45s var(--ressort); }
.etape__couleurs { width: 100%; }
.etape .bulle, .etape > .bouton { align-self: stretch; }
.etape__actions { display: flex; flex-direction: column; align-items: center; gap: 8px; align-self: stretch; margin-top: 4px; }
.etape__actions .bouton { width: 100%; justify-content: center; }
.etape--finale .etape__texte { font-size: 17px; line-height: 25px; }

/* Passage d'une carte à l'autre : l'ancienne part à gauche en basculant, la nouvelle arrive de la droite
   avec un rebond, puis ses éléments apparaissent l'un après l'autre */
.etape.est-sortie { animation: etape-sort 0.32s cubic-bezier(0.55, 0, 0.75, 0.2) forwards; pointer-events: none; }
@keyframes etape-sort { to { opacity: 0; transform: translateX(-70px) rotate(-5deg) scale(0.92); } }
.etape.est-entree { animation: etape-entre 0.6s var(--ressort) backwards; }
@keyframes etape-entre { from { opacity: 0; transform: translateX(90px) rotate(6deg) scale(0.9); } }
.etape.est-entree > * { animation: etape-element 0.5s var(--doux) backwards; }
.etape.est-entree > :nth-child(1) { animation-delay: 0.12s; }
.etape.est-entree > :nth-child(2) { animation-delay: 0.19s; }
.etape.est-entree > :nth-child(3) { animation-delay: 0.26s; }
.etape.est-entree > :nth-child(4) { animation-delay: 0.33s; }
.etape.est-entree > :nth-child(5) { animation-delay: 0.4s; }
.etape.est-entree > :nth-child(n + 6) { animation-delay: 0.47s; }
@keyframes etape-element { from { opacity: 0; transform: translateY(14px); } }
.etape__image--chat, .etape.est-entree > .etape__image--chat { animation: etape-element 0.5s var(--doux) 0.12s backwards, etape-chat 2.4s ease-in-out 0.6s infinite; }
/* Première carte affichée : arrivée depuis le bas */
.etape:not(.est-entree):not(.est-sortie) { animation: contenu-entre 0.6s var(--doux) 0.15s backwards; }

/* ==========================================================================
   Construction de l'accueil (après « C'est parti ! » des cartes d'accueil) :
   la barre du haut descend, la barre du bas monte, puis les blocs arrivent un par un
   ========================================================================== */
/* Vitesse : 1 après une connexion ou les cartes d'accueil ; plus rapide à chaque ouverture de l'app */
:root { --vitesse-construction: 1; }
.construction--rapide { --vitesse-construction: 0.42; }
.construction .barre-haut { animation: construit-haut calc(1s * var(--vitesse-construction)) var(--ressort) calc(0.2s * var(--vitesse-construction)) backwards; }
@keyframes construit-haut { from { transform: translateY(-110%); } }
.construction .barre-haut__avatar { animation: pop calc(0.7s * var(--vitesse-construction)) var(--ressort) calc(0.85s * var(--vitesse-construction)) backwards; }
.construction .titre-page { animation: construit-titre calc(0.85s * var(--vitesse-construction)) var(--doux) calc(1s * var(--vitesse-construction)) backwards; }
@keyframes construit-titre { from { opacity: 0; transform: translateX(-24px); filter: blur(4px); } }
.construction .barre-bas { animation: construit-bas calc(1s * var(--vitesse-construction)) var(--ressort) calc(0.4s * var(--vitesse-construction)) backwards; }
@keyframes construit-bas { from { transform: translateY(130%); } }
.construction .onglet { animation: pop calc(0.7s * var(--vitesse-construction)) var(--ressort) backwards; }
.construction .onglet:nth-child(1) { animation-delay: calc(1.05s * var(--vitesse-construction)); }
.construction .onglet:nth-child(2) { animation-delay: calc(1.22s * var(--vitesse-construction)); }
.construction .onglet:nth-child(3) { animation-delay: calc(1.39s * var(--vitesse-construction)); }
.construction .ecran > * { animation: construit-bloc calc(1.1s * var(--vitesse-construction)) var(--ressort) backwards; }
@keyframes construit-bloc { from { opacity: 0; transform: translateY(56px) scale(0.9); } }
.construction .ecran > :nth-child(1) { animation-delay: calc(1.25s * var(--vitesse-construction)); }
.construction .ecran > :nth-child(2) { animation-delay: calc(1.47s * var(--vitesse-construction)); }
.construction .ecran > :nth-child(3) { animation-delay: calc(1.69s * var(--vitesse-construction)); }
.construction .ecran > :nth-child(4) { animation-delay: calc(1.91s * var(--vitesse-construction)); }
.construction .ecran > :nth-child(5) { animation-delay: calc(2.13s * var(--vitesse-construction)); }
.construction .ecran > :nth-child(n + 6) { animation-delay: calc(2.35s * var(--vitesse-construction)); }

/* Gestion des membres : explication sous « Supprimer le compte » */
.membre-ligne__note { font-size: var(--texte-petit); line-height: 18px; opacity: 0.75; }

/* ==========================================================================
   Recadrage de la photo de profil (js/app.js : recadrerPhoto)
   ========================================================================== */
.recadrage {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: calc(var(--haut-sur) + 20px) 20px calc(20px + var(--bas-sur));
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: apparaitre 0.25s ease-out;
}
.recadrage.est-fermeture { animation: disparaitre 0.25s ease-in forwards; }
.recadrage__panneau {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 357px;
  padding: 26px 22px 22px;
  border-radius: var(--rayon-carte);
  background: var(--noir-30);
  -webkit-backdrop-filter: var(--flou-fort);
  backdrop-filter: var(--flou-fort);
  box-shadow: var(--relief);
  animation: contenu-entre 0.4s var(--doux) backwards;
}
.recadrage__zone {
  position: relative;
  width: min(300px, 78vw);
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 18px;
  background: #000;
  touch-action: none;
  cursor: grab;
}
.recadrage__zone:active { cursor: grabbing; }
.recadrage__zone canvas { display: block; width: 100%; height: 100%; }
/* Cercle : tout ce qui est autour est assombri (c'est ce qui sera coupé à l'affichage) */
.recadrage__cercle { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 200px rgba(0, 0, 0, 0.5), inset 0 0 0 2px rgba(255, 255, 255, 0.85); pointer-events: none; }
.recadrage__cercle--rect { border-radius: 4px; }
.recadrage__aide { font-size: var(--texte-petit); opacity: 0.8; }
.recadrage__zoom { width: 100%; accent-color: #e1257d; }
.recadrage__boutons { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; }
.recadrage__boutons .bouton { flex: 1; justify-content: center; }

/* Bande sous la barre d'état : noire pendant l'intro, claire sur le guide d'installation */
.intro body::after { background: #000; }
.guide body::after { background: #f7f4f5; }

/* Clavier ouvert (téléphone) : la barre du bas reste dessous, la saisie se colle au clavier */
.clavier-ouvert { --bas-barre: 8px; }
.clavier-ouvert .barre-bas { transform: translateY(calc(100% + 20px)); pointer-events: none; }
.barre-bas { transition: transform 0.3s var(--doux); }

/* Clavier ouvert dans un panneau (Statut, Profil, album…) : sous le panneau, jusqu'au clavier, l'iPhone montre
   la couleur de fond de la fenêtre (orange) : elle prend la teinte sombre du panneau, qui semble ainsi descendre
   jusque sous le clavier */
html.clavier-ouvert:has(.feuille:not([hidden])) { background-color: #4a2a24 !important; }

/* ==========================================================================
   Comportement d'app, pas de navigateur : pas de sélection de texte (appui long), pas de zoom au double toucher,
   pas de barre de défilement, pas de menu « copier / enregistrer l'image » à l'appui long.
   Les champs de saisie restent sélectionnables.
   ========================================================================== */
html { touch-action: manipulation; scrollbar-width: none; }
* { scrollbar-width: none; }
::-webkit-scrollbar { display: none; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* Clavier ouvert sur iPhone (seulement) : l'en-tête et la bande sous la barre d'état suivent la partie visible de
   l'écran. Hors clavier, l'en-tête reste strictement fixe (le rebond en bas de page déplace aussi la partie visible). */
.clavier-ouvert .barre-haut, .clavier-ouvert body::after { transform: translateY(var(--decalage-visible, 0px)); }

/* --- Réaction retirée (la pastille disparaît) : explosion en mini-émojis (js/app.js : exploserReaction) --- */
.explosion { position: fixed; z-index: 96; pointer-events: none; }
.explosion__eclat { position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; }
.explosion__eclat--blanc { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px rgba(255, 255, 255, 0.8); }
.explosion__eclat--blanc:nth-child(3n) { width: 4px; height: 9px; border-radius: 2px; }


/* Émoji qui s'envole du menu des réactions jusqu'au message */
.reaction-envol { position: fixed; z-index: 97; pointer-events: none; will-change: transform; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25)); }

/* --- GIF favoris : onglets Tendances / Favoris, étoile sur chaque GIF --- */
.gif-onglets { display: flex; gap: 8px; }
.gif-onglets[hidden] { display: none; }
.gif-onglet {
  flex: 1; padding: 9px 12px; border: 0; border-radius: 999px; font: inherit; font-weight: 700; font-size: 14px;
  color: inherit; background: rgba(255, 255, 255, 0.12); cursor: pointer; transition: background 0.2s, transform 0.15s;
}
.gif-onglet.est-actif { background: rgba(255, 255, 255, 0.92); color: #3a2230; }
.gif-onglet:active { transform: scale(0.96); }
.gif-carte { position: relative; break-inside: avoid; margin: 0 0 6px; }
.gif-carte .gif-choix { margin: 0; }
.gif-favori {
  position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.45); color: #fff; font-size: 17px; line-height: 1; cursor: pointer;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: transform 0.2s var(--ressort);
}
.gif-favori.est-favori { color: #ffd84d; }
.gif-favori:active { transform: scale(0.85); }
.gif-favori.pop { animation: pop 0.4s var(--ressort); }
.menu-message__etoile { font-size: 22px; line-height: 24px; width: 24px; text-align: center; color: #ffd84d; }

/* Connexion avec une passkey (Face ID) : sous la carte du choix de profil */
.bouton--passkey { width: 100%; margin-top: 16px; }
