/* ===========================================
   WHEEL OF FORTUNE STYLES
   =========================================== */

.wheel-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  aspect-ratio: 1;
  margin-top:2rem;
}

/* Spin counter badge */
.spin-counter {
  position: absolute;
  top: 2%;
  right: 2%;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 2px;
  background: rgba(159, 122, 234, 0.6);
  border: none;
  border-radius: 12px;
  padding: 4px 8px 4px 4px;
}
.spin-counter-icon {
  width: 42px;
  height: 42px;
}
.spin-counter-text {
  color: #fff;
  font-weight: 800;
  font-size: 1.7rem;
  line-height: 1;
}

/* Background */
.wheel-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* Spinning part (segments + frame) */
.wheel-spinner {
  position: absolute;
  inset: 3%;
  z-index: 1;
}

/* Individual segment — pointe au centre de la roue */
/* Segment = 455x600px, ratio ~0.758. Width 29% → height ~38% du container */
/* Pointe (bottom center) doit être à 50% du container → top = 50% - 38% = ~12% */
.wheel-segment {
  position: absolute;
  width: 29%;
  left: 35.5%;
  top: 8%;
  transform-origin: 50% 110%;
  transform: rotate(var(--angle));
  z-index: 1;
}

/* Wheel decorative frame overlay */
.wheel-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

/* Needle (fixed, doesn't rotate) */
.wheel-needle {
  position: absolute;
  width: 20%;
  top: -5%;
  left: 50%;
  transform: translateX(-50%);
  transform-origin: 50% 25%; /* pivot near the top (axe point) */
  z-index: 10;
  pointer-events: none;
}

/* Axe — same size/position as needle, overlaid on top */
.wheel-axe {
  position: absolute;
  width: 18%;
  top: -5%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  pointer-events: none;
}

/* Spin button */
.wheel-spin-btn {
  position: absolute;
  width: 28%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 12;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
  transition: width 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.7s ease-in-out;
}
.wheel-spin-btn.small {
  width: 18%;
}
.wheel-spin-btn.press {
  transform: translate(-50%, -50%) scale(0.85);
}

/* Progress / info below wheel */
/* Portraits row */
.wheel-portraits {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin: 0.75rem auto;
  max-width: 100%;
  padding: 0 8px;
}
.portrait {
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.15);
  filter: grayscale(1) brightness(0.5);
  transition: filter 0.3s, border-color 0.3s;
  position: relative;
  flex-shrink: 0;
}
.portrait.lit {
  filter: grayscale(0) brightness(1);
}
/* Character-specific border colors when lit */
.portrait[data-segment="clown"].lit    { border-color: #B8652A; }
.portrait[data-segment="spectre"].lit  { border-color: #aaaaaa; }
.portrait[data-segment="archange"].lit { border-color: #C9A84C; }
.portrait[data-segment="sirene"].lit   { border-color: #1A6B6B; }
.portrait[data-segment="vampire"].lit  { border-color: #8B1A1A; }
.portrait[data-segment="alchimiste"].lit { border-color: #2A5A3A; }
.portrait[data-segment="reine"].lit    { border-color: #4A1A5E; }
.portrait.shake {
  animation: portraitShake 0.5s ease-in-out;
}

/* Segment name overlay */
.segment-name {
  position: fixed;
  z-index: 10000;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8), 0 0 20px rgba(0,0,0,0.5);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  letter-spacing: 0.03em;
}
.segment-name.visible {
  opacity: 1;
}
.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Flying clone — phase 1: zoom out from wheel */
.fly-clone {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
}
.fly-clone.zoom-out {
  transition: transform 1s cubic-bezier(0.2, 0.8, 0.3, 1), opacity 0.4s ease, filter 0.8s ease, left 1s ease-out, top 1s ease-out;
  opacity: 1;
}
/* Phase 2a: aspirée vers portrait */
.fly-clone.fly-to-portrait {
  transition: all 0.8s cubic-bezier(0.5, 0, 0.2, 1);
  border-radius: 50%;
}

/* Dust particles */
.dust-particle {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  z-index: 9998;
  pointer-events: none;
  opacity: 1;
  transition: all 0.8s ease-out;
}
.dust-particle.disperse {
  opacity: 0;
}

@keyframes portraitShake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-4px) rotate(-3deg); }
  30% { transform: translateX(4px) rotate(3deg); }
  45% { transform: translateX(-3px) rotate(-2deg); }
  60% { transform: translateX(3px) rotate(2deg); }
  75% { transform: translateX(-2px); }
  90% { transform: translateX(2px); }
}

.contest-info {
  max-width: 600px;
  margin: 1rem auto;
  text-align: center;
  padding: 0 0.5rem;
}
.contest-info .contest-countdown {
  color: #9f7aea;
  font-weight: 600;
  font-size: 1rem;
}

/* Share buttons (same as referral page) */
.resp-sharing-button__link, .resp-sharing-button__icon { display: inline-block; }
.resp-sharing-button__link { text-decoration: none; color: #fff; margin: 0.5em; }
.resp-sharing-button { border-radius: 5px; transition: 25ms ease-out; padding: 0.5em 0.75em; }
.resp-sharing-button__icon svg { width: 1em; height: 1em; vertical-align: middle; }
.resp-sharing-button__icon { stroke: #fff; fill: none; }
.resp-sharing-button__icon--solid { fill: #fff; stroke: none; }
.resp-sharing-button--twitter { background-color: #55acee; }
.resp-sharing-button--twitter:hover { background-color: #2795e9; }
.resp-sharing-button--facebook { background-color: #3b5998; }
.resp-sharing-button--facebook:hover { background-color: #2d4373; }
.resp-sharing-button--whatsapp { background-color: #25D366; }
.resp-sharing-button--whatsapp:hover { background-color: #1da851; }
.resp-sharing-button--telegram { background-color: #54A9EB; }
.resp-sharing-button--telegram:hover { background-color: #4B97D1; }
.resp-sharing-button--email { background-color: #777777; }
.resp-sharing-button--email:hover { background-color: #5e5e5e; }
