/* ============================================================
   Плата — premium VPN. Obsidian + champagne-gold, refined.
   ============================================================ */
:root {
  --bg: #0a0a0c;
  --bg-2: #0f0e12;
  --ink: #ece8e1;            /* platinum text */
  --ink-dim: #b6b1a6;
  --muted: #7f7a70;
  --line: rgba(216,179,114,.16);
  --line-soft: rgba(255,255,255,.06);
  --gold: #d8b372;
  --gold-bright: #f2dcab;
  --gold-deep: #b5904f;
  --glass: rgba(255,255,255,.025);
  --glass-2: rgba(255,255,255,.045);
  --green: #8fd6a6;
  --red: #e89a8a;
  --r: 18px;
  --shadow: 0 24px 60px -28px rgba(0,0,0,.85);
  --font-display: "Cormorant Garamond", Georgia, serif;
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: .1px;
  padding-bottom: 88px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Atmospheric layers */
.bg-glow {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(900px 480px at 50% -8%, rgba(216,179,114,.14), transparent 60%),
    radial-gradient(700px 500px at 100% 12%, rgba(120,98,60,.10), transparent 55%),
    linear-gradient(180deg, #0c0b0e 0%, var(--bg) 42%, #08080a 100%);
}
.bg-grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.app-root { padding: 22px 18px 0; max-width: 540px; margin: 0 auto; }
.screen { display: flex; flex-direction: column; gap: 14px; }
.screen > * { animation: rise .5s cubic-bezier(.22,.61,.36,1) backwards; }
.screen > *:nth-child(2){animation-delay:.05s}
.screen > *:nth-child(3){animation-delay:.1s}
.screen > *:nth-child(4){animation-delay:.15s}
.screen > *:nth-child(5){animation-delay:.2s}
.screen > *:nth-child(6){animation-delay:.25s}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Brand wordmark */
.brand-wrap { text-align: center; padding: 12px 0 6px; }
.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 52px;
  line-height: .95;
  letter-spacing: 1px;
  margin: 0;
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 45%, var(--gold-deep) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 18px rgba(216,179,114,.25));
}
.brand-sub {
  font-size: 11px; letter-spacing: 4px; text-transform: uppercase;
  color: var(--muted); margin-top: 8px; font-weight: 600;
}
.brand-rule {
  width: 46px; height: 1px; margin: 12px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 27px; letter-spacing: .3px; margin: 6px 2px;
}
h3 {
  font-size: 11px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--muted); font-weight: 700; margin: 14px 2px 2px;
}

/* Cards — glass with hairline gold edge */
.card {
  position: relative;
  background: var(--glass);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.card-accent {
  background:
    linear-gradient(135deg, rgba(216,179,114,.12), rgba(216,179,114,.02));
  border: 1px solid var(--line);
}
.card-accent::before {
  content: ""; position: absolute; inset: 0; border-radius: var(--r); padding: 1px;
  background: linear-gradient(135deg, rgba(242,220,171,.55), transparent 40%, transparent 70%, rgba(181,144,79,.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.card-title { font-weight: 700; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold); }
.row { display: flex; justify-content: space-between; align-items: center; }
.muted { color: var(--muted); font-size: 13px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { align-items: center; text-align: center; gap: 6px; }
.stat-val { font-family: var(--font-display); font-size: 30px; font-weight: 600; color: var(--gold-bright); }
.stat-lbl { font-size: 10px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--muted); }

/* Buttons */
.btn {
  appearance: none; cursor: pointer; width: 100%;
  font-family: var(--font-body); font-size: 14px; font-weight: 700;
  letter-spacing: .4px;
  padding: 15px 18px; border-radius: 13px;
  background: var(--glass-2); color: var(--ink);
  border: 1px solid var(--line-soft);
  transition: transform .12s ease, border-color .2s ease, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; }
.btn-primary {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 55%, var(--gold-deep));
  color: #20180b; border: none;
  box-shadow: 0 12px 30px -10px rgba(216,179,114,.5);
}
.btn-ghost { background: transparent; color: var(--ink-dim); border: 1px solid var(--line-soft); }
.btn-sm { width: auto; padding: 9px 14px; font-size: 12px; }

.input {
  width: 100%; font-family: var(--font-body); font-size: 15px;
  background: rgba(0,0,0,.25); color: var(--ink);
  border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 13px 15px; transition: border-color .2s;
}
.input:focus { outline: none; border-color: var(--gold); }
textarea.input { resize: vertical; }

.badge {
  font-size: 10px; font-weight: 700; letter-spacing: .5px;
  color: var(--gold-bright); border: 1px solid var(--line);
  border-radius: 999px; padding: 2px 8px;
}

/* Tariffs */
.tariffs { display: flex; flex-direction: column; gap: 12px; }
.tariff { gap: 4px; }
.tariff-label { font-weight: 700; font-size: 14px; }
.tariff-price { font-family: var(--font-display); font-size: 34px; font-weight: 600; color: var(--gold-bright); line-height: 1; }
.tariff-days { color: var(--muted); font-size: 12px; letter-spacing: .5px; }
.tariff .btn { margin-top: 8px; }

/* Keys / links */
.link-card { gap: 8px; }
.link-srv { font-weight: 700; font-size: 14px; }
.link-val {
  font-family: ui-monospace, "SF Mono", monospace; font-size: 11px; color: var(--ink-dim);
  word-break: break-all; background: rgba(0,0,0,.3); padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line-soft);
}

/* Referral levels */
.lvl-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft);
}
.lvl-row:last-child { border-bottom: none; }
.lvl-name { font-size: 13px; display: flex; gap: 6px; align-items: center; }
.lvl-count { color: var(--muted); font-size: 12px; }
.lvl-earned { color: var(--gold-bright); font-weight: 700; font-size: 13px; min-width: 70px; text-align: right; }

/* Balance / wallet */
.balance-card { align-items: center; text-align: center; gap: 8px; }
.balance-val { font-family: var(--font-display); font-size: 44px; font-weight: 600;
  color: var(--gold-bright); line-height: 1; letter-spacing: .5px; }
.balance-val .cur { font-size: 18px; color: var(--gold); letter-spacing: 1px; }
.tariff-price .cur { font-size: 14px; color: var(--gold); }
.balance-mini { flex-direction: row; align-items: center; justify-content: space-between;
  padding: 12px 16px; }
.token-chip { text-align: center; font-family: ui-monospace, monospace; font-size: 13px;
  color: var(--gold-bright); letter-spacing: 1px; padding: 6px;
  border: 1px solid var(--line); border-radius: 999px; }
.topup-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.topup-grid .btn { flex: 1 1 28%; }
.topup-custom { display: flex; gap: 8px; margin-top: 8px; align-items: center; }
.topup-custom .input { flex: 1; }
.topup-custom .btn { white-space: nowrap; }
.pay-method { margin-top: 12px; font-size: 12px; font-weight: 700; letter-spacing: .5px;
  color: var(--gold); text-transform: uppercase; }
.tron-pay { display: flex; flex-direction: column; gap: 10px; align-items: stretch;
  margin-top: 10px; color: var(--ink); }
.tron-pay .qr { width: 180px; height: 180px; align-self: center; border-radius: 12px;
  background: #fff; padding: 8px; }
.docs-footer { text-align: center; margin-top: 20px; font-size: 12px; color: var(--muted); }
.docs-footer .doc-link { color: var(--gold); text-decoration: none; }
.wallet-help { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; color: var(--ink); }
.wallet-help a { text-decoration: none; text-align: center; }

/* Referral tree */
.ref-tree { gap: 0; padding: 16px 16px 18px; }
.tnode { position: relative; padding: 12px 0 12px 18px; border-left: 1px solid var(--line-soft); }
.tnode.on { border-left-color: var(--gold); }
.tnode-tick { position: absolute; left: -1px; top: 24px; width: 14px; height: 1px; background: var(--line-soft); }
.tnode.on .tnode-tick { background: var(--gold); }
.tnode-tick::after {
  content: ""; position: absolute; right: -4px; top: -3.5px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--bg); border: 1px solid var(--line-soft);
}
.tnode.on .tnode-tick::after {
  background: var(--gold); border-color: var(--gold); box-shadow: 0 0 9px rgba(216,179,114,.6);
}
.tnode-body { padding-left: 14px; }
.tnode-head { display: flex; align-items: center; gap: 8px; }
.tnode-line { font-weight: 700; font-size: 13px; letter-spacing: .3px; }
.tnode-earned { margin-left: auto; color: var(--gold-bright); font-weight: 700; font-size: 13px; }
.tnode-count { font-size: 12px; color: var(--muted); margin-top: 3px; }
.tnode-count b { font-family: var(--font-display); font-size: 19px; color: var(--ink-dim); margin-right: 3px; }
.tnode.on .tnode-count b { color: var(--gold-bright); }
.tnode-bar { height: 4px; border-radius: 999px; background: rgba(255,255,255,.05); margin-top: 8px; overflow: hidden; }
.tnode-bar span { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-bright)); }

.tx { padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.tx-plus { color: var(--green); font-weight: 700; }
.tx-minus { color: var(--red); font-weight: 700; }

/* Tabs */
.tabs { display: flex; gap: 8px; }
.tab {
  flex: 1; padding: 11px; border-radius: 11px; cursor: pointer; font-size: 12px; font-weight: 700;
  background: var(--glass-2); color: var(--muted); border: 1px solid var(--line-soft);
  transition: .2s;
}
.tab.active { background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep)); color: #20180b; border: none; }

.loading, .error { text-align: center; color: var(--muted); padding: 48px 0; font-family: var(--font-display); font-size: 18px; }
.error { color: var(--red); }

/* Bottom nav — glass */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  display: flex; justify-content: space-around;
  padding: 10px 6px calc(12px + env(safe-area-inset-bottom));
  background: rgba(10,10,12,.82); backdrop-filter: blur(20px) saturate(140%);
  border-top: 1px solid var(--line);
}
.nav-item { flex: 1; text-align: center; cursor: pointer; color: var(--muted); transition: color .2s; }
.nav-item.active { color: var(--gold-bright); }
.nav-item.active .nav-icon { filter: drop-shadow(0 0 10px rgba(216,179,114,.6)); }
.nav-icon { font-size: 19px; }
.nav-label { font-size: 10px; margin-top: 3px; letter-spacing: .5px; font-weight: 600; }

.toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%);
  background: rgba(20,18,15,.96); color: var(--gold-bright);
  padding: 11px 20px; border-radius: 999px; font-size: 13px; font-weight: 600;
  z-index: 100; border: 1px solid var(--line); box-shadow: var(--shadow);
}
