:root {
  --bg: #0e0e0e;
  --bg-2: #131313;
  --bg-3: #181818;
  --panel: #141414;
  --panel-2: #181818;
  --line: #232323;
  --line-2: #2e2e2e;
  --text: #ffffff;
  --muted: #9ca3af;
  --muted-2: #6b7280;
  --green: #1dd985;
  --green-2: #15b372;
  --red: #ef4444;
  --gold: #f5c451;
  --silver: #c7ccd1;
  --bronze: #cd7f4a;
  --accent: #1dd985;
  --radius: 10px;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  line-height: 1.45;
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

.wrap { width: 100%; max-width: 1340px; margin: 0 auto; padding: 18px 22px 40px; }

/* ---------- Top nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 40;
  background: rgba(7, 9, 11, 0.86);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  max-width: 1340px; margin: 0 auto; padding: 0 22px;
  height: 58px; display: flex; align-items: center; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.brand__mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--green);
  color: #04150b;
  flex: 0 0 auto;
}
.brand__mark svg { width: 22px; height: 22px; display: block; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__title { font-weight: 800; letter-spacing: -0.01em; font-size: 15px; }
.brand__sub { font-size: 9px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.16em; }

.nav__links { display: flex; align-items: center; gap: 4px; flex: 1 1 auto; }
.nav__link {
  font-size: 13px; font-weight: 600; color: var(--muted);
  padding: 7px 12px; border-radius: 8px; cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.nav__link:hover { color: var(--text); background: var(--bg-3); }
.nav__link.is-active { color: var(--text); }

.nav__right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }

.search { position: relative; display: flex; align-items: center; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; transition: border-color 0.15s, box-shadow 0.15s; }
.search:focus-within { border-color: var(--line-2); box-shadow: 0 0 0 3px rgba(29, 217, 133, 0.12); }
.search--nav { width: 280px; }
.search__icon { color: var(--muted-2); flex: 0 0 auto; }
.search__input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 13px; padding: 9px 8px; min-width: 0; }
.search__input::placeholder { color: var(--muted-2); }
.search__clear { background: var(--bg-3); border: 0; color: var(--muted); width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1; display: grid; place-items: center; }
.search__clear:hover { color: var(--text); background: var(--line-2); }

.currency__select {
  appearance: none; background: var(--panel); border: 1px solid var(--line); color: var(--text);
  font: inherit; font-size: 12px; font-weight: 600; padding: 8px 10px; border-radius: 9px; cursor: pointer;
}
.currency__select:focus { outline: none; border-color: var(--accent); }
.currency--nav { display: inline-flex; }

.xlink {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  flex: 0 0 auto;
}
.xlink:hover { color: var(--text); border-color: var(--line-2); background: var(--bg-3); }

.btn { appearance: none; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); font: inherit; font-weight: 600; font-size: 13px; padding: 9px 16px; border-radius: 9px; cursor: pointer; transition: background 0.15s, transform 0.05s; }
.btn:hover { background: var(--bg-3); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; }

/* ---------- Ticker strip ---------- */
.ticker {
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  overflow: hidden;
  height: 34px;
  position: relative;
}
.ticker__track {
  display: flex; align-items: center; gap: 26px;
  height: 100%; white-space: nowrap;
  animation: ticker-scroll 60s linear infinite;
  padding-left: 22px;
}
.ticker:hover .ticker__track { animation-play-state: paused; }
.tick { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; }
.tick__sym { color: var(--muted); font-weight: 600; }
.tick__price { font-family: var(--mono); color: var(--text); }
.tick__chg { font-family: var(--mono); font-size: 11px; }
.tick__chg.pos { color: var(--green); }
.tick__chg.neg { color: var(--red); }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- KPI cards ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 0 0 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; position: relative; overflow: hidden; }
.kpi--accent { background: var(--panel); border-color: var(--line-2); }
.kpi__label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted-2); }
.kpi__value { font-family: var(--mono); font-weight: 700; font-size: 21px; margin: 5px 0 2px; color: var(--text); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi--accent .kpi__value { color: var(--green); }
.kpi__sub { font-size: 11px; color: var(--muted); }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar .livebar { margin: 0; padding: 7px 12px; font-size: 11px; }
.toolbar .filters { margin-left: auto; }

.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg__btn { appearance: none; background: transparent; border: 0; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; padding: 7px 13px; border-radius: 7px; cursor: pointer; transition: color 0.15s, background 0.15s; }
.seg__btn:hover { color: var(--text); }
.seg__btn.is-active { background: var(--bg-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

.livebar { display: inline-flex; align-items: center; gap: 9px; font-size: 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.livedot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--muted-2); }
.livedot--loading { background: #f59e0b; animation: pulse 1.2s infinite; }
.livedot--live { background: var(--green); }
.livedot--stale { background: #f59e0b; }
.livedot--retrying { background: #f59e0b; animation: pulse 1.2s infinite; }
.livedot--error { background: var(--red); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.filters { display: flex; gap: 7px; flex-wrap: wrap; }
.chip { appearance: none; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; padding: 7px 13px; border-radius: 999px; cursor: pointer; transition: all 0.15s; }
.chip:hover { color: var(--text); border-color: var(--line-2); }
.chip.is-active { color: #04150b; background: var(--green); border-color: transparent; }

/* ---------- Data table ---------- */
.tablewrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.tablehead, .row {
  display: grid;
  grid-template-columns: 52px minmax(220px,1.7fr) 110px 130px 130px 130px 120px 150px;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
}
.tablehead {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--muted-2); border-bottom: 1px solid var(--line);
  position: sticky; top: 58px; background: var(--panel-2); z-index: 5;
  border-radius: 11px 11px 0 0;
}
.col { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col--trader, .col--rank { text-align: left; }
.col--net, .col--pnl24, .col--period, .col--alloc { text-align: right; }
.col--spark { text-align: center; }

.board { display: flex; flex-direction: column; }
.row {
  position: relative;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
  text-decoration: none; color: inherit;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--bg-2); }
.row > * { position: relative; }

.row__rank { display: flex; align-items: center; font-weight: 800; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.row__rank .num { color: var(--text); }
.medal { position: relative; width: 30px; height: 30px; display: grid; place-items: center; }
.medal svg { width: 100%; height: 100%; display: block; }
.medal .medal__num { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 11px; color: #1a1206; padding-top: 1px; }

.row__trader { display: flex; align-items: center; gap: 11px; min-width: 0; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; letter-spacing: -0.02em; border: 1px solid rgba(255,255,255,0.06); flex: 0 0 auto; user-select: none; overflow: hidden; position: relative; }
.avatar__init { display: grid; place-items: center; width: 100%; height: 100%; }
.avatar__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.row__info { min-width: 0; }
.row__name { font-weight: 700; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.row__handle { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tag { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 2px 6px; border-radius: 5px; background: var(--bg-3); color: var(--muted); border: 1px solid var(--line); }
.tag--live { color: #04150b; background: var(--green); border-color: transparent; }

.row__cat { font-size: 11px; color: var(--muted); text-transform: capitalize; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.pnl { font-family: var(--mono); font-weight: 700; font-size: 14px; color: var(--green); white-space: nowrap; text-align: right; }
.pnl--neg, .pnl.pnl--neg { color: var(--red); }
.dim { color: var(--muted); }

.row__spark { display: flex; justify-content: center; }
.spark { width: 100px; height: 26px; display: block; }

.row__alloc { display: flex; align-items: center; justify-content: flex-end; gap: 0; height: 18px; }
.badge { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--panel); margin-left: -5px; display: grid; place-items: center; font-size: 8px; font-weight: 800; color: #fff; }
.badge:first-child { margin-left: 0; }
.badge__count { background: var(--bg-3); border: 1px solid var(--line-2); color: var(--muted); font-size: 9px; padding: 1px 5px; border-radius: 999px; margin-left: 5px; font-weight: 700; }

.empty { text-align: center; color: var(--muted); padding: 50px 0; }
.pager { text-align: center; margin: 18px 0 8px; }

.disclaimer { text-align: center; color: var(--muted-2); font-size: 11px; margin: 22px 0 0; max-width: 700px; margin-left: auto; margin-right: auto; }

/* ---------- Footer status bar ---------- */
.statusbar { border-top: 1px solid var(--line); background: var(--bg-2); margin-top: 20px; }
.statusbar__inner {
  max-width: 1340px; margin: 0 auto; padding: 11px 22px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  font-size: 11px; color: var(--muted-2);
}
.statusbar__conn { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); }
.statusbar__src { color: var(--muted-2); }
.statusbar__links { margin-left: auto; display: inline-flex; gap: 14px; }
.statusbar__links a { color: var(--muted); font-size: 13px; }
.statusbar__links a:hover { color: var(--text); }

/* ---------- Profile view ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; padding: 4px 0 16px; }
.back:hover { color: var(--text); }

.phead {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin-bottom: 14px;
}
.avatar--lg { width: 72px; height: 72px; font-size: 24px; }
.phead__name { font-size: 21px; font-weight: 800; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.phead__meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.phead__pnl { text-align: right; }
.phead__pnl .pnl { font-size: 22px; }
.phead__pnlsub { font-size: 11px; color: var(--muted-2); margin-top: 2px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; flex-wrap: wrap; }
.panel__title { font-weight: 700; font-size: 14px; color: var(--text); }
.panel__tabs { display: inline-flex; gap: 4px; }
.ptab { appearance: none; background: transparent; border: 1px solid transparent; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 8px; cursor: pointer; }
.ptab:hover { color: var(--text); }
.ptab.is-active { background: var(--bg-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }

.chartpanel { padding: 18px; }
.chartwrap { width: 100%; }
.area { width: 100%; height: 220px; display: block; }

/* interactive chart overlays */
.ichart { width: 100%; height: 100%; display: block; }
.ichart__base { stroke: rgba(255,255,255,0.06); stroke-width: 1; }
.ichart__line { stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ichart__cross {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: rgba(255,255,255,0.22);
  display: none; pointer-events: none; z-index: 3;
}
.ichart__dot {
  position: absolute; width: 10px; height: 10px; border-radius: 50%;
  background: var(--green); border: 2px solid var(--bg);
  display: none; pointer-events: none; z-index: 4;
  transform: translateZ(0);
}
.ichart__tip {
  position: absolute; display: none; z-index: 5; pointer-events: none;
  background: var(--bg-3); border: 1px solid var(--line-2); border-radius: 8px;
  padding: 7px 10px; min-width: 96px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.ichart__tip-v { font-family: var(--mono); font-weight: 700; font-size: 13px; color: var(--green); }
.ichart__tip-l { font-size: 11px; color: var(--muted); margin-top: 2px; }

.pcards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.pcard__l { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted-2); }
.pcard__v { font-family: var(--mono); font-weight: 700; font-size: 17px; margin: 5px 0 2px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pcard__v--neg { color: var(--red); }
.pcard__s { font-size: 11px; color: var(--muted); }

.ptable { display: flex; flex-direction: column; }
.ptrow { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr 1.1fr; align-items: center; gap: 12px; padding: 11px 6px; border-bottom: 1px solid var(--line); font-size: 13px; }
.ptrow:last-child { border-bottom: 0; }
.ptrow--head { color: var(--muted-2); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; }
.ptrow__asset { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ptrow__name { font-weight: 600; color: var(--text); }
.ptrow__sub { font-size: 11px; color: var(--muted-2); }
.ptrow__amt, .ptrow__val, .ptrow__chg { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ptrow__val, .ptrow__chg { text-align: right; }
.ptrow__chg.pos { color: var(--green); }
.ptrow__chg.neg { color: var(--red); }
.ptrow__bar { height: 6px; background: var(--bg-3); border-radius: 999px; overflow: hidden; }
.ptrow__bar span { display: block; height: 100%; border-radius: 999px; }
.ptrow--loading { color: var(--muted-2); padding: 18px 16px; }
.ptrow .muted { color: var(--muted-2); }
.ptrow .txhash { font-family: var(--mono); font-size: 11px; color: var(--muted); height: auto; background: none; }
.panel__src { margin-left: auto; }
.srcbadge { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  padding: 4px 8px; border-radius: 6px; background: rgba(255,255,255,0.06); color: var(--muted-2); }
.srcbadge--live { background: rgba(31,208,122,0.16); color: var(--green); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.side { font-family: var(--mono); font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 6px; }
.side--pos { background: rgba(31,208,122,0.16); color: var(--green); }
.side--neg { background: rgba(240,86,106,0.16); color: var(--red); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .tablehead, .row { grid-template-columns: 44px minmax(180px,1.6fr) 90px 110px 110px 110px 90px 120px; }
  .search--nav { width: 200px; }
}
@media (max-width: 860px) {
  .nav__links { display: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .col--cat, .col--spark, .row__cat, .row__spark { display: none; }
  .tablehead, .row { grid-template-columns: 40px minmax(160px,1.6fr) 110px 110px 120px; }
  .ptrow { grid-template-columns: 1.4fr 1fr 1fr; }
  .ptrow__amt, .ptrow__bar { display: none; }
  .phead { grid-template-columns: auto 1fr; }
  .phead__pnl { grid-column: 1 / -1; text-align: left; }
  .area { height: 170px; }
  .toolbar { gap: 10px; }
  .toolbar .filters { margin-left: 0; }
}
@media (max-width: 560px) {
  .wrap { padding: 14px 14px 30px; }
  .nav__inner { padding: 0 14px; gap: 12px; }
  .search--nav { width: 150px; }
  .currency--nav { display: none; }
  .col--net, .row .col--net { display: none; }
  .tablehead, .row { grid-template-columns: 36px minmax(140px,1.5fr) 100px 100px; }
  .phead__name { font-size: 18px; }
  .avatar--lg { width: 58px; height: 58px; font-size: 21px; }
  .kpi__value { font-size: 18px; }
}


