:root {
  color-scheme: dark light;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #0b0f14;
  color: #f5f7fa;
}

/* Flutter hides selection in its internal text fields. Keep the real mobile
   editor inputs visibly selected while retaining the browser's native handles. */
flutter-view input.avatar-native-editor-field::selection,
flutter-view textarea.avatar-native-editor-field::selection {
  background-color: var(--avatar-editor-selection-color, rgba(127, 95, 220, 0.55)) !important;
}

html,
body {
  width: 100%;
  max-width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overflow-x: clip;
  overscroll-behavior: none;
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
#app-loading::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

#app-loading {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: #0b0f14;
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  opacity: 1;
}

html[data-splash-enabled="false"] #app-loading:not(.failed) {
  display: none;
}

#app-loading.leaving {
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease-out;
}

#app-loading .launch-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  color: #ffffff;
  font-family: sans-serif;
  font-size: 28px;
  font-weight: 700;
  line-height: normal;
}

#app-loading .launch-brand img {
  display: block;
  width: 144px;
  height: 144px;
  object-fit: contain;
}

#app-loading .startup-message {
  display: none;
  margin: 0;
}

#app-loading.failed {
  gap: 16px;
  padding: 32px;
  box-sizing: border-box;
}

#app-loading.failed .launch-brand {
  display: none;
}

#app-loading.failed .startup-message {
  display: block;
}

#app-loading.failed p {
  max-width: 32rem;
  color: #ffb4ab;
}

#app-loading button {
  appearance: none;
  border: 1px solid #9b5cf6;
  border-radius: 999px;
  padding: 10px 22px;
  background: #9b5cf6;
  color: #ffffff;
  font: inherit;
  cursor: pointer;
}
