:root {
  --bg: #071019;
  --panel: rgba(12, 24, 35, 0.86);
  --panel-solid: #0c1823;
  --line: rgba(159, 196, 211, 0.14);
  --line-strong: rgba(159, 196, 211, 0.25);
  --text: #eef6f6;
  --muted: #879aa4;
  --acid: #d8ff65;
  --cyan: #58d8ff;
  --up: #67e7ad;
  --down: #ff7783;
  --gold: #f5c96a;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --sans: Inter, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); font-family: var(--sans); }
body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(rgba(88, 216, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88, 216, 255, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 50% -20%, #163342 0, var(--bg) 42%);
  background-size: 44px 44px, 44px 44px, auto;
  overflow-x: hidden;
}

a { color: inherit; }
button, input, select { font: inherit; }

.ambient {
  position: fixed;
  width: 38vw;
  height: 38vw;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.11;
  pointer-events: none;
  z-index: -1;
}
.ambient-a { background: var(--cyan); top: 8vh; right: -18vw; }
.ambient-b { background: var(--acid); bottom: -20vh; left: -20vw; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 0 4vw;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 25, 0.84);
  backdrop-filter: blur(18px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  color: inherit;
  text-decoration: none;
  letter-spacing: 0.08em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--acid);
  color: var(--acid);
  font-family: var(--mono);
  font-weight: 800;
  transform: rotate(-6deg);
}
.brand strong { display: block; font-size: 0.95rem; }
.brand small { color: var(--muted); font: 0.58rem var(--mono); letter-spacing: 0.2em; }
.live-state {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font: 0.68rem var(--mono);
  letter-spacing: 0.08em;
}
.live-state time { color: var(--text); }
.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(245, 201, 106, 0.08);
}
.live-state.online .pulse {
  background: var(--up);
  box-shadow: 0 0 0 5px rgba(103, 231, 173, 0.08), 0 0 16px var(--up);
  animation: pulse 2.2s infinite;
}
@keyframes pulse { 50% { opacity: 0.45; transform: scale(0.8); } }

main { width: min(1440px, 92vw); margin: 0 auto; }
.hero { padding: 9vh 0 6vh; max-width: 900px; }
.eyebrow, .metric-label, .section-index {
  color: var(--cyan);
  font: 0.65rem var(--mono);
  letter-spacing: 0.18em;
}
.hero h1 {
  margin: 20px 0 22px;
  font-size: clamp(3.1rem, 8.2vw, 7.5rem);
  line-height: 0.88;
  letter-spacing: -0.065em;
  font-weight: 650;
}
.hero h1 em { color: var(--acid); font-style: normal; }
.hero > p {
  max-width: 680px;
  margin: 0;
  color: #aab9bf;
  font-size: clamp(1rem, 1.5vw, 1.22rem);
  line-height: 1.65;
}
.hero-meta { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 28px; color: var(--muted); font: 0.65rem var(--mono); text-transform: uppercase; }
.hero-meta span::before { content: "+"; color: var(--acid); margin-right: 7px; }

.metrics {
  display: grid;
  grid-template-columns: 1.2fr repeat(3, 1fr);
  border: 1px solid var(--line);
  background: rgba(8, 19, 29, 0.62);
}
.metric { min-height: 148px; padding: 24px; border-left: 1px solid var(--line); }
.metric:first-child { border-left: 0; }
.metric-primary { background: linear-gradient(135deg, rgba(216, 255, 101, 0.07), transparent 62%); }
.metric strong { display: block; margin-top: 18px; font: 600 clamp(1.7rem, 3vw, 2.8rem) var(--mono); letter-spacing: -0.05em; }
.metric-primary strong { color: var(--acid); }
.metric small { display: block; margin-top: 9px; color: var(--muted); line-height: 1.4; }

.market-panel { margin-top: 4vh; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(14px); }
.panel-head { display: flex; justify-content: space-between; gap: 24px; padding: 28px 30px 24px; border-bottom: 1px solid var(--line); }
.panel-head h2, .section-heading h2 { margin: 7px 0 5px; font-size: clamp(1.45rem, 2.5vw, 2.25rem); letter-spacing: -0.035em; }
.panel-head p, .section-heading p { margin: 0; color: var(--muted); font-size: 0.86rem; }
.refresh-box { text-align: right; color: var(--muted); font: 0.6rem var(--mono); letter-spacing: 0.12em; }
.refresh-box strong { display: block; margin-top: 7px; color: var(--acid); font-size: 1.15rem; }

.controls {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}
.controls label { display: flex; flex-direction: column; gap: 7px; padding: 17px 20px; background: var(--panel-solid); }
.controls label > span { color: var(--muted); font: 0.58rem var(--mono); letter-spacing: 0.14em; }
input, select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}
input::placeholder { color: #586a73; }
select option { background: var(--panel-solid); color: var(--text); }

.table-shell { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 1040px; }
th {
  padding: 13px 15px;
  color: #71858f;
  background: rgba(7, 16, 25, 0.56);
  border-bottom: 1px solid var(--line);
  font: 0.57rem var(--mono);
  letter-spacing: 0.1em;
  text-align: left;
  white-space: nowrap;
}
td { padding: 14px 15px; border-bottom: 1px solid rgba(159, 196, 211, 0.075); font-size: 0.83rem; vertical-align: middle; }
tbody tr { transition: background 180ms ease; }
tbody tr:hover { background: rgba(88, 216, 255, 0.035); }
.align-right { text-align: right; }
.rank { color: #60727b; font: 0.67rem var(--mono); }
.asset { display: flex; align-items: center; gap: 12px; min-width: 185px; }
.asset img, .asset-fallback {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  object-fit: cover;
  background: #142733;
}
.asset-fallback { display: grid; place-items: center; color: var(--cyan); font: 0.7rem var(--mono); border: 1px solid var(--line-strong); }
.asset strong { display: block; font-size: 0.84rem; }
.asset small { display: block; margin-top: 3px; color: var(--muted); font: 0.64rem var(--mono); }
.price { font-family: var(--mono); font-weight: 700; }
.price.up { animation: flash-up 900ms ease; }
.price.down { animation: flash-down 900ms ease; }
@keyframes flash-up { from { color: var(--up); background: rgba(103, 231, 173, 0.08); } }
@keyframes flash-down { from { color: var(--down); background: rgba(255, 119, 131, 0.08); } }
.change { font-family: var(--mono); white-space: nowrap; }
.change.positive { color: var(--up); }
.change.negative { color: var(--down); }
.change.neutral { color: var(--muted); }
.provider {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  color: #b5c7ce;
  font: 0.58rem var(--mono);
  text-transform: uppercase;
  white-space: nowrap;
}
.provider::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--cyan); }
.provider.dexscreener::before { background: var(--acid); }
.provider.livecoinwatch::before { background: var(--gold); }
.loading-row { padding: 70px 20px; text-align: center; color: var(--muted); }
.loader { display: inline-block; width: 13px; height: 13px; margin-right: 9px; border: 1px solid var(--line-strong); border-top-color: var(--acid); border-radius: 50%; animation: spin 800ms linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.panel-foot { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; color: var(--muted); font: 0.66rem var(--mono); }
.panel-foot button {
  border: 1px solid var(--line-strong);
  padding: 10px 16px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.panel-foot button:hover { border-color: var(--acid); color: var(--acid); }
.panel-foot button:disabled { opacity: 0.35; cursor: default; }

.sources-section { padding: 9vh 0 8vh; }
.section-heading { display: flex; gap: 18px; align-items: flex-start; }
.source-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; }
.source-card { min-height: 128px; padding: 20px; border: 1px solid var(--line); background: rgba(8, 19, 29, 0.55); }
.source-card span { color: var(--muted); font: 0.65rem var(--mono); text-transform: uppercase; }
.source-card strong { display: block; margin-top: 24px; color: var(--gold); font: 0.75rem var(--mono); }
.source-card strong.online { color: var(--up); }
.source-card small { display: block; margin-top: 8px; color: var(--muted); line-height: 1.45; }

footer { display: flex; justify-content: space-between; gap: 20px; width: min(1440px, 92vw); margin: 0 auto; padding: 25px 0 38px; border-top: 1px solid var(--line); color: #61737d; font: 0.6rem var(--mono); }

@media (max-width: 900px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { border-top: 1px solid var(--line); }
  .metric:nth-child(odd) { border-left: 0; }
  .metric:nth-child(-n+2) { border-top: 0; }
  .controls { grid-template-columns: 1fr 1fr; }
  .search-wrap { grid-column: 1 / -1; }
  .market-cap-col, .volume-col, .change-col { display: none; }
  table { min-width: 720px; }
  .source-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .site-header { min-height: 64px; padding: 0 18px; }
  main { width: calc(100% - 24px); }
  .hero { padding-top: 62px; }
  .hero h1 { font-size: clamp(3.2rem, 17vw, 5.2rem); }
  .metrics { grid-template-columns: 1fr; }
  .metric { border-left: 0; border-top: 1px solid var(--line); }
  .metric:first-child { border-top: 0; }
  .panel-head { padding: 22px 20px; }
  .refresh-box { display: none; }
  .controls { grid-template-columns: 1fr; }
  .search-wrap { grid-column: auto; }
  th, td { padding-left: 12px; padding-right: 12px; }
  .panel-foot { padding: 15px; }
  footer { display: block; width: calc(100% - 28px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
