/* --- Base Styles --- */
body {
  background: radial-gradient(ellipse at top right, #321263 0%, #180035 70%);
  margin: 0;
  min-height: 100vh;
  font-family: 'Orbitron', 'Inter', Arial, sans-serif;
  color: #FFD700;
  box-shadow: inset 0 0 200px 20px #7542e766, 0 0 0 0 #fff;
}

/* --- Layout Containers --- */
.diwali-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 890px;
  margin: 0 auto;
  padding: 0 6vw;
}

.wheel-layout {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: center;
  gap: 32px;
}

.wheel-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 430px;
  min-width: 290px;
  max-width: 95vw;
}

@media (max-width: 900px) {
  .diwali-container {
    max-width: 99vw;
    padding: 0 1vw;
  }
  .wheel-layout {
    flex-direction: column;
    align-items: center;
    gap: 14px;
  }
  .wheel-container {
    width: 98vw;
    min-width: 0;
  }
}

/* --- Header & Titles --- */
.diwali-header, .diwali-title {
  text-align: center;
  color: #FFD700;
  font-size: 2.3rem;
  font-family: 'Orbitron', Arial, sans-serif;
  font-weight: 900;
  letter-spacing: 2px;
  margin-top: 34px;
  margin-bottom: 10px;
  text-shadow: 0 3px 20px #FFD70099, 0 1px 0 #522e96cc;
  position: relative;
}

.diwali-title .diya-icon {
  font-size: 2rem;
  vertical-align: middle;
  filter: drop-shadow(0 0 8px #ffc700);
  margin: 0 6px;
}

.diwali-subtitle {
  text-align: center;
  color: #ffe4a6;
  font-size: 1.35rem;
  font-weight: 500;
  margin-bottom: 36px;
  margin-top: 2px;
  text-shadow: 0 2px 8px #FFD70066;
}

/* --- Glow effect for Diwali --- */
.glow-effect {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle, #ffd70022 0%, transparent 60%);
  filter: blur(12px) brightness(1.15);
}

/* --- Wheel Section --- */
#wheelCanvas {
  display: block;
  margin: 24px auto;
  background: radial-gradient(ellipse at center, #352086 60%, #120025 100%);
  border-radius: 50%;
  border: 5px solid #ffd700dd;
  box-shadow: 0 0 72px 0 #ffe066, 0 0 0 4px #25114A;
  z-index: 2;
  max-width: 98vw;
  max-height: 98vw;
}

/* --- Wheel Text --- */
.winwheel-canvas-text,
#wheelCanvas text,
.winwheel-label {
  font-family: 'Orbitron', Arial, sans-serif !important;
  font-weight: 900 !important;
  font-size: 15px !important;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  fill: #fff7c7 !important;
}

/* --- Wheel Pointer --- */
.wheel-pointer {
  text-align: center;
  font-size: 3.1rem;
  color: #ffd700;
  margin-bottom: -16px;
  margin-top: 12px;
  filter: drop-shadow(0 0 8px #FFD70070) drop-shadow(0 0 18px #ffd70044);
  font-family: 'Orbitron',Arial;
}

/* --- Spin Buttons --- */
.spin-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
}

#readySpinBtn, .spin-btn {
  display: block;
  margin: 18px auto;
  padding: 18px 55px;
  font-size: 1.22rem;
  font-family: 'Orbitron', Arial, sans-serif;
  font-weight: bold;
  background: linear-gradient(90deg, #ffd700 0%, #f4b400 100%);
  color: #320d80;
  border: none;
  border-radius: 34px;
  cursor: pointer;
  box-shadow: 0 7px 40px #FFD70055;
  outline: none;
  letter-spacing: 1px;
  position: relative;
  transition: background .2s, box-shadow .2s, opacity .2s;
  text-align: center;
}

.spin-btn.locked,
.spin-btn.cooldown {
  background: repeating-linear-gradient(90deg, #FFD700 0 18px, #fae46c 18px 36px);
  color: #aaa8ab;
  opacity: 0.85;
}

.spin-btn.unlock-btn {
  background: linear-gradient(90deg, #f8b400 0%, #fffaac 100%);
  color: #9c4b00;
  border: 2px solid #ffd70088;
  box-shadow: 0 5px 24px #ffd70044;
}

.spin-btn.login-required {
  background: #6441a5;
  color: #fff7c7;
  border: 2px solid #ffd70055;
  box-shadow: 0 5px 22px #44307a55;
}

.spin-btn.ready,
#readySpinBtn {
  background: linear-gradient(90deg, #ffd700 0%, #fdc20b 100%);
  color: #320d80;
  animation: spinPulse 1.4s infinite alternate;
}

@keyframes spinPulse {
  0% { box-shadow: 0 3px 20px #ffd70050; }
  100% { box-shadow: 0 7px 80px #ffd70088; }
}

.spin-btn i {
  margin-right: 10px;
}

.spin-btn:disabled {
  background: #d8d8d8;
  color: #b3b3b3;
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
}

/* --- Cooldown Timer --- */
.cooldown-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg,#ffd70033 0%,#ffd70055 100%);
  color: #ffd700;
  font-size: 1.1rem;
  font-family: 'Orbitron', Arial, sans-serif;
  border-radius: 14px;
  box-shadow: 0 2px 10px #ffd70022;
  margin: 12px 0;
  padding: 7px 22px 7px 12px;
  font-weight: bold;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.cooldown-timer.active, .cooldown-timer[style*="display: block"], .cooldown-timer[style*="display: inline-flex"] {
  opacity: 1;
  pointer-events: auto;
}

/* --- Lux Character (optional, placeholder) --- */
.lux-character img {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  box-shadow: 0 0 16px #f69e6c88, 0 2px 8px #FFD70066;
  background: #FFF7ED;
  object-fit: cover;
  display:block;
  margin: 0 auto 8px auto;
}

/* --- Info Cards --- */
.info-cards {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 44px;
  justify-content: center;
  align-items: flex-start;
}

.info-card {
  background: linear-gradient(95deg, #482da2 0%, #25114A 98%);
  border-radius: 18px;
  padding: 18px 26px;
  color: #FFD700;
  font-family: 'Inter', Arial, sans-serif;
  text-align: center;
  box-shadow: 0 2px 20px #FFD70022;
  border: 2px solid #FFD70033;
}
.info-title {
  font-size: 1.05rem;
  font-weight: bold;
  margin: 7px 0 3px 0;
}
.info-text {
  font-size: 0.95rem;
  color: #ffe4a6;
  margin: 0 0 4px 0;
}

/* --- Glowing Gift Button (Top Right) --- */
.reward-gift-btn {
  position: fixed;
  top: 22px;
  right: 28px;
  z-index: 2222;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(115deg,#f9d423 60%,#fc913a 100%);
  color: #854c00;
  box-shadow: 0 0 24px 8px #ffd700a5, 0 3px 20px #ffd70099;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.55rem;
  cursor: pointer;
  transition: box-shadow .25s, background .22s;
  animation: giftPulse 1.4s infinite alternate;
}
.reward-gift-btn:hover {
  background: linear-gradient(135deg, #ffd700 70%, #fc913a 100%);
  box-shadow: 0 0 42px 10px #ffd700ee, 0 1px 10px #ffea7ea5;
}
@keyframes giftPulse {
  0% { box-shadow: 0 0 12px #ffd70077, 0 0 22px #ffeb3b55; }
  100% { box-shadow: 0 0 35px 18px #ffd700dd, 0 0 56px #ffc40099; }
}
.reward-gift-btn i { pointer-events: none; }

@media (max-width: 700px) {
  .reward-gift-btn {
    top: 15px;
    right: 12px;
    width: 42px;
    height: 42px;
    font-size: 1.55rem;
  }
}

/* --- Reward Modal (Box) --- */
.reward-modal {
  position: fixed;
  z-index: 30000;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}
.reward-modal-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(22,0,36,0.93);
  backdrop-filter: blur(4px);
  z-index: 0;
}
.reward-modal-content {
  position: relative;
  background: linear-gradient(120deg, #25114a 70%, #ffd7000b 100%);
  border-radius: 27px;
  box-shadow: 0 6px 40px #ffd70029, 0 0 0 2px #ffd70033;
  padding: 42px 44px 34px 44px;
  color: #FFD700;
  max-width: 660px;
  min-width: 295px;
  max-height: 86vh;
  overflow-y: auto;
  margin: 0 auto;
  animation: fadein 0.5s;
  z-index: 3;
}
.reward-modal-close {
  position: absolute;
  top: 18px; right: 18px;
  border: none;
  background: none;
  color: #ffd700cc;
  font-size: 2.1rem;
  cursor: pointer;
  z-index: 4;
  outline: none;
  transition: color .2s;
}
.reward-modal-close:hover { color: #fffc; background: #ffd70033; border-radius: 100px; }
.reward-featured-main {
  background: linear-gradient(120deg, #ffd70044 0%,#ffd70000 100%);
  border-radius: 18px;
  box-shadow: 0 0 32px #ffd70070;
  margin-bottom: 22px;
  padding: 12px 14px 14px 14px;
  text-align: center;
  position: relative;
}
.reward-feature-title {
  color: #fffad6;
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 1.1px;
  margin-bottom: 7px;
  text-shadow: 0 2px 20px #ffd700cc, 0 1px 0 #522e96cc;
}
.reward-feature-grid {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}
.reward-feature-item.glow-prize {
  background: linear-gradient(92deg, #fff8e6c1 10%, #fff176b9 80%);
  color: #c77f04;
  font-family: 'Orbitron', Arial, sans-serif;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 16px;
  box-shadow: 0 0 24px #ffd700cc, 0 0 7px #ffeb3b44;
  padding: 10px 26px;
  margin: 0 5px;
  letter-spacing: 1px;
  text-shadow: 0 2px 13px #ffd70055, 0 0px 0 #7e4301;
  animation: mainPrizeGlow 1.7s infinite alternate;
}
@keyframes mainPrizeGlow {
  0% { box-shadow: 0 0 12px 2px #ffd700a6, 0 2px 10px #fffada77;}
  100% { box-shadow: 0 0 34px 10px #ffd700ee, 0 1px 18px #fffec477;}
}
/* RARITY LIST SECTION */
.reward-all-section {
  margin: 22px 0 2px 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.reward-category {
  padding: 14px 18px 12px 18px;
  border-radius: 13px;
  box-shadow: 0 0 11px #ffd70013;
  background: linear-gradient(96deg, #2a105c8a 64%, #ffefc100 110%);
  border-left: 4px solid #ffd700cc;
}
.reward-category-title {
  font-size: 1.15rem;
  font-family: 'Orbitron', Arial, sans-serif;
  color: #FFF7C7;
  font-weight: 700;
  letter-spacing: 1.3px;
  margin-bottom: 7px;
  text-shadow: 0 1px 7px #ffd70044;
}

.reward-category.epic   { border-left-color: #aa59ea; }
.reward-category.legendary { border-left-color: #ffe447; }
.reward-category.rare   { border-left-color: #4eb9e2; }
.reward-category.uncommon { border-left-color: #4be076; }
.reward-category.common { border-left-color: #cccccc; }

.reward-list {
  color: #ffe4a6;
  font-family: 'Inter', Arial, sans-serif;
  font-size: 1.01rem;
  font-weight: 500;
  line-height: 1.6;
  word-break: break-word;
}
@media (max-width: 600px) {
  .reward-modal-content {
    max-width: 95vw;
    padding: 16px 4vw 22px 4vw;
  }
  .reward-feature-grid {
    flex-direction: column;
    gap: 12px;
  }
  .reward-feature-item.glow-prize {
    padding: 10px 9vw;
    font-size: 0.97rem;
  }
  .reward-category-title { font-size: 1.01rem; }
}

/* --- Prize Popup (unchanged) --- */
.prize-popup {
  position: fixed;
  z-index: 20000;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.popup-overlay {
  position: absolute;
  top:0; left:0; right:0; bottom:0;
  background:rgba(24,0,53,.85);
  backdrop-filter: blur(7px);
  pointer-events: auto;
}
.popup-content {
  position: relative;
  background: linear-gradient(110deg,#25114a 60%,#ffd70010 100%);
  border-radius: 28px;
  box-shadow:0 7px 60px #ffd70029;
  color: #FFD700;
  padding: 34px 34px 22px 34px;
  text-align:center;
  min-width: 290px; max-width: 95vw;
  min-height: 280px;
  pointer-events: auto;
  border: 2px solid #ffd70099;
  z-index: 2;
  animation: fadein 0.55s;
}
.popup-fireworks {
  min-height: 30px; margin-bottom: 10px;
}
.popup-close {
  position: absolute; top: 16px; right: 19px;
  font-size:2.1rem; color:#ffd700ee;
  background:none;border:none;
  cursor:pointer; z-index:3;line-height:1;
  transition: color .2s;
}
.popup-close:hover { color:#fff; background:#ffd70033; border-radius:50%; }
.popup-header {
  margin-bottom: 0.75em;
}
.popup-title {
  font-size:1.3rem; font-weight:900;
  color:#ffeec7; letter-spacing:2px;
  text-shadow:0 2px 12px #ffd70055;
}
.popup-icon { font-size:2.7rem; margin-bottom:8px; }
.popup-rarity { margin-bottom:10px; }
.rarity-badge {
  background:linear-gradient(90deg, #ffd700aa 0%,#fbe64c 100%);
  color:#8F7922; box-shadow:0 1px 12px #FFD70044;
  border-radius:20px; padding:3px 16px;
  font-weight:700; font-size:1.12rem;
  letter-spacing:1px;
}
.prize-emoji {
  font-size:2.3rem;margin-bottom:0.2em;
}
.prize-name {
  margin: 2px auto 9px auto;
  color: #fff6c7; font-weight:800; font-size:1.17rem;
}
.prize-description {
  font-size:.97rem;color:#fde384;
  margin-bottom:1.07em;margin-top:.65em;
}
.popup-btn {
  background:linear-gradient(90deg,#ffd700 60%,#f4b400 100%);
  color:#320d80; border:none;border-radius:30px;
  font-family:'Orbitron',Arial;
  font-size:1.1rem;font-weight:700;
  padding:14px 32px;cursor:pointer;
  margin-top:14px;box-shadow:0 2px 20px #FFD70029;
  transition: background .15s;
}
.popup-btn i { margin-right:7px; }
.popup-btn:hover { background:linear-gradient(90deg,#f4b400 0,#ffd700 100%); color:#240076; }

/* --- Loading Overlay --- */
.loading-overlay {
  position: fixed;
  z-index: 8888;
  inset: 0;
  background: rgba(24,0,53,0.91);
  backdrop-filter: blur(7px);
  animation: fadein 0.6s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.loading-content {
  text-align: center;
  padding: 36px 28px;
  background: #25114Aee;
  border-radius: 20px;
  box-shadow: 0 1px 32px #ffd70044, 0 0 0 1px #ffd700cc;
  color: #ffd700;
}
.loading-logo {
  font-size: 2.7rem;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 13px #ffd700dd);
}
.loading-text {
  font-size: 1.3rem;
  margin-bottom: 18px;
  font-weight: bold;
}
.loading-bar {
  width: 144px;
  height: 11px;
  background: linear-gradient(90deg,#ffd70026 0%,#ffd70080 100%);
  border-radius: 10px;
  overflow: hidden;
  margin: 12px auto 0 auto;
  box-shadow: 0 0 7px #ffd70088;
}
.loading-progress {
  width: 70%; height: 100%;
  background: linear-gradient(90deg,#ffd700 0%, #ffea6c 100%);
  border-radius: 15px;
  animation: loadingbar 1.7s cubic-bezier(.85,.1,.19,.93) infinite alternate;
}
@keyframes loadingbar {
  0% { width: 30%; }
  85% { width: 97%; }
  100% { width: 56%; }
}
@keyframes fadein {
  from { opacity:0; }
  to   { opacity:1; }
}