/* draw-roulette.css — Secret Draw roulette animation component
   Self-contained. Triggered via window.DrawRoulette.show(names, onComplete).
   v1 */

/* ── Overlay ── */
.dr-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 9500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.dr-overlay.dr-visible {
  opacity: 1;
}

/* ── Card container ── */
.dr-card {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 32px 28px 28px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 0 80px rgba(99, 102, 241, 0.25), 0 0 0 1px rgba(99, 102, 241, 0.15);
  position: relative;
  overflow: hidden;
}

/* Ambient glow pulse */
.dr-card::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
  animation: dr-glow-pulse 2s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes dr-glow-pulse {
  from { opacity: 0.4; transform: scale(0.95); }
  to   { opacity: 1;   transform: scale(1.05); }
}

/* ── Title ── */
.dr-title {
  font-size: 1rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 24px;
  position: relative;
}

/* ── Slot machine window ── */
.dr-slot-wrap {
  position: relative;
  height: 80px;
  overflow: hidden;
  border-radius: 12px;
  background: #020617;
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(99, 102, 241, 0.2);
  margin-bottom: 20px;
}

/* Top + bottom fade masks */
.dr-slot-wrap::before,
.dr-slot-wrap::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 28px;
  z-index: 2;
  pointer-events: none;
}
.dr-slot-wrap::before {
  top: 0;
  background: linear-gradient(to bottom, #020617 0%, transparent 100%);
}
.dr-slot-wrap::after {
  bottom: 0;
  background: linear-gradient(to top, #020617 0%, transparent 100%);
}

/* Centre highlight bar */
.dr-slot-bar {
  position: absolute;
  top: 50%;
  left: 8px; right: 8px;
  height: 44px;
  transform: translateY(-50%);
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.4);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
  z-index: 1;
  pointer-events: none;
}

/* The scrolling reel */
.dr-reel {
  display: flex;
  flex-direction: column;
  align-items: center;
  will-change: transform;
  transition: transform 0.1s linear;
}

.dr-reel-item {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 340px;
  padding: 0 16px;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}

/* ── Particle burst (on winner reveal) ── */
.dr-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

.dr-particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0;
  animation: dr-particle-fly 0.8s ease-out forwards;
}

@keyframes dr-particle-fly {
  0%   { opacity: 1; transform: translate(0, 0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(0.3); }
}

/* ── Winner reveal ── */
.dr-winner-wrap {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}
.dr-winner-wrap.dr-winner-visible {
  opacity: 1;
  transform: scale(1);
}

.dr-winner-name {
  font-size: 1.6rem;
  font-weight: 900;
  background: linear-gradient(135deg, #818cf8, #c084fc, #f472b6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
  line-height: 1.2;
  padding: 4px 8px;
  position: relative;
}

/* Shimmer sweep on winner */
.dr-winner-name::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: dr-shimmer 1.2s ease-in-out 0.3s 2;
  -webkit-background-clip: text;
  background-clip: text;
}

@keyframes dr-shimmer {
  0%   { background-position: -100% 0; }
  100% { background-position: 200% 0; }
}

/* ── Status / subtext ── */
.dr-status {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 20px;
  min-height: 18px;
  letter-spacing: 0.03em;
}

/* ── Progress dots (multi-draw) ── */
.dr-progress {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 20px;
  min-height: 10px;
}
.dr-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.3s ease, transform 0.3s ease;
}
.dr-dot.dr-dot-done {
  background: #818cf8;
  transform: scale(1.2);
}
.dr-dot.dr-dot-active {
  background: #c084fc;
  transform: scale(1.4);
  box-shadow: 0 0 8px rgba(192, 132, 252, 0.6);
  animation: dr-dot-pulse 0.6s ease-in-out infinite alternate;
}

@keyframes dr-dot-pulse {
  from { box-shadow: 0 0 4px rgba(192, 132, 252, 0.4); }
  to   { box-shadow: 0 0 12px rgba(192, 132, 252, 0.8); }
}

/* ── CTA button ── */
.dr-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  border: none;
  padding: 11px 28px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: opacity 0.2s ease, transform 0.15s ease;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
  display: none;
}
.dr-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.dr-btn:active {
  transform: translateY(0);
}
.dr-btn.dr-btn-visible {
  display: inline-block;
}

/* ── Skip link (small, top-right) ── */
.dr-skip {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.25);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.2s ease;
  letter-spacing: 0.04em;
}
.dr-skip:hover {
  color: rgba(255, 255, 255, 0.6);
}

/* ── Motion safety ── */
@media (prefers-reduced-motion: reduce) {
  .dr-overlay,
  .dr-reel,
  .dr-winner-wrap,
  .dr-card::before,
  .dr-particle,
  .dr-winner-name::after,
  .dr-dot {
    animation: none !important;
    transition: none !important;
  }
  .dr-overlay { opacity: 1; }
  .dr-winner-wrap { opacity: 1; transform: scale(1); }
}
