/* base.css — reset + base typography. Loaded after tokens.css. */

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

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

body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* M0 — мобильный гард: ни одна страница не должна скроллиться вбок. `clip`
     (не `hidden`) не создаёт scroll-контейнер → не ломает position:sticky
     (липкая bet-bar) и якоря. Реальные оверфлоу-источники чиним в mobile.css. */
  overflow-x: clip;
  overflow-wrap: break-word;   /* длинные строки (крипто-адреса) не распирают layout */
}

/* M0 — тач: убрать серую вспышку при тапе + 300ms-задержку на интерактивных. */
a, button, input, select, textarea, label, [role="button"], .btn {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Все числа — табличные фигуры по умолчанию (балансы, суммы, мультипликаторы) */
.num,
[data-num],
.balance,
.amount,
.multiplier,
input[type="number"],
table td,
.font-mono {
  font-variant-numeric: tabular-nums;
}

.font-mono { font-family: var(--font-mono); }
.font-display { font-family: var(--font-display); }

/* По макету: bold (700) — только для самых крупных заголовков (баннер/h1).
   Остальные заголовки — semibold (600). Тело — regular (400). */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text-primary);
}

h1 { font-size: var(--text-3xl); font-weight: 700; }  /* самый крупный — bold */
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { color: var(--color-text-secondary); }

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--color-accent); }

img, svg { display: block; max-width: 100%; }

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button { cursor: pointer; background: none; border: none; }

ul, ol { list-style: none; }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Скроллбары (webkit) — тёмные, ненавязчивые */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--color-bg-secondary); }
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-border-hover); }

/* Утилиты-хелперы */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden { display: none !important; }

.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }
.text-accent { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }

.container {
  width: 100%;
  max-width: var(--content-max-width);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

@media (max-width: 768px) {
  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
  .container { padding-inline: var(--space-4); }
}

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