/* =========================================================
   LUCKY WHEEL COMPONENT STYLES
   Aesthetic: Dark Futuristic / Crimson Red & Gold Gaming Theme
   ========================================================= */

@keyframes wheelFabPulse {
  0%, 100% {
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 6px 22px rgba(220, 38, 38, 0.7);
    transform: scale(1.04);
  }
}

@keyframes wheelSpinInterval {
  0% {
    transform: rotate(0deg);
  }
  16% {
    transform: rotate(360deg);
  }
  21% {
    transform: rotate(346deg);
  }
  26% {
    transform: rotate(360deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes spinIconRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes rewardBadgeGlow {
  0%, 100% { text-shadow: 0 0 15px rgba(220, 38, 38, 0.7); }
  50% { text-shadow: 0 0 25px rgba(234, 179, 8, 0.9), 0 0 40px rgba(220, 38, 38, 0.9); }
}

@keyframes rewardCardPop {
  0% { transform: scale(0.85); opacity: 0; }
  70% { transform: scale(1.03); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* Floating Action Button */
.lucky-wheel-fab {
  position: fixed;
  bottom: 160px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dc2626, #991b1b);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9998;
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: wheelFabPulse 3s infinite ease-in-out;
  user-select: none;
}

.lucky-wheel-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(220, 38, 38, 0.6);
}

.lucky-wheel-svg-icon {
  width: 36px;
  height: 36px;
  display: block;
  overflow: visible;
}

.wheel-icon-disc {
  transform-origin: 32px 32px;
  animation: wheelSpinInterval 4.5s cubic-bezier(0.25, 1, 0.5, 1) infinite;
}

.lucky-wheel-fab:hover .wheel-icon-disc {
  animation: spinIconRotate 0.8s linear infinite;
}

/* Tooltip Badge */
.lucky-wheel-tooltip {
  position: absolute;
  right: 72px;
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  background: #0d0d0d;
  color: #fff;
  border: 1px solid rgba(255, 215, 0, 0.4);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: all 0.25s ease;
  box-shadow: 0 4px 15px rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  gap: 6px;
}

.lucky-wheel-tooltip::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border-width: 6px 0 6px 6px;
  border-style: solid;
  border-color: transparent transparent transparent #0d0d0d;
}

.lucky-wheel-fab:hover .lucky-wheel-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Modal Overlay */
.lucky-wheel-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(8, 8, 8, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  font-family: 'Manrope', 'Inter', -apple-system, sans-serif;
  padding: 16px;
  box-sizing: border-box;
}

.lucky-wheel-overlay.active {
  display: flex;
  opacity: 1;
  pointer-events: all;
}

/* Main Modal Card */
.lucky-wheel-card {
  position: relative;
  background: #0d0d0d;
  border: 1px solid #282828;
  border-radius: 28px;
  width: 100%;
  max-width: 620px;
  max-height: 94vh;
  overflow-y: auto;
  box-shadow: 0 0 70px rgba(191, 0, 0, 0.3), 0 25px 60px rgba(0, 0, 0, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 34px 28px;
  transform: scale(0.92) translateY(15px);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

.lucky-wheel-overlay.active .lucky-wheel-card {
  transform: scale(1) translateY(0);
}

/* Modal Background Glow Accents */
.lucky-wheel-glow-top {
  position: absolute;
  top: -90px;
  left: 50%;
  transform: translateX(-50%);
  width: 400px;
  height: 220px;
  background: radial-gradient(circle, rgba(191,0,0,0.4) 0%, rgba(234,179,8,0.18) 50%, transparent 70%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
}

/* Close Button */
.lucky-wheel-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #888;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 20;
}

.lucky-wheel-close:hover {
  background: rgba(191, 0, 0, 0.25);
  border-color: #BF0000;
  color: #fff;
}

/* Header */
.lucky-wheel-header {
  position: relative;
  z-index: 1;
  text-align: center;
  margin-bottom: 16px;
}

.lucky-wheel-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  background: rgba(191, 0, 0, 0.15);
  border: 1px solid rgba(191, 0, 0, 0.4);
  border-radius: 9999px;
  color: #ff4d4d;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: 8px;
}

.lucky-wheel-title {
  color: #ffffff;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0;
  line-height: 1.2;
}

.lucky-wheel-title span {
  background: linear-gradient(135deg, #ffffff 30%, #BF0000 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lucky-wheel-subtitle {
  color: #888888;
  font-size: 14px;
  margin-top: 6px;
}

/* Wheel Canvas Wrapper */
.lucky-wheel-stage {
  position: relative;
  width: 440px;
  height: 440px;
  max-width: 82vw;
  max-height: 54vh;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 14px 0 22px;
  z-index: 1;
}

.lucky-wheel-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 45px rgba(0,0,0,0.85), 0 0 25px rgba(191, 0, 0, 0.35);
  display: block;
}

/* Outer Glowing Ring */
.lucky-wheel-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 4px solid #BF0000;
  box-shadow: inset 0 0 20px rgba(191, 0, 0, 0.6), 0 0 30px rgba(220, 38, 38, 0.6), 0 0 60px rgba(191, 0, 0, 0.3);
  pointer-events: none;
}

/* Pointer Marker */
.lucky-wheel-pointer {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 42px;
  height: 52px;
  z-index: 20;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,0.9)) drop-shadow(0 0 12px rgba(255, 215, 0, 0.9));
  pointer-events: none;
  transition: transform 0.1s ease;
}

.lucky-wheel-pointer.tick {
  transform: translateX(-50%) scale(1.2) rotate(-8deg);
}

/* Center Hub / Spin Button */
.lucky-wheel-center-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ef4444 0%, #dc2626 40%, #991b1b 80%, #500724 100%);
  border: 4px solid #ffd700;
  box-shadow: 0 0 30px rgba(220, 38, 38, 0.8), 0 0 12px rgba(255, 215, 0, 0.6), inset 0 2px 5px rgba(255, 255, 255, 0.6), inset 0 -4px 8px rgba(0, 0, 0, 0.7);
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s;
  user-select: none;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.lucky-wheel-center-btn:hover:not(:disabled) {
  transform: translate(-50%, -50%) scale(1.08);
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.95), 0 0 25px rgba(220, 38, 38, 0.95), inset 0 2px 6px rgba(255, 255, 255, 0.8);
  border-color: #ffffff;
}

.lucky-wheel-center-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

@media (max-width: 640px) {
  .lucky-wheel-card {
    max-width: 95vw;
    padding: 24px 16px;
    border-radius: 20px;
  }
  .lucky-wheel-title {
    font-size: 24px;
  }
  .lucky-wheel-subtitle {
    font-size: 12px;
  }
  .lucky-wheel-stage {
    width: 300px;
    height: 300px;
    margin: 10px 0 18px;
  }
  .lucky-wheel-center-btn {
    width: 76px;
    height: 76px;
    font-size: 13px;
    border-width: 3px;
  }
  .lucky-wheel-pointer {
    top: -12px;
    width: 32px;
    height: 40px;
  }
}

/* Cooldown Banner */
.lucky-wheel-cooldown-bar {
  width: 100%;
  background: rgba(20, 20, 20, 0.9);
  border: 1px solid #2e2e2e;
  border-radius: 14px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 1;
}

.lucky-wheel-timer-text {
  font-size: 12px;
  color: #aaa;
  font-weight: 600;
}

.lucky-wheel-timer-value {
  font-family: monospace;
  color: #ffd700;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

/* Reward Presentation View */
.lucky-wheel-reward-view {
  display: none;
  width: 100%;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 2;
  animation: rewardCardPop 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.lucky-wheel-reward-view.active {
  display: flex;
}

.lucky-wheel-prize-tag {
  font-size: 42px;
  font-weight: 900;
  color: #BF0000;
  line-height: 1;
  margin: 10px 0;
  animation: rewardBadgeGlow 2s infinite ease-in-out;
}

.lucky-wheel-coupon-box {
  width: 100%;
  background: #060606;
  border: 1px solid #333;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 18px;
}

.lucky-wheel-coupon-code {
  font-family: monospace;
  font-size: 16px;
  font-weight: 800;
  color: #ffd700;
  letter-spacing: 0.08em;
  word-break: break-all;
}

.lucky-wheel-copy-btn {
  background: #BF0000;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.lucky-wheel-copy-btn:hover {
  background: #dc2626;
  box-shadow: 0 0 15px rgba(220, 38, 38, 0.5);
}

.lucky-wheel-copy-btn.copied {
  background: #22c55e;
}

/* Instructions Stepper */
.lucky-wheel-instructions {
  width: 100%;
  background: rgba(25, 25, 25, 0.6);
  border: 1px solid #262626;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 18px;
  text-align: left;
}

.lucky-wheel-instructions-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #aaa;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lucky-wheel-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lucky-wheel-steps li {
  font-size: 12px;
  color: #ddd;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.lucky-wheel-step-num {
  background: #BF0000;
  color: #fff;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Action Buttons */
.lucky-wheel-discord-btn {
  width: 100%;
  background: #5865F2;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none !important;
  box-shadow: 0 4px 20px rgba(88, 101, 242, 0.4);
  transition: all 0.25s ease;
  cursor: pointer;
}

.lucky-wheel-discord-btn:hover {
  background: #4752c4;
  box-shadow: 0 6px 25px rgba(88, 101, 242, 0.6);
  transform: translateY(-1px);
  color: #fff !important;
}

.lucky-wheel-discord-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
