/* =====================================================================
   Jeu (mobile-first 360 → 430 px, desktop centré). Ambiance BK x Noël maison.
   ===================================================================== */
.game {
  color: var(--c-cream);
  background:
    radial-gradient(120% 60% at 50% 0%, #E8443F 0%, transparent 60%),
    linear-gradient(180deg, var(--c-red) 0%, #B91C21 55%, var(--c-red-dark) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}
/* Flocons maison (CSS) */
.snow {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .55;
  background-image:
    radial-gradient(3px 3px at 20px 30px, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 80px 120px, #fff 50%, transparent 51%),
    radial-gradient(3px 3px at 150px 60px, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 220px 160px, #fff 50%, transparent 51%),
    radial-gradient(4px 4px at 300px 90px, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 360px 200px, #fff 50%, transparent 51%);
  background-size: 380px 240px;
  animation: snow 14s linear infinite;
}
@keyframes snow { from { background-position: 0 0; } to { background-position: 60px 240px; } }

.topbar {
  position: relative; z-index: 2; display: flex; align-items: center; gap: 10px;
  padding: 10px max(14px, calc((100vw - 460px) / 2));
}
.topbar-title { margin-right: auto; font-family: var(--font-title); font-size: 1.05rem; color: var(--c-cream); letter-spacing: .02em; }
.icon-btn {
  display: grid; place-items: center; width: 48px; height: 48px; border: 2px solid rgba(255, 243, 223, .6); border-radius: 50%;
  background: rgba(0, 0, 0, .12); color: var(--c-cream); cursor: pointer;
}
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn[aria-pressed="true"] .icon-off, .icon-btn[aria-pressed="false"] .icon-on { display: none; }

.stage { position: relative; z-index: 1; max-width: 460px; margin: 0 auto; padding: 4px 16px 40px; }

/* ---------- Accueil ---------- */
.hero { text-align: center; padding: 6px 0 4px; }
.kicker { margin: 0 0 8px; font-size: .78rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #FFE3B8; }
.title {
  margin: 0; font-family: var(--font-title); font-weight: 400; font-size: clamp(1.9rem, 8.6vw, 2.6rem); line-height: 1.02;
  color: var(--c-cream); text-shadow: 0 3px 0 var(--c-red-dark), 0 6px 14px rgba(0, 0, 0, .25);
}
.title:focus { outline: none; }
.subtitle { margin: 12px auto 14px; max-width: 30em; font-size: 1.02rem; font-weight: 700; color: #FFF8EE; }
.hero-visual { width: 100%; height: 120px; object-fit: cover; border-radius: var(--radius); margin: 0 0 14px; box-shadow: 0 8px 20px rgba(0, 0, 0, .2); }
.hero-cta { width: 100%; }

/* ---------- Roue ---------- */
.wheel-zone { display: flex; flex-direction: column; align-items: center; margin: 22px 0 6px; scroll-margin-top: 20px; }
.wheel-wrap { position: relative; width: min(88vw, 380px); aspect-ratio: 1; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .32)); }
.wheel { position: relative; width: 100%; height: 100%; }
.wheel > .wheel-base, .wheel > .wheel-rotor, .wheel > .wheel-cap { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.wheel-rotor { transform-origin: 50% 50%; will-change: transform; backface-visibility: hidden; }
.wheel-cap { pointer-events: none; }
.wheel-pointer { position: absolute; top: -5%; left: 50%; width: 13%; transform: translateX(-50%); transform-origin: 50% 30%; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .35)); }
.wheel-label { font-family: var(--font-title); font-weight: 400; letter-spacing: .02em; transition: opacity .4s ease; }
.wheel-emoji { font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; transition: opacity .4s ease; }
.wheel-pin { fill: #F4B23E; stroke: var(--c-brown); stroke-width: 2; }
.wheel-segment { stroke: var(--c-cream); stroke-width: 2; transition: opacity .4s ease; }
.wheel.is-won .wheel-segment:not(.is-winner), .wheel.is-won .wheel-label:not(.is-winner), .wheel.is-won .wheel-emoji:not(.is-winner),
.wheel.is-lost .wheel-segment:not(.is-winner), .wheel.is-lost .wheel-label:not(.is-winner) { opacity: .35; }
.wheel-hub-text { fill: var(--c-cream); font-family: var(--font-title); font-size: 24px; letter-spacing: .02em; }
.bulb { animation: bulb 1.6s linear infinite; }
.wheel.is-spinning .bulb { animation-duration: .45s; }
.wheel.is-won .bulb { animation: bulb-flash .36s steps(2, jump-none) infinite; animation-delay: 0s !important; }
@keyframes bulb { 0%, 35%, 100% { opacity: .45; } 8% { opacity: 1; } }
@keyframes bulb-flash { from { opacity: 1; } to { opacity: .3; } }
.spin-status { min-height: 1.5em; margin: 10px 0 0; font-weight: 900; color: var(--c-cream); text-align: center; }

/* ---------- Lots ---------- */
.lots { margin: 10px 0 18px; text-align: center; }
.lots-title { margin: 0 0 10px; font-family: var(--font-title); font-weight: 400; font-size: 1.35rem; color: var(--c-cream); }
.lot-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  font-size: .86rem; font-weight: 800; color: var(--c-brown); background: var(--c-cream); box-shadow: 0 2px 0 rgba(0, 0, 0, .15);
}
.chip-jackpot { background: var(--c-gold); }
.jackpot { display: flex; align-items: center; gap: 12px; margin: 14px 0 0; padding: 10px; border-radius: var(--radius); background: rgba(0, 0, 0, .16); text-align: left; }
.jackpot img { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; flex: none; }
.jackpot figcaption { font-weight: 800; color: var(--c-cream); }

/* ---------- Formulaire ---------- */
.play-card, .state-card, .result-card {
  position: relative; padding: 22px 18px; border-radius: var(--radius); color: var(--c-text-dark); background: var(--c-cream);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .25);
}
.play-card::before, .result-card::before, .state-card::before {
  content: ''; position: absolute; left: 14px; right: 14px; top: -8px; height: 16px; border-radius: 999px;
  background: repeating-linear-gradient(90deg, var(--c-green) 0 18px, var(--c-gold) 18px 24px, var(--c-red) 24px 42px, var(--c-gold) 42px 48px);
}
.loading { padding: 20px 0; text-align: center; font-weight: 800; }
.form-title { margin: 0 0 4px; font-family: var(--font-title); font-weight: 400; font-size: 1.6rem; color: var(--c-red); }
.form-intro { margin: 0 0 14px; font-size: .9rem; color: var(--c-muted-dark); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field { margin-bottom: 10px; }
.field > label { display: block; margin-bottom: 4px; font-size: .88rem; font-weight: 900; color: var(--c-brown); }
.field input:not([type="checkbox"]) {
  width: 100%; min-height: 50px; padding: 10px 14px; border: 2px solid #E2CFB6; border-radius: 12px;
  font-size: 16px; font-weight: 700; color: var(--c-text-dark); background: var(--c-white);
}
.field input:focus { outline: none; border-color: var(--c-brown); box-shadow: 0 0 0 3px rgba(244, 178, 62, .5); }
.field input[aria-invalid="true"] { border-color: var(--c-error); }
.field-error { min-height: 0; margin: 4px 0 0; font-size: .82rem; font-weight: 800; color: var(--c-error); }
.field-error:empty { display: none; }
.consents { margin: 14px 0 10px; display: grid; gap: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; font-weight: 700; line-height: 1.35; cursor: pointer; }
.check input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--c-red); }
.check small { display: block; font-weight: 600; color: var(--c-muted-dark); }
.check a { font-weight: 900; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.alert { margin: 8px 0; padding: 10px 12px; border-radius: 10px; font-weight: 800; color: var(--c-white); background: var(--c-error); }
.form-legal { margin: 12px 0 0; font-size: .74rem; font-weight: 600; line-height: 1.4; color: var(--c-muted-dark); }
#submit-btn { margin-top: 6px; }

/* ---------- États ---------- */
.state-card { text-align: center; }
.state-icon { margin: 0; font-size: 3rem; line-height: 1; }
.state-title { margin: 8px 0 6px; font-family: var(--font-title); font-weight: 400; font-size: 1.6rem; line-height: 1.1; color: var(--c-red); }
.state-title:focus { outline: none; }
.state-text { margin: 0 0 12px; font-weight: 700; }

/* ---------- Résultat ---------- */
.result { text-align: center; }
.result-emoji { margin: 0; font-size: 3.4rem; line-height: 1; animation: pop .6s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { from { transform: scale(.2); opacity: 0; } }
.result-title { margin: 8px 0; font-family: var(--font-title); font-weight: 400; font-size: clamp(1.6rem, 7.4vw, 2.1rem); line-height: 1.08; color: var(--c-red); }
.result-title:focus { outline: none; }
.result-text { margin: 0 0 8px; font-weight: 700; }
.result-mail { margin: 0 0 12px; font-size: .9rem; font-weight: 800; color: var(--c-green); }
.ticket-box { padding: 14px; border: 3px dashed var(--c-red); border-radius: 16px; background: var(--c-white); }
.code-label { margin: 0; font-size: .74rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted-dark); }
.code { margin: 2px 0 8px; font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 1.6rem; font-weight: 900; letter-spacing: .06em; color: var(--c-brown); }
.qr-box { display: grid; place-items: center; margin: 0 auto 8px; }
.expiry { margin: 0; font-weight: 900; color: var(--c-red); }
.conditions, .result-how { margin: 4px 0 0; font-size: .84rem; font-weight: 700; color: var(--c-muted-dark); }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.result-actions .btn { padding: .6em .6em; font-size: .9rem; }
.result-actions .btn-ghost { color: var(--c-brown); }
.result-restos { margin: 12px 0 0; padding: 0; list-style: none; font-size: .86rem; font-weight: 800; color: var(--c-brown); }
.result-restos li { margin: 4px 0; }
.replay { display: block; margin: 16px auto 0; color: var(--c-cream); }

/* ---------- Visibilité selon l'état ---------- */
body[data-state="result"] .hero, body[data-state="result"] .lots, body[data-state="result"] .play-card,
body[data-state="state"] .play-card, body[data-state="state"] .hero-cta { display: none; }
body[data-state="result"] .wheel-zone { margin-top: 4px; }
body[data-state="result"] .wheel-wrap { width: min(56vw, 230px); }
body[data-state="spinning"] .play-card, body[data-state="spinning"] .lots, body[data-state="spinning"] .hero-cta,
body[data-state="spinning"] .hero-visual { display: none; }

@media (min-width: 900px) {
  .stage { max-width: 520px; }
}
@media (prefers-reduced-motion: reduce) {
  .snow { animation: none; }
  .bulb { animation: none !important; opacity: .85; }
  .result-emoji { animation: none; }
  .btn { transition: none; }
}
