/* =================================================================
   Tombola — interface joueur
   Thème estival, épuré et festif. Les 3 couleurs de la marque sont
   injectées via --c1 / --c2 / --c3.
   ================================================================= */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --ink: #10233a;
  --ink-soft: #55708c;
  --sand: #fff7ec;
  --sky-top: #d8f3ff;
  --sky-mid: #eaf8ff;
  --white: #ffffff;
  --radius: 22px;
  --radius-lg: 30px;
  --shadow-sm: 0 2px 8px rgba(16, 35, 58, .06);
  --shadow: 0 14px 40px -18px rgba(16, 35, 58, .35);
  --shadow-lg: 0 30px 70px -30px rgba(16, 35, 58, .45);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wheel-size: min(88vw, 430px);
}

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--ink);
  background: var(--fond-base);
  background-repeat: no-repeat;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- Thèmes ----
   Les couleurs de l'enseigne restent des ACCENTS : la base ne prend qu'une
   pointe de la couleur principale. Une base trop teintée transforme le fond
   en aplat de marque, et les halos n'ont plus rien à faire ressortir. */
body.theme-sombre {
  --fond-base: color-mix(in srgb, var(--c1) 7%, #070a10);
  --ink: #ffffff;
  --ink-soft: rgba(255,255,255,.72);
  --surface: rgba(255,255,255,.07);
  --surface-fort: rgba(255,255,255,.12);
  --contour: rgba(255,255,255,.14);
  --shadow: 0 18px 44px rgba(0,0,0,.32);
  --shadow-sm: 0 4px 14px rgba(0,0,0,.24);
  --shadow-lg: 0 30px 70px rgba(0,0,0,.42);
}
body.theme-clair {
  --fond-base: color-mix(in srgb, var(--c1) 4%, #ffffff);
  --ink: #10233a;
  --ink-soft: #55708c;
  --surface: rgba(255,255,255,.72);
  --surface-fort: #ffffff;
  --contour: rgba(16,35,58,.10);
  --shadow: 0 14px 34px rgba(16,35,58,.10);
  --shadow-sm: 0 2px 8px rgba(16,35,58,.06);
  --shadow-lg: 0 30px 70px -30px rgba(16,35,58,.45);
}

body.rtl { direction: rtl; }

/* ------------------------- Décor de fond -------------------------

   Quatre couches, AUCUNE ANIMATION.

   Le point qui fait tout : les halos sont composés en `screen` sur fond
   sombre. En composition normale, deux couleurs vives qui se superposent
   donnent une bouillie brune — le vert et le rouge de Marjane Market en
   sont le pire cas. En `screen` elles s'additionnent vers la lumière et
   restent franches. Sur fond clair, c'est `multiply`.

   Le décor est FIXÉ À LA FENÊTRE : s'il défilait avec le contenu, les
   trois halos s'étaleraient sur toute la hauteur du document et on n'en
   verrait qu'un seul à la fois.
   ------------------------------------------------------------------ */

.fond { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

/* AUCUN filter: blur() ici, volontairement. Un flou sur une surface de la
   taille de l'écran se paie au premier rendu, et deux fois plus sur un
   téléphone d'entrée de gamme. Un dégradé radial à quatre arrêts donne
   exactement le même adouci, gratuitement : c'est le dégradé lui-même qui
   est flou, il n'y a rien à flouter. */
.fond .halo {
  position: absolute; display: block; border-radius: 50%;
  mix-blend-mode: screen;
}
body.theme-clair .fond .halo { mix-blend-mode: multiply; }

.fond .halo-1 {
  width: 120%; height: 34%; inset-inline-start: -34%; top: -10%;
  background: radial-gradient(closest-side,
    color-mix(in srgb, var(--c1) 82%, transparent) 0%,
    color-mix(in srgb, var(--c1) 44%, transparent) 38%,
    color-mix(in srgb, var(--c1) 13%, transparent) 66%,
    transparent 88%);
}
.fond .halo-2 {
  width: 96%; height: 30%; inset-inline-end: -32%; top: 38%;
  background: radial-gradient(closest-side,
    color-mix(in srgb, var(--c2) 70%, transparent) 0%,
    color-mix(in srgb, var(--c2) 36%, transparent) 38%,
    color-mix(in srgb, var(--c2) 11%, transparent) 66%,
    transparent 88%);
}
.fond .halo-3 {
  width: 124%; height: 34%; inset-inline-start: -22%; bottom: -14%;
  background: radial-gradient(closest-side,
    color-mix(in srgb, var(--c3) 62%, transparent) 0%,
    color-mix(in srgb, var(--c3) 32%, transparent) 38%,
    color-mix(in srgb, var(--c3) 10%, transparent) 66%,
    transparent 88%);
}
body.theme-clair .fond .halo-1 { opacity: .58; }
body.theme-clair .fond .halo-2 { opacity: .46; }
body.theme-clair .fond .halo-3 { opacity: .56; }

/* Faisceaux : répétition conique depuis un point décentré en haut. */
.fond .faisceaux {
  position: absolute; inset: -40% -40% auto -40%; height: 130%;
  background: repeating-conic-gradient(from 198deg at 66% 8%,
    rgba(255,255,255,.075) 0deg 2.6deg, transparent 2.6deg 9deg);
  -webkit-mask-image: radial-gradient(105% 78% at 66% 8%, #000 2%, transparent 62%);
          mask-image: radial-gradient(105% 78% at 66% 8%, #000 2%, transparent 62%);
}
body.theme-clair .fond .faisceaux {
  background: repeating-conic-gradient(from 198deg at 66% 8%,
    rgba(16,35,58,.075) 0deg 2.6deg, transparent 2.6deg 9deg);
}

/* Traînée : une seule diagonale claire. Sans elle, trois halos flous
   donnent une image molle ; avec, l'œil a une direction à suivre. */
.fond .lame {
  position: absolute; inset: -25% -45%;
  background: linear-gradient(108deg,
    transparent 0 41%, rgba(255,255,255,.085) 46%,
    rgba(255,255,255,.02) 51%, transparent 55% 100%);
}
body.theme-clair .fond .lame {
  background: linear-gradient(108deg,
    transparent 0 41%, rgba(255,255,255,.85) 46%,
    rgba(255,255,255,.3) 51%, transparent 55% 100%);
}

/* Halo doux derrière le bloc central : il détache l'affiche, la roue ou la
   carte du fond sans leur poser un cadre opaque. */
.fond .projecteur {
  position: absolute; left: 50%; top: 26%; width: 130%; height: 42%;
  transform: translateX(-50%);
  background: radial-gradient(closest-side,
    color-mix(in srgb, var(--c3) 22%, transparent) 0%,
    color-mix(in srgb, var(--c3) 10%, transparent) 44%,
    transparent 82%);
  mix-blend-mode: screen;
}
body.theme-clair .fond .projecteur { mix-blend-mode: normal; opacity: .35; }

/* Le grain casse le lissé des dégradés, qui bande visiblement sur OLED. */
.fond .grain {
  position: absolute; inset: 0; opacity: .10; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
.fond .vignette {
  position: absolute; inset: 0;
  background:
    radial-gradient(130% 82% at 50% 30%, transparent 42%, rgba(0,0,0,.38) 100%),
    linear-gradient(180deg, rgba(0,0,0,.22) 0, transparent 18%);
}
body.theme-clair .fond .vignette {
  background: radial-gradient(130% 82% at 50% 30%, transparent 46%, rgba(16,35,58,.09) 100%);
}

/* ---------------------------- Topbar ----------------------------- */

.topbar {
  position: relative; z-index: 3; min-height: 62px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px clamp(16px, 4vw, 32px);
}

.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand-logo { height: 42px; width: auto; max-width: 190px; object-fit: contain; display: block; }
.brand-name { font-weight: 800; font-size: 20px; color: var(--c1); letter-spacing: -.02em; }

.topbar-actions { display: flex; gap: 8px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 42px; padding: 0 13px;
  border: 1.5px solid var(--contour); border-radius: 14px;
  background: var(--surface); backdrop-filter: blur(9px);
  color: var(--ink); font: inherit; font-weight: 750; font-size: 15px;
  text-decoration: none; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform .18s ease, background .18s ease;
}
.icon-btn:hover { transform: translateY(-1px); background: var(--surface-fort); }
.icon-btn.muted { opacity: .45; }

/* ----------------------------- Scène ----------------------------- */

.stage {
  position: relative; z-index: 2;
  max-width: 720px; margin: 0 auto;
  padding: clamp(6px, 2vw, 18px) clamp(16px, 5vw, 28px) 48px;
  display: flex; flex-direction: column; align-items: center;
}

.hero { text-align: center; margin: 4px 0 clamp(14px, 3vw, 24px); }

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 7.4vw, 44px);
  line-height: 1.08; letter-spacing: -.035em; font-weight: 800;
  color: var(--ink);
  text-wrap: balance;
}
.hero .sub {
  margin: 0 auto; max-width: 30ch;
  font-size: clamp(15px, 3.6vw, 17px); line-height: 1.5;
  color: var(--ink-soft); text-wrap: balance;
}

/* ----------------------------- Roue ------------------------------ */

.wheel-section { display: flex; flex-direction: column; align-items: center; width: 100%; }

.wheel-wrap {
  position: relative;
  width: var(--wheel-size); height: var(--wheel-size);
  display: grid; place-items: center;
}
/* Ombre portee statique : un filtre drop-shadow sur un canvas anime
   force le navigateur a recalculer l'ombre a chaque image (tres couteux). */
.wheel-wrap::before {
  content: ''; position: absolute; inset: 4%; border-radius: 50%;
  box-shadow: 0 30px 48px -8px rgba(16,35,58,.42);
  z-index: 0;
}
#wheel {
  position: relative; z-index: 1;
  width: 100%; height: 100%; display: block; border-radius: 50%;
  transition: transform .5s ease;   /* retour en douceur quand le balancement s'arrete */
}

/* AU REPOS, LA ROUE NE BOUGE PAS. C'est délibéré.
   Une animation perpétuelle, même composée par le GPU, maintient la carte
   graphique en activité tant que l'onglet est ouvert : ventilateur qui souffle
   et batterie qui fond. On se contente donc d'une entrée jouée UNE fois au
   chargement, qui se termine et libère complètement la machine. */
#wheel.wheel-enter { animation: wheel-in 1.15s cubic-bezier(.22, 1, .36, 1) 1 both; }
@keyframes wheel-in {
  from { transform: rotate(-26deg) scale(.94); opacity: 0; }
  to   { transform: rotate(0deg) scale(1); opacity: 1; }
}

.wheel-pointer {
  position: absolute; top: -14px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 52px; z-index: 4;
  filter: drop-shadow(0 5px 10px rgba(16,35,58,.35));
  transform-origin: 50% 20%;
}
.wheel-pointer svg { width: 100%; height: 100%; display: block; }
.wheel-pointer.tick { animation: tick .07s ease-out; }
@keyframes tick {
  0% { transform: translateX(-50%) rotate(0deg); }
  50% { transform: translateX(-50%) rotate(-13deg); }
  100% { transform: translateX(-50%) rotate(0deg); }
}

.wheel-hub {
  position: absolute; z-index: 3;
  width: 25%; height: 25%; border-radius: 50%;
  border: 0; padding: 0; cursor: pointer;
  background: #fff;
  box-shadow: 0 8px 22px rgba(16,35,58,.28), inset 0 0 0 6px color-mix(in srgb, var(--c1) 90%, #fff);
  display: grid; place-items: center;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1);
}
.wheel-hub:hover { transform: scale(1.06); }
.wheel-hub:active { transform: scale(.96); }
.hub-inner {
  font-weight: 900; font-size: clamp(15px, 3.6vw, 19px); letter-spacing: .02em;
  color: var(--c1);
}
.wheel-hub[disabled] { cursor: default; opacity: .75; }

/* ---------------------------- Boutons ---------------------------- */

.cta {
  margin-top: clamp(18px, 4vw, 26px);
  border: 0; cursor: pointer;
  padding: 16px 30px; border-radius: 999px;
  font: inherit; font-size: 17px; font-weight: 800; letter-spacing: -.01em;
  color: #fff;
  background: linear-gradient(135deg, var(--c1) 0%, color-mix(in srgb, var(--c1) 70%, var(--c3)) 100%);
  box-shadow: 0 12px 26px -10px color-mix(in srgb, var(--c1) 75%, transparent), inset 0 -2px 0 rgba(0,0,0,.12);
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .2s ease, filter .2s ease;
  display: inline-flex; align-items: center; gap: 10px;
}
.cta:hover { transform: translateY(-2px); filter: brightness(1.04); }
.cta:active { transform: translateY(0) scale(.98); }
.cta[disabled] { opacity: .6; cursor: default; transform: none; }
.cta-spark { transition: transform .25s cubic-bezier(.34,1.56,.64,1); }
.cta:hover .cta-spark { transform: scale(1.25) rotate(12deg); }

.cta-submit { width: 100%; justify-content: center; margin-top: 20px; }
.cta-ghost {
  background: transparent; color: var(--ink-soft);
  box-shadow: none; font-weight: 700; padding: 12px 22px;
}
.cta-ghost:hover { background: rgba(16,35,58,.05); filter: none; }

/* ----------------------------- Lots ------------------------------ */

.prizes { margin-top: clamp(30px, 6vw, 44px); text-align: center; width: 100%; }
.prizes h2 {
  margin: 0 0 14px; font-size: 13px; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase; color: var(--ink-soft);
}
.prizes ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.prizes li {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--contour);
  backdrop-filter: blur(9px);
  font-size: 14px; font-weight: 600; color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.pz-ico { font-size: 16px; }

.legal {
  margin-top: 34px; max-width: 46ch; text-align: center;
  font-size: 12px; line-height: 1.6; color: var(--ink-soft); opacity: .85;
}

/* -------------------------- Feuille form -------------------------- */

.sheet-backdrop {
  position: fixed; inset: 0; z-index: 8;
  background: rgba(10, 26, 45, .5);
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; backdrop-filter: blur(4px); }

.sheet {
  position: fixed; z-index: 9; left: 0; right: 0; bottom: 0;
  max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: #fff;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 12px clamp(20px, 6vw, 34px) max(26px, env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
  transform: translateY(102%);
  transition: transform .38s cubic-bezier(.32,.72,0,1), visibility 0s linear .38s;
  pointer-events: none; visibility: hidden;
}
.sheet.open {
  transform: translateY(0); pointer-events: auto; visibility: visible;
  transition: transform .38s cubic-bezier(.32,.72,0,1), visibility 0s;
}

.sheet-handle {
  width: 42px; height: 4px; border-radius: 99px; background: rgba(16,35,58,.16);
  margin: 4px auto 12px;
}
.sheet-close {
  position: absolute; top: 14px; inset-inline-end: 16px;
  width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(16,35,58,.06); color: var(--ink-soft); font-size: 15px;
}
.sheet-close:hover { background: rgba(16,35,58,.11); }

.sheet h2 { margin: 0 0 4px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.sheet-intro { margin: 0 0 20px; color: var(--ink-soft); font-size: 15px; }

@media (min-width: 640px) {
  .sheet {
    left: 50%; right: auto; bottom: auto; top: 50%; width: 540px;
    border-radius: var(--radius-lg);
    transform: translate(-50%, -46%) scale(.96); opacity: 0;
    transition: transform .34s cubic-bezier(.32,.72,0,1), opacity .24s ease, visibility 0s linear .34s;
    padding-top: 26px;
  }
  .sheet.open {
    transform: translate(-50%, -50%) scale(1); opacity: 1;
    transition: transform .34s cubic-bezier(.32,.72,0,1), opacity .24s ease, visibility 0s;
  }
  .sheet-handle { display: none; }
}

/* --------------------------- Formulaire --------------------------- */

.field { margin-bottom: 16px; border: 0; padding: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .grid-2 { grid-template-columns: 1fr; gap: 0; } }

.field label, .field legend {
  display: block; margin-bottom: 7px; padding: 0;
  font-size: 13.5px; font-weight: 700; color: var(--ink);
}

.field input[type="text"], .field input[type="email"], .field input[type="tel"] {
  width: 100%; padding: 14px 16px;
  border: 1.5px solid rgba(16,35,58,.12); border-radius: 14px;
  background: #fbfcfe; font: inherit; font-size: 16px; color: var(--ink);
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.field input:focus {
  outline: 0; background: #fff; border-color: var(--c1);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c1) 16%, transparent);
}
.field input.invalid { border-color: #e5484d; background: #fff5f5; }
.code-row { display: flex; gap: 8px; align-items: stretch; }
.code-row input { flex: 1; min-width: 0; letter-spacing: .2em; }
.cta-code { padding: 0 14px; border: 1.5px solid rgba(16,35,58,.12); border-radius: 14px; white-space: nowrap; font-size: 14px; }

.q-field { margin-bottom: 18px; }
.q-hint { font-weight: 500; font-size: 12.5px; color: var(--ink-soft); }
.chip-other input:checked + span { background: var(--c2); border-color: var(--c2); }
.other-input {
  width: 100%; margin-top: 10px; padding: 12px 15px;
  border: 1.5px solid var(--c2); border-radius: 14px;
  background: #fff; font: inherit; font-size: 16px; color: var(--ink);
}
.other-input:focus {
  outline: 0; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c2) 18%, transparent);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip span {
  display: inline-block; padding: 10px 15px; border-radius: 999px;
  border: 1.5px solid rgba(16,35,58,.12); background: #fbfcfe;
  font-size: 14.5px; font-weight: 600; color: var(--ink-soft);
  transition: all .18s ease;
}
.chip:hover span { border-color: rgba(16,35,58,.24); }
.chip input:checked + span {
  background: var(--c1); border-color: var(--c1); color: #fff;
  box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--c1) 80%, transparent);
}
.chip input:focus-visible + span { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c1) 20%, transparent); }
.q-field.invalid legend { color: #d1383c; }

.consent {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 20px; padding: 15px; border-radius: 16px;
  background: color-mix(in srgb, var(--c2) 8%, #fbfcfe);
  border: 1.5px solid color-mix(in srgb, var(--c2) 22%, transparent);
  font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); cursor: pointer;
  transition: border-color .18s ease;
}
.consent.invalid { border-color: #e5484d; background: #fff5f5; }
.consent input {
  flex: 0 0 auto; width: 20px; height: 20px; margin: 1px 0 0;
  accent-color: var(--c1); cursor: pointer;
}

.form-error {
  min-height: 0; margin: 14px 0 0; color: #d1383c;
  font-size: 13.5px; font-weight: 600;
}
.form-error:empty { margin: 0; }

/* Champ piège : sorti de l'écran sans display:none, que certains robots ignorent. */
.hp-field {
  position: absolute !important; left: -9999px !important; top: auto !important;
  width: 1px; height: 1px; overflow: hidden;
}

/* --------------------------- Résultat ---------------------------- */

.modal {
  position: fixed; inset: 0; z-index: 20;
  display: grid; place-items: center; padding: 20px;
  background: rgba(10, 26, 45, .58);
  opacity: 0; pointer-events: none; transition: opacity .35s ease;
}
.modal.open { opacity: 1; pointer-events: auto; backdrop-filter: blur(6px); }

.confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

.modal-card {
  position: relative; z-index: 2;
  width: min(100%, 430px); text-align: center;
  background: #fff; border-radius: var(--radius-lg);
  padding: 34px clamp(22px, 6vw, 34px) 24px;
  box-shadow: var(--shadow-lg);
  transform: scale(.9) translateY(14px); opacity: 0;
  transition: transform .42s cubic-bezier(.34,1.4,.64,1), opacity .3s ease;
  max-height: 92dvh; overflow-y: auto;
}
.modal.open .modal-card { transform: scale(1) translateY(0); opacity: 1; }

.result-emoji { font-size: 54px; line-height: 1; margin-bottom: 10px; animation: pop .55s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes pop { from { transform: scale(0) rotate(-25deg); } to { transform: scale(1) rotate(0); } }

.modal-card h2 { margin: 0 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -.025em; }
.result-prize { margin: 0 0 20px; font-size: 19px; font-weight: 700; color: var(--c1); }
.result-prize:empty { display: none; }
.result-text { margin: 0; color: var(--ink-soft); font-size: 15px; line-height: 1.55; }
.result-text:empty { display: none; }

.code-box {
  display: none; flex-direction: column; align-items: center; gap: 8px;
  padding: 20px 16px; border-radius: 20px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c3) 22%, #fff), color-mix(in srgb, var(--c2) 10%, #fff));
  border: 1.5px dashed color-mix(in srgb, var(--c1) 35%, transparent);
}
.code-box.show { display: flex; }
.code-label { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.code-value {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: clamp(21px, 5.6vw, 27px); font-weight: 700; letter-spacing: .06em; color: var(--ink);
}
.barcode { width: 190px; height: 34px; }
.code-help { font-size: 12.5px; color: var(--ink-soft); max-width: 26ch; line-height: 1.45; }

.demo-note {
  margin: 16px 0 0; font-size: 11.5px; color: var(--ink-soft); opacity: .7;
  font-style: italic;
}

/* ----------------------- États fermés / home ---------------------- */

.closed-wrap { position: relative; z-index: 2; display: grid; place-items: center; min-height: 70dvh; padding: 20px; }
.card {
  background: var(--surface); border: 1.5px solid var(--contour);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg); padding: 40px 32px;
  text-align: center; box-shadow: var(--shadow); max-width: 420px;
}
.closed-emoji { font-size: 46px; margin-bottom: 12px; }
.closed-card h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: -.02em; }
.closed-card p { margin: 0; color: var(--ink-soft); line-height: 1.55; }

.home {
  position: relative; z-index: 2; max-width: 760px; margin: 0 auto;
  padding: clamp(40px, 10vw, 90px) 24px 60px; text-align: center;
}
.home h1 { margin: 0 0 8px; font-size: clamp(30px, 6vw, 42px); letter-spacing: -.035em; font-weight: 800; }
.home .sub { margin: 0 0 36px; color: var(--ink-soft); font-size: 16px; }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.brand-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  min-height: 150px; padding: 26px; border-radius: var(--radius);
  background: #fff; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); border-top: 4px solid var(--bc1);
  transition: transform .22s cubic-bezier(.34,1.4,.64,1), box-shadow .22s ease;
}
.brand-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.brand-card img { height: 46px; max-width: 170px; object-fit: contain; }
.brand-card span { font-weight: 700; }
.brand-card-go { font-size: 13.5px; font-weight: 700; color: var(--bc2); }
.admin-link {
  display: inline-block; margin-top: 40px; color: var(--ink-soft);
  font-size: 14px; font-weight: 600; text-decoration: none;
}
.admin-link:hover { color: var(--ink); }

/* ---------------------------- Réglages --------------------------- */

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .12s !important; }
}

/* ==================================================================
   Carte à gratter

   Aucune animation au repos : la couche à gratter est un canvas dessiné
   une fois, redessiné uniquement au déplacement du pointeur ou lorsque la
   carte change de taille. La révélation joue une transition unique.
   ================================================================== */

.scratch-section {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  width: 100%; max-width: 460px; margin: 0 auto;
}

.scratch {
  position: relative;
  width: 100%;
  aspect-ratio: 8 / 5;
  border-radius: 20px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 30, 46, .16), 0 0 0 1px rgba(15, 30, 46, .06);
  touch-action: none; /* le grattage ne doit pas faire défiler la page */
}

.scratch-under {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 18px; text-align: center;
  color: #10233a;
  background: linear-gradient(140deg, color-mix(in srgb, var(--c2) 16%, #fff), #fff 62%);
}
.scratch.is-win .scratch-under {
  background: linear-gradient(140deg, color-mix(in srgb, var(--c3) 34%, #fff), #fff 66%);
}

.sc-ico { font-size: 46px; line-height: 1; }
.sc-label {
  font-size: 20px; font-weight: 800; color: inherit;
  line-height: 1.25; max-width: 92%;
}

.scratch-cover {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  cursor: crosshair;
  transition: opacity .32s ease;
}
.scratch:not(.is-active) .scratch-cover { cursor: default; }
.scratch.is-revealed .scratch-cover { opacity: 0; pointer-events: none; }

.scratch-hint {
  margin: 0; font-size: 14px; color: var(--muted); text-align: center; min-height: 20px;
}

.btn-reveal {
  border: 1.5px solid rgba(15, 30, 46, .16);
  background: rgba(255, 255, 255, .8);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 20px;
  font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.btn-reveal:hover { border-color: rgba(15, 30, 46, .3); }
/* `.cta` impose un display : sans cette règle, l'attribut hidden reste sans
   effet, la règle de la feuille du navigateur étant moins spécifique. */
.btn-reveal[hidden], .cta[hidden] { display: none; }

/* Téléphone obligatoire, email facultatif : la mention et l'aide de saisie. */
.field .hint { display: block; margin-top: 5px; font-size: 12.5px; opacity: .62; }
.field .opt { font-weight: 400; font-size: 12.5px; opacity: .6; }

@media (max-width: 420px) {
  .sc-ico { font-size: 38px; }
  .sc-label { font-size: 17px; }
}

/* ==================================================================
   Tirage au sort — la page ne porte ni roue ni carte : l'inscription
   est le seul geste, le résultat vient plus tard.
   ================================================================== */

.draw-section {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  width: 100%; max-width: 460px; margin: 0 auto;
}

.draw-card {
  width: 100%;
  border-radius: 20px;
  padding: 24px 22px;
  text-align: center;
  border: 1.5px solid color-mix(in srgb, #2f9e5e 40%, var(--contour));
  background: color-mix(in srgb, #2f9e5e 12%, var(--surface));
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.draw-card[hidden] { display: none; }
.draw-ico { font-size: 38px; line-height: 1; display: block; margin-bottom: 10px; }
.draw-card h2 { margin: 0 0 6px; font-size: 21px; font-weight: 800; color: var(--ink); }
.draw-card p { margin: 0; color: var(--ink-soft); font-size: 14.5px; line-height: 1.5; }
.sous-cta[hidden] { display: none; }

/* ---------------------- Preuve d'achat : ticket ---------------------- */

.ticket-step { margin: 0 0 22px; }

/* Ticket accepté : l'écran passe au formulaire, mais la confirmation reste
   visible. La faire disparaître laisserait le joueur sans trace de l'étape
   qu'il vient de franchir, et sans moyen de vérifier ce qui a été retenu. */
.ticket-step.is-done .ticket-need,
.ticket-step.is-done .ticket-actions,
.ticket-step.is-done .ticket-zone img,
.ticket-step.is-done .ticket-ico,
.ticket-step.is-done .form-error { display: none; }
.ticket-step.is-done .ticket-zone {
  min-height: 0; padding: 10px 14px; flex-direction: row; gap: 8px;
}
.ticket-step.is-done .ticket-zone::before { content: '✓'; font-weight: 800; color: #1f7a46; }

.ticket-need {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 14px; padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--c3) 22%, #fff);
  color: var(--ink); font-size: 14px; font-weight: 650;
}
.ticket-need span { font-size: 17px; }

.ticket-zone {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px;
  min-height: 150px; padding: 18px;
  border: 2px dashed color-mix(in srgb, var(--c1) 32%, #d7dde6);
  border-radius: 16px;
  background: #fbfcfe;
  text-align: center;
}
.ticket-zone img {
  max-width: 100%; max-height: 210px;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(16, 35, 58, .16);
}
.ticket-ico { font-size: 38px; line-height: 1; }
.ticket-state { font-size: 14px; color: var(--muted); line-height: 1.45; }

.ticket-zone.is-busy { border-style: solid; border-color: var(--c2); }
.ticket-zone.is-busy .ticket-state { color: var(--c2); font-weight: 650; }
.ticket-zone.is-good { border-style: solid; border-color: #2f9e5e; background: #f4fbf6; }
.ticket-zone.is-good .ticket-state { color: #1f7a46; font-weight: 700; }
.ticket-zone.is-bad { border-color: #e5484d; background: #fff5f5; }

.ticket-actions { display: flex; gap: 10px; margin-top: 12px; }

.btn-ticket {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 14px;
  border-radius: 12px; border: 0;
  background: var(--c1); color: #fff;
  font-size: 15px; font-weight: 700; text-align: center;
  cursor: pointer;
}
.btn-ticket-ghost {
  background: #fff; color: var(--ink);
  border: 1.5px solid #d7dde6;
}
/* Le champ natif est remplacé par le libellé : on le sort du flux sans
   display:none, qui le rendrait inatteignable au clavier. */
.btn-ticket input[type="file"] {
  position: absolute; width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}
.btn-ticket:focus-within { outline: 3px solid color-mix(in srgb, var(--c2) 60%, #fff); outline-offset: 2px; }


/* ------------------- Affiche de campagne (tirage) -------------------
   Création publicitaire libre : elle peut arriver claire ou sombre, à fond
   perdu ou détourée. Le cadre reste donc discret et à peine teinté, pour
   tomber juste dans les deux cas. */
.visuel {
  width: 100%; margin: 0 0 18px; padding: 14px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--contour); background: var(--surface);
  backdrop-filter: blur(10px); box-shadow: var(--shadow);
}
.visuel img {
  width: 100%; height: auto; display: block; border-radius: 16px;
}

/* Ligne d'appoint sous le bouton : date du tirage, mention courte. */
.sous-cta {
  margin: 12px 0 0; text-align: center;
  font-size: 13.5px; line-height: 1.45; color: var(--ink-soft);
}

/* ---------------------------- Étapes -------------------------------
   Libellés libres saisis par l'enseigne : « Achetez » n'a de sens que si la
   preuve d'achat est exigée, et le bloc entier se masque. */
.etapes {
  width: 100%; margin: clamp(20px, 5vw, 30px) 0 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
}
.etape {
  border-radius: 18px; padding: 15px 8px 13px; text-align: center;
  border: 1.5px solid var(--contour); background: var(--surface);
  backdrop-filter: blur(9px);
}
.etape b {
  display: grid; place-items: center; width: 32px; height: 32px; margin: 0 auto 9px;
  border-radius: 50%; background: var(--c3); color: #10233a;
  font-size: 15px; font-weight: 900;
}
.etape span { display: block; font-size: 13px; font-weight: 750; line-height: 1.3; }

/* Repli : sans création publicitaire, le cadre porte le LOGO. Un logo est
   large et court ; occuper la même surface qu'une affiche le ferait paraître
   étiré et vide. On réduit le bloc plutôt que d'agrandir l'image. */
.visuel-repli { padding: 22px 26px; }
.visuel-repli img {
  max-height: 92px; width: auto; max-width: 100%; margin: 0 auto;
  border-radius: 0;
}

/* Turnstile : le widget n'apparaît que si Cloudflare a un doute. La marge
   n'est posée que lorsqu'il a réellement quelque chose à afficher, sinon un
   formulaire propre garderait un blanc inexpliqué. */
.turnstile { margin: 16px 0 0; display: flex; justify-content: center; }
.turnstile:empty { margin: 0; }

/* ------------------- Panneaux toujours clairs --------------------
   La feuille du formulaire, la modale de résultat et le dessous de la carte
   à gratter sont blancs dans les deux thèmes. En fond sombre, l'encre du
   thème est blanche : sans cette remise à plat, tout le formulaire
   disparaissait — libellés, questions, réponses, en blanc sur blanc.

   La palette est REDÉFINIE localement plutôt que corrigée propriété par
   propriété : chaque nouveau composant posé dans la feuille hérite alors des
   bonnes valeurs sans qu'on ait à y penser. */
.sheet,
.modal-card,
.scratch-under {
  --ink: #10233a;
  --ink-soft: #55708c;
  --surface: rgba(255,255,255,.72);
  --surface-fort: #ffffff;
  --contour: rgba(16,35,58,.10);
  color: var(--ink);
}

/* Lien du règlement : souligné, pour qu'on voie que c'en est un. */
.lien-reglement { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.lien-reglement:hover { text-decoration-thickness: 2px; }
