/* One coin. Shares coins.css for the shell, placeholder and empty state. */

.coin-head {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 30px 0 22px;
}
.coin-hero {
  width: 96px; height: 96px; border-radius: var(--r-sm);
  object-fit: cover; display: block; background: var(--bg-4);
  flex: 0 0 auto;
}
.coin-head .coin-ph { font-size: 28px; }
.coin-head-main { min-width: 0; flex: 1 1 auto; }
.coin-title { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.coin-title h1 { font: 600 27px/1.1 Geist, sans-serif; color: var(--txt-hero); letter-spacing: -.02em; }
.coin-title span { font-size: 13px; color: var(--txt-5); }
.coin-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* An address is never truncated in the DOM. A shortened one is one somebody
   will select and paste, and half an address sends money nowhere. */
.addr {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  padding: 7px 9px; border-radius: var(--r-xs);
  background: var(--bg-2); border: 1px solid var(--line);
}
.addr-l {
  font: 500 9.5px/1 'Geist Mono', monospace; letter-spacing: .1em;
  text-transform: uppercase; color: var(--txt-5); white-space: nowrap;
}
.addr code {
  font: 400 11px 'Geist Mono', monospace; color: var(--txt-3);
  overflow-wrap: anywhere; min-width: 0; flex: 1 1 auto;
}

.card {
  padding: 17px; margin-bottom: 12px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.card h2 {
  font: 500 9.5px/1 'Geist Mono', monospace; letter-spacing: .12em;
  text-transform: uppercase; color: var(--txt-5); margin-bottom: 13px;
}
.muted { font-size: 12.5px; line-height: 1.6; color: var(--txt-5); }
.small { font-size: 11.5px; }
.warn { font-size: 11.5px; line-height: 1.6; color: var(--err); }

/* ------------------------------------------------------------------ jobs */

.jobs-list { display: grid; gap: 9px; }
.jrow {
  padding: 12px 13px; border-radius: var(--r-xs);
  background: var(--bg); border: 1px solid var(--line);
}
.jrow-top { display: flex; align-items: baseline; gap: 10px; }
.jrow-top b { font: 500 13.5px Geist, sans-serif; color: var(--txt); }
.jrow-pct {
  margin-left: auto; font: 600 13.5px 'Geist Mono', monospace;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.jrow-rule { margin-top: 6px; font-size: 11.5px; line-height: 1.55; color: var(--txt-5); }
.jrow-cfg { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.jrow-set {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 2px 7px; border-radius: 3px; background: var(--bg-3);
  font-size: 10.5px; color: var(--txt-3);
}
.jrow-set .k { color: var(--txt-5); }
.jrow-run {
  display: flex; gap: 12px; margin-top: 9px;
  font: 500 11px 'Geist Mono', monospace; color: var(--txt-4);
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------- engine
   Whether the engine is working on this coin. Quiet when it is, loud when it
   is not: a failing coin has to READ failing at a glance, which is the whole
   defect this section exists for. --err is the same red the lock mismatch
   warning uses, and it is the only place on the page that colour appears. */

/* style.css has .tag-accent and .tag-warn and no red one. The failing state is
   not a warning, it is a failure, and dressing it as amber was half the
   problem. */
.tag-err { background: rgba(248, 113, 113, .1); color: var(--err); border-color: rgba(248, 113, 113, .3); }

.engine .warn { margin-bottom: 9px; }
.engine .muted + .muted { margin-top: 7px; }
/* The engine's own error text, verbatim. A <pre> because it is a machine
   string and may be several errors joined; it wraps rather than scrolling,
   because a message a holder cannot read is the same as no message. */
.engine-err {
  margin: 0 0 9px; padding: 9px 10px;
  background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-xs);
  font: 400 11px/1.6 'Geist Mono', monospace; color: var(--txt-3);
  white-space: pre-wrap; overflow-wrap: anywhere;
}

/* ----------------------------------------------------------------- draws
   One block per round. The claim this page makes about a game is that anyone
   can re-run the draw, so every round carries the inputs that makes true: the
   entrant count and the hash of the ordered list, the seed block and its
   blockhash, and both signatures. Nothing here is shortened: a hash somebody
   has to compare against their own is the one string that must not be
   ellipsised, and the same goes for the winner's address. */

.draw-list { display: grid; gap: 9px; }
.drow {
  padding: 12px 13px; border-radius: var(--r-xs);
  background: var(--bg); border: 1px solid var(--line);
}
.drow-top { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; }
.drow-top b { font: 500 13.5px Geist, sans-serif; color: var(--txt); }
.dround {
  font: 500 11px 'Geist Mono', monospace; color: var(--txt-5);
  font-variant-numeric: tabular-nums;
}
.dwhen { margin-left: auto; font: 500 10.5px 'Geist Mono', monospace; color: var(--txt-5); }

/* Who won, and how much. The one line a holder opened the page for, so it is
   the only thing in the block set at reading size. */
.dwin { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.dwin b {
  font: 600 16px 'Geist Mono', monospace; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.dwin span { font-size: 12px; color: var(--txt-5); }
.dwho {
  font: 400 11.5px/1.5 'Geist Mono', monospace; color: var(--txt-3);
  overflow-wrap: anywhere; min-width: 0;
  text-decoration: none; border-bottom: 1px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.dwho:hover { color: var(--accent); border-bottom-color: rgba(134, 239, 172, .4); }

/* margin and the dd indent set explicitly: there is no reset for dl/dd in
   style.css, so the browser's own 1em block margin and 40px dd indent apply. */
.draw-meta {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px;
  margin: 11px 0 0; font-size: 12px;
}
.draw-meta dt {
  font: 500 9.5px/1.7 'Geist Mono', monospace; letter-spacing: .08em;
  text-transform: uppercase; color: var(--txt-5); white-space: nowrap;
}
.draw-meta dd { margin: 0; color: var(--txt-3); min-width: 0; font-variant-numeric: tabular-nums; }
.draw-meta code {
  font: 400 10.5px/1.5 'Geist Mono', monospace; color: var(--txt-4);
  overflow-wrap: anywhere;
}
.drow .muted { margin-top: 9px; }
.dlinks { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 11px; }

/* The retry under a chain read that did not answer. */
.retry { margin: 12px 0 4px; }

@media (max-width: 480px) {
  /* The label column is the first thing to go: "WINNING TICKET" over one line
     leaves nothing for the value beside it at 375px. */
  .draw-meta { grid-template-columns: 1fr; gap: 1px 0; }
  .draw-meta dt { margin-top: 7px; }
  .dwhen { margin-left: 0; }
}

/* ------------------------------------------------------------------ lock */

.lock-state {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 13px; border-radius: var(--r-xs);
  background: var(--accent-deep); border: 1px solid var(--accent-line);
}
.lock-state b { font: 600 19px 'Geist Mono', monospace; color: var(--accent); font-variant-numeric: tabular-nums; }
.lock-state span { font-size: 12px; color: var(--txt-3); }
/* Unlocked and released are not failures, but they are not the green state
   either: a reader glancing at the colour should not read "still locked". */
.lock-state.open, .lock-state.done { background: var(--bg-3); border-color: var(--line-3); }
.lock-state.open b, .lock-state.done b { color: var(--txt-2); }

.lock-meta {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px;
  margin-top: 13px; font-size: 12px;
}
.lock-meta dt {
  font: 500 9.5px/1.6 'Geist Mono', monospace; letter-spacing: .08em;
  text-transform: uppercase; color: var(--txt-5);
}
/* margin: 0 because there is no reset for dd in style.css, so the browser's own
   40px margin-inline-start applied inside this grid and pushed every value 54px
   off its label instead of the 14px the gap asks for. Measured in the browser,
   not assumed. Same reason .draw-meta dd sets it. */
.lock-meta dd { margin: 0; color: var(--txt-3); }
.lock-links { display: flex; gap: 8px; flex-wrap: wrap; margin: 13px 0 11px; }

@media (max-width: 640px) {
  .coin-head { padding: 22px 0 18px; gap: 13px; }
  .coin-hero { width: 72px; height: 72px; }
  .coin-title h1 { font-size: 23px; }
  .addr code { font-size: 10px; }
}

/* ===================================================== market and chart ===
   The numbers a coin page leads with, and the line under them.

   Modelled on what this category has converged on (pump.fun, splicepad): a
   horizontal strip of labelled figures directly under the coin's identity,
   then the chart, then everything specific to the product. The convergence is
   not fashion, it is that a visitor arriving from a link is looking for
   exactly one of those numbers and scanning a row is faster than reading a
   grid of cards.

   Where we differ: every cell carries a provenance line. On this page the
   market cap is read off chain on the request, the change is from our own
   hourly readings, and the fee figures are receipts. Three different kinds of
   number, and a reader deciding whether to buy should not have to guess which
   is which. */

.market { padding-bottom: 18px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.stat {
  display: flex; flex-direction: column; gap: 3px;
  padding: 11px 13px 12px;
  background: var(--bg-2);
}
.stat-l {
  font: 500 9.5px 'Geist Mono', monospace; letter-spacing: .13em;
  text-transform: uppercase; color: var(--txt-5);
}
.stat-v {
  font: 600 17px 'Geist Mono', monospace; letter-spacing: -.02em;
  color: var(--txt-hero); font-variant-numeric: tabular-nums;
  /* The figures line up down the column even as they change length, which is
     what makes a strip of numbers scannable rather than jittery. */
  font-feature-settings: 'tnum' 1;
}
.stat-v.up   { color: var(--accent); }
.stat-v.down { color: var(--err); }
/* The provenance line. Deliberately small and quiet: it is there to be found
   when somebody asks "where did that come from", not to compete with the
   number it belongs to. */
.stat-n {
  font-size: 10px; line-height: 1.35; color: var(--txt-5); max-width: 22ch;
}

/* ------------------------------------------------------- the curve bar */

.curvebar { margin-top: 16px; }
.curvebar-l {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 7px;
}
.curvebar-l span {
  font: 500 9.5px 'Geist Mono', monospace; letter-spacing: .13em;
  text-transform: uppercase; color: var(--txt-5);
}
.curvebar-l b {
  font: 600 13px 'Geist Mono', monospace; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.curvebar-t {
  height: 6px; border-radius: 3px; background: var(--bg-4); overflow: hidden;
}
.curvebar-t span {
  display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  transition: width .6s var(--ease);
}
@media (prefers-reduced-motion: reduce) { .curvebar-t span { transition: none; } }

/* ------------------------------------------------------------ the chart */

.chartcard { padding-bottom: 14px; }
.chart-head {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.chart-head h2 { margin: 0; flex: 0 0 auto; }
.chart-head .seg-pick { margin-left: auto; }
/* The crosshair readout. Reserves its own line at every width so the header
   does not reflow as the pointer moves across the chart, which is the kind of
   jitter that makes a chart feel cheap. */
.chart-read {
  flex: 1 1 100%; min-height: 17px;
  display: flex; align-items: baseline; gap: 9px;
}
.chart-read b {
  font: 600 13.5px 'Geist Mono', monospace; color: var(--txt-hero);
  font-variant-numeric: tabular-nums;
}
.chart-read span { font-size: 11.5px; color: var(--txt-5); }

.chart { width: 100%; }
/* A FIXED HEIGHT, because the ratio cannot be trusted to give one.
   preserveAspectRatio="none" with height:auto makes the drawn height a function
   of the width: at 343px on a phone the 1000x230 viewBox rendered 79px tall and
   squashed the 10px axis labels to 3.4px. The chart is as tall as a chart
   should be and the geometry stretches to fill it, which is exactly what
   preserveAspectRatio="none" is for. */
.chart-svg { width: 100%; height: 230px; display: block; overflow: visible; }

.chart-grid   { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-axis   { fill: var(--txt-5); font: 400 10px 'Geist Mono', monospace; }
.chart-line   { fill: none; stroke: var(--accent); stroke-width: 1.6;
                stroke-linejoin: round; stroke-linecap: round;
                vector-effect: non-scaling-stroke; }
.chart-dot    { fill: var(--accent); }
.chart-last   { fill: var(--accent); stroke: var(--bg-2); stroke-width: 2;
                vector-effect: non-scaling-stroke; }
/* Graduation. A real discontinuity in how the price is formed, so it gets a
   mark rather than being smoothed over. */
.chart-mark   { stroke: var(--txt-5); stroke-width: 1; stroke-dasharray: 3 3;
                vector-effect: non-scaling-stroke; }
.chart-mark-t { fill: var(--txt-5); font: 400 9.5px 'Geist Mono', monospace;
                letter-spacing: .1em; text-transform: uppercase; }
.chart-cursor { stroke: var(--txt-4); stroke-width: 1; vector-effect: non-scaling-stroke;
                transition: opacity .12s linear; pointer-events: none; }

.chart-empty {
  display: grid; place-items: center; min-height: 140px;
  border: 1px dashed var(--line-2); border-radius: var(--r-sm);
}
.chart-note {
  margin: 0; max-width: 42ch; text-align: center;
  font-size: 12px; line-height: 1.6; color: var(--txt-5);
}

@media (max-width: 560px) {
  /* Shorter on a phone, not squashed: 230px of chart is most of a small screen
     and the shape survives 180 fine. The axis text is set in px against the
     viewBox, so it scales with the height and stays legible either way. */
  .chart-svg { height: 180px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  /* An odd number of cells left an empty half-tile showing the grid's line
     colour, which read as a stat that failed to load. The last cell spans the
     row when it is alone on it. */
  .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .stat-v { font-size: 15.5px; }
  .chart-head h2 { flex: 1 1 auto; }
  .chart-head .seg-pick { margin-left: 0; }
}

/* ---------------------------------------------------------- holders
   A list, not a table. Three columns of which the middle one is a bar, because
   at ten rows the thing a reader is actually asking is "does one wallet own
   this", and that is a shape question rather than a number question. */

.holders { display: grid; gap: 1px; }
.hrow {
  display: grid; grid-template-columns: 11ch 1fr auto;
  align-items: center; gap: 12px;
  padding: 7px 0;
}
.hrow + .hrow { border-top: 1px solid var(--line); }
.hwho {
  font: 400 12px 'Geist Mono', monospace; color: var(--txt-4);
  text-decoration: none; border-bottom: 1px solid transparent;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.hwho:hover { color: var(--accent); border-bottom-color: rgba(134, 239, 172, .4); }
.hbar { height: 5px; border-radius: 3px; background: var(--bg-4); overflow: hidden; }
.hbar span {
  display: block; height: 100%; border-radius: 3px; background: var(--accent-deep);
  transition: width .5s var(--ease);
}
.hrow:hover .hbar span { background: var(--accent); }
.hamt {
  font: 600 12.5px 'Geist Mono', monospace; color: var(--txt-2);
  font-variant-numeric: tabular-nums; text-align: right;
}
@media (prefers-reduced-motion: reduce) { .hbar span { transition: none; } }
@media (max-width: 480px) { .hrow { grid-template-columns: 10ch 1fr auto; gap: 9px; } }
