:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
}

html,
body {
  width: 100%;
  height: var(--app-height, 100dvh);
  background: #061736;
  overflow: hidden;
}

body {
  position: fixed;
  inset: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

flutter-view,
flt-glass-pane,
flt-scene-host {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: var(--app-height, 100dvh) !important;
  max-height: var(--app-height, 100dvh) !important;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}

html.tmidap-leaving flutter-view,
html.tmidap-leaving flt-glass-pane,
html.tmidap-leaving flt-scene-host,
html.is-leaving flutter-view,
html.is-leaving flt-glass-pane,
html.is-leaving flt-scene-host {
  opacity: 1;
  pointer-events: auto;
}

#tmidap-startup {
  position: fixed;
  inset: 0;
  z-index: 2147483640;
  overflow: hidden;
  background: #061736;
  opacity: 1;
  transition: opacity 300ms ease;
}

#tmidap-startup.is-leaving,
html.tmidap-leaving #tmidap-startup {
  opacity: 0;
  pointer-events: none;
}

#splash-fallback,
#splash-vanta-host {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

#splash-fallback {
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 20%, rgba(25, 142, 192, 0.38), transparent 39%),
    radial-gradient(circle at 80% 78%, rgba(7, 70, 154, 0.48), transparent 42%),
    linear-gradient(135deg, #03102d 0%, #082a55 48%, #061736 100%);
}

#splash-vanta-host {
  z-index: 1;
}

.splash-bird {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 0;
  height: 0;
  border-top: var(--wing, 7px) solid transparent;
  border-bottom: var(--wing, 7px) solid transparent;
  border-left: calc(var(--wing, 7px) * 1.8) solid currentColor;
  color: #b6f4ff;
  filter: drop-shadow(0 0 8px rgba(127, 225, 255, 0.42));
  transform: rotate(-12deg);
  animation: splash-bird-drift var(--duration) ease-in-out var(--delay) infinite alternate;
}

.splash-bird--far {
  --wing: 4px;
  opacity: 0.26;
}

.splash-bird--mid {
  --wing: 7px;
  opacity: 0.43;
}

.splash-bird--near {
  --wing: 10px;
  opacity: 0.62;
}

@keyframes splash-bird-drift {
  from { transform: translate3d(-5vw, -2vh, 0) rotate(-12deg); }
  to { transform: translate3d(6vw, 3vh, 0) rotate(12deg); }
}

#splash-brand {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: min(92vw, 760px);
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

#splash-logo {
  font-size: clamp(52px, 7vw, 104px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.035em;
  color: #e7edf1;
  background: linear-gradient(120deg, #f6d985 8%, #ffffff 47%, #b9c6ce 82%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 8px 32px rgba(1, 14, 44, 0.42);
}

#splash-subtitle {
  margin-top: clamp(14px, 2vw, 24px);
  color: #fff;
  font-size: clamp(16px, 1.7vw, 25px);
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.08em;
  text-align: center;
  text-shadow: 0 2px 18px rgba(1, 14, 44, 0.7);
}

#splash-enter {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  width: min(420px, calc(100% - 32px));
  min-height: 52px;
  padding: 12px 20px;
  border: 1px solid rgba(238, 248, 255, 0.42);
  border-radius: 16px;
  background: rgba(9, 45, 90, 0.72);
  box-shadow: 0 8px 30px rgba(0, 12, 39, 0.3);
  color: #fff;
  font: inherit;
  font-size: clamp(14px, 3.8vw, 16px);
  font-weight: 650;
  line-height: 1.35;
  transform: translateX(-50%);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#splash-enter:disabled {
  border-color: rgba(238, 248, 255, 0.22);
  background: rgba(7, 31, 67, 0.58);
  color: rgba(255, 255, 255, 0.68);
}

#splash-enter:not(:disabled) {
  cursor: pointer;
  background: rgba(17, 103, 177, 0.9);
}

@media (max-width: 480px) {
  #splash-brand { width: calc(100% - 32px); }
  #splash-enter { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}

@media (min-width: 900px) {
  #splash-enter { bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  #tmidap-startup,
  flutter-view,
  flt-glass-pane,
  flt-scene-host {
    transition-duration: 1ms;
  }

  .splash-bird {
    animation-duration: 60s;
  }
}
