/* Moteur : mise en page, composants, animations.
   Aucune couleur ici : elles viennent toutes des variables du thème (themes/<id>/theme.css). */

@font-face { font-family: "Archivo Black"; src: url("../polices/archivo-black.woff2") format("woff2"); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("../polices/archivo-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("../polices/archivo-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

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

html, body {
  height: 100%; margin: 0; background: var(--c-page);
  overscroll-behavior: none; touch-action: manipulation;
  -webkit-text-size-adjust: 100%; text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body { font-family: var(--police-texte); font-size: 14px; line-height: 1.35; color: var(--c-encre); overflow: hidden; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
p, h1, h2 { margin: 0; }
:focus-visible { outline: 3px solid var(--c-encre); outline-offset: 2px; }
.ecran-jeu :focus-visible, .calque-partage :focus-visible { outline-color: var(--c-papier); box-shadow: 0 0 0 5px var(--c-encre); }

/* ---------- Cadre général ---------- */
.app {
  --largeur: min(100vw, 430px);
  --h-mention: calc(28px + env(safe-area-inset-bottom, 0px));
  --haut-sur: env(safe-area-inset-top, 0px);
  --L: max(180px, min(calc(var(--largeur) - 24px), calc(100vh - 316px - var(--haut-sur) - env(safe-area-inset-bottom, 0px))));
  position: fixed; top: 0; bottom: 0; left: 0; right: 0; margin: 0 auto;
  width: var(--largeur); display: flex; flex-direction: column; overflow: hidden;
  background: var(--fond-salle);
}
@supports (height: 100dvh) {
  .app { --L: max(180px, min(calc(var(--largeur) - 24px), calc(100dvh - 316px - var(--haut-sur) - env(safe-area-inset-bottom, 0px)))); }
}
.app[data-etat="chargement"] .ecran-jeu { visibility: hidden; }

.fond { position: absolute; inset: 0; background: var(--fond-salle); overflow: hidden; }
.volet { position: absolute; inset: 0; background: var(--fond-suivant, transparent); transform: translateY(101%); }
.volet.monte { animation: volet-monte 250ms cubic-bezier(.3, .7, .2, 1) both; }
.rideau { position: absolute; inset: 0; z-index: 60; background: var(--fond-suivant); animation: volet-descend 300ms cubic-bezier(.3, .7, .2, 1) both; }
.decor { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.app:not([data-ecran="jeu"]) .decor { display: none; }

.ecran { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.ecran-jeu, .calque-pause, .calque-rotation { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* ---------- Bandeau de mention ---------- */
.mention {
  position: relative; z-index: 40; flex: none; width: 100%; height: var(--h-mention);
  padding: 1px 10px env(safe-area-inset-bottom, 0px); border: 0; border-radius: 0;
  background: var(--c-papier); color: var(--c-encre);
  font: 700 11px/1.15 var(--police-texte); text-align: center; text-wrap: balance;
}
.mention u { text-underline-offset: 2px; }
.mention-flux { display: none; font: 700 11px/1.3 var(--police-texte); text-align: center; padding: 8px 0 0; }
.app.clavier .mention { display: none; }
.app.clavier .mention-flux { display: block; }

/* ---------- Ligne haute ---------- */
.haut { display: flex; align-items: center; gap: 8px; height: 44px; flex: none; padding: 0 12px; margin-top: var(--haut-sur); position: relative; z-index: 3; }
.chrono { display: flex; gap: 2px; }
.chrono i { position: relative; display: block; width: 14px; height: 14px; background: var(--c-encre); border: 1.5px solid var(--c-papier); border-radius: 2px; }
.chrono i::before, .chrono i::after { content: ""; position: absolute; top: 3px; width: 3px; height: 3px; border-radius: 50%; background: var(--c-relief); }
.chrono i::before { left: 2px; } .chrono i::after { right: 2px; }
.chrono i.croque { animation: croque 300ms ease-in both; }
.chrono i.vide { visibility: hidden; }
.chrono i.dernier { animation: battement-fort 1s ease-in-out infinite; }
.chrono .miette { position: absolute; width: 2px; height: 2px; background: var(--c-encre); border: 0; border-radius: 0; animation: miette 500ms ease-out both; }
.chrono { position: relative; }
.compteur-zone { position: relative; margin-left: auto; }
.compteur { font: 20px/1 var(--police-titre); letter-spacing: -.02em; color: var(--texte-salle); transition: color 200ms; }
.compteur.rebond { animation: rebond 320ms cubic-bezier(.34, 1.56, .64, 1); }
.bonus {
  position: absolute; top: calc(100% + 6px); right: -4px; white-space: nowrap; pointer-events: none;
  font: 12px/1 var(--police-titre); padding: 5px 9px; border-radius: 12px;
  background: var(--c-note); color: var(--c-encre); border: 2px solid var(--c-encre); opacity: 0;
}
.bonus.visible { animation: bonus 900ms ease-out both; }

.rond {
  position: relative; flex: none; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  background: var(--c-papier); color: var(--c-encre); display: grid; place-items: center;
}
.rond::before { content: ""; position: absolute; inset: -4px; }
.rond:active { transform: scale(.94); }
.rond-bord { border: 2px solid var(--c-encre); }
.pic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[aria-pressed="false"] > .pic-son-actif, [aria-pressed="true"] > .pic-son-coupe { display: none; }

/* ---------- Scène : bulle, coffret, cartel ---------- */
.scene { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 0 12px 8px; position: relative; z-index: 2; }
.bulle-zone { position: relative; width: 100%; padding-top: 10px; flex: none; }
.etiquette {
  position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 2; white-space: nowrap;
  font: 11px/1 var(--police-titre); padding: 5px 10px 4px; border-radius: 11px;
  background: var(--c-action); color: var(--c-sur-action); transition: opacity 150ms;
}
.app:not([data-etat="attente"]) .etiquette { opacity: 0; }
.bulle {
  position: relative; height: 92px; display: flex; align-items: center; justify-content: center; padding: 6px 14px;
  background: var(--c-papier); border: 3px solid var(--c-encre); border-radius: 20px;
}
.bulle::after {
  content: ""; position: absolute; left: 30px; bottom: -10px; width: 16px; height: 16px;
  background: var(--c-papier); border: solid var(--c-encre); border-width: 0 3px 3px 0; transform: rotate(45deg) skew(8deg, 8deg);
}
.bulle.arrive { animation: bulle 200ms cubic-bezier(.34, 1.56, .64, 1) both; }
.consigne { font: 30px/.95 var(--police-titre); letter-spacing: -.02em; text-align: center; text-transform: uppercase; text-wrap: balance; }
.consigne b { font-weight: inherit; color: var(--c-action); }
.points { position: absolute; right: 18px; bottom: -11px; display: none; gap: 5px; padding: 4px 8px; background: var(--c-papier); border: 3px solid var(--c-encre); border-radius: 12px; z-index: 1; }
.points.visible { display: flex; }
.points i { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--c-encre); }
.points i.plein { background: var(--c-action); border-color: var(--c-action); animation: rebond 300ms cubic-bezier(.34, 1.56, .64, 1); }

.coffret {
  position: relative; flex: none; width: var(--L); padding: 0 12px;
  background: var(--c-boite); border-radius: 4px; box-shadow: 0 8px 0 var(--c-ombre);
}
.coffret.arrive { animation: coffret 250ms ease-out both; }
.coffret.part { animation: coffret-part 600ms cubic-bezier(.5, 0, .8, .4) both; }
.coffret-tete { height: 40px; display: flex; align-items: center; justify-content: center; }
.logo { display: block; height: 20px; width: auto; -webkit-user-drag: none; user-select: none; -webkit-user-select: none; pointer-events: none; }
.fenetre { position: relative; width: 100%; height: calc(var(--L) - 24px); background: var(--c-fenetre); }
.coffret-pied { height: 24px; display: flex; align-items: center; justify-content: center; font: 11px/1 var(--police-titre); white-space: nowrap; overflow: hidden; }
.cartel { flex: none; min-height: 34px; max-width: var(--L); font: 400 13px/1.3 var(--police-texte); text-align: center; text-wrap: balance; color: var(--texte-salle); transition: color 200ms; }

/* ---------- Grille et carrés ---------- */
.grille {
  --n: 3; position: absolute; inset: 4px; display: grid; gap: 4px;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr)); grid-template-rows: repeat(var(--n), minmax(0, 1fr));
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.grille.serree { gap: 3px; }
.grille.tableau { inset: 0; gap: 0; background-size: 100% 100%; background-repeat: no-repeat; animation: fondu 200ms ease-out both; }
.carre {
  position: relative; min-width: 0; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 3px;
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  font-family: var(--police-titre); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  animation: apparition 260ms cubic-bezier(.34, 1.56, .64, 1) both; animation-delay: calc(var(--i, 0) * var(--pas, 20ms));
}
.carre > img, .carre > svg, .case-ecrin > img, .case-ecrin > svg { display: block; width: 80%; height: 80%; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.carre-typo > span, .case-ecrin > span { display: block; font-family: var(--police-titre); font-size: calc(var(--taille, 13) * var(--u, 1) * 1px); line-height: .95; letter-spacing: -.02em; text-align: center; text-transform: uppercase; pointer-events: none; }
.carre-tuile { border-radius: 0; background: transparent; box-shadow: inset 0 0 0 .5px var(--c-filet); animation: none; }
.carre-tuile.trouve { box-shadow: inset 0 0 0 3px var(--c-action); }
.carre.trouve { z-index: 3; animation: reussite 240ms ease-out both; }
.carre.rate { animation: tremble 300ms linear both; }
.carre.indice { animation: battement .8s ease-in-out infinite; z-index: 2; }
.carre-tuile.indice { animation: battement-tuile .8s ease-in-out infinite; }
.carre.saut { animation: saut 420ms ease-out both; }
.grille.figee .carre:not(.trouve) { opacity: .4; transition: opacity 300ms; }
.grille.figee .carre-tuile:not(.trouve) { opacity: 1; background: var(--c-fenetre); opacity: .6; }
.coche {
  position: absolute; top: -5px; right: -5px; width: 20px; height: 20px; border-radius: 50%; z-index: 4;
  background: var(--c-action); color: var(--c-sur-action); display: grid; place-items: center; animation: rebond 260ms cubic-bezier(.34, 1.56, .64, 1) both;
}
.carre-tuile .coche { top: 4px; right: 4px; }
.coche svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 3.500; stroke-linecap: round; stroke-linejoin: round; }
.anneau { position: absolute; inset: -2px; border: 3px solid var(--c-action); border-radius: 6px; pointer-events: none; animation: anneau 250ms ease-out both; z-index: 3; }
.bravo {
  position: absolute; left: -8px; right: -8px; top: 50%; z-index: 6; pointer-events: none; opacity: 0;
  font: 44px/.9 var(--police-titre); letter-spacing: -.02em; text-align: center; color: var(--c-mot);
  -webkit-text-stroke: 6px var(--c-encre); paint-order: stroke fill; transform: translateY(-50%) rotate(-6deg);
}
.bravo.visible { animation: eclat 450ms ease-out both; }
.vol { position: fixed; z-index: 30; width: 26px; height: 26px; border-radius: 3px; pointer-events: none; display: grid; place-items: center; overflow: hidden; background-color: var(--c-papier); }
.vol > img, .vol > svg { width: 80%; height: 80%; object-fit: contain; }
.vol > span { display: none; }

/* ---------- Écran 5 : bandeau de fin ---------- */
.bandeau-fin {
  position: absolute; left: -15%; width: 130%; top: 44%; z-index: 20; pointer-events: none; padding: 16px 20%;
  background: var(--c-action); color: var(--c-sur-action); text-align: center;
  font: clamp(30px, 10.500vw, 40px)/.92 var(--police-titre); letter-spacing: -.02em; text-wrap: balance;
  transform: rotate(-6deg) translateX(-120%); visibility: hidden;
}
.bandeau-fin.visible { visibility: visible; animation: bandeau 1600ms cubic-bezier(.2, .8, .2, 1) both; }

/* ---------- Boutons, liens, notes ---------- */
.bouton {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; padding: 6px 18px;
  border: 0; border-radius: 26px; background: var(--c-action); color: var(--c-sur-action);
  font: 16px/1.05 var(--police-titre); letter-spacing: -.01em; text-transform: uppercase; text-align: center; text-decoration: none;
  transition: transform 80ms, background-color 80ms;
}
.bouton:active { transform: scale(.97); background: var(--c-action-appui); }
.bouton[disabled] { opacity: .6; }
.bouton-encre { background: var(--c-encre); color: var(--c-papier); }
.bouton-encre:active { background: var(--c-encre); }
.bouton-secondaire { background: transparent; color: var(--c-encre); border: 2px solid var(--c-encre); }
.bouton-secondaire:active { background: var(--c-trait-doux); }
.lien {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; border: 0; background: none;
  font: 700 14px/1.2 var(--police-texte); color: var(--c-encre); text-decoration: underline; text-underline-offset: 3px;
}
.lien-clair { color: var(--c-papier); }
.lien-texte { font-weight: 700; color: inherit; text-decoration: underline; text-underline-offset: 2px; background: none; border: 0; padding: 0; }
.pastille { display: inline-block; padding: 5px 10px 4px; border-radius: 14px; background: var(--c-action); color: var(--c-sur-action); font: 13px/1.1 var(--police-titre); }
.note-demo { padding: 8px 10px; background: var(--c-note); border: 2px solid var(--c-encre); border-radius: 8px; font: 700 13px/1.3 var(--police-texte); }
.etiquette-demo { display: inline-block; vertical-align: 1px; margin-right: 3px; padding: 3px 7px 2px; border-radius: 9px; background: var(--c-encre); color: var(--c-note); font: 11px/1 var(--police-titre); }
.apercu { position: relative; margin-top: 18px; padding: 17px 14px 14px; background: var(--c-papier); border: 2px dashed var(--c-encre); border-radius: 12px; }
.apercu-onglet { position: absolute; top: -11px; left: 12px; padding: 5px 8px 4px; border-radius: 6px; background: var(--c-encre); color: var(--c-papier); font: 10px/1 var(--police-titre); white-space: nowrap; }
.apercu-titre { font: 20px/.95 var(--police-titre); letter-spacing: -.02em; text-transform: uppercase; }
.apercu-titre-grand { font-size: 28px; }
.apercu-texte { margin-top: 6px; font: 400 14px/1.32 var(--police-texte); }

/* ---------- Écrans 6 et 7 ---------- */
.ecran-papier { background: var(--c-papier); z-index: 5; }
.ecran-papier.entre { animation: fondu 250ms ease-out both; }
.defile { height: 100%; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: calc(var(--haut-sur) + 8px) 12px 18px; }
.resultat-tete { display: flex; align-items: flex-start; gap: 8px; min-height: 40px; }
.resultat-titre { flex: 1; font: 34px/.92 var(--police-titre); letter-spacing: -.02em; text-transform: uppercase; text-wrap: balance; padding-top: 3px; outline: none; }
.resultat-titre.long { font-size: 27px; }
.resultat-corps { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.ecrin-zone { position: relative; flex: none; }
.resultat-infos { flex: 1; min-width: 0; }
.palier-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.record { font: 11px/1 var(--police-titre); color: var(--c-action); }
.sous-titre { margin-top: 7px; font: 400 14px/1.3 var(--police-texte); }
.signature { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 9px; font: 14px/1 var(--police-titre); min-height: 30px; }
.signature-bouton { display: inline-flex; align-items: center; gap: 4px; min-height: 30px; padding: 0 2px; border: 0; background: none; font: inherit; border-bottom: 2px solid var(--c-encre); position: relative; }
.signature-bouton::before { content: ""; position: absolute; inset: -8px -8px; }
.pic-crayon { width: 16px; height: 16px; }
.signature-champ { width: 9.500em; height: 30px; padding: 0 6px; border: 2px solid var(--c-encre); border-radius: 6px; background: var(--c-champ); font: 16px/1 var(--police-titre); text-transform: uppercase; }
.signature-champ::placeholder { color: var(--c-exemple); font-size: 12px; }
.signature-note { margin-top: 3px; font: 400 11px/1.25 var(--police-texte); }

.ecrin { --w: 176px; display: grid; cursor: pointer; -webkit-user-select: none; user-select: none; width: var(--w); padding: 0; border: 0; background: none; text-align: center; transform-style: preserve-3d; transition: transform 500ms cubic-bezier(.3, .1, .2, 1); }
.ecrin-zone { perspective: 700px; }
.ecrin.retourne { transform: rotateY(180deg); }
.ecrin-face, .ecrin-dos { grid-area: 1 / 1; -webkit-backface-visibility: hidden; backface-visibility: hidden; border: 2px solid var(--c-encre); box-shadow: 0 6px 0 var(--c-ombre-douce); }
.ecrin-face { display: flex; flex-direction: column; background: var(--c-boite); padding: 0 calc(var(--w) * .04) calc(var(--w) * .04); }
.ecrin-tete { height: calc(var(--w) * .136); display: flex; align-items: center; justify-content: center; }
.ecrin-tete .logo { height: calc(var(--w) * .074); }
.ecrin-fenetre { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: calc(var(--w) * .0114); padding: calc(var(--w) * .0114); background: var(--c-fenetre); }
.case-ecrin { position: relative; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; box-shadow: inset 0 0 0 1px var(--c-case-vide); background-repeat: no-repeat; }
.case-ecrin.pleine { box-shadow: none; animation: chute 320ms cubic-bezier(.34, 1.56, .64, 1) both; animation-delay: calc(var(--i, 0) * 30ms + 200ms); }
.ecrin-dos { transform: rotateY(180deg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 16px 12px; background: var(--c-action); color: var(--c-sur-action); outline: 2px solid var(--c-sur-action); outline-offset: -10px; font-family: var(--police-titre); }
.dos-signe { font-size: 11px; line-height: 1; }
.dos-prenom { font-size: 26px; line-height: .95; letter-spacing: -.02em; overflow-wrap: anywhere; }
.dos-prenom.long { font-size: 19px; }
.dos-detail { font-size: 10px; line-height: 1.15; }
.ecrin-aide { position: absolute; z-index: 3; left: 50%; bottom: -16px; transform: translateX(-50%); width: max-content; max-width: 164px; padding: 5px 8px; border-radius: 8px; background: var(--c-encre); color: var(--c-papier); font: 700 11px/1.2 var(--police-texte); text-align: center; pointer-events: none; opacity: 0; }
.ecrin-aide.visible { animation: aide 3000ms ease both; }

#zone-collecte { margin-top: 10px; }
.champ-libelle { display: block; margin-top: 8px; font: 700 13px/1.2 var(--police-texte); }
.champ { display: block; width: 100%; height: 52px; margin-top: 4px; padding: 0 12px; border: 2px solid var(--c-encre); border-radius: 8px; background: var(--c-champ); font: 400 16px/1 var(--police-texte); color: var(--c-encre); -webkit-appearance: none; appearance: none; }
.champ::placeholder { color: var(--c-exemple); opacity: 1; }
.champ.en-erreur { border: 3px solid var(--c-action); }
.piege { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.case { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; min-height: 44px; cursor: pointer; }
.case input { position: absolute; opacity: 0; width: 24px; height: 24px; margin: 0; }
.case-boite { flex: none; width: 24px; height: 24px; border: 2px solid var(--c-encre); border-radius: 4px; background: var(--c-champ); display: grid; place-items: center; }
.case-boite svg { width: 18px; height: 18px; fill: none; stroke: var(--c-sur-action); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.case input:checked + .case-boite { background: var(--c-action); }
.case input:checked + .case-boite svg { opacity: 1; }
.case input:focus-visible + .case-boite { outline: 3px solid var(--c-encre); outline-offset: 2px; }
.case.en-erreur .case-boite { border: 3px solid var(--c-action); }
.case-texte { font: 400 13px/1.3 var(--police-texte); padding-top: 3px; }
.case-sous { margin: 2px 0 0 34px; font: 400 11px/1.3 var(--police-texte); }
.erreur { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; font: 700 13px/1.25 var(--police-texte); color: var(--c-action); }
.erreur:empty { display: none; }
.erreur::before { content: "!"; flex: none; width: 17px; height: 17px; border: 2px solid var(--c-action); border-radius: 50%; font: 11px/13px var(--police-titre); text-align: center; }
#bouton-valider { margin-top: 12px; }
.mention-rgpd { margin-top: 10px; font: 400 11px/1.35 var(--police-texte); }
.deja { margin-top: 12px; padding: 12px; border: 2px dashed var(--c-encre); border-radius: 12px; font: 700 14px/1.3 var(--police-texte); text-align: center; }
.liens { display: flex; flex-direction: column; align-items: center; margin-top: 8px; }

.ecran-confirmation .defile { display: flex; flex-direction: column; gap: 12px; }
.conf-ecrin { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 4px; }
.ecrin-petit { --w: 120px; }
.conf-signe { font: 14px/1 var(--police-titre); }
.ecran-confirmation .apercu { margin-top: 8px; }
.suppression { margin-top: 8px; }
.suppression-message { margin-top: 6px; }
.collection { display: flex; flex-direction: column; gap: 8px; }
.collection-image { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--c-page); display: grid; place-items: center; }
.collection-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.collection-repli { padding: 0 20px; font: 22px/.95 var(--police-titre); letter-spacing: -.02em; text-align: center; color: var(--c-papier); }
.collection-note { font: 400 12px/1.3 var(--police-texte); text-align: center; }

/* ---------- Calques ---------- */
.calque { position: absolute; top: 0; left: 0; right: 0; bottom: var(--h-mention); z-index: 30; animation: fondu 150ms ease-out both; }
.calque.sort { animation: fondu-sortie 200ms ease-in both; }
.calque-pause { background: var(--c-pause); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; text-align: center; }
.pause-titre { font: 48px/.9 var(--police-titre); letter-spacing: -.02em; max-width: 6.200em; outline: none; }
.pause-texte { font: 400 16px/1.35 var(--police-texte); max-width: 300px; }
.calque-pause .bouton { max-width: 320px; margin-top: 4px; }

.calque-partage { z-index: 34; background: var(--c-voile); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 12px 24px; animation-duration: 200ms; }
.partage-carte { height: 62%; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden; background: var(--c-page); }
.partage-carte img, .partage-carte canvas { display: block; width: 100%; height: 100%; }
.partage-actions { width: 100%; max-width: 320px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.partage-message { font: 700 13px/1.3 var(--police-texte); color: var(--c-papier); text-align: center; margin-top: 6px; }
.partage-message:empty { display: none; }

.calque-apropos { z-index: 36; background: var(--c-voile); }
.panneau { position: absolute; left: 0; right: 0; bottom: 0; height: 88%; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 22px 20px 28px; background: var(--c-papier); border-radius: 20px 20px 0 0; animation: monte 300ms cubic-bezier(.2, .8, .2, 1) both; }
.croix { position: sticky; top: 0; float: right; width: 44px; height: 44px; margin: -12px -10px 0 8px; padding: 0; border: 0; border-radius: 50%; background: var(--c-papier); display: grid; place-items: center; z-index: 2; }
.apropos-titre { font: 24px/.95 var(--police-titre); letter-spacing: -.02em; outline: none; }
.apropos-texte p { margin-top: 12px; font: 400 14px/1.42 var(--police-texte); }
.apropos-texte b { font: 12px/1 var(--police-titre); }
.calque-apropos .lien { margin-top: 10px; padding: 0; }

.calque-erreur { z-index: 50; background: var(--c-papier); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.erreur-titre { font: 34px/.92 var(--police-titre); letter-spacing: -.02em; }
.erreur-texte { font: 400 16px/1.35 var(--police-texte); }
.calque-erreur .bouton { max-width: 320px; }

.calque-rotation { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .calque-rotation {
    position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px;
    background: var(--c-rotation); color: var(--c-sur-rotation); text-align: center;
  }
}
.rotation-pic { width: 64px; height: 64px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; animation: pivote 2.400s ease-in-out infinite; }
.rotation-titre { font: 28px/.95 var(--police-titre); letter-spacing: -.02em; }
.rotation-texte { font: 400 14px/1.3 var(--police-texte); }
.rotation-mention { position: absolute; left: 0; right: 0; bottom: calc(8px + env(safe-area-inset-bottom, 0px)); font: 700 11px/1.2 var(--police-texte); }

.sans-js { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; background: var(--c-page); color: var(--c-papier); font: 400 16px/1.35 var(--police-texte); }
.sans-js-cartouche { padding: 14px 20px; border-radius: 12px; background: var(--c-papier); }
.sans-js-cartouche img { display: block; }
.sans-js-titre { font: 24px/.95 var(--police-titre); }
.sans-js-mention { font: 700 12px/1.3 var(--police-texte); margin-top: 12px; }

/* ---------- Petits écrans ---------- */
@media (max-width: 359px) {
  .consigne { font-size: 26px; }
  .chrono i { width: 12px; height: 12px; }
  .chrono i::before, .chrono i::after { top: 2px; width: 2px; height: 2px; }
  .haut { gap: 6px; }
  .coffret-pied { font-size: 10px; }
  .ecrin:not(.ecrin-petit) { --w: 150px; }
  .resultat-titre { font-size: 29px; }
  .resultat-corps { gap: 10px; }
  .pause-titre { font-size: 42px; }
  .apercu-titre:not(.apercu-titre-grand) { font-size: 18px; }
}

/* ---------- Animations ---------- */
@keyframes apparition { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes reussite { 0% { transform: scale(1); } 50% { transform: scale(1.150); } 100% { transform: scale(1); } }
@keyframes tremble { 0%, 100% { transform: translateX(0); } 16% { transform: translateX(-4px); } 33% { transform: translateX(4px); } 50% { transform: translateX(-4px); } 66% { transform: translateX(4px); } 83% { transform: translateX(-4px); } }
@keyframes battement { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.060); } }
@keyframes battement-tuile { 0%, 100% { box-shadow: inset 0 0 0 .5px var(--c-filet); } 50% { box-shadow: inset 0 0 0 4px var(--c-papier); } }
@keyframes battement-fort { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.120); } }
@keyframes saut { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-4px); } 70% { transform: translateY(1px); } }
@keyframes anneau { from { transform: scale(1); opacity: 1; } to { transform: scale(1.450); opacity: 0; } }
@keyframes rebond { 0% { transform: scale(.5); } 60% { transform: scale(1.250); } 100% { transform: scale(1); } }
@keyframes eclat { 0% { opacity: 0; transform: translateY(-50%) rotate(-6deg) scale(.5); } 30% { opacity: 1; transform: translateY(-50%) rotate(-6deg) scale(1.100); } 45%, 75% { opacity: 1; transform: translateY(-50%) rotate(-6deg) scale(1); } 100% { opacity: 0; transform: translateY(-50%) rotate(-6deg) scale(1); } }
@keyframes bonus { 0% { opacity: 0; transform: translateY(-6px) scale(.8); } 15% { opacity: 1; transform: translateY(0) scale(1.050); } 25%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(4px); } }
@keyframes croque { to { transform: translateY(16px) rotate(20deg); opacity: 0; } }
@keyframes miette { from { opacity: 1; transform: translate(0, 0); } to { opacity: 0; transform: translate(var(--dx, 4px), 14px); } }
@keyframes bulle { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes coffret { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes coffret-part { to { transform: translateY(-70vh) scale(.5); opacity: 0; } }
@keyframes volet-monte { from { transform: translateY(101%); } to { transform: translateY(0); } }
@keyframes volet-descend { from { transform: translateY(-101%); } to { transform: translateY(0); } }
@keyframes bandeau { 0% { transform: rotate(-6deg) translateX(-120%); } 18%, 78% { transform: rotate(-6deg) translateX(0); } 100% { transform: rotate(-6deg) translateX(120%); } }
@keyframes fondu { from { opacity: 0; } to { opacity: 1; } }
@keyframes fondu-sortie { from { opacity: 1; } to { opacity: 0; } }
@keyframes monte { from { transform: translateY(100%); } to { transform: none; } }
@keyframes chute { 0% { transform: translateY(-16px) scale(.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes aide { 0%, 100% { opacity: 0; } 12%, 85% { opacity: 1; } }
@keyframes pivote { 0%, 20% { transform: rotate(-90deg); } 60%, 100% { transform: rotate(0deg); } }
@keyframes contour { 0%, 100% { outline: 3px solid var(--c-encre); outline-offset: -3px; } }

/* ---------- Réduction des animations ---------- */
@media (prefers-reduced-motion: reduce) {
  .decor { display: none; }
  .carre, .coffret.arrive, .bulle.arrive, .case-ecrin.pleine, .coche, .points i.plein, .compteur.rebond { animation: fondu 150ms ease-out both; animation-delay: 0ms; }
  .carre.trouve, .carre.saut { animation: none; }
  .carre.rate { animation: contour 300ms linear both; }
  .carre.indice { animation: none; outline: 3px solid var(--c-action); outline-offset: -3px; }
  .carre-tuile.indice { animation: none; box-shadow: inset 0 0 0 4px var(--c-papier); }
  .anneau { display: none; }
  .bravo.visible { animation: aide 450ms linear both; }
  .volet.monte, .rideau { animation: fondu 150ms ease-out both; transform: none; }
  .bandeau-fin.visible { animation: fondu 150ms ease-out both; transform: rotate(-6deg); }
  .coffret.part { animation: fondu-sortie 150ms ease-out both; }
  .chrono i.croque { animation: fondu-sortie 150ms ease-out both; }
  .chrono i.dernier, .rotation-pic { animation: none; }
  .chrono .miette { display: none; }
  .panneau { animation: fondu 150ms ease-out both; }
  .ecrin { transition-duration: 1ms; }
}
