/* Original logo, two short glitch bursts, then the real Flutter surface.
   The exit only starts after fitrpg-ready. No screenshot or duplicate UI. */
:root { color-scheme: dark; }
html, body { margin: 0; height: 100%; background: #07090D; overscroll-behavior: none; }
#intro { position: fixed; inset: 0; z-index: 9999; background: #07090D;
  display: flex; align-items: center; justify-content: center; overflow: hidden; }
#intro .logo { position: relative; width: min(340px, 78vw); aspect-ratio: 944 / 493; isolation: isolate; }
#intro .l { position: absolute; inset: 0; background: url(logo.png) center / contain no-repeat; }
#intro .base { animation: logoArrive 540ms steps(1, end) both; }
#intro .red, #intro .cyan, #intro .slice { opacity: 0; pointer-events: none; }
#intro .red { filter: sepia(1) saturate(15) hue-rotate(310deg); mix-blend-mode: screen;
  animation: rgbArrive 540ms steps(1, end) both; --shift: 12px; }
#intro .cyan { filter: sepia(1) saturate(12) hue-rotate(135deg); mix-blend-mode: screen;
  animation: rgbArrive 540ms steps(1, end) both; --shift: -12px; }
#intro .slice { animation: sliceArrive 540ms steps(1, end) both; }
#intro .scan, #intro .tear { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
#intro .scan { background: repeating-linear-gradient(0deg, transparent 0 3px, #000 3px 4px);
  animation: scanArrive 540ms both; }
#intro .tear { background: linear-gradient(90deg, #ff315866, transparent 45%, #2ee6a666); }
#intro .skip { position: absolute; right: 16px; top: max(24px, env(safe-area-inset-top));
  min-height: 44px; min-width: 44px; padding: 0 12px; border: 0; background: none;
  color: #B4BFCE; font: 500 15px Inter, system-ui, sans-serif; cursor: pointer; }
#intro .skip:focus-visible { outline: 2px solid #2EE6A6; outline-offset: 2px; }
/* 2100 ms hold + 900 ms exit = 3 s when Flutter is already ready. */
#intro.out { animation: revealApp 900ms steps(1, end) both; }
#intro.out .logo { animation: logoExit 320ms steps(1, end) both; }
#intro.out .red, #intro.out .cyan { animation: rgbExit 320ms steps(1, end) both; }
#intro.out .slice { animation: sliceExit 320ms steps(1, end) both; }
#intro.out .scan { animation: scanExit 900ms both; }
#intro.out .tear { animation: tearExit 900ms steps(1, end) both; }
/* Animate the existing Flutter host without reparenting/remounting it. */
body.fit-intro-exit flt-glass-pane { animation: appGlitch 900ms steps(1, end) both; }
@keyframes logoArrive {
  0%, 24% { opacity: 0; }
  25% { opacity: 1; transform: translateX(-12px); clip-path: inset(30% 0 48%); }
  42% { transform: translateX(7px); clip-path: inset(5% 0 18%); }
  62% { transform: translateX(-4px); clip-path: inset(0); }
  85%, 100% { opacity: 1; transform: none; clip-path: inset(0); }
}
@keyframes rgbArrive {
  0%, 24% { opacity: 0; }
  25%, 61% { opacity: .6; transform: translateX(var(--shift)); }
  62% { opacity: .4; transform: translateX(calc(var(--shift) * -.5)); }
  85%, 100% { opacity: 0; }
}
@keyframes sliceArrive {
  0%, 30% { opacity: 0; }
  31% { opacity: 1; clip-path: inset(42% 0 43%); transform: translateX(28px); }
  55% { clip-path: inset(65% 0 18%); transform: translateX(-21px); }
  80%, 100% { opacity: 0; }
}
@keyframes scanArrive { 0% { opacity: 0; } 30%, 60% { opacity: .25; } 100% { opacity: 0; } }
@keyframes logoExit {
  0% { opacity: 1; transform: translateX(-12px) skewX(5deg); }
  30% { transform: translateX(18px); clip-path: inset(15% 0 40%); }
  65% { transform: translateX(-24px); clip-path: inset(65% 0 15%); }
  100% { opacity: 0; }
}
@keyframes rgbExit {
  0%, 55% { opacity: .7; transform: translateX(var(--shift)); }
  56% { transform: translateX(calc(var(--shift) * -1.5)); }
  100% { opacity: 0; }
}
@keyframes sliceExit {
  0% { opacity: 1; clip-path: inset(25% 0 55%); transform: translateX(36px); }
  40% { clip-path: inset(70% 0 12%); transform: translateX(-32px); }
  100% { opacity: 0; }
}
@keyframes revealApp {
  0%, 36% { background: #07090D; }
  37% { background: transparent; clip-path: polygon(0 0,100% 0,100% 18%,0 18%,0 32%,100% 32%,100% 38%,0 38%,0 72%,100% 72%,100% 100%,0 100%); }
  55% { background: transparent; clip-path: inset(0); }
  100% { background: transparent; }
}
@keyframes appGlitch {
  0%, 36% { transform: none; }
  37% { transform: translateX(12px) skewX(-1deg); }
  48% { transform: translateX(-8px); }
  60% { transform: translateX(3px); }
  74%, 100% { transform: none; }
}
@keyframes scanExit { 0%, 45% { opacity: .25; } 85%, 100% { opacity: 0; } }
@keyframes tearExit {
  0% { opacity: .6; clip-path: inset(35% 0 62%); }
  25% { clip-path: inset(68% 0 29%); }
  50% { opacity: .35; clip-path: inset(22% 0 75%); }
  75%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #intro *, #intro.out, body.fit-intro-exit flt-glass-pane { animation: none !important; }
  #intro .red, #intro .cyan, #intro .slice, #intro .scan, #intro .tear { display: none; }
}
