/* Ruota premi — stile roulette: disco fisso + pallina */
#prize-wheel-modal {
  --pw-accent: #38bdf8;
  --pw-gold: #fbbf24;
  --pw-ink: #0f172a;
  font-family: "Segoe UI", system-ui, sans-serif;
}

#prize-wheel-modal.prize-wheel-open {
  display: flex !important;
}

.prize-wheel-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(56, 189, 248, 0.28), transparent 55%),
    radial-gradient(ellipse 70% 50% at 50% 90%, rgba(251, 191, 36, 0.16), transparent 50%),
    rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(8px);
}

.prize-wheel-panel {
  position: relative;
  z-index: 2;
  width: min(92vw, 420px);
  max-height: min(94vh, 720px);
  overflow: auto;
  padding: 1.25rem 1.25rem 1.5rem;
  border-radius: 1.5rem;
  background: linear-gradient(165deg, #1e293b 0%, #0f172a 55%, #020617 100%);
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow:
    0 0 0 1px rgba(56, 189, 248, 0.15),
    0 25px 60px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: center;
  color: #e2e8f0;
  animation: prize-wheel-panel-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes prize-wheel-panel-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.prize-wheel-eyebrow {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--pw-accent);
  margin-bottom: 0.35rem;
}

.prize-wheel-title {
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.15;
  margin: 0 0 0.35rem;
}

.prize-wheel-sub {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0 0 1rem;
  line-height: 1.4;
}

.prize-wheel-stage {
  position: relative;
  width: min(78vw, 300px);
  height: min(78vw, 300px);
  margin: 0.75rem auto 1.25rem;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45));
}

/* Freccia fissa in alto: indica dove cade la pallina */
.prize-wheel-pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  z-index: 8;
  width: 0;
  height: 0;
  margin-left: -12px;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 22px solid var(--pw-gold);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  transform-origin: 50% 0%;
}

.prize-wheel-rim {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(145deg, #fbbf24, #b45309 45%, #fcd34d);
  padding: 10px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.25),
    0 0 20px rgba(251, 191, 36, 0.28);
}

/* Disco FISSO: non ruota mai */
.prize-wheel-disk {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  background: #0f172a;
  box-shadow: inset 0 0 0 2px rgba(15, 23, 42, 0.9);
}

/* Etichette fisse e leggibili (testo dritto) */
.prize-wheel-labels {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 3;
}

.prize-wheel-seg-label {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3.4rem;
  margin: 0;
  padding: 0;
  text-align: center;
  font-size: clamp(0.55rem, 2.1vw, 0.72rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
  pointer-events: none;
  white-space: pre-line;
  z-index: 2;
}

.prize-wheel-seg-label.is-win {
  color: #fef08a;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.8), 0 1px 3px rgba(0, 0, 0, 0.8);
  font-size: clamp(0.62rem, 2.3vw, 0.8rem);
}

/* Orbita pallina (roulette) */
.prize-wheel-ball-orbit {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  z-index: 6;
  pointer-events: none;
  transform: rotate(0deg);
  will-change: transform;
}

.prize-wheel-ball-orbit.is-spinning {
  transition: transform 4.5s cubic-bezier(0.15, 0.85, 0.2, 1);
}

.prize-wheel-ball {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 16px;
  height: 16px;
  margin-left: -8px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #fff 0%, #f8fafc 28%, #cbd5e1 70%, #64748b 100%);
  box-shadow:
    0 2px 6px rgba(0, 0, 0, 0.55),
    inset 0 -2px 3px rgba(0, 0, 0, 0.25),
    0 0 10px rgba(255, 255, 255, 0.35);
}

.prize-wheel-ball-orbit.is-spinning .prize-wheel-ball {
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.5),
    0 0 14px rgba(251, 191, 36, 0.55);
}

.prize-wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 7;
  width: 54px;
  height: 54px;
  margin: -27px 0 0 -27px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff7d6, #fbbf24 45%, #b45309);
  border: 3px solid #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #7c2d12;
  font-size: 1.1rem;
}

.prize-wheel-result {
  display: none;
  margin: 0.25rem 0 1rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(56, 189, 248, 0.15));
  border: 1px solid rgba(52, 211, 153, 0.45);
  animation: prize-wheel-result-pop 0.5s cubic-bezier(0.22, 1.2, 0.36, 1) both;
}

.prize-wheel-result.is-visible {
  display: block;
}

.prize-wheel-result.is-lose {
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.25), rgba(51, 65, 85, 0.2));
  border-color: rgba(148, 163, 184, 0.45);
}

.prize-wheel-result.is-lose .prize-wheel-result-label {
  color: #94a3b8;
}

@keyframes prize-wheel-result-pop {
  0% {
    opacity: 0;
    transform: scale(0.85) translateY(8px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.prize-wheel-result-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #6ee7b7;
  margin-bottom: 0.25rem;
}

.prize-wheel-result-prize {
  font-size: 1.35rem;
  font-weight: 900;
  color: #fff;
  line-height: 1.2;
}

.prize-wheel-result-hint {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 0.35rem;
}

.prize-wheel-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  position: relative;
  z-index: 12;
}

.prize-wheel-btn {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 0.85rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.prize-wheel-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

.prize-wheel-btn-primary {
  color: #0f172a;
  background: linear-gradient(135deg, #38bdf8, #22d3ee 40%, #fbbf24);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.35);
}

.prize-wheel-btn-primary:not(:disabled):hover {
  transform: translateY(-1px) scale(1.02);
}

.prize-wheel-btn-primary:not(:disabled):active {
  transform: scale(0.98);
}

.prize-wheel-btn-primary.is-pulse {
  animation: prize-wheel-cta-pulse 1.2s ease-in-out infinite;
}

@keyframes prize-wheel-cta-pulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(56, 189, 248, 0.35); }
  50% { box-shadow: 0 8px 32px rgba(251, 191, 36, 0.55); }
}

.prize-wheel-btn-secondary {
  color: #cbd5e1;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.prize-wheel-confetti {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  overflow: hidden;
  border-radius: 1.5rem;
}

.prize-wheel-confetti i {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  opacity: 0;
  animation: prize-wheel-confetti-fall 1.6s ease-out forwards;
}

@keyframes prize-wheel-confetti-fall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(420px) rotate(540deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .prize-wheel-ball-orbit.is-spinning {
    transition-duration: 0.7s !important;
  }
  .prize-wheel-btn-primary.is-pulse,
  .prize-wheel-panel {
    animation: none !important;
  }
}

/* ——— Gratta e vinci (checkout) ——— */
.prize-scratch-stage {
  margin: 0 auto 1rem;
  width: min(92vw, 340px);
}

.prize-scratch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
}

.prize-scratch-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 0.85rem;
  overflow: hidden;
  background: linear-gradient(145deg, #1e293b, #0f172a);
  border: 2px solid rgba(148, 163, 184, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 14px rgba(0, 0, 0, 0.35);
}

.prize-scratch-cell.is-revealed {
  border-color: rgba(56, 189, 248, 0.55);
  animation: prize-scratch-pop 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes prize-scratch-pop {
  from { transform: scale(0.92); opacity: 0.6; }
  to { transform: scale(1); opacity: 1; }
}

.prize-scratch-prize {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  color: #fff;
  background: linear-gradient(160deg, #0369a1 0%, #0f766e 100%);
}

.prize-scratch-cell.is-lose .prize-scratch-prize {
  background: linear-gradient(160deg, #475569 0%, #334155 100%);
  color: #cbd5e1;
}

.prize-scratch-prize-icon {
  font-size: 1.35rem;
  margin-bottom: 0.15rem;
}

.prize-scratch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}

.prize-scratch-canvas.is-disabled {
  pointer-events: none;
  cursor: default;
}

.prize-scratch-hint {
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.35;
}

.prize-scratch-stage.is-ready .prize-scratch-hint {
  color: #38bdf8;
  font-weight: 600;
}
