/* Roulette CSS */
.roulette-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(3, 7, 18, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.roulette-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.roulette-modal {
  width: 100%;
  max-width: 360px;
  background: linear-gradient(145deg, #0d1527, #070a13);
  border: 1.5px solid rgba(212, 175, 55, 0.5);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 1px 1px rgba(255, 255, 255, 0.15);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  position: relative;
}

.roulette-overlay.active .roulette-modal {
  transform: translateY(0);
}

.roulette-header {
  background: #090e1a;
  padding: 20px 16px 14px;
  text-align: center;
  position: relative;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.roulette-header .limited-event {
  color: #dfba53;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.roulette-header .divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.roulette-header .divider-line {
  width: 40px;
  height: 1px;
  background: linear-gradient(95deg, transparent, #dfba53, transparent);
}

.roulette-header .divider-diamond {
  width: 6px;
  height: 6px;
  background: #dfba53;
  transform: rotate(45deg);
}

.roulette-header .subtitle {
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.3px;
}

.roulette-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.8);
  font-size: 24px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
  z-index: 50;
}

.roulette-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.roulette-body {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 310px;
  background: #0b1120;
  position: relative;
  overflow: hidden;
}

/* Wheel Game Area */
.roulette-game-container {
  position: relative;
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.roulette-game-container.fade-out {
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;
  position: absolute;
}

.roulette-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 20px solid #dfba53;
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}

.roulette-wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  background: #090e1a;
}

.roulette-spin-btn {
  position: absolute;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dfba53, #aa8214);
  border: 4px solid #090e1a;
  color: #090e1a;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5), inset 0 2px 2px rgba(255, 255, 255, 0.4);
  transition: transform 0.15s, box-shadow 0.15s;
  user-select: none;
  line-height: 1.2;
}

.roulette-spin-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

.roulette-spin-btn.disabled {
  pointer-events: none;
  background: linear-gradient(135deg, #71717a, #52525b);
  color: #27272a;
}

/* Result Area */
.roulette-result-container {
  display: none;
  opacity: 0;
  transform: scale(0.9);
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: opacity 0.5s ease, transform 0.5s ease;
  width: 100%;
}

.roulette-result-container.active {
  display: flex;
  opacity: 1;
  transform: scale(1);
}

.roulette-prize-img {
  width: 100%;
  max-width: 270px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  margin-bottom: 18px;
}

.roulette-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 270px;
  padding: 14px 16px;
  background: linear-gradient(90deg, #10b981 0%, #059669 100%);
  color: #fff;
  font-weight: 800;
  font-size: 14.5px;
  text-decoration: none;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  animation: roulettePulse 1.8s infinite;
  transition: transform 0.2s, filter 0.2s;
  border: none;
  cursor: pointer;
  letter-spacing: -0.3px;
}

.roulette-cta-btn:active {
  transform: scale(0.97);
  filter: brightness(0.9);
}

.roulette-home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 270px;
  padding: 12px 16px;
  background: transparent;
  color: #9ca3af;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-top: 10px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  letter-spacing: -0.3px;
}

.roulette-home-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.roulette-home-btn:active {
  transform: scale(0.98);
}

/* Footer (Bottom options) */
.roulette-footer {
  display: flex;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #070a13;
}

.roulette-footer-btn {
  flex: 1;
  background: none;
  border: none;
  padding: 15px 12px;
  color: #9ca3af;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s;
  outline: none;
  text-align: center;
}

.roulette-footer-btn:first-child {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.roulette-footer-btn:active {
  background-color: rgba(255, 255, 255, 0.04);
  color: #fff;
}

/* Animations */
@keyframes roulettePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Confetti styling */
.confetti {
  position: absolute;
  width: 6px;
  height: 6px;
  pointer-events: none;
  opacity: 0.9;
  border-radius: 50%;
  animation: confettiFall 3s ease-out forwards;
  z-index: 20;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-20px) translateX(0) rotate(0deg);
    opacity: 1;
  }
  50% {
    opacity: 1;
  }
  100% {
    transform: translateY(350px) translateX(var(--scatter-x, 30px)) rotate(720deg);
    opacity: 0;
  }
}
