:root {
  --ash: #0e0d0c;
  --panel: #171513;
  --panel-2: #1d1a17;
  --line: #2b2723;
  --bone: #ede6d8;
  --muted: #8a8378;
  --ember: #ff6a1a;
  --core: #ffc04d;
  --cold: #6fa8ff;
  --dead: #6b665f;
  --serif: "Playfair Display SC", "Bodoni Moda", Georgia, serif;
  --sans: "IBM Plex Sans Condensed", "Arial Narrow", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --r: 4px;
  --w: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ash);
  color: var(--bone);
  font: 16px/1.5 var(--sans);
}
a { color: var(--bone); text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { color: var(--core); text-decoration-color: var(--ember); }
:focus-visible { outline: 2px solid var(--core); outline-offset: 2px; }
[hidden] { display: none !important; }
.mono, code, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ember { color: var(--ember); }
.cold { color: var(--cold); }
.wrap { max-width: var(--w); margin: 0 auto; padding: 0 20px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.label {
  font: 500 11px/1.2 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.05;
  margin: 0 0 12px;
}
h1 { font-size: clamp(34px, 6vw, 60px); }
h2 { font-size: clamp(24px, 3.4vw, 34px); }
h3 { font-size: 20px; }

/* top bar */
.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--ash);
  position: sticky; top: 0; z-index: 10;
}
.topbar .wrap {
  display: flex; align-items: center; gap: 14px;
  min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; font: 700 22px/1 var(--serif); letter-spacing: 0.04em;
}
.brand img { width: 26px; height: 26px; }
.nav { display: flex; gap: 16px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--bone); }
.topbar .spacer { flex: 1; }
.pill {
  font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 99px; padding: 6px 10px; color: var(--muted);
  white-space: nowrap;
}
.pill .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); margin-right: 6px; vertical-align: 1px; }
.pill.ok .dot { background: var(--ember); }
.pill.ok { color: var(--bone); }
.pill.warn { color: var(--core); border-color: #5a4320; }
.pill.warn .dot { background: var(--core); }
.pill.bad { color: var(--cold); border-color: #2b3b55; }
.pill.bad .dot { background: var(--cold); }
.ca-chip {
  display: inline-flex; align-items: center; gap: 8px;
  font: 12px/1 var(--mono); border: 1px solid var(--line); border-radius: var(--r);
  padding: 6px 8px; color: var(--muted); max-width: 100%;
}
.ca-chip #ca-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-chip button { padding: 3px 8px; font-size: 11px; }
.ext-links { display: flex; gap: 10px; }
.ext-links a { font: 12px var(--mono); color: var(--muted); }

/* buttons */
.btn, button {
  font: 600 14px/1 var(--sans); letter-spacing: 0.02em;
  color: var(--bone); background: transparent;
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 10px 14px; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn:hover, button:hover { border-color: var(--muted); color: var(--bone); }
.btn.fire, button.fire { background: var(--ember); border-color: var(--ember); color: #160a03; }
.btn.fire:hover, button.fire:hover { background: var(--core); border-color: var(--core); color: #160a03; }
.btn.sm, button.sm { padding: 6px 10px; font-size: 12px; }
button:disabled, .btn[aria-disabled="true"] {
  background: var(--panel-2); border-color: var(--line); color: var(--muted); cursor: not-allowed;
}

/* forms */
input, textarea, select {
  font: 15px var(--mono); color: var(--bone);
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; width: 100%;
}
input::placeholder { color: var(--muted); }
input:focus { border-color: var(--ember); outline: none; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field small { color: var(--muted); font-size: 13px; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin: 0 0 16px; min-width: 0; }
fieldset:disabled { opacity: 0.6; }
legend { padding: 0 6px; }
.form-error { color: var(--cold); font-size: 14px; margin-top: 8px; min-height: 1.2em; }

/* hero */
.hero { padding: 48px 0 28px; border-bottom: 1px solid var(--line); }
.hero p.sub { color: var(--muted); font-size: 18px; max-width: 620px; margin: 0 0 22px; }
.lookup { display: flex; gap: 10px; max-width: 760px; }
.lookup input { flex: 1; min-width: 0; font-size: 16px; }

/* sections */
section.block { padding: 36px 0; border-bottom: 1px solid var(--line); }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.block-head p { margin: 0; color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.note { border-left: 2px solid var(--line); padding: 4px 0 4px 12px; color: var(--muted); margin: 12px 0; }
.note.err { border-left-color: var(--cold); color: var(--cold); }
.note.fire { border-left-color: var(--ember); color: var(--bone); }

/* results */
.results { margin-top: 26px; max-width: 980px; }
.result-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; margin-bottom: 14px; }
.group { margin: 0 0 22px; }
.group > h3 { display: flex; align-items: baseline; gap: 10px; }
.group > h3 .count { font: 500 12px var(--mono); color: var(--muted); }
details.group > summary { cursor: pointer; list-style: none; }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary h3 { display: inline; }
details.group > summary::before { content: "+ "; font-family: var(--mono); color: var(--muted); }
details.group[open] > summary::before { content: "− "; }
.loading { color: var(--muted); font-family: var(--mono); font-size: 14px; }
.loading::after { content: "…"; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
th { font: 500 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); background: var(--panel); }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.coin-cell { display: grid; gap: 2px; }
.ticker { font: 600 15px var(--mono); }
.ticker.dead { color: var(--dead); text-decoration: line-through; text-decoration-thickness: 1px; text-decoration-color: var(--muted); }
.ticker.alive { color: var(--ember); }
.obit { font-size: 13px; color: var(--muted); }
.obit .dagger { font-family: var(--serif); color: var(--bone); margin-right: 3px; }
.mint-link { font: 12px var(--mono); color: var(--muted); }

.verdict { font: 600 13px var(--mono); white-space: nowrap; }
.verdict.pass { color: var(--ember); }
.verdict.fail { color: var(--cold); }
.verdict.unknown { color: var(--muted); }

@media (max-width: 640px) {
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack td { border: 0; padding: 4px 12px; text-align: left; display: flex; justify-content: space-between; gap: 12px; }
  table.stack td.num { text-align: right; }
  table.stack td[data-label]::before { content: attr(data-label); font: 500 11px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
  table.stack td.coin-td { display: block; }
}

/* cards: graveyard + phoenixes */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; display: grid; gap: 10px; align-content: start;
}
.card.dead { filter: grayscale(1); }
.card.dead .btn.fire { filter: none; }
.card-top { display: flex; gap: 12px; align-items: center; }
.coin-img {
  width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none;
  background: var(--panel-2); border: 1px solid var(--line);
  display: grid; place-items: center; font: 600 14px var(--serif); color: var(--muted);
}
.card.dead .coin-img { opacity: 0.55; }
.card .name { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin: 0; }
.stats dt { font: 500 10px var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.stats dd { margin: 0; font: 14px var(--mono); font-variant-numeric: tabular-nums; }
.card .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card.alive { border-color: #5a2b12; filter: none; }
.card.alive .ticker { color: var(--ember); text-decoration: none; }

/* signature: reignite, used only when a card turns revived */
.card.reignite { animation: reignite 400ms ease-out; }
.card.reignite::after {
  content: ""; position: absolute; inset: -1px; border-radius: var(--r); pointer-events: none;
  box-shadow: 0 -6px 18px -6px var(--core), inset 0 0 0 1px var(--ember);
  animation: ash-lift 400ms ease-out forwards;
}
@keyframes reignite {
  0% { filter: grayscale(1); background: var(--panel); }
  45% { filter: grayscale(0); background: #2a160b; }
  100% { filter: grayscale(0); background: var(--panel); }
}
@keyframes ash-lift {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-8px); }
}
@media (prefers-reduced-motion: reduce) {
  .card.reignite, .card.reignite::after { animation: none; }
  .loading::after { animation: none; }
}

/* live strip */
.strip { border-bottom: 1px solid var(--line); background: var(--panel); overflow: hidden; }
.strip ul { display: flex; gap: 32px; list-style: none; margin: 0; padding: 10px 20px; overflow-x: auto; white-space: nowrap; font: 13px var(--mono); }
.strip li.new { box-shadow: inset 0 -1px 0 var(--ember); }

/* totals */
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.totals a { text-decoration: none; }
.totals .num { font-size: 22px; color: var(--ember); display: block; }

/* launch tabs */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.tabs button { border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); padding: 12px 16px; }
.tabs button[aria-selected="true"] { color: var(--bone); border-bottom-color: var(--ember); }
.verdict-banner { font: 600 15px var(--mono); margin: 14px 0; }
.coin-head { display: flex; gap: 14px; align-items: center; margin-bottom: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }

/* prose */
.prose { max-width: 760px; }
.prose p, .prose li { color: #d6cfc1; }
.prose h2 { margin-top: 36px; }
.prose ul { padding-left: 20px; }

/* footer */
footer { padding: 32px 0 48px; color: var(--muted); font-size: 14px; }
footer .disclaimer { max-width: 720px; border-top: 1px solid var(--line); padding-top: 16px; }
footer .row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }

@media (max-width: 640px) {
  .wrap { padding: 0 14px; }
  .hero { padding-top: 32px; }
  .lookup { flex-direction: column; }
  .topbar .spacer { display: none; }
  .nav { gap: 12px; }
}
