:root {
  --ink: #0b0a08;
  --ink-2: #13110d;
  --ink-3: #1b1812;
  --line: rgba(243, 213, 138, 0.12);
  --line-2: rgba(243, 213, 138, 0.22);
  --cream: #f1e9d8;
  --muted: #9c9381;
  --faint: #6b6456;
  --gold: #e2b85a;
  --gold-hi: #f3d58a;
  --gold-lo: #b8862e;
  --up: #46c98b;
  --down: #f0645c;
  --display: "Unbounded", "Manrope", sans-serif;
  --body: "Manrope", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --radius: 14px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 8% -10%, rgba(226, 184, 90, 0.16), transparent 60%),
    radial-gradient(700px 480px at 100% 30%, rgba(184, 134, 46, 0.07), transparent 65%),
    var(--ink);
  color: var(--cream);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
}
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
header, .tape, main, footer { position: relative; z-index: 1; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ── header ───────────────────────────── */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1280px; margin: 0 auto; padding: 22px 28px 18px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--cream); }
.brand-mark { width: 34px; height: 34px; }
.brand-word { font-family: var(--display); font-weight: 400; font-size: 21px; letter-spacing: .01em; }
.brand-word b {
  font-weight: 700;
  background: linear-gradient(120deg, var(--gold-hi), var(--gold-lo));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.status {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 12.5px; color: var(--muted); background: rgba(19, 17, 13, .6); white-space: nowrap;
}
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.status[data-state="live"] .dot { background: var(--up); box-shadow: 0 0 0 0 rgba(70, 201, 139, .6); animation: pulse 2s infinite; }
.status[data-state="poll"] .dot { background: var(--gold); }
.status[data-state="down"] .dot { background: var(--down); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(70, 201, 139, .55); } 70% { box-shadow: 0 0 0 8px rgba(70, 201, 139, 0); } 100% { box-shadow: 0 0 0 0 rgba(70, 201, 139, 0); } }

/* ── ticker tape ──────────────────────── */
.tape {
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  background: rgba(11, 10, 8, .55); overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.tape-track { display: flex; width: max-content; animation: tape 60s linear infinite; }
.tape:hover .tape-track { animation-play-state: paused; }
.tape-item {
  display: inline-flex; align-items: baseline; gap: 10px; padding: 11px 26px;
  font-family: var(--mono); font-size: 13px; white-space: nowrap; border-right: 1px solid var(--line);
}
.tape-item .t-sym { color: var(--gold); font-weight: 500; letter-spacing: .04em; }
.tape-item .t-px { color: var(--cream); }
@keyframes tape { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── hero ─────────────────────────────── */
main { max-width: 1280px; margin: 0 auto; padding: 34px 28px 20px; }
.hero { display: grid; grid-template-columns: minmax(280px, 340px) 1fr; gap: 28px; align-items: stretch; }
.info { padding: 6px 0; animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.eyebrow {
  margin: 0 0 14px; font-size: 11.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--gold);
  display: flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--gold); }
h1 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 30px; letter-spacing: .01em; }
h1 .slash { color: var(--faint); font-weight: 400; margin: 0 .12em; }
.coin-name { margin: 4px 0 26px; color: var(--muted); }
.price {
  margin: 0; font-family: var(--display); font-weight: 700; font-size: clamp(38px, 4.6vw, 56px);
  line-height: 1.05; letter-spacing: -.01em; font-variant-numeric: tabular-nums;
  transition: color .6s ease;
}
.price.flash-up { color: var(--up); transition: none; }
.price.flash-down { color: var(--down); transition: none; }
.change { margin: 12px 0 0; font-family: var(--mono); font-size: 15px; }
.up { color: var(--up); }
.down { color: var(--down); }
.stats { margin: 30px 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.stats div { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.stats dt { color: var(--muted); font-size: 13px; }
.stats dd { margin: 0; font-family: var(--mono); font-size: 14px; }
.updated { margin: 14px 0 0; color: var(--faint); font-size: 12px; font-family: var(--mono); }

.panel {
  display: flex; flex-direction: column; min-width: 0;
  background: linear-gradient(180deg, rgba(27, 24, 18, .85), rgba(19, 17, 13, .85));
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .9), inset 0 1px 0 rgba(243, 213, 138, .06);
  animation: rise .7s .08s cubic-bezier(.2, .7, .2, 1) both;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px 0; flex-wrap: wrap; }
.tabs { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: rgba(11, 10, 8, .5); }
.tabs button {
  border: 0; background: none; cursor: pointer; padding: 6px 12px; border-radius: 7px;
  font-size: 12.5px; color: var(--muted); transition: color .2s, background .2s;
}
.tabs button:hover { color: var(--cream); }
.tabs button[aria-selected="true"] { background: var(--gold); color: #1a1406; font-weight: 600; }
.legend { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chart { flex: 1; min-height: 440px; position: relative; }

/* ── board ────────────────────────────── */
.board { margin-top: 54px; }
.board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.board-head h2 { margin: 0; font-family: var(--display); font-weight: 600; font-size: 20px; }
.board-head p { margin: 0; color: var(--faint); font-size: 13px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 12px; }
.card {
  position: relative; text-align: left; cursor: pointer; padding: 16px 16px 12px;
  background: rgba(19, 17, 13, .78); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .25s, transform .25s, background .25s;
  animation: rise .6s calc(.12s + var(--i, 0) * .045s) cubic-bezier(.2, .7, .2, 1) both;
}
.card:hover { border-color: var(--line-2); transform: translateY(-2px); background: rgba(27, 24, 18, .9); }
.card[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset, 0 18px 40px -24px rgba(226, 184, 90, .45); }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-sym { font-family: var(--display); font-weight: 600; font-size: 15px; }
.card-name { color: var(--faint); font-size: 12px; }
.card-px { margin-top: 10px; font-family: var(--mono); font-size: 19px; font-variant-numeric: tabular-nums; transition: color .6s; }
.card-px.flash-up { color: var(--up); transition: none; }
.card-px.flash-down { color: var(--down); transition: none; }
.card-chg { font-family: var(--mono); font-size: 12.5px; margin-top: 2px; }
.spark { display: block; width: 100%; height: 44px; margin-top: 10px; }
.card.loading .card-px, .card.loading .card-chg { color: transparent; background: linear-gradient(90deg, var(--ink-3), #26221a, var(--ink-3)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 4px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── footer ───────────────────────────── */
.foot { max-width: 1280px; margin: 40px auto 0; padding: 26px 28px 40px; border-top: 1px solid var(--line); color: var(--faint); font-size: 12.5px; }
.foot p { margin: 0 0 6px; }
.foot .copy { margin-top: 14px; color: var(--muted); }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .chart { min-height: 340px; }
  .stats { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .top { padding: 16px 16px 14px; }
  .brand-word { font-size: 18px; }
  .status { padding: 6px 11px; font-size: 11.5px; }
  main { padding: 26px 16px 10px; }
  .foot { padding: 22px 16px 32px; }
  .chart { min-height: 300px; }
  .tabs button { padding: 6px 9px; }
  .cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .card { padding: 13px 12px 10px; }
  .card-name { display: none; }
  .card-px { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
