/* ==========================================================
   Roue de Noël — Galzin
   DA reprise de MOTION (galzin-fidelite) + couche Noël
   ========================================================== */
@font-face { font-family: "Bebas Neue"; src: url(assets/fonts/bebas-neue-latin-400-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Crimson Pro"; font-weight: 700; src: url(assets/fonts/crimson-pro-latin-700-normal.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Crimson Pro"; font-weight: 600; font-style: italic; src: url(assets/fonts/crimson-pro-latin-600-italic.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Dancing Script"; font-weight: 700; src: url(assets/fonts/dancing-script-latin-700-normal.woff2) format("woff2"); font-display: swap; }

:root {
  --brown: #572d14;
  --brown-2: #3c1f0e;
  --brown-3: #6a3a1c;
  --cream: #fdf0e2;
  --coral: #ee7a63;
  --orange: #f08a1c;
  --red: #e2132b;
  --ink: #2a1d14;
  --gold: #c99a4a;
  --gold-2: #e3a35a;
  --yellow: #ffcc4d;
  --green: #1f6b3a;
  --green-2: #124a27;
  /* Noël */
  --noel: #c8162f;
  --noel-2: #8e0d1c;
  --noel-3: #5a0812;
  --noel-4: #3d050c;
  --radius: 22px;
  --ease-pop: cubic-bezier(.2, 1.4, .4, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--cream);
  background: radial-gradient(ellipse at 50% 45%, var(--noel) 0%, var(--noel-2) 50%, var(--noel-3) 85%, var(--noel-4) 100%);
  background-color: var(--noel-3);
  font-family: "Crimson Pro", Georgia, serif;
  font-weight: 700;
}

/* ---------- Décor ---------- */
.rays {
  position: fixed; left: 50%; top: 50%;
  width: 220vmax; height: 220vmax;
  margin: -110vmax 0 0 -110vmax;
  background: repeating-conic-gradient(from 0deg, rgba(255, 204, 77, .10) 0deg 7deg, transparent 7deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 0%, transparent 55%);
          mask: radial-gradient(circle, #000 0%, transparent 55%);
  animation: spinRays 60s linear infinite;
  pointer-events: none; z-index: 0;
}
@keyframes spinRays { to { transform: rotate(360deg); } }

.pines {
  position: fixed; left: 0; right: 0; bottom: 0; height: 120px; z-index: 1; pointer-events: none; opacity: .9;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cpath d='M60 18 82 52H71l20 30H76l22 32H22l22-32H29l20-30H38z' fill='%23124a27'/%3E%3Crect x='54' y='112' width='12' height='8' fill='%233c1f0e'/%3E%3C/svg%3E") 0 100% / 90px 90px repeat-x,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cpath d='M60 18 82 52H71l20 30H76l22 32H22l22-32H29l20-30H38z' fill='%231f6b3a'/%3E%3C/svg%3E") 45px 100% / 70px 70px repeat-x;
  -webkit-mask: linear-gradient(transparent, #000 40%); mask: linear-gradient(transparent, #000 40%);
}
#snow, #confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#snow { z-index: 1; }
#confetti { z-index: 50; }

.garland {
  position: fixed; top: 0; left: 0; right: 0; height: 34px; z-index: 5; pointer-events: none;
  background:
    radial-gradient(circle at 50% 70%, var(--yellow) 0 5px, transparent 6px) 0 0 / 44px 34px repeat-x,
    radial-gradient(circle at 50% 70%, var(--red) 0 5px, transparent 6px) 22px 6px / 44px 34px repeat-x;
  filter: drop-shadow(0 0 6px rgba(255, 204, 77, .8));
  animation: blink 1.2s steps(2) infinite;
}
.garland::before {
  content: ""; position: absolute; left: 0; right: 0; top: 10px; height: 14px;
  border-bottom: 2px solid rgba(31, 107, 58, .9);
  border-radius: 0 0 50% 50% / 0 0 100% 100%;
}
@keyframes blink { 50% { filter: drop-shadow(0 0 2px rgba(226, 19, 43, .7)) brightness(.75); } }

.sound {
  position: fixed; top: 40px; right: 12px; z-index: 20;
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid rgba(255, 204, 77, .6); background: rgba(61, 5, 12, .6);
  font-size: 18px; cursor: pointer;
}
.demo {
  position: fixed; pointer-events: none; bottom: 0; left: 0; right: 0; z-index: 30;
  background: var(--yellow); color: var(--ink); text-align: center;
  font: 16px/1.8 "Bebas Neue", sans-serif; letter-spacing: .08em;
}

/* ---------- Écrans ---------- */
main { position: relative; z-index: 2; }
body.is-demo .screen { padding-bottom: 72px; }
.screen {
  display: none;
  min-height: 100dvh;
  max-width: 480px; margin: 0 auto;
  padding: 56px 16px 40px;
  flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 14px;
}
.screen.is-active { display: flex; }
.screen.is-active > * { animation: rise .7s var(--ease-pop) both; }
.screen.is-active > *:nth-child(2) { animation-delay: .06s; }
.screen.is-active > *:nth-child(3) { animation-delay: .12s; }
.screen.is-active > *:nth-child(4) { animation-delay: .18s; }
.screen.is-active > *:nth-child(5) { animation-delay: .24s; }
.screen.is-active > *:nth-child(6) { animation-delay: .30s; }
.screen.is-active > *:nth-child(7) { animation-delay: .36s; }
@keyframes rise { from { opacity: 0; transform: translateY(26px) scale(.96); } }

.logo { display: block; border-radius: 50%; box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 0 4px rgba(255, 204, 77, .25); }
.logo-xl { width: 104px; height: 104px; animation: rise .7s var(--ease-pop) both, bob 3.2s ease-in-out 1s infinite !important; }
.logo-sm { width: 72px; height: 72px; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-4deg); } }

.kicker {
  margin: 0;
  font-family: "Dancing Script", cursive; font-size: 26px; color: var(--yellow);
}
.title { margin: 0; font-family: "Bebas Neue", sans-serif; font-weight: 400; line-height: .85; letter-spacing: .02em; }
.t-line { display: block; font-size: clamp(54px, 17vw, 84px); }
.t-big {
  font-size: clamp(76px, 25vw, 124px);
  background: linear-gradient(100deg, var(--gold) 0%, var(--yellow) 40%, #fff6d8 50%, var(--yellow) 60%, var(--gold) 100%);
  background-size: 250% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shine 3s linear infinite;
  filter: drop-shadow(0 4px 0 var(--noel-4));
  padding-top: .14em; margin-top: -.1em;
}
@keyframes shine { to { background-position: -250% 0; } }

.h2 { margin: 0; font: 400 clamp(40px, 12vw, 56px)/.95 "Bebas Neue", sans-serif; letter-spacing: .03em; }
.lead { margin: 0; font-size: 22px; line-height: 1.2; }
.lead em, .scan em { color: var(--yellow); font-style: italic; font-weight: 600; }
.lead.small { font-size: 19px; }
.fine { margin: 0; font-size: 15px; opacity: .8; font-style: italic; font-weight: 600; }

.gift-row { display: flex; gap: 10px; font-size: 26px; }
.gift-row span { animation: hop 1.6s ease-in-out infinite; }
.gift-row span:nth-child(2) { animation-delay: .15s; }
.gift-row span:nth-child(3) { animation-delay: .3s; }
.gift-row span:nth-child(4) { animation-delay: .45s; }
.gift-row span:nth-child(5) { animation-delay: .6s; }
@keyframes hop { 30% { transform: translateY(-10px) rotate(8deg); } 60% { transform: translateY(0); } }

/* ---------- Boutons ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer;
  font: 400 26px/1 "Bebas Neue", sans-serif; letter-spacing: .06em;
  padding: 18px 34px; border-radius: 999px;
}
.btn-main {
  position: relative; overflow: hidden;
  color: var(--ink);
  background: linear-gradient(100deg, #a8662d 0%, var(--gold-2) 50%, var(--yellow) 100%);
  box-shadow: 0 6px 0 var(--noel-4), 0 0 0 3px var(--green), 0 0 0 6px var(--cream), 0 12px 30px rgba(0, 0, 0, .4);
  transition: transform .15s, box-shadow .15s;
  animation: rise .7s var(--ease-pop) both, pulse 2s ease-in-out 1.2s infinite !important;
}
.btn-main::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .7), transparent);
  transform: skewX(-20deg); animation: sweep 2.6s ease-in-out infinite;
}
.btn-main:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--noel-4), 0 0 0 3px var(--green), 0 0 0 6px var(--cream); }
.btn-main:disabled { filter: grayscale(.6) brightness(.8); animation: none !important; cursor: default; }
@keyframes pulse { 50% { transform: scale(1.05); } }
@keyframes sweep { 60%, 100% { left: 130%; } }
.btn-ghost {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none; color: var(--cream);
  padding: 12px 22px; border-radius: 18px;
  border: 2px dashed rgba(255, 204, 77, .7); background: rgba(61, 5, 12, .35);
  transition: transform .2s, background .2s;
}
.btn-ghost small { font: 600 italic 16px "Crimson Pro", serif; opacity: .85; }
.btn-ghost strong { font: 400 22px/1 "Bebas Neue", sans-serif; letter-spacing: .06em; color: var(--yellow); }
.btn-ghost:hover, .btn-ghost:focus-visible { background: rgba(61, 5, 12, .6); transform: scale(1.03); }
.btn-ghost:active { transform: scale(.97); }
.hint { margin: 2px 0 0; font: 600 italic 14px "Crimson Pro", serif; color: #7a5232; }
.hint a { color: var(--noel); font-weight: 700; }
.link { background: none; border: 0; color: var(--cream); opacity: .75; font: 600 italic 17px "Crimson Pro", serif; cursor: pointer; }

/* ---------- Formulaire ---------- */
.card {
  width: 100%;
  background: var(--cream); color: var(--ink);
  border-radius: var(--radius); padding: 22px 18px;
  box-shadow: 0 0 0 3px var(--gold), 0 0 0 7px var(--green), 0 18px 40px rgba(0, 0, 0, .45);
  display: flex; flex-direction: column; gap: 14px; text-align: left;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font: 400 18px "Bebas Neue", sans-serif; letter-spacing: .06em; color: var(--brown); }
.field input {
  font: 700 19px "Crimson Pro", serif; color: var(--ink);
  padding: 13px 14px; border-radius: 14px;
  border: 2px solid #e7cfae; background: #fff; outline: none;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(201, 154, 74, .25); transform: scale(1.01); }
.field input.bad { border-color: var(--red); animation: shake .4s; }
.check { display: flex; gap: 10px; align-items: flex-start; font: 600 italic 15px/1.3 "Crimson Pro", serif; color: #7a5232; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--noel); flex: none; }
.check a { color: var(--red); }
.check.bad { animation: shake .4s; }
.card .btn-main { margin-top: 6px; align-self: center; }
.error { margin: 0; color: #fff; background: var(--noel-2); box-shadow: 0 0 0 2px var(--yellow); border-radius: 12px; padding: 10px 12px; font-size: 16px; text-align: center; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------- Roue ---------- */
.wheel-wrap { position: relative; width: min(92vw, 420px); aspect-ratio: 1; margin: 10px 0; }
.wheel-wrap::before {
  content: ""; position: absolute; inset: -14px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 204, 77, .35), transparent 70%);
  animation: glow 2s ease-in-out infinite;
}
@keyframes glow { 50% { transform: scale(1.06); opacity: .6; } }
#wheel { position: relative; width: 100%; height: 100%; display: block; filter: drop-shadow(0 16px 30px rgba(0, 0, 0, .55)); }
.pointer {
  position: absolute; top: -18px; left: 50%; z-index: 3;
  width: 46px; height: 58px; margin-left: -23px;
  transform-origin: 50% 20%;
  background: linear-gradient(180deg, var(--yellow), var(--gold));
  clip-path: polygon(50% 100%, 0 28%, 18% 0, 82% 0, 100% 28%);
  filter: drop-shadow(0 4px 0 var(--noel-4));
}
.pointer::after { content: ""; position: absolute; left: 50%; top: 12px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--noel); }
.pointer.tick { animation: tick .12s ease-out; }
@keyframes tick { 40% { transform: rotate(-22deg); } }
.hub {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  width: 27%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; border: 5px solid var(--yellow); padding: 0;
  background: var(--brown-2); cursor: pointer; overflow: hidden;
  box-shadow: 0 0 0 4px var(--brown-2), 0 6px 18px rgba(0, 0, 0, .5);
  transition: transform .2s;
}
.hub img { width: 100%; height: 100%; display: block; }
.hub span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 400 34px "Bebas Neue", sans-serif; color: var(--ink);
  background: rgba(255, 204, 77, .92); opacity: 0; transition: opacity .3s;
}
.hub:hover span, .hub:focus-visible span { opacity: 1; }
.hub:active { transform: translate(-50%, -50%) scale(.93); }

/* ---------- Ticket gagnant ---------- */
.win-title { animation: rise .7s var(--ease-pop) both, wiggle 2.4s ease-in-out 1s infinite !important; }
@keyframes wiggle { 10% { transform: rotate(-3deg) scale(1.04); } 20% { transform: rotate(3deg) scale(1.04); } 30% { transform: none; } }
.ticket {
  position: relative; width: 100%;
  background: var(--cream); color: var(--ink);
  border-radius: var(--radius); padding: 22px 18px 18px;
  box-shadow: 0 0 0 3px var(--gold), 0 0 0 7px var(--green), 0 22px 50px rgba(0, 0, 0, .5);
}
.ticket-prize { display: flex; flex-direction: column; align-items: center; }
.prize-big {
  font: 400 clamp(72px, 24vw, 108px)/.9 "Bebas Neue", sans-serif; color: var(--noel);
  text-shadow: 0 4px 0 var(--noel-4);
  animation: popIn .9s var(--ease-pop) .3s both;
}
.prize-sub { font: 400 34px/1 "Bebas Neue", sans-serif; color: var(--brown); letter-spacing: .03em; }
@keyframes popIn { from { transform: scale(0) rotate(-20deg); } }
.prize-desc { margin: 8px 0 0; font: 600 italic 19px "Crimson Pro", serif; color: #7a5232; }
.ticket-cut { margin: 16px -18px; border-top: 3px dashed #e1c49b; position: relative; }
.ticket-cut::before, .ticket-cut::after {
  content: ""; position: absolute; top: -14px; width: 26px; height: 26px; border-radius: 50%; background: var(--noel-2);
}
.ticket-cut::before { left: -13px; } .ticket-cut::after { right: -13px; }
.scan { margin: 0 0 10px; font-size: 20px; }
.scan em { color: var(--noel); }
.qr { width: min(56vw, 210px); aspect-ratio: 1; display: block; margin: 0 auto; background: #fff; border-radius: 12px; padding: 6px; box-shadow: 0 0 0 2px #e7cfae; }
.code { margin: 10px 0 4px; font: 400 30px "Bebas Neue", sans-serif; letter-spacing: .12em; color: var(--brown); }
.live { display: inline-flex; align-items: center; gap: 8px; font: 400 20px "Bebas Neue", sans-serif; letter-spacing: .06em; color: var(--green); background: #e9f5ec; padding: 4px 14px; border-radius: 999px; }
.live-dot { width: 10px; height: 10px; border-radius: 50%; background: #23a455; animation: livePulse 1s ease-in-out infinite; }
@keyframes livePulse { 50% { box-shadow: 0 0 0 6px rgba(35, 164, 85, .25); transform: scale(.8); } }
.live-sep { opacity: .5; }
.validite { margin: 10px 0 0; font: 600 italic 14px "Crimson Pro", serif; color: #7a5232; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; }
}

/* Accueil compact : tout doit tenir sans scroller sur un téléphone */
#s-home { gap: 10px; padding-top: 48px; }
#s-home .t-line { font-size: clamp(48px, 15vw, 80px); }
#s-home .t-big { font-size: clamp(68px, 22vw, 116px); }
#s-home .lead { font-size: 20px; }

/* Légal */
.rgpd { margin: 0; font: 600 italic 12.5px/1.35 "Crimson Pro", serif; color: #8a6a4d; }
.rgpd a { color: var(--noel); }
.small-print { font-size: 13px; }
.small-print a, .legal-links a { color: var(--yellow); }
.legal-links {
  position: relative; z-index: 3; text-align: center;
  padding: 0 16px 18px; margin-top: -30px;
  font: 600 italic 13px "Crimson Pro", serif; color: var(--cream);
}
.legal-links span { opacity: .6; margin: 0 4px; }
body.is-demo .legal-links { padding-bottom: 46px; }

.qr svg { display: block; width: 100%; height: 100%; }
.barcode { display: block; width: 100%; max-width: 360px; height: 110px; margin: 10px auto 0; background: #fff; border-radius: 8px; }
.code { font-size: 24px; word-break: break-all; }

/* Révélation de la remise */
.reveal[hidden] { display: none !important; }
.reveal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px;
  background: rgba(61, 5, 12, .72); backdrop-filter: blur(3px); }
.reveal-card { width: min(92vw, 360px); background: var(--cream); color: var(--ink); border-radius: 24px; padding: 22px 18px 24px; text-align: center;
  box-shadow: 0 0 0 3px var(--gold), 0 0 0 7px var(--green), 0 24px 60px rgba(0,0,0,.5); transform: scale(.6); opacity: 0;
  transition: transform .45s var(--ease-pop), opacity .3s; }
.reveal.open .reveal-card { transform: none; opacity: 1; }
.reveal-kicker { margin: 0; font: 600 italic 17px "Crimson Pro", serif; color: #7a5232; }
.reveal-prod { margin: 2px 0 12px; font: 400 40px/1 "Bebas Neue", sans-serif; color: var(--brown); }
.reveal-window { height: 110px; overflow: hidden; margin-top: 6px; border-radius: 16px; background: #fff;
  box-shadow: inset 0 0 0 3px #ecd6b6, inset 0 12px 14px -10px rgba(0,0,0,.25), inset 0 -12px 14px -10px rgba(0,0,0,.25); }
.reveal-reel span { display: block; height: 110px; font: 400 96px/110px "Bebas Neue", sans-serif; color: var(--noel); text-shadow: 0 4px 0 var(--noel-4); }
.reveal.done .reveal-window { animation: revealFlash .6s ease-out 2; box-shadow: inset 0 0 0 4px var(--yellow); }
@keyframes revealFlash { 50% { background: #fff4c7; transform: scale(1.06); } }

/* Accès admin discret (bas à droite) */
.admin-link {
  position: fixed; right: 10px; bottom: 10px; z-index: 25;
  width: 26px; height: 26px; display: grid; place-items: center;
  font-size: 15px; line-height: 1; text-decoration: none; color: var(--cream);
  opacity: .18; border-radius: 50%; transition: opacity .2s;
}
.admin-link:hover, .admin-link:focus-visible { opacity: .8; }
body.is-demo .admin-link { bottom: 44px; }

/* Consigne : coupon à scanner en premier */
.tip { margin: 0; font: 600 italic 15px "Crimson Pro", serif; color: var(--cream);
  background: rgba(61, 5, 12, .45); border: 1px solid rgba(255, 204, 77, .5); padding: 6px 12px; border-radius: 12px; }
.tip b { color: var(--yellow); }
.reveal-tip { margin: 12px 0 0; font: 600 italic 15px "Crimson Pro", serif; color: var(--noel); }
.alerte { margin: 0 0 14px; padding: 12px 14px; border-radius: 14px; text-align: left;
  background: #fff4c7; border: 3px solid var(--noel); box-shadow: 0 0 0 3px #fff4c7;
  font: 600 16px/1.35 "Crimson Pro", serif; color: var(--ink); animation: alertePulse 2.2s ease-in-out infinite; }
.alerte p { margin: 4px 0; }
.alerte b, .alerte u { color: var(--noel); }
.alerte-titre { text-align: center; font: 400 24px/1 "Bebas Neue", sans-serif !important; letter-spacing: .05em; color: var(--noel) !important; margin-bottom: 6px !important; }
@keyframes alertePulse { 50% { box-shadow: 0 0 0 6px rgba(200, 22, 47, .18); } }
.qr[hidden] { display: none !important; }
