/* Spawn — startup splash (polished / modern) */

.splash {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: var(--bg-void);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s;
}

.splash.is-exiting {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 70% at 50% 40%, transparent 30%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
  z-index: 1;
}

.splash__canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.splash__stars {
  position: absolute;
  inset: -30%;
  background-image:
    radial-gradient(1px 1px at 15% 25%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1px 1px at 55% 65%, rgba(255, 255, 255, 0.25), transparent),
    radial-gradient(1.5px 1.5px at 75% 15%, rgba(0, 212, 238, 0.4), transparent),
    radial-gradient(1px 1px at 35% 85%, rgba(255, 255, 255, 0.2), transparent);
  background-size: 180% 180%;
  opacity: 0;
  animation: splashStarsIn 1.4s ease forwards, splashStarsDrift 40s linear infinite 1.4s;
}

.splash__nebula {
  position: absolute;
  width: 120%;
  height: 120%;
  top: -10%;
  left: -10%;
  background:
    radial-gradient(ellipse 45% 35% at 20% 40%, rgba(232, 121, 249, 0.08), transparent 60%),
    radial-gradient(ellipse 50% 45% at 80% 60%, rgba(0, 212, 238, 0.1), transparent 55%),
    url(../assets/generated/backgrounds/splash-nebula.png) center/cover no-repeat;
  opacity: 0;
  animation: splashFadeIn 1.2s ease 0.15s forwards;
}

.splash__grid {
  position: absolute;
  bottom: -5%;
  left: -15%;
  right: -15%;
  height: 38%;
  background:
    linear-gradient(rgba(0, 212, 238, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 212, 238, 0.04) 1px, transparent 1px),
    url(../assets/generated/backgrounds/cyber-grid-floor.png) center bottom/cover no-repeat;
  background-size: 56px 56px, 56px 56px, cover;
  transform: perspective(500px) rotateX(72deg);
  transform-origin: center bottom;
  opacity: 0;
  mask-image: linear-gradient(to top, black 15%, transparent 90%);
  animation: splashGridIn 1.2s ease 0.4s forwards;
}

.splash__scanline { display: none; }

.splash__inner {
  position: relative;
  z-index: 2;
  width: 100%;
}

.splash__content {
  text-align: center;
  padding: var(--space-6);
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

.splash__skip {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  right: max(20px, env(safe-area-inset-right));
  z-index: 3;
  background: var(--glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  cursor: pointer;
  opacity: 0;
  animation: splashFadeIn 0.5s ease 0.8s forwards;
  transition: color var(--motion), border-color var(--motion), background var(--motion);
}
.splash__skip:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-raised);
}

.splash__logo-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin: 0 auto var(--space-6);
  opacity: 0;
  transform: scale(0.92);
  animation: splashLogoIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.3s forwards;
}

.splash__logo-ring {
  display: none;
}

.splash__logo-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 24px;
  position: relative;
  z-index: 1;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  object-fit: cover;
}

.splash__wordmark {
  font-family: var(--font-cyber);
  font-size: clamp(2rem, 8vw, 2.75rem);
  font-weight: 700;
  letter-spacing: 0.28em;
  margin-right: -0.28em;
  color: var(--text);
  display: flex;
  justify-content: center;
  gap: 0.02em;
}

.splash__wordmark span {
  display: inline-block;
  opacity: 0;
  transform: translateY(14px);
  background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0.75) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: splashLetterIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.splash__wordmark span:nth-child(1) { animation-delay: 0.85s; }
.splash__wordmark span:nth-child(2) { animation-delay: 0.95s; }
.splash__wordmark span:nth-child(3) { animation-delay: 1.05s; }
.splash__wordmark span:nth-child(4) { animation-delay: 1.15s; }
.splash__wordmark span:nth-child(5) { animation-delay: 1.25s; }

.splash__line {
  font-family: var(--font-body);
  font-size: clamp(1.0625rem, 3.5vw, 1.1875rem);
  color: var(--text-secondary);
  margin-top: var(--space-5);
  line-height: 1.55;
  letter-spacing: -0.02em;
  opacity: 0;
  transform: translateY(10px);
  animation: splashLineIn 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  max-width: 36ch;
  margin-left: auto;
  margin-right: auto;
}
.splash__line--primary {
  animation-delay: 1.45s;
  color: var(--text);
  font-weight: 600;
}
.splash__line--secondary {
  animation-delay: 1.6s;
  font-size: 0.9375rem;
  font-weight: 400;
  color: var(--muted);
  max-width: 42ch;
}

.splash__progress {
  width: min(240px, 72%);
  height: 3px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  margin: var(--space-8) auto 0;
  overflow: hidden;
  opacity: 0;
  animation: splashFadeIn 0.4s ease 1.35s forwards;
}
.splash__progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  border-radius: inherit;
  animation: splashProgress 1.6s cubic-bezier(0.4, 0, 0.2, 1) 1.45s forwards;
}

.splash__badge {
  display: none;
}

.splash__actions {
  margin-top: var(--space-8);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  opacity: 0;
  animation: splashFadeIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) 2.6s forwards;
}
.splash__actions--player {
  width: 100%;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}
.splash__owner-link {
  font-size: 14px;
  margin-top: var(--space-2);
  color: var(--text-secondary) !important;
}

/* Owner panel — premium glass card */
.splash__panel-right {
  background: var(--glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  box-shadow: var(--shadow-md);
  opacity: 0;
  animation: splashPanelIn 0.75s cubic-bezier(0.22, 1, 0.36, 1) 2.2s forwards;
}

.splash__panel-owner .splash__owner-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-alt);
  background: rgba(232, 121, 249, 0.1);
  border: 1px solid rgba(232, 121, 249, 0.25);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}

.splash__panel-right h2 {
  font-family: var(--font-body);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: var(--space-3);
  line-height: 1.25;
}

.splash__panel-right > p {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.65;
  margin-bottom: var(--space-5);
}

.splash__feature-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-6);
  font-size: 14px;
  color: var(--text-secondary);
}
.splash__feature-list li {
  padding: 10px 0;
  padding-left: 28px;
  position: relative;
  line-height: 1.45;
  border-bottom: 1px solid var(--border);
}
.splash__feature-list li:last-child { border-bottom: none; }
.splash__feature-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 10px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-muted);
  border-radius: 50%;
}

.splash__owner-note {
  margin-top: var(--space-4);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  text-align: center;
}

@media (min-width: 768px) {
  .splash__inner {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 40px;
    align-items: center;
    max-width: 1000px;
    padding: 48px 56px;
  }
  .splash__content {
    text-align: left;
    max-width: none;
    margin: 0;
    padding: 0;
  }
  .splash__logo-wrap { margin: 0 0 var(--space-5); }
  .splash__wordmark { justify-content: flex-start; }
  .splash__line { margin-left: 0; margin-right: 0; }
  .splash__progress {
    width: min(520px, 100%);
    margin: var(--space-8) 0 0;
  }
  .splash__actions--player { margin: var(--space-8) 0 0; max-width: 280px; }
  .splash__panel-right { display: block; }
}

@media (max-width: 767px) {
  .splash__panel-right { display: none; }
  .splash__owner-link { display: inline-flex; justify-content: center; }
}

@media (min-width: 768px) {
  .splash__owner-link { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .splash__stars, .splash__nebula, .splash__grid, .splash__logo-wrap,
  .splash__wordmark span, .splash__line, .splash__progress, .splash__progress-bar,
  .splash__actions, .splash__skip, .splash__panel-right {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .splash__progress-bar { width: 100% !important; }
  .splash__wordmark span { -webkit-text-fill-color: var(--text); }
}

@keyframes splashFadeIn { to { opacity: 1; } }
@keyframes splashStarsIn { to { opacity: 0.85; } }
@keyframes splashStarsDrift {
  0% { transform: translate(0, 0); }
  100% { transform: translate(-3%, -2%); }
}
@keyframes splashGridIn { to { opacity: 0.45; } }
@keyframes splashLogoIn { to { opacity: 1; transform: scale(1); } }
@keyframes splashRingPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
@keyframes splashLetterIn { to { opacity: 1; transform: translateY(0); } }
@keyframes splashLineIn { to { opacity: 1; transform: translateY(0); } }
@keyframes splashProgress { to { width: 100%; } }
@keyframes splashPanelIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
