/* =============================================
   Bingo System - Custom Styles
   ============================================= */

/* ─── Animations ─────────────────────────────────────────────────────────────*/
@keyframes bounce-once {
  0%, 100% { transform: translateY(0) scale(1); }
  25% { transform: translateY(-20px) scale(1.1); }
  50% { transform: translateY(-10px) scale(1.05); }
  75% { transform: translateY(-5px) scale(1.02); }
}

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

@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.7); }
  70% { box-shadow: 0 0 0 20px rgba(250, 204, 21, 0); }
  100% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0); }
}

@keyframes number-pop {
  0% { transform: scale(0.5) rotate(-10deg); opacity: 0; }
  60% { transform: scale(1.3) rotate(5deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

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

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(250, 204, 21, 0.5); }
  50% { box-shadow: 0 0 40px rgba(250, 204, 21, 0.9), 0 0 80px rgba(249, 115, 22, 0.4); }
}

/* ─── Utility Classes ────────────────────────────────────────────────────────*/
.animate-bounce-once {
  animation: bounce-once 0.6s ease-out;
}

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

.animate-slideInLeft {
  animation: slideInLeft 0.4s ease-out;
}

.animate-number-pop {
  animation: number-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.animate-glow {
  animation: glow 2s ease-in-out infinite;
}

/* ─── Number Ball ────────────────────────────────────────────────────────────*/
.number-ball {
  background: radial-gradient(circle at 35% 35%, #60a5fa, #2563eb);
  box-shadow: 
    0 4px 15px rgba(37, 99, 235, 0.4),
    inset 0 1px 0 rgba(255,255,255,0.3);
  border: 2px solid rgba(255,255,255,0.2);
}

.number-ball-current {
  background: radial-gradient(circle at 35% 35%, #fde047, #f59e0b);
  box-shadow: 
    0 4px 25px rgba(245, 158, 11, 0.6),
    inset 0 1px 0 rgba(255,255,255,0.4);
  animation: pulse-ring 1.5s ease-out infinite, glow 2s ease-in-out infinite;
}

/* ─── Bingo Card Cells ───────────────────────────────────────────────────────*/
.cell-marked {
  background: linear-gradient(135deg, #34d399, #059669);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1), 0 2px 6px rgba(5, 150, 105, 0.3);
  transform: scale(0.96);
}

.cell-current {
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
  animation: pulse-ring 1s ease-out infinite;
}

.cell-empty {
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
}

/* ─── Main Display Ball ──────────────────────────────────────────────────────*/
.main-ball {
  width: 180px;
  height: 180px;
  background: radial-gradient(circle at 35% 30%, #93c5fd, #1d4ed8 60%, #1e3a8a);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 
    0 20px 60px rgba(29, 78, 216, 0.5),
    inset 0 4px 8px rgba(255,255,255,0.25),
    inset 0 -4px 8px rgba(0,0,0,0.2);
  position: relative;
  margin: 0 auto;
}

.main-ball::before {
  content: '';
  position: absolute;
  top: 12%;
  left: 18%;
  width: 35%;
  height: 25%;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  filter: blur(4px);
}

.main-ball-active {
  background: radial-gradient(circle at 35% 30%, #fde68a, #f59e0b 50%, #d97706);
  box-shadow: 
    0 20px 60px rgba(245, 158, 11, 0.6),
    inset 0 4px 8px rgba(255,255,255,0.3),
    0 0 60px rgba(249, 115, 22, 0.4);
  animation: glow 1.5s ease-in-out infinite;
}

/* ─── Panel Controls ─────────────────────────────────────────────────────────*/
.control-panel {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 1px solid rgba(255,255,255,0.08);
}

/* ─── History Chips ──────────────────────────────────────────────────────────*/
.history-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  font-weight: 700;
  font-size: 0.8rem;
  transition: all 0.3s;
}

.history-chip-latest {
  background: linear-gradient(135deg, #fde047, #f59e0b);
  color: white;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
  transform: scale(1.15);
}

.history-chip-old {
  background: #dbeafe;
  color: #1d4ed8;
}

/* ─── Confetti ───────────────────────────────────────────────────────────────*/
.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confetti-fall linear forwards;
}

/* ─── Glassmorphism ──────────────────────────────────────────────────────────*/
.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ─── Scrollbar ──────────────────────────────────────────────────────────────*/
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: #94a3b8;
  border-radius: 3px;
}

/* ─── Responsive ─────────────────────────────────────────────────────────────*/
@media (max-width: 640px) {
  .main-ball {
    width: 130px;
    height: 130px;
  }
}

/* ─── Winner Effect ──────────────────────────────────────────────────────────*/
.winner-card {
  animation: glow 1s ease-in-out infinite;
  border: 3px solid #fbbf24 !important;
}

/* ─── Transition helpers ─────────────────────────────────────────────────────*/
.transition-smooth {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Tab underline ──────────────────────────────────────────────────────────*/
.tab-btn {
  border-bottom-width: 2px;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: #2563eb;
}
