/* ============================================================
   main.css — Tradex PROMOTE 2026 V2  ·  FESTIVE RED/GOLD
   Design System — Promotional wheel game interface
   ============================================================ */

/* ─── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Palette Tradex — rouge vif + or festif */
  --rouge:        #c40000;
  --rouge-vif:    #E30613;
  --rouge-deep:   #820000;
  --rouge-bg:     #b70000;
  --rouge-glow:   rgba(227, 6, 19, 0.4);

  --or:           #f5c443;
  --or-vif:       #ffd45f;
  --or-pale:      #ffe082;
  --or-deep:      #d4a017;
  --or-glow:      rgba(245, 196, 67, 0.6);

  --blanc:        #FFFFFF;
  --blanc-pur:    #FFFFFF;

  /* Fond */
  --fond:         #820000;
  --fond-card:    #FFFFFF;

  /* Glassmorphisme */
  --glass-bg:     rgba(180, 0, 0, 0.55);
  --glass-bord:   rgba(255, 255, 255, 0.12);
  --glass-bord-or:rgba(245, 196, 67, 0.4);
  --glass-inner:  rgba(255, 255, 255, 0.06);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35),
                  0 1px 0 rgba(255, 255, 255, 0.05) inset;

  /* Textes */
  --texte:        #FFFFFF;
  --texte-muted:  rgba(255, 255, 255, 0.75);
  --texte-dim:    rgba(255, 255, 255, 0.45);
  --texte-label:  #ffd45f;
  --texte-dark:   #1a1a1a;

  /* Rayons */
  --radius:       18px;
  --radius-sm:    10px;
  --radius-lg:    20px;
  --radius-pill:  100px;

  /* Easing */
  --ease-out:     cubic-bezier(0.23, 1, 0.32, 1);
  --ease-spring:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out:  cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer:  cubic-bezier(0.32, 0.72, 0, 1);

  /* Z-index scale */
  --z-bg:         0;
  --z-content:    1;
  --z-wheel:      5;
  --z-overlay:    100;
  --z-confetti:   101;
  --z-banner:     200;
}

/* ─── Page ─────────────────────────────────────────────────── */
html { height: 100%; font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Nunito', Arial, sans-serif;
  min-height: 100dvh;
  background: #5a0000;
  color: var(--texte);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
}

/* ─── Layout ───────────────────────────────────────────────── */
.page-container {
  position: relative;
  z-index: var(--z-content);
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 20px 32px;
  display: flex;

  /* Photo station Tradex — visible sans filtre rouge */
  background:
    linear-gradient(
      rgba(0,0,0,0.1) 0%,
      rgba(0,0,0,0.15) 50%,
      rgba(0,0,0,0.3) 100%
    ),
    url('../img/bg-tradex.png') center top / cover no-repeat;
}

@media (min-width: 600px) {
  .page-container {
    box-shadow: 0 0 80px rgba(0,0,0,0.5);
  }
}

/* ─── Header ───────────────────────────────────────────────── */
.header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 4px;
  animation: fadeInDown 0.6s var(--ease-out) both;
}

@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.header-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.header-logo img {
  height: 56px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.4));
}
.header-slogan {
  font-size: 11px;
  color: var(--or-pale);
  font-style: italic;
  letter-spacing: 0.06em;
  margin-top: 3px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Anciens sélecteurs header — masqués */
.header-center { display: none; }
.header-title { display: none; }


.promote-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--rouge-vif) 0%, var(--rouge-deep) 100%);
  color: #fff;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 0.2em;
  padding: 8px 26px;
  border-radius: 8px;
  text-transform: uppercase;
  border: 1px solid rgba(255, 212, 95, 0.45);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.hero-year {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 5rem;
  line-height: 0.95;
  letter-spacing: 4px;
  color: var(--or);
  text-shadow:
    0 4px 10px rgba(0,0,0,0.35),
    0 0 30px rgba(245, 196, 67, 0.25);
  margin: 2px 0 0;
  animation: fadeInUp 0.5s var(--ease-out) 0.2s both;
}

.hero-main-title {
  display: inline-block;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.45rem;
  line-height: 1.1;
  letter-spacing: 2px;
  color: #fff;
  background: linear-gradient(135deg, var(--rouge-vif) 0%, var(--rouge-deep) 100%);
  padding: 10px 18px;
  border-radius: 10px;
  border: 1.5px solid rgba(255, 212, 95, 0.35);
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
  text-shadow: 0 2px 4px rgba(0,0,0,0.4);
  animation: fadeInUp 0.5s var(--ease-out) 0.25s both;
}

.hero-sub-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.3rem;
  letter-spacing: 6px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.3);
  margin-top: 6px;
  opacity: 0.85;
  animation: fadeInUp 0.5s var(--ease-out) 0.3s both;
}

/* Ancien hero — masqué */
.hero-section { display: none; }

/* ─── Wheel Section avec décorations ───────────────────────── */
.wheel-section-deco {
  position: relative;
  margin-top: 20px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeInUp 0.6s var(--ease-out) 0.3s both;
}

/* Wrapper canvas preview — identique à la roue de jeu */
.wheel-preview-wrap {
  width: 280px;
  height: 280px;
  position: relative;
  z-index: 2;
  flex-shrink: 0;
}
.wheel-preview-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Décorations autour de la roue */
.deco-barrel {
  position: absolute;
  bottom: -10px;
  left: 2%;
  width: 90px;
  height: auto;
  z-index: 3;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
  animation: fadeInUp 0.5s var(--ease-out) 0.45s both;
}

.deco-oil-wrap {
  position: absolute;
  bottom: 0;
  left: 12%;
  z-index: 3;
  animation: fadeInUp 0.5s var(--ease-out) 0.5s both;
}
.deco-oil {
  width: 65px;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
  animation: float-can 5s ease-in-out infinite;
}

.deco-gift-wrap {
  position: absolute;
  right: 2%;
  bottom: -5px;
  z-index: 3;
  animation: fadeInUp 0.5s var(--ease-out) 0.55s both;
}
.deco-gift {
  width: 100px;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
  animation: float-gift 5.5s ease-in-out infinite;
}

@keyframes float-can {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50%      { transform: translateY(-8px) rotate(1.5deg); }
}
@keyframes float-gift {
  0%, 100% { transform: translateY(0) rotate(1.5deg); }
  50%      { transform: translateY(-10px) rotate(-1.5deg); }
}

/* ─── Bannière arrondie ────────────────────────────────────── */
.ribbon-banner {
  margin-top: 20px;
  padding: 15px 30px;
  background: #b00000;
  text-align: center;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  animation: fadeInUp 0.5s var(--ease-out) 0.35s both;
}
.ribbon-banner h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: 2px;
  color: #fff;
  font-weight: 700;
}
.ribbon-banner h2 span {
  display: block;
  font-size: 1.6rem;
  letter-spacing: 2px;
  color: var(--or-vif);
}

/* ─── Cards (pour écrans erreur/hors-horaire) ──────────────── */
.card {
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s var(--ease-out) 0.2s both;
}
.card--or {
  border: 1.5px solid rgba(245, 196, 67, 0.3);
}

/* ─── Wheel section for form screen ────────────────────────── */
.wheel-section-form {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 90px;
  padding-bottom: 10px;
  animation: fadeInUp 0.6s var(--ease-out) 0.1s both;
}

/* ─── Form glass container ─────────────────────────────────── */
.form-glass {
  width: 100%;
  max-width: 420px;
  background: rgba(80, 0, 0, 0.2);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 24px 20px 20px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: fadeInUp 0.5s var(--ease-out) 0.25s both;
  margin: auto;
}

.form-glass-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: 2px;
  color: #fff;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}
.form-glass-title span {
  display: block;
  font-size: 1.5rem;
  letter-spacing: 2px;
  color: var(--or-vif);
}

/* ─── Formulaire ───────────────────────────────────────────── */
.form-card {
  margin-top: 12px;
  width: 100%;
  max-width: 420px;
  background: transparent;
  padding: 8px 0 0;
  border-radius: 0;
  box-shadow: none;
  animation: fadeInUp 0.5s var(--ease-out) 0.35s both;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.form-label {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--or-vif);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.25s var(--ease-out);
}

/* Input icon wrapper */
.input-icon-wrap {
  position: relative;
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.input-icon-wrap .input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #aaa;
  pointer-events: none;
  z-index: 2;
  transition: color 0.25s var(--ease-out);
}
.input-icon-wrap:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), 0 0 0 3px rgba(245, 196, 67, 0.4);
}
.input-icon-wrap:focus-within .input-icon {
  color: var(--or);
}

.form-input {
  font-family: 'Nunito', sans-serif;
  font-size: 15.5px;
  font-weight: 700;
  background: transparent !important;
  border: none;
  border-radius: 15px;
  color: #1a1a1a !important;
  padding: 16px 18px 16px 48px;
  width: 100%;
  box-shadow: none !important;
  outline: none;
  -webkit-appearance: none;
}
.form-input::placeholder { color: #aaa; }
.form-input:focus {
  outline: none;
  box-shadow: none !important;
}
.form-input:-webkit-autofill,
.form-input:-webkit-autofill:hover,
.form-input:-webkit-autofill:focus,
.form-input:-webkit-autofill:active {
  -webkit-text-fill-color: #1a1a1a !important;
  color: #1a1a1a !important;
  transition: background-color 500000s ease-in-out 0s;
  box-shadow: 0 0 0px 1000px #ffffff inset !important;
}
.input-icon-wrap:has(.form-input.error) {
  box-shadow: 0 0 0 3px rgba(255, 80, 80, 0.6) !important;
  animation: inputShake 0.4s var(--ease-out);
}
.form-input.error {
  animation: inputShake 0.4s var(--ease-out);
}
@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}
.form-error {
  font-size: 11.5px;
  font-weight: 600;
  color: #ffcccc;
  margin-top: 4px;
  min-height: 18px;
  display: block;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out);
}
.form-error:not(:empty) {
  opacity: 1;
  transform: translateY(0);
}
.form-group:focus-within .form-label {
  color: var(--or-pale);
}

/* Préfixe +237 */
.tel-wrapper  { position: relative; }
.tel-prefix {
  position: absolute;
  left: 48px; top: 50%;
  transform: translateY(-50%);
  font-weight: 800;
  color: #888;
  font-size: 14.5px;
  pointer-events: none;
  z-index: 2;
  transition: color 0.25s var(--ease-out);
}
.input-icon-wrap:focus-within .tel-prefix {
  color: #444;
}
.tel-wrapper .form-input { padding-left: 100px; }

/* ─── Boutons ──────────────────────────────────────────────── */
.btn {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 0.1em;
  border: none;
  border-radius: var(--radius-lg);
  padding: 16px 32px;
  cursor: pointer;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 160ms var(--ease-out),
              box-shadow 250ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }

/* CTA doré (JOUER) — gradient or */
.btn-rouge {
  background: linear-gradient(180deg, var(--or-vif), var(--or));
  color: var(--rouge-deep);
  padding: 8px 32px;
  font-size: 30px;
  font-weight: 900;
  border-radius: var(--radius-lg);
  box-shadow:
    0 6px 20px rgba(130, 0, 0, 0.4),
    inset 0 1px 0 rgba(255,255,255,0.3);
  animation: pulseGlow 2.5s ease-in-out infinite;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.btn-rouge::after {
  content: '';
  position: absolute;
  top: -50%; left: -60%;
  width: 30%; height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(25deg);
  animation: shimmer-sweep 3.5s ease-in-out infinite;
  pointer-events: none;
}
.btn-rouge:disabled::after {
  display: none;
}

.btn-rouge .btn-arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(130, 0, 0, 0.2);
  border: 2px solid rgba(130, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-family: sans-serif;
  flex-shrink: 0;
  color: var(--rouge-deep);
  position: relative;
  z-index: 2;
  /* margin-left: auto; */
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow:
      0 6px 20px rgba(130, 0, 0, 0.4),
      inset 0 1px 0 rgba(255,255,255,0.3);
  }
  50% {
    box-shadow:
      0 8px 30px rgba(130, 0, 0, 0.5),
      0 0 25px rgba(245, 196, 67, 0.35),
      inset 0 1px 0 rgba(255,255,255,0.3);
  }
}
@keyframes shimmer-sweep {
  0% { left: -60%; }
  30%, 100% { left: 140%; }
}

.btn-rouge:disabled { animation: none; }

/* Bouton LANCER sur page roue — rouge vif pour contraste */
.btn-lancer-rouge {
  background: linear-gradient(180deg, #E30613, #990000);
  color: #fff;
  border: 3px solid var(--or);
  font-size: 28px;
  border-radius: var(--radius-pill);
  box-shadow:
    0 6px 24px rgba(139, 0, 0, 0.5),
    inset 0 1px 0 rgba(255,255,255,0.2);
  animation: pulseGlowRouge 2.5s ease-in-out infinite;
}

@keyframes pulseGlowRouge {
  0%, 100% {
    box-shadow:
      0 6px 24px rgba(139, 0, 0, 0.5),
      inset 0 1px 0 rgba(255,255,255,0.2);
  }
  50% {
    box-shadow:
      0 8px 36px rgba(139, 0, 0, 0.7),
      0 0 25px rgba(245, 196, 67, 0.2),
      inset 0 1px 0 rgba(255,255,255,0.2);
  }
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.2);
  font-size: 16px;
}

/* ─── Bouton fermer overlay ────────────────────────────────── */
.btn-close-result {
  display: block;
  width: 100%;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 2px;
  background: linear-gradient(180deg, var(--or-vif), var(--or));
  border: none;
  border-radius: var(--radius-lg);
  padding: 14px 44px;
  color: var(--rouge-deep);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  animation: fadeInUp 0.4s var(--ease-out) 1.4s both;
  position: relative;
  overflow: hidden;
}
.btn-close-result:active { transform: scale(0.97); }
.btn-close-result::after {
  content: '';
  position: absolute;
  top: -50%; left: -60%;
  width: 30%; height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.35) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(25deg);
  animation: shimmer-sweep 3.5s ease-in-out infinite;
  pointer-events: none;
}

/* ─── Progress bar ─────────────────────────────────────────── */
.progress-bar {
  width: 100%; height: 5px;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--or-vif), var(--rouge-vif), var(--or));
  border-radius: 4px;
  position: relative;
}
.progress-fill::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 40px; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  animation: progressShimmer 1.5s ease-in-out infinite;
}
@keyframes progressShimmer {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 1; }
}

/* ─── Quota badge ──────────────────────────────────────────── */
.quota-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--texte-muted);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
}
.quota-badge .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #4ADE80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.4);
  animation: dotPulse 2s ease-in-out infinite;
}
@keyframes dotPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.quota-badge.alerte .dot {
  background: #EF4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

/* ─── Code référence ───────────────────────────────────────── */
.ref-display {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 52px;
  letter-spacing: 12px;
  color: var(--or-vif);
  text-shadow: 0 0 20px rgba(245, 196, 67, 0.5);
  text-align: center;
  padding: 16px 18px;
  background: rgba(130, 0, 0, 0.9);
  border: 2px solid var(--or);
  border-radius: 12px;
  line-height: 1;
  animation: refReveal 0.8s var(--ease-spring) 0.4s both;
}
@keyframes refReveal {
  from { opacity: 0; transform: scale(0.9) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Shimmer titre — or animé */
.shimmer-text {
  background: linear-gradient(90deg,
    var(--or) 0%, #fff8dc 30%, var(--or-vif) 50%, #fff8dc 70%, var(--or) 100%);
  background-size: 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}
@keyframes shimmer {
  from { background-position: 200% center; }
  to   { background-position: -200% center; }
}

/* ─── Overlays résultat ────────────────────────────────────── */
.result-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15, 2, 3, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  z-index: var(--z-overlay);
  overflow-y: auto;
  padding: 24px 12px;
  transition: background 0.4s ease, backdrop-filter 0.4s ease, -webkit-backdrop-filter 0.4s ease;
}
.result-overlay.show {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 2, 3, 0.55);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: overlayFadeIn 0.4s var(--ease-out);
}
@keyframes overlayFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Flash burst (full screen white flash on wheel stop) ── */
.win-flash {
  position: fixed; inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.95) 0%, rgba(245,196,67,0.6) 40%, transparent 70%);
  z-index: 200;
  pointer-events: none;
  opacity: 0;
}
.win-flash.active {
  animation: flashBurst 0.25s ease-out forwards;
}
@keyframes flashBurst {
  0%   { opacity: 1; transform: scale(0.5); }
  40%  { opacity: 0.9; transform: scale(1.2); }
  100% { opacity: 0; transform: scale(2); }
}

/* ── Shockwave ring ── */
.win-shockwave {
  position: fixed;
  top: 50%; left: 50%;
  width: 60px; height: 60px;
  margin: -30px 0 0 -30px;
  border-radius: 50%;
  border: 3px solid var(--or-vif);
  box-shadow: 0 0 30px rgba(245,196,67,0.5), inset 0 0 20px rgba(245,196,67,0.3);
  z-index: 201;
  pointer-events: none;
  opacity: 0;
  transform: scale(0);
}
.win-shockwave.active {
  animation: shockwaveExpand 0.7s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}
@keyframes shockwaveExpand {
  0%   { opacity: 1; transform: scale(0); }
  30%  { opacity: 0.8; }
  100% { opacity: 0; transform: scale(12); border-width: 0.5px; }
}

/* ── Result card ── */
.result-card {
  border-radius: var(--radius-lg);
  padding: 28px 20px 22px;
  text-align: center;
  width: 100%; max-width: 380px;
  margin: auto;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.result-card::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), inset 0 -1px 1px rgba(0,0,0,0.2);
  pointer-events: none;
}
.result-card.win {
  background: linear-gradient(135deg, #b80000 0%, #660000 100%);
  border: 2.5px solid var(--or);
  box-shadow: 0 0 60px rgba(245, 196, 67, 0.4), 0 24px 48px rgba(0,0,0,0.5);
  color: #ffffff;
  opacity: 0;
  transform: scale(0.85) translateY(30px);
}
/* Card appears with spring when overlay .show and prize lands */
.result-overlay.show .result-card.win {
  animation: cardReveal 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}
@keyframes cardReveal {
  0%   { opacity: 0; transform: scale(0.85) translateY(30px); }
  60%  { opacity: 1; transform: scale(1.03) translateY(-4px); }
  80%  { transform: scale(0.98) translateY(1px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Accent line on top of card ── */
.result-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px; z-index: 1;
}
.result-card.win::before {
  background: linear-gradient(90deg, var(--rouge-vif), var(--or-vif), var(--or), var(--or-vif), var(--rouge-vif));
  background-size: 200%;
  animation: accentLine 2.5s linear infinite;
}
@keyframes accentLine { from { background-position: 0%; } to { background-position: 200%; } }
.result-card.lose::before { background: rgba(255,255,255,0.1); }

/* ── Rotating golden light rays ── */
.win-rays {
  position: absolute;
  top: 50%; left: 50%;
  width: 300%; height: 300%;
  transform: translate(-50%, -50%);
  pointer-events: none; z-index: 0;
  opacity: 0;
  background:
    repeating-conic-gradient(
      rgba(245, 196, 67, 0.08) 0deg,
      transparent 8deg,
      transparent 22deg,
      rgba(245, 196, 67, 0.08) 30deg
    );
  animation:
    raysReveal 0.8s var(--ease-out) 0.5s both,
    raysSpin 30s linear 0.5s infinite;
}
@keyframes raysReveal {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes raysSpin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ── Radial glow ── */
.result-card.win .win-radial-glow {
  position: absolute;
  top: -40%; left: 50%; transform: translateX(-50%);
  width: 200%; height: 200%;
  background: radial-gradient(ellipse at center top, rgba(245, 196, 67, 0.22) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
  animation: radialGlowPulse 3s ease-in-out infinite;
}
@keyframes radialGlowPulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

/* ── Sparkles ── */
.win-sparkle {
  position: absolute; width: 4px; height: 4px;
  border-radius: 50%; background: var(--or-vif);
  pointer-events: none; z-index: 2;
  animation: sparkleFade 1.8s ease-in-out infinite;
}
.win-sparkle:nth-child(3) { top: 8%; left: 12%; animation-delay: 0s; }
.win-sparkle:nth-child(4) { top: 15%; right: 10%; animation-delay: 0.4s; width: 3px; height: 3px; }
.win-sparkle:nth-child(5) { top: 6%; left: 50%; animation-delay: 0.8s; width: 5px; height: 5px; }
.win-sparkle:nth-child(6) { top: 20%; right: 25%; animation-delay: 1.2s; width: 3px; height: 3px; }
.win-sparkle:nth-child(7) { top: 3%; left: 30%; animation-delay: 0.6s; }
.win-sparkle:nth-child(8) { top: 12%; right: 40%; animation-delay: 1s; width: 3px; height: 3px; }
@keyframes sparkleFade {
  0%, 100% { opacity: 0; transform: scale(0.5); }
  50%      { opacity: 1; transform: scale(1.2); }
}

/* ── Light streaks ── */
.win-streaks {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 1;
  overflow: hidden;
}
.win-streaks span {
  position: absolute;
  width: 2px; height: 60%;
  background: linear-gradient(to bottom, transparent, rgba(245, 196, 67, 0.5), transparent);
  opacity: 0;
  animation: streakShoot 2s var(--ease-out) infinite;
}
.win-streaks span:nth-child(1) {
  left: 18%; top: -20%;
  transform: rotate(15deg);
  animation-delay: 1.2s;
}
.win-streaks span:nth-child(2) {
  right: 22%; top: -10%;
  transform: rotate(-12deg);
  animation-delay: 2s;
}
.win-streaks span:nth-child(3) {
  left: 50%; top: -15%;
  transform: rotate(5deg);
  animation-delay: 3.2s;
}
@keyframes streakShoot {
  0%   { opacity: 0; transform: translateY(-30%) rotate(inherit); }
  15%  { opacity: 0.7; }
  100% { opacity: 0; transform: translateY(160%) rotate(inherit); }
}

/* ═══════════════════════════════════════════════════════════════
   ① WIN HEADER — "Félicitations" (secondary, compact)
   ═══════════════════════════════════════════════════════════════ */
.win-header {
  position: relative; z-index: 5;
  opacity: 0;
  transform: translateY(-15px);
}
.result-overlay.show .win-header {
  animation: staggerSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.5s both;
}

.win-icon-wrap {
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(245,196,67,0.25), rgba(255,215,0,0.1));
  border: 2px solid var(--or);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 8px;
  box-shadow: 0 0 25px rgba(245,196,67,0.2);
  position: relative;
}
.win-icon-wrap::before {
  content: ''; position: absolute; inset: -15px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245,196,67,0.12) 0%, transparent 70%);
  animation: iconGlow 2s ease-in-out infinite;
}
@keyframes iconGlow { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(1.1); } }

.win-title {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 28px;
  letter-spacing: 2px;
  line-height: 1;
  margin-bottom: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   ② PRIZE HERO — dominant, 60% of visual space
   ═══════════════════════════════════════════════════════════════ */
.prize-hero {
  position: relative; z-index: 5;
  width: 100%;
  padding: 18px 10px 14px;
  opacity: 0;
  transform: scale(0.3) translateY(60px);
}
.result-overlay.show .prize-hero {
  animation: prizeFlight 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}
@keyframes prizeFlight {
  0%   { opacity: 0; transform: scale(0.3) translateY(60px); }
  45%  { opacity: 1; transform: scale(1.15) translateY(-12px); }
  65%  { transform: scale(0.95) translateY(3px); }
  80%  { transform: scale(1.04) translateY(-1px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Prize glow halo behind */
.prize-glow-halo {
  position: absolute;
  top: 50%; left: 50%;
  width: 160%; height: 180%;
  transform: translate(-50%, -50%) scale(0);
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(245, 196, 67, 0.4) 0%,
    rgba(245, 196, 67, 0.15) 35%,
    transparent 65%
  );
  pointer-events: none; z-index: 0;
  opacity: 0;
}
.result-overlay.show .prize-glow-halo {
  animation: haloReveal 0.6s var(--ease-out) 0.45s both, haloPulse 2.5s ease-in-out 1.2s infinite;
}
@keyframes haloReveal {
  from { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@keyframes haloPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
  50%      { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}
.prize-img-hero {
  width: 240px; max-height: 100px;
  display: flex; align-items: center; justify-content: center;
  margin: 20px auto;
  position: relative; z-index: 2;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.45)) drop-shadow(0 0 35px rgba(245, 196, 67, 0.4));
}
.prize-img-hero img {
  height: 100px;
  max-width: 100%;
  width: auto;
  object-fit: contain;
}

/* Prize name — BIG typography, dominant */
.prize-name-hero {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 42px;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--or-vif);
  text-shadow:
    0 2px 10px rgba(245, 196, 67, 0.5),
    0 0 40px rgba(245, 196, 67, 0.2);
  position: relative; z-index: 2;
  padding: 0 10px;
  /* Continuous gentle pulse to keep the prize alive */
  animation: prizeNamePulse 3s ease-in-out 1.5s infinite;
}
@keyframes prizeNamePulse {
  0%, 100% { text-shadow: 0 2px 10px rgba(245,196,67,0.5), 0 0 40px rgba(245,196,67,0.2); }
  50%      { text-shadow: 0 2px 15px rgba(245,196,67,0.7), 0 0 60px rgba(245,196,67,0.35); }
}

/* "VOTRE LOT" label */
.prize-label-hero {
  font-size: 10px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  margin-top: 6px;
  position: relative; z-index: 2;
}

/* ── Burst particles — 24 particles exploding from prize on impact ── */
.win-burst {
  position: absolute;
  top: 50%; left: 50%;
  width: 0; height: 0;
  pointer-events: none; z-index: 3;
}
.win-burst span {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
}
.result-overlay.show .win-burst span {
  animation: burstOut 0.9s var(--ease-out) both;
}

/* Generate 24 particles with varied sizes, colors, directions */
.win-burst span:nth-child(1)  { width: 7px; height: 7px; background: var(--or-vif);     --bx:  0px;  --by: -110px; animation-delay: 0.35s; }
.win-burst span:nth-child(2)  { width: 5px; height: 5px; background: #fff;              --bx:  78px; --by: -78px;  animation-delay: 0.37s; }
.win-burst span:nth-child(3)  { width: 6px; height: 6px; background: var(--or);          --bx:  110px; --by: 0px;  animation-delay: 0.39s; }
.win-burst span:nth-child(4)  { width: 4px; height: 4px; background: var(--rouge-vif);   --bx:  78px; --by: 78px;  animation-delay: 0.36s; }
.win-burst span:nth-child(5)  { width: 7px; height: 7px; background: var(--or-vif);     --bx:  0px;  --by: 110px; animation-delay: 0.38s; }
.win-burst span:nth-child(6)  { width: 5px; height: 5px; background: #fff;              --bx: -78px; --by: 78px;  animation-delay: 0.40s; }
.win-burst span:nth-child(7)  { width: 6px; height: 6px; background: var(--or);          --bx: -110px; --by: 0px; animation-delay: 0.35s; }
.win-burst span:nth-child(8)  { width: 4px; height: 4px; background: var(--rouge-vif);   --bx: -78px; --by: -78px; animation-delay: 0.37s; }
.win-burst span:nth-child(9)  { width: 3px; height: 3px; background: var(--or-pale);    --bx:  50px; --by: -100px; animation-delay: 0.41s; }
.win-burst span:nth-child(10) { width: 3px; height: 3px; background: var(--or-pale);    --bx: -50px; --by: 100px; animation-delay: 0.39s; }
.win-burst span:nth-child(11) { width: 5px; height: 5px; background: var(--rouge-vif);   --bx:  100px; --by: 50px; animation-delay: 0.36s; }
.win-burst span:nth-child(12) { width: 5px; height: 5px; background: var(--rouge-vif);   --bx: -100px; --by: -50px; animation-delay: 0.38s; }
.win-burst span:nth-child(13) { width: 4px; height: 4px; background: var(--or-vif);     --bx:  35px; --by: -60px; animation-delay: 0.42s; }
.win-burst span:nth-child(14) { width: 4px; height: 4px; background: #fff;              --bx: -35px; --by: 60px;  animation-delay: 0.40s; }
.win-burst span:nth-child(15) { width: 3px; height: 3px; background: var(--or);          --bx:  90px; --by: -30px; animation-delay: 0.37s; }
.win-burst span:nth-child(16) { width: 3px; height: 3px; background: var(--or);          --bx: -90px; --by: 30px; animation-delay: 0.39s; }
.win-burst span:nth-child(17) { width: 6px; height: 6px; background: var(--or-vif);     --bx:  55px; --by: 95px;  animation-delay: 0.35s; }
.win-burst span:nth-child(18) { width: 6px; height: 6px; background: var(--rouge-vif);   --bx: -55px; --by: -95px; animation-delay: 0.41s; }
.win-burst span:nth-child(19) { width: 3px; height: 3px; background: #fff;              --bx:  120px; --by: 20px; animation-delay: 0.38s; }
.win-burst span:nth-child(20) { width: 3px; height: 3px; background: #fff;              --bx: -120px; --by: -20px; animation-delay: 0.36s; }
.win-burst span:nth-child(21) { width: 5px; height: 5px; background: var(--or-pale);    --bx:  20px; --by: 120px; animation-delay: 0.40s; }
.win-burst span:nth-child(22) { width: 5px; height: 5px; background: var(--or-pale);    --bx: -20px; --by: -120px; animation-delay: 0.42s; }
.win-burst span:nth-child(23) { width: 4px; height: 4px; background: var(--rouge-vif);   --bx:  70px; --by: -90px; animation-delay: 0.37s; }
.win-burst span:nth-child(24) { width: 4px; height: 4px; background: var(--or-vif);     --bx: -70px; --by: 90px;  animation-delay: 0.39s; }

@keyframes burstOut {
  0%   { transform: translate(0, 0) scale(1.5); opacity: 1; }
  60%  { opacity: 0.7; }
  100% { transform: translate(var(--bx), var(--by)) scale(0); opacity: 0; }
}

/* ═══════════════════════════════════════════════════════════════
   ③ WIN FOOTER — player info, instruction (tertiary)
   ═══════════════════════════════════════════════════════════════ */
.win-footer {
  position: relative; z-index: 5;
  opacity: 0;
  transform: translateY(15px);
}
.result-overlay.show .win-footer {
  animation: staggerSlideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.7s both;
}

/* ── Shared stagger slide animation ── */
@keyframes staggerSlideUp {
  0%   { opacity: 0; transform: translateY(15px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ── Win / Lose common elements ── */
.win-greeting {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 4px;
}
.win-greeting strong {
  color: var(--or-vif) !important;
  font-weight: 800;
}

.code-instruction {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 10px;
  line-height: 1.5;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  text-align: center;
}

/* ── Lose overlay elements ── */
.result-card.lose {
  background: linear-gradient(135deg, #8c0000 0%, #4a0000 100%);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 24px 48px rgba(0,0,0,0.4);
  color: #ffffff;
  animation: cardReveal 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lose-icon-wrap {
  width: 72px; height: 72px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  animation: iconPop 0.5s var(--ease-spring) 0.1s both, loseBreathe 3s ease-in-out 0.6s infinite;
}
.lose-icon-wrap svg {
  stroke: rgba(255, 255, 255, 0.7);
}
@keyframes iconPop { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes loseBreathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }

.lose-title {
  font-family: 'Bebas Neue', sans-serif; font-size: 38px;
  color: var(--or-vif); letter-spacing: 1px; line-height: 1;
  margin-bottom: 10px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  animation: titleSlide 0.4s var(--ease-out) 0.2s both;
}
@keyframes titleSlide { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.lose-message {
  font-size: 0.94rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.65;
  margin: 14px 0 18px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.lose-sublabel {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 16px;
}

/* ── Skip animation — instant final state ── */
.result-overlay.show.skip-to-final .win-flash,
.result-overlay.show.skip-to-final .win-shockwave { display: none; }
.result-overlay.show.skip-to-final .result-card.win,
.result-overlay.show.skip-to-final .win-header,
.result-overlay.show.skip-to-final .prize-hero,
.result-overlay.show.skip-to-final .win-footer {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}
.result-overlay.show.skip-to-final .win-burst span { animation: none !important; opacity: 0 !important; }

/* ── prefers-reduced-motion ── */
@media (prefers-reduced-motion: reduce) {
  .result-overlay.show .result-card.win,
  .result-overlay.show .win-header,
  .result-overlay.show .prize-hero,
  .result-overlay.show .win-footer {
    animation: simpleFadeIn 0.4s ease both !important;
  }
  .win-flash, .win-shockwave, .win-burst, .win-rays, .win-sparkle, .win-streaks, .win-radial-glow, .prize-glow-halo {
    display: none !important;
  }
  @keyframes simpleFadeIn { from { opacity: 0; } to { opacity: 1; } }
}

/* ── Mobile responsive ── */
@media (max-width: 400px) {
  .prize-name-hero { font-size: 32px; }
  .win-title { font-size: 24px; }
  .result-card { padding: 22px 16px 18px; }
}
@media (max-width: 340px) {
  .prize-name-hero { font-size: 26px; }
  .win-title { font-size: 20px; }
}

/* ─── Timer ────────────────────────────────────────────────── */
.timer-wrap { display: flex; align-items: center; gap: 6px; color: var(--texte-muted); font-size: 12px; justify-content: center; margin-top: 10px; }
.timer-val { font-family: 'Bebas Neue', sans-serif; font-size: 17px; color: #fff; min-width: 2ch; text-align: center; }

/* ─── Bannière offline ─────────────────────────────────────── */
.offline-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: var(--z-banner);
  background: linear-gradient(90deg, #D97706, #b45309);
  color: #fff; text-align: center; padding: 10px 16px;
  font-weight: 700; font-size: 12px;
  transform: translateY(-100%);
  transition: transform 0.4s var(--ease-spring);
}
.offline-banner.visible { transform: translateY(0); }

/* ─── Spinner ──────────────────────────────────────────────── */
.spinner {
  width: 48px; height: 48px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--or);
  border-right-color: var(--rouge-vif);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Canvas confettis ─────────────────────────────────────── */
#confetti-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: var(--z-confetti); display: none;
}

/* ─── Floating Particles ───────────────────────────────────── */
.floating-particles {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: 0; bottom: 0; width: 100%; max-width: 480px;
  pointer-events: none; z-index: var(--z-content); overflow: hidden;
}
.floating-particles .particle {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: var(--or-vif); opacity: 0;
  animation: floatUp var(--dur, 8s) var(--delay, 0s) linear infinite;
}
@keyframes floatUp {
  0%   { opacity: 0; transform: translateY(100vh) translateX(0) scale(0.5); }
  10%  { opacity: var(--max-opacity, 0.3); }
  90%  { opacity: var(--max-opacity, 0.3); }
  100% { opacity: 0; transform: translateY(-10vh) translateX(var(--drift, 20px)) scale(1); }
}

/* ─── Animations ───────────────────────────────────────────── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slowRotate { to { transform: rotate(360deg); } }
.animate-fadeInUp { animation: fadeInUp 0.5s var(--ease-out) both; }
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.10s; }
.stagger-3 { animation-delay: 0.15s; }

/* ─── Utilitaires ──────────────────────────────────────────── */
.hidden { display: none !important; }
.text-or { color: var(--or-vif); }
.text-muted { color: var(--texte-muted); }
.w-full { width: 100%; }
.mt-2 { margin-top: 12px; }
.accent-line { width: 44px; height: 2px; background: linear-gradient(90deg, var(--rouge-vif), var(--or)); border-radius: 2px; }

/* ─── Wheel zone (écran roue) ──────────────────────────────── */
.wheel-zone {
  width: 100%; display: flex; flex-direction: column; align-items: center;
  padding: 0 8px; position: relative;
  animation: fadeInUp 0.6s var(--ease-out) 0.1s both;
  margin: auto;
}
.wheel-zone::before {
  content: ''; position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 130%; height: 130%;
  background:
    radial-gradient(circle, rgba(245,196,67,0.12) 0%, transparent 50%),
    radial-gradient(circle at 30% 40%, rgba(227,6,19,0.06) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
  animation: wheelAmbient 5s ease-in-out infinite;
}
@keyframes wheelAmbient {
  0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
  50%      { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
}

/* Pointer */
.pointer-wrap {
  display: flex; flex-direction: column; align-items: center;
  position: relative; z-index: var(--z-wheel);
  margin-bottom: -3px;
  filter: drop-shadow(0 2px 8px rgba(139,0,0,0.6));
  animation: pointerIdle 2s ease-in-out infinite;
}
@keyframes pointerIdle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
[data-spinning="true"] .pointer-wrap { animation: none; }

.pointer-neck {
  width: 22px; height: 14px;
  background: linear-gradient(180deg, #E30613, #990000);
  border-radius: 4px 4px 0 0;
  box-shadow: 0 -2px 8px rgba(227,6,19,0.6);
}
.pointer-tri {
  width: 0; height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 26px solid var(--rouge-vif);
}
.canvas-wrap { width: 100%; max-width: 450px; position: relative; z-index: 1; }
.canvas-wrap canvas { width: 100%; height: auto; display: block; }

/* ─── Player greeting ──────────────────────────────────────── */
.player-greeting {
  margin-top: 48px;
  display: inline-block;
  background: rgba(90, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(245, 196, 67, 0.3);
  border-radius: var(--radius-pill);
  padding: 6px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  margin-bottom: 12px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  animation: fadeInUp 0.4s var(--ease-out) both;
}
.player-greeting strong { color: var(--or-vif) !important; font-weight: 800; }

.cta-subtext {
  font-size: 0.74rem; color: var(--texte-dim);
  text-align: center; margin-top: 10px;
}

.spin-zone { width: 100%; margin-top: 14px; }
.spin-label { font-size: 0.78rem; color: var(--texte-dim); font-style: italic; text-align: center; margin-top: 8px; }

/* ─── Error screens ────────────────────────────────────────── */
.error-icon-circle {
  width: 76px; height: 76px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  animation: iconPop 0.5s var(--ease-spring) 0.1s both;
}
.error-icon-circle--red { background: rgba(227,6,19,0.15); border: 1px solid rgba(227,6,19,0.3); }
.error-icon-circle--gold { background: rgba(245,196,67,0.12); border: 1px solid rgba(245,196,67,0.25); }
.error-title { font-family: 'Bebas Neue', sans-serif; line-height: 1; animation: titleSlide 0.4s var(--ease-out) 0.2s both; }

/* ─── Countdown ────────────────────────────────────────────── */
.countdown-timer { display: flex; align-items: flex-start; justify-content: center; gap: 8px; animation: fadeInUp 0.5s var(--ease-out) 0.3s both; }
.countdown-unit { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.countdown-digit {
  font-family: 'Bebas Neue', sans-serif; font-size: 42px; letter-spacing: 2px; line-height: 1;
  color: var(--or-vif);
  background: rgba(245,196,67,0.08); border: 1px solid rgba(245,196,67,0.2);
  border-radius: 12px; padding: 12px 16px; min-width: 68px; text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  text-shadow: 0 0 12px rgba(245,196,67,0.3);
}
.countdown-digit.flip { animation: digitFlip 0.35s var(--ease-spring); }
@keyframes digitFlip { 0% { transform: scaleY(1); } 40% { transform: scaleY(0.85); } 100% { transform: scaleY(1); } }
.countdown-label { font-size: 0.62rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--texte-dim); font-weight: 600; }
.countdown-sep { font-family: 'Bebas Neue', sans-serif; font-size: 36px; color: var(--or-vif); opacity: 0.5; padding-top: 10px; animation: sepPulse 1s ease-in-out infinite; }
@keyframes sepPulse { 0%, 100% { opacity: 0.5; } 50% { opacity: 0.15; } }

/* ─── Home page ────────────────────────────────────────────── */
.home-hero {
  min-height: 100dvh; max-width: 480px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 2rem 1.5rem; gap: 1.5rem;
  position: relative; z-index: var(--z-content);
}
.home-logo { margin-bottom: 0.5rem; }
.home-logo img { height: 60px; filter: drop-shadow(0 2px 8px rgba(0,0,0,0.2)); }
.home-wheel-anim {
  width: 160px; height: 160px; border-radius: 50%;
  border: 5px solid var(--or);
  background: url('../img/roue-design.png') center/contain no-repeat;
  display: flex; align-items: center; justify-content: center;
  animation: slowRotate 15s linear infinite;
  box-shadow: 0 0 25px rgba(245, 196, 67, 0.4);
}
.home-title { font-family: 'Bebas Neue', sans-serif; font-size: 3.5rem; line-height: 0.92; }
.home-subtitle { font-size: 0.95rem; opacity: 0.65; font-weight: 600; }
.home-links { width: 100%; display: flex; flex-direction: column; gap: 12px; }

/* ─── Responsive ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}@media (max-width: 400px) {
  .hero-year { font-size: 4rem; }
  .hero-main-title { font-size: 1.2rem; padding: 8px 14px; }
  .wheel-frame-deco { width: 220px; height: 220px; border-width: 12px; }
  .deco-barrel { width: 70px; }
  .deco-gift { width: 80px; }
  .ribbon-banner h2 { font-size: 1.3rem; }
}

@media (max-width: 360px) {
  .page-container { padding: 14px 14px 24px; }
  .hero-year { font-size: 3.5rem; }
  .wheel-frame-deco { width: 200px; height: 200px; border-width: 10px; }
  .countdown-digit { min-width: 56px; font-size: 36px; padding: 10px 12px; }
}
.promote-text-light {
  color: #ffffff;
  font-size: 13.5px;
  line-height: 1;
}

.promote-text-gold {
  color: var(--or-vif);
  font-size: 13.5px;
  font-weight: bold;
  line-height: 1;
}

.badge-star {
  filter: drop-shadow(0 0 2px rgba(245, 196, 67, 0.6));
  animation: starPulse 2s ease-in-out infinite;
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes starPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px rgba(245, 196, 67, 0.6)); }
  50%      { transform: scale(1.2); filter: drop-shadow(0 0 5px rgba(255, 212, 95, 0.9)); }
}

@media (max-width: 360px) {
  .promote-text-light, .promote-text-gold {
    font-size: 12px;
  }
}

/* ─── Informations de redirection de fin de jeu ───────────── */
.redirect-info {
  margin-top: 18px;
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  font-style: italic;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 2;
  animation: fadeInUp 0.4s var(--ease-out) 1s both;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.redirect-info .countdown-sec {
  font-weight: 800;
  color: var(--or-vif);
  font-size: 15px;
  display: inline-block;
  margin: 0 2px;
  text-shadow: 0 0 10px rgba(255, 212, 95, 0.4);
}

/* ============================================================
   Style du lecteur QR Code html5-qrcode
   ============================================================ */
.scanner-wrapper {
  margin-top: 24px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 212, 95, 0.25);
  background: linear-gradient(135deg, rgba(20, 20, 25, 0.9) 0%, rgba(35, 10, 15, 0.9) 100%) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  position: relative;
  transition: all 0.3s var(--ease-out);
}

#reader {
  border: none !important;
  font-family: 'Nunito', Arial, sans-serif !important;
  background: transparent !important;
}

#reader video {
  border-radius: 16px !important;
  border: 2px solid rgba(255, 212, 95, 0.3) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65) !important;
  object-fit: cover;
}

#reader img {
  display: block;
  margin: 15px auto;
  max-width: 80px;
  opacity: 0.8;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.3));
}

#reader__dashboard_section_csr {
  padding: 15px 10px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  align-items: center !important;
}

#reader__dashboard_section_csr button,
#reader__dashboard_section_swaplink,
#reader__camera_permission_button {
  background: linear-gradient(135deg, var(--rouge-vif) 0%, #a00000 100%) !important;
  color: #fff !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 12px !important;
  padding: 12px 24px !important;
  font-family: 'Nunito', sans-serif !important;
  font-weight: 700 !important;
  letter-spacing: 0.3px !important;
  cursor: pointer !important;
  font-size: 14.5px !important;
  text-decoration: none !important;
  display: inline-block !important;
  text-align: center !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
  transition: all 0.25s var(--ease-out) !important;
}

#reader__dashboard_section_csr button:hover,
#reader__camera_permission_button:hover {
  background: linear-gradient(135deg, #ff1a1a 0%, var(--rouge) 100%) !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 20px rgba(227, 6, 19, 0.45) !important;
}

#reader__dashboard_section_csr button:active,
#reader__camera_permission_button:active {
  transform: translateY(0) !important;
  box-shadow: 0 4px 10px rgba(227, 6, 19, 0.25) !important;
}

#reader__camera_selection {
  padding: 12px 40px 12px 16px !important;
  border-radius: 12px !important;
  border: 1px solid rgba(255, 212, 95, 0.3) !important;
  background-color: rgba(26, 29, 39, 0.9) !important;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23ffd45f' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 14px !important;
  color: #fff !important;
  font-family: 'Nunito', sans-serif !important;
  font-size: 14.5px !important;
  font-weight: 600 !important;
  outline: none !important;
  max-width: 100% !important;
  width: 100% !important;
  box-sizing: border-box !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
  cursor: pointer !important;
  transition: all 0.25s var(--ease-out) !important;
}

#reader__camera_selection:focus {
  border-color: var(--or-vif) !important;
  box-shadow: 0 0 0 3px rgba(255, 212, 95, 0.25), 0 4px 12px rgba(0, 0, 0, 0.3) !important;
}

#reader__camera_selection option {
  background: #1a1d27 !important;
  color: #fff !important;
}

#reader__scan_region {
  background: #050508 !important;
  border-radius: 16px !important;
  overflow: hidden !important;
  position: relative !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

/* Pulsing scan overlay laser */
#reader__scan_region::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--or-vif), transparent);
  box-shadow: 0 0 12px var(--or-glow);
  animation: scanLaser 3s linear infinite;
  pointer-events: none;
  z-index: 2;
  display: none;
}

#reader__scan_region:has(video)::after {
  display: block;
}

@keyframes scanLaser {
  0% { top: 0%; }
  50% { top: 100%; }
  100% { top: 0%; }
}

#reader label,
#reader span,
#reader__status_span {
  color: var(--or-pale) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.8px !important;
  margin-bottom: 6px !important;
  display: inline-block !important;
  white-space: normal !important;
}

#reader__status_span {
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 13.5px !important;
  margin-top: 10px !important;
  display: block !important;
  font-weight: 600 !important;
  text-transform: none !important;
  letter-spacing: normal !important;
}

#btn-fermer-scanner {
  font-family: 'Nunito', sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px !important;
  text-transform: none !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: rgba(255, 255, 255, 0.8) !important;
  padding: 10px 24px !important;
  width: auto !important;
  display: inline-block !important;
  box-shadow: none !important;
  transition: all 0.25s var(--ease-out) !important;
  margin-top: 15px !important;
}

#btn-fermer-scanner:hover {
  background: rgba(255, 255, 255, 0.15) !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  transform: translateY(-1px) !important;
}

#btn-fermer-scanner:active {
  transform: translateY(0) !important;
}

/* ─── Media Query pour hauteur d'écran réduite ─── */
@media (max-height: 660px) {
  .result-card {
    padding: 16px 20px 14px;
  }
  .win-icon-wrap {
    width: 44px; height: 44px;
    margin-bottom: 4px;
  }
  .win-icon-wrap svg {
    width: 20px; height: 20px;
  }
  .win-title {
    font-size: 22px;
  }
  .prize-name-hero {
    font-size: 32px;
  }
  .btn-close-result {
    padding: 10px 24px;
    font-size: 18px;
  }
}
@media (max-height: 500px) {
  .prize-name-hero {
    font-size: 26px;
  }
}