:root {
  --bg: #080B18;
  --bg-elevated: #0F1530;
  --panel: #121A3A;
  --panel-line: #232C56;
  --blue: #2E6BFF;
  --blue-soft: #4C7EFF;
  --green: #22D9A6;
  --green-soft: #5CE8C4;
  --ink: #EEF1FB;
  --ink-dim: #98A2C7;
  --ink-faint: #5C6690;
  --danger: #FF6B6B;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.screen {
  max-width: 430px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background:
    radial-gradient(120% 60% at 100% -10%, rgba(46,107,255,0.18), transparent 55%),
    radial-gradient(90% 50% at -10% 0%, rgba(34,217,166,0.10), transparent 60%),
    var(--bg);
  padding-bottom: 96px;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 8px;
}

.icon-btn {
  width: 40px; 
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--panel-line);
  background: rgba(255,255,255,0.02);
  display: flex; 
  align-items: center; 
  justify-content: center;
  color: var(--ink-dim);
  position: relative;
  cursor: pointer;
  text-decoration: none;
}
.icon-btn svg { width: 18px; height: 18px; }

.badge-dot {
  position: absolute; 
  top: -4px; 
  right: -4px;
  width: 9px; 
  height: 9px; 
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px var(--bg);
}

.brand {
  display: flex; 
  align-items: center; 
  gap: 9px;
  text-decoration: none;
}
.brand-mark { width: 30px; height: 34px; }
.brand-word {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--ink);
}
.brand-word span { color: var(--green-soft); }
.brand-sub {
  font-size: 9.5px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  margin-top: 1px;
}

/* ---------- Greeting ---------- */
.greeting {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 0;
}
.avatar {
  width: 52px; 
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(160deg, var(--blue), var(--green));
  padding: 2px;
  flex-shrink: 0;
}
.avatar img {
  width: 100%; 
  height: 100%;
  border-radius: 14px;
  object-fit: cover;
  display: block;
  background: #1a2350;
}
.greeting-text { flex: 1; min-width: 0; }
.greeting-hi { font-size: 12.5px; color: var(--ink-faint); }
.greeting-name {
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 17px;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-chip {
  display: inline-flex; 
  align-items: center; 
  gap: 5px;
  margin-top: 6px;
  font-size: 11px; 
  font-weight: 600;
  color: var(--green-soft);
  background: rgba(34,217,166,0.10);
  border: 1px solid rgba(34,217,166,0.25);
  padding: 3px 9px 3px 7px;
  border-radius: 100px;
}
.rank-chip .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--green-soft); }
.id-tag {
  text-align: right;
  font-size: 10.5px;
  color: var(--ink-faint);
  line-height: 1.5;
}
.id-tag b { color: var(--ink-dim); font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- Balance hero ---------- */
.hero {
  margin: 22px 20px 0;
  position: relative;
  border-radius: 26px;
  padding: 24px 22px 22px;
  background: linear-gradient(150deg, #101a3f 0%, #0c1330 65%);
  border: 1px solid var(--panel-line);
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 34px 100%, 0 calc(100% - 34px));
}
.hero::before {
  content: "";
  position: absolute;
  top: -60px; right: -70px;
  width: 220px; height: 220px;
  background: conic-gradient(from 200deg, var(--blue), var(--green), transparent 70%);
  opacity: 0.16;
  filter: blur(30px);
  border-radius: 50%;
}
.hero-row {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  position: relative; 
  z-index: 1;
}
.hero-label {
  font-size: 12.5px; 
  color: var(--ink-dim);
  display: flex; 
  align-items: center; 
  gap: 7px;
}
.eye-toggle {
  width: 26px; 
  height: 26px;
  display: flex; 
  align-items: center; 
  justify-content: center;
  color: var(--ink-faint);
  cursor: pointer;
}
.eye-toggle svg { width: 16px; height: 16px; }

.hero-amount {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.02em;
  margin-top: 8px;
  position: relative; 
  z-index: 1;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(100deg, #ffffff, var(--green-soft) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  transition: filter 0.2s ease;
}
.hero-amount.hidden-value { filter: blur(9px); user-select: none; }

.hero-actions {
  display: flex; 
  gap: 10px;
  margin-top: 18px;
  position: relative; 
  z-index: 1;
}
.btn-primary {
  flex: 1;
  border: none;
  border-radius: 14px;
  padding: 13px 16px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: #04140F;
  background: linear-gradient(100deg, var(--green), var(--green-soft));
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 8px 20px -8px rgba(34,217,166,0.5);
  text-decoration: none;
}
.btn-primary svg { width: 16px; height: 16px; }
.btn-ghost {
  width: 48px;
  border-radius: 14px;
  border: 1px solid var(--panel-line);
  background: rgba(255,255,255,0.03);
  display: flex; 
  align-items: center; 
  justify-content: center;
  color: var(--ink-dim);
  cursor: pointer;
  text-decoration: none;
}
.btn-ghost svg { width: 17px; height: 17px; }

/* ---------- Section heading ---------- */
.section-head {
  display: flex; 
  align-items: baseline; 
  justify-content: space-between;
  padding: 0 20px;
  margin: 30px 0 12px;
}
.section-title {
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 15.5px;
}
.section-link {
  font-size: 12px; 
  font-weight: 600;
  color: var(--blue-soft);
  display: flex; 
  align-items: center; 
  gap: 3px;
  cursor: pointer;
  text-decoration: none;
}
.section-link svg { width: 12px; height: 12px; }

/* ---------- Quick actions rail ---------- */
.rail {
  display: flex; 
  gap: 10px;
  padding: 0 20px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail-item {
  scroll-snap-align: start;
  flex: 0 0 auto;
  width: 104px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 18px;
  padding: 14px 12px;
  display: flex; 
  flex-direction: column; 
  gap: 14px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.rail-icon {
  width: 32px; 
  height: 32px;
  border-radius: 10px;
  background: rgba(46,107,255,0.12);
  color: var(--blue-soft);
  display: flex; 
  align-items: center; 
  justify-content: center;
}
.rail-icon svg { width: 16px; height: 16px; }
.rail-item:nth-child(2) .rail-icon { background: rgba(34,217,166,0.12); color: var(--green-soft); }
.rail-item:nth-child(4) .rail-icon { background: rgba(46,107,255,0.12); color: var(--blue-soft); }
.rail-label { font-size: 12px; font-weight: 500; color: var(--ink); line-height: 1.3; }

/* ---------- Earnings comparison ---------- */
.earnings {
  margin: 0 20px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius-md);
  padding: 18px;
}
.earn-cols {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  height: 96px;
  margin-top: 6px;
}
.earn-col {
  flex: 1;
  display: flex; 
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
}
.earn-bar-track {
  width: 100%;
  max-width: 36px;
  flex: 1;
  display: flex; 
  align-items: flex-end;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  overflow: hidden;
}
.earn-bar {
  width: 100%;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--green-soft), var(--blue));
}
.earn-value {
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 12.5px;
  margin-top: 9px;
  font-variant-numeric: tabular-nums;
}
.earn-label { font-size: 10.5px; color: var(--ink-faint); margin-top: 2px; }

/* ---------- Network ---------- */
.network {
  margin: 0 20px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.orbit-wrap {
  width: 104px; 
  height: 104px;
  flex-shrink: 0;
  position: relative;
  display: flex; 
  align-items: center; 
  justify-content: center;
}
.orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--panel-line);
}
.orbit-ring.r1 { width: 104px; height: 104px; }
.orbit-ring.r2 { width: 74px; height: 74px; }
.orbit-core {
  width: 44px; 
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(150deg, var(--blue), var(--green));
  display: flex; 
  align-items: center; 
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: #04102A;
  position: relative; 
  z-index: 2;
}
.orbit-node {
  position: absolute;
  width: 9px; 
  height: 9px;
  border-radius: 50%;
  background: var(--green-soft);
  box-shadow: 0 0 0 3px rgba(34,217,166,0.14);
}
.network-info { flex: 1; }
.network-stat-row { display: flex; gap: 22px; }
.network-num {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.network-cap { font-size: 11px; color: var(--ink-faint); margin-top: 1px; }

/* ---------- Rank ---------- */
.rank-panel {
  margin: 0 20px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  gap: 16px;
  align-items: center;
}
.shield-fill-wrap { width: 52px; height: 60px; flex-shrink: 0; position: relative; }
.rank-copy { flex: 1; }
.rank-copy-title { font-family: 'Sora', sans-serif; font-weight: 600; font-size: 14.5px; }
.rank-copy-sub { font-size: 11.5px; color: var(--ink-faint); margin-top: 3px; line-height: 1.4; }
.rank-copy-sub b { color: var(--green-soft); font-weight: 600; }
.rank-pct {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--green-soft);
  flex-shrink: 0;
}

/* ---------- Bottom nav ---------- */
.bottom-nav {
  position: fixed;
  left: 50%; 
  transform: translateX(-50%);
  bottom: 0;
  width: 100%; 
  max-width: 430px;
  background: rgba(10,14,32,0.86);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--panel-line);
  display: flex;
  padding: 10px 6px calc(10px + env(safe-area-inset-bottom));
  z-index: 50;
}
.nav-item {
  flex: 1;
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  gap: 4px;
  color: var(--ink-faint);
  font-size: 10.5px;
  cursor: pointer;
  text-decoration: none;
}
.nav-item svg { width: 19px; height: 19px; }
.nav-item.active { color: var(--green-soft); }

@media (min-width: 431px) {
  body { padding: 24px 0; }
  .screen { border-radius: 32px; border: 1px solid var(--panel-line); box-shadow: 0 40px 80px -30px rgba(0,0,0,0.6); }
}

/* ---------- Shared overlay backdrop ---------- */
.backdrop {
  position: fixed; 
  inset: 0;
  background: rgba(4,6,16,0.62);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 60;
}
.backdrop.show { opacity: 1; pointer-events: auto; }

/* ---------- Hamburger drawer ---------- */
.drawer {
  position: fixed; 
  top: 0;
  left: 50%;
  margin-left: -215px; /* Alinha exatamente com a borda esquerda do painel */
  height: 100%;
  width: min(80%, 296px);
  background: var(--bg-elevated);
  border-right: 1px solid var(--panel-line);
  z-index: 70;
  transform: translateX(-105%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform .32s cubic-bezier(.22,.85,.32,1), opacity .25s ease, visibility .32s;
  display: flex; 
  flex-direction: column;
  padding: 22px 16px;
  overflow-y: auto;
}

.drawer.open { 
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.drawer-head {
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  margin-bottom: 22px;
}
.drawer-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.drawer-close {
  width: 34px; 
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--panel-line);
  background: rgba(255,255,255,0.02);
  display: flex; 
  align-items: center; 
  justify-content: center;
  color: var(--ink-dim);
  cursor: pointer;
}
.drawer-close svg { width: 15px; height: 15px; }

.drawer-profile {
  display: flex; 
  align-items: center; 
  gap: 12px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 16px;
  margin-bottom: 18px;
}
.drawer-profile .avatar { width: 42px; height: 42px; border-radius: 13px; }
.drawer-profile .avatar img { border-radius: 11px; }
.drawer-profile-name { 
  font-family: 'Sora', sans-serif; 
  font-weight: 600; 
  font-size: 14px; 
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.drawer-profile-sub { font-size: 11px; color: var(--ink-faint); margin-top: 2px; }

.drawer-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.drawer-eyebrow {
  font-size: 10.5px; 
  font-weight: 600; 
  color: var(--ink-faint);
  padding: 14px 10px 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.drawer-link {
  display: flex; 
  align-items: center; 
  gap: 12px;
  padding: 11px 10px;
  border-radius: 12px;
  color: var(--ink);
  font-size: 14px; 
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.drawer-link svg { width: 18px; height: 18px; color: var(--ink-dim); flex-shrink: 0; }
.drawer-link.active { background: rgba(46,107,255,0.12); color: var(--ink); }
.drawer-link.active svg { color: var(--blue-soft); }
.drawer-link .chip {
  margin-left: auto;
  font-size: 10px; 
  font-weight: 700;
  color: #04140F;
  background: var(--green-soft);
  padding: 2px 7px;
  border-radius: 100px;
}

.drawer-foot {
  border-top: 1px solid var(--panel-line);
  padding-top: 10px;
  margin-top: 10px;
}
.drawer-link.danger svg { color: var(--danger); }
.drawer-link.danger { color: var(--danger); }

/* ---------- "Mais" bottom sheet ---------- */
.sheet {
  position: fixed; 
  bottom: 0;
  left: 50%; 
  transform: translate(-50%, 105%);
  width: 100%; 
  max-width: 430px;
  background: var(--bg-elevated);
  border: 1px solid var(--panel-line);
  border-bottom: none;
  border-radius: 26px 26px 0 0;
  z-index: 70;
  padding: 10px 20px calc(22px + env(safe-area-inset-bottom));
  transition: transform .32s cubic-bezier(.22,.85,.32,1);
}
.sheet.open { transform: translate(-50%, 0); }
.sheet-handle {
  width: 36px; 
  height: 4px;
  border-radius: 100px;
  background: var(--panel-line);
  margin: 0 auto 16px;
  cursor: pointer;
}
.sheet-title {
  font-family: 'Sora', sans-serif; 
  font-weight: 600; 
  font-size: 15.5px;
  margin-bottom: 14px;
}
.sheet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 6px;
}
.sheet-item {
  display: flex; 
  flex-direction: column; 
  gap: 12px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 16px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.sheet-icon {
  width: 32px; 
  height: 32px;
  border-radius: 10px;
  background: rgba(34,217,166,0.12);
  color: var(--green-soft);
  display: flex; 
  align-items: center; 
  justify-content: center;
}
.sheet-icon svg { width: 16px; height: 16px; }
.sheet-item:nth-child(2n) .sheet-icon { background: rgba(46,107,255,0.12); color: var(--blue-soft); }
.sheet-item-label { font-size: 12.5px; font-weight: 500; }
.sheet-logout {
  display: flex; 
  align-items: center; 
  justify-content: center; 
  gap: 8px;
  margin-top: 12px;
  padding: 13px;
  border-radius: 14px;
  border: 1px solid rgba(255,107,107,0.25);
  color: var(--danger);
  font-size: 13.5px; 
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.sheet-logout svg { width: 16px; height: 16px; }

body.no-scroll { overflow: hidden; }


/* Ajuste para telas mobile */
@media (max-width: 430px) {
  .drawer {
    left: 0;
    margin-left: 0;
    width: min(85%, 296px);
  }
}