:root {
  --bg: #040916;
  --bg-2: #071126;
  --panel: rgba(8, 17, 33, 0.86);
  --panel-2: rgba(7, 14, 29, 0.94);
  --line: rgba(58, 134, 255, 0.16);
  --line-strong: rgba(58, 134, 255, 0.28);
  --text: #e8f1ff;
  --muted: #8ea2c5;
  --muted-2: #6f84a8;
  --blue: #3a86ff;
  --blue-soft: rgba(58, 134, 255, 0.12);
  --cyan: #00d9ff;
  --loader-accent: #3a86ff;
  --loader-accent-rgb: 58, 134, 255;
  --green: #00ff9c;
  --red: #ff5f7a;
  --yellow: #ffd166;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 10px 28px rgba(20, 80, 180, 0.12);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
  scrollbar-width: none !important;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(
      circle at 16% 10%,
      rgba(58, 134, 255, 0.14),
      transparent 22%
    ),
    radial-gradient(circle at 82% 8%, rgba(0, 217, 255, 0.08), transparent 18%),
    linear-gradient(180deg, #020611 0%, #050b19 38%, #030814 100%);
  color: var(--text);
  font-family: "Inter", sans-serif;
}

body {
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.012), rgba(255, 255, 255, 0.012)),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 46px,
      rgba(58, 134, 255, 0.025) 47px,
      transparent 48px
    );
  pointer-events: none;
  opacity: 0.28;
}

/* LOADER */
.app-loader {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(
      circle at center,
      rgba(var(--loader-accent-rgb, 58, 134, 255), 0.12),
      transparent 28%
    ),
    linear-gradient(180deg, #020611 0%, #040916 55%, #020814 100%);
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

.app-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-core {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: min(92vw, 420px);
  text-align: center;
}

.loader-logo-wrap {
  position: relative;
  width: 170px;
  height: 170px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-glow {
  position: absolute;
  inset: 18%;
  border-radius: 999px;
  background: radial-gradient(
    circle,
    rgba(var(--loader-accent-rgb, 58, 134, 255), 0.28),
    transparent 70%
  );
  filter: blur(28px);
  animation: loaderGlowPulse 2.4s ease-in-out infinite;
}

.loader-logo {
  position: relative;
  z-index: 1;
  width: 135px;
  height: 135px;
  object-fit: contain;
  opacity: 1;
  filter: drop-shadow(0 0 14px rgba(var(--loader-accent-rgb, 58, 134, 255), 0.22))
    drop-shadow(0 0 32px rgba(var(--loader-accent-rgb, 58, 134, 255), 0.14));
  animation: loaderFloat 2.4s ease-in-out infinite;
}

.loader-title {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.8rem);
  letter-spacing: 0.01em;
  color: color-mix(in srgb, var(--loader-accent, #3a86ff) 42%, white);
  text-shadow: 0 0 18px rgba(var(--loader-accent-rgb, 58, 134, 255), 0.15);
}

.loader-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

.loader-bar {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(var(--loader-accent-rgb, 58, 134, 255), 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.loader-bar-fill {
  height: 100%;
  width: 45%;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--loader-accent, #3a86ff) 88%, black),
    color-mix(in srgb, var(--loader-accent, #3a86ff) 84%, white)
  );
  box-shadow: 0 0 14px rgba(var(--loader-accent-rgb, 58, 134, 255), 0.3);
  animation: loaderBarMove 1.6s ease-in-out infinite;
}

@keyframes loaderFloat {
  0%,
  100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-8px) scale(1.02);
  }
}

@keyframes loaderGlowPulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.94);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

@keyframes loaderBarMove {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(260%);
  }
}


@media (max-width: 860px) {
  .app-loader {
    padding:
      max(env(safe-area-inset-top, 0px), 18px)
      18px
      max(env(safe-area-inset-bottom, 0px), 18px);
  }

  .loader-core {
    width: min(88vw, 360px);
    gap: 12px;
    transform: translateY(-7vh);
  }

  .loader-logo-wrap {
    width: 150px;
    height: 150px;
  }

  .loader-logo {
    width: 118px;
    height: 118px;
  }

  .loader-title {
    font-size: clamp(2.25rem, 8vw, 3rem);
  }

  .loader-subtitle {
    font-size: 0.95rem;
  }

  .loader-bar {
    margin-top: 4px;
  }
}


/* Render stability 3.0.22: o canvas raiz nunca fica branco durante repintura/overscroll. */
html {
  min-height: 100%;
  background-color: #03060d !important;
  overscroll-behavior-y: none;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: #03060d !important;
  overscroll-behavior-y: none;
}

body::before {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  min-height: 100dvh;
  background-color: #03060d;
}

/* A mascara animada em dezenas de cards gerava repaints caros ao rolar rapido. */
.moving-border::before {
  display: none !important;
  animation: none !important;
}


/* RC49: ícones vetoriais no lugar de glifos/emoji. */
.auth-email-icon svg { width: 1.15em; height: 1.15em; }
.mobile-nav-icon svg { width: 1.15em; height: 1.15em; display: block; }
.expense-category-remove-button svg { width: 16px; height: 16px; }
.bet-core-history-hit-mark svg { width: 16px; height: 16px; display: block; }
