:root {
  --bg: #080a0e;
  --bg-2: #0c0f15;
  --bg-3: #11151d;
  --panel: rgba(20, 24, 32, 0.55);
  --panel-solid: #141922;
  --glass-border: rgba(255, 255, 255, 0.08);
  --gold: #e7bd5a;
  --gold-2: #f4dc93;
  --gold-deep: #b8912f;
  --text: #eef1f6;
  --muted: #8b93a3;
  --muted-2: #626b7b;
  --green: #3ddc97;
  --red: #ff6b6b;
  --blue: #4dabf7;
  --violet: #7c5cff;
  --line: rgba(255, 255, 255, 0.07);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.75);
  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --sidebar-w: 264px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
/* Ambient background */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(60% 50% at 12% 0%, rgba(231, 189, 90, 0.10), transparent 60%),
    radial-gradient(50% 50% at 100% 10%, rgba(124, 92, 255, 0.10), transparent 55%),
    radial-gradient(70% 60% at 50% 100%, rgba(61, 220, 151, 0.06), transparent 60%),
    var(--bg);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; opacity: 0.04; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1, h2, h3, h4, .b-name { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(231, 189, 90, 0.3); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.09); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(231, 189, 90, 0.3); }

.glass {
  background: var(--panel);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}
.gold-text {
  background: linear-gradient(100deg, var(--gold-2), var(--gold) 45%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.w-full { width: 100%; }
.muted { color: var(--muted); }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-gold { color: var(--gold); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  font-family: var(--font-display); font-weight: 600; font-size: 0.92rem;
  cursor: pointer; transition: transform 0.18s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.2s ease;
  white-space: nowrap; user-select: none;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-gold {
  background: linear-gradient(100deg, var(--gold-2), var(--gold) 60%, var(--gold-deep));
  color: #1a1406; box-shadow: 0 10px 30px -8px rgba(231, 189, 90, 0.55);
}
.btn-gold:hover { transform: translateY(-2px); box-shadow: 0 16px 40px -8px rgba(231, 189, 90, 0.7); }
.btn-ghost { background: rgba(255, 255, 255, 0.04); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(231, 189, 90, 0.4); }
.btn-outline { background: transparent; border-color: rgba(231, 189, 90, 0.45); color: var(--gold-2); }
.btn-outline:hover { background: rgba(231, 189, 90, 0.1); }
.btn-sm { padding: 8px 14px; font-size: 0.82rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn.loading { pointer-events: none; opacity: 0.7; }
.btn.loading::after {
  content: ""; width: 15px; height: 15px; border: 2px solid rgba(0,0,0,0.25);
  border-top-color: #1a1406; border-radius: 50%; animation: spin 0.7s linear infinite;
}

.icon-btn {
  width: 42px; height: 42px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); color: var(--text); cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(231, 189, 90, 0.35); }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.input, select.input, textarea.input {
  width: 100%; padding: 14px 16px; background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text);
  font-family: var(--font-body); font-size: 0.95rem; transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.input:focus { outline: none; border-color: rgba(231, 189, 90, 0.6); background: rgba(255,255,255,0.05); box-shadow: 0 0 0 4px rgba(231, 189, 90, 0.1); }
.input::placeholder { color: var(--muted-2); }
.input.readonly, .input[readonly] { background: rgba(255,255,255,0.02); color: var(--muted); cursor: default; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-right: 96px; }
.input-suffix { position: absolute; right: 12px; display: flex; gap: 8px; }

/* ---------- App shell ---------- */
#app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; position: fixed; top: 0; left: 0; bottom: 0; z-index: 60;
  background: linear-gradient(180deg, rgba(15, 18, 25, 0.95), rgba(9, 11, 16, 0.98));
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
  backdrop-filter: blur(16px); transition: transform 0.3s ease;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 22px 22px 18px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font-size: 1.2rem; color: #1a1406;
  background: linear-gradient(135deg, var(--gold-2), var(--gold-deep)); box-shadow: 0 8px 22px -6px rgba(231,189,90,0.6);
}
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.b-name { font-size: 1.15rem; letter-spacing: 0.05em; }
.b-sub { font-size: 0.7rem; color: var(--gold); letter-spacing: 0.4em; margin-top: 3px; }

.nav { flex: 1; overflow-y: auto; padding: 6px 12px 12px; }
.nav-link, .nav-sub, .nav-parent {
  display: flex; align-items: center; gap: 13px; width: 100%;
  padding: 11px 14px; border-radius: 12px; color: var(--muted); font-size: 0.9rem; font-weight: 600;
  border: none; background: transparent; cursor: pointer; font-family: var(--font-body);
  transition: color 0.18s, background 0.18s; margin-bottom: 2px; position: relative;
}
.nav-link i, .nav-sub i, .nav-parent i:first-child { width: 20px; text-align: center; font-size: 0.98rem; }
.nav-link:hover, .nav-sub:hover, .nav-parent:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.nav-link.active, .nav-sub.active {
  color: var(--gold-2); background: linear-gradient(90deg, rgba(231,189,90,0.14), rgba(231,189,90,0.02));
}
.nav-link.active::before, .nav-sub.active::before {
  content: ""; position: absolute; left: 0; top: 20%; bottom: 20%; width: 3px; border-radius: 3px; background: var(--gold);
}
.nav-parent .chev { margin-left: auto; font-size: 0.7rem; transition: transform 0.25s; }
.nav-group.open .chev { transform: rotate(180deg); }
.nav-children { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; padding-left: 14px; }
.nav-group.open .nav-children { max-height: 420px; }
.nav-sub { font-size: 0.85rem; padding: 9px 12px; }
.sidebar-foot { padding: 14px; border-top: 1px solid var(--line); }

.shell-main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 16px;
  padding: 14px 26px; margin: 14px 18px 0; border-radius: 16px;
}
.page-title { font-size: 1.25rem; margin-right: auto; }
.menu-toggle { display: none; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.net-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: rgba(61, 220, 151, 0.1); border: 1px solid rgba(61, 220, 151, 0.25); color: var(--green);
  font-size: 0.78rem; font-weight: 600;
}
.net-badge i { font-size: 0.55rem; }
.net-badge.bad { background: rgba(255,107,107,0.1); border-color: rgba(255,107,107,0.3); color: var(--red); }
.wallet-chip {
  display: inline-flex; align-items: center; gap: 9px; padding: 9px 16px; border-radius: 999px;
  background: linear-gradient(100deg, rgba(231,189,90,0.16), rgba(231,189,90,0.05));
  border: 1px solid rgba(231,189,90,0.35); color: var(--gold-2); font-weight: 700; font-family: var(--font-display);
  cursor: pointer; font-size: 0.85rem; transition: transform 0.15s, box-shadow 0.2s;
}
.wallet-chip:hover { transform: translateY(-1px); box-shadow: 0 8px 24px -8px rgba(231,189,90,0.4); }
.content { padding: 24px 26px 60px; }

/* ---------- Sections / cards ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 6px 0 18px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.15rem; }
.section-head .sub { color: var(--muted); font-size: 0.86rem; }
.card { padding: 22px; }
.panel { padding: 22px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.flex { display: flex; }
.between { justify-content: space-between; }
.center { align-items: center; }
.gap { gap: 12px; }
.wrap { flex-wrap: wrap; }
.mt { margin-top: 18px; }
.mb { margin-bottom: 18px; }

.copy-inline { cursor: pointer; color: var(--gold); transition: color 0.2s; }
.copy-inline:hover { color: var(--gold-2); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; }
.pill-green { background: rgba(61,220,151,0.12); color: var(--green); }
.pill-red { background: rgba(255,107,107,0.12); color: var(--red); }
.pill-gold { background: rgba(231,189,90,0.14); color: var(--gold-2); }
.pill-muted { background: rgba(255,255,255,0.06); color: var(--muted); }

/* ---------- Modals ---------- */
.modal-overlay, .tx-modal-overlay {
  position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center;
  background: rgba(4, 6, 10, 0.7); backdrop-filter: blur(6px); opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease; padding: 20px;
}
.modal-overlay.show, .tx-modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal { width: 100%; max-width: 460px; padding: 26px; transform: translateY(14px) scale(0.98); transition: transform 0.3s cubic-bezier(0.2,0.8,0.3,1); }
.modal-overlay.show .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.modal-head h3 { font-size: 1.15rem; display: flex; align-items: center; gap: 10px; }
.modal-sub { color: var(--muted); font-size: 0.85rem; margin-bottom: 18px; }
.modal-foot { margin-top: 18px; text-align: center; color: var(--muted); font-size: 0.78rem; }
.wallet-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.wallet-option {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--line); cursor: pointer; color: var(--text);
  font-family: var(--font-body); font-weight: 600; font-size: 0.9rem; transition: transform 0.15s, border-color 0.2s, background 0.2s; position: relative;
}
.wallet-option:hover { transform: translateY(-2px); border-color: rgba(231,189,90,0.45); background: rgba(231,189,90,0.06); }
.wo-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(231,189,90,0.12); color: var(--gold-2); font-size: 1.1rem; flex-shrink: 0; }
.wo-name { flex: 1; }
.wo-detected { font-size: 0.6rem; color: var(--green); background: rgba(61,220,151,0.12); padding: 3px 6px; border-radius: 6px; }
.wo-install { font-size: 0.6rem; color: var(--muted-2); }
.wallet-option.loading { opacity: 0.6; pointer-events: none; }

.account-menu {
  position: fixed; z-index: 130; width: 240px; padding: 8px; box-shadow: var(--shadow);
}
.am-addr { padding: 10px 12px; font-family: "JetBrains Mono", monospace; font-size: 0.82rem; color: var(--gold-2); border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.am-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 10px; background: transparent; border: none; color: var(--text); font-family: var(--font-body); font-size: 0.86rem; cursor: pointer; transition: background 0.15s; }
.am-item:hover { background: rgba(255,255,255,0.06); }
.am-item.danger { color: var(--red); }

/* ---------- Tx dialog ---------- */
.tx-modal { width: 100%; max-width: 400px; padding: 30px; text-align: center; }
.tx-spinner { position: relative; width: 74px; height: 74px; margin: 0 auto 18px; display: grid; place-items: center; }
.tx-spinner .ring { position: absolute; inset: 0; border-radius: 50%; border: 3px solid rgba(231,189,90,0.18); border-top-color: var(--gold); animation: spin 0.9s linear infinite; }
.tx-spinner i { font-size: 1.4rem; color: var(--gold-2); }
.tx-spinner.done .ring { animation: none; border-color: var(--green); border-top-color: var(--green); }
.tx-spinner.done i::before { content: "\f00c"; }
.tx-spinner.failed .ring { animation: none; border-color: var(--red); border-top-color: var(--red); }
.tx-spinner.failed i { color: var(--red); }
.tx-spinner.failed i::before { content: "\f00d"; }
.tx-title { font-size: 1.1rem; margin-bottom: 16px; }
.tx-steps { text-align: left; margin: 0 auto 14px; max-width: 240px; }
.tx-step { display: flex; align-items: center; gap: 10px; padding: 5px 0; color: var(--muted-2); font-size: 0.85rem; transition: color 0.2s; }
.tx-step .dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,0.15); transition: background 0.2s, box-shadow 0.2s; }
.tx-step.active { color: var(--gold-2); }
.tx-step.active .dot { background: var(--gold); box-shadow: 0 0 0 4px rgba(231,189,90,0.15); }
.tx-step.complete { color: var(--green); }
.tx-step.complete .dot { background: var(--green); }
.tx-note { color: var(--muted); font-size: 0.82rem; margin-bottom: 12px; min-height: 18px; }
.tx-link { display: inline-flex; align-items: center; gap: 7px; color: var(--gold-2); font-size: 0.82rem; margin-bottom: 12px; }

/* ---------- Toasts ---------- */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px;
  background: rgba(18, 22, 30, 0.92); backdrop-filter: blur(14px); border: 1px solid var(--line);
  box-shadow: var(--shadow); transform: translateX(120%); opacity: 0; transition: transform 0.3s cubic-bezier(0.2,0.8,0.3,1), opacity 0.3s;
}
.toast.show { transform: none; opacity: 1; }
.toast-icon { font-size: 1.15rem; }
.toast-success { border-left: 3px solid var(--green); } .toast-success .toast-icon { color: var(--green); }
.toast-error { border-left: 3px solid var(--red); } .toast-error .toast-icon { color: var(--red); }
.toast-info { border-left: 3px solid var(--blue); } .toast-info .toast-icon { color: var(--blue); }
.toast-warning { border-left: 3px solid var(--gold); } .toast-warning .toast-icon { color: var(--gold); }
.toast-msg { flex: 1; font-size: 0.86rem; }
.toast-close { background: none; border: none; color: var(--muted); cursor: pointer; }

/* ---------- Empty states ---------- */
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-state i { font-size: 2.4rem; color: rgba(231,189,90,0.4); margin-bottom: 14px; display: block; }
.empty-state h4 { color: var(--text); margin-bottom: 6px; }

/* ---------- Social share ---------- */
.share-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.share-btn {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.05rem;
  background: rgba(255,255,255,0.04); border: 1px solid var(--line); color: var(--text); cursor: pointer;
  transition: transform 0.15s, background 0.2s, color 0.2s, border-color 0.2s;
}
.share-btn:hover { transform: translateY(-3px); border-color: rgba(231,189,90,0.4); }
.share-btn.whatsapp:hover { background: rgba(37,211,102,0.15); color: #25d366; }
.share-btn.telegram:hover { background: rgba(34,158,217,0.15); color: #229ed9; }
.share-btn.twitter:hover { background: rgba(255,255,255,0.12); color: #fff; }
.share-btn.facebook:hover { background: rgba(24,119,242,0.15); color: #4dabf7; }
.share-btn.native:hover { background: rgba(231,189,90,0.15); color: var(--gold-2); }

/* Live indicator */
.live-dot { display: inline-flex; align-items: center; gap: 7px; font-size: 0.74rem; color: var(--green); }
.live-dot .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(61,220,151,0.5); animation: pulseGlowGreen 2s infinite; }
@keyframes pulseGlowGreen { 0%,100% { box-shadow: 0 0 0 0 rgba(61,220,151,0.5);} 50% { box-shadow: 0 0 0 6px rgba(61,220,151,0);} }
.load-more-wrap { text-align: center; margin-top: 18px; }

/* ---------- Rank badge ---------- */
.rank-badge {
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 1.35rem;
  color: #12141a; position: relative; flex-shrink: 0;
  box-shadow: 0 10px 26px -8px rgba(0,0,0,0.6);
}
.rank-badge.lg { width: 68px; height: 68px; font-size: 1.7rem; border-radius: 20px; }
.rank-badge::after { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 1px solid rgba(255,255,255,0.35); }
.rank-badge.rankup { animation: rankup 1.1s cubic-bezier(0.2,0.8,0.3,1); }
@keyframes rankup {
  0% { transform: scale(0.5) rotate(-25deg); opacity: 0; }
  50% { transform: scale(1.25) rotate(8deg); }
  70% { transform: scale(0.95) rotate(-3deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.rank-pill-icon { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- Auto-compound toggle ---------- */
.compound-toggle { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; font-size: 0.82rem; color: var(--muted); }
.switch { width: 40px; height: 22px; border-radius: 999px; background: rgba(255,255,255,0.12); position: relative; transition: background 0.2s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.2s; }
.compound-toggle.on .switch { background: linear-gradient(100deg, var(--gold-2), var(--gold-deep)); }
.compound-toggle.on .switch::after { transform: translateX(18px); }
.compound-toggle.on { color: var(--gold-2); }

/* ---------- Celebrate confetti ---------- */
.celebrate-layer { position: fixed; inset: 0; pointer-events: none; z-index: 250; overflow: hidden; }
.celebrate-layer i { position: absolute; top: -12px; width: 9px; height: 9px; border-radius: 2px; animation: cfall linear forwards; }
@keyframes cfall { to { top: 110%; transform: rotate(720deg); opacity: 0; } }

/* ---------- Depth table ---------- */
.depth-bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,0.06); overflow: hidden; min-width: 90px; }
.depth-bar .f { height: 100%; background: linear-gradient(90deg, var(--gold-2), var(--gold-deep)); border-radius: 999px; }
