@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800&family=Plus+Jakarta+Sans:wght@500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #0b0d13;
  font-family: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  color: #fff;
  user-select: none;
}

canvas {
  outline: none;
  display: block;
}

/* --- Persistent Corner Branding --- */
.corner-brand {
  position: fixed;
  top: 14px;
  left: 16px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(15, 17, 23, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 100px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0.85;
}

.corner-brand img {
  height: 22px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.corner-brand:hover {
  opacity: 1;
  transform: translateY(-2px) scale(1.04);
  border-color: rgba(255, 180, 50, 0.4);
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.25);
  background: rgba(20, 24, 33, 0.9);
}

/* --- Premium Loading Splash Screen --- */
#splash {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 35%, #231628 0%, #120d18 50%, #07060a 100%);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.6s;
  overflow: hidden;
}

/* Ambient glow blobs */
#splash::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, rgba(239, 68, 68, 0.08) 50%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  filter: blur(60px);
  animation: pulseGlow 4s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes pulseGlow {
  0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.7; }
  100% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

#wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  width: 100%;
  max-width: 480px;
  padding: 40px 32px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.7),
              inset 0 1px 1px rgba(255, 255, 255, 0.15);
  animation: cardFadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Clickable Logo in Splash */
.logo-link {
  display: inline-block;
  margin-bottom: 24px;
  padding: 6px 14px;
  border-radius: 16px;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.brand-logo {
  max-width: 240px;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-link:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.2);
}

.logo-link:hover .brand-logo {
  transform: scale(1.05);
}

/* Title & Status */
.splash-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffffff 30%, #fbcfe8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 6px;
  text-align: center;
}

.splash-subtitle {
  font-size: 14px;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 28px;
  text-align: center;
  display: flex;
  align-items: center;
  gap: 6px;
}

.splash-dots span {
  animation: dotPulse 1.4s infinite;
  display: inline-block;
  opacity: 0.3;
}
.splash-dots span:nth-child(2) { animation-delay: 0.2s; }
.splash-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Modern Progress Bar */
.progress-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#progressbar {
  position: relative;
  width: 100% !important;
  height: 12px !important;
  background: rgba(0, 0, 0, 0.45);
  border-radius: 100px !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
  visibility: visible !important;
}

#progressbar2 {
  position: relative;
  width: 0%;
  height: 100% !important;
  border-radius: 100px !important;
  background: linear-gradient(90deg, #f59e0b, #ef4444, #ec4899);
  background-size: 200% 100%;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.6);
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  animation: gradientSlide 2s linear infinite;
}

/* Shimmer on progress bar */
#progressbar2::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: shimmer 1.6s infinite;
}

@keyframes gradientSlide {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #cbd5e1;
  padding: 0 4px;
}

#progress-status {
  color: #94a3b8;
  font-weight: 500;
}

#progress-percent {
  font-variant-numeric: tabular-nums;
  color: #f59e0b;
  font-weight: 700;
}

/* Smooth Fade Out */
#splash.fade-out {
  opacity: 0;
  pointer-events: none;
}