*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
  letter-spacing: inherit;
}

button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }

input, select, textarea { outline: none; }

h1, h2, h3, h4, h5, h6, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 { font-weight: 600; line-height: 1.25; }

table { border-collapse: collapse; width: 100%; }

::selection { background: var(--brand); color: var(--brand-ink); }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-xs); }

/* Scrollbars discretas */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; }
*::-webkit-scrollbar-track { background: transparent; }

.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Utilitários */
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.brand { color: var(--brand); }
.win { color: var(--win); }
.loss { color: var(--loss); }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }
.flex { display: flex; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { display: grid; place-items: center; }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-6 { margin-top: 24px; } .mt-8 { margin-top: 32px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* Preloader */
#preloader {
  position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center;
  background: var(--bg); transition: opacity 400ms var(--ease), visibility 400ms;
}
#preloader.done { opacity: 0; visibility: hidden; }
.preloader-logo {
  width: 64px; height: 64px; border-radius: 18px;
  background: var(--brand) url("../assets/brand/mark.svg") center / 70% no-repeat;
  box-shadow: 0 0 0 0 var(--brand-glow);
  animation: preloader-pulse 1.2s var(--ease) infinite;
}
@keyframes preloader-pulse {
  0% { transform: scale(0.92); box-shadow: 0 0 0 0 var(--brand-glow); }
  60% { transform: scale(1); box-shadow: 0 0 0 22px rgba(34, 226, 122, 0); }
  100% { transform: scale(0.92); box-shadow: 0 0 0 0 rgba(34, 226, 122, 0); }
}
