body {
  padding: 0;
  margin: 0;
  overflow: hidden;
  background: #07060c;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

#unity-container { position: absolute }
#unity-container.unity-desktop { left: 50%; top: 50%; transform: translate(-50%, -50%) }
#unity-container.unity-mobile { position: fixed; width: 100%; height: 100% }
#unity-canvas { background: #231F20 }
.unity-mobile #unity-canvas { width: 100%; height: 100% }

/* ---- Splash / resource loading ---- */
#unity-loading-bar {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background:
    radial-gradient(ellipse 90% 55% at 50% 18%, rgba(212, 168, 75, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 80% 90%, rgba(32, 90, 140, 0.35), transparent 50%),
    radial-gradient(ellipse 60% 45% at 10% 80%, rgba(90, 40, 120, 0.25), transparent 45%),
    linear-gradient(165deg, #120e1c 0%, #07060c 45%, #0a1420 100%);
  animation: splash-in 0.55s ease-out both;
}

#unity-loading-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.45;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255, 240, 200, 0.7), transparent),
    radial-gradient(1px 1px at 28% 68%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1.5px 1.5px at 55% 18%, rgba(255, 220, 160, 0.55), transparent),
    radial-gradient(1px 1px at 72% 42%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1.5px 1.5px at 88% 72%, rgba(200, 230, 255, 0.5), transparent),
    radial-gradient(1px 1px at 40% 88%, rgba(255, 255, 255, 0.35), transparent);
  animation: star-drift 12s linear infinite;
}

#unity-loading-bar.is-visible {
  display: flex;
}

.splash-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(86vw, 360px);
  padding: 0 12px;
}

#unity-logo {
  width: 112px;
  height: 112px;
  margin: 0 0 22px;
  border-radius: 28px;
  background: url("icons/icon-192.png") center / cover no-repeat;
  box-shadow:
    0 0 0 1px rgba(255, 215, 140, 0.28),
    0 18px 40px rgba(0, 0, 0, 0.45),
    0 0 48px rgba(212, 168, 75, 0.22);
  animation: logo-pulse 2.4s ease-in-out infinite;
}

.splash-title {
  margin: 0;
  font-size: clamp(1.55rem, 5.5vw, 2rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #f6e7c3;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.55);
}

.splash-sub {
  margin: 10px 0 0;
  font-size: 0.92rem;
  letter-spacing: 0.28em;
  color: rgba(230, 214, 180, 0.62);
}

.splash-track {
  width: 100%;
  height: 10px;
  margin-top: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(246, 231, 195, 0.22);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}

#unity-progress-bar-empty {
  width: 100%;
  height: 100%;
  margin: 0;
  background: none;
}

#unity-progress-bar-full {
  width: 0%;
  height: 100%;
  margin: 0;
  border-radius: inherit;
  background:
    linear-gradient(90deg, #b8872f 0%, #f0d48a 48%, #ffe9b0 100%);
  box-shadow: 0 0 16px rgba(240, 212, 138, 0.45);
  transition: width 0.12s linear;
}

.splash-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 12px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: rgba(230, 214, 180, 0.7);
}

#unity-progress-text {
  font-variant-numeric: tabular-nums;
  color: #f6e7c3;
  font-weight: 600;
}

#unity-footer { position: relative; display: none }
.unity-mobile #unity-footer { display: none }
#unity-warning {
  position: absolute;
  left: 50%;
  top: 5%;
  transform: translate(-50%);
  background: white;
  padding: 10px;
  display: none;
  z-index: 50;
}

@keyframes splash-in {
  from { opacity: 0 }
  to { opacity: 1 }
}

@keyframes logo-pulse {
  0%, 100% { transform: translateY(0) scale(1) }
  50% { transform: translateY(-4px) scale(1.03) }
}

@keyframes star-drift {
  from { transform: translateY(0) }
  to { transform: translateY(-18px) }
}
