:root {
  --bg: #04140d;
  --bg2: #071a12;
  --card: rgba(10, 28, 20, .82);
  --line: rgba(90, 255, 170, .18);
  --text: #f5fff8;
  --muted: #7f9d8b;
  --lime: #3dff8a;
  --lime2: #14e06a;
  --gold: #ffe14d;
  --red: #ff5d6c;
  --price: #d9ffe8;
  --glass: rgba(7, 22, 16, .62);
  --shadow: 0 22px 70px rgba(0,0,0,.42);
  --radius: 22px;
  --focus: 0 0 0 3px rgba(61,255,138,.22);
}

[data-theme="light"] {
  --bg: #eef8f1;
  --bg2: #e3f3e9;
  --card: rgba(255,255,255,.86);
  --line: rgba(16, 90, 48, .16);
  --text: #0d1c13;
  --muted: #456352;
  --price: #0d2a18;
  --glass: rgba(255,255,255,.7);
  --shadow: 0 16px 40px rgba(16, 40, 24, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Instrument Sans", Inter, system-ui, sans-serif;
  background:
    radial-gradient(1200px 500px at 12% -10%, rgba(61,255,138,.12), transparent 55%),
    radial-gradient(900px 420px at 92% 8%, rgba(255,225,77,.07), transparent 50%),
    var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
.wrap { width: min(1180px, calc(100% - 28px)); margin-inline: auto; }

.bg-orb { position: fixed; border-radius: 50%; filter: blur(70px); z-index: -2; pointer-events: none; }
.orb-a { width: 420px; height: 420px; background: rgba(61,255,138,.16); top: -80px; left: -80px; }
.orb-b { width: 360px; height: 360px; background: rgba(255,225,77,.08); top: 120px; right: -60px; }
.grid-overlay {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(61,255,138,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61,255,138,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 20%, black, transparent 75%);
}

.ticker {
  overflow: hidden; border-bottom: 1px solid var(--line);
  background: rgba(4,20,13,.86); backdrop-filter: blur(16px);
  font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--muted);
}
.ticker-track { white-space: nowrap; padding: 8px 0; animation: slide 40s linear infinite; }
@keyframes slide { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.topbar {
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; gap: 16px; }
.brand { display: flex; gap: 10px; align-items: center; }
.logo {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--lime), var(--gold)); color: #04130a; font-weight: 800;
}
.brand small { display: block; color: var(--muted); font-size: 11px; }
.links { display: flex; gap: 18px; color: var(--muted); font-size: 14px; }
.links a:hover { color: var(--lime); }
.nav-actions { display: flex; gap: 8px; align-items: center; }

.icon-btn, .chip, .text-btn, select, .open, .btn { font: inherit; cursor: pointer; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--glass); color: var(--text);
}
.icon-btn:focus-visible, .chip:focus-visible, .btn:focus-visible, .open:focus-visible,
#search:focus-visible, #tokenSearch:focus-visible, select:focus-visible {
  outline: 2px solid var(--lime); outline-offset: 2px;
}

.hero { padding: 56px 0 20px; }
.eyebrow { color: var(--lime); letter-spacing: .18em; text-transform: uppercase; font-size: 11px; font-weight: 800; }

.hero .wrap,
.hero-top,
.hero-copy {
  position: relative;
}

h1[data-i="heroTitle"],
.hero h1 {
  font-size: clamp(34px, 6vw, 64px);
  letter-spacing: -.045em;
  line-height: 1.02;
  max-width: none;
  margin: 10px 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.hero-meme-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: auto;
  flex-shrink: 0;
  padding: 8px 10px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--glass) 86%, transparent);
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  backdrop-filter: blur(16px);
}

.meme-top3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meme-top3 a {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: #08150e;
  box-shadow: 0 0 0 3px rgba(61,255,138,.08);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.meme-top3 a:hover {
  transform: translateY(-2px);
  border-color: var(--lime);
  box-shadow: 0 0 0 3px rgba(61,255,138,.2), 0 8px 18px rgba(0,0,0,.25);
}

.meme-top3 .tok-ico,
.meme-top3 img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 14px;
}

.trade-cta {
  font: 800 12px/1.25 "Instrument Sans", sans-serif;
  color: var(--lime);
  letter-spacing: .02em;
  white-space: nowrap;
}

.trade-cta a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--lime) 55%, transparent);
}

.trade-cta a:hover { border-bottom-color: var(--gold); color: var(--gold); }

.lead { max-width: 640px; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; gap: 10px; margin: 22px 0 28px; flex-wrap: wrap; }
.btn { border-radius: 14px; padding: 11px 16px; font-weight: 800; display: inline-flex; border: 0; }
.btn.tiny { padding: 8px 12px; font-size: 13px; }
.btn.primary { background: linear-gradient(90deg, var(--lime), var(--lime2)); color: #04130a; box-shadow: 0 0 24px rgba(61,255,138,.22); }
.btn.ghost { border: 1px solid var(--line); background: transparent; color: var(--text); }

.kpi-row, .market-grid, .info-grid, .grid { display: grid; gap: 14px; }
.kpi-row { grid-template-columns: repeat(4, 1fr); }
.kpi, .glass, .card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  backdrop-filter: blur(16px); box-shadow: var(--shadow);
}
.kpi { padding: 16px; }
.kpi span, .kpi small { color: var(--muted); font-size: 12px; }
.kpi b { display: block; font-size: 26px; margin: 6px 0 2px; color: var(--price); letter-spacing: -.03em; }
.kpi .up { color: var(--lime); }
.kpi .down { color: var(--red); }

.section-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin: 36px 0 14px; flex-wrap: wrap; }
.section-head p { color: var(--muted); }
.pulse { color: var(--lime); font-size: 12px; font-weight: 800; letter-spacing: .12em; }
.market-grid { grid-template-columns: 1.5fr .7fr; }
.wide, .session-card { padding: 20px; }
.wide { border-color: color-mix(in srgb, var(--lime) 28%, var(--line)); }
.panel-head, .spot { display: flex; justify-content: space-between; gap: 16px; }
.spot-price, #spotPrice, #iotaPrice {
  font-size: 42px; font-weight: 800; color: var(--price);
  letter-spacing: -.04em; font-variant-numeric: tabular-nums;
  text-shadow: 0 0 24px rgba(61,255,138,.18);
}
.spot-meta, .fineprint, .muted { color: var(--muted); font-size: 13px; }
.spot-stats { display: grid; gap: 8px; min-width: 180px; }
.stat-line { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--line); }
.big { font-size: 42px; font-weight: 800; color: var(--lime); line-height: 1; margin: 8px 0 4px; }
.text-btn, .text-link { background: none; border: 0; color: var(--lime); font-weight: 700; cursor: pointer; }

#apiStatus { color: var(--muted); font-size: 12px; font-weight: 700; }

.iota-chart-wrap { margin-top: 16px; }
.chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.chart-kicker { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.range-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.range-pill {
  border: 1px solid var(--line); background: var(--glass); color: var(--muted);
  padding: 6px 11px; border-radius: 999px; font-weight: 800; font-size: 11px; cursor: pointer;
}
.range-pill:hover { border-color: var(--lime); color: var(--text); }
.range-pill.active {
  background: var(--lime); color: #04130a; border-color: var(--lime);
  box-shadow: var(--focus);
}

.toolbar { display: grid; gap: 10px; margin-bottom: 16px; }
.search-wrap { position: relative; }
#search, #tokenSearch {
  width: 100%; border-radius: 14px; border: 1px solid var(--line);
  background: var(--glass); color: var(--text); padding: 13px 44px 13px 14px; font-size: 15px;
}
.search-wrap kbd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  border: 1px solid var(--line); border-radius: 8px; padding: 2px 7px; color: var(--muted); font-size: 12px;
}
.filters, .toolbar-mini, .sort-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#boardTabs { margin-left: auto; }
.chip {
  border: 1px solid var(--line); background: var(--glass); color: var(--muted);
  padding: 8px 12px; border-radius: 999px; font-weight: 700;
}
.chip.active, .chip:hover { background: var(--lime); color: #04130a; border-color: var(--lime); }
.chip:disabled { opacity: .4; cursor: not-allowed; background: var(--glass); color: var(--muted); border-color: var(--line); }
select {
  border: 1px solid var(--line); background: var(--glass); color: var(--text);
  border-radius: 12px; padding: 8px 10px;
}

.token-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.token-filters { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tok-sort {
  border: 1px solid var(--line); background: var(--glass); color: var(--muted);
  padding: 6px 10px; border-radius: 999px; font: 700 11px/1 "Instrument Sans", sans-serif; cursor: pointer;
}
.tok-sort.active { background: var(--lime); color: #04130a; border-color: var(--lime); }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  backdrop-filter: blur(16px);
}
.token-table { width: 100%; border-collapse: collapse; }
.token-table th, .token-table td {
  text-align: left; padding: 12px 14px;
  border-bottom: 1px solid var(--line); font-size: 14px;
  vertical-align: middle; white-space: nowrap;
}
.token-table th {
  color: var(--muted); font-size: 12px; font-weight: 700;
  position: sticky; top: 0;
  background: color-mix(in srgb, var(--card) 92%, var(--bg));
  z-index: 1;
}
.token-table tr:last-child td { border-bottom: 0; }
.token-row { cursor: pointer; }
.token-row:hover td { background: color-mix(in srgb, var(--lime) 8%, transparent); }
.token-table td:nth-child(1) { width: 40px; padding-right: 0; }
.token-table td:nth-child(2) { white-space: normal; min-width: 220px; }
.token-table td:nth-child(4),
.token-table td:nth-child(5) { font-family: "IBM Plex Mono", monospace; font-weight: 700; }

.tok-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tok-meta { min-width: 0; flex: 1; }
.tok-name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.tok-name-row b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tok-price-inline {
  font: 800 12px/1.2 "IBM Plex Mono", monospace;
  white-space: nowrap;
  flex-shrink: 0;
}

@media (min-width: 721px) {
  .tok-price-inline { display: none; }
}

@media (max-width: 720px) {
  .token-table th:nth-child(4),
  .token-table td:nth-child(4) { display: none; }
}
.tok-ico {
  --h: 150;
  position: relative; width: 28px; height: 28px; border-radius: 9px; overflow: hidden;
  flex: 0 0 28px; display: grid; place-items: center;
  background: hsl(var(--h) 48% 18%);
  border: 1px solid var(--line);
}
.tok-ico img { width: 28px; height: 28px; object-fit: cover; display: block; background: #08150e; }
.tok-fallback {
  display: grid; place-items: center; width: 100%; height: 100%;
  font: 800 9px/1 "IBM Plex Mono", monospace; letter-spacing: .04em; color: var(--text); text-transform: uppercase;
}
.tok-ico img + .tok-fallback { display: none; position: absolute; inset: 0; background: hsl(var(--h) 48% 18%); }

.price-hi { color: var(--price); font-variant-numeric: tabular-nums; }
.chg-hi.up, .chg.up, td.up { color: var(--lime); font-weight: 800; }
.chg-hi.down, .chg.down, td.down { color: var(--red); font-weight: 800; }

.star { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 16px; line-height: 1; }
.star.on { color: var(--gold); filter: drop-shadow(0 0 6px rgba(255,225,77,.35)); }
.dex-pill {
  font-size: 11px; border: 1px solid var(--line); border-radius: 999px;
  padding: 2px 8px; color: var(--muted);
}

.token-pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin: 12px 0 4px; }
.token-pager .muted { font-family: "IBM Plex Mono", monospace; font-size: 12px; }

.heat { padding: 16px; margin-bottom: 16px; }
.heat-chip {
  display: inline-flex; margin: 0 8px 8px 0; padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--glass); font-size: 12px; color: var(--muted);
}
.row { display: flex; justify-content: space-between; font-size: 14px; margin-top: 10px; }
.bar { height: 8px; background: color-mix(in srgb, var(--text) 8%, transparent); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--lime), var(--gold)); }

.grid { grid-template-columns: repeat(3, 1fr); padding-bottom: 40px; }
.grid.list { grid-template-columns: 1fr; }
.card { display: flex; flex-direction: column; gap: 10px; min-height: 230px; padding: 18px; transition: transform .15s ease, border-color .15s ease; }
.card:hover { transform: translateY(-4px); border-color: var(--lime); }
.top { display: flex; gap: 12px; align-items: center; }
.icon { width: 46px; height: 46px; border-radius: 12px; overflow: hidden; background: #08150e; border: 1px solid var(--line); flex-shrink: 0; }
.icon img { width: 100%; height: 100%; object-fit: cover; }
.title { font-weight: 800; }
.clicks { color: var(--lime); font-size: 12px; font-weight: 700; }
.desc { color: var(--muted); font-size: 14px; }
.open {
  margin-top: auto; border: 0; border-radius: 12px; padding: 10px;
  background: linear-gradient(90deg, var(--lime), var(--gold)); color: #04130a; font-weight: 800;
}

.info-grid { grid-template-columns: repeat(3, 1fr); margin: 10px 0 48px; }
.info-grid article { padding: 18px; }
.info-grid h3 { margin-bottom: 8px; }

.trade-mask { position: fixed; inset: 0; background: rgba(4, 12, 8, .62); z-index: 80; display: none; backdrop-filter: blur(6px); }
.trade-drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: min(560px, 100vw); z-index: 81;
  background: var(--bg2); border-left: 1px solid var(--line); display: none; flex-direction: column;
  box-shadow: var(--shadow); overflow: auto;
}
.trade-head {
  padding: 16px 18px; display: flex; justify-content: space-between; gap: 12px;
  border-bottom: 1px solid var(--line); align-items: flex-start;
}
.trade-head h3 { font-size: 18px; letter-spacing: -.02em; }
#tradeMeta { color: var(--price); font-size: 15px; margin-top: 4px; font-weight: 800; }
.trade-actions { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: flex-end; gap: 6px; }
.trade-actions a, #tradeScan, #tradeOpen, #tradeClose {
  margin: 0; padding: 6px 10px; border-radius: 10px; background: var(--glass);
  color: inherit; text-decoration: none; border: 1px solid var(--line); cursor: pointer; font: inherit;
}
#tradeClose { min-width: 36px; font-weight: 800; }
#tradeChart {
  width: calc(100% - 32px); height: 220px; display: block; margin: 12px 16px;
  border-radius: 12px; background: #07140e; border: 1px solid var(--line);
}
#tradeList { overflow: auto; flex: 1; padding: 8px 10px 24px; }
.trade-row {
  display: grid; gap: 4px; padding: 10px 8px; font-size: 12px;
  font-family: "IBM Plex Mono", monospace; border-bottom: 1px solid var(--line);
}
.trade-row .buy { color: var(--lime); font-weight: 800; }
.trade-row .sell { color: var(--red); font-weight: 800; }

footer { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 13px; }
.footer-grid { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 14px; }

.tok-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 28px 0;
}
.tok-spin {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .18);
  border-top-color: var(--lime);
  animation: tokspin .7s linear infinite;
}
@keyframes tokspin {
  to { transform: rotate(360deg); }
}
[data-theme="light"] .tok-spin {
  border-color: rgba(16, 90, 48, .18);
  border-top-color: #14e06a;
}

@media (max-width: 900px) {
  .links { display: none; }
  .kpi-row, .market-grid, .info-grid, .grid { grid-template-columns: 1fr; }
  h1[data-i="heroTitle"],
  .hero h1 { max-width: none; }
  .hero-meme-wrap { margin-left: 0; width: 100%; justify-content: space-between; }
  #boardTabs { margin-left: 0; }
  .token-table th, .token-table td { padding: 10px 10px; font-size: 13px; }
  .token-pager { justify-content: space-between; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track, .card, .trade-drawer, .meme-top3 a { animation: none; transition: none; }
}
.brand .logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}