/* Cardiboo — la machine à cartes animées */
:root {
  --creme: #FFF4E6;
  --papier: #FFFFFF;
  --encre: #2B2140;
  --encre-2: #5B5370;
  --corail: #FF5A5F;
  --soleil: #FFC845;
  --menthe: #2EC4B6;
  --violet: #7B61FF;
  --rose: #FF8FC7;
  --police: "Arial Rounded MT Bold", "Nunito", "Varela Round", "Trebuchet MS", system-ui, -apple-system, "Segoe UI", sans-serif;
  --texte: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ombre: 4px 4px 0 var(--encre);
  --rayon: 18px;
  --item: 74px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--creme);
  background-image: radial-gradient(circle at 1px 1px, rgba(43, 33, 64, .09) 1.3px, transparent 0);
  background-size: 22px 22px;
  color: var(--encre);
  font-family: var(--texte);
  line-height: 1.45;
}
:focus-visible { outline: 3px solid var(--violet); outline-offset: 3px; }
button { -webkit-tap-highlight-color: transparent; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- En-tête ---------- */
.entete {
  max-width: 1080px; margin: 0 auto; padding: 16px 16px 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--encre); font: 900 22px var(--police); }
.logo svg { width: 40px; height: 40px; }
.slogan { margin: 0; font-size: 14px; color: var(--encre-2); text-align: right; }
.slogan strong { color: var(--encre); }
@media (max-width: 560px) { .slogan { text-align: left; font-size: 13px; } }

/* ---------- Grille de l'atelier ---------- */
.atelier {
  max-width: 1080px; margin: 0 auto; padding: 8px 16px 120px;
  display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "mode" "occ" "qui" "machine" "mot" "envoi";
}
.mode-zone { grid-area: mode; min-width: 0; padding-top: 10px; }
.etape-occasion { grid-area: occ; }
.etape-qui { grid-area: qui; }
.machine-zone { grid-area: machine; min-width: 0; width: 100%; max-width: 470px; justify-self: center; }
.etape-mot { grid-area: mot; }
.envoi-zone { grid-area: envoi; }
@media (min-width: 900px) {
  .atelier {
    grid-template-columns: minmax(0, 430px) minmax(0, 1fr);
    grid-template-rows: auto auto auto auto 1fr;
    grid-template-areas: "machine mode" "machine occ" "machine qui" "machine mot" "machine envoi";
    column-gap: 30px; align-items: start; padding-bottom: 40px;
  }
  .machine-zone { position: sticky; top: 12px; }
}

/* ---------- Étapes ---------- */
.etape {
  background: var(--papier); border: 3px solid var(--encre); border-radius: var(--rayon);
  box-shadow: var(--ombre); padding: 14px 14px 16px; min-width: 0;
}
.etape h2 { margin: 0 0 10px; font: 900 18px var(--police); display: flex; align-items: center; gap: 8px; }
.num {
  display: inline-grid; place-items: center; width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%;
  background: var(--soleil); border: 2.5px solid var(--encre); font-size: 15px;
}

.puces { display: flex; gap: 8px; flex-wrap: wrap; }
.etape-occasion .puces { padding-top: 10px; }
.puce {
  position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 96px; padding: 10px 10px 8px; background: #fff; border: 2.5px solid var(--encre); border-radius: 16px;
  font: 800 13px var(--police); color: var(--encre); cursor: pointer; transition: transform .12s, box-shadow .12s, background-color .12s;
}
.puce-emoji { font-size: 27px; line-height: 1.05; }
.puce:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--encre); }
.puce[aria-pressed="true"] { background: var(--soleil); box-shadow: 3px 3px 0 var(--encre); transform: translate(-1px, -1px); }
.badge {
  position: absolute; top: -10px; right: -6px; font: 800 10px var(--police); padding: 2px 6px; border-radius: 10px;
  border: 2px solid var(--encre); white-space: nowrap; color: #fff;
}
.badge-saison { background: var(--corail); }
.badge-neuf { background: var(--violet); }
.puce-petite { flex-direction: row; min-width: 0; padding: 7px 12px; border-radius: 999px; gap: 5px; }
.puces-mini { margin-bottom: 4px; }
@media (max-width: 899px) {
  .etape-occasion .puces {
    flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
    margin: 0 -14px; padding: 12px 14px 8px;
  }
  .etape-occasion .puces::-webkit-scrollbar { display: none; }
  .etape-occasion .puce { flex: 0 0 auto; scroll-snap-align: start; }
}

/* ---------- Champs ---------- */
.champ { display: block; margin-top: 10px; }
.etiquette { display: block; font: 800 13px var(--police); margin-bottom: 4px; color: var(--encre-2); }
.etiquette em { font-weight: 400; font-style: normal; }
input[type="text"], input[type="date"], input[type="number"], textarea {
  width: 100%; font: 500 17px var(--texte); color: var(--encre); background: #FFFBF5;
  border: 2.5px solid var(--encre); border-radius: 14px; padding: 11px 13px; outline: none; transition: box-shadow .15s;
  min-height: 48px;
}
#prenom, #stdNoms { font: 900 22px var(--police); padding: 13px 15px; }
#champsPrenom .champ { margin-top: 0; }
input:focus, textarea:focus { box-shadow: 0 0 0 4px rgba(123, 97, 255, .3); }
textarea { resize: vertical; min-height: 92px; line-height: 1.4; }
.a-corriger { animation: secoue .4s; border-color: var(--corail) !important; }
.erreur { color: #C62828; font-weight: 700; font-size: 14px; margin: 8px 0 0; }
.erreur:empty { display: none; }
.champs-ligne { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 400px) { .champs-ligne { grid-template-columns: 1fr; } }

.mot-outils { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 4px; }
.btn-idee {
  font: 800 14px var(--police); color: var(--encre); background: #fff; border: 2.5px solid var(--encre); border-radius: 999px;
  padding: 11px 14px; cursor: pointer; box-shadow: 2px 2px 0 var(--encre); min-height: 48px;
}
.btn-idee:active { transform: translate(2px, 2px); box-shadow: none; }
.champ-signe { flex: 1; min-width: 180px; margin-top: 0; }

/* ---------- La machine ---------- */
.machine {
  position: relative; margin-right: 58px;
  background: linear-gradient(180deg, #FF6E72, #EE474D); border: 3px solid var(--encre);
  border-radius: 30px 30px 24px 24px; box-shadow: 6px 6px 0 var(--encre); padding: 10px 12px 14px;
}
.machine.vibre { animation: vibre .35s; }
.fronton { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.fronton-titre {
  margin: 0; font: 900 15px var(--police); color: #fff; letter-spacing: .08em; text-transform: uppercase;
  text-shadow: 2px 2px 0 var(--encre); white-space: nowrap;
}
.ampoules {
  flex: 1; height: 10px; min-width: 20px;
  background: radial-gradient(circle, #FFE38A 3.5px, transparent 4px) 0 50% / 16px 10px repeat-x;
  animation: ampoules 1s steps(2) infinite;
}
.ecran {
  position: relative; aspect-ratio: 3 / 4; border: 3px solid var(--encre); border-radius: 18px; overflow: hidden;
  background: #BDE6FF; box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .35);
}
.ecran-scene { position: absolute; inset: 0; }
.ecran-btn {
  position: absolute; top: 8px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 2.5px solid var(--encre);
  background: rgba(255, 255, 255, .92); font-size: 18px; cursor: pointer; display: grid; place-items: center; color: var(--encre);
}
.ecran-rejouer { left: 8px; font-weight: 900; }
.ecran-son { right: 8px; }

.rouleaux { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.rouleau { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.fenetre {
  position: relative; width: 100%; height: calc(var(--item) + 6px); overflow: hidden; padding: 0; cursor: pointer;
  border: 3px solid var(--encre); border-radius: 14px; background: #fff;
}
.fenetre::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(0, 0, 0, .18), transparent 22%, transparent 78%, rgba(0, 0, 0, .18));
}
.bande { display: flex; flex-direction: column; will-change: transform; }
.item { height: var(--item); flex: 0 0 var(--item); display: grid; place-items: center; }
.item .mini-heros { width: 62px; height: 62px; }
.item-emoji { font-size: 40px; line-height: 1; }
.rouleau.tourne .bande { filter: blur(1.3px); }
.rouleau.pile .fenetre { animation: pile .42s; }
.rouleau.secoue .fenetre { animation: secoue .45s; }
.rouleau.garde .fenetre { box-shadow: 0 0 0 3px var(--soleil); }
.rouleau-nom {
  font: 800 12px var(--police); color: #fff; text-shadow: 1px 1px 0 var(--encre); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.verrou {
  font: 800 11.5px var(--police); background: rgba(255, 255, 255, .94); color: var(--encre);
  border: 2px solid var(--encre); border-radius: 999px; padding: 4px 8px; cursor: pointer; white-space: nowrap; min-height: 30px;
}
.verrou[aria-pressed="true"] { background: var(--soleil); }
.tirer-indice {
  margin: 12px 0 2px; text-align: center; font: 800 14px var(--police); color: #fff; text-shadow: 1px 1px 0 var(--encre);
  animation: pulse 1.6s ease-in-out infinite;
}
.tirer-indice.vu { animation: none; opacity: .85; }

/* ---------- Le vrai levier : on attrape la boule et on tire ---------- */
.levier-zone { position: absolute; right: -58px; top: 26%; width: 58px; }
.levier-zone::before {
  content: ""; position: absolute; left: -4px; top: 104px; width: 30px; height: 76px; background: linear-gradient(90deg, #AEB7C4, #E6EAF0);
  border: 3px solid var(--encre); border-left: 0; border-radius: 0 14px 14px 0;
}
.levier {
  --L: 96px; --b: 50px; --m: 46px; --w: 15px;
  position: relative; display: block; width: calc(var(--m) + 4px); height: calc(var(--b) + var(--L) * 1.8 + 6px);
  touch-action: none; cursor: grab; outline: none; -webkit-user-select: none; user-select: none;
}
.levier.attrape { cursor: grabbing; }
.levier-tige {
  position: absolute; left: calc(var(--m) / 2 - var(--w) / 2); top: calc(var(--b) / 2); width: var(--w); height: var(--L);
  background: linear-gradient(90deg, #7F8A9C, #F7F9FC 42%, #A9B3C2 70%, #7F8A9C); border: 2.5px solid var(--encre);
  border-radius: calc(var(--w) / 2); transform-origin: 50% 100%; z-index: 2;
}
.levier-moyeu {
  position: absolute; left: 0; top: calc(var(--b) / 2 + var(--L) - var(--m) / 2); width: var(--m); height: var(--m); border-radius: 50%; z-index: 2;
  background: radial-gradient(circle at 35% 30%, #FFFFFF, #C9D2DD 45%, #7F8A9C 100%); border: 3px solid var(--encre);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .15);
}
.levier-moyeu::after { content: ""; position: absolute; inset: 32%; border-radius: 50%; background: #5B6578; border: 2px solid var(--encre); }
.levier-boule {
  position: absolute; left: calc(var(--m) / 2 - var(--b) / 2); top: 0; width: var(--b); height: var(--b); border-radius: 50%; z-index: 1;
  background: radial-gradient(circle at 32% 28%, #FFFFFF 0 7%, #FF9EA0 14%, #E63946 58%, #A3202B 100%);
  border: 3px solid var(--encre); box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
}
.levier:hover .levier-boule, .levier:focus-visible .levier-boule { filter: brightness(1.08); }
.levier:focus-visible .levier-boule { outline: 3px solid var(--violet); outline-offset: 3px; }
.levier-grand:not(.attrape):not(.tire) .levier-boule { animation: appel 2s ease-out infinite; }
.levier-petit { --L: 30px; --b: 26px; --m: 22px; --w: 8px; }
.astuce-machine { font-size: 13px; color: var(--encre-2); text-align: center; margin: 12px 58px 0 0; }

/* ---------- Envoi ---------- */
.envoi-barre { display: flex; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 50px;
  font: 900 17px var(--police); color: var(--encre); background: #fff; text-decoration: none; text-align: center;
  border: 3px solid var(--encre); border-radius: 16px; padding: 12px 18px; cursor: pointer;
  box-shadow: 0 4px 0 var(--encre); transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--encre); }
.btn-premier { background: var(--corail); color: #fff; text-shadow: 1px 1px 0 rgba(0, 0, 0, .25); }
.btn-jaune { background: var(--soleil); }
.envoi-barre .btn-premier { flex: 1; font-size: 19px; }
.confiance { font-size: 13px; color: var(--encre-2); text-align: center; margin: 10px 0 0; }
@media (max-width: 899px) {
  .envoi-zone {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255, 244, 230, .95); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    border-top: 3px solid var(--encre);
  }
  .envoi-zone .confiance { display: none; }
}
.pied { max-width: 1080px; margin: 0 auto; padding: 0 16px 130px; font-size: 13px; color: var(--encre-2); text-align: center; }
@media (min-width: 900px) { .pied { padding-bottom: 30px; } }

/* ---------- Feuilles (choix, envoi) ---------- */
.feuille { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.feuille[hidden] { display: none; }
.feuille-fond { position: absolute; inset: 0; background: rgba(43, 33, 64, .45); opacity: 0; transition: opacity .2s; }
.feuille-panneau {
  position: relative; width: 100%; max-width: 520px; max-height: 88vh; overflow: auto;
  background: var(--creme); border: 3px solid var(--encre); border-bottom: 0; border-radius: 24px 24px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .22s ease-out;
}
.feuille.ouverte .feuille-fond { opacity: 1; }
.feuille.ouverte .feuille-panneau { transform: none; }
@media (min-width: 600px) {
  .feuille { align-items: center; padding: 16px; }
  .feuille-panneau { border-radius: 24px; border-bottom: 3px solid var(--encre); box-shadow: 6px 6px 0 var(--encre); }
}
.feuille h2 { font: 900 20px var(--police); margin: 0 0 12px; }
.choix-grille { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choix-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px; background: #fff; color: var(--encre);
  border: 2.5px solid var(--encre); border-radius: 14px; padding: 8px 4px; cursor: pointer; font: 800 13px var(--police);
}
.choix-item[aria-pressed="true"] { background: var(--soleil); }
.choix-visuel { height: 64px; display: grid; place-items: center; }
.choix-visuel .mini-heros { width: 60px; height: 60px; }
.choix-visuel .item-emoji { font-size: 38px; }
.fermer { width: 100%; margin-top: 14px; }
.partages { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 6px; }
.partage {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 54px;
  font: 900 16px var(--police); color: var(--encre); background: #fff; text-decoration: none;
  border: 3px solid var(--encre); border-radius: 16px; padding: 12px 10px; cursor: pointer; box-shadow: 0 4px 0 var(--encre);
}
.partage:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--encre); }
.p-wa { grid-column: 1 / -1; background: #25D366; color: #fff; font-size: 19px; text-shadow: 1px 1px 0 rgba(0, 0, 0, .2); }
.partage[hidden] { display: none; }
.feuille-note { font-size: 13px; color: var(--encre-2); margin: 8px 0 0; }
#lienCarte { font-size: 14px; }

/* ---------- Lecteur ---------- */
body.lecteur-ouvert { overflow: hidden; }
.lecteur { position: fixed; inset: 0; z-index: 50; background: #1B1530; overflow: hidden; }
.lecteur[hidden] { display: none; }
.lecteur-scene { position: absolute; top: 0; bottom: 0; left: 0; right: 0; margin: 0 auto; max-width: 520px; }
.lecteur-haut {
  position: absolute; top: 0; left: 0; right: 0; max-width: 520px; margin: 0 auto; z-index: 10;
  display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 12px 0; pointer-events: none;
}
.lecteur-haut > * { pointer-events: auto; }
.lecteur-haut > [hidden] { display: none; }
.rond {
  width: 44px; height: 44px; border-radius: 50%; border: 2.5px solid var(--encre); background: rgba(255, 255, 255, .94);
  font: 900 19px var(--police); color: var(--encre); cursor: pointer; display: grid; place-items: center;
}
.lecteur-marque {
  margin-right: auto; font: 900 13px var(--police); color: #fff; background: rgba(43, 33, 64, .6);
  padding: 6px 12px; border-radius: 999px;
}

.enveloppe-ecran {
  position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 24px; text-align: center; color: #fff;
  background: rgba(27, 21, 48, .5); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  transition: opacity .35s .75s;
}
.enveloppe-ecran[hidden] { display: none; }
.enveloppe-ecran.ouverte { opacity: 0; }
.env-sur { margin: 0; max-width: 320px; font: 800 18px var(--police); text-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.env-pour { margin: 0; font: 900 30px var(--police); text-shadow: 2px 2px 0 var(--encre); }
.env-indice { margin: 0; font-size: 15px; opacity: .92; animation: pulse 1.6s ease-in-out infinite; }
.enveloppe {
  position: relative; width: 260px; height: 174px; border: 0; padding: 0; background: none; cursor: pointer;
  perspective: 700px; animation: fretille 2.6s ease-in-out infinite;
}
.enveloppe-ecran.ouverte .enveloppe { animation: none; }
.env-dos { position: absolute; inset: 0; background: #FFB27D; border: 3px solid var(--encre); border-radius: 14px; }
.env-carte {
  position: absolute; left: 18px; right: 18px; top: 12px; height: 140px; z-index: 1; background: #fff;
  border: 3px solid var(--encre); border-radius: 10px; transition: transform .55s .3s cubic-bezier(.3, 1.3, .5, 1);
}
.env-carte::before {
  content: ""; position: absolute; left: 22px; right: 22px; top: 20px; height: 10px; border-radius: 5px;
  background: var(--rose); box-shadow: 0 22px 0 #FFE38A, 0 44px 0 #A0E7E5;
}
.env-devant { position: absolute; inset: 0; z-index: 2; }
.env-devant::before {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 174' preserveAspectRatio='none'%3E%3Cpath d='M1.5 34 L130 110 L258.5 34 L258.5 160 Q258.5 172.5 246 172.5 L14 172.5 Q1.5 172.5 1.5 160 Z' fill='%23FFC9A3' stroke='%232B2140' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.env-rabat {
  position: absolute; left: 0; top: 0; width: 100%; height: 118px; z-index: 3; transform-origin: 50% 0;
  transition: transform .45s ease-in, z-index 0s .22s;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 118' preserveAspectRatio='none'%3E%3Cpath d='M1.5 14 Q1.5 1.5 14 1.5 L246 1.5 Q258.5 1.5 258.5 14 L130 112 Z' fill='%23FFA066' stroke='%232B2140' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
}
.env-cachet {
  position: absolute; left: 50%; top: 84px; width: 54px; height: 54px; margin-left: -27px; z-index: 4; border-radius: 50%;
  background: var(--corail); border: 3px solid var(--encre); display: grid; place-items: center; font-size: 25px;
  transition: transform .25s;
}
.enveloppe-ecran.ouverte .env-cachet { transform: scale(0) rotate(90deg); }
.enveloppe-ecran.ouverte .env-rabat { transform: rotateX(180deg); z-index: 0; }
.enveloppe-ecran.ouverte .env-carte { transform: translateY(-112px); }

.astuce-touche {
  position: absolute; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 6; margin: 0;
  background: rgba(43, 33, 64, .72); color: #fff; font: 800 14px var(--police); padding: 8px 14px; border-radius: 999px;
  animation: pulse 1.4s ease-in-out infinite; pointer-events: none;
}
.astuce-touche[hidden] { display: none; }

.ticket {
  position: absolute; left: 50%; top: 56%; z-index: 7; width: min(320px, calc(100% - 40px)); text-align: center;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  background: #fff; border: 3px solid var(--encre); border-radius: 20px; box-shadow: 6px 6px 0 var(--encre); padding: 14px;
  opacity: 0; transform: translate(-50%, -50%) scale(.6) rotate(-6deg); transition: transform .45s cubic-bezier(.3, 1.4, .5, 1), opacity .3s;
}
.ticket[hidden] { display: none; }
.ticket.visible { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-2deg); }
.ticket-titre { margin: 0 0 10px; font: 900 17px var(--police); }
.ticket-zone { position: relative; height: 108px; border-radius: 14px; overflow: hidden; border: 2.5px dashed var(--encre); }
.ticket-dessous {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: linear-gradient(135deg, #FFE3F1, #FFF6D6); padding: 8px;
}
.ticket-dessous strong { font: 900 27px/1.1 var(--police); color: var(--encre); }
.ticket-dessous span { font: 800 15px var(--police); color: var(--encre-2); }
#ticketCanvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; transition: opacity .5s; }
#ticketCanvas.efface { opacity: 0; pointer-events: none; }
.lien {
  position: absolute; left: 50%; top: calc(100% + 12px); transform: translateX(-50%); white-space: nowrap;
  background: rgba(255, 255, 255, .92); border: 2px solid var(--encre); border-radius: 999px; color: var(--encre); cursor: pointer;
  font: 800 14px var(--police); padding: 7px 14px; visibility: hidden; opacity: 0; transition: opacity .4s;
}
.lien.visible { visibility: visible; opacity: 1; }

.mot {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 9; max-width: 520px; margin: 0 auto;
  padding: 0 14px calc(14px + env(safe-area-inset-bottom));
  transform: translateY(110%); transition: transform .5s cubic-bezier(.25, 1.2, .4, 1);
}
.mot[hidden] { display: none; }
.mot.visible { transform: none; }
.mot-papier {
  background: #FFFDF8; border: 3px solid var(--encre); border-radius: 22px; box-shadow: 5px 5px 0 var(--encre);
  padding: 16px 18px; max-height: 58vh; overflow: auto; transform: rotate(-1deg);
}
.mot-surtitre { margin: 0; font: 900 12px var(--police); text-transform: uppercase; letter-spacing: .1em; color: var(--corail); }
.mot-titre { margin: 4px 0 8px; font: 900 23px/1.15 var(--police); }
.mot-texte { margin: 0; font-size: 17px; white-space: pre-line; overflow-wrap: anywhere; }
.mot-signe { margin: 10px 0 0; font: 800 16px var(--police); color: var(--encre-2); text-align: right; }
.mot-signe:empty { display: none; }
.mot-std { background: #FFF0F6; border: 2.5px solid var(--encre); border-radius: 16px; padding: 10px 12px 12px; margin: 0 0 10px; text-align: center; }
.mot-std[hidden] { display: none; }
.mot-date { margin: 0; font: 900 20px var(--police); }
.mot-date::first-letter { text-transform: uppercase; }
.mot-lieu { margin: 2px 0 0; font-weight: 700; }
.mot-lieu:empty { display: none; }
.mot-compte {
  display: inline-block; margin: 8px 0; background: var(--soleil); border: 2px solid var(--encre); border-radius: 999px;
  padding: 3px 12px; font: 900 14px var(--police);
}
.mot-compte:empty { display: none; }
.agenda .btn { width: 100%; font-size: 15px; min-height: 46px; padding: 10px; }
.agenda-choix { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.agenda-choix[hidden] { display: none; }
.agenda-choix .btn { font-size: 13px; padding: 9px 6px; }
.mot-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.mot-actions .btn { font-size: 15px; padding: 10px 8px; }
.mot-actions .btn-jaune { grid-column: 1 / -1; }

.toast {
  position: fixed; left: 50%; bottom: 96px; z-index: 80; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--encre); color: #fff; font: 800 14px var(--police); padding: 10px 16px; border-radius: 999px;
  transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center;
}
.toast.visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Scène SVG ---------- */
.cq-scene { display: block; width: 100%; height: 100%; }
.cq-scene text { font-family: var(--police); font-weight: 900; }
.cq-lettre-face { paint-order: stroke; stroke: var(--encre); stroke-width: 7px; stroke-linejoin: round; }
.cq-lettre-ombre { fill: var(--encre); stroke: var(--encre); stroke-width: 7px; stroke-linejoin: round; opacity: .35; }
.lt-bob { animation: bob 2.2s ease-in-out infinite; }
.lt.neon .cq-lettre-face { stroke: #fff; stroke-width: 2.5px; animation: neon 2.4s linear infinite; }
.lt.neon .cq-lettre-ombre { display: none; }
.cq-ruban-txt { fill: #fff; font-size: 16px; letter-spacing: .06em; paint-order: stroke; stroke: var(--encre); stroke-width: 3px; stroke-linejoin: round; }
.cq-bulle-txt { fill: var(--encre); font-size: 14px; }
.cq-banniere-txt { fill: var(--encre); font-size: 17px; letter-spacing: .04em; }
.cq-cal-mois { fill: #fff; font-size: 15px; letter-spacing: .08em; }
.cq-cal-jour { fill: var(--encre); font-size: 46px; }
.cq-cal-annee { fill: var(--encre-2); font-size: 15px; }
.cq-cal-lieu { fill: var(--encre); font-size: 13px; }

.hz-oeil-joie, .hz-bouche-o, .hz-bouche-rire, .hz-suie, .hz-bandeau, .hz-vertige { display: none; }
.hz.joie .hz-oeil-ouvert, .hz.ferme .hz-oeil-ouvert { display: none; }
.hz.joie .hz-oeil-joie, .hz.ferme .hz-oeil-joie { display: inline; }
.hz.joie .hz-bouche { display: none; }
.hz.joie .hz-bouche-rire { display: inline; }
.hz.surpris .hz-bouche, .hz.surpris .hz-bouche-rire { display: none; }
.hz.surpris .hz-bouche-o { display: inline; }
.hz.suie .hz-suie { display: inline; }
.hz.suie .hz-oeil { fill: #fff; }
.hz.suie .hz-oeil-joie path { stroke: #fff; }
.hz.suie .hz-bouche { stroke: #fff; }
.hz.bandeau .hz-bandeau { display: inline; }
.hz.vertige .hz-vertige { display: inline; }
.cq-scene .hz-corps { animation: respire 2.6s ease-in-out infinite; }
.cq-scene .hz.marche .hz-corps { animation: marche .34s ease-in-out infinite alternate; }
.cq-scene .hz-flotte .hz-corps { animation: flotte 2s ease-in-out infinite; }
.cq-scene .hz-yeux { animation: cligne 4.2s infinite; }
.cq-scene .hz-queue { animation: queue .5s ease-in-out infinite alternate; }
.cq-scene .hz-oreille { animation: oreille 1.4s ease-in-out infinite alternate; }
.cq-scene .hz-oreille-d { animation-direction: alternate-reverse; }
.cq-scene .hz-vertige { animation: tourne 1s linear infinite; }
.cq-scene .hz-antenne, .cq-scene .hz-led { animation: clignote 1.1s steps(2) infinite; }

.d-scint { animation: scint 2.4s ease-in-out infinite; }
.d-nuage { animation: nuage var(--d) linear infinite; }
.d-soleil { animation: tourne 40s linear infinite; }
.d-vagues { animation: vagues 3s linear infinite; }
.d-filante { animation: filante 7s ease-in infinite; }
.d-ballon { animation: monte calc(var(--d) * 2.6) linear infinite; }
.d-coeur { animation: monte calc(var(--d) * 1.5) linear infinite; opacity: .85; }
.d-flocon { animation: neige var(--d) linear infinite; }
.d-chauve { animation: chauve 9s linear infinite; }
.d-chauve-ailes { animation: ailes .22s ease-in-out infinite alternate; }
.d-lueur { animation: lueur 1.1s ease-in-out infinite alternate; }
.d-araignee { animation: araignee 3s ease-in-out infinite alternate; }
.d-ampoule { animation: ampoule 1.6s ease-in-out infinite; }
.d-projo { animation: projo 3.2s ease-in-out infinite alternate; mix-blend-mode: screen; }
.d-dalle { animation: dalle 1.72s steps(1) infinite; opacity: .55; }
.p-facettes { animation: clignote .7s steps(2) infinite; }
.p-banniere { animation: banniere .55s ease-in-out infinite alternate; }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes neon { 0% { fill: #FF5AF7; } 33% { fill: #4CF2FF; } 66% { fill: #FFE14C; } 100% { fill: #FF5AF7; } }
@keyframes respire { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.025, .975); } }
@keyframes marche { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-6px) rotate(4deg); } }
@keyframes flotte { 0%, 100% { transform: translateY(-4px); } 50% { transform: translateY(-12px); } }
@keyframes cligne { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes queue { from { transform: rotate(-8deg); } to { transform: rotate(12deg); } }
@keyframes oreille { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
@keyframes tourne { to { transform: rotate(360deg); } }
@keyframes clignote { 50% { opacity: .25; } }
@keyframes scint { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
@keyframes nuage { from { transform: translateX(-130px); } to { transform: translateX(400px); } }
@keyframes vagues { to { transform: translateX(60px); } }
@keyframes filante { 0% { transform: translate(400px, 40px); opacity: 0; } 4% { opacity: 1; } 14% { transform: translate(170px, 110px); opacity: 0; } 100% { transform: translate(170px, 110px); opacity: 0; } }
@keyframes monte { from { transform: translate(var(--x), 700px); } to { transform: translate(var(--x), -120px); } }
@keyframes neige { from { transform: translate(var(--x), -20px); } to { transform: translate(calc(var(--x) + 30px), 660px); } }
@keyframes chauve {
  0% { transform: translate(-40px, calc(150px + var(--i) * 46px)); }
  25% { transform: translate(90px, calc(100px + var(--i) * 46px)); }
  50% { transform: translate(200px, calc(160px + var(--i) * 46px)); }
  75% { transform: translate(300px, calc(90px + var(--i) * 46px)); }
  100% { transform: translate(410px, calc(140px + var(--i) * 46px)); }
}
@keyframes ailes { from { transform: scaleY(1); } to { transform: scaleY(-.4); } }
@keyframes lueur { from { opacity: .55; } to { opacity: 1; } }
@keyframes araignee { from { transform: translateY(0); } to { transform: translateY(34px); } }
@keyframes ampoule { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes projo { from { transform: rotate(-32deg); } to { transform: rotate(32deg); } }
@keyframes dalle { 0% { fill: #FF5AF7; } 25% { fill: #4CF2FF; } 50% { fill: #FFE14C; } 75% { fill: #7B61FF; } }
@keyframes banniere { from { transform: skewY(-2deg); } to { transform: skewY(2deg); } }

/* ---------- Animations d'interface ---------- */
@keyframes ampoules { 50% { background-position: 8px 50%; } }
@keyframes vibre { 20% { transform: translate(-2px, 1px) rotate(-.4deg); } 40% { transform: translate(2px, -1px) rotate(.4deg); } 60% { transform: translate(-1px, 1px); } 80% { transform: translate(1px, 0); } }
@keyframes pile { 30% { transform: scale(1.08); } }
@keyframes secoue { 20% { transform: translateX(-5px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
@keyframes pulse { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
@keyframes fretille { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(-4deg); } 80% { transform: rotate(4deg); } 85% { transform: rotate(-3deg); } 90% { transform: rotate(2deg); } }

@media (prefers-reduced-motion: reduce) {
  .ampoules, .enveloppe, .env-indice, .astuce-touche { animation: none; }
}

/* =====================================================================
   V2.1 : têtes en photo, mots au levier, cartes à gratter, cartes de groupe
   ===================================================================== */
.envoi-barre .btn-jaune { white-space: nowrap; }
@media (max-width: 480px) {
  .btn-icone { padding: 12px 14px; }
  .btn-icone .txt-large { display: none; }
  .envoi-barre .btn { font-size: 16px; padding-left: 12px; padding-right: 12px; }
  .envoi-barre .btn-premier { font-size: 17px; }
}
/* Très petits téléphones (320–360 px) : la barre d'envoi tient sur une ligne, sans « Envoyer » coupé en deux */
@media (max-width: 360px) {
  .envoi-barre { gap: 6px; }
  .envoi-barre .btn { font-size: 14px; padding-left: 8px; padding-right: 8px; gap: 4px; }
  .envoi-barre .btn-premier { font-size: 15px; white-space: nowrap; }
  .btn-icone { padding-left: 11px; padding-right: 11px; }
}
.indispo { opacity: .55; }
.btn[disabled] { opacity: .6; cursor: progress; }
.boutons-ligne { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.boutons-ligne .btn { flex: 1; min-width: 140px; }
.btn-large { width: 100%; margin-top: 14px; font-size: 19px; }
.lien-texte { background: none; border: 0; padding: 0; color: var(--violet); text-decoration: underline; font: inherit; cursor: pointer; }

/* Photos (passe-tête) */
.photos { margin-top: 14px; padding: 12px; border: 2.5px dashed var(--encre); border-radius: 16px; background: #FFF8EE; }
.photos-titre { margin: 0 0 10px; font-size: 14px; }
.photos-titre span { color: var(--encre-2); }
.photos-bande { margin-top: 12px; padding-top: 10px; border-top: 2px dashed rgba(43, 33, 64, .25); }
.photos-aide { margin: 0 0 8px; font: 600 14px var(--police); color: var(--encre-2); }
.photos-aide strong { color: var(--encre); }
.tete-choix { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tete-option {
  min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 2.5px solid var(--encre); background: #fff;
  font: 800 15px var(--police); color: var(--encre); cursor: pointer; box-shadow: 2px 2px 0 var(--encre);
}
.tete-option[aria-pressed="true"] { background: var(--soleil); box-shadow: 3px 3px 0 var(--encre); transform: translate(-1px, -1px); }
.photos-boutons { display: flex; gap: 10px; flex-wrap: wrap; }
.photo-case { position: relative; }
.photo-bouton {
  min-height: 56px; min-width: 56px; padding: 0 16px; border-radius: 999px; border: 2.5px solid var(--encre); background: #fff;
  font: 800 15px var(--police); color: var(--encre); cursor: pointer; box-shadow: 2px 2px 0 var(--encre);
}
.photo-case.pleine .photo-bouton { padding: 0; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; }
.photo-case.pleine .photo-bouton { background: radial-gradient(circle at 50% 45%, #FFF6D6 0 45%, #FFD9A8 100%); }
.photo-case.pleine img { width: 100%; height: 100%; object-fit: contain; display: block; transform: scale(1.18) translateY(4%); }
.retirer {
  position: absolute; top: -6px; right: -6px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--encre);
  background: var(--corail); color: #fff; font: 900 13px var(--police); cursor: pointer; display: grid; place-items: center;
}

/* Atelier du mot : tons + petit levier */
.atelier-mot { margin-bottom: 10px; }
.tons { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.mot-machine {
  display: flex; align-items: center; gap: 12px; padding: 6px 16px 6px 12px; border: 2.5px solid var(--encre); border-radius: 16px;
  background: linear-gradient(180deg, #FF7A7E, #EE474D); color: #fff; width: fit-content; box-shadow: 3px 3px 0 var(--encre);
}
.mot-etiquette { font: 800 15px var(--police); text-shadow: 1px 1px 0 var(--encre); }
.mot-etiquette small { display: block; font-size: 12px; opacity: .95; min-height: 1em; }
.atelier-mot.reflechit .mot-machine { animation: pulse .8s ease-in-out infinite; }

/* Recadrage photo */
.cadreur-zone { position: relative; width: min(280px, 100%); aspect-ratio: 1; margin: 0 auto; border-radius: 20px; overflow: hidden; border: 3px solid var(--encre); touch-action: none; }
#cadreur { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.cadreur-masque {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, transparent 0 41%, rgba(43, 33, 64, .55) 41.3%);
}
.cadreur-masque::after { content: ""; position: absolute; inset: 8.9%; border-radius: 50%; border: 3px dashed #fff; }
.cadreur-zoom input { padding: 0; min-height: 30px; width: 100%; }

/* Question : le « Non » qui s'enfuit */
.question {
  position: absolute; left: 0; right: 0; top: 0; bottom: 0; max-width: 520px; margin: 0 auto; z-index: 8;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding: 30px 20px;
  opacity: 0; transition: opacity .35s;
}
.question[hidden] { display: none; }
.question.visible { opacity: 1; }
.question-texte {
  margin: 0; max-width: 340px; text-align: center; font: 900 27px/1.2 var(--police); color: var(--encre);
  background: #fff; border: 3px solid var(--encre); border-radius: 22px; padding: 18px 20px; box-shadow: 5px 5px 0 var(--encre);
}
.question-boutons { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
.question-oui { font-size: 22px; padding: 16px 28px; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.question-non { transition: left .18s ease-out, top .18s ease-out, transform .18s; white-space: nowrap; z-index: 2; }

/* Mur de messages (carte de groupe) */
.mur {
  position: absolute; inset: 0; z-index: 9; max-width: 520px; margin: 0 auto; overflow-y: auto;
  padding: calc(64px + env(safe-area-inset-top)) 14px calc(16px + env(safe-area-inset-bottom));
  background: rgba(255, 244, 230, .93); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .4s;
}
.mur[hidden] { display: none; }
.mur.visible { opacity: 1; }
.mur-entete { text-align: center; margin-bottom: 12px; }
.mur-entete p:last-child { margin: 0; color: var(--encre-2); font-weight: 700; }
.mur-grille { columns: 2 150px; column-gap: 12px; }
.postit {
  position: relative; break-inside: avoid; margin: 0 0 12px; padding: 12px 12px 10px; border: 2.5px solid var(--encre); border-radius: 6px 6px 14px 6px;
  box-shadow: 3px 3px 0 var(--encre); transform: rotate(var(--r, 0deg)); animation: postit .45s both cubic-bezier(.3, 1.4, .5, 1);
}
.postit.c-jaune { background: #FFF1A8; } .postit.c-rose { background: #FFD3E6; } .postit.c-bleu { background: #CDEBFF; }
.postit.c-vert { background: #D4F5C6; } .postit.c-violet { background: #E3D9FF; }
.postit-tete { float: right; width: 58px; height: 58px; object-fit: contain; margin: -10px -6px 2px 6px; transform: rotate(6deg); filter: drop-shadow(0 2px 0 rgba(0,0,0,.12)); }
.postit-texte { margin: 0; font-size: 15px; line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere; }
.postit-nom { margin: 8px 0 0; font: 800 14px var(--police); color: var(--encre-2); clear: both; }
.postit-effacer {
  position: absolute; top: -10px; left: -10px; width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--encre);
  background: #fff; color: var(--encre); font: 900 13px var(--police); cursor: pointer;
}
.vide { color: var(--encre-2); font-weight: 700; }

/* Pages pleine largeur (signer, organiser) */
body.page-ouverte { overflow: hidden; }
.page { position: fixed; inset: 0; z-index: 45; overflow-y: auto; background: var(--creme); }
.page[hidden] { display: none; }
.page-haut {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 10px; max-width: 640px; margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: linear-gradient(var(--creme) 70%, rgba(255, 244, 230, 0));
}
.page-haut .lecteur-marque { margin-right: 0; }
.page-contenu { max-width: 640px; margin: 0 auto; padding: 0 16px 60px; display: grid; gap: 16px; }
.page-contenu h1 { margin: 0; font: 900 26px/1.15 var(--police); }
.page-sous { margin: -6px 0 0; color: var(--encre-2); }
.page-h2 { margin: 6px 0 0; font: 900 19px var(--police); }
.mini-ecran {
  position: relative; width: min(300px, 100%); aspect-ratio: 3 / 4; margin: 0 auto; border: 3px solid var(--encre); border-radius: 20px;
  overflow: hidden; box-shadow: 5px 5px 0 var(--encre); background: #BDE6FF;
}
.signer-options { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.photo-apercu { position: relative; display: inline-flex; }
.photo-apercu img { width: 60px; height: 60px; object-fit: contain; }
.couleurs { display: flex; gap: 8px; margin-left: auto; }
.couleurs button { width: 32px; height: 32px; border-radius: 8px; border: 2.5px solid var(--encre); cursor: pointer; }
.couleurs button[aria-pressed="true"] { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--encre); }
.couleurs .c-jaune { background: #FFF1A8; } .couleurs .c-rose { background: #FFD3E6; } .couleurs .c-bleu { background: #CDEBFF; }
.couleurs .c-vert { background: #D4F5C6; } .couleurs .c-violet { background: #E3D9FF; }
.merci { text-align: center; background: #E9FBE3; }
.merci-titre { margin: 0; font: 900 24px var(--police); }
#mesGroupes ul { list-style: none; padding: 0; margin: 6px 0 14px; display: grid; gap: 6px; }
#mesGroupes a { color: var(--encre); font-weight: 700; }

/* Mot et ticket des cartes à gratter */
.mot-precision { margin: -4px 0 8px; font: 800 16px var(--police); color: var(--encre-2); }
.mot-precision:empty { display: none; }
.ticket.t-fille .ticket-dessous { background: linear-gradient(135deg, #FFD3E6, #FFF0F6); }
.ticket.t-garcon .ticket-dessous { background: linear-gradient(135deg, #CDEBFF, #EEF8FF); }
.ticket-dessous strong { overflow-wrap: anywhere; text-align: center; }

/* Scène : panneau, bande de copains, têtes en photo */
.cq-panneau-txt { fill: var(--encre); font-size: 22px; }
.cq-panneau-sous { fill: var(--encre-2); font-size: 14px; }
.cq-foule-nom { fill: #fff; font-size: 19px; paint-order: stroke; stroke: var(--encre); stroke-width: 5px; stroke-linejoin: round; }
/* La grosse tête découpée remplace la tête dessinée et dodeline sur son cou */
.hz-avec-photo .hz-tete-espece { display: none; }
.cq-scene .hz-tete-bouge { animation: dodeline 1.9s ease-in-out infinite alternate; }
.cq-scene .hz.marche .hz-tete-bouge { animation: dodeline .34s ease-in-out infinite alternate; }
.cq-scene .hz.joie .hz-tete-bouge { animation: tete .45s ease-in-out infinite alternate; }
.cq-scene .hz-cape { animation: cape 1.1s ease-in-out infinite alternate; }
/* L'âge en ballons dorés */
.cq-age { font: 900 74px var(--police); fill: #FFC845; stroke: var(--encre); stroke-width: 4px; paint-order: stroke; stroke-linejoin: round; }
.cq-scene .cq-ballon { animation: ballon 2.4s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
.champ-age input { max-width: 140px; }
/* « Comment ça marche ? » en 3 étapes */
.guide { margin: 0 0 14px; padding: 14px 14px 16px; border: 3px solid var(--encre); border-radius: 22px;
  background: linear-gradient(160deg, #FFFFFF 0%, #FFF3D6 100%); box-shadow: 0 4px 0 var(--encre); }
.guide-tete { display: flex; align-items: flex-start; gap: 8px; }
.guide h2 { flex: 1; margin: 0 0 10px; font: 900 19px/1.2 var(--police); }
.guide-x { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2.5px solid var(--encre); background: #fff; font: 900 14px var(--police); cursor: pointer; }
.guide-etapes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.guide-etapes li { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border: 2.5px solid var(--encre); border-radius: 16px; background: #fff; }
.guide-emoji { flex: none; font-size: 30px; line-height: 1.1; }
.guide-txt { display: flex; flex-direction: column; gap: 2px; font: 600 14px/1.35 var(--police); color: var(--encre-2); }
.guide-txt strong { font: 900 16px var(--police); color: var(--encre); }
.guide-go { width: 100%; margin-top: 12px; }
.guide-lien { margin: 0 0 6px; text-align: right; }
.guide-lien:has(button[hidden]) { display: none; }
@media (min-width: 600px) {
  .guide-etapes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .guide-etapes li { flex-direction: column; align-items: center; text-align: center; }
  .guide-txt { align-items: center; }
  .guide-go { width: auto; display: flex; margin: 12px auto 0; }
}

/* Carte de moi / carte de groupe */
.mode-carte { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; margin: 4px 0 6px; }
.mode-option {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 92px;
  padding: 16px 10px 12px; border: 3px solid var(--encre); border-radius: 20px; background: #fff; color: var(--encre); cursor: pointer;
  font: 900 15px/1.2 var(--police); text-align: center; box-shadow: 0 4px 0 var(--encre); transition: transform .1s, box-shadow .1s, background-color .15s;
}
.mode-option:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--encre); }
.mode-emoji { font-size: 30px; line-height: 1; }
.mode-groupe { background: linear-gradient(135deg, #FFF3B0 0%, #FFD3E6 100%); }
.mode-option[aria-pressed="true"] { outline: 4px solid rgba(123, 97, 255, .35); outline-offset: 2px; }
.mode-groupe[aria-pressed="true"] { background: linear-gradient(135deg, #FFE066 0%, #FF9EC4 100%); }
.mode-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); white-space: nowrap; padding: 3px 9px; border-radius: 999px;
  background: var(--corail); color: #fff; border: 2px solid var(--encre); font: 900 11px var(--police); }
.mode-aide { margin: 4px 2px 12px; font: 700 14px var(--police); color: var(--encre-2); text-align: center; }
.mode-aide[hidden] { display: none; }
.envoi-barre .txt-groupe { display: none; }
.envoi-barre.mode-groupe .txt-solo { display: none; }
.envoi-barre.mode-groupe .txt-groupe { display: inline; }
.envoi-barre.mode-groupe #envoyer { display: none; }
.envoi-barre.mode-groupe #plusieurs { flex: 1; background: var(--corail); color: #fff; text-shadow: 1px 1px 0 rgba(0, 0, 0, .25); }
@media (max-width: 360px) { .mode-option { font-size: 13px; min-height: 84px; } .mode-badge { font-size: 10px; } }

/* RSVP du save the date */
.option-aide { margin: 2px 0 0 34px; font: 600 13px var(--police); color: var(--encre-2); }
.rsvp-option { background: #F2FBF3; }
.rsvp { margin-top: 16px; padding: 14px; border: 3px solid var(--encre); border-radius: 18px; background: #fff; }
.rsvp-titre { margin: 0 0 10px; font: 900 22px var(--police); text-align: center; }
.rsvp-choix { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.rsvp-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 74px; padding: 10px 6px;
  border: 3px solid var(--encre); border-radius: 16px; background: #fff; cursor: pointer; font: 900 14px/1.15 var(--police); color: var(--encre);
  box-shadow: 0 3px 0 var(--encre); transition: transform .08s, box-shadow .08s, background-color .12s;
}
.rsvp-btn span:first-child { font-size: 26px; line-height: 1; }
.rsvp-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--encre); }
.rsvp-btn.r-oui[aria-pressed="true"] { background: #B8F2A0; }
.rsvp-btn.r-peut[aria-pressed="true"] { background: #FFE38A; }
.rsvp-btn.r-non[aria-pressed="true"] { background: #FFC2CC; }
.rsvp #rsvpForm { margin-top: 6px; }
#rsvpNb { max-width: 120px; }
.rsvp-merci { text-align: center; font: 900 17px var(--police); }
.rsvp-merci p { margin: 4px 0 6px; }
.envoi-rsvp { margin: 12px 0 4px; padding: 12px; border: 2.5px dashed var(--encre); border-radius: 16px; background: #F2FBF3; }
.envoi-rsvp p { margin: 0 0 8px; font-size: 14px; }
.rsvp-totaux { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 14px 0; }
.rsvp-total { display: flex; flex-direction: column; align-items: center; padding: 12px 6px; border: 3px solid var(--encre); border-radius: 18px; background: #fff; font: 800 14px var(--police); }
.rsvp-total strong { font: 900 34px/1 var(--police); }
.rsvp-total small { font: 700 12px var(--police); color: var(--encre-2); }
.rsvp-total.r-oui { background: #E6FBE0; }
.rsvp-total.r-peut { background: #FFF6CC; }
.rsvp-total.r-non { background: #FFE6EA; }
.rsvp-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rsvp-ligne { position: relative; padding: 10px 40px 10px 12px; border: 2.5px solid var(--encre); border-radius: 14px; background: #fff; }
.rsvp-ligne p { margin: 0; font-size: 15px; }
.rsvp-ligne .rsvp-mot { margin-top: 4px; color: var(--encre-2); font-size: 14px; overflow-wrap: anywhere; }
.rsvp-ligne .retirer { top: 8px; right: 8px; }
#mesRsvp ul, #mesGroupes ul { list-style: none; padding: 0; }
.interrupteur-petit { margin-top: 6px; font-size: 14px; min-height: 34px; }
.interrupteur-petit input { width: 20px; height: 20px; }
.rsvp-visible { margin: 6px 0 0; }
.rsvp-public { margin-top: 12px; border-top: 2px dashed rgba(43, 33, 64, .25); padding-top: 10px; }
.rsvp-public summary { cursor: pointer; font: 900 15px var(--police); list-style-position: inside; }
.rsvp-public-liste { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.rsvp-public-liste li { padding: 4px 10px; border: 2px solid var(--encre); border-radius: 999px; background: #FFFBF5; font: 700 14px var(--police); }
.rsvp-ouverture { margin: 0 0 14px; padding: 10px 12px; border: 2.5px dashed var(--encre); border-radius: 16px; background: #F4F0FF; }
.rsvp-ouverture .option-aide { margin-left: 34px; }

/* Save the date surprise */
.surprise-bloc { margin-top: 12px; padding: 10px 12px; border: 2.5px dashed var(--encre); border-radius: 16px; background: #FFF6F8; }
.interrupteur { display: flex; align-items: center; gap: 10px; font: 800 16px var(--police); cursor: pointer; min-height: 40px; }
.interrupteur input { width: 24px; height: 24px; accent-color: #E63946; flex: none; }
.env-surprise, .mot-surprise { display: inline-block; margin: 10px auto 0; padding: 8px 14px; border: 2.5px solid #E63946; border-radius: 999px;
  background: #FFF0F3; color: #B3122B; font: 900 15px var(--police); text-align: center; transform: rotate(-2deg); }
.mot-surprise { display: block; width: fit-content; margin: 0 auto 10px; }
.cq-chut { fill: #E63946; font: 900 17px var(--police); letter-spacing: .04em; }
.cq-chut-sous { fill: #B3122B; font: 900 11px var(--police); letter-spacing: .18em; }
.cq-scene .hz.surpris .hz-tete-bouge { animation: tete-surprise .3s ease-out; }

/* Tête découpée par l'IA */
.decoupe-zone { text-align: center; }
.decoupe-fond {
  width: min(240px, 80%, 30vh); aspect-ratio: 1; margin: 0 auto; border: 3px solid var(--encre); border-radius: 20px; position: relative;
  background: radial-gradient(circle at 50% 45%, #FFF6D6 0 40%, #FFD9A8 100%);
}
.decoupe-fond img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; animation: tete-apercu 1.6s ease-in-out infinite alternate; }
.decoupe-fond img:not([src]) { display: none; }
.decoupe-zone.travaille .decoupe-fond::after {
  content: "✂️"; position: absolute; left: 50%; top: 50%; font-size: 44px; transform: translate(-50%, -50%);
  animation: ciseaux .7s ease-in-out infinite alternate;
}
.decoupe-statut { margin: 10px 0 0; font: 800 15px var(--police); text-align: center; }
.decoupe-statut:empty { display: none; }
#cadreurBloc .decoupe-statut { margin: 0 0 10px; }
@keyframes tete-apercu { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
@keyframes ciseaux { from { transform: translate(-50%, -50%) rotate(-20deg); } to { transform: translate(-50%, -50%) rotate(20deg) scale(1.1); } }

/* Langues */
.langue-btn {
  display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 6px 12px; margin-left: auto;
  font: 900 14px var(--police); color: var(--encre); background: #fff; border: 2.5px solid var(--encre); border-radius: 999px;
  box-shadow: 2px 2px 0 var(--encre); cursor: pointer;
}
.entete .slogan { flex-basis: 100%; }
@media (min-width: 700px) { .entete .slogan { flex-basis: auto; order: 3; } .langue-btn { order: 2; margin-left: 0; } }
.langue-rond { font-size: 18px; }
.lecteur-haut .langue-rond, .page-haut .langue-rond { margin-left: auto; }
.lecteur-haut .langue-rond + .rond { margin-left: 0; }
.langues-liste { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.langue-choix {
  display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 10px 14px; font: 800 16px var(--police); color: var(--encre);
  background: #fff; border: 2.5px solid var(--encre); border-radius: 14px; cursor: pointer; box-shadow: 2px 2px 0 var(--encre);
}
.langue-choix[aria-pressed="true"] { background: var(--soleil); }

/* « À ton tour ! » à la fin d'une carte reçue */
.encore {
  margin-top: 10px; padding: 12px; border: 3px solid var(--encre); border-radius: 18px; background: #FFF6D6;
  box-shadow: 4px 4px 0 var(--encre); text-align: center;
}
.encore:empty { display: none; }
.encore-titre { margin: 0 0 10px; font: 900 17px var(--police); }
.encore-boutons { display: flex; gap: 8px; flex-wrap: wrap; }
.encore-boutons .btn { flex: 1; min-width: 140px; font-size: 15px; padding: 10px; }
.encore-fetes { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.mur .encore { margin-top: 12px; }

@keyframes appel { 0% { box-shadow: 0 4px 0 rgba(0, 0, 0, .25), 0 0 0 0 rgba(255, 200, 69, .9); } 70%, 100% { box-shadow: 0 4px 0 rgba(0, 0, 0, .25), 0 0 0 14px rgba(255, 200, 69, 0); } }
@keyframes tete { from { transform: rotate(-9deg) translateY(1px); } to { transform: rotate(9deg) translateY(-2px); } }
@keyframes cape { from { transform: skewX(-6deg); } to { transform: skewX(6deg) scaleY(1.04); } }
@keyframes ballon { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-9px) rotate(4deg); } }
@keyframes dodeline { from { transform: rotate(-4deg); } to { transform: rotate(4deg); } }
@keyframes tete-surprise { 50% { transform: scale(1.15); } }
@keyframes postit { from { opacity: 0; transform: translateY(20px) rotate(var(--r, 0deg)) scale(.8); } to { opacity: 1; transform: rotate(var(--r, 0deg)); } }

/* Pied de page : liens vers les pages d'idées (bloc écrit par outils/pages-seo.mjs) ; seule la liste de la langue affichée est visible */
.pied-idees { margin: 14px auto 0; max-width: 760px; }
.pied-idees-langues { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 8px; }
.pied-idees ul { display: none; list-style: none; margin: 8px 0 0; padding: 0; flex-wrap: wrap; justify-content: center; gap: 0 14px; }
.pied-idees a { display: inline-block; padding: 6px 0; color: var(--encre-2); }
html[lang="fr"] .pied-idees ul[data-l="fr"], html[lang="en"] .pied-idees ul[data-l="en"], html[lang="es"] .pied-idees ul[data-l="es"],
html[lang="pt"] .pied-idees ul[data-l="pt"], html[lang="de"] .pied-idees ul[data-l="de"], html[lang="it"] .pied-idees ul[data-l="it"] { display: flex; }
