/* La web app du joueur (V3), couleurs et formes des maquettes finales (charte « Carillon »). Tailles en rem : le texte suit le réglage. */
:root {
  --fond: #F6F4FF; --encre: #1C1838; --second: #5A5478; --lavande: #ECE8FF; --filet: #E2DFEA;
  /* Retouche A (2 déc.) : l'action en encre, plus de relief plein ; sur une image, une ombre douce. */
  --ombre-douce: 0 4px 14px rgba(20,12,40,.28);
  --bord: #E4DFFB; --carte: #fff; --or: #F5B83D;
  --entree: cubic-bezier(.22,.8,.3,1); --sortie: cubic-bezier(.5,0,.75,.4);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--encre); font: 400 1rem/1.5 "Atkinson Hyperlegible Next", system-ui, sans-serif; }
/* Téléphone de 320 à 480 px (440 px sur un iPhone Pro Max) ; sur ordinateur, une colonne de 480 px au centre. Les zones sûres protègent l'encoche et la barre d'accueil. */
/* Les réglages de lecture (I5, B13, fiche 12), sur <html>. Tout est en rem : la taille choisie multiplie celle du téléphone,
   et la page tient jusqu'à 200 % sans couper de texte. */
html[data-taille="0"] { font-size: 87.5%; } html[data-taille="2"] { font-size: 125%; }
html[data-contraste] { --second: #2E2A48; --bord: #8A84A8; }
html[data-sans-animation] *, html[data-sans-animation] *::before, html[data-sans-animation] *::after { animation: none !important; transition: none !important; }
html[data-sans-astuces] .astuce { display: none !important; }
.ecran {
  display: flex; flex-direction: column; height: 100vh; height: 100dvh; max-width: 480px; margin: 0 auto; background: var(--fond);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
/* La zone de l'heure d'iOS (bande blanche floue, iPhone de Samuel, 3 déc.) : iOS 26 floute le haut d'une app installée, sauf si un vrai
   élément opaque touche le bord du haut ; il prend alors sa couleur. Un ::before ne compte pas, et la zone vaut 0 px en barre « default ». */
html { background: var(--fond); }
.bande-heure { position: fixed; top: 0; left: 0; right: 0; height: max(1px, env(safe-area-inset-top)); background: var(--fond);
  z-index: 2147483647; pointer-events: none; }
@media (min-width: 481px) { .ecran { box-shadow: 0 0 0 1px var(--bord); } }
header { flex: none; padding: 16px 18px 8px; }
.entete-fil { display: flex; align-items: center; gap: 12px; }
.entete-fil h1 { flex: 1; }
.rond-fil { width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 10px;
  background: transparent; color: var(--encre); text-decoration: none; font: 700 1.1rem Jost, sans-serif; }
h1 { margin: 0; font: 600 1.0625rem/1.3 Jost, sans-serif; overflow-wrap: anywhere; }

#hors-ligne { flex: none; margin: 12px 14px 0; padding: 10px 12px; border-radius: 12px; background: var(--encre); color: #fff;
  font-size: .875rem; animation: m-fondu 320ms var(--entree) both; }
#hors-ligne[hidden] { display: none; }
#hors-ligne.revenu { background: var(--lavande); color: var(--encre); }

#fil { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 18px 12px; display: flex; flex-direction: column; gap: 14px; }
.prose { margin: 0; font-size: 1.0625rem; line-height: 1.65; white-space: pre-line; overflow-wrap: anywhere;
  background: #F4F1FF; border-radius: 14px 14px 14px 4px; padding: 12px 14px 13px; }
.prose::before { content: "Le Meneur"; display: block; margin-bottom: 4px; font: 700 .75rem "Atkinson Hyperlegible Next", sans-serif; color: var(--second); }
.prose.resume-de { align-self: center; background: none; padding: 0; font: 600 .875rem Jost, sans-serif; color: var(--second); }
.prose.resume-de::before { content: none; }
.toi { margin: 0; align-self: flex-end; max-width: 80%; background: var(--encre); color: #fff; border-radius: 14px 14px 4px 14px;
  padding: 10px 14px; font-weight: 500; font-size: .9375rem; line-height: 1.45;
  white-space: pre-line; overflow-wrap: anywhere; }
.attente { align-self: flex-end; margin-top: -8px; font-size: .8125rem; color: var(--second); }
.entre { animation: m-monte 420ms var(--entree) both; }
.toi.entre { animation-name: m-droite; }
.petit { margin: 0; font-size: .8125rem; color: var(--second); }
.envoye { align-self: flex-end; margin-top: -8px; animation: m-fondu 320ms ease-out both; }
.meneur-ecrit { display: flex; align-items: center; gap: 8px; animation: m-fondu 320ms ease-out both; }
.meneur-ecrit span:first-child { display: flex; gap: 4px; }
.meneur-ecrit i { display: block; width: 7px; height: 7px; border-radius: 50%; background: var(--encre); animation: m-point 1.2s ease-in-out infinite; }
.meneur-ecrit i:nth-child(2) { animation-delay: .15s; } .meneur-ecrit i:nth-child(3) { animation-delay: .3s; }

/* G5b : une ligne épaisse à chaque changement de mode ; G7 : des bulles avec le nom de qui parle. */
.mode { margin: 6px 0 0; display: flex; align-items: center; gap: 10px; font: 700 .875rem Jost, sans-serif; color: var(--encre); }
.mode::before, .mode::after { content: ""; flex: 1; height: 3px; border-radius: 2px; background: var(--bord); }
.lui { align-self: flex-start; max-width: 80%; padding: 10px 14px; border-radius: 14px 14px 14px 4px; background: var(--carte);
  border: 1px solid var(--filet); }
.lui b { display: block; font: 700 .78rem "Atkinson Hyperlegible Next", sans-serif; color: var(--encre); }
.lui p { margin: 2px 0 0; font-size: .97rem; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.lui.entre { animation-name: m-monte; }
.geste { margin: -6px 0 0; font-style: italic; color: var(--second); }
.plus-haut { align-self: center; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--encre); border-radius: 10px; background: #fff;
  color: var(--encre); font: 700 .875rem "Atkinson Hyperlegible Next", sans-serif; cursor: pointer; }
.finir { flex: none; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--encre); border-radius: 10px; background: #fff; color: var(--encre);
  font: 700 .875rem "Atkinson Hyperlegible Next", sans-serif; cursor: pointer; }
/* G10 : la feuille d'un nouveau mode, la même pour tous les modes. */
.voile-mode { position: fixed; inset: 0; z-index: 10; display: flex; align-items: flex-end; justify-content: center; background: rgba(20,12,40,.45);
  animation: m-fondu 320ms ease-out both; }
.feuille-mode { width: 100%; max-width: 430px; display: flex; flex-direction: column; gap: 8px; padding: 22px 18px calc(env(safe-area-inset-bottom) + 24px);
  background: #fff; border-radius: 20px 20px 0 0; animation: m-monte 460ms var(--entree) both; }
.feuille-mode small { font: 700 .8rem "Atkinson Hyperlegible Next", sans-serif; color: var(--encre); }
.feuille-mode h2 { margin: 0; font: 600 1.75rem/1.15 Jost, sans-serif; }
.feuille-mode h3 { margin: 8px 0 0; font: 700 .875rem "Atkinson Hyperlegible Next", sans-serif; color: var(--second); }
.feuille-mode p { margin: 0; }

/* G5 : les choix du dernier message, la carte de dé qui respire tant qu'elle attend. */
.choix { display: flex; flex-wrap: wrap; gap: 8px; animation: m-monte 420ms var(--entree) both; }
.choix button { flex: 1 1 auto; min-height: 44px; padding: 8px 16px; border: 1px solid var(--filet); border-radius: 10px; background: var(--carte); color: var(--encre); font: 700 .9rem "Atkinson Hyperlegible Next", sans-serif; cursor: pointer; }
.carte-de { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--carte);
  border: 1px solid var(--filet); animation: m-monte 420ms var(--entree) both; }
.icone-de { flex: none; width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 14px;
  background: #7A1420; color: #F5D78A; font: 800 1.1rem Jost, sans-serif; clip-path: polygon(50% 2%, 96% 26%, 96% 74%, 50% 98%, 4% 74%, 4% 26%); }
.carte-de .quoi { flex: 1; min-width: 0; }
.carte-de b { display: block; font: 700 1.125rem/1.3 Jost, sans-serif; }
.carte-de .quoi span { display: block; font-size: .875rem; color: var(--second); }
.carte-de .quoi .enjeu { color: var(--encre); }
.carte-de .lancer { flex: none; min-height: 44px; padding: 10px 14px; border: 0; border-radius: 10px; background: var(--or); color: var(--encre);
  font: 700 .875rem Jost, sans-serif; box-shadow: 0 3px 10px rgba(20,12,40,.18); cursor: pointer; animation: m-respire 2.4s ease-in-out infinite; }

/* G6 et G6b : le film du dé, puis le résultat. Le dé est tiré par le serveur avant le film. */
.voile-de { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; gap: 14px;
  max-width: 430px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 24px) 18px calc(env(safe-area-inset-bottom) + 24px);
  background: linear-gradient(rgba(12,10,18,.74) 45%, rgba(12,10,18,.95) 72%); overflow-y: auto; animation: m-fondu 320ms ease-out both; }
.voile-de:focus { outline: none; }
.voile-de .enjeu { align-self: stretch; display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: 14px;
  background: var(--carte); box-shadow: var(--ombre-douce); animation: m-monte 420ms var(--entree) both; }
.voile-de .enjeu .quoi { flex: 1; min-width: 0; }
.voile-de .enjeu h2 { margin: 0; font: 600 1.03rem/1.35 Jost, sans-serif; }
.voile-de .enjeu .phrase { margin: 4px 0 0; font-size: .9375rem; line-height: 1.45; color: var(--second); }
.voile-de .faut { flex: none; text-align: center; padding: 6px 12px; border-radius: 12px; background: #FFF1D6; }
.voile-de .faut small { display: block; font: 700 .75rem "Atkinson Hyperlegible Next"; color: #8A5A00; }
.voile-de .faut b { font: 700 1.6rem/1 Jost, sans-serif; }
.voile-de .film { width: min(330px, 100%); aspect-ratio: 1; flex: none; }
.voile-de .film video, .voile-de .film img { display: block; width: 100%; height: 100%; border-radius: 26px; object-fit: cover;
  box-shadow: 0 20px 50px rgba(0,0,0,.6); }
.voile-de .bonus { margin: 0; padding: 8px 16px; border-radius: 999px; background: #fff; font: 600 .875rem Jost, sans-serif; }
.voile-de .resultat { display: flex; flex-direction: column; align-items: center; gap: 12px; color: #fff; }
.voile-de .resultat[hidden] { display: none; }
.voile-de .mot { font: 800 2.5rem/1 Jost, sans-serif; letter-spacing: .06em; color: #7BE0A6;
  text-shadow: 0 0 18px rgba(123,224,166,.55), 0 3px 0 #1E5A37; animation: m-monte 420ms var(--entree) 1.05s both; }
.voile-de .mot.echec { color: #FF9C9C; text-shadow: 0 0 18px rgba(255,120,120,.5), 0 3px 0 #6A1F1F; }
.voile-de .calcul { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; color: #D9D2FF; font: 700 1.1rem Jost; }
.voile-de .calcul span { padding: 8px 12px; border-radius: 12px; background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.28);
  color: #fff; font: 700 1rem Jost, sans-serif; animation: m-fondu 320ms ease-out both; }
.voile-de .calcul span:nth-of-type(2) { animation-delay: .35s; }
.voile-de .calcul .medaille { width: 58px; height: 58px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #FFE7A8, #F5B83D 60%, #C98E1A); box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 0 22px rgba(245,184,61,.6);
  color: var(--encre); font: 800 1.6rem Jost, sans-serif; animation: m-medaille 700ms var(--entree) .7s both; }
.voile-de .fallait, .voile-de .continuer { margin: 0; font: 600 .875rem Jost, sans-serif; color: #D9D2FF; animation: m-fondu 320ms ease-out 1.3s both; }
.voile-de .continuer { opacity: .8; animation-delay: 2.4s; }

.carte { background: var(--carte); border-radius: 14px; border: 1px solid var(--filet); padding: 14px 16px; overflow-wrap: anywhere; }
.carte.erreur { border: 1.5px solid var(--encre); }
.carte b { display: block; font: 600 1.0625rem/1.3 Jost, sans-serif; }
.carte p { margin: 6px 0 0; font-size: .97rem; }
.btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; margin-top: 12px; padding: 8px 20px;
  border: 0; border-radius: 10px; background: var(--encre); color: #fff; text-decoration: none; font: 700 1rem "Atkinson Hyperlegible Next", sans-serif;
  box-shadow: 0 4px 12px rgba(20,12,40,.22); cursor: pointer; }
.lien { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 44px; border: 0; background: none;
  color: var(--encre); font: 700 1rem "Atkinson Hyperlegible Next", sans-serif; cursor: pointer; }

#saisie { flex: none; display: flex; gap: 8px; align-items: flex-end; padding: 8px 14px 16px; }
#saisie textarea { flex: 1; min-width: 0; min-height: 48px; max-height: 30dvh; resize: none; border: 1.5px solid var(--encre); border-radius: 12px;
  padding: 12px 14px; font: inherit; color: var(--encre); background: #fff; }
#saisie textarea:focus { outline: none; box-shadow: inset 0 0 0 1px var(--encre); }
#saisie button { flex: none; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; border: 0;
  border-radius: 9px; background: var(--encre); color: #fff; cursor: pointer; }

/* Bouton touché : descend de 2 px et remonte en 160 ms. */
button, .btn { transition: transform 160ms var(--entree); }
button:active, .btn:active { transform: translateY(2px); }
/* Hors ligne : ce qui a besoin du serveur est grisé. */
body.hors-ligne [data-reseau] { opacity: .45; pointer-events: none; }
body.hors-ligne [data-reseau]::after { content: " (il faut du réseau)"; font-weight: 400; }

@keyframes m-monte { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@keyframes m-fondu { from { opacity: 0; } to { opacity: 1; } }
@keyframes m-droite { from { opacity: 0; translate: 12px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes m-point { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
@keyframes m-respire { 0%, 100% { scale: 1; } 50% { scale: 1.04; } }
@keyframes m-medaille { 0% { opacity: 0; scale: .6; } 60% { opacity: 1; scale: 1.12; filter: brightness(1.3); } 100% { scale: 1; filter: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Fiche 12, les états particuliers (gabarits/etats.html). */
.lu { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.lien-fort { min-height: 44px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--encre); text-decoration: none; }
/* L3, L4 : une liste vide dit pourquoi, et quoi faire. */
.vide { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; margin: 48px 0 16px; }
.arche-vide { display: block; width: 150px; height: 200px; border-radius: 75px 75px 10px 10px; overflow: hidden;
  box-shadow: 0 0 0 3px #fff, 0 0 34px 6px rgba(255,226,160,.55); }
.arche-vide img { width: 100%; height: 100%; object-fit: cover; object-position: 40% 50%; }
.tuile-vide { display: flex; align-items: center; justify-content: center; width: 96px; height: 96px; border-radius: 14px; background: #fff; border: 1px solid var(--filet); color: var(--encre); }
.tuile-vide svg { width: 40px; height: 40px; }
.titre-vide { margin: 0; font: 600 1.375rem/1.25 Jost, sans-serif; }
.txt-vide { margin: 0; color: var(--second); }
.lien-invitation summary { list-style: none; cursor: pointer; } .lien-invitation summary::-webkit-details-marker { display: none; }
/* L7 : le squelette d'une liste, montré seulement si elle tarde plus de 400 ms. */
.squelette { display: flex; flex-direction: column; gap: 12px; animation: m-fondu 320ms ease-out 400ms both; }
.sq-carte { display: flex; gap: 14px; align-items: center; padding: 12px 14px; }
.sq-carte span { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.sq { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--lavande) 0, var(--fond) 50%, var(--lavande) 100%);
  background-size: 400px 100%; animation: brille 1.4s linear infinite; }
.sq-arche { flex: none; width: 56px; height: 70px; border-radius: 28px 28px 9px 9px; }
@keyframes brille { from { background-position: -200px 0; } to { background-position: 200px 0; } }
/* L5, L8, L9 : la roue d'attente. */
.roue { display: inline-block; flex: none; width: 48px; height: 48px; border-radius: 50%; border: 5px solid var(--bord); border-top-color: var(--encre); animation: tourne 1s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
/* L8 : le Meneur prépare. */
.etapes-prep { list-style: none; margin: 0; padding: 2px 16px; }
.etapes-prep .ligne { display: flex; align-items: center; gap: 12px; min-height: 48px; color: var(--second); }
.etapes-prep .case { width: 22px; height: 22px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--bord); }
.etapes-prep .en-cours { color: var(--encre); font-weight: 700; }
.etapes-prep .en-cours .case { box-shadow: none; border: 3px solid var(--bord); border-top-color: var(--encre); animation: tourne 1s linear infinite; }
.etapes-prep .faite { color: var(--encre); }
.etapes-prep .faite .case { border-radius: 7px; box-shadow: none; background: #2E7D4F url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 16px no-repeat; }
.m-case .case { animation: m-medaille 420ms var(--entree) both; }
/* L9 : le paiement en cours, une feuille sans bouton par-dessus B6. */
.voile-paiement { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: rgba(28,24,56,.45); }
.feuille-paiement { width: 100%; max-width: 430px; padding: 26px 18px calc(44px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0;
  background: var(--carte); text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; animation: m-monte 460ms var(--entree) both; }
.feuille-paiement h2 { margin: 6px 0 0; font: 600 1.375rem Jost, sans-serif; } .feuille-paiement p { margin: 0; color: var(--second); }
