/* ======================================================================
   Jeu concours CERFRANCE Côtes d'Armor — front participant (REFONTE v5)
   - Fond ANTHRACITE chaud (plus de bleu) + or riche.
   - Typo en GRAS et bien lisible (Figtree 800/900).
   - Chaque écran tient sur UNE vue, sans scroll (flex plein écran, compact).
   - Plus d'animations.  Format téléphone.
   ====================================================================== */

:root{
  --or:#E0A838;
  --or-hi:#F7CF6B;
  --or-d:#A4761F;

  --noir:#0C0B0A;        /* fond le plus sombre (chaud) */
  --anthra:#201D1B;      /* anthracite chaud */

  --surface:rgba(255,255,255,.05);
  --surface-2:rgba(255,255,255,.09);

  --ink:#F7F3EA;
  --ink-2:rgba(247,243,234,.74);
  --ink-3:rgba(247,243,234,.46);
  --line:rgba(255,255,255,.12);

  --ok:#3FC57F; --err:#FF6B61;
  --r:14px; --r-lg:20px;
  --shadow:0 20px 48px rgba(0,0,0,.55);
  --foil:linear-gradient(180deg,var(--or-hi) 0%,var(--or) 55%,var(--or-d) 100%);
  --foil-txt:linear-gradient(180deg,#FFE9B8 0%,var(--or-hi) 42%,var(--or) 100%);
  --ease:cubic-bezier(.22,.61,.36,1);

  --font-display:"Figtree",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --font-body:"Figtree",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --font-title:"Figtree",system-ui,sans-serif;
}

*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0; font-family:var(--font-body); color:var(--ink);
  background:var(--noir); line-height:1.5; height:100dvh; overflow:hidden;
  display:flex; flex-direction:column; -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility;
  position:relative;
}
/* Fond anthracite chaud + halo doré animé (pas de bleu, pas de pastel) */
body::before{
  content:""; position:fixed; inset:0; z-index:-2;
  background:linear-gradient(180deg, var(--anthra) 0%, #16130F 52%, var(--noir) 100%);
}
@keyframes drift{ 0%{ transform:translate3d(-3%,-2%,0) scale(1.05) } 100%{ transform:translate3d(4%,4%,0) scale(1.14) } }

h1,h2,h3{ font-family:var(--font-title); margin:0; line-height:1; font-weight:900; }
p{ margin:0; }
img{ max-width:100%; display:block; }
button{ font-family:inherit; }

/* ----- Shell téléphone PLEIN ÉCRAN (contenu centré, pas de scroll) ----- */
.app{
  flex:1 1 auto; min-height:0; width:100%; max-width:440px; margin:0 auto;
  padding:10px 16px; display:flex; flex-direction:column; align-items:stretch;
  overflow-y:auto; -webkit-overflow-scrolling:touch; position:relative; z-index:1;
}
/* Centre quand ça tient ; si le contenu dépasse, s'aligne EN HAUT (le trophée
   reste visible) et devient défilable au lieu d'être coupé. */
.app > *{ margin:auto 0; width:100%; flex:0 0 auto; }
@media (min-width:600px){
  body{ padding:0; }
  .app{
    max-width:406px; height:min(92dvh,860px); margin:auto; flex:0 0 auto;
    padding:14px 20px; border-radius:40px; border:1px solid rgba(255,255,255,.08);
    background:linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01));
    box-shadow:0 50px 100px rgba(0,0,0,.65), inset 0 1px 0 rgba(255,255,255,.06);
  }
}

/* ----- Animations ----- */
@keyframes fadeUp{ from{ opacity:0; transform:translateY(16px) } to{ opacity:1; transform:none } }
@keyframes fadeIn{ from{ opacity:0 } to{ opacity:1 } }
@keyframes pop{ 0%{ transform:scale(.7); opacity:0 } 60%{ transform:scale(1.08) } 100%{ transform:scale(1); opacity:1 } }
@keyframes floaty{ 0%,100%{ transform:translateY(0) } 50%{ transform:translateY(-9px) } }
@keyframes medalGlow{ 0%,100%{ filter:drop-shadow(0 0 14px rgba(247,207,107,.4)) drop-shadow(0 12px 22px rgba(0,0,0,.5)) } 50%{ filter:drop-shadow(0 0 34px rgba(247,207,107,.75)) drop-shadow(0 12px 22px rgba(0,0,0,.5)) } }
@keyframes ringSpin{ to{ transform:rotate(360deg) } }
@keyframes spin{ to{ transform:rotate(360deg) } }
@keyframes confFall{ to{ transform:translateY(118vh) rotate(720deg); opacity:1 } }
@keyframes sweep{ 0%{ left:-60% } 100%{ left:140% } }
@keyframes btnPulse{ 0%,100%{ box-shadow:0 12px 26px rgba(224,168,56,.42) } 50%{ box-shadow:0 12px 40px rgba(247,207,107,.6) } }
@keyframes floatDust{ 0%{ transform:translateY(0); opacity:0 } 10%{ opacity:.7 } 90%{ opacity:.7 } 100%{ transform:translateY(-120px); opacity:0 } }

.in{ animation:fadeUp .5s var(--ease) both; }
.in-1{ animation-delay:.04s } .in-2{ animation-delay:.09s } .in-3{ animation-delay:.14s }
.in-4{ animation-delay:.19s } .in-5{ animation-delay:.24s } .in-6{ animation-delay:.30s }

/* ----- Boutons (gras) ----- */
.btn{
  position:relative; overflow:hidden; display:inline-flex; align-items:center; justify-content:center; gap:10px;
  width:100%; min-height:54px; padding:14px 22px; border:0; border-radius:var(--r);
  font-family:var(--font-display); font-weight:900; font-size:1.1rem; letter-spacing:.01em; text-transform:uppercase;
  cursor:pointer; -webkit-tap-highlight-color:transparent; transition:transform .06s ease, box-shadow .2s var(--ease), filter .2s ease;
}
.btn--primary{ background:var(--foil); color:#1a1205; box-shadow:0 10px 22px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.5); }
.btn--primary::after{ content:""; position:absolute; top:-40%; left:-60%; width:38%; height:180%; background:linear-gradient(90deg,transparent,rgba(255,255,255,.6),transparent); transform:rotate(8deg); pointer-events:none; }
.btn--primary:hover{ filter:brightness(1.05); }
.btn--primary:hover::after{ animation:sweep 1s var(--ease); }
.btn--primary:active{ transform:translateY(1px); }
.btn--ghost{ background:rgba(255,255,255,.05); color:var(--ink); border:1.5px solid var(--line); min-height:48px; font-size:1rem; animation:none; }
.btn--ghost:hover{ border-color:var(--or); color:var(--or-hi); }
.btn--lg{ min-height:58px; font-size:1.2rem; }
.btn[disabled]{ opacity:.45; cursor:not-allowed; filter:grayscale(.3); animation:none; }
:where(a,button,input,select,textarea,[tabindex]):focus-visible{ outline:3px solid var(--or-hi); outline-offset:2px; border-radius:10px; }

/* ----- Logo (pastille blanche) ----- */
.brand{ display:flex; justify-content:center; margin-bottom:14px; }
.brand__img{ display:block; height:78px; width:auto; max-width:86vw; background:#fff; padding:16px 26px; border-radius:18px; box-shadow:0 16px 32px rgba(0,0,0,.5); }

/* ======================================================================
   HÉROS — plein cadre, compact, sans boîtes
   ====================================================================== */
.hero{ position:relative; padding:0; color:#fff; text-align:center; background:none; border:0; box-shadow:none; }
.hero__inner{ position:relative; z-index:1; }
/* Médaille : halo + anneau doré tournant derrière */
.hero__medal{ position:relative; width:96px; height:96px; margin:0 auto 10px; display:block; animation:floaty 4.8s ease-in-out infinite; filter:drop-shadow(0 10px 20px rgba(0,0,0,.55)); }
.hero__eyebrow{ display:block; font-family:var(--font-display); font-weight:800; font-size:.78rem; letter-spacing:.16em; text-transform:uppercase; color:var(--or-hi); margin-bottom:10px; }
.hero__title{ font-family:var(--font-title); font-weight:900; font-size:3.1rem; line-height:.92; letter-spacing:-.02em; text-transform:uppercase; text-wrap:balance; margin:0; }
.hero__title span{ display:block; background:var(--foil-txt); -webkit-background-clip:text; background-clip:text; color:transparent; }
.hero__rule{ position:relative; width:70px; height:4px; background:var(--foil); border-radius:3px; margin:14px auto 14px; overflow:hidden; }
.hero__rule::after{ content:""; position:absolute; top:0; left:-60%; width:50%; height:100%; background:linear-gradient(90deg,transparent,rgba(255,255,255,.95),transparent); animation:sweep 3s var(--ease) infinite; }
.hero__prize{ display:block; margin:0 auto 12px; max-width:360px; color:var(--ink); font-size:.98rem; line-height:1.45; }
.hero__prize b{ color:var(--or-hi); font-weight:800; }
.hero__prize-ic{ display:none; }
.welcome{ text-align:center; }
.welcome p{ color:var(--ink-2); font-size:.92rem; margin-bottom:6px; }
.welcome p:last-child{ margin-bottom:0; }
.hero__cta{ margin-top:18px; }
.hero__meta{ margin-top:14px; font-size:.8rem; color:var(--ink-3); display:flex; align-items:center; gap:7px; justify-content:center; }
.hero__meta svg{ width:15px; height:15px; opacity:.8; }

/* ======================================================================
   Cartes compactes
   ====================================================================== */
.card{ position:relative; background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg); box-shadow:var(--shadow); padding:18px 16px 16px; }
.section-head{ margin-bottom:12px; }
.step-pill{ display:block; font-family:var(--font-display); font-weight:800; font-size:.74rem; letter-spacing:.12em; text-transform:uppercase; color:var(--or-hi); margin-bottom:6px; }
.section-head__title{ font-family:var(--font-title); font-weight:900; font-size:1.7rem; text-transform:uppercase; letter-spacing:-.015em; color:var(--ink); text-wrap:balance; }
.section-head__sub{ margin-top:4px; color:var(--ink-2); font-size:.9rem; }

/* ----- Formulaire compact (tient en un écran) ----- */
.field{ margin-bottom:9px; }
.field__label{ display:block; font-weight:700; font-size:.82rem; color:var(--ink); margin-bottom:4px; }
.field__req{ color:var(--or-hi); font-weight:800; }
.field__input{ width:100%; min-height:46px; padding:11px 13px; font-size:16px; font-family:inherit; color:var(--ink); background:var(--surface-2); border:1.5px solid var(--line); border-radius:11px; transition:border-color .15s ease, box-shadow .15s ease, background .15s ease; }
.field__input::placeholder{ color:var(--ink-3); }
.field__input:focus{ border-color:var(--or); background:rgba(255,255,255,.12); box-shadow:0 0 0 3px rgba(224,168,56,.28); outline:none; }
.field__input[aria-invalid="true"]{ border-color:var(--err); box-shadow:0 0 0 3px rgba(255,107,97,.2); }
.field__error{ display:none; margin-top:3px; font-size:.78rem; color:var(--err); font-weight:600; }
.field--invalid .field__error{ display:block; }
.field-row{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }

.consent{ display:flex; gap:10px; align-items:flex-start; margin:10px 0 2px; padding:10px 12px; background:rgba(255,255,255,.03); border:1px solid var(--line); border-radius:11px; }
.consent__box{ flex:0 0 auto; width:22px; height:22px; margin-top:1px; accent-color:var(--or); cursor:pointer; }
.consent__text{ font-size:.72rem; line-height:1.35; color:var(--ink-2); max-height:62px; overflow:auto; }
.consent--invalid{ border-color:var(--err); box-shadow:0 0 0 3px rgba(255,107,97,.14); }
.consent__error{ display:none; margin:5px 0 0; font-size:.78rem; color:var(--err); font-weight:600; }
.consent--invalid + .consent__error{ display:block; }

/* ----- Quiz compact ----- */
.quiz-top{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.quiz-count{ font-family:var(--font-display); font-weight:800; font-size:.8rem; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-2); white-space:nowrap; }
.quiz-count b{ color:var(--or-hi); font-size:1.05rem; }
.quiz-bar{ flex:1 1 auto; height:9px; border-radius:999px; background:rgba(255,255,255,.1); overflow:hidden; }
.quiz-bar__fill{ height:100%; border-radius:999px; background:var(--foil); transition:width .45s var(--ease); }
.quiz-q{ font-family:var(--font-title); font-weight:900; font-size:1.42rem; line-height:1.14; letter-spacing:-.01em; color:var(--ink); margin:6px 0 14px; text-wrap:balance; }
.quiz-options{ display:flex; flex-direction:column; gap:10px; }
.quiz-option{ display:flex; align-items:center; gap:12px; width:100%; text-align:left; min-height:56px; padding:12px 14px; font-size:1.02rem; font-weight:700; color:var(--ink); background:var(--surface-2); border:1.5px solid var(--line); border-radius:var(--r); cursor:pointer; transition:border-color .15s ease, background .15s ease, transform .06s ease, box-shadow .15s ease; }
.quiz-option:hover{ border-color:var(--or); background:rgba(224,168,56,.1); }
.quiz-option:active{ transform:translateY(1px); }
.quiz-option.is-selected{ border-color:var(--or); background:rgba(224,168,56,.18); box-shadow:0 0 0 2px rgba(224,168,56,.5) inset; }
.quiz-option__marker{ flex:0 0 auto; width:30px; height:30px; display:inline-flex; align-items:center; justify-content:center; font-family:var(--font-display); font-weight:900; font-size:.98rem; color:var(--or-hi); background:rgba(224,168,56,.14); border:1.5px solid var(--or); border-radius:50%; transition:all .15s var(--ease); }
.quiz-option.is-selected .quiz-option__marker{ background:var(--foil); color:#1a1205; transform:scale(1.08); }
.quiz-option__check{ margin-left:auto; width:22px; height:22px; opacity:0; transform:scale(.6); transition:all .2s var(--ease); }
.quiz-option.is-selected .quiz-option__check{ opacity:1; transform:scale(1); }
.quiz-actions{ margin-top:16px; }

/* ----- Résultat compact ----- */
.result{ text-align:center; }
.result__badge{ width:98px; height:98px; margin:0 auto 10px; filter:drop-shadow(0 12px 22px rgba(0,0,0,.5)); animation:pop .6s var(--ease) both; }
.result__title{ font-family:var(--font-title); font-weight:900; font-size:1.8rem; text-transform:uppercase; letter-spacing:-.015em; color:var(--ink); margin-bottom:10px; text-wrap:balance; line-height:1.02; }
.result__title--win{ background:var(--foil-txt); -webkit-background-clip:text; background-clip:text; color:transparent; }
.result__score{ display:inline-flex; align-items:center; gap:8px; font-family:var(--font-display); font-weight:900; font-size:1.1rem; letter-spacing:.02em; color:#1a1205; background:var(--foil); padding:7px 20px; border-radius:999px; margin:2px 0 12px; }
.result__text{ color:var(--ink-2); font-size:.95rem; margin-bottom:8px; }
.result__note{ margin-top:10px; font-size:.9rem; color:var(--ink-2); }
.result__note strong{ color:var(--or-hi); }

/* Bloc « Double tes chances » */
.boost{ position:relative; overflow:hidden; margin-top:14px; padding:15px 16px; border-radius:var(--r-lg); color:#fff; text-align:center;
  background:linear-gradient(160deg,#2c2318 0%, #16110b 100%); border:1px solid rgba(247,207,107,.22); box-shadow:var(--shadow); }
.boost__x2{ display:inline-block; font-family:var(--font-display); font-weight:900; font-size:2rem; line-height:1; letter-spacing:-.02em; background:var(--foil-txt); -webkit-background-clip:text; background-clip:text; color:transparent; }
.boost__title{ font-family:var(--font-title); font-weight:900; font-size:1.3rem; text-transform:uppercase; letter-spacing:-.01em; margin-bottom:5px; }
.boost__sub{ color:rgba(255,255,255,.84); font-size:.85rem; margin-bottom:12px; line-height:1.35; }
.boost__sub b{ color:var(--or-hi); }
.boost .btn--ghost{ color:#fff; border-color:rgba(247,207,107,.5); margin-top:9px; background:rgba(255,255,255,.05); }
.boost .btn--ghost:hover{ border-color:var(--or-hi); color:var(--or-hi); }

/* ----- Jeu : remplit l'écran, hauteur CONCRÈTE (corrige le bug mobile) ----- */
.game-screen{ padding:0; background:none; border:0; box-shadow:none; }
#game-host{ width:100%; height:78dvh; max-height:680px; }
@media (min-width:600px){ #game-host{ height:72vh; max-height:720px; } }
.boosted-banner{ display:flex; align-items:center; gap:10px; justify-content:center; margin-top:14px; color:var(--or-hi); font-weight:800; font-family:var(--font-display); letter-spacing:.02em; text-transform:uppercase; }

/* ----- Confettis ----- */
.confetti{ position:fixed; inset:0; pointer-events:none; z-index:50; overflow:hidden; }
.confetti i{ position:absolute; top:-14px; width:9px; height:14px; opacity:0; border-radius:2px; animation:confFall linear forwards; }

/* ----- Alertes ----- */
.alert{ margin:0 0 12px; padding:11px 14px; border-radius:11px; font-size:.9rem; font-weight:600; display:flex; gap:10px; align-items:flex-start; }
.alert--error{ background:rgba(255,107,97,.14); color:#FFB3AD; border:1px solid rgba(255,107,97,.35); }
.alert__retry{ margin-top:10px; }
.btn__spinner{ width:18px; height:18px; border-radius:50%; border:2.5px solid rgba(0,0,0,.25); border-top-color:#1a1205; animation:spin .7s linear infinite; }

/* ----- Pied de page ----- */
.site-footer{ flex:0 0 auto; text-align:center; padding:6px 16px 10px; color:var(--ink-3); font-size:.74rem; letter-spacing:.04em; position:relative; z-index:1; }
.site-footer span{ opacity:.9; }
.site-footer a{ color:var(--or-hi); text-decoration:none; font-weight:700; }
.site-footer a:hover{ text-decoration:underline; }
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

@media (prefers-reduced-motion:reduce){
  *{ animation-duration:.001ms !important; animation-iteration-count:1 !important; transition-duration:.001ms !important; }
  .hero__medal,.btn--primary,.boost,.app::after,body::after{ animation:none !important; }
}

/* Petits écrans : on réduit encore pour tenir sans scroll */
@media (max-height:740px){
  .hero__medal{ width:78px; height:78px; margin-bottom:8px; }
  .hero__title{ font-size:2.5rem; }
  .hero__prize{ font-size:.9rem; margin-bottom:8px; }
  .welcome p{ font-size:.85rem; }
  .brand__img{ height:62px; padding:12px 20px; }
}
