/* =====================================================================
   ROUE DE LA FORTUNE — feuille de style (mobile-first)
   Les couleurs sont des variables : elles sont remplacées par celles
   du bar au chargement (Common.applyTheme).
   ===================================================================== */

:root {
  --primaire: #0D3D3A;
  --secondaire: #1A8574;
  --accent: #E88A86;
  --doux: #FADFD8;
  --fond: #F5EFE3;
  --blanc: #FFFFFF;
  --texte-doux: color-mix(in srgb, var(--primaire) 72%, transparent);
  --radius: 22px;
  --shadow: 0 10px 30px -12px color-mix(in srgb, var(--primaire) 45%, transparent);
  --font-titre: "Anton", Impact, "Arial Narrow", sans-serif;
  --font-texte: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-texte);
  font-size: 16px;
  line-height: 1.5;
  color: var(--primaire);
  background-color: var(--fond);
  /* Petits confettis décoratifs en fond */
  background-image:
    radial-gradient(circle at 12% 18%, var(--accent) 0 3px, transparent 4px),
    radial-gradient(circle at 85% 12%, var(--secondaire) 0 3px, transparent 4px),
    radial-gradient(circle at 92% 46%, var(--accent) 0 2px, transparent 3px),
    radial-gradient(circle at 6% 58%, var(--secondaire) 0 2px, transparent 3px),
    radial-gradient(circle at 78% 82%, var(--accent) 0 3px, transparent 4px);
  background-size: 100% 900px;
  background-repeat: repeat-y;
}

a { color: inherit; text-underline-offset: 3px; }

/* ---------- Mise en page ---------- */
.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 16px 24px;
}

.hero { text-align: center; padding: 22px 0 4px; }

.kicker {
  margin: 0;
  font-family: var(--font-titre);
  text-transform: uppercase;
  letter-spacing: .14em;
  font-size: 14px;
  color: var(--secondaire);
}

.title {
  margin: 2px 0 10px;
  font-family: var(--font-titre);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(44px, 14vw, 68px);
  line-height: .95;
  letter-spacing: .01em;
}
.title-accent { color: var(--accent); }

.subtitle { margin: 0; font-size: 16px; color: var(--texte-doux); }

/* ---------- Roue ---------- */
.wheel {
  position: relative;
  width: min(92vw, 380px);
  aspect-ratio: 1;
  margin: 18px auto 22px;
  isolation: isolate;
}
/* Ombre portée fixe sous la roue (pas de filter sur la roue : il forcerait à tout redessiner pendant la rotation) */
.wheel::before {
  content: "";
  position: absolute;
  inset: 2.5%;
  border-radius: 50%;
  box-shadow: 0 18px 30px color-mix(in srgb, var(--primaire) 38%, transparent);
  z-index: -1;
}
.wheel-svg { width: 100%; height: 100%; display: block; }

/* Calque des cases : seul élément qui tourne, sur son propre calque graphique */
.rotor {
  position: absolute;
  inset: 0;
  transform-origin: 50% 50%;
  will-change: transform;
  backface-visibility: hidden;
}

.seg-label {
  font-family: var(--font-titre);
  font-size: 30px;
  letter-spacing: .07em;
}
.seg-emoji { font-size: 34px; }

/* Bouton "Revenir au site" sous le résultat */
.btn-back { margin-top: 14px; }

/* Ampoules de la jante : clignotent en alternance, plus vite pendant la rotation */
.bulb { fill: #fff; }
.bulb-a { animation: blink 1.4s steps(1) infinite; }
.bulb-b { animation: blink 1.4s steps(1) infinite .7s; }
.is-spinning .bulb-a, .is-spinning .bulb-b { animation-duration: .35s; }
.is-spinning .bulb-b { animation-delay: .175s; }
@keyframes blink { 50% { fill: var(--accent); } }

.wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 27%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--blanc);
  border: 4px solid var(--accent);
  box-shadow: 0 0 0 5px var(--blanc), 0 6px 14px rgba(0,0,0,.25);
  display: flex;
  align-items: center;
  justify-content: center;
}
.wheel-hub svg, .wheel-hub img { width: 70%; height: auto; display: block; }

/* Roue prête : le centre (toujours blanc) bat doucement et envoie des ondes corail */
.wheel.is-ready { cursor: pointer; }
.is-ready .wheel-hub { animation: hub-pulse 1.1s ease-in-out infinite; }
.is-ready .wheel-hub::before,
.is-ready .wheel-hub::after {
  content: "";
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  animation: hub-wave 1.6s ease-out infinite;
  pointer-events: none;
}
.is-ready .wheel-hub::after { animation-delay: .8s; }
@keyframes hub-pulse { 50% { transform: translate(-50%, -50%) scale(1.08); } }
@keyframes hub-wave { from { transform: scale(1); opacity: .9; } to { transform: scale(1.55); opacity: 0; } }
.spin-hint {
  margin: -8px 0 18px;
  text-align: center;
  font-family: var(--font-titre);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: 20px;
  color: var(--accent);
  animation: hint-blink 1s ease-in-out infinite;
}
@keyframes hint-blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  .is-ready .wheel-hub, .is-ready .wheel-hub::before, .is-ready .wheel-hub::after, .spin-hint { animation: none; }
}

.wheel-pointer {
  position: absolute;
  top: -3%;
  left: 50%;
  width: 11%;
  transform: translateX(-50%);
  transform-origin: 50% 30%;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.3));
}
.wheel-pointer svg { display: block; width: 100%; }
.is-spinning .wheel-pointer { animation: tick .12s ease-in-out infinite alternate; }
@keyframes tick { from { transform: translateX(-50%) rotate(-7deg); } to { transform: translateX(-50%) rotate(5deg); } }

/* ---------- Cartes ---------- */
.card {
  background: var(--blanc);
  border-radius: var(--radius);
  padding: 22px 18px;
  box-shadow: var(--shadow);
}
.card-intro { margin: 0 0 16px; text-align: center; color: var(--texte-doux); }

/* Formulaire mis en évidence quand on touche la roue trop tôt */
.card.is-highlight { animation: card-flash 1.4s ease-out; }
@keyframes card-flash {
  0%, 40% { box-shadow: 0 0 0 4px var(--accent), var(--shadow); }
  100% { box-shadow: 0 0 0 4px transparent, var(--shadow); }
}
.wheel:not(.is-ready) .wheel-hub { cursor: pointer; }

/* ---------- Formulaire ---------- */
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }

input[type="text"], input[type="tel"], input[type="email"], input[type="password"], select {
  width: 100%;
  font: inherit;
  font-size: 16px; /* ≥16px : évite le zoom automatique sur iPhone */
  color: var(--primaire);
  background: var(--fond);
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 13px 14px;
  outline: none;
  transition: border-color .15s, background .15s;
}
input:focus, select:focus { border-color: var(--secondaire); background: var(--blanc); }
input[aria-invalid="true"] { border-color: #C0392B; background: #FDF0EF; }

.phone { display: flex; gap: 8px; }
.phone select { flex: 0 0 108px; padding-right: 6px; }
.phone input { flex: 1; min-width: 0; }

.check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 12px 0;
  font-size: 15px;
  cursor: pointer;
}
.check input {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--secondaire);
}
.check input[aria-invalid="true"] { outline: 2px solid #C0392B; outline-offset: 2px; }
.check em { color: var(--texte-doux); font-style: normal; }

.form-error {
  min-height: 1.5em;
  margin: 8px 0;
  color: #B03A2E;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
}

.rgpd {
  margin: 16px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--texte-doux);
}

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-radius: 999px;
  font-family: var(--font-titre);
  text-transform: uppercase;
  letter-spacing: .08em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .1s, box-shadow .2s, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .65; cursor: progress; }
.btn-primary {
  background: var(--primaire);
  color: var(--fond);
  box-shadow: 0 6px 0 color-mix(in srgb, var(--primaire) 60%, #000), var(--shadow);
}
.btn-primary:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.btn-xl { font-size: 21px; padding: 16px 20px; }
.btn-secondary { background: var(--doux); color: var(--primaire); font-size: 16px; padding: 12px 18px; }

/* Lien secondaire "Jouer sans laisser d'avis" : taille normale, bon contraste, toujours visible */
.link-secondary {
  display: block;
  margin: 18px auto 0;
  padding: 10px 12px;
  background: none;
  border: 0;
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  color: var(--primaire);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

/* ---------- Fenêtre (bottom sheet sur mobile) ---------- */
.sheet {
  width: 100%;
  max-width: 520px;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 26px 26px 0 0;
  background: var(--blanc);
  color: var(--primaire);
  box-shadow: 0 -10px 40px rgba(0,0,0,.25);
}
.sheet[open] { animation: slide-up .3s ease-out; }
.sheet::backdrop { background: color-mix(in srgb, var(--primaire) 55%, transparent); backdrop-filter: blur(2px); }
.sheet-body { position: relative; padding: 30px 22px calc(30px + env(safe-area-inset-bottom)); text-align: center; }

/* Variante plein écran (fenêtre avis Google) */
.sheet-full,
.sheet-full[open] {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  animation: fade-in .25s ease-out;
}
.sheet-full .sheet-body {
  min-height: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: calc(60px + env(safe-area-inset-top)) 24px calc(40px + env(safe-area-inset-bottom));
}
.sheet-full .sheet-close { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 2; }
@keyframes fade-in { from { opacity: 0; } }

/* ---------- Fenêtre avis Google : univers du logo (teal lumineux, formes vertes et roses) ---------- */
#review-modal {
  background: radial-gradient(120% 70% at 50% 0%, #22A08B 0%, var(--secondaire) 45%, #146C60 100%);
  color: var(--fond);
  overflow-x: hidden;
}
#review-modal .sheet-body { position: static; }
#review-modal .sheet-body > :not(.review-deco, .sheet-close) { position: relative; z-index: 1; }
.review-deco { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#review-modal .sheet-close { background: color-mix(in srgb, var(--fond) 16%, transparent); }
#review-modal .sheet-close svg { stroke: var(--fond); }

.review-kicker {
  margin: 0 0 6px !important;
  font-family: var(--font-titre);
  text-transform: uppercase;
  letter-spacing: .16em;
  font-size: 14px;
  color: #F7CDD9 !important;
}
#review-modal h2 {
  font-size: clamp(40px, 12.5vw, 56px);
  line-height: .95;
  margin: 0 0 18px;
  color: var(--fond);
}
#review-modal h2 { color: var(--blanc); text-shadow: 0 3px 0 color-mix(in srgb, var(--primaire) 45%, transparent); }
#review-modal h2 span { display: block; color: #F7CDD9; }

.review-stars { display: flex; justify-content: center; gap: 6px; margin: 0 0 18px; }
.review-stars svg {
  width: 44px;
  height: 44px;
  fill: #FFD36E;
  filter: drop-shadow(0 0 10px color-mix(in srgb, #FFD36E 55%, transparent));
  animation: star-pop .5s cubic-bezier(.3,1.6,.5,1) both;
}
.review-stars svg:nth-child(2) { animation-delay: .1s; }
.review-stars svg:nth-child(3) { animation-delay: .2s; }
.review-stars svg:nth-child(4) { animation-delay: .3s; }
.review-stars svg:nth-child(5) { animation-delay: .4s; }
@keyframes star-pop { from { transform: scale(0) rotate(-40deg); opacity: 0; } }

#review-modal .review-lead { font-size: 18px; line-height: 1.45; color: var(--blanc); margin: 0 0 18px; }
.review-lead strong { display: block; margin-top: 4px; white-space: nowrap; color: #F7CDD9; }

.review-steps {
  list-style: none;
  margin: 0 0 26px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  border-radius: 18px;
  background: color-mix(in srgb, var(--primaire) 38%, transparent);
  color: var(--blanc);
  font-size: 16px;
}
.review-steps li { display: flex; align-items: center; gap: 12px; }
.review-steps span {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-titre);
  font-size: 15px;
  background: var(--accent);
  color: var(--primaire);
}

/* Bouton blanc : c'est l'élément le plus clair de la page, il attire l'œil */
.btn-review {
  font-size: 20px;
  padding: 10px 22px 10px 10px;
  background: var(--blanc);
  color: var(--primaire);
  box-shadow: 0 6px 0 var(--accent), 0 0 0 0 color-mix(in srgb, var(--blanc) 70%, transparent);
  animation: review-glow 1.8s ease-out infinite;
}
.btn-review:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
@keyframes review-glow {
  70%, 100% { box-shadow: 0 6px 0 var(--accent), 0 0 0 18px transparent; }
}
.g-badge { flex: 0 0 44px; height: 44px; border-radius: 50%; background: var(--doux); display: grid; place-items: center; }
.g-badge svg { width: 24px; height: 24px; }
#review-modal .review-note { margin: 16px 0 0; font-size: 14px; color: color-mix(in srgb, var(--fond) 70%, transparent); }
@media (prefers-reduced-motion: reduce) {
  .review-stars svg, .btn-review { animation: none; }
}

/* Croix de fermeture, petite et discrète en haut à droite ; fermer = la roue attend qu'on appuie */
.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--fond);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.sheet-close svg { width: 15px; height: 15px; stroke: var(--primaire); stroke-width: 2.6; stroke-linecap: round; fill: none; }
.sheet-close:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sheet-star { width: 56px; height: 56px; margin-top: 4px; fill: var(--accent); stroke: var(--primaire); stroke-width: 2.4; stroke-linejoin: round; }
.sheet-body h2 { font-family: var(--font-titre); font-weight: 400; text-transform: uppercase; font-size: 30px; margin: 4px 0 8px; letter-spacing: .02em; }
.sheet-body p { margin: 0 0 22px; color: var(--texte-doux); }
@keyframes slide-up { from { transform: translateY(40px); opacity: 0; } }

@media (min-width: 600px) {
  .sheet { margin: auto; border-radius: 26px; }
}

/* ---------- Résultat ---------- */
.result { text-align: center; margin-top: 4px; }
.result-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--secondaire);
  display: flex;
  align-items: center;
  justify-content: center;
}
.result-icon svg { width: 40px; height: 40px; fill: none; stroke: var(--fond); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.result-icon-soft { background: var(--doux); }
.result-icon-soft svg { stroke: var(--primaire); }
.result-icon .fill { fill: currentColor; stroke: none; color: var(--primaire); }

/* Étapes : aujourd'hui → email demain → 3 semaines */
.steps {
  list-style: none;
  margin: 18px 0 14px;
  padding: 18px 16px;
  background: var(--fond);
  border-radius: 18px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.steps li { display: flex; gap: 14px; align-items: flex-start; font-size: 15px; line-height: 1.4; }
.step-n {
  flex: 0 0 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primaire);
  color: var(--fond);
  font-family: var(--font-titre);
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-n-accent { background: var(--accent); color: var(--primaire); }
.step-n-teal { background: var(--secondaire); }
.result-title {
  font-family: var(--font-titre);
  font-weight: 400;
  text-transform: uppercase;
  font-size: 38px;
  line-height: 1;
  margin: 6px 0 12px;
  color: var(--primaire);
}
.result-title-line { white-space: nowrap; font-size: clamp(22px, 7.6vw, 38px); }
.result p { margin: 0 0 10px; }

.ticket {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 8px 0 14px;
  padding: 16px;
  border: 3px dashed var(--accent);
  border-radius: 18px;
  background: var(--doux);
}
.ticket-code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 26px;
  letter-spacing: .12em;
  user-select: all;
}
.ticket-copy {
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  background: var(--primaire);
  color: var(--fond);
  cursor: pointer;
}
.validity { font-size: 16px; }
.small { font-size: 13.5px; color: var(--texte-doux); }

/* ---------- Pied de page ---------- */
.foot {
  text-align: center;
  font-size: 14px;
  padding: 8px 16px 32px;
  color: var(--texte-doux);
}
.foot a { margin: 0 4px; }


#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* ---------- Pages secondaires (règlement, personnel, désinscription) ---------- */
.doc { max-width: 720px; margin: 0 auto; padding: 16px 16px 40px; }
.doc h1 { font-family: var(--font-titre); font-weight: 400; text-transform: uppercase; font-size: clamp(32px, 9vw, 48px); line-height: 1; margin: 18px 0 8px; }
.doc h2 { font-family: var(--font-titre); font-weight: 400; text-transform: uppercase; letter-spacing: .03em; font-size: 22px; margin: 28px 0 8px; color: var(--secondaire); }
.doc p, .doc li { font-size: 15.5px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 15px; background: var(--blanc); border-radius: 12px; overflow: hidden; }
.doc th, .doc td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--fond); }
.doc th { background: var(--primaire); color: var(--fond); font-weight: 500; }
.back { display: inline-block; margin-top: 8px; font-weight: 700; }

.status {
  margin-top: 16px;
  padding: 18px;
  border-radius: 16px;
  text-align: center;
  font-size: 17px;
}
.status strong { display: block; font-family: var(--font-titre); font-weight: 400; text-transform: uppercase; font-size: 28px; letter-spacing: .03em; }
.status-ok { background: #DDF3E8; color: #0F5132; }
.status-ko { background: #FBE1DE; color: #842029; }
.status-warn { background: #FFF1CC; color: #664D03; }

.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.code-input { text-transform: uppercase; letter-spacing: .1em; font-family: ui-monospace, Menlo, Consolas, monospace; }
.qr { display: grid; place-items: center; padding: 12px; background: #fff; border-radius: 12px; margin: 10px 0; }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; word-break: break-all; }
iframe.email-preview { width: 100%; height: 560px; border: 0; border-radius: 12px; background: #fff; }

[hidden] { display: none !important; }

/* Pas de barres de défilement visibles (la page défile quand même) */
html { scrollbar-width: none; overflow-x: hidden; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }
body { overflow-x: hidden; }
