/* Kobold Pool: shared styles for the coin list and the coin pages. */
:root {
  --bg: #0e1113;
  --bg-glow: #1a1510;
  --surface: #151a1e;
  --surface-2: #1b2126;
  --border: #262e35;
  --text: #e7eaed;
  --muted: #8d98a2;
  --faint: #5d6872;
  --accent: #f2a541;
  --accent-ink: #1b1306;
  --accent-soft: rgba(242, 165, 65, 0.12);
  --good: #3fbf6f;
  --bad: #ef5b5b;
  --warn: #e5b04a;
  --link: #8ab4ff;
  --topbar-bg: rgba(14, 17, 19, 0.85);
  --code-text: #d7dde3;
  --bad-text: #f3b0b0;
  --good-text: #a8e6bf;
  --shadow: rgba(0, 0, 0, 0.35);
  --radius: 12px;
  --radius-sm: 8px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
/* Light mode: the device's setting, or the toggle in the menu (data-theme, remembered in the browser). */
:root[data-theme="light"] {
  --bg: #f5f6f7;
  --bg-glow: #fdf1de;
  --surface: #ffffff;
  --surface-2: #f0f2f4;
  --border: #dde2e6;
  --text: #15191d;
  --muted: #59646e;
  --faint: #87919a;
  --accent: #d98614;
  --accent-ink: #1b1306;
  --accent-soft: rgba(217, 134, 20, 0.12);
  --good: #1f8a4c;
  --bad: #c93c3c;
  --warn: #a8740f;
  --link: #1f5fd1;
  --topbar-bg: rgba(255, 255, 255, 0.88);
  --code-text: #23292f;
  --bad-text: #9e2a2a;
  --good-text: #17683a;
  --shadow: rgba(20, 30, 40, 0.15);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f6f7; --bg-glow: #fdf1de; --surface: #ffffff; --surface-2: #f0f2f4; --border: #dde2e6;
    --text: #15191d; --muted: #59646e; --faint: #87919a; --accent: #d98614; --accent-ink: #1b1306;
    --accent-soft: rgba(217, 134, 20, 0.12); --good: #1f8a4c; --bad: #c93c3c; --warn: #a8740f; --link: #1f5fd1;
    --topbar-bg: rgba(255, 255, 255, 0.88); --code-text: #23292f; --bad-text: #9e2a2a; --good-text: #17683a;
    --shadow: rgba(20, 30, 40, 0.15);
    color-scheme: light;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  background: radial-gradient(1200px 500px at 15% -10%, var(--bg-glow), transparent 60%), var(--bg);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  font-size: 15px;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.hidden { display: none !important; }

/* top bar */
.topbar { border-bottom: 1px solid var(--border); background: var(--topbar-bg); position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px); }
.topbar .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.05rem;
  letter-spacing: 0.2px; }
.brand:hover { text-decoration: none; }
.brand svg { width: 30px; height: 30px; }
.brand span b { color: var(--accent); font-weight: 700; }
.nav { display: flex; gap: 18px; margin-left: auto; font-size: 0.92rem; }
.nav a { color: var(--muted); }
.nav a:hover, .nav a.active { color: var(--text); text-decoration: none; }
.theme-toggle { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 999px; width: 30px;
  height: 30px; cursor: pointer; font-size: 0.95rem; line-height: 1; display: grid; place-items: center; flex: none; }
.theme-toggle:hover { color: var(--text); border-color: var(--faint); }
.nav { align-items: center; }

/* hero */
.hero { padding: 48px 0 28px; }
.hero h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); line-height: 1.15; letter-spacing: -0.5px; max-width: 720px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: var(--muted); margin-top: 12px; max-width: 640px; font-size: 1.02rem; }

/* stat tiles */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 28px; }
.stats.cols-4 { grid-template-columns: repeat(4, 1fr); }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.tile .label { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.6px; }
.tile .value { font-size: 1.35rem; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .sub { color: var(--faint); font-size: 0.78rem; margin-top: 2px; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card h2 { font-size: 1.05rem; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.card h2 .hint { color: var(--muted); font-weight: 400; font-size: 0.85rem; margin-left: auto; }
.section { margin-top: 28px; }
.section-title { font-size: 1.15rem; margin-bottom: 12px; display: flex; align-items: center; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; }
.grid-2 > * { min-width: 0; } /* let wide tables scroll inside their card instead of widening the page */

/* search + coin table */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.search { position: relative; flex: 1; max-width: 360px; }
.search input { width: 100%; padding: 10px 12px 10px 36px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 0.95rem; }
.search input:focus { outline: none; border-color: var(--accent); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px;
  color: var(--muted); }
.table-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.table-card.table-scroll { overflow-x: auto; }
.table-scroll td { white-space: nowrap; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th { text-align: left; color: var(--muted); font-weight: 500; font-size: 0.78rem; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2);
  white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
tbody tr.link { cursor: pointer; }
tbody tr.link:hover { background: var(--surface-2); }
.empty { color: var(--muted); padding: 22px 16px; text-align: center; }

.coin { display: flex; align-items: center; gap: 12px; }
.coin-icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 750;
  font-size: 0.82rem; color: #0b0d10; flex: none; }
.coin-icon.lg { width: 56px; height: 56px; font-size: 1.15rem; }
.coin .name { font-weight: 650; }
.coin .ticker { color: var(--muted); font-size: 0.82rem; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-weight: 600;
  font-size: 0.88rem; cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.sm { padding: 4px 10px; font-size: 0.8rem; }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem;
  font-weight: 600; border: 1px solid var(--border); color: var(--muted); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); }
.pill.ok { color: var(--good); border-color: rgba(63, 191, 111, 0.35); }
.pill.ok .dot { background: var(--good); box-shadow: 0 0 0 3px rgba(63, 191, 111, 0.18); }
.pill.down { color: var(--bad); border-color: rgba(239, 91, 91, 0.35); }
.pill.down .dot { background: var(--bad); }
.pill.accent { color: var(--accent); border-color: rgba(242, 165, 65, 0.4); background: var(--accent-soft); }

/* coin page header */
.crumbs { color: var(--muted); font-size: 0.88rem; padding-top: 22px; }
.crumbs a { color: var(--muted); }
.coin-head { display: flex; align-items: center; gap: 16px; margin-top: 14px; flex-wrap: wrap; }
.coin-head h1 { font-size: 1.7rem; letter-spacing: -0.3px; }
.coin-head h1 small { color: var(--muted); font-weight: 500; font-size: 1rem; margin-left: 6px; }
.coin-head .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.coin-desc { color: var(--muted); margin-top: 12px; max-width: 760px; }
.links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 0.9rem; }

/* start mining */
.steps { counter-reset: step; display: grid; gap: 18px; }
.step { display: grid; grid-template-columns: 30px 1fr; gap: 12px; }
.step::before { counter-increment: step; content: counter(step); width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700;
  font-size: 0.85rem; }
.step h3 { font-size: 0.95rem; margin-bottom: 6px; }
.step p { color: var(--muted); font-size: 0.9rem; }
.fields { display: grid; grid-template-columns: 2fr 1fr; gap: 8px; margin-top: 8px; }
.field label { display: block; color: var(--muted); font-size: 0.78rem; margin-bottom: 4px; }
.field input, .field select { width: 100%; padding: 9px 11px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-family: var(--mono); font-size: 0.85rem; }
.field input:focus { outline: none; border-color: var(--accent); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 10px; }
.tab { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--muted);
  cursor: pointer; font-size: 0.85rem; font-weight: 600; }
.tab.active { background: var(--accent-soft); color: var(--accent); border-color: rgba(242, 165, 65, 0.45); }
.miner-info { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 0.85rem; margin-bottom: 8px; }
.code { position: relative; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 84px 12px 14px; font-family: var(--mono); font-size: 0.84rem; white-space: pre-wrap; word-break: break-all;
  color: var(--code-text); }
.code .copy { position: absolute; top: 8px; right: 8px; }
.endpoints { display: grid; gap: 8px; }
.endpoint { display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 8px 8px 12px; }
.endpoint .what { color: var(--muted); font-size: 0.8rem; min-width: 64px; }
.endpoint code { flex: 1; word-break: break-all; }

/* key/value list */
.kv { display: grid; grid-template-columns: 1fr auto; gap: 0; }
.kv div { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.92rem; }
.kv div:nth-last-child(-n+2) { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.note { color: var(--muted); font-size: 0.85rem; margin-top: 12px; }

/* lookup */
.lookup { display: flex; gap: 8px; }
.lookup input { flex: 1; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-family: var(--mono); font-size: 0.88rem; min-width: 0; }
.lookup input:focus { outline: none; border-color: var(--accent); }
.error { color: var(--bad); font-size: 0.88rem; margin-top: 8px; }
.result { margin-top: 16px; }
.lookup-bar { margin-top: 18px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 16px; }
.lookup-bar h2 { margin: 0; font-size: 0.98rem; white-space: nowrap; }
.lookup-bar .lookup { flex: 1; min-width: 260px; }
.lookup-bar .error { flex-basis: 100%; margin-top: 0; }

/* wallet dashboard */
.wallet-addr { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.wallet-addr code { color: var(--muted); word-break: break-all; font-size: 0.85rem; }
.chart-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.chart-head h2 { margin: 0; }
.chart-head .tabs { margin: 0; }
.chart-head .grow { flex: 1; }
.chart-now { color: var(--muted); font-size: 0.85rem; margin-bottom: 8px; }
.chart-now b { color: var(--text); font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.chart { position: relative; height: 260px; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid { stroke: var(--border); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis { fill: var(--faint); font-size: 11px; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .cross { stroke: var(--muted); stroke-width: 1; shape-rendering: crispEdges; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .empty-msg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 0.9rem; }
.tip { position: absolute; pointer-events: none; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 10px; font-size: 0.8rem; white-space: nowrap; z-index: 2;
  box-shadow: 0 6px 20px var(--shadow); }
.tip .v { font-weight: 700; font-size: 0.95rem; font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; }
.tip .v i { width: 12px; height: 2px; background: var(--accent); display: inline-block; border-radius: 1px; }
.tip .t { color: var(--muted); margin-top: 2px; }
.chart-table { margin-top: 10px; }
.chart-table summary { font-weight: 500; color: var(--muted); font-size: 0.85rem; }
.chart-table summary::after { content: none; }
.chart-table .table-scroll { max-height: 260px; overflow-y: auto; margin-top: 8px; }
.spark { width: 96px; height: 24px; display: block; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linejoin: round; }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.85rem; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status.on { color: var(--good); }
.status.on::before { background: var(--good); }
.status.off { color: var(--bad); }
.status.off::before { background: var(--bad); }
tbody tr.sel { background: var(--accent-soft); }

/* faq */
details { border-bottom: 1px solid var(--border); padding: 12px 0; }
details:last-child { border-bottom: 0; }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--muted); font-weight: 400; }
details[open] summary::after { content: "−"; }
details p { color: var(--muted); margin-top: 8px; font-size: 0.92rem; }

.banner { margin-top: 16px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid rgba(239, 91, 91, 0.35);
  background: rgba(239, 91, 91, 0.08); color: var(--bad-text); font-size: 0.9rem; }

footer { margin-top: 56px; border-top: 1px solid var(--border); padding: 24px 0 40px; color: var(--muted); font-size: 0.85rem; }
footer .wrap { display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; }
footer a { color: var(--muted); }

@media (max-width: 860px) {
  .stats, .stats.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .nav .opt { display: none; }
  /* coin table becomes cards */
  table.responsive thead { display: none; }
  table.responsive, table.responsive tbody, table.responsive tr, table.responsive td { display: block; width: 100%; }
  table.responsive tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  table.responsive tr:last-child { border-bottom: 0; }
  table.responsive td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: 0.82rem; text-align: left; }
  table.responsive td.first::before, table.responsive td.action::before { content: none; }
  table.responsive td.action { justify-content: flex-end; padding-top: 10px; }
}
@media (max-width: 520px) {
  .brand span { white-space: nowrap; }
  .brand svg { width: 26px; height: 26px; }
  .nav { gap: 12px; font-size: 0.88rem; }
  .fields { grid-template-columns: 1fr; }
  .tile .value { font-size: 1.15rem; }
  .card { padding: 16px; }
  .topbar .wrap { gap: 12px; }
  .table-scroll { overflow-x: auto; }
}
