/* SAVE LUMIOS — charte reprise de lumios-le-jeu.fr
   Crème #FDF9F0 · Indigo #36398D · Corail #EB615F · Menthe #C7E6D9 · Vert #4BAA70 · Jaune #FAD45E
   Titres Grandstander · Texte Poppins · Boutons Jost capitales */

/* Polices hébergées ici (licence SIL OFL) : aucune requête vers Google Fonts. */
@font-face { font-family: 'Grandstander'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/grandstander-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Grandstander'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/grandstander-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Grandstander'; font-style: normal; font-weight: 800; font-display: swap; src: url('/fonts/grandstander-latin-800-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/poppins-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/poppins-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Poppins'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/poppins-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/jost-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Jost'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/jost-latin-600-normal.woff2') format('woff2'); }

:root {
  --creme: #FDF9F0;
  --creme-2: #F4EEDF;
  --indigo: #36398D;
  --indigo-nuit: #14153A;
  --corail: #EB615F;
  --corail-fonce: #D24A48;
  --menthe: #C7E6D9;
  --vert: #4BAA70;
  --jaune: #FAD45E;
  --bleu: #4F7BEA;
  --texte: #333333;
  --texte-doux: #4A4D6B;
  --gris: #8C8FA8;
  --blanc: #FFFFFF;
  --rayon: 24px;
  --rayon-pilule: 999px;
  --ombre: 0 10px 30px rgba(54, 57, 141, 0.10);
  --f-titre: 'Grandstander', 'Trebuchet MS', sans-serif;
  --f-texte: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-bouton: 'Jost', 'Poppins', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--creme); color: var(--texte);
  font-family: var(--f-texte); font-weight: 400; font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(420px 420px at -8% 18%, rgba(199, 230, 217, .55), transparent 70%),
    radial-gradient(380px 380px at 108% 62%, rgba(250, 212, 94, .28), transparent 70%),
    radial-gradient(340px 340px at 12% 104%, rgba(235, 97, 95, .16), transparent 70%);
  background-attachment: fixed;
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 3px; }

/* ── Barre du haut ─────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  height: 60px; padding: 0 16px; padding-top: env(safe-area-inset-top);
  background: var(--indigo); color: var(--blanc);
}
.topbar__logo { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
.topbar__logo img { height: 30px; width: auto; display: block; }
.topbar__wordmark { font-family: var(--f-titre); font-weight: 700; font-size: 28px; letter-spacing: 3px; }
.topbar__tag {
  font-family: var(--f-bouton); font-weight: 600; font-size: 12px; letter-spacing: 2.5px;
  background: var(--corail); color: var(--blanc); padding: 4px 10px 3px; border-radius: var(--rayon-pilule);
}
.topbar__back {
  position: absolute; left: 10px; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .12); color: var(--blanc); display: grid; place-items: center;
}
.topbar__back:active { background: rgba(255, 255, 255, .25); }

.progress { display: flex; gap: 6px; width: min(100%, 560px); margin: 0 auto; padding: 14px 22px 0; }
.progress span { flex: 1; height: 6px; border-radius: 6px; background: var(--creme-2); transition: background .35s; }
.progress span.on { background: var(--corail); }
.progress span.done { background: var(--indigo); }

/* ── Scène ─────────────────────────────────────────────────────────────────── */
.stage { flex: 1; width: min(100%, 560px); margin: 0 auto; padding: 22px 20px 36px; }
.screen { animation: entree .38s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes entree { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

h1, h2, h3 { font-family: var(--f-titre); font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: .3px; }
h1 { font-size: clamp(28px, 7.4vw, 36px); color: var(--indigo); }
h2 { font-size: clamp(24px, 6.4vw, 30px); color: var(--indigo); }
h3 { font-size: 18px; color: var(--indigo); }
.accent { color: var(--corail); }
.lead { color: var(--texte-doux); margin: 10px 0 0; }
.kicker {
  font-family: var(--f-bouton); font-weight: 600; text-transform: uppercase; letter-spacing: 2.5px;
  font-size: 12.5px; color: var(--corail); margin: 0 0 8px;
}
.small { font-size: 13.5px; color: var(--gris); }
.center { text-align: center; }
.stack > * + * { margin-top: 16px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }

/* ── Boutons ───────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  min-height: 56px; padding: 14px 24px; border: 2px solid transparent; border-radius: var(--rayon-pilule);
  font-family: var(--f-bouton); font-weight: 600; font-size: 16px; letter-spacing: 2px; text-transform: uppercase;
  text-decoration: none; transition: transform .12s, box-shadow .2s, background .2s; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.975); }
.btn--primaire { background: var(--corail); color: var(--blanc); box-shadow: 0 8px 20px rgba(235, 97, 95, .35); }
.btn--primaire:hover { background: var(--corail-fonce); }
.btn--indigo { background: var(--indigo); color: var(--blanc); box-shadow: 0 8px 20px rgba(54, 57, 141, .28); }
.btn--ligne { background: transparent; color: var(--indigo); border-color: var(--indigo); }
.btn--ligne:hover { background: rgba(54, 57, 141, .06); }
.btn--texte { background: none; color: var(--texte-doux); min-height: 44px; letter-spacing: 1.2px; font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }
.btn[disabled] { opacity: .45; pointer-events: none; box-shadow: none; }
.actions { display: grid; gap: 12px; margin-top: 28px; }

/* ── Cartes de choix ───────────────────────────────────────────────────────── */
.choix { display: grid; gap: 14px; margin-top: 24px; }
.carte-choix {
  display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: 16px; width: 100%; text-align: left;
  padding: 14px 18px 14px 14px; background: var(--blanc); border: 2px solid transparent; border-radius: var(--rayon);
  box-shadow: var(--ombre); transition: transform .15s, border-color .2s, box-shadow .2s;
}
.carte-choix:hover, .carte-choix:focus-visible { border-color: var(--corail); transform: translateY(-2px); }
.carte-choix:active { transform: scale(.985); }
.carte-choix__visuel { width: 84px; height: 84px; border-radius: 20px; display: grid; place-items: center; background: var(--indigo-nuit); overflow: hidden; }
.carte-choix__visuel svg { width: 100%; height: 100%; display: block; }
.carte-choix__titre { font-family: var(--f-titre); font-weight: 700; font-size: 20px; color: var(--indigo); line-height: 1.15; }
.carte-choix__sous { font-size: 14px; color: var(--texte-doux); margin-top: 3px; }
.carte-choix__fleche { color: var(--corail); }

/* ── Lumie (bulle de l'assistant) ──────────────────────────────────────────── */
.lumie { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: start; }
.lumie__avatar { width: 52px; height: 52px; border-radius: 50%; background: var(--blanc); box-shadow: var(--ombre); overflow: hidden; display: grid; place-items: center; }
.lumie__avatar img, .lumie__avatar svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.lumie__bulle {
  position: relative; background: var(--menthe); color: #1F3B30; border-radius: 6px 22px 22px 22px; padding: 14px 18px; font-weight: 500;
}
.lumie__nom { display: block; font-family: var(--f-bouton); font-size: 11.5px; letter-spacing: 2px; text-transform: uppercase; color: #2F6B52; margin-bottom: 2px; }
.bulle-client { margin-left: auto; max-width: 86%; background: var(--indigo); color: var(--blanc); border-radius: 22px 22px 6px 22px; padding: 12px 18px; width: fit-content; }

/* ── Champs ────────────────────────────────────────────────────────────────── */
.champ { display: block; }
.champ__label { display: block; font-weight: 600; font-size: 14px; color: var(--indigo); margin: 0 0 6px 6px; }
.champ__label .opt { font-weight: 400; color: var(--gris); }
.input, .textarea {
  width: 100%; background: var(--blanc); border: 2px solid #E7E0CF; border-radius: 18px; padding: 14px 16px; font-size: 16px;
  transition: border-color .2s, box-shadow .2s; appearance: none;
}
.textarea { min-height: 132px; resize: vertical; border-radius: 22px; line-height: 1.45; }
.input:focus, .textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 4px rgba(54, 57, 141, .12); }
.input.erreur, .textarea.erreur { border-color: var(--corail); }
.grille-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grille-cp { display: grid; grid-template-columns: 120px 1fr; gap: 12px; }
.msg-erreur { color: var(--corail-fonce); font-size: 14px; font-weight: 500; margin: 8px 6px 0; }

.puces { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.puce {
  border: 2px solid #E7E0CF; background: var(--blanc); color: var(--texte-doux); border-radius: var(--rayon-pilule);
  padding: 9px 15px; font-size: 14.5px; font-weight: 500; transition: all .15s;
}
.puce:hover { border-color: var(--indigo); color: var(--indigo); }
.puce.on { background: var(--indigo); border-color: var(--indigo); color: var(--blanc); }

.coche { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; font-size: 14px; color: var(--texte-doux); }
.coche input { width: 24px; height: 24px; margin: 1px 0 0; accent-color: var(--corail); }
.coche a { color: var(--indigo); }

.compteur { display: inline-flex; align-items: center; gap: 4px; background: var(--blanc); border: 2px solid #E7E0CF; border-radius: var(--rayon-pilule); padding: 4px; }
.compteur button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--creme-2); color: var(--indigo); font-size: 24px; font-weight: 600; line-height: 1; }
.compteur output { min-width: 44px; text-align: center; font-family: var(--f-titre); font-weight: 700; font-size: 24px; color: var(--indigo); }

/* ── Cartes de contenu ─────────────────────────────────────────────────────── */
.carte { background: var(--blanc); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 20px; }
.etapes { list-style: none; margin: 0; padding: 0; counter-reset: e; display: grid; gap: 14px; }
.etapes li { counter-increment: e; display: grid; grid-template-columns: 38px 1fr; gap: 14px; align-items: start; }
.etapes li::before {
  content: counter(e); width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--jaune); color: var(--indigo); font-family: var(--f-titre); font-weight: 800; font-size: 19px; padding-top: 2px;
}
.etapes strong { color: var(--indigo); }
.alerte { display: grid; grid-template-columns: 26px 1fr; gap: 10px; background: #FFF4D2; border-radius: 18px; padding: 14px 16px; font-size: 14.5px; color: #5C4A0B; font-weight: 500; }
.alerte svg { margin-top: 1px; }

.recap { display: grid; gap: 0; }
.recap__ligne { display: grid; grid-template-columns: 116px 1fr; gap: 10px; padding: 11px 0; border-bottom: 1px dashed #E7E0CF; font-size: 15px; }
.recap__ligne:last-child { border-bottom: 0; }
.recap__ligne dt { color: var(--gris); margin: 0; }
.recap__ligne dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* ── Chargement ────────────────────────────────────────────────────────────── */
.attente { display: grid; place-items: center; text-align: center; padding: 56px 0 24px; gap: 22px; }
.orbe { position: relative; width: 120px; height: 120px; }
.orbe i { position: absolute; inset: 0; border-radius: 50%; animation: orbe 2.4s linear infinite; mix-blend-mode: multiply; }
.orbe i:nth-child(1) { background: radial-gradient(circle at 35% 35%, #ffb3b1, var(--corail)); }
.orbe i:nth-child(2) { background: radial-gradient(circle at 35% 35%, #b8f0cf, var(--vert)); animation-delay: -.8s; }
.orbe i:nth-child(3) { background: radial-gradient(circle at 35% 35%, #b9ccff, var(--bleu)); animation-delay: -1.6s; }
@keyframes orbe { 0%, 100% { opacity: 0; transform: scale(.7); } 33% { opacity: 1; transform: scale(1); } 66% { opacity: 0; transform: scale(.7); } }
.attente p { font-family: var(--f-titre); font-weight: 700; font-size: 21px; color: var(--indigo); margin: 0; }

/* ── Justificatif ──────────────────────────────────────────────────────────── */
.depot { border: 2.5px dashed #D9D0BB; border-radius: var(--rayon); background: rgba(255, 255, 255, .7); padding: 26px 20px; text-align: center; }
.depot.survol { border-color: var(--corail); background: #FFF1F0; }
.depot__icone { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; background: var(--menthe); display: grid; place-items: center; color: #2F6B52; }
.fichier { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; }
.fichier__vignette { width: 64px; height: 64px; border-radius: 14px; background: var(--creme-2); object-fit: cover; display: grid; place-items: center; color: var(--indigo); font-family: var(--f-bouton); font-size: 13px; letter-spacing: 1px; overflow: hidden; }
.fichier__vignette img { width: 100%; height: 100%; object-fit: cover; }
.fichier__nom { font-weight: 600; overflow-wrap: anywhere; font-size: 15px; }
.etat { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 500; color: var(--texte-doux); }
.etat::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--jaune); animation: pulse 1s ease-in-out infinite; }
.etat.ok::before { background: var(--vert); animation: none; }
.etat.ko::before { background: var(--corail); animation: none; }
@keyframes pulse { 50% { transform: scale(1.6); opacity: .5; } }

/* ── Fin ───────────────────────────────────────────────────────────────────── */
.heros { text-align: center; padding-top: 12px; }
.heros__visuel { width: 148px; height: 148px; margin: 0 auto 18px; position: relative; }
.heros__visuel svg { width: 100%; height: 100%; }
.reference {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 18px; padding: 12px 14px 12px 22px;
  background: var(--indigo); color: var(--blanc); border-radius: var(--rayon-pilule);
  font-family: var(--f-titre); font-weight: 800; font-size: 26px; letter-spacing: 3px;
}
.reference button { border: 0; border-radius: var(--rayon-pilule); background: rgba(255, 255, 255, .16); color: var(--blanc); font-family: var(--f-bouton); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; padding: 9px 13px; }
.confettis { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 30; }
.confettis i { position: absolute; top: -20px; width: 14px; height: 14px; border-radius: 50%; animation: chute linear forwards; }
@keyframes chute { to { transform: translateY(112vh) rotate(540deg); opacity: .9; } }

.foot { text-align: center; font-size: 12px; color: var(--gris); padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); letter-spacing: .5px; }

.toast {
  position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 90;
  background: var(--indigo-nuit); color: var(--blanc); padding: 12px 20px; border-radius: 22px; font-size: 14.5px; font-weight: 500;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .3); width: max-content; max-width: calc(100vw - 32px); text-align: center; animation: entree .25s both;
}

/* ── Test caméra (plein écran, ambiance « partie de nuit ») ────────────────── */
.cam { position: fixed; inset: 0; z-index: 60; background: var(--indigo-nuit); color: var(--blanc); display: flex; flex-direction: column; overflow: hidden; animation: fondu .25s both; }
@keyframes fondu { from { opacity: 0; } }
.cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam__voile { position: absolute; inset: 0; pointer-events: none; }
.cam__voile svg { width: 100%; height: 100%; display: block; }
.cam__haut { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: calc(12px + env(safe-area-inset-top)) 14px 0; }
.cam__fermer { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(20, 21, 58, .55); color: var(--blanc); display: grid; place-items: center; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.cam__rec { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-bouton); font-size: 12px; letter-spacing: 2px; background: rgba(20, 21, 58, .55); padding: 8px 12px; border-radius: var(--rayon-pilule); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.cam__rec::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--corail); animation: pulse 1.1s infinite; }
.cam__points { display: flex; gap: 6px; }
.cam__points i { width: 22px; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, .28); transition: background .3s; }
.cam__points i.on { background: var(--blanc); }
.cam__consigne { position: relative; z-index: 2; margin: 14px 16px 0; padding: 16px 18px; text-align: center; background: rgba(20, 21, 58, .62); border-radius: 22px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.cam__consigne h2 { color: var(--blanc); font-size: clamp(21px, 5.6vw, 26px); }
.cam__consigne p { margin: 6px 0 0; font-size: 14.5px; color: rgba(255, 255, 255, .82); }
.cam__consigne.flash { animation: flash .5s; }
@keyframes flash { 30% { transform: scale(1.04); background: rgba(235, 97, 95, .85); } }
.cam__centre { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 1; }
.cam__chiffre { font-family: var(--f-titre); font-weight: 800; font-size: 96px; line-height: 1; text-shadow: 0 4px 24px rgba(0, 0, 0, .55); }
.cam__bas { position: relative; z-index: 2; margin-top: auto; padding: 0 18px calc(22px + env(safe-area-inset-bottom)); display: grid; gap: 10px; }
.cam__bas .btn--fantome { background: rgba(20, 21, 58, .6); color: var(--blanc); border-color: rgba(255, 255, 255, .55); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); min-height: 50px; font-size: 14px; }
.cam__obturateur { justify-self: center; width: 78px; height: 78px; border-radius: 50%; border: 5px solid var(--blanc); background: var(--corail); box-shadow: 0 0 0 4px rgba(20, 21, 58, .4); }
.cam__obturateur.stop { border-radius: 26px; width: 66px; height: 66px; }
.cam__verdict { position: relative; z-index: 3; margin: auto 14px calc(18px + env(safe-area-inset-bottom)); background: var(--creme); color: var(--texte); border-radius: 28px; padding: 22px 20px; text-align: center; animation: entree .35s both; }
.cam__verdict .pastille { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-bouton); font-weight: 600; font-size: 12.5px; letter-spacing: 2px; text-transform: uppercase; padding: 7px 14px; border-radius: var(--rayon-pilule); margin-bottom: 10px; }
.pastille.ok { background: #DDF3E5; color: #23693F; }
.pastille.ko { background: #FDE2E1; color: #A93230; }
.pastille.info { background: #E3E4F6; color: var(--indigo); }
.cam__verdict .actions { margin-top: 18px; }
.cam__analyse { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; background: rgba(20, 21, 58, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); text-align: center; }
.cam__analyse p { font-family: var(--f-titre); font-weight: 700; font-size: 22px; margin: 18px 0 0; }
.cam__analyse .orbe i { mix-blend-mode: screen; }

@media (min-width: 720px) {
  .stage { padding-top: 34px; }
  .cam { left: 50%; right: auto; width: 460px; transform: translateX(-50%); box-shadow: 0 0 0 100vmax rgba(20, 21, 58, .92); }
}
