html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }

#startup {
  position: fixed;
  inset: 0;
  z-index: 1;
  isolation: isolate;
  display: grid;
  align-items: center;
  overflow: auto;
  box-sizing: border-box;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at 50% 28%, #38377c, transparent 48%), linear-gradient(#131a43 55%, #075985);
  color: #fff;
  font: 16px/1.6 system-ui, sans-serif;
  text-align: center;
}

.startup-background { position: absolute; z-index: -2; pointer-events: none; overflow: hidden; will-change: transform, opacity; }
#startup-halo {
  inset: -12% -12% 28%;
  background:
    radial-gradient(ellipse 68% 58% at 38% 36%, rgb(99 102 241 / 38%), transparent 70%),
    radial-gradient(ellipse 56% 52% at 64% 32%, rgb(56 189 248 / 26%), transparent 72%);
  mask-image: linear-gradient(#000 68%, transparent);
  animation: startup-halo-drift 12s ease-in-out infinite alternate;
}
#startup-waves {
  inset: 52% -14% -12%;
  background:
    radial-gradient(ellipse 75% 60% at 50% 62%, rgb(14 165 233 / 36%), transparent 72%),
    radial-gradient(ellipse 60% 45% at 30% 78%, rgb(56 189 248 / 22%), transparent 70%);
  mask-image: linear-gradient(transparent, #000 42%);
  animation: startup-waves-drift 10s ease-in-out infinite alternate;
}
#startup::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(transparent 40%, rgb(9 17 48 / 30%) 60%, transparent 80%);
}

.startup-content { position: relative; margin-top: 24vh; text-shadow: 0 2px 16px rgb(4 15 36 / 70%); }
#startup-loading { margin: 0; font-size: clamp(20px, 2vw, 28px); font-weight: 600; animation: startup-loading-pulse 2.6s ease-in-out infinite; }
#startup-loading small { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 400; color: #e0eaf6; }
#startup a { display: inline-block; margin-top: 24px; padding: 8px 12px; color: #e0eaf6; font-size: 14px; text-underline-offset: 5px; }
#startup button { padding: 10px 24px; border: 1px solid #fff; border-radius: 12px; background: #fff; color: #131a43; font: inherit; cursor: pointer; }
#startup :focus-visible { outline: 2px solid #fff; outline-offset: 5px; }
#startup [hidden] { display: none !important; }

@keyframes startup-halo-drift {
  0% { transform: translate3d(-2%, -1%, 0) scale(1); opacity: 0.78; }
  100% { transform: translate3d(2%, 2%, 0) scale(1.06); opacity: 1; }
}

@keyframes startup-waves-drift {
  0% { transform: translate3d(2%, 1%, 0) scale(1); opacity: 0.75; }
  100% { transform: translate3d(-2%, -2%, 0) scale(1.05); opacity: 1; }
}

@keyframes startup-loading-pulse {
  0%, 100% { opacity: 0.88; }
  50% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  #startup-halo, #startup-waves, #startup-loading { animation: none !important; }
}
