/* quick pick · drop day
   near-black warm ground, coin art supplies the colour, green/red only for price moves. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/fonts/schibsted-grotesk-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ground: #100f0e;
  --surface: #191816;
  --raised: #221f1c;
  --line: #2f2c28;
  --line-strong: #46423c;
  --text: #f3efe8;
  --muted: #a8a196;
  --dim: #8f897f;
  --up: #3ccf7e;
  --down: #ff5f5a;
  --mark: #f3efe8;
  --font: "Schibsted Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-card: 14px;
  --r-ctl: 10px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px -8px rgb(0 0 0 / 0.55);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line-strong) var(--ground); scrollbar-width: thin; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 400 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
::selection { background: var(--text); color: var(--ground); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ground); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 2px solid var(--ground); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 6px; }
input, button { font: inherit; color: inherit; caret-color: var(--text); }
a { color: inherit; text-underline-offset: 3px; text-decoration-thickness: 1px; }
img { display: block; max-width: 100%; }
code { font-family: var(--font); }
h1, h2, p { margin: 0; }
[hidden] { display: none !important; }
/* tabular figures only where numbers line up; the face's tnum is too loose for running text */
.price, .chg, .meta, .rank, .delta, #updated { font-variant-numeric: tabular-nums; }
.big, .stats dd, .chg-line .chg { font-variant-numeric: proportional-nums; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--text); color: var(--ground); padding: 8px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgb(16 15 14 / 0.94);
  border-bottom: 1px solid var(--line);
}
.top-in {
  max-width: 1440px; margin: 0 auto;
  padding: 12px 32px;
  display: flex; align-items: center; gap: 20px;
}
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -0.03em; white-space: nowrap; }
.mark svg { width: 28px; height: 28px; flex: none; }
.mark svg rect { fill: var(--mark); }
.mark svg path { fill: none; stroke: var(--ground); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }

.search { position: relative; flex: 1; max-width: 620px; display: flex; align-items: center; margin-left: 12px; }
.search-ico { position: absolute; left: 13px; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; pointer-events: none; }
.search input {
  width: 100%; height: 42px;
  padding: 0 98px 0 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  font-size: 15px;
  transition: border-color 0.15s, background-color 0.15s;
}
.search input::placeholder { color: var(--dim); }
.search input:hover { border-color: var(--line-strong); }
.search input:focus { outline: none; border-color: var(--text); background: var(--raised); }
.search input[aria-invalid="true"] { border-color: var(--down); }
.search button {
  position: absolute; right: 5px; height: 32px; padding: 0 12px;
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: 7px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background-color 0.15s;
}
.search button:hover { background: var(--line-strong); }
.search button:disabled { cursor: progress; color: var(--muted); }
.search[aria-busy="true"] .search-ico { animation: pulse 0.9s ease-in-out infinite alternate; }
.search-msg {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--raised); border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  padding: 10px 12px; font-size: 14px; color: var(--text); box-shadow: var(--shadow);
}
.search-msg::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--down); margin-right: 8px; vertical-align: 1px; }

.seg { display: inline-flex; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-ctl); margin-left: auto; flex: none; }
.seg button {
  height: 34px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent;
  font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--ground); }

.back { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; height: 40px; padding: 0 12px 0 8px; border-radius: var(--r-ctl); border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 14px; color: var(--muted); }
.back:hover { color: var(--text); border-color: var(--line-strong); }
.back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- board ---------- */
.wrap { width: 100%; max-width: 1440px; margin: 0 auto; padding: 28px 32px 0; flex: 1; }
.board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.board-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; }
.board-head .on { color: var(--muted); font-weight: 600; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.status .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); }
.is-stale .status .dot { background: var(--dim); }

.board-error {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 14px 12px 16px; margin-bottom: 16px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  font-size: 14px;
}

.board { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.card {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 0.25s var(--ease-out), background-color 0.2s;
}
.card:hover { background: var(--raised); box-shadow: inset 0 0 0 1px var(--line-strong), var(--shadow); }
.card-link { display: flex; flex-direction: column; text-decoration: none; height: 100%; border-radius: var(--r-card); }
.card-link:focus-visible { outline-offset: 2px; border-radius: var(--r-card); }
.art { display: block; aspect-ratio: 1; margin: 6px 6px 0; border-radius: 10px; overflow: hidden; background: var(--raised); }
.art img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease-out); }
.card:hover .art img { transform: scale(1.03); }
.tile { display: grid; place-items: center; width: 100%; height: 100%; background: var(--tile-bg); color: var(--tile-fg); font-weight: 900; font-size: clamp(48px, 7vw, 96px); letter-spacing: -0.05em; }
.rank {
  position: absolute; top: 14px; left: 14px;
  min-width: 34px; height: 34px; padding: 0 8px;
  display: grid; place-items: center;
  background: var(--ground); color: var(--text);
  border-radius: 9px;
  font-weight: 800; font-size: 17px; letter-spacing: -0.03em;
}
.body { display: flex; flex-direction: column; padding: 12px 14px 14px; gap: 2px; flex: 1; }
.row1 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tick { font-weight: 800; font-size: 19px; letter-spacing: -0.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chg { font-weight: 700; font-size: 14px; white-space: nowrap; }
.chg.up { color: var(--up); }
.chg.down { color: var(--down); }
.chg.flat { color: var(--muted); }
.name { color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price { font-size: 22px; font-weight: 700; letter-spacing: -0.025em; margin-top: 8px; line-height: 1.15; }
.note { font-size: 14px; color: var(--text); margin-top: 2px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: auto; padding-top: 10px; font-size: 12.5px; color: var(--muted); }
.meta .k { color: var(--dim); }

/* signature: a card that moved stays marked until seen */
.card.is-moved { box-shadow: inset 0 0 0 1.5px var(--text); }
.card.is-moved:hover { box-shadow: inset 0 0 0 1.5px var(--text), var(--shadow); }
.delta {
  position: absolute; top: 14px; right: 14px;
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 9px;
  background: var(--text); color: var(--ground);
  border-radius: 999px;
  font-size: 13px; font-weight: 800; letter-spacing: -0.01em;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.45);
  pointer-events: none;
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}
.delta svg { width: 9px; height: 9px; fill: currentColor; }
.delta.is-new { text-transform: lowercase; }
.delta.is-going { opacity: 0; transform: translateY(-4px); }

/* skeleton */
.is-skel .art { background: var(--raised); }
.is-skel .rank { color: var(--dim); }
.sk { display: block; height: 12px; border-radius: 6px; background: var(--raised); margin: 6px 0; }
.sk.tall { height: 20px; }
.w40 { width: 40%; } .w55 { width: 55%; } .w70 { width: 70%; } .w85 { width: 85%; }
.is-skel .art, .is-skel .sk { animation: pulse 1.1s ease-in-out infinite alternate; }

@keyframes pulse { from { opacity: 1; } to { opacity: 0.45; } }

/* ---------- buttons + forms ---------- */
.btn-light, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding: 0 18px; border-radius: var(--r-ctl);
  font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, transform 0.1s;
}
.btn-light { background: var(--text); color: var(--ground); border: 0; }
.btn-light:hover { background: #fff; }
.btn-light:active, .btn-ghost:active { transform: translateY(1px); }
.btn-light:disabled { cursor: progress; background: var(--muted); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line-strong); height: 36px; padding: 0 14px; font-size: 14px; }
.btn-ghost:hover { border-color: var(--text); }

.after { margin: 56px 0 0; padding: 28px 0 0; border-top: 1px solid var(--line); }
.fb { max-width: 560px; }
.fb label, .join label { display: block; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; margin-bottom: 10px; }
.fb-row { display: flex; gap: 8px; }
.fb-row input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-ctl); font-size: 15px;
  transition: border-color 0.15s;
}
.fb-row input::placeholder { color: var(--dim); }
.fb-row input:hover { border-color: var(--line-strong); }
.fb-row input:focus { outline: none; border-color: var(--text); }
.fb-row input[aria-invalid="true"] { border-color: var(--down); }
.form-msg { min-height: 22px; margin-top: 8px; font-size: 14px; color: var(--muted); display: flex; gap: 6px; align-items: flex-start; }
.join .form-msg:empty { min-height: 0; margin: 0; }
.form-msg.is-error { color: var(--text); }
.form-msg.is-error::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--down); margin-top: 7px; }
.form-msg.is-ok { color: var(--text); font-weight: 600; }
.form-msg svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--text); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }

.foot { max-width: 1440px; width: 100%; margin: 0 auto; padding: 24px 32px 40px; }
.foot p { font-size: 13px; color: var(--muted); max-width: 70ch; }

/* ---------- coin page ---------- */
.coin-wrap { max-width: 1120px; padding-top: 40px; }
.coin { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 1fr); gap: 48px; align-items: start; }
.coin-art { position: sticky; top: 96px; }
.coin-art .art { margin: 0; border-radius: 20px; box-shadow: inset 0 0 0 1px var(--line); }
.coin-art .tile { font-size: 160px; }
.coin-main { display: flex; flex-direction: column; min-width: 0; }
.coin.is-skel .coin-main .sk { margin: 10px 0; }
.coin-id h1 { font-size: 44px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; overflow-wrap: anywhere; }
.coin-name { display: block; font-size: 20px; font-weight: 500; letter-spacing: -0.015em; color: var(--muted); margin-top: 6px; }
.coin-chain { margin-top: 10px; color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.addr { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--text); font-size: 13px; }
.addr:hover { border-color: var(--line-strong); }
.addr svg { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linejoin: round; }
.coin-price { margin-top: 28px; }
.big { font-size: 56px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.chg-line { margin-top: 8px; font-size: 18px; }
.chg-line .chg { font-size: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 28px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stats div { padding: 14px 0; }
.stats div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.stats dt { font-size: 13px; color: var(--muted); }
.stats dd { margin: 4px 0 0; font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.actions { margin-top: 28px; }
.btn-buy {
  width: 100%; height: 54px; border-radius: 12px;
  background: var(--raised); color: var(--muted);
  border: 1px dashed var(--line-strong);
  font-weight: 700; font-size: 16px; cursor: not-allowed;
}
.actions p { margin-top: 8px; }
.join { margin-top: 28px; padding: 20px; background: var(--surface); border-radius: var(--r-card); box-shadow: inset 0 0 0 1px var(--line); }
.join.is-done .fb-row { opacity: 0.7; }
.links { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.link-btn { display: inline-flex; align-items: center; gap: 7px; background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; text-decoration: none; }
.link-btn:hover { color: var(--text); }
.link-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.link-btn[hidden] { display: none; }
.toast { font-size: 13px; color: var(--text); opacity: 0; transition: opacity 0.2s; }
.toast.is-on { opacity: 1; }
.coin-error { max-width: 640px; padding: 40px 0 8px; }
.coin-error h1 { font-size: 34px; font-weight: 800; letter-spacing: -0.035em; }
.coin-error p { margin-top: 12px; color: var(--muted); font-size: 16px; max-width: 60ch; }
.coin-error code { display: inline-block; max-width: 100%; overflow-wrap: anywhere; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; font-size: 13px; color: var(--text); }
.coin-error-actions { display: flex; gap: 10px; align-items: center; margin-top: 24px !important; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) { .board { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 980px) {
  .board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .coin { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .coin-art { max-width: 360px; position: static; }
}
@media (max-width: 760px) {
  .top-in { flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; margin-left: 0; }
  .search input { height: 44px; }
  .seg button { height: 32px; padding: 0 12px; }
  .wrap { padding: 20px 16px 0; }
  .foot { padding: 20px 16px 32px; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .board-head { flex-direction: column; gap: 4px; margin-bottom: 14px; }
  .board-head h1 { font-size: 24px; }
  .art { margin: 4px 4px 0; border-radius: 9px; }
  .rank { top: 10px; left: 10px; min-width: 28px; height: 28px; font-size: 14px; border-radius: 7px; padding: 0 6px; }
  .delta { top: 10px; right: 10px; height: 22px; padding: 0 7px; font-size: 12px; }
  .body { padding: 10px 10px 12px; }
  .tick { font-size: 16px; }
  .chg { font-size: 13px; }
  .name { font-size: 13px; }
  .price { font-size: 17px; margin-top: 6px; }
  .note { font-size: 13px; }
  .meta { font-size: 12px; gap: 2px 8px; padding-top: 8px; }
  .meta span:nth-child(3) { display: none; }
  .coin-wrap { padding-top: 20px; }
  .coin-art { max-width: none; }
  .coin-art .art { width: 160px; border-radius: 16px; }
  .coin-art .tile { font-size: 72px; }
  .coin-id h1 { font-size: 34px; }
  .big { font-size: 40px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .join { padding: 16px; }
  .after { margin-top: 40px; }
}
@media (max-width: 380px) { .fb-row { flex-direction: column; } .mark span { font-size: 17px; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
