/* ============================================================
   RAN UNIVERSE — animations.css
   Keyframes & animation utilities
   ============================================================ */

/* ── Keyframes ────────────────────────────────────────────── */

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes zoom-in {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.94) translateY(12px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(32px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(32px); }
}

@keyframes pulse-gold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 197, 71, 0); }
  50%       { box-shadow: 0 0 0 8px rgba(232, 197, 71, 0.2); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}

@keyframes sparkle-pop {
  0%   { transform: scale(1) rotate(0deg); }
  40%  { transform: scale(1.25) rotate(8deg); }
  70%  { transform: scale(0.92) rotate(-4deg); }
  100% { transform: scale(1) rotate(0deg); }
}

@keyframes stagger-fade {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Gold shimmer text */
@keyframes gold-shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* Page transition */
@keyframes page-enter {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* Splash logo reveal */
@keyframes splash-reveal {
  0%   { opacity: 0; transform: scale(0.7) translateY(20px); letter-spacing: 0.5em; }
  60%  { opacity: 1; transform: scale(1.04) translateY(-4px); letter-spacing: 0.2em; }
  100% { opacity: 1; transform: scale(1) translateY(0); letter-spacing: 0.15em; }
}

/* Online pulse */
@keyframes online-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--success); }
  50%       { opacity: 0.6; box-shadow: 0 0 8px var(--success); }
}

/* ── Animation utility classes ────────────────────────────── */
.anim-fade-in     { animation: fade-in 0.4s var(--ease-out) both; }
.anim-slide-up    { animation: slide-up 0.5s var(--ease-out) both; }
.anim-slide-down  { animation: slide-down 0.4s var(--ease-out) both; }
.anim-slide-left  { animation: slide-in-left 0.5s var(--ease-out) both; }
.anim-slide-right { animation: slide-in-right 0.5s var(--ease-out) both; }
.anim-zoom-in     { animation: zoom-in 0.4s var(--ease-out) both; }
.anim-float       { animation: float 3s ease-in-out infinite; }
.anim-pulse-gold  { animation: pulse-gold 2.5s ease-in-out infinite; }

/* Stagger delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* Stagger children (JS-applied via data-stagger) */
[data-stagger] > * {
  opacity: 0;
  animation: stagger-fade 0.45s var(--ease-out) both;
}

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

/* ── Hover micro-interactions ─────────────────────────────── */
.hover-lift {
  transition: transform var(--trans-med), box-shadow var(--trans-med);
}
.hover-lift:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.hover-glow:hover {
  box-shadow: var(--shadow-gold);
}

/* ── Gold shimmer heading effect ──────────────────────────── */
.shimmer-text {
  background: linear-gradient(
    90deg,
    var(--gold-soft) 0%,
    var(--gold-bright) 30%,
    #fff8c0 50%,
    var(--gold-bright) 70%,
    var(--gold-soft) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gold-shimmer 3s linear infinite;
}

/* ── Particles container ──────────────────────────────────── */
.particles-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.particle {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--gold-accent);
  opacity: 0;
  animation: particle-float linear infinite;
}
@keyframes particle-float {
  0%   { opacity: 0;    transform: translateY(100vh) scale(0); }
  10%  { opacity: 0.4; }
  90%  { opacity: 0.2; }
  100% { opacity: 0;    transform: translateY(-50px) scale(1.5); }
}

/* ── Background decoration ────────────────────────────────── */
.bg-decoration {
  position: fixed;
  pointer-events: none;
  z-index: 0;
}
.bg-orb {
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.06;
  position: absolute;
}
.bg-orb-1 {
  width: 400px; height: 400px;
  background: var(--gold-bright);
  top: -100px; left: -100px;
}
.bg-orb-2 {
  width: 300px; height: 300px;
  background: #8b5cf6;
  bottom: -50px; right: -50px;
}

[data-theme="light"] .bg-orb { opacity: 0.08; }

/* ── Splash screen ────────────────────────────────────────── */
#splash-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #050410;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  transition: opacity 0.5s ease;
}
#splash-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}
.splash-logo {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 4.5rem);
  font-weight: 900;
  letter-spacing: 0.15em;
  color: transparent;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: splash-reveal 1.2s var(--ease-out) both;
  line-height: 1;
  margin-bottom: 10px;
}
.splash-tagline {
  font-size: 0.78rem;
  color: rgba(200, 170, 100, 0.6);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  animation: fade-in 0.6s 0.8s both;
  margin-bottom: var(--space-2xl);
}
.splash-divider {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232,197,71,0.6), transparent);
  margin: 6px 0 8px;
  animation: fade-in 0.4s 0.6s both;
}
.splash-progress {
  width: 200px; height: 3px;
  background: rgba(232, 197, 71, 0.15);
  border-radius: 2px;
  overflow: hidden;
  animation: fade-in 0.4s 0.5s both;
}
.splash-progress-bar {
  height: 100%;
  background: var(--grad-gold);
  border-radius: 2px;
  animation: progress-fill 1.8s var(--ease-out) both;
}
@keyframes progress-fill {
  from { width: 0%; }
  to   { width: 100%; }
}

/* Online indicator pulse */
.rank-online {
  animation: online-pulse 2s ease-in-out infinite;
}
