/* The loading shell shares the portrait game frame and appears before Cocos. */
#StartupScreen {
  --startup-blue: #48c6ff;
  --startup-pink: #ff86c5;
  position: absolute;
  inset: 0;
  z-index: 1000;
  overflow: hidden;
  background: radial-gradient(ellipse at 18% 8%, #ffffffb8, transparent 44%),
    linear-gradient(180deg, #cdeeff 0%, #e1f5ff 55%, #f1faff 100%);
  color: #285273;
  opacity: 1;
  transition: opacity 200ms ease;
  touch-action: pan-y;
}

#StartupScreen[data-state="ready"] {
  opacity: 0;
  pointer-events: none;
}

.startup-brand {
  position: absolute;
  top: 42%;
  left: 50%;
  width: min(80%, 320px);
  transform: translate(-50%, -50%);
  text-align: center;
}

#StartupLogo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
}

.startup-cloud {
  position: absolute;
  width: 176px;
  height: 62px;
  border-radius: 50%;
  background: #ffffffa8;
  box-shadow: 26px -16px 0 -1px #ffffffb0, 61px -6px 0 -7px #ffffffa3;
  filter: blur(3px);
  pointer-events: none;
}

.startup-cloud-left {
  top: 13%;
  left: -74px;
  opacity: .58;
}

.startup-cloud-right {
  top: 62%;
  right: -104px;
  width: 192px;
  opacity: .48;
}

#StartupBubbles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  height: 30px;
  margin-top: 18px;
}

.startup-bubble {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  box-shadow: inset 0 -2px 3px #ffffff70, 0 3px 7px #6aafce24;
  animation: startup-jump 1200ms ease-in-out infinite;
}

.startup-bubble-blue {
  background: radial-gradient(circle at 30% 25%, white 0%, #b5ecff 18%, var(--startup-blue) 56%, #248bed 100%);
}

.startup-bubble-pink {
  background: radial-gradient(circle at 30% 25%, white 0%, #ffcee9 18%, var(--startup-pink) 56%, #ed62a8 100%);
  animation-delay: -600ms;
}

@keyframes startup-jump {
  0%, 45%, 100% { transform: translateY(0); opacity: .82; }
  20% { transform: translateY(-9px); opacity: 1; }
}

#StartupScreen[data-state="error"] .startup-bubble {
  animation: none;
}

#StartupFailure {
  padding-top: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

#StartupFailure[hidden] { display: none; }
#StartupFailure p { margin: 10px 0 14px; font-size: 16px; line-height: 1.5; }

#StartupRetry {
  min-width: 120px;
  min-height: 44px;
  padding: 9px 22px;
  border: 1px solid #7dd8ff;
  border-radius: 24px;
  background: linear-gradient(180deg, #fff, #d7f3ff);
  box-shadow: inset 0 2px 0 #ffffffcc, 0 4px 12px #83bcd62b;
  color: #235679;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
}

#StartupRetry:active { transform: translateY(1px); }
#StartupRetry:focus-visible { outline: 3px solid #278be3; outline-offset: 4px; }

.startup-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-height: 640px) {
  .startup-brand { width: min(76%, 260px); }
}

@media (prefers-reduced-motion: reduce) {
  #StartupScreen { transition: none; }
  .startup-bubble { animation: none; }
}
