/* Splash: static markup in index.html (#splash), painted before the app bundle loads; src/splash.ts fades it out
   and removes it once the app is ready. LoadingSplash reuses it (.is-screen) for «volviendo a tu partida».
   Its own file in public/ (served as is, not merged into the app CSS), linked from index.html before anything else,
   so it may not rely on styles.css: colors are the tokens of styles.css, repeated. */

html {
  background: #0c2229; /* --table-deep */
}

body {
  margin: 0;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: env(safe-area-inset-top, 0px) 24px calc(20px + env(safe-area-inset-bottom, 0px));
  /* Same background as body in styles.css (viewport-sized like its "fixed" gradient): no flash when it goes */
  background: radial-gradient(120% 80% at 50% 0%, #13323b 0%, #0c2229 100%);
  color: #eef5f6;
  font-family: 'Bricolage Grotesque Variable', 'Segoe UI', system-ui, sans-serif; /* @font-face in the app CSS */
  text-align: center;
  transition: opacity 200ms ease-out;
}

.splash.is-hiding {
  opacity: 0;
  pointer-events: none;
}

.splash-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.splash-mark {
  width: min(240px, 64vw);
  height: auto;
  overflow: visible;
}

.splash-word {
  margin: 22px 0 0;
  font-size: clamp(2.6rem, 12vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

.splash-slogan {
  margin: 8px 0 0;
  color: #a7c0c6; /* --muted */
  font-size: 1.15rem;
  font-weight: 600;
}

.splash-studio {
  margin: 0;
  color: #a7c0c6;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* Chips drop in one by one (0.54 s), then the gold line draws (until 0.7 s) */
.mk-chip {
  transform-box: fill-box;
  transform-origin: center;
  animation: mk-drop 260ms cubic-bezier(0.3, 1.4, 0.5, 1) both;
}

.mk-c2 { animation-delay: 70ms; }
.mk-c3 { animation-delay: 140ms; }
.mk-c4 { animation-delay: 210ms; }
.mk-c5 { animation-delay: 280ms; }

.mk-line {
  stroke-dasharray: 1;
  animation: mk-draw 160ms ease-out 540ms both;
}

@keyframes mk-drop {
  from {
    transform: translateY(-120%);
    opacity: 0;
  }
}

@keyframes mk-draw {
  from {
    stroke-dashoffset: 1;
  }
  to {
    stroke-dashoffset: 0;
  }
}

/* Loading screen inside the app (LoadingSplash): already-drawn mark, below the «Sin conexión» banner, and it only
   fades in after 300 ms so a screen that lasts a moment shows nothing */
.splash.is-screen {
  z-index: 10;
  animation: splash-in 200ms ease-out 300ms both;
}

.splash.is-screen .mk-chip,
.splash.is-screen .mk-line {
  animation: none;
}

@keyframes splash-in {
  from {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .splash,
  .splash.is-screen,
  .splash .mk-chip,
  .splash .mk-line {
    animation: none;
    transition: none;
  }
}
