body {
  background: linear-gradient(to bottom, #181c2a, #232c43);
}

/* Color classes */
.text-yellow-400 {
  color: #facc15;
}
.text-purple-400 {
  color: #a78bfa;
}
.text-blue-400 {
  color: #60a5fa;
}

.border-yellow-400 {
  border-color: #facc15;
}
.border-purple-400 {
  border-color: #a78bfa;
}
.border-blue-400 {
  border-color: #60a5fa;
}

/* Loader animation */
.loader {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 4px solid #fff;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

/* Open button styling */
.open-btn {
  background: linear-gradient(90deg, #4338ca 0%, #8b5cf6 100%);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}
.open-btn:hover {
  background: linear-gradient(90deg, #4f46e5 0%, #a78bfa 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.3);
}

/* CSGO-style case opening display */
.case-container {
  position: relative;
  width: 100%;
  background: rgba(26, 31, 48, 0.6);
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.case-indicator {
  position: absolute;
  top: 50%;
  left: 50%; /* Back to center - we'll adjust the animation instead */
  transform: translate(-50%, -50%); /* Center precisely */
  width: 6px;
  height: 100%;
  background: #facc15;
  box-shadow:
    0 0 10px #facc15,
    0 0 15px rgba(255, 255, 255, 0.5);
  z-index: 3;
  animation: indicator-pulse 1.5s ease-in-out 10s infinite alternate;
}

@keyframes indicator-pulse {
  0% {
    opacity: 0.6;
    box-shadow:
      0 0 10px #facc15,
      0 0 15px rgba(255, 255, 255, 0.3);
  }
  100% {
    opacity: 1;
    box-shadow:
      0 0 15px #facc15,
      0 0 20px rgba(255, 255, 255, 0.7);
  }
}

.case-items-container {
  position: relative;
  z-index: 1;
  padding: 10px 5px;
  margin: 0 auto;
  width: 100%;
  height: 150px; /* Fixed height for the horizontal row */
  overflow: hidden; /* Hide scrollbar */
  display: flex;
  justify-content: center; /* Center the items container */
  align-items: center;
}

.case-items {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  height: 100%;
  width: 100%;
  animation: slide-in 10s cubic-bezier(0.33, 0.9, 0.3, 1) forwards;
  transform: translateX(4500px);
  position: relative;
}

@keyframes slide-in {
  0% {
    transform: translateX(4500px);
  }
  100% {
    transform: translateX(-37.5px);
  }
}

.case-item {
  transition: all 0.2s ease;
  padding: 2px;
  animation: item-flash 0.3s ease-out forwards;
  animation-play-state: paused;
  width: 69px;
  flex-shrink: 0;
}

@keyframes item-flash {
  0% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.8);
  }
  100% {
    filter: brightness(1.2);
  }
}

.case-item-inner {
  background: #232c43;
  border: 2px solid #2d3748;
  border-radius: 8px;
  padding: 10px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.case-item-won {
  z-index: 2;
  animation: highlight-winner 1s ease-out 10s forwards;
}

.winning-prize {
  border: 2px solid transparent;
  transition: all 0.5s ease;
}

.winning-prize.highlight {
  border-color: #fff !important;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.6) !important;
}

/* Specific ID for the winning item to ensure it's visible */
#winning-item {
  z-index: 5; /* Higher than indicator */
}

@keyframes highlight-winner {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  10% {
    transform: scale(1.1);
    filter: brightness(1.5);
  }
  20% {
    transform: scale(1.05);
    filter: brightness(1.3);
  }
  30% {
    transform: scale(1.1);
    filter: brightness(1.5);
  }
  40% {
    transform: scale(1.05);
    filter: brightness(1.3);
  }
  50% {
    transform: scale(1.1);
    filter: brightness(1.5);
  }
  60% {
    transform: scale(1.05);
    filter: brightness(1.3);
  }
  70% {
    transform: scale(1.1);
    filter: brightness(1.5);
  }
  80% {
    transform: scale(1.05);
    filter: brightness(1.3);
  }
  90% {
    transform: scale(1.1);
    filter: brightness(1.5);
  }
  100% {
    transform: scale(1.05);
    filter: brightness(1.3);
  }
}

.amount {
  font-size: 1rem;
  font-weight: bold;
  margin-bottom: 4px;
}

.rarity {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Prize animation */
.prize-reel {
  animation: slide-prizes 10s cubic-bezier(0.05, 0.82, 0.17, 1) forwards;
}

@keyframes slide-prizes {
  0% {
    transform: translateX(800px);
  }
  85% {
    transform: translateX(-120px); /* Small overshoot */
  }
  92% {
    transform: translateX(-90px); /* Bounce back */
  }
  100% {
    transform: translateX(-100px); /* Final position centered */
  }
}

.animate-item-flash {
  animation: item-flash 0.5s ease-out alternate infinite;
}

.highlight {
  animation: highlight-winner 1s ease-out forwards;
}

/* Reward rarity classes */
.text-common {
  color: #ffffff;
}

.text-uncommon {
  color: #4ade80;
}

.text-rare {
  color: #60a5fa;
}

.text-epic {
  color: #a78bfa;
}

.text-legendary {
  color: #facc15;
}

.text-mythic {
  color: #f87171;
}

.text-emerald {
  color: #10b981;
}

.text-accent-red {
  color: #ef4444;
}

.animation-fade {
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.5s ease-out,
    transform 0.5s ease-out;
  transition-delay: 0.5s;
  pointer-events: none; /* Prevent clicks when invisible */
}

.animation-fade.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto; /* Enable clicks when visible */
}
