/* ==========================================================================
   Feliya — roue de la chance (/roue/, /en/wheel/), après main.css
   Ordre : la scène (roue + panneau) · la roue · le panneau · confettis · règlement · responsive
   ========================================================================== */

/* ---------- La scène : la roue à gauche, le jeu à droite, sur le vert de la perle du logo ---------- */
.roue {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  align-items: center;
  gap: 40px 72px;
  padding-bottom: 72px;
  background: var(--color-forest);
}

.roue [hidden] { display: none !important; }

.roue__stage { display: grid; place-items: center; }

/* ---------- La roue (SVG dessiné par WheelPage.astro) ---------- */
.wheel {
  width: min(100%, 560px);
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 26px 40px rgba(12, 18, 12, 0.38));
}

.wheel__disc {
  transform-box: fill-box;
  transform-origin: center;
  will-change: transform;
}

/* En attendant la réponse du serveur : la roue tourne à vitesse constante depuis sa position (--from) */
.wheel__disc.is-spinning { animation: roue-spin 520ms linear infinite; }

@keyframes roue-spin {
  from { transform: rotate(var(--from, 0deg)); }
  to { transform: rotate(calc(var(--from, 0deg) + 360deg)); }
}

.wheel__slice path { fill: var(--color-paper); stroke: rgba(36, 30, 25, 0.16); stroke-width: 1; }
.wheel__slice--15 path { fill: var(--color-sand); }
.wheel__slice--20 path { fill: #d3c2a3; }
.wheel__slice--25 path { fill: url(#wheel-prize); }

.wheel__slice text {
  fill: var(--color-ink);
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 400;
  font-variant-numeric: lining-nums; /* Cormorant dessine « 10 » en chiffres elzéviriens, proches de « IO » */
  text-anchor: middle;
  dominant-baseline: central;
}

.wheel__bulb { fill: var(--color-on-dark); animation: roue-bulb 1.6s ease-in-out infinite alternate; }
.wheel__bulb:nth-of-type(odd) { animation-delay: -0.8s; }

@keyframes roue-bulb {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

.wheel__pointer {
  fill: var(--color-wine);
  stroke: var(--color-on-dark);
  stroke-width: 3;
  stroke-linejoin: round;
}

/* ---------- Le panneau : e-mail, garder ou relancer, la carte gagnée ---------- */
.roue__panel {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 22px;
  max-width: 520px;
}

/* Texte secondaire sur le vert : plus clair que --color-on-dark-muted (contraste 5:1, au lieu de 4:1) */
.roue__panel > .eyebrow { color: rgba(247, 244, 239, 0.75); }

.roue__title {
  font-family: var(--font-script);
  font-size: clamp(56px, 6.2vw, 100px);
  font-weight: 400;
  line-height: 1.05;
}

.roue__lede {
  font-family: var(--font-serif);
  font-size: clamp(20px, 1.8vw, 24px);
  font-style: italic;
  line-height: 1.35;
  opacity: 0.88;
}

.roue__form { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; width: 100%; margin-top: 6px; }
.roue__form[aria-busy="true"] { opacity: 0.6; pointer-events: none; }

.roue__field { width: 100%; }

.roue__field input {
  width: 100%;
  padding: 14px 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(247, 244, 239, 0.45);
  border-radius: 0;
  outline: 0;
  font-size: 16px;
  transition: border-color var(--dur) var(--ease);
}

.roue__field input:focus { border-color: var(--color-on-dark); }
.roue__field input::placeholder { color: var(--color-on-dark-muted); }

.roue__consent { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.5; cursor: pointer; }
.roue__consent input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: #c2a674; }

/* Piège à robots : hors écran, jamais visible ni atteignable au clavier */
.roue__trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.roue__spin { min-width: 240px; }
.roue .btn:disabled { opacity: 0.45; cursor: default; }
.roue .btn--light:focus-visible,
.roue .btn--ghost:focus-visible { outline: 2px solid var(--color-on-dark); outline-offset: 3px; }

.roue__note { font-size: 12px; color: rgba(247, 244, 239, 0.75); }
.roue__note a { color: var(--color-on-dark); border-bottom: 1px solid rgba(247, 244, 239, 0.45); }

.roue__status {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2vw, 28px);
  font-style: italic;
  line-height: 1.3;
}
.roue__status:empty { display: none; }
.roue__status.is-error { font-size: 19px; color: #f2c6cc; }

.roue__choice { display: flex; flex-direction: column; gap: 16px; }
.roue__hint { font-size: 13px; color: var(--color-on-dark-muted); }
.roue__actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Partie finie : la carte prend la place de l'introduction */
.roue.is-done .roue__lede { display: none; }

.roue__result { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }

.roue__card {
  width: min(100%, 440px);
  height: auto;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.35));
  animation: roue-card 900ms var(--ease) both;
}

@keyframes roue-card {
  from { opacity: 0; transform: translateY(24px) rotate(-6deg) scale(0.94); }
  to { opacity: 1; transform: none; }
}

.roue__sent { font-size: 14px; line-height: 1.6; max-width: 440px; }
.roue__resend { color: var(--color-on-dark); }

/* ---------- Confettis (assets/js/roue.js), aux couleurs des cartes ---------- */
.confetti { position: fixed; inset: 0; z-index: 50; overflow: hidden; pointer-events: none; }

.confetti i {
  position: absolute;
  top: -16px;
  width: 7px;
  height: 13px;
  animation: confetti-fall var(--fall, 2.6s) cubic-bezier(0.3, 0.6, 0.6, 1) var(--delay, 0s) forwards;
}

@keyframes confetti-fall {
  to { transform: translate3d(var(--drift, 0), 108vh, 0) rotate(var(--turn, 540deg)); }
}

/* ---------- Règlement ---------- */
.roue-faq {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 56px;
  padding: var(--section-y) var(--gutter) 96px;
  background: var(--color-paper);
  scroll-margin-top: 72px;
}

.roue-faq__list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 64px;
  width: 100%;
  max-width: 920px;
}

.roue-faq h3 { margin-bottom: 10px; font-family: var(--font-serif); font-size: 22px; font-weight: 400; line-height: 1.3; }
.roue-faq p { font-size: 14px; line-height: 1.62; color: var(--color-muted); }

@media (prefers-reduced-motion: reduce) {
  .wheel__bulb { animation: none; opacity: 0.8; }
  .roue__card { animation: none; }
}

/* ---------- Responsive (mêmes points de rupture que main.css) ---------- */
@media (max-width: 1199.98px) {
  .roue { gap: 40px 48px; }
}

@media (max-width: 809.98px) {
  .roue {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 28px;
    padding-top: 116px;
    padding-bottom: 56px;
  }

  .roue__panel { gap: 18px; }

  .wheel { width: min(100%, 330px); }

  .roue__panel { align-items: center; text-align: center; }
  .roue__form,
  .roue__result { align-items: center; }
  .roue__consent { text-align: left; }
  .roue__spin { width: 100%; }
  .roue__actions { justify-content: center; }

  .roue-faq { gap: 40px; padding-bottom: 72px; }
  .roue-faq__list { grid-template-columns: 1fr; gap: 32px; }
}
