:root {
  color-scheme: dark;
  --bg: #07080a;
  --panel: #0e0f12;
  --panel-2: #141519;
  --panel-3: #1b1c21;
  --line: rgba(255, 255, 255, 0.075);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #ededef;
  --text-2: #a4a4ad;
  --muted: #6c6c77;
  --accent: #5c8cff;
  --accent-2: #8fb0ff;
  --accent-soft: rgba(92, 140, 255, 0.12);
  --accent-line: rgba(92, 140, 255, 0.4);
  --ton: #3aa0ff;
  --ton-soft: rgba(58, 160, 255, 0.12);
  --usdt: #2fbf8f;
  --usdt-soft: rgba(47, 191, 143, 0.13);
  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, 0.12);
  --warn: #f5b454;
  --warn-soft: rgba(245, 180, 84, 0.12);
  --bad: #ff6b6b;
  --bad-soft: rgba(255, 107, 107, 0.12);
  --r-lg: 16px;
  --r: 12px;
  --r-sm: 8px;
  --font: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --nav-h: 64px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
code, kbd, pre { font-family: var(--mono); }
::selection { background: rgba(92, 140, 255, 0.35); }

h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -0.03em; line-height: 1.08; }

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

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 28px; }
@media (max-width: 720px) { .container { padding: 0 18px; } }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }
.mono { font-family: var(--mono); }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 18px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.18s var(--ease), opacity 0.18s;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover { background: var(--panel-3); border-color: rgba(255, 255, 255, 0.22); }
.btn:active { transform: scale(0.985); }
.btn svg { width: 17px; height: 17px; flex: none; }

.btn-primary { background: #f2f2f4; border-color: #f2f2f4; color: #0a0a0c; }
.btn-primary:hover { background: #fff; border-color: #fff; }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); border-color: transparent; color: var(--text); }

.btn-outline { background: transparent; }

.btn-lg { height: 50px; padding: 0 24px; font-size: 15.5px; border-radius: 10px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }

.btn[disabled], .btn.is-disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
}

.icon-btn:hover { background: var(--panel-3); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }

/* ---------------------------------------------------------------- small parts */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.025);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  text-decoration: none;
}

.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); animation: pulse 2.4s infinite; }
.dot.bad { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(61, 220, 151, 0); } }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-2);
}

.badge-gold, .badge-accent { background: var(--accent-soft); color: var(--accent-2); }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-ton { background: var(--ton-soft); color: var(--ton); }

.method {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  height: 22px;
  padding: 0 6px;
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.method-get { background: var(--ok-soft); color: var(--ok); }
.method-post { background: var(--accent-soft); color: var(--accent-2); }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
}

.coin { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none; }
.coin svg { width: 18px; height: 18px; }
.coin-ton { background: var(--ton-soft); color: var(--ton); }
.coin-usdt { background: var(--usdt-soft); color: var(--usdt); }
.coin-star { background: var(--accent-soft); color: var(--accent); }

.skeleton {
  display: inline-block;
  height: 1em;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.04) 25%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------------------------------------- code */

.code-window {
  border-radius: var(--r-lg);
  border: 1px solid var(--line-2);
  background: #0a0b0d;
  overflow: hidden;
}

.code-window-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.code-window-bar i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); }

.code-window pre {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.75;
  color: var(--text-2);
  -webkit-overflow-scrolling: touch;
}

.tok-k { color: #c9a7ff; }
.tok-s { color: #9fe0b4; }
.tok-n { color: #ffb88a; }
.tok-c { color: var(--muted); }
.tok-g, .tok-a { color: var(--accent-2); }
.tok-p { color: var(--text); }

/* ---------------------------------------------------------------- nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--nav-h);
  background: rgba(7, 8, 10, 0.78);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-inner { display: flex; align-items: center; gap: 28px; height: 100%; }

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg);
}

.logo-mark svg { width: 17px; height: 17px; }
.logo b { color: var(--accent); font-weight: 700; }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ---------------------------------------------------------------- toasts */

.toasts {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(92vw, 420px);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--r);
  background: rgba(27, 28, 33, 0.97);
  border: 1px solid var(--line-2);
  box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.8);
  font-size: 14px;
  font-weight: 500;
  animation: toast-in 0.35s var(--ease);
}

.toast-ok .dot { background: var(--ok); }
.toast-bad .dot { background: var(--bad); }
.toast-gold .dot { background: var(--accent); }
.toast.leaving { opacity: 0; transform: translateY(8px); transition: 0.3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }

/* ---------------------------------------------------------------- footer */

.footer { border-top: 1px solid var(--line); padding: 36px 0 calc(40px + env(safe-area-inset-bottom)); color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 22px; }
.footer-links a { text-decoration: none; color: var(--text-2); }
.footer-links a:hover { color: var(--text); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
