* {
  box-sizing: border-box;
  user-select: none;
}

body {
  margin: 0;
  background: radial-gradient(circle at top, #0d1b2a, #000);
  font-family: system-ui;
  color: white;
  display: flex;
  justify-content: center;
}

.app {
  width: 420px;
  text-align: center;
  padding-top: 20px;
}

.title {
  font-size: 26px;
  margin-bottom: 25px;
}

.wheel-wrapper {
  position: relative;
  width: 300px;
  height: 300px;
  margin: 0 auto;
}

#wheel {
  width: 100%;
  height: 100%;
  transition: transform 4s cubic-bezier(0.15, 0.85, 0.25, 1);
}

.arrow {
  position: absolute;
  top: -18px;
  left: 50%;
  width: 42px;
  transform: translateX(-50%);
  z-index: 10;
}

#spinBtn {
  margin-top: 18px;
  padding: 12px 36px;
  font-size: 20px;
  font-weight: 900;
  border-radius: 40px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #ffb703, #fb8500);
}

#spinBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.result {
  margin-top: 18px;
  font-size: 18px;
  font-weight: 800;
}

.hidden {
  display: none;
}

@keyframes shake {
  0%   { transform: translateX(-50%) rotate(0deg); }
  25%  { transform: translateX(-50%) rotate(-4deg); }
  50%  { transform: translateX(-50%) rotate(4deg); }
  75%  { transform: translateX(-50%) rotate(-2deg); }
  100% { transform: translateX(-50%) rotate(0deg); }
}

.arrow.spin {
  animation: shake 0.2s ease-in-out infinite;
}

/* =========================
   UPGRADE EFFECT
========================= */
@keyframes upgradeFlash {
  0%   { box-shadow: 0 0 0 rgba(138,43,226,0); }
  50%  { box-shadow: 0 0 60px rgba(138,43,226,1); }
  100% { box-shadow: 0 0 0 rgba(138,43,226,0); }
}

.upgrade {
  animation: upgradeFlash 1s ease-out 2;
}

/* =========================
   JACKPOT EFFECT
========================= */
@keyframes jackpotGlow {
  0%   { box-shadow: 0 0 0 rgba(255,215,0,0); }
  50%  { box-shadow: 0 0 120px rgba(255,215,0,1); }
  100% { box-shadow: 0 0 0 rgba(255,215,0,0); }
}

.jackpot {
  animation: jackpotGlow 1.2s ease-out 3;
  color: gold;
}
/* =========================
   WHEEL TRANSITION EFFECTS
========================= */
#wheel {
  transition: transform 0.6s ease, opacity 0.6s ease;
  transform-origin: center center;
}

.wheel-fade-out {
  transform: scale(1.25);
  opacity: 0;
}

.wheel-fade-in {
  transform: scale(0.9);
  opacity: 0;
}

.wheel-visible {
  transform: scale(1);
  opacity: 1;
}

.wheel-special {
  filter: drop-shadow(0 0 18px rgba(138,43,226,0.9));
  animation: specialPulse 1.4s ease-in-out infinite;
}

@keyframes specialPulse {
  0%   { filter: drop-shadow(0 0 10px rgba(138,43,226,0.6)); }
  50%  { filter: drop-shadow(0 0 30px rgba(138,43,226,1)); }
  100% { filter: drop-shadow(0 0 10px rgba(138,43,226,0.6)); }
}

.wheel-jackpot {
  filter: drop-shadow(0 0 30px rgba(255,215,0,1));
  animation: jackpotPulse 1.8s ease-in-out infinite;
}

@keyframes jackpotPulse {
  0%   { filter: drop-shadow(0 0 18px rgba(255,215,0,0.7)); }
  50%  { filter: drop-shadow(0 0 55px rgba(255,215,0,1)); }
  100% { filter: drop-shadow(0 0 18px rgba(255,215,0,0.7)); }
}

.wheel-wrapper {
  position: relative;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.wheel-fade-out {
  opacity: 0;
  transform: scale(0.92);
}

.wheel-fade-in {
  opacity: 1;
  transform: scale(1);
}

@keyframes tierPop {
  0%   { transform: scale(0.85); }
  60%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}

.wheel-pop {
  animation: tierPop 0.45s ease-out;
}
