:root {
  --bg: #0a0a0a;
  --bg-2: #111111;
  --panel: #151515;
  --line: #242424;
  --line-2: #2f2f2f;
  --text: #e6e6e6;
  --muted: #7a7a7a;
  --dim: #4a4a4a;
  --up: #7bd88f;
  --down: #ff6b6b;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --pixel: "Silkscreen", var(--mono);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  /* optional texture: drop assets/bg.png in and it tiles behind everything */
  background-image: url("assets/bg.png");
  color: var(--text);
  font: 14px/1.5 var(--mono);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
[hidden] { display: none !important; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 24px 16px 48px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.up { color: var(--up); }
.down { color: var(--down); }
.r { text-align: right; }

/* ── header ─────────────────────────────── */
.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 32px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo { height: 40px; width: 40px; }
.brand-name { font-family: var(--pixel); font-size: 20px; letter-spacing: .02em; white-space: nowrap; }
.top-links { display: flex; gap: 8px; }
.chip {
  border: 1px solid var(--line-2); background: var(--bg-2); color: var(--muted);
  padding: 6px 10px; font-size: 12px; text-decoration: none; border-radius: 2px; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.social { display: inline-flex; align-items: center; gap: 7px; }

/* ── hero ───────────────────────────────── */
.hero {
  display: grid; grid-template-columns: 280px 1fr; gap: 32px; align-items: center;
  border: 1px solid var(--line); background: var(--panel); padding: 28px;
}
.neet-slot { aspect-ratio: 1; display: grid; place-items: center; }
.neet-slot img { width: 100%; height: 100%; object-fit: contain; }
.neet-slot img.is-logo { width: 88%; height: 88%; }
.neet-ph {
  width: 100%; height: 100%; border: 1px dashed var(--line-2); display: grid; place-content: center;
  text-align: center; gap: 4px; color: var(--dim); font-family: var(--pixel);
}
.neet-ph small { font-family: var(--mono); font-size: 11px; }

.kicker { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin-bottom: 20px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.dot.live { background: var(--up); box-shadow: 0 0 8px var(--up); }

.value-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; }
.value { font-family: var(--pixel); font-size: clamp(40px, 8vw, 72px); line-height: 1.05; margin: 4px 0 6px; font-variant-numeric: tabular-nums; }
.value-sub { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.sep { color: var(--dim); }

.progress { margin: 24px 0 22px; }
.bar { position: relative; height: 12px; background: var(--bg); border: 1px solid var(--line-2); }
.fill { position: absolute; inset: 0 auto 0 0; width: 0; background: repeating-linear-gradient(90deg, var(--text) 0 6px, #bdbdbd 6px 8px); transition: width .6s ease; }
.marker { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--text); left: 0; transition: left .6s ease; }
.ticks { position: relative; height: 18px; margin-top: 6px; font-size: 11px; color: var(--dim); }
.ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.ticks span:first-child { transform: none; }
.ticks span:last-child { transform: translateX(-100%); }
.ticks span.hit { color: var(--text); }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.stat { padding: 14px 12px 0 0; }
.stat + .stat { padding-left: 12px; border-left: 1px solid var(--line); }
.stat-k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; }
.stat-v { font-size: 18px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }

.cta { grid-column: 1 / -1; display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; } /* own row, centered */
.buy {
  display: inline-flex; align-items: center; gap: 10px;
  background: var(--text); color: var(--bg); text-decoration: none;
  font-family: var(--pixel); font-size: 15px; padding: 11px 18px; border: 1px solid var(--text);
}
.buy:hover { background: transparent; color: var(--text); }
.sort-select { display: none; }

/* ── value chart ────────────────────────── */
.chart { position: relative; height: 240px; padding: 12px 8px 4px; }
.chart svg { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--dim); font: 11px var(--mono); }
.chart .base { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .base-label { fill: var(--muted); font: 11px var(--mono); }
.chart .line { fill: none; stroke: var(--text); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cross { stroke: var(--muted); stroke-width: 1; }
.chart .dot { fill: var(--text); stroke: var(--panel); stroke-width: 2; }
.chart-tip {
  position: absolute; top: 8px; pointer-events: none; transform: translateX(-50%);
  background: var(--bg); border: 1px solid var(--line-2); padding: 6px 9px; font-size: 12px; white-space: nowrap;
}
.chart-tip b { display: block; font-size: 14px; }

/* ── rules strip ────────────────────────── */
.rules { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-top: 0; background: var(--bg-2); }
.rule { position: relative; padding: 12px 16px; font-size: 12px; color: var(--muted); }
.rule + .rule { border-left: 1px solid var(--line); }
/* ">" between steps, sitting on the divider */
.rule + .rule::before {
  content: ">"; position: absolute; left: -6px; top: 50%; transform: translateY(-50%);
  background: var(--bg-2); color: var(--text); font-size: 12px; line-height: 1; padding: 2px 0;
}

/* ── panels + tables ────────────────────── */
.panel { margin-top: 28px; border: 1px solid var(--line); background: var(--panel); }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-head { gap: 12px; }
.panel-head h2 { margin: 0; font-family: var(--pixel); font-weight: 400; font-size: 16px; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-weight: 400; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; padding: 10px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 12px 18px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--bg-2); }
.tbl td.note { white-space: normal; color: var(--muted); min-width: 180px; }
.tbl .empty td { color: var(--dim); text-align: center; padding: 28px; }
.tbl th[data-key] { cursor: pointer; user-select: none; }
.tbl th[data-key]:hover { color: var(--muted); }
.tbl th.sorted { color: var(--text); }
.tbl th.sorted::after { content: " ↓"; }
.tbl th.sorted.asc::after { content: " ↑"; }

.coin { display: flex; align-items: center; gap: 10px; }
.coin img, .coin .ph { width: 22px; height: 22px; border-radius: 50%; background: var(--line-2); flex: none; }
.coin b { font-weight: 700; }
.tag { display: inline-block; font-size: 11px; padding: 2px 6px; border: 1px solid var(--line-2); color: var(--muted); }
.tag.ok { color: var(--up); border-color: #2c4a33; }
.tag.buy { color: var(--up); border-color: #2c4a33; }
.tag.sell { color: var(--down); border-color: #4d2a2a; }
.tag.stack { color: var(--text); border-color: var(--muted); }
.tbl a { color: var(--muted); text-decoration: none; }
.tbl a:hover { color: var(--text); }

.earn-sum { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.earn-sum > div { padding: 14px 18px; }
.earn-sum > div + div { border-left: 1px solid var(--line); }

/* ── footer ─────────────────────────────── */
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 28px; color: var(--dim); font-size: 11px; }

/* ── phone ──────────────────────────────── */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding: 20px; gap: 20px; }
  .neet-slot { max-width: 200px; margin: 0 auto; width: 100%; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .rules { grid-template-columns: repeat(2, 1fr); }
  .rule:nth-child(3) { border-left: 0; }
  .rule:nth-child(3)::before { display: none; }
  .rule:nth-child(n+3) { border-top: 1px solid var(--line); }
  .earn-sum { grid-template-columns: repeat(2, 1fr); }
  .earn-sum > div:nth-child(3) { border-left: 0; }
  .earn-sum > div:nth-child(n+3) { border-top: 1px solid var(--line); }

  /* tables become cards: coin on top, labeled fields in a 3-column grid below */
  .table-wrap { overflow: visible; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody { display: block; }
  .tbl tr { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .tbl tr:last-child { border-bottom: 0; }
  .tbl td, .tbl td.r { display: block; padding: 0; border: 0; text-align: left; white-space: normal; }
  .tbl td:first-child { grid-column: 1 / -1; }
  #holdings tr { grid-template-columns: repeat(4, 1fr); } /* 7 fields: two tidy rows */
  .tbl td[data-label]::before {
    content: attr(data-label); display: block; color: var(--dim);
    font-size: 10px; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 2px;
  }
  .tbl td.note { min-width: 0; grid-column: 1 / -1; }
  .tbl .empty td { grid-column: 1 / -1; text-align: center; }
  .tbl tbody tr:hover td { background: none; }
  .sort-select {
    display: block; margin-left: auto; background: var(--bg-2); color: var(--muted);
    border: 1px solid var(--line-2); font: 12px var(--mono); padding: 4px 6px; border-radius: 2px;
  }
  .panel-head { align-items: center; flex-wrap: wrap; }
  .ticks span:not(:first-child):not(:last-child) { display: none; }
}
