/* CoinWhales — Premium Wheel (Crypto Casino) */

.wheel-screen {
  --w-black: #030508;
  --w-blue: #0b1224;
  --w-blue-mid: #121f3d;
  --w-purple: #7c3aed;
  --w-purple-neon: #a855f7;
  --w-gold: #f5c451;
  --w-gold-dim: #b8860b;
  --w-text: #e8edf7;
  --w-muted: #8b9bb8;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(124, 58, 237, 0.22), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(59, 130, 246, 0.08), transparent),
    linear-gradient(180deg, #030508 0%, #0b1224 45%, #030508 100%);
  min-height: 100vh;
  animation: wheelFadeIn 0.35s ease;
  overflow-x: hidden;
  touch-action: pan-y;
}

@keyframes wheelFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.wheel-screen .sub-topbar.wheel-topbar {
  display: grid;
  grid-template-columns: 44px 1fr 58px;
  align-items: start;
  gap: 6px;
  margin-bottom: 10px;
  padding-top: 4px;
  padding-bottom: 6px;
  overflow: visible;
}

.wheel-topbar-back {
  justify-self: start;
}

.wheel-page-title {
  grid-column: 2;
  margin: 0;
  text-align: center;
  font-size: clamp(30px, 9vw, 42px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fff7e6 0%, #f5c451 42%, #d4a017 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 28px rgba(245, 196, 81, 0.4));
}

.wheel-topbar .wheel-shop-premium-btn {
  justify-self: end;
  grid-column: 3;
  margin-top: 4px;
}

.wheel-shop-premium-btn .cw-premium-icon-tile {
  animation: wheelShopTilePulse 2.4s ease-in-out infinite;
}

@keyframes wheelShopTilePulse {
  0%,
  100% {
    box-shadow: var(--cw-purple-glow, 0 0 14px rgba(168, 85, 247, 0.42));
  }
  50% {
    box-shadow:
      var(--cw-purple-glow-strong, 0 0 22px rgba(168, 85, 247, 0.5)),
      0 0 0 3px rgba(192, 132, 252, 0.35);
  }
}

/* legacy keyframes — kept for any cached refs */
@keyframes wheelShopBtnPulse {
  0%,
  100% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.06) inset,
      0 4px 16px rgba(124, 58, 237, 0.2),
      0 0 12px rgba(245, 196, 81, 0.2);
    border-color: rgba(245, 196, 81, 0.45);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.1) inset,
      0 6px 22px rgba(124, 58, 237, 0.35),
      0 0 22px rgba(245, 196, 81, 0.45);
    border-color: rgba(245, 196, 81, 0.85);
  }
}

.wheel-intro-head {
  text-align: center;
  padding: 0 12px 12px;
}

.wheel-premium-sub {
  margin: 0 auto;
  max-width: 340px;
  font-size: 14px;
  color: #cbd5e1;
  line-height: 1.55;
}

.wheel-luck-boost-banner {
  margin: 0 0 10px;
  padding: 10px 14px;
  border-radius: 14px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
  color: #fde68a;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(245, 196, 81, 0.2));
  border: 1px solid rgba(245, 196, 81, 0.45);
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.35);
  animation: wheelLuckPulse 2s ease-in-out infinite;
}

.wheel-luck-boost-banner.hidden {
  display: none;
}

.wheel-luck-boost-badge {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 4px 16px rgba(245, 196, 81, 0.45);
  pointer-events: none;
}

.wheel-luck-boost-badge.hidden {
  display: none;
}

.wheel-stage-wrap.is-luck-boost .wheel-stage-glow {
  opacity: 1;
  background: radial-gradient(
    circle at 50% 45%,
    rgba(245, 196, 81, 0.35) 0%,
    rgba(124, 58, 237, 0.2) 45%,
    transparent 70%
  );
}

.wheel-spin-btn.is-luck-boost {
  border-color: rgba(245, 196, 81, 0.85);
  box-shadow: 0 0 24px rgba(245, 196, 81, 0.35), 0 8px 24px rgba(0, 0, 0, 0.35);
}

@keyframes wheelLuckPulse {
  0%,
  100% {
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
  }
  50% {
    box-shadow: 0 0 22px rgba(245, 196, 81, 0.45);
  }
}

.wheel-spins-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 4px 16px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(18, 31, 61, 0.95), rgba(8, 12, 22, 0.98));
  border: 1px solid rgba(168, 85, 247, 0.35);
  box-shadow:
    0 0 30px rgba(124, 58, 237, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.wheel-spins-strip strong {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--w-gold);
  text-shadow: 0 0 20px rgba(245, 196, 81, 0.5);
}

.wheel-spins-strip span {
  font-size: 12px;
  color: var(--w-muted);
}

.wheel-shop-panel {
  margin: 0 0 14px;
  padding: 14px 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(18, 31, 61, 0.92), rgba(6, 10, 18, 0.98));
  border: 1px solid rgba(245, 196, 81, 0.28);
}

.wheel-shop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.wheel-shop-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--w-gold);
}

.wheel-shop-balance {
  font-size: 12px;
  color: var(--w-muted);
}

.wheel-shop-balance strong {
  color: #fde68a;
}

.wheel-shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.wheel-shop-pack {
  position: relative;
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 14px;
  padding: 12px 8px 10px;
  background: rgba(15, 22, 40, 0.9);
  color: var(--w-text);
  font-family: inherit;
  cursor: pointer;
  text-align: center;
}

.wheel-shop-pack:active {
  transform: scale(0.98);
}

.wheel-shop-pack-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(245, 196, 81, 0.25);
  color: var(--w-gold);
}

.wheel-shop-pack-spins {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: var(--w-gold);
  line-height: 1;
}

.wheel-shop-pack-label {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--w-muted);
}

.wheel-shop-pack-price {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #c4b5fd;
}

.wheel-stage-wrap {
  position: relative;
  margin: 0 auto 20px;
  width: min(100%, 360px);
  max-width: calc(100vw - 28px);
  padding: 8px 0 18px;
  overflow: hidden;
}

.wheel-stage-glow {
  position: absolute;
  inset: 10% 5%;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.35), transparent 65%);
  filter: blur(28px);
  pointer-events: none;
  z-index: 0;
}

.wheel-stage {
  position: relative;
  z-index: 1;
  perspective: 900px;
}

.wheel-pointer-fixed {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: 36px;
  height: 48px;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 16px rgba(245, 196, 81, 0.7));
  pointer-events: none;
}

.wheel-pointer-fixed::before {
  content: "";
  display: block;
  width: 0;
  height: 0;
  margin: 0 auto;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 32px solid var(--w-gold);
}

.wheel-pointer-fixed::after {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(145deg, #fde68a, #b45309);
  border: 2px solid #fff8e7;
  box-shadow: 0 0 12px rgba(245, 196, 81, 0.8);
}

.wheel-3d-mount {
  transform: rotateX(11deg);
  transform-style: preserve-3d;
}

@keyframes mysteryBoxBreathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

#wheelRotor {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.65));
  transform: rotate3d(0, 0, 1, 0deg);
  transition: none;
  animation: none;
}

#wheelRotor.is-idle {
  will-change: auto;
}

#wheelRotor.is-spinning {
  will-change: transform;
}

.wheel-mystery-teaser {
  margin: 14px 4px 12px;
  padding: 14px 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(59, 29, 110, 0.55), rgba(8, 12, 22, 0.98));
  border: 1px solid rgba(245, 196, 81, 0.45);
  box-shadow: 0 0 28px rgba(124, 58, 237, 0.25);
}

.wheel-mystery-teaser-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.wheel-mystery-teaser-img {
  width: 96px;
  height: auto;
  max-height: 74px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 20px rgba(245, 196, 81, 0.45));
}

.wheel-seg-icon-stroke {
  vector-effect: non-scaling-stroke;
}

#wheelRotor.is-idle .wheel-seg-gift .wheel-seg-mystery-pulse {
  animation: wheelMysteryPulse 1.5s ease-in-out infinite;
}

#wheelRotor.is-spinning .wheel-seg-gift .wheel-seg-mystery-pulse {
  animation: none;
}

@keyframes wheelMysteryPulse {
  0%,
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(245, 196, 81, 0.45));
  }
  50% {
    opacity: 0.92;
    filter: drop-shadow(0 0 16px rgba(245, 196, 81, 1));
  }
}

.wheel-seg-mystery-img {
  filter: drop-shadow(0 0 4px rgba(245, 196, 81, 0.4));
}

.wheel-mystery-teaser-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--w-gold);
}

.wheel-mystery-teaser-sub {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--w-muted);
  line-height: 1.45;
}

.wheel-mystery-teaser-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.wheel-mystery-teaser-chip {
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  color: var(--w-text);
  background: rgba(124, 58, 237, 0.25);
  border: 1px solid rgba(168, 85, 247, 0.4);
}

#wheelSvg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 50%;
}

.wheel-rim-glow {
  position: absolute;
  inset: -4%;
  border-radius: 50%;
  border: 2px solid rgba(245, 196, 81, 0.45);
  box-shadow:
    0 0 0 4px rgba(124, 58, 237, 0.25),
    0 0 40px rgba(168, 85, 247, 0.35),
    inset 0 0 30px rgba(245, 196, 81, 0.08);
  pointer-events: none;
  z-index: 2;
}

.wheel-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  margin: -32px 0 0 -32px;
  border-radius: 50%;
  z-index: 5;
  background: transparent;
  border: none;
  box-shadow: none;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.wheel-hub-coin {
  width: clamp(68px, 19vw, 88px);
  height: clamp(68px, 19vw, 88px);
  object-fit: contain;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 18px rgba(245, 196, 81, 0.35));
}

.wheel-inside-guide {
  margin: 0 4px 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(12, 20, 34, 0.92), rgba(8, 12, 22, 0.96));
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.wheel-inside-title {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--w-gold);
  font-weight: 800;
}

.wheel-inside-list {
  margin: 0;
  padding: 0 18px 0 0;
  color: var(--w-muted);
  font-size: 12px;
  line-height: 1.6;
}

.wheel-inside-list li + li {
  margin-top: 4px;
}

.wheel-inside-list strong {
  color: #e9eefc;
}

.wheel-spin-btn {
  display: block;
  width: 100%;
  max-width: 340px;
  margin: 0 auto 12px;
  padding: 16px 20px;
  border: none;
  border-radius: 14px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #0a0a0f;
  cursor: pointer;
  background: linear-gradient(180deg, #fde68a 0%, #f5c451 40%, #d4a017 100%);
  box-shadow:
    0 8px 28px rgba(245, 196, 81, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.15) inset,
    0 0 40px rgba(168, 85, 247, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s;
}

.wheel-spin-btn:not(:disabled):hover {
  box-shadow:
    0 10px 36px rgba(245, 196, 81, 0.5),
    0 0 50px rgba(168, 85, 247, 0.35);
}

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

.wheel-spin-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

.wheel-spin-btn.is-spinning {
  pointer-events: none;
  animation: wheelBtnPulse 1s ease infinite;
}

@keyframes wheelBtnPulse {
  0%,
  100% {
    box-shadow: 0 8px 28px rgba(245, 196, 81, 0.35);
  }
  50% {
    box-shadow: 0 8px 40px rgba(168, 85, 247, 0.45);
  }
}

.wheel-secondary-btn {
  display: block;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(168, 85, 247, 0.4);
  background: rgba(18, 31, 61, 0.6);
  color: #c4b5fd;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.wheel-status-text {
  margin: 12px 4px 0;
  text-align: center;
  font-size: 12px;
  color: var(--w-muted);
  min-height: 1.3em;
}

.wheel-rules-panel {
  margin-top: 20px;
  padding: 16px;
  border-radius: 16px;
  background: rgba(8, 12, 22, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.wheel-rules-panel h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--w-gold);
}

.wheel-rules-panel ul {
  margin: 0;
  padding: 0 18px 0 0;
  font-size: 12px;
  color: var(--w-muted);
  line-height: 1.65;
}

.wheel-odds-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}

.wheel-odds-item {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(18, 31, 61, 0.7);
  border: 1px solid rgba(168, 85, 247, 0.15);
  font-size: 11px;
  color: var(--w-text);
}

.wheel-odds-item span:last-child {
  color: var(--w-gold);
  font-weight: 700;
}

.wheel-history-compact {
  margin-top: 14px;
}

.wheel-history-compact h4 {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--w-muted);
}

.wheel-history-compact ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.wheel-history-compact li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  font-size: 11px;
  color: var(--w-muted);
}

.wheel-history-compact strong {
  color: var(--w-gold);
}

/* Confetti */
#wheelConfettiCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9000;
}

/* Prize modal */
.wheel-modal {
  position: fixed;
  inset: 0;
  z-index: 8500;
  display: grid;
  place-items: center;
  padding: 20px;
}

.wheel-modal.hidden {
  display: none;
}

.wheel-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 5, 8, 0.82);
  backdrop-filter: blur(8px);
}

.wheel-modal-card {
  position: relative;
  width: min(100%, 340px);
  padding: 28px 22px 22px;
  border-radius: 20px;
  text-align: center;
  background: linear-gradient(165deg, #1a1040 0%, #0b1224 50%, #030508 100%);
  border: 1px solid rgba(245, 196, 81, 0.45);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.7),
    0 0 60px rgba(168, 85, 247, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  animation: wheelModalPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes wheelModalPop {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.wheel-modal-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #0a0a0f;
  background: linear-gradient(90deg, #f5c451, #fde68a);
  margin-bottom: 14px;
}

.wheel-modal-prize {
  margin: 0;
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 30px rgba(245, 196, 81, 0.5);
}

.wheel-modal-cw {
  margin: 10px 0 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--w-gold);
}

.wheel-modal-note {
  margin: 12px 0 20px;
  font-size: 13px;
  color: var(--w-muted);
}

.wheel-modal-close {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  color: #0a0a0f;
  background: linear-gradient(180deg, #c4b5fd, #7c3aed);
}

.tile-wheel .tile-icon:not(.tile-icon--img) {
  background: linear-gradient(145deg, #7c3aed 0%, #4c1d95 50%, #f5c451 100%);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.45);
}

@media (max-width: 380px) {
  .wheel-shop-grid {
    grid-template-columns: 1fr 1fr;
  }

  .wheel-stage-wrap {
    width: min(100%, 330px);
    max-width: calc(100vw - 22px);
  }
}

/* Mystery Box modal */
.wheel-mystery-card {
  width: min(100%, 360px);
  max-height: min(88vh, 640px);
  overflow-y: auto;
}

.wheel-mystery-box-stage {
  display: grid;
  place-items: center;
  min-height: 100px;
  margin: 8px 0 12px;
}

.wheel-mystery-box {
  position: relative;
  display: grid;
  place-items: center;
  width: min(100%, 220px);
}

.wheel-mystery-box-img {
  display: block;
  width: 100%;
  max-width: 200px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 28px rgba(245, 196, 81, 0.5));
}

.wheel-mystery-box--idle .wheel-mystery-box-img {
  animation: mysteryBoxBreathe 2s ease-in-out infinite;
}

.wheel-mystery-box-open-label {
  position: absolute;
  bottom: -6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--w-gold);
  letter-spacing: 0.06em;
}

.wheel-mystery-box.is-open .wheel-mystery-box-img {
  animation: mysteryBoxPop 0.55s ease;
}

@keyframes mysteryBoxPop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.25);
  }
  100% {
    transform: scale(1);
  }
}

.wheel-mystery-intro {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--w-muted);
  line-height: 1.5;
}

.wheel-mystery-prize-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
  text-align: start;
}

.wheel-mystery-prize-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 22, 40, 0.85);
  border: 1px solid rgba(168, 85, 247, 0.25);
  font-size: 11px;
  color: var(--w-text);
}

.wheel-mystery-prize-item.is-won {
  border-color: rgba(245, 196, 81, 0.75);
  background: rgba(245, 196, 81, 0.12);
  box-shadow: 0 0 20px rgba(245, 196, 81, 0.25);
  font-weight: 800;
  color: var(--w-gold);
}

.wheel-mystery-prize-item .win-tag {
  font-size: 12px;
  color: var(--w-gold);
}

.wheel-mystery-result {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 800;
  color: var(--w-gold);
  line-height: 1.45;
}

.wheel-mystery-open-btn {
  margin-bottom: 0;
}
