/* ============================================================
   JOKERCOIN — Cinematic Splash Screen
   Premium gold-themed intro animation
   ============================================================ */

.joker-splash {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background:
    radial-gradient(ellipse at center, #1a0f00 0%, #0a0700 40%, #000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.joker-splash--hide {
  opacity: 0;
  transform: scale(1.1);
  pointer-events: none;
}

/* === Background animated particles (golden dust) === */
.joker-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.joker-particles span {
  position: absolute;
  display: block;
  width: 4px;
  height: 4px;
  background: radial-gradient(circle, #fbbf24 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0;
  animation: jokerParticleFloat 4s ease-in-out infinite;
  filter: blur(0.5px);
}
.joker-particles span:nth-child(1)  { left:  5%; top: 80%; animation-delay: 0.0s; width: 3px; height: 3px; }
.joker-particles span:nth-child(2)  { left: 15%; top: 60%; animation-delay: 0.3s; width: 5px; height: 5px; }
.joker-particles span:nth-child(3)  { left: 25%; top: 90%; animation-delay: 0.6s; }
.joker-particles span:nth-child(4)  { left: 35%; top: 70%; animation-delay: 0.9s; width: 6px; height: 6px; }
.joker-particles span:nth-child(5)  { left: 45%; top: 85%; animation-delay: 1.2s; }
.joker-particles span:nth-child(6)  { left: 55%; top: 75%; animation-delay: 1.5s; width: 4px; height: 4px; }
.joker-particles span:nth-child(7)  { left: 65%; top: 95%; animation-delay: 0.4s; width: 5px; height: 5px; }
.joker-particles span:nth-child(8)  { left: 75%; top: 65%; animation-delay: 0.7s; }
.joker-particles span:nth-child(9)  { left: 85%; top: 80%; animation-delay: 1.0s; width: 6px; height: 6px; }
.joker-particles span:nth-child(10) { left: 95%; top: 70%; animation-delay: 1.3s; }
.joker-particles span:nth-child(11) { left: 10%; top: 30%; animation-delay: 1.6s; width: 4px; height: 4px; }
.joker-particles span:nth-child(12) { left: 30%; top: 20%; animation-delay: 0.5s; }
.joker-particles span:nth-child(13) { left: 50%; top: 15%; animation-delay: 0.8s; width: 5px; height: 5px; }
.joker-particles span:nth-child(14) { left: 70%; top: 25%; animation-delay: 1.1s; }
.joker-particles span:nth-child(15) { left: 90%; top: 35%; animation-delay: 1.4s; width: 4px; height: 4px; }

@keyframes jokerParticleFloat {
  0%   { transform: translateY(0) scale(0); opacity: 0; }
  20%  { opacity: 1; transform: translateY(-30px) scale(1); }
  80%  { opacity: 0.8; transform: translateY(-200px) scale(1.2); }
  100% { transform: translateY(-300px) scale(0); opacity: 0; }
}

/* === Animated gold rays from center === */
.joker-rays {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.joker-rays span {
  position: absolute;
  width: 2px;
  height: 100vh;
  background: linear-gradient(to top,
    transparent 0%,
    rgba(251, 191, 36, 0.0) 30%,
    rgba(251, 191, 36, 0.4) 50%,
    rgba(251, 191, 36, 0.0) 70%,
    transparent 100%);
  transform-origin: center bottom;
  animation: jokerRaySweep 3s ease-in-out infinite;
  opacity: 0;
}
.joker-rays span:nth-child(1) { transform: rotate(0deg);   animation-delay: 0.0s; }
.joker-rays span:nth-child(2) { transform: rotate(45deg);  animation-delay: 0.2s; }
.joker-rays span:nth-child(3) { transform: rotate(90deg);  animation-delay: 0.4s; }
.joker-rays span:nth-child(4) { transform: rotate(135deg); animation-delay: 0.6s; }
.joker-rays span:nth-child(5) { transform: rotate(180deg); animation-delay: 0.8s; }
.joker-rays span:nth-child(6) { transform: rotate(225deg); animation-delay: 1.0s; }
.joker-rays span:nth-child(7) { transform: rotate(270deg); animation-delay: 1.2s; }
.joker-rays span:nth-child(8) { transform: rotate(315deg); animation-delay: 1.4s; }

@keyframes jokerRaySweep {
  0%, 100% { opacity: 0; }
  50%      { opacity: 1; }
}

/* === Splash main content === */
.joker-splash-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  z-index: 2;
}

/* === Logo wrapper with multi-ring glow === */
.joker-logo-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.joker-logo-img {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow:
    0 0 50px rgba(251, 191, 36, 0.6),
    0 0 100px rgba(251, 191, 36, 0.4),
    0 0 150px rgba(251, 191, 36, 0.2),
    inset 0 0 20px rgba(0, 0, 0, 0.3);
  border: 3px solid rgba(251, 191, 36, 0.8);
  animation: jokerLogoEntry 2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             jokerLogoPulse 2.5s ease-in-out infinite 1.5s;
  position: relative;
  z-index: 3;
  opacity: 0;
  transform: scale(0) rotate(-180deg);
}

@keyframes jokerLogoEntry {
  0%   { opacity: 0; transform: scale(0) rotate(-360deg); filter: blur(20px); }
  60%  { opacity: 1; transform: scale(1.15) rotate(20deg); filter: blur(0); }
  80%  { transform: scale(0.95) rotate(-10deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); filter: blur(0); }
}

@keyframes jokerLogoPulse {
  0%, 100% {
    box-shadow:
      0 0 50px rgba(251, 191, 36, 0.6),
      0 0 100px rgba(251, 191, 36, 0.4),
      0 0 150px rgba(251, 191, 36, 0.2);
  }
  50% {
    box-shadow:
      0 0 70px rgba(251, 191, 36, 0.9),
      0 0 130px rgba(251, 191, 36, 0.6),
      0 0 200px rgba(251, 191, 36, 0.35);
  }
}

/* === Rotating glow rings around logo === */
.joker-glow-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #fbbf24;
  border-right-color: rgba(251, 191, 36, 0.4);
  animation: jokerRingSpin 3s linear infinite;
  opacity: 0;
  animation: jokerRingAppear 0.6s ease-out 0.8s forwards,
             jokerRingSpin 3s linear infinite 0.8s;
}
.joker-glow-ring--2 {
  inset: -20px;
  border: 1px dashed rgba(251, 191, 36, 0.5);
  border-radius: 50%;
  animation: jokerRingAppear 0.6s ease-out 1.0s forwards,
             jokerRingSpinReverse 5s linear infinite 1.0s;
}
.joker-glow-ring--3 {
  inset: -40px;
  border: 1px solid transparent;
  border-bottom-color: rgba(251, 191, 36, 0.3);
  border-left-color: rgba(245, 158, 11, 0.5);
  border-radius: 50%;
  animation: jokerRingAppear 0.6s ease-out 1.2s forwards,
             jokerRingSpin 7s linear infinite 1.2s;
}

@keyframes jokerRingAppear {
  to { opacity: 1; }
}
@keyframes jokerRingSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes jokerRingSpinReverse {
  from { transform: rotate(360deg); }
  to   { transform: rotate(0deg); }
}

/* === Orbiting dots around logo === */
.joker-orbit-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  background: radial-gradient(circle, #fde68a 0%, #fbbf24 50%, #f59e0b 100%);
  border-radius: 50%;
  box-shadow: 0 0 20px #fbbf24, 0 0 40px rgba(251, 191, 36, 0.6);
  top: 50%;
  left: 50%;
  margin: -6px 0 0 -6px;
  transform-origin: 6px 6px;
  animation: jokerOrbit 3s linear infinite 1.5s;
  opacity: 0;
  animation-fill-mode: forwards;
}
.joker-orbit-dot--2 {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  transform-origin: 4px 4px;
  background: radial-gradient(circle, #fff 0%, #fbbf24 70%);
  animation: jokerOrbit2 4s linear infinite 1.7s;
}

@keyframes jokerOrbit {
  0%   { opacity: 0; transform: rotate(0deg) translateX(110px) rotate(0deg); }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { opacity: 1; transform: rotate(360deg) translateX(110px) rotate(-360deg); }
}
@keyframes jokerOrbit2 {
  0%   { opacity: 0; transform: rotate(180deg) translateX(140px) rotate(-180deg); }
  10%  { opacity: 0.9; }
  90%  { opacity: 0.9; }
  100% { opacity: 0.9; transform: rotate(540deg) translateX(140px) rotate(-540deg); }
}

/* === Shine sweep effect across logo === */
.joker-shine {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  overflow: hidden;
  pointer-events: none;
  z-index: 4;
}
.joker-shine::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.0) 45%,
    rgba(255, 255, 255, 0.6) 50%,
    rgba(255, 255, 255, 0.0) 55%,
    transparent 70%);
  transform: translateX(-100%) translateY(-100%);
  animation: jokerShineSweep 2.5s ease-in-out 1.8s infinite;
}

@keyframes jokerShineSweep {
  0%   { transform: translateX(-100%) translateY(-100%); }
  60%  { transform: translateX(100%) translateY(100%); }
  100% { transform: translateX(100%) translateY(100%); }
}

/* === Brand name with letter-by-letter reveal === */
.joker-brand-name {
  display: flex;
  align-items: center;
  font-family: 'Orbitron', 'Cairo', sans-serif;
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 900;
  letter-spacing: 0.15em;
  background: linear-gradient(180deg, #fef3c7 0%, #fbbf24 30%, #f59e0b 70%, #b45309 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(251, 191, 36, 0.4);
  filter: drop-shadow(0 4px 20px rgba(251, 191, 36, 0.5));
  margin-top: 1.5rem;
}

.joker-brand-name span {
  display: inline-block;
  opacity: 0;
  transform: translateY(40px) rotateX(90deg);
  animation: jokerLetterReveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: calc(1.6s + var(--i) * 0.08s);
}
.joker-spacer { width: 0.6em; }

@keyframes jokerLetterReveal {
  0%   { opacity: 0; transform: translateY(40px) rotateX(90deg); }
  60%  { opacity: 1; transform: translateY(-8px) rotateX(-15deg); }
  100% { opacity: 1; transform: translateY(0) rotateX(0); }
}

/* === Tagline === */
.joker-tagline {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(0.7rem, 1.5vw, 0.9rem);
  font-weight: 700;
  letter-spacing: 0.5em;
  color: rgba(251, 191, 36, 0.8);
  text-transform: uppercase;
  opacity: 0;
  animation: jokerFadeUp 0.8s ease-out 2.6s forwards;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
}

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

/* === Loading progress bar === */
.joker-progress {
  width: 280px;
  max-width: 80vw;
  height: 3px;
  background: rgba(251, 191, 36, 0.15);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 1rem;
  opacity: 0;
  animation: jokerFadeUp 0.6s ease-out 2.8s forwards;
  position: relative;
}

.joker-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #fbbf24, #fde68a, #fbbf24);
  background-size: 200% 100%;
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.8);
  animation: jokerProgressFill 1.4s ease-out 2.9s forwards,
             jokerProgressShine 1.4s linear 2.9s;
}

@keyframes jokerProgressFill {
  to { width: 100%; }
}
@keyframes jokerProgressShine {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* === Loading text === */
.joker-loading-text {
  font-family: 'Cairo', sans-serif;
  font-size: 0.8rem;
  color: rgba(251, 191, 36, 0.6);
  margin-top: 0.5rem;
  opacity: 0;
  animation: jokerFadeUp 0.6s ease-out 3.0s forwards,
             jokerTextPulse 1.5s ease-in-out 3.0s infinite;
}

@keyframes jokerTextPulse {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 1; }
}

/* === Mobile responsive === */
@media (max-width: 640px) {
  .joker-logo-wrap { width: 160px; height: 160px; }
  .joker-logo-img { width: 130px; height: 130px; }
  .joker-orbit-dot { animation-name: jokerOrbitMobile; }
  @keyframes jokerOrbitMobile {
    0%   { opacity: 0; transform: rotate(0deg) translateX(80px) rotate(0deg); }
    10%  { opacity: 1; }
    100% { transform: rotate(360deg) translateX(80px) rotate(-360deg); opacity: 1; }
  }
}

/* === Accessibility: respect reduced motion === */
@media (prefers-reduced-motion: reduce) {
  .joker-splash * {
    animation-duration: 0.5s !important;
    animation-iteration-count: 1 !important;
  }
}
