/* ============================================================
   Kimia Lottery — Custom styles
   ============================================================ */

/* ---------- Base ---------- */
* { -webkit-font-smoothing: antialiased; }
html { scroll-behavior: smooth; }
body { font-feature-settings: "ss02"; }

/* ---------- Glass card ---------- */
.glass-card {
  background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 1.5rem;
  box-shadow:
    0 20px 60px rgba(0,0,0,0.4),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

/* ---------- Stat card ---------- */
.stat-card {
  padding: 1rem;
  border-radius: 1rem;
  background: linear-gradient(145deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1px solid rgba(255,255,255,0.08);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(245,184,0,0.08), transparent 60%);
  pointer-events: none;
}

/* ---------- Animated background blobs ---------- */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  pointer-events: none;
}
.blob-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #784BA0, transparent 70%);
  top: -150px; right: -150px;
  animation: floatSlow 20s ease-in-out infinite;
}
.blob-2 {
  width: 450px; height: 450px;
  background: radial-gradient(circle, #2B86C5, transparent 70%);
  bottom: -150px; left: -100px;
  animation: floatSlow 25s ease-in-out infinite reverse;
}
.blob-3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, #F5B800, transparent 70%);
  top: 40%; left: 30%;
  opacity: 0.25;
  animation: floatSlow 30s ease-in-out infinite;
}

@keyframes floatSlow {
  0%,100% { transform: translate(0,0) scale(1); }
  33%     { transform: translate(40px,-30px) scale(1.05); }
  66%     { transform: translate(-30px,40px) scale(0.95); }
}

.grid-overlay {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  pointer-events: none;
}

/* ---------- Entry animations ---------- */
.fade-in { animation: fadeIn 0.8s ease both; }
.fade-in-up { animation: fadeInUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Shake on error ---------- */
.shake { animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both; }
@keyframes shake {
  10%,90% { transform: translateX(-2px); }
  20%,80% { transform: translateX(4px); }
  30%,50%,70% { transform: translateX(-8px); }
  40%,60% { transform: translateX(8px); }
}

/* ---------- History item enter ---------- */
.history-item-enter {
  animation: historyEnter 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes historyEnter {
  from { opacity: 0; transform: translateX(30px) scale(0.9); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* ---------- Wheel ---------- */
.wheel-idle {
  animation: wheelIdle 6s ease-in-out infinite;
}
@keyframes wheelIdle {
  0%,100% { filter: drop-shadow(0 0 30px rgba(245,184,0,0.25)); }
  50%     { filter: drop-shadow(0 0 50px rgba(245,184,0,0.45)); }
}
.wheel-spinning { animation: none !important; }

/* ---------- Custom scrollbar ---------- */
.custom-scroll::-webkit-scrollbar { width: 6px; }
.custom-scroll::-webkit-scrollbar-track { background: transparent; }
.custom-scroll::-webkit-scrollbar-thumb {
  background: rgba(245,184,0,0.3);
  border-radius: 3px;
}
.custom-scroll::-webkit-scrollbar-thumb:hover { background: rgba(245,184,0,0.5); }

/* ---------- Toast ---------- */
.toast-item {
  padding: 0.875rem 1.25rem;
  border-radius: 0.875rem;
  background: rgba(17, 21, 51, 0.95);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(20px);
  color: white;
  font-size: 0.875rem;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  animation: toastIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.toast-error { border-color: rgba(239, 68, 68, 0.4); color: #fca5a5; }
.toast-success { border-color: rgba(16, 185, 129, 0.4); color: #6ee7b7; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---------- Winner modal entrance ---------- */
.modal-enter { animation: modalEnter 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.85) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 640px) {
  .stat-card .text-3xl { font-size: 1.5rem; }
}