/* Deriv-style palette: coral brand, near-black surfaces, IBM Plex Sans.
   Profit/loss always carries an explicit +/- sign, so colour reinforces the
   meaning rather than being the only channel that conveys it. */
:root {
  --bg:        #0e0e0e;
  --surface:   #191919;
  --surface-2: #232323;
  --line:      rgba(255,255,255,0.08);
  --line-soft: rgba(255,255,255,0.05);
  --text:      #ffffff;
  --text-2:    rgba(255,255,255,0.72);
  --text-3:    rgba(255,255,255,0.44);
  --brand:     #ff444f;
  --profit:    #00c390;
  --loss:      #ff444f;
  --radius:    16px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: rgba(14,14,14,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner {
  max-width: 720px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 9px; }
.logo-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand);
}
.logo-text { font-weight: 700; font-size: 16px; letter-spacing: -0.01em; }

.nav-right { display: flex; align-items: center; gap: 8px; }
.chip {
  font-size: 11px; font-weight: 600; letter-spacing: 0.03em;
  padding: 5px 10px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.chip-live { color: var(--profit); }
.chip-live .pulse {
  width: 6px; height: 6px; border-radius: 50%; background: var(--profit);
  animation: pulse 2s ease-in-out infinite;
}
.chip-off { color: var(--text-3); }
.chip-off .pulse { background: var(--text-3); animation: none; }
.chip-halt { color: var(--brand); }
.chip-halt .pulse { background: var(--brand); animation: none; }
.chip-real { background: rgba(255,68,79,0.15); color: var(--brand); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- layout ---------- */
.wrap { max-width: 720px; margin: 0 auto; padding: 0 20px 64px; }

/* ---------- hero ---------- */
.hero { padding: 44px 0 36px; }
.hero-label {
  font-size: 12px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px;
}
.hero-value {
  font-size: 52px; font-weight: 600; letter-spacing: -0.03em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hero-meta {
  margin-top: 14px; display: flex; align-items: center; gap: 8px;
  font-size: 14px; flex-wrap: wrap;
}
.delta { font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--profit); }
.delta.down { color: var(--loss); }
.hero-sep, .hero-dim { color: var(--text-3); }

/* ---------- halt ---------- */
.halt {
  background: rgba(255,68,79,0.10);
  border: 1px solid rgba(255,68,79,0.3);
  color: var(--brand);
  border-radius: 12px; padding: 12px 16px;
  font-size: 13px; font-weight: 500; margin-bottom: 8px;
}
.hidden { display: none; }

/* ---------- blocks ---------- */
.block { margin-top: 36px; }
.block-title {
  font-size: 13px; font-weight: 600; color: var(--text-2);
  margin: 0 0 14px; display: flex; align-items: center; gap: 8px;
}
.count {
  background: var(--surface-2); color: var(--text-3);
  border-radius: 999px; padding: 1px 8px; font-size: 11px;
}
.muted { color: var(--text-3); font-size: 14px; margin: 0; padding: 18px 0; }

/* ---------- positions ---------- */
.positions { display: grid; gap: 10px; }
.pos {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.pos-main { min-width: 0; }
.pos-sym { font-weight: 600; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.dir {
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  padding: 2px 7px; border-radius: 6px;
}
.dir-up { background: rgba(0,195,144,0.15); color: var(--profit); }
.dir-down { background: rgba(255,68,79,0.15); color: var(--loss); }
.pos-sub { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.pos-pnl {
  font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------- trades ---------- */
.trades { display: flex; flex-direction: column; }
.trade {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 2px; border-bottom: 1px solid var(--line-soft);
}
.trade:last-child { border-bottom: none; }
.trade-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.trade-sym { font-weight: 500; font-size: 14px; }
.trade-strat { font-size: 12px; color: var(--text-3); }
.trade-right { display: flex; align-items: center; gap: 14px; }
.trade-time { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.trade-pnl { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 14px; min-width: 58px; text-align: right; }

/* ---------- strategies ---------- */
.strategies { display: flex; flex-direction: column; gap: 14px; }
.strat-row { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.strat-head { display: flex; justify-content: space-between; align-items: baseline; grid-column: 1 / -1; }
.strat-name { font-size: 14px; font-weight: 500; }
.strat-stat { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.bar { grid-column: 1 / -1; height: 4px; background: var(--surface-2); border-radius: 2px; overflow: hidden; position: relative; }
.bar-mid { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line); }
.bar-fill { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.bar-fill.up { background: var(--profit); left: 50%; }
.bar-fill.down { background: var(--loss); right: 50%; }

/* ---------- foot ---------- */
.foot { margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line-soft);
        font-size: 12px; color: var(--text-3); }

@media (max-width: 520px) {
  .wrap, .nav-inner { padding-left: 16px; padding-right: 16px; }
  .hero { padding: 32px 0 26px; }
  .hero-value { font-size: 42px; }
  .pos { padding: 14px; }
  .pos-pnl { font-size: 18px; }
  .trade-strat { display: none; }
}
