:root {
  --ink-900: #0a111a;
  --ink-800: #0d1825;
  --ink-700: #0f1f2d;
  --cyan: #78c8ff;
  --mint: #5df0c0;
  --edge: #b7f7ff;
  --ring: rgba(120, 200, 255, 0.36);
}

#app-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 60% -10%, rgba(16, 35, 53, 0.667), transparent 70%),
    linear-gradient(135deg, #0b1521, #0e1a27 60%, #0a111a);
  backdrop-filter: blur(14px) saturate(140%);
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

#app-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#loader-particles {
  position: absolute;
  inset: 0;
  filter: blur(0.2px) contrast(110%);
}

.loader-glass {
  position: relative;
  width: min(660px, 92vw);
  padding: 28px 28px 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(11, 21, 33, 0.8), rgba(14, 26, 39, 0.8));
  border: 1px solid rgba(120, 200, 255, 0.22);
  box-shadow: 0 24px 64px rgba(8, 18, 32, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.icon-wrap {
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  filter: drop-shadow(0 10px 28px rgba(120, 200, 255, 0.35));
}

.status {
  color: #eaf6ff;
  text-align: center;
  font-family: ui-sans-serif, system-ui, "Inter", "Noto Sans Thai", sans-serif;
}

.status-line {
  font-weight: 700;
  font-size: clamp(1.15rem, 0.9rem + 0.8vw, 1.6rem);
  letter-spacing: 0.02em;
}

#loader-ellipsis::after {
  content: "";
  animation: ell 1.2s infinite steps(4);
}

@keyframes ell {
  0% {
    content: "";
  }

  25% {
    content: ".";
  }

  50% {
    content: "..";
  }

  75% {
    content: "...";
  }

  100% {
    content: "";
  }
}

.progress {
  width: 100%;
  height: 12px;
  background: linear-gradient(180deg, #0a1723, #0b1a28);
  border-radius: 999px;
  margin: 14px auto 8px;
  overflow: hidden;
  border: 1px solid rgba(120, 200, 255, 0.18);
}

#loader-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #38f7b0, #34e2ff 55%, #38f7b0);
  box-shadow: 0 0 18px rgba(56, 247, 176, 0.53), inset 0 0 12px rgba(52, 226, 255, 0.4);
  transition: width 0.25s ease;
}

.counter {
  opacity: 0.9;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.counter .suffix {
  opacity: 0.75;
  margin-left: 0.25rem;
}

.tip {
  margin-top: 6px;
  font-size: 0.92rem;
  opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
  #loader-ellipsis,
  #loader-bar {
    transition: none !important;
    animation: none !important;
  }
}

html.loading body {
  filter: blur(2px) saturate(105%);
  transition: filter 0.5s ease;
}

html.ready body {
  filter: none;
}

html.loading {
  overflow: hidden;
}

