/* NexioGame splash: the loading screen shared by every NexioLabs game (and the portal while a game starts).
   Markup: see web/sdk/splash.js (SPLASH_HTML). Shown by plain HTML + CSS, before any script runs. */
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 100 900; font-display: swap; src: url('/fonts/outfit-latin.woff2') format('woff2'); }

.ng-splash {
  position: fixed; inset: 0; z-index: 2147483000; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(60% 50% at 30% 25%, rgba(124, 58, 237, 0.38), transparent 70%),
    radial-gradient(55% 45% at 75% 80%, rgba(8, 145, 178, 0.3), transparent 70%), #090713;
  color: #f3f0ff; font-family: 'Outfit', 'Segoe UI', system-ui, -apple-system, sans-serif;
  transition: opacity 0.45s ease, visibility 0.45s;
  -webkit-user-select: none; user-select: none;
}
.ng-splash.out { opacity: 0; visibility: hidden; pointer-events: none; }
.ng-splash .ngs-box { display: grid; justify-items: center; gap: 10px; width: min(360px, 82vw); text-align: center; }
.ng-splash .ngs-mark { width: clamp(64px, 14vmin, 92px); height: auto; filter: drop-shadow(0 10px 28px rgba(139, 92, 246, 0.55)); animation: ngs-float 2.4s ease-in-out infinite; }
.ng-splash .ngs-word { font-weight: 800; font-size: clamp(1.5rem, 5vmin, 2rem); letter-spacing: -0.03em; line-height: 1; }
.ng-splash .ngs-word b { background: linear-gradient(90deg, #a78bfa, #22d3ee); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ng-splash .ngs-game { margin-top: 6px; font-weight: 700; font-size: clamp(0.95rem, 3vmin, 1.15rem); color: #d8d2f7; letter-spacing: 0.02em; min-height: 1.2em; }
.ng-splash .ngs-bar { width: 100%; height: 8px; margin-top: 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.1); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.ng-splash .ngs-bar i {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, #8b5cf6, #6366f1 50%, #22d3ee); background-size: 200% 100%;
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.55); transition: width 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); animation: ngs-shine 1.6s linear infinite;
}
.ng-splash .ngs-meta { width: 100%; display: flex; justify-content: space-between; font-size: 0.78rem; color: #a59fc9; font-variant-numeric: tabular-nums; }
.ng-splash .ngs-by { margin-top: 14px; font-size: 0.74rem; letter-spacing: 0.16em; text-transform: uppercase; color: #8d86b3; }
.ng-splash .ngs-by b { color: #e9e4ff; letter-spacing: 0.12em; }
@keyframes ngs-float { 50% { transform: translateY(-6px) scale(1.03); } }
@keyframes ngs-shine { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .ng-splash .ngs-mark, .ng-splash .ngs-bar i { animation: none; } }

/* Inside the portal's player frame (until the game paints its own, identical screen). */
.ng-splash.in-player { position: absolute; z-index: 4; border-radius: inherit; }

/* ================================================================== NexioLabs Games intro (≈ 2.7 s, skippable)
   Timeline (ms): 0 light streak · 250 flash · 300-750 logo flies in and hits · 750 shockwave + sparks (splash.js)
   (streak, flash, ring and sparks are anchored on the logo by splash.js: --cx/--cy)
   · 850-1450 NEXIOLABS letter by letter · 1250-1900 metallic shine · 1500 GAMES · 1850 tagline · 2700 hand-over. */
.ng-splash:not(.go) .ngi * { animation-play-state: paused !important; }
.ng-splash .ngi { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 0; perspective: 900px; transition: opacity 0.35s ease, transform 0.45s ease; }
.ng-splash.intro .ngs-box { opacity: 0; transform: translateY(10px); }
.ng-splash .ngs-box { transition: opacity 0.4s ease 0.05s, transform 0.4s ease 0.05s; }
.ng-splash.loading .ngi, .ng-splash.skip .ngi { opacity: 0; transform: scale(1.04); pointer-events: none; }
.ng-splash.loading .ngs-box { opacity: 1; transform: none; }
.ng-splash.skip .ngs-box { opacity: 0; transition: none; } /* game already loaded: straight to the fade-out */
/* Intro over, game still loading: the intro stays, with a slim progress line under it (never a second screen). */
.ng-splash.waiting .ngs-box { display: none; }
.ng-splash .ngi-progress { position: absolute; left: 50%; bottom: 16%; width: min(300px, 56vw); height: 3px; margin-left: calc(min(300px, 56vw) / -2); border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; opacity: 0; transition: opacity 0.4s ease; }
.ng-splash.waiting .ngi-progress { opacity: 1; transition-delay: 2.5s; } /* only on a really slow connection */
.ng-splash .ngi-progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #22d3ee, #a78bfa, #f472b6); box-shadow: 0 0 12px rgba(167, 139, 250, 0.8); transition: width 0.3s ease; }
.ng-splash .ngi-fx { position: absolute; inset: 0; width: 100%; height: 100%; }
.ng-splash .ngi-streak {
  position: absolute; left: 0; right: 0; top: var(--cy, 50%); height: 2px; margin-top: -1px; transform-origin: center; transform: scaleX(0); opacity: 0;
  background: linear-gradient(90deg, transparent, #22d3ee 20%, #fff 50%, #a78bfa 80%, transparent);
  box-shadow: 0 0 18px 4px rgba(139, 92, 246, 0.7), 0 0 60px 10px rgba(34, 211, 238, 0.35);
  animation: ngi-streak 0.62s cubic-bezier(0.7, 0, 0.2, 1) 0s both;
}
.ng-splash .ngi-flash { position: absolute; inset: 0; opacity: 0; background: radial-gradient(40% 35% at var(--cx, 50%) var(--cy, 50%), rgba(255, 255, 255, 0.85), rgba(167, 139, 250, 0.35) 45%, transparent 70%); animation: ngi-flash 0.55s ease-out 0.25s both; }
.ng-splash .ngi-ring { position: absolute; top: var(--cy, 50%); left: var(--cx, 50%); width: 140px; height: 140px; margin: -70px 0 0 -70px; border-radius: 50%; border: 3px solid rgba(167, 139, 250, 0.9); box-shadow: 0 0 30px rgba(34, 211, 238, 0.6), inset 0 0 20px rgba(139, 92, 246, 0.6); opacity: 0; animation: ngi-ring 0.9s cubic-bezier(0.1, 0.7, 0.2, 1) 0.74s both; }
.ng-splash .ngi-mark {
  position: relative; width: clamp(84px, 17vmin, 132px); height: auto; margin-bottom: clamp(14px, 3vmin, 24px);
  filter: drop-shadow(0 16px 40px rgba(139, 92, 246, 0.7)); opacity: 0;
  animation: ngi-mark 0.5s cubic-bezier(0.55, 0, 0.3, 1.25) 0.3s both, ngi-breathe 3s ease-in-out 1.2s infinite;
}
.ng-splash .ngi-word { position: relative; display: flex; font-weight: 900; font-size: clamp(2.3rem, 9.5vmin, 5.8rem); line-height: 1; letter-spacing: 0.16em; margin-right: -0.16em; }
.ng-splash .ngi-word span {
  display: inline-block; opacity: 0; transform: translateY(45%) scale(0.85); filter: blur(10px);
  background: linear-gradient(100deg, #ffffff 0%, #e9e2ff 35%, #ffffff 45%, #9f7bff 50%, #ffffff 55%, #d9f7ff 70%, #ffffff 100%);
  background-size: 300% 100%; background-position: 100% 0; -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 30px rgba(139, 92, 246, 0.25);
  animation: ngi-letter 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both, ngi-shine 0.9s ease-in-out 1.25s both;
}
.ng-splash .ngi-word span:nth-child(1) { animation-delay: 0.85s, 1.25s; }
.ng-splash .ngi-word span:nth-child(2) { animation-delay: 0.9s, 1.29s; }
.ng-splash .ngi-word span:nth-child(3) { animation-delay: 0.95s, 1.33s; }
.ng-splash .ngi-word span:nth-child(4) { animation-delay: 1s, 1.37s; }
.ng-splash .ngi-word span:nth-child(5) { animation-delay: 1.05s, 1.41s; }
.ng-splash .ngi-word span:nth-child(6) { animation-delay: 1.1s, 1.45s; }
.ng-splash .ngi-word span:nth-child(7) { animation-delay: 1.15s, 1.49s; }
.ng-splash .ngi-word span:nth-child(8) { animation-delay: 1.2s, 1.53s; }
.ng-splash .ngi-word span:nth-child(9) { animation-delay: 1.25s, 1.57s; }
.ng-splash .ngi-sub { display: flex; align-items: center; gap: 14px; margin-top: clamp(10px, 2.2vmin, 18px); font-weight: 700; font-size: clamp(0.8rem, 2.4vmin, 1.15rem); letter-spacing: 0.62em; margin-right: -0.62em; color: #67e8f9; opacity: 0; animation: ngi-up 0.5s ease-out 1.5s both; }
.ng-splash .ngi-sub i { width: clamp(30px, 9vmin, 70px); height: 1px; background: linear-gradient(90deg, transparent, #67e8f9); transform: scaleX(0); animation: ngi-line 0.6s ease-out 1.55s both; }
.ng-splash .ngi-sub i:last-child { background: linear-gradient(90deg, #67e8f9, transparent); }
.ng-splash .ngi-tag { margin-top: clamp(14px, 3vmin, 24px); font-weight: 600; font-style: italic; font-size: clamp(0.85rem, 2.6vmin, 1.2rem); letter-spacing: 0.06em; color: #c9c1f2; opacity: 0; animation: ngi-up 0.6s ease-out 1.85s both; }
.ng-splash .ngi-skip { position: absolute; right: 18px; bottom: calc(14px + env(safe-area-inset-bottom)); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255, 255, 255, 0.38); opacity: 0; animation: ngi-up 0.4s ease-out 1s both; }
@keyframes ngi-streak { 0% { opacity: 0; transform: scaleX(0); } 35% { opacity: 1; transform: scaleX(1); } 70% { opacity: 1; transform: scaleX(1) scaleY(1.6); } 100% { opacity: 0; transform: scaleX(1.2) scaleY(0.2); } }
@keyframes ngi-flash { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ngi-ring { 0% { opacity: 0.95; transform: scale(0.35); } 100% { opacity: 0; transform: scale(4.2); } }
@keyframes ngi-mark { 0% { opacity: 0; transform: translateZ(-500px) rotateY(-150deg) rotateX(25deg) scale(2.2); filter: blur(14px) drop-shadow(0 0 0 transparent); } 70% { opacity: 1; } 100% { opacity: 1; transform: none; filter: drop-shadow(0 16px 40px rgba(139, 92, 246, 0.7)); } }
@keyframes ngi-breathe { 50% { transform: scale(1.035); } }
@keyframes ngi-letter { to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes ngi-shine { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes ngi-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes ngi-line { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .ng-splash .ngi *, .ng-splash .ngi-word span { animation-duration: 0.01s !important; animation-delay: 0s !important; }
  .ng-splash .ngi-streak, .ng-splash .ngi-flash, .ng-splash .ngi-ring { display: none; }
}
/* Inside the portal player until the game's intro starts: just dark, the show happens in the game. */
.ng-splash.in-player { background: #090713; }
