/* ═══════════════════════════════════════════════
   ASTER TRADER BOARD — BHB skin
   ═══════════════════════════════════════════════ */

:root {
  --black:   #0d0d0d;
  --yellow:  #ffe135;
  --red:     #ff3b3b;
  --green:   #00c86e;
  --white:   #fef9ee;
  --bg:      #0d0f14;

  --font-display: 'Impact', 'Arial Black', sans-serif;
  --font-body:    'Arial', sans-serif;
  --font-mono:    'Courier New', monospace;

  --shadow-sm: 3px 3px 0 rgba(255,225,53,0.3);
  --shadow-md: 5px 5px 0 rgba(255,225,53,0.2);
  --radius: 8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--white);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Header ── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--black);
  border-bottom: 3px solid var(--yellow);
}

.header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 1.5rem;
  height: 62px;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
}

.header-brand { display: flex; align-items: center; gap: 10px; }
.brand-emoji  { font-size: 24px; }
.brand-name   {
  font-family: var(--font-display);
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  color: var(--yellow);
  text-transform: uppercase;
}
.brand-accent { color: var(--red); }

.header-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

/* live pill */
.live-pill {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,225,53,0.2);
  border-radius: 999px;
  padding: 4px 12px;
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #555;
}
.live-dot.live  { background: var(--green); animation: pulse 2.5s infinite; }
.live-dot.error { background: var(--red); }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
.live-label { font-size: 11px; font-family: var(--font-mono); color: rgba(255,255,255,0.6); }

/* timeframe tabs */
.tf-tabs { display: flex; gap: 4px; }
.tab {
  padding: 5px 14px;
  border-radius: 4px;
  border: 2px solid rgba(255,225,53,0.25);
  background: transparent;
  color: rgba(255,255,255,0.5);
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: all 0.1s;
}
.tab:hover { border-color: var(--yellow); color: var(--yellow); }
.tab.active {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--black);
}

/* ── Ticker tape ── */
.ticker-wrap {
  overflow: hidden;
  background: var(--black);
  border-bottom: 3px solid var(--yellow);
  padding: 6px 0;
  white-space: nowrap;
}
.ticker-inner {
  display: inline-block;
  animation: ticker 28s linear infinite;
  font-family: var(--font-display);
  font-size: 0.85rem;
  color: var(--yellow);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ── Main ── */
.main { max-width: 1200px; margin: 0 auto; padding: 1.5rem; }

/* ── Stat bar ── */
.stat-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 2rem;
}
.stat-card {
  background: rgba(255,255,255,0.04);
  border: 2px solid var(--yellow);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  text-align: center;
  transition: all 0.1s;
}
.stat-card:hover {
  transform: translate(-2px,-2px);
  box-shadow: 5px 5px 0 rgba(255,225,53,0.4);
}
.stat-emoji { font-size: 22px; margin-bottom: 4px; }
.stat-label { font-size: 10px; font-family: var(--font-mono); color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.stat-value { font-family: var(--font-display); font-size: 1.2rem; color: var(--white); letter-spacing: 0.04em; }
.stat-value.up   { color: var(--green); }
.stat-value.down { color: var(--red); }

/* ── Section ── */
.section { margin-bottom: 2rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.875rem; gap: 8px; }
.section-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--yellow);
  display: flex; align-items: center; gap: 8px;
}
.tf-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.07);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.12);
}
.source-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 20px;
  background: rgba(0,200,110,0.12);
  color: var(--green);
  border: 1px solid rgba(0,200,110,0.25);
}
.source-badge.simulated {
  background: rgba(255,59,59,0.12);
  color: #ff7b7b;
  border-color: rgba(255,59,59,0.25);
}

/* ── Chart ── */
.chart-card {
  background: rgba(255,255,255,0.03);
  border: 2px solid rgba(255,225,53,0.2);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 10px;
}
.chart-wrap { position: relative; width: 100%; height: 220px; }

/* ── Gainer list ── */
.gainer-list { display: flex; flex-direction: column; }
.gainer-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 1rem;
  background: rgba(255,255,255,0.03);
  border: 2px solid rgba(255,225,53,0.15);
  border-top: none;
}
.gainer-row:first-child { border-top: 2px solid rgba(255,225,53,0.15); border-radius: var(--radius) var(--radius) 0 0; }
.gainer-row:last-child  { border-radius: 0 0 var(--radius) var(--radius); }
.gainer-row:hover { background: rgba(255,225,53,0.05); }
.g-sym   { font-family: var(--font-display); font-size: 13px; letter-spacing: 0.04em; color: var(--yellow); min-width: 100px; }
.g-price { font-size: 12px; font-family: var(--font-mono); color: rgba(255,255,255,0.4); min-width: 72px; }
.bar-wrap { flex: 1; height: 5px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden; }
.bar-fill      { height: 100%; border-radius: 3px; }
.bar-fill.up   { background: var(--green); }
.bar-fill.down { background: var(--red); }
.g-pct      { font-family: var(--font-display); font-size: 13px; min-width: 64px; text-align: right; }
.g-pct.up   { color: var(--green); }
.g-pct.down { color: var(--red); }

/* ── Two col ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 700px) { .two-col { grid-template-columns: 1fr; } }

/* ── Card ── */
.card {
  background: rgba(255,255,255,0.03);
  border: 2px solid rgba(255,225,53,0.2);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ── Trader rows ── */
.trader-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 1rem;
  border-bottom: 1px solid rgba(255,225,53,0.1);
  transition: background 0.1s;
}
.trader-row:last-child { border-bottom: none; }
.trader-row:hover { background: rgba(255,225,53,0.04); }

.rank { font-family: var(--font-display); font-size: 14px; min-width: 22px; text-align: center; color: rgba(255,255,255,0.3); padding-top: 2px; }
.rank.gold   { color: var(--yellow); }
.rank.silver { color: #c0c0c0; }
.rank.bronze { color: #cd7f32; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  border: 2px solid rgba(255,225,53,0.3);
  background: rgba(255,225,53,0.08);
}

.trader-info { flex: 1; min-width: 0; }
.trader-name { font-family: var(--font-display); font-size: 12px; letter-spacing: 0.04em; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trader-meta { font-size: 10px; font-family: var(--font-mono); color: rgba(255,255,255,0.4); margin-top: 2px; }
.trader-best-trade {
  font-size: 10px; font-family: var(--font-mono);
  margin-top: 4px; padding: 3px 6px;
  background: rgba(255,225,53,0.07);
  border-left: 2px solid var(--yellow);
  border-radius: 0 3px 3px 0;
  color: rgba(255,255,255,0.55);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.trader-best-trade .trade-sym { color: var(--yellow); font-weight: 700; }
.trader-best-trade .trade-gain { color: var(--green); margin-left: 4px; }
.trader-best-trade .trade-gain.neg { color: var(--red); }

.trader-pnl { font-family: var(--font-display); font-size: 13px; color: var(--green); text-align: right; white-space: nowrap; }
.trader-roi { font-size: 10px; font-family: var(--font-mono); color: rgba(255,255,255,0.35); text-align: right; }

/* ── Trade rows ── */
.trade-row {
  padding: 10px 1rem;
  border-bottom: 1px solid rgba(255,225,53,0.1);
  transition: background 0.1s;
}
.trade-row:last-child { border-bottom: none; }
.trade-row:hover { background: rgba(255,225,53,0.04); }
.trade-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 3px; }
.trade-sym  { font-family: var(--font-display); font-size: 13px; letter-spacing: 0.04em; color: var(--yellow); }
.trade-gain { font-family: var(--font-display); font-size: 13px; color: var(--green); }
.trade-gain.down { color: var(--red); }
.trade-bot  { display: flex; align-items: center; justify-content: space-between; }
.trade-trader { font-size: 11px; font-family: var(--font-mono); color: rgba(255,255,255,0.4); }
.tag { font-family: var(--font-display); font-size: 10px; letter-spacing: 0.06em; padding: 2px 8px; border-radius: 3px; border: 1px solid; }
.tag.long  { background: rgba(0,200,110,0.12); color: var(--green);  border-color: rgba(0,200,110,0.3); }
.tag.short { background: rgba(255,59,59,0.12);  color: #ff7b7b; border-color: rgba(255,59,59,0.3); }
.trade-prices { font-size: 10px; font-family: var(--font-mono); color: rgba(255,255,255,0.3); margin-top: 3px; }

/* ── Misc ── */
.loading-msg { padding: 2rem; text-align: center; color: rgba(255,255,255,0.3); font-size: 13px; font-family: var(--font-mono); }

/* ── Footer ── */
.footer {
  max-width: 1200px; margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-size: 11px; font-family: var(--font-mono);
  color: rgba(255,255,255,0.2);
  border-top: 2px solid rgba(255,225,53,0.15);
}
.footer a { color: var(--yellow); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

@media (max-width: 768px) {
  .tf-tabs .tab { padding: 4px 10px; font-size: 0.75rem; }
  .header-inner  { height: auto; padding: 0.75rem 1rem; }
}

/* ── Nav button (shared with bots page) ── */
.nav-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 14px;
  border-radius: 4px;
  border: 2px solid rgba(255,225,53,0.25);
  color: rgba(255,255,255,0.5);
  font-family: var(--font-display);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: all 0.1s;
}
.nav-btn:hover  { border-color: var(--yellow); color: var(--yellow); }
.nav-btn.active { background: var(--yellow); border-color: var(--yellow); color: var(--black); }
