*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:       #269AE2;
  --blue-dark:  #1a7bbf;
  --blue-light: #e8f5fd;
  --white:      #ffffff;
  --text:       #0d1f2d;
  --sub:        #4a6a82;
  --muted:      #9ab8cc;
  --border:     #d6eaf7;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: #0a1628;
}

/* ── Background ─────────────────────────────────────────────── */
#loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%,   rgba(38,154,226,0.12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(38,154,226,0.07) 0%, transparent 60%),
    linear-gradient(160deg, #0a1628 0%, #0d2035 50%, #091520 100%);
  z-index: 100;
  transition: opacity 0.7s ease;
  gap: 0;
}

/* subtle grid overlay */
#loading-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(38,154,226,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(38,154,226,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

/* ── Left accent strip ──────────────────────────────────────── */
#accent-strip {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, transparent 0%, var(--blue) 40%, var(--blue-dark) 60%, transparent 100%);
}

/* ── Center card ────────────────────────────────────────────── */
#loader-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(38,154,226,0.18);
  border-radius: 24px;
  padding: 52px 64px 48px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 0 0 1px rgba(38,154,226,0.08),
    0 32px 80px rgba(0,0,0,0.5),
    0 0 60px rgba(38,154,226,0.06) inset;
  min-width: 420px;
  max-width: 480px;
  width: 90vw;
}

/* corner accent */
#loader-card::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px;
  width: 60px; height: 60px;
  border-top: 2px solid var(--blue);
  border-left: 2px solid var(--blue);
  border-radius: 24px 0 0 0;
  opacity: 0.7;
}
#loader-card::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px;
  width: 60px; height: 60px;
  border-bottom: 2px solid var(--blue);
  border-right: 2px solid var(--blue);
  border-radius: 0 0 24px 0;
  opacity: 0.4;
}

/* ── Logo ───────────────────────────────────────────────────── */
#logo-wrap {
  position: relative;
  width: 88px; height: 88px;
}

#logo-wrap::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 28px;
  background: radial-gradient(circle, rgba(38,154,226,0.15) 0%, transparent 70%);
}

#app-logo {
  width: 88px; height: 88px;
  object-fit: contain;
  border-radius: 20px;
  position: relative;
  z-index: 1;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(38,154,226,0.2);
}

/* ── Title block ────────────────────────────────────────────── */
#title-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

#app-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.01em;
}

#app-sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--blue);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

/* ── Divider ────────────────────────────────────────────────── */
#divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(38,154,226,0.3), transparent);
}

/* ── Progress ───────────────────────────────────────────────── */
#loader-mid {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#progress-status {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#progress-pct {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

#progress-track {
  width: 100%;
  height: 5px;
  background: rgba(255,255,255,0.07);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}

#progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue-dark), var(--blue), #5ec4f5);
  border-radius: 99px;
  transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

#progress-shine {
  position: absolute;
  top: 0; left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: shine 1.8s ease-in-out infinite;
}

@keyframes shine {
  0%   { left: -60%; }
  100% { left: 160%; }
}

/* ── Bottom branding ────────────────────────────────────────── */
#loader-bottom {
  position: absolute;
  bottom: 28px;
  left: 0; right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

#brand-link {
  display: flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
  transition: opacity 0.2s;
}
#brand-link:hover { opacity: 0.7; }

#powered-text {
  font-size: 0.72rem;
  font-weight: 400;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.05em;
}

#brand-logo {
  height: 18px;
  object-fit: contain;
  filter: brightness(0) invert(1) opacity(0.45);
  transition: filter 0.2s;
}
#brand-link:hover #brand-logo {
  filter: brightness(0) invert(1) opacity(0.7);
}

#bottom-line {
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.12);
  text-transform: uppercase;
}

/* ── Unity Canvas ───────────────────────────────────────────── */
#unity-container {
  position: fixed;
  inset: 0;
  display: none;
}

#unity-canvas {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
}

#fs-prompt {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.7);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  padding: 8px 18px;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.12);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.5s ease;
}
