/* Splash / boot loader — web + Capacitor (assets under /assets/splash/, packaged offline) */

#splash-loader {
  position: fixed;
  inset: 0;
  z-index: 200000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  overflow: hidden;
  background: #050814 url('/assets/splash/splash.png') center center / cover no-repeat;
  color: #e8f4ff;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  pointer-events: all;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.45s ease, visibility 0.45s ease;
  padding-bottom: calc(20vh + env(safe-area-inset-bottom, 0px));
}

#splash-loader.is-hiding {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#splash-loader.is-hidden {
  display: none !important;
}

.splash-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, transparent 20%, rgba(0, 0, 0, 0.35) 100%),
    linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.15) 42%, transparent 70%);
  pointer-events: none;
}

.splash-track-wrap {
  position: relative;
  z-index: 2;
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 16px 14px;
  border-radius: 16px;
  background: rgba(6, 12, 22, 0.72);
  border: 1px solid rgba(51, 115, 191, 0.35);
  backdrop-filter: blur(8px);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}

.splash-track {
  position: relative;
  height: 72px;
  margin: 0 8px 10px;
}

.splash-lane {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(51, 204, 255, 0.15), rgba(0, 255, 204, 0.35), rgba(51, 204, 255, 0.15));
  box-shadow: 0 0 12px rgba(0, 255, 204, 0.2);
}

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

.splash-orb {
  position: absolute;
  top: 50%;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  margin-top: -14px;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(51, 204, 255, 0.55));
  transition: opacity 0.18s ease, transform 0.18s ease, filter 0.18s ease;
  will-change: transform, opacity;
}

.splash-orb.is-collected {
  opacity: 0;
  transform: translateY(-18px) scale(0.4);
  filter: drop-shadow(0 0 12px rgba(0, 255, 204, 0.9));
}

.splash-player {
  position: absolute;
  top: 50%;
  left: 0;
  width: 56px;
  height: 56px;
  margin-left: -28px;
  margin-top: -28px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(255, 180, 80, 0.55));
  transition: left 0.18s linear;
  will-change: left;
  z-index: 3;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.splash-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  color: rgba(210, 225, 240, 0.9);
  padding: 0 4px;
}

.splash-status {
  min-height: 1.2em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.splash-percent {
  font-weight: 700;
  color: #00ffcc;
  font-variant-numeric: tabular-nums;
  min-width: 3.2em;
  text-align: right;
}

.splash-bar {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.splash-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1aa3ff, #33ccff 40%, #00ffcc);
  box-shadow: 0 0 10px rgba(0, 255, 204, 0.45);
  transition: width 0.2s ease-out;
}

@media (max-width: 640px) {
  .splash-track {
    height: 60px;
  }
  .splash-player {
    width: 44px;
    height: 44px;
    margin-left: -22px;
    margin-top: -22px;
  }
  .splash-orb {
    width: 22px;
    height: 22px;
    margin-left: -11px;
    margin-top: -11px;
  }
  .splash-track-wrap {
    padding: 14px 12px 12px;
  }
}
