/*
 * Pre-Flutter loading screen.
 *
 * Visually continuous with the in-app SplashScreen
 * (`lib/core/widgets/splash_screen.dart`):
 *   - same background (`AppColors.backgroundTheme` = #2A272E)
 *   - same green chat-bubble logo (`AppColors.splashLogoBubble`/`micAnimationGreen`
 *     = #00BD09) sized to match `splashTalkingLogoSize` = 96px
 *   - same wordmark + subtitle ("tiriti" / "Чат, стриминг, созвон")
 *
 * The CSS-only spinner cannot replicate the animated voice bars from
 * `TalkingLogo`, but the shared logo, palette, and typography mean the
 * user does not see a hard cut between this loader and the Flutter
 * splash — Flutter's `flutter-first-frame` event removes #app-loader
 * once it's ready to take over.
 */

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #2a272e;
}

#app-loader {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #2a272e;
  color: #ffffff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  z-index: 9999;
  user-select: none;
  -webkit-user-select: none;
}

#app-loader-spinner {
  /* matches splashTalkingLogoSize (96) */
  width: 96px;
  height: 96px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 51 49'><path d='M25.92 0C39.42 0 50.37 10.94 50.37 24.44 50.37 37.94 39.42 48.89 25.92 48.89 19.73 48.89 14.08 46.58 9.77 42.79L3.25 48.53 2.97 48.78 0 48.78 0.55 47.41 0.55 47.40C0.55 47.40 0.56 47.39 0.56 47.38 0.57 47.36 0.58 47.34 0.59 47.30 0.62 47.22 0.67 47.10 0.72 46.94 0.83 46.63 0.99 46.16 1.18 45.56 1.55 44.35 2.02 42.61 2.41 40.49 2.79 38.44 3.10 36.05 3.19 33.44 2.08 30.66 1.48 27.62 1.48 24.44 1.48 10.94 12.42 0 25.92 0ZM25.92 3C14.08 3 4.48 12.60 4.48 24.44 4.48 27.24 5.01 29.90 5.98 32.34L6.21 32.92 6.19 33.54C6.09 36.32 5.77 38.87 5.36 41.04 5.23 41.75 5.09 42.41 4.95 43.04L7.79 40.54 9.77 38.79 11.75 40.54C15.53 43.87 20.49 45.89 25.92 45.89 37.58 45.89 47.06 36.59 47.36 25.00L47.37 24.44C47.37 12.60 37.76 3 25.92 3Z' fill='%2300BD09'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  animation: app-loader-pulse 1.4s ease-in-out infinite;
}

#app-loader-text {
  /* matches splashLogoSpinnerGap (24) */
  margin-top: 24px;
  text-align: center;
}

#app-loader-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #ffffff;
}

#app-loader-subtitle {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.6);
}

@keyframes app-loader-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.06);
    opacity: 0.85;
  }
}
