/* Базовые переменные Telegram WebApp (fallback на тёмную/светлую) */
:root {
  --tg-theme-bg-color: #1e1e1e;
  --tg-theme-text-color: #ffffff;
  --tg-theme-hint-color: #708499;
  --tg-theme-link-color: #6ab2f2;
  --tg-theme-button-color: #5288c1;
  --tg-theme-button-text-color: #ffffff;
  --tg-theme-secondary-bg-color: #131313;
  --tg-theme-header-bg-color: #1e1e1e;
  --tg-theme-section-bg-color: #2c2c2e;
  --tg-theme-section-header-text-color: #6ab2f2;
  --tg-theme-destructive-text-color: #ff453a;

  --radius-card: 12px;
  --radius-btn: 10px;
  --gap: 12px;

  --color-ok: #2ea043;
  --color-warn: #f0b400;
  --color-err: #f04438;
}

@media (prefers-color-scheme: light) {
  :root {
    --tg-theme-bg-color: #ffffff;
    --tg-theme-text-color: #000000;
    --tg-theme-hint-color: #707579;
    --tg-theme-secondary-bg-color: #f1f1f1;
    --tg-theme-section-bg-color: #ffffff;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  background: var(--tg-theme-secondary-bg-color);
  color: var(--tg-theme-text-color);
  font-size: 15px;
  line-height: 1.4;
  overscroll-behavior-y: contain;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: var(--tg-theme-button-color);
  color: var(--tg-theme-button-text-color);
  border-radius: var(--radius-btn);
  padding: 12px 16px;
  transition: transform .08s ease, opacity .15s ease;
}
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
