/**
 * InterFilm — Modal choix aléatoire (noir / orange)
 */

.wheel-bg {
  position: fixed;
  inset: 0;
  z-index: 350;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  overflow-y: auto;
}

.wheel-bg.open {
  opacity: 1;
  pointer-events: all;
}

.wheel-close {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 12;
  transition: 0.2s ease;
}

.wheel-close:hover {
  background: #f77f00;
  border-color: #f77f00;
  transform: rotate(90deg);
}

.wheel-close svg {
  width: 20px;
  height: 20px;
}

.wheel-modal {
  width: min(920px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.25rem, 3vw, 2rem);
  padding: 8px 0 24px;
}

.wheel-modal-head {
  text-align: center;
  max-width: 520px;
}

.wheel-modal-kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(247, 127, 0, 0.85);
}

.wheel-modal-title {
  margin: 0 0 10px;
  font-family: 'Bebas Neue', var(--ff-head);
  font-size: clamp(2.5rem, 7vw, 3.5rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
  flex-wrap: wrap;
}

.wheel-modal-title .section-title-w {
  color: #fff;
}

.wheel-modal-title .section-title-o {
  color: #f77f00;
  text-shadow: 0 0 28px rgba(247, 127, 0, 0.35);
}

.wheel-modal-sub {
  margin: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
}

.wheel-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-wrap {
  position: relative;
  border-radius: 50%;
  padding: 14px;
  background: linear-gradient(145deg, #1a1a1f 0%, #050505 55%, #111 100%);
  box-shadow:
    0 0 0 1px rgba(247, 127, 0, 0.25),
    0 0 48px rgba(247, 127, 0, 0.12),
    0 28px 64px rgba(0, 0, 0, 0.75);
}

.wheel-wrap::before {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 2px solid rgba(247, 127, 0, 0.2);
  pointer-events: none;
  z-index: 2;
}

.wheel-ring-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(247, 127, 0, 0.5),
    transparent 40deg,
    transparent 130deg,
    rgba(255, 149, 0, 0.35) 180deg,
    transparent 220deg,
    transparent 310deg,
    rgba(247, 127, 0, 0.45) 360deg
  );
  opacity: 0.35;
  animation: wheelRingSpin 12s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes wheelRingSpin {
  to { transform: rotate(360deg); }
}

#wheelCanvas {
  display: block;
  border-radius: 50%;
  position: relative;
  z-index: 1;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.85);
}

.wheel-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: 36px;
  height: 48px;
  color: #f77f00;
  filter: drop-shadow(0 4px 12px rgba(247, 127, 0, 0.65));
  transition: transform 0.07s ease;
}

.wheel-pointer.tick {
  transform: translateX(-50%) rotate(-12deg);
}

.wheel-pointer svg {
  width: 100%;
  height: 100%;
  display: block;
  transform: rotate(180deg);
}

.wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  width: clamp(72px, 18vw, 96px);
  height: clamp(72px, 18vw, 96px);
  border-radius: 50%;
  border: 3px solid rgba(247, 127, 0, 0.55);
  background: radial-gradient(circle at 35% 30%, #2a2a32 0%, #0a0a0d 70%);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 0 6px rgba(0, 0, 0, 0.65),
    0 8px 24px rgba(0, 0, 0, 0.6),
    inset 0 2px 4px rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.wheel-hub:hover:not(:disabled) {
  transform: translate(-50%, -50%) scale(1.05);
  border-color: #ff9500;
  box-shadow:
    0 0 0 6px rgba(0, 0, 0, 0.65),
    0 0 32px rgba(247, 127, 0, 0.45),
    inset 0 2px 4px rgba(255, 255, 255, 0.12);
}

.wheel-hub:active:not(:disabled) {
  transform: translate(-50%, -50%) scale(0.96);
}

.wheel-hub:disabled {
  opacity: 0.65;
  cursor: wait;
}

.wheel-hub-label {
  font-family: 'Bebas Neue', var(--ff-head);
  font-size: clamp(1rem, 3vw, 1.25rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
}

.wheel-result {
  display: none;
  width: min(560px, 100%);
  align-items: stretch;
  gap: 20px;
  padding: 20px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(18, 18, 22, 0.98), rgba(8, 8, 10, 0.98));
  border: 1px solid rgba(247, 127, 0, 0.28);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55), 0 0 32px rgba(247, 127, 0, 0.08);
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transition: opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1), transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.wheel-result.visible {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.wheel-result-poster {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-result-poster img {
  width: 110px;
  height: 165px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
}

.wheel-result-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: left;
}

.wheel-result-kicker {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f77f00;
}

.wheel-result-title {
  margin: 0 0 8px;
  font-family: 'Bebas Neue', var(--ff-head);
  font-size: clamp(1.35rem, 4vw, 1.75rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.15;
  color: #fff;
  text-transform: uppercase;
}

.wheel-result-meta {
  margin: 0 0 16px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.55);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}

.wheel-result-meta strong {
  color: #f77f00;
  font-weight: 700;
}

.wheel-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.wheel-result-btn {
  flex: 1;
  min-width: 120px;
  justify-content: center;
  padding: 12px 16px !important;
  font-size: 14px !important;
}

@media (max-width: 640px) {
  .wheel-bg {
    padding: calc(var(--mobile-nav-h, 56px) + 12px) 16px 24px;
    align-items: flex-start;
  }

  .wheel-result {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .wheel-result-body {
    text-align: center;
    align-items: center;
  }

  .wheel-result-actions {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wheel-ring-glow {
    animation: none;
  }
}
