/* ================== PRIZE GRID (BigBerm Theme) ================== */
.prize-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.prize-card {
  border-radius: 16px;
  background: var(--bb-bg-card);
  border: 2px solid var(--bb-border);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.prize-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--bb-orange), var(--bb-orange-light), var(--bb-red));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.prize-card:hover {
  border-color: var(--bb-border-orange);
  box-shadow: 0 0 25px var(--bb-glow-orange);
  transform: translateY(-4px);
}

.prize-card:hover::before {
  opacity: 1;
}

.prize-card img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px var(--bb-glow-orange));
  transition: transform 0.3s ease;
}

.prize-card:hover img {
  transform: scale(1.15);
}

.prize-card-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--bb-text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* Rarity Border Colors - BigBerm Theme */
.prize-card[data-rarity="legendary"] {
  border-color: #fbbf24;
}
.prize-card[data-rarity="legendary"] .prize-card-name {
  color: #fbbf24;
}
.prize-card[data-rarity="legendary"]::before {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.prize-card[data-rarity="epic"] {
  border-color: var(--bb-orange);
}
.prize-card[data-rarity="epic"] .prize-card-name {
  color: var(--bb-orange);
}

.prize-card[data-rarity="rare"] {
  border-color: #3b82f6;
}
.prize-card[data-rarity="rare"] .prize-card-name {
  color: #3b82f6;
}

.prize-card[data-rarity="common"] {
  border-color: var(--bb-text-muted);
}
.prize-card[data-rarity="common"] .prize-card-name {
  color: var(--bb-text-muted);
}

/* ================== WINNERS LIST (BigBerm Theme) ================== */
.winners-panel {
  margin-top: 24px;
  padding: 16px;
  border-radius: 20px;
  background: var(--bb-bg-card);
  border: 2px solid var(--bb-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.winners-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--bb-border);
}

.winners-header i {
  color: var(--bb-orange);
  font-size: 1.1rem;
}

.winners-header span {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bb-text-primary);
}

.winners-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 4px;
}

.winner-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(249, 115, 22, 0.1);
  border-radius: 12px;
  border-left: 3px solid var(--bb-orange);
  transition: all 0.2s ease;
}

.winner-item:hover {
  background: rgba(249, 115, 22, 0.2);
  transform: translateX(4px);
}

.winner-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.winner-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bb-orange), var(--bb-red));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--bb-glow-orange);
}

.winner-name {
  font-size: 0.9rem;
  color: var(--bb-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.winner-prize {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--bb-orange-light);
  text-shadow: 0 0 8px var(--bb-glow-orange);
  white-space: nowrap;
}

.winner-time {
  font-size: 0.75rem;
  color: var(--bb-text-muted);
  flex-shrink: 0;
}

/* ================== COST DISPLAY & SPIN BUTTON (BigBerm Theme) ================== */
.cost-display {
  text-align: center;
  margin: 20px 0 16px;
  padding: 12px 20px;
  border-radius: 16px;
  background: rgba(249, 115, 22, 0.1);
  border: 2px solid var(--bb-border-orange);
}

.cost-label {
  color: var(--bb-text-muted);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.cost-value {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--bb-orange), var(--bb-orange-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cost-unit {
  font-size: 1rem;
  background: rgba(249, 115, 22, 0.3);
  padding: 2px 10px;
  border-radius: 20px;
  color: var(--bb-text-primary);
  margin-left: 4px;
}

.spin-btn-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.spin-btn {
  position: relative;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--bb-orange), var(--bb-orange-dark));
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  cursor: pointer;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 5px 25px var(--bb-glow-orange), 0 0 30px rgba(220, 38, 38, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.spin-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.spin-btn:hover::before {
  left: 100%;
}

.spin-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 35px var(--bb-glow-orange), 0 0 50px rgba(220, 38, 38, 0.4);
}

.spin-btn:active {
  transform: translateY(1px) scale(0.98);
}

.spin-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 0 15px var(--bb-glow-orange);
}

.spin-btn-secondary {
  padding: 10px 22px;
  font-size: 0.95rem;
  background: transparent;
  border: 2px solid var(--bb-border);
  color: var(--bb-text-secondary);
}

.spin-btn-secondary:hover {
  background: rgba(249, 115, 22, 0.1);
  border-color: var(--bb-border-orange);
  color: var(--bb-text-primary);
  box-shadow: 0 0 20px var(--bb-glow-orange);
}

/* ================== ITEMS LIST (ด้านล่าง) ================== */
#case-items-list {
  margin-top: 24px;
  padding: 16px;
  border-radius: 20px;
  background: var(--bb-bg-card);
  border: 2px solid var(--bb-border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#case-items-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

#case-items-list li {
  padding: 8px 12px;
  background: rgba(249, 115, 22, 0.1);
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--bb-text-secondary);
  border-left: 3px solid var(--bb-orange);
  transition: all 0.2s ease;
}

#case-items-list li:hover {
  background: rgba(249, 115, 22, 0.2);
  transform: translateX(4px);
}

/* ================== CONFETTI EFFECT ================== */
#confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* ================== UTILITY CLASSES ================== */
.text-glow {
  text-shadow: 0 0 10px currentColor;
}

.text-accent {
  color: var(--bb-orange);
  text-shadow: 0 0 8px var(--bb-glow-orange);
}

.text-accent2 {
  color: var(--bb-orange-light);
  text-shadow: 0 0 8px var(--bb-glow-orange);
}

.border-glow {
  box-shadow: 0 0 20px var(--bb-glow-orange);
}

.hidden {
  display: none !important;
}

.fade-in {
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pulse-once {
  animation: pulseOnce 0.6s ease-out;
}

@keyframes pulseOnce {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* ================== GAME MODE TOGGLE ================== */
.game-mode {
  display: none;
  animation: fadeIn 0.4s ease-out;
}

.game-mode.active {
  display: block;
}

/* ================== CSGO STRIP (BigBerm Theme) ================== */
.csgo-strip-shell {
  position: relative;
  overflow: hidden;
  border-radius: var(--bb-radius-md);
  border: 2px solid var(--bb-border);
  background: var(--bb-bg-card);
  height: 140px;
  margin: 14px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), inset 0 0 30px rgba(0, 0, 0, 0.4);
}

.csgo-strip-shell::before,
.csgo-strip-shell::after {
  content: '';
  position: absolute;
  top: 0;
  width: 80px;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

.csgo-strip-shell::before {
  left: 0;
  background: linear-gradient(90deg, var(--bb-bg-card), transparent);
}

.csgo-strip-shell::after {
  right: 0;
  background: linear-gradient(270deg, var(--bb-bg-card), transparent);
}

.csgo-pointer-line {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, transparent, var(--bb-red), transparent);
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.5);
  z-index: 15;
}

.csgo-pointer-line::before {
  content: '▼';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--bb-red);
  font-size: 1.3rem;
  text-shadow: 0 0 12px rgba(220, 38, 38, 0.5);
  font-weight: bold;
}

.csgo-strip {
  display: flex;
  gap: 8px;
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 6.5s cubic-bezier(0.08, 0.9, 0.15, 1);
  z-index: 1;
  will-change: transform;
}

.csgo-item {
  flex-shrink: 0;
  width: 110px;
  height: 110px;
  border-radius: 14px;
  border: 2px solid var(--bb-border);
  background: linear-gradient(145deg, var(--bb-bg-card), rgba(255, 255, 255, 0.03));
  font-size: 11px;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 6px;
  transition: all 0.3s ease;
}

.csgo-item:hover {
  border-color: var(--bb-border-orange);
  box-shadow: 0 0 25px var(--bb-glow-orange);
  transform: translateY(-3px);
}

.csgo-item img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  filter: drop-shadow(0 0 6px var(--bb-glow-orange));
}

.csgo-item-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--bb-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* ================== WHEEL (BigBerm Theme) ================== */
.wheel-body {
  position: relative;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  border: 10px solid var(--bb-orange);
  background: radial-gradient(circle at 50% 50%, rgba(249, 115, 22, 0.15) 0%, transparent 70%),
    linear-gradient(135deg, #0c0502, #1a0b05);
  overflow: hidden;
  box-shadow: 0 0 40px var(--bb-glow-orange), 0 0 80px rgba(220, 38, 38, 0.3),
    inset 0 0 60px rgba(0, 0, 0, 0.6);
}

.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bb-orange), var(--bb-red));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 30px var(--bb-glow-orange), 0 0 60px rgba(220, 38, 38, 0.3),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
  z-index: 3;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.2);
  animation: floatGlow 3s ease-in-out infinite;
}

.wheel-center img {
  width: 70%;
  height: auto;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

@keyframes floatGlow {
  0%, 100% {
    box-shadow: 0 0 30px var(--bb-glow-orange), 0 0 60px rgba(220, 38, 38, 0.3),
      inset 0 0 20px rgba(0, 0, 0, 0.3);
  }
  50% {
    box-shadow: 0 0 40px var(--bb-glow-orange), 0 0 80px rgba(220, 38, 38, 0.4),
      inset 0 0 20px rgba(0, 0, 0, 0.3);
  }
}

/* ================== RESPONSIVE UPDATES ================== */
@media (max-width: 800px) {
  .prize-grid {
    grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  }

  .prize-card img {
    width: 48px;
    height: 48px;
  }

  .winner-name {
    max-width: 80px;
  }

  .spin-btn {
    width: 100%;
    max-width: 260px;
  }

  .spin-btn-group {
    flex-direction: column;
    align-items: center;
  }

  .csgo-item {
    width: 95px;
    height: 95px;
  }

  .csgo-item img {
    width: 54px;
    height: 54px;
  }

  .wheel-wrap,
  .wheel-body {
    width: 280px;
    height: 280px;
  }

  .wheel-seg-img {
    width: 56px;
    height: 56px;
  }
}

@media (max-width: 480px) {
  .prize-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .winner-item {
    flex-wrap: wrap;
    gap: 6px;
  }

  .winner-prize {
    order: 3;
    width: 100%;
    text-align: center;
    margin-top: 4px;
  }

  .cost-value {
    font-size: 1.5rem;
  }
}

/* ================== SCROLLBAR (BigBerm Theme) ================== */
.winners-list::-webkit-scrollbar,
#case-items-list::-webkit-scrollbar {
  width: 6px;
}

.winners-list::-webkit-scrollbar-track,
#case-items-list::-webkit-scrollbar-track {
  background: var(--bb-bg-dark);
}

.winners-list::-webkit-scrollbar-thumb,
#case-items-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--bb-orange), var(--bb-red));
  border-radius: 10px;
}

.winners-list::-webkit-scrollbar-thumb:hover,
#case-items-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--bb-red), var(--bb-orange));
  box-shadow: 0 0 10px var(--bb-glow-orange);
}