/* bc3pool.org
   Two modes, one page. The accent follows the mode: BitcoinIII orange for
   cPPLNS (a coinbase shared out), cyan for SOLO (one address, one block).
   Data is set in a monospace face because everything a miner actually
   handles here - addresses, ports, d=DIFF, hashrates - is monospaced anyway.
   Source is plain ASCII; special characters are written as escapes. */

:root {
  --bg: #111926;
  --surface: #182234;
  --surface-2: #1f2c40;
  --line: #2a3a52;
  --line-soft: #223044;
  --text: #e6ecf4;
  --muted: #8fa0b6;
  --dim: #5d6e85;
  --good: #57c785;
  --warn: #f0925a;
  --bad: #ef6f6c;
  --orange: #f3952c;          /* the BitcoinIII logo */
  --cyan: #5dd3f0;
  --accent: var(--orange);
  --accent-soft: rgba(243, 149, 44, 0.12);
  --accent-line: rgba(243, 149, 44, 0.38);
  --mono: "JetBrains Mono", "Fira Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
  --maxw: 1140px;
}
html[data-mode="solo"] {
  --accent: var(--cyan);
  --accent-soft: rgba(93, 211, 240, 0.12);
  --accent-line: rgba(93, 211, 240, 0.35);
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); font: 15px/1.5 var(--sans); -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: #000; padding: 6px 10px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button { font: inherit; }

/* header ------------------------------------------------------------ */
.top { position: sticky; top: 0; z-index: 20; background: rgba(17, 25, 38, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line-soft); }
.top__inner { max-width: var(--maxw); margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 600; letter-spacing: -0.01em; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand__logo { width: 28px; height: 28px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(243, 149, 44, 0.25); }
.brand__tld { color: var(--muted); font-weight: 400; }
.brand__tag { color: var(--dim); font-weight: 400; font-size: 12px; margin-left: 4px; padding-left: 10px; border-left: 1px solid var(--line); }
@media (max-width: 720px) { .brand__tag { display: none; } }

.modeswitch { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.modeswitch__btn { position: relative; z-index: 1; border: 0; background: transparent; color: var(--muted); padding: 5px 16px; border-radius: 999px; cursor: pointer; font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; transition: color 0.2s; }
.modeswitch__btn[aria-pressed="true"] { color: #0e1420; }
.modeswitch__thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); background: var(--accent); border-radius: 999px; transition: transform 0.25s cubic-bezier(.2,.8,.2,1), background 0.25s; }
html[data-mode="solo"] .modeswitch__thumb { transform: translateX(100%); }

.nav { display: flex; gap: 16px; }
.nav a { color: var(--muted); }
.nav a:hover { color: var(--text); text-decoration: none; }

.search { margin-left: auto; display: flex; gap: 6px; flex: 1 1 320px; max-width: 460px; }
.search__input { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 7px 10px; font-family: var(--mono); font-size: 13px; }
.search__input::placeholder { color: var(--dim); }
.search__btn { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; color: var(--text); padding: 7px 12px; cursor: pointer; white-space: nowrap; }
.search__btn:hover { border-color: var(--accent); }

/* layout ------------------------------------------------------------ */
.main { flex: 1; }
.view { max-width: var(--maxw); margin: 0 auto; padding: 24px 20px 48px; }
.loading { color: var(--muted); }
.section { margin-top: 36px; }
.section__head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.section__title { font-size: 19px; font-weight: 600; margin: 0; letter-spacing: -0.01em; }
.section__meta { color: var(--muted); font-size: 13px; }
.section__meta a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line); }
.grid-2 { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .grid-3 { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px 18px; }
.card--accent { border-color: var(--accent-line); box-shadow: inset 3px 0 0 var(--accent); }
.card__label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.card__value { font-family: var(--mono); font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.card__value small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.card__sub { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* hero ---------------------------------------------------------------- */
.hero { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; margin-top: 8px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.hero__title { font-size: clamp(30px, 4.2vw, 44px); line-height: 1.08; letter-spacing: -0.025em; font-weight: 650; margin: 0 0 14px; }
.hero__lead { color: var(--muted); font-size: 16px; max-width: 52ch; margin: 0 0 20px; }
.stats { display: grid; grid-template-columns: repeat(3, auto); gap: 8px 28px; margin: 0; padding: 0; }
.stats div { display: flex; flex-direction: column; }
.stats dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); order: 2; }
.stats dd { margin: 0; font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.stats dd small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 3px; }
@media (max-width: 520px) { .stats { grid-template-columns: 1fr 1fr; } }

/* the signature: the live coinbase ------------------------------------ */
.ledger { background: linear-gradient(180deg, var(--surface) 0%, #141d2c 100%); border: 1px solid var(--accent-line); border-radius: 14px; padding: 16px 18px 12px; position: relative; overflow: hidden; }
.ledger::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, var(--accent), transparent 70%); }
.ledger__head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ledger__title { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.ledger__tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.ledger__tab { border: 1px solid var(--line); background: transparent; color: var(--muted); font-family: var(--mono); font-size: 12px; padding: 3px 9px; border-radius: 6px; cursor: pointer; }
.ledger__tab[aria-selected="true"] { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.ledger__sum { display: flex; gap: 22px; flex-wrap: wrap; margin: 6px 0 12px; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.ledger__sum b { color: var(--text); font-weight: 600; }
.ledger__rows { display: grid; grid-template-columns: minmax(0, 1fr) 46px minmax(90px, auto); gap: 4px 12px; align-items: center; font-family: var(--mono); font-size: 13px; }
.ledger__addr { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.ledger__addr a { color: inherit; }
.ledger__addr.is-fee { color: var(--muted); }
.ledger__pct { text-align: right; color: var(--muted); }
.ledger__amt { text-align: right; white-space: nowrap; }
.ledger__bar { grid-column: 1 / -1; height: 3px; background: var(--line-soft); border-radius: 2px; overflow: hidden; margin: -2px 0 4px; }
.ledger__bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width 0.6s ease; }
.ledger__more { color: var(--muted); font-size: 12px; margin-top: 6px; font-family: var(--mono); }
.ledger__foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--dim); font-size: 12px; }
.ledger__empty { color: var(--muted); padding: 14px 0; }

/* the SOLO round meter */
.meter { margin: 10px 0 6px; }
.meter__track { height: 10px; background: var(--line-soft); border-radius: 6px; overflow: hidden; position: relative; }
.meter__fill { height: 100%; background: linear-gradient(90deg, var(--accent), #9be9ff); border-radius: 6px; width: 0; transition: width 0.6s ease; }
.meter__marks { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; color: var(--dim); margin-top: 4px; }
.meter__legend { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.meter__legend b { color: var(--text); }
.logbar { margin-top: 12px; }
.logbar__track { height: 6px; background: var(--line-soft); border-radius: 4px; overflow: hidden; }
.logbar__fill { height: 100%; background: var(--accent); width: 0; opacity: 0.85; }

/* tables --------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-soft); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); font-weight: 500; background: var(--surface-2); position: sticky; top: 0; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th.sorted::after { content: " \25BE"; color: var(--accent); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
td.num, th.num { text-align: right; font-family: var(--mono); }
td.addr { font-family: var(--mono); max-width: 30ch; overflow: hidden; text-overflow: ellipsis; }
td.dim { color: var(--muted); }
.empty { padding: 22px; color: var(--muted); text-align: center; }
.badge { display: inline-block; font-family: var(--mono); font-size: 11px; padding: 2px 7px; border-radius: 5px; border: 1px solid var(--line); color: var(--muted); }
.badge--good { color: var(--good); border-color: rgba(87, 199, 133, 0.4); }
.badge--warn { color: var(--warn); border-color: rgba(240, 146, 90, 0.4); }
.badge--bad { color: var(--bad); border-color: rgba(239, 111, 108, 0.4); }
.badge--mode { color: var(--text); border-color: var(--accent-line); background: var(--accent-soft); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--dim); margin-right: 6px; vertical-align: 1px; }
.dot--on { background: var(--good); box-shadow: 0 0 0 3px rgba(87, 199, 133, 0.18); }
.dot--stale { background: var(--warn); }
.dot--off { background: var(--bad); }

/* connect -------------------------------------------------------------- */
.connect { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr); gap: 20px; }
@media (max-width: 900px) { .connect { grid-template-columns: 1fr; } }
.endpoint { font-family: var(--mono); display: inline-flex; align-items: center; gap: 6px; }
.copy { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 5px; padding: 2px 5px; cursor: pointer; line-height: 0; }
.copy:hover { color: var(--text); border-color: var(--accent); }
.copy.did { color: var(--good); border-color: var(--good); }
.howto { font-size: 14px; }
.howto dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 12px 0; }
.howto dt { color: var(--muted); }
.howto dd { margin: 0; font-family: var(--mono); font-size: 13px; }
.howto p { margin: 8px 0; color: var(--muted); }
.howto code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; color: var(--text); }
.hint { color: var(--dim); font-size: 12px; }
.callout { border-left: 3px solid var(--warn); background: rgba(240, 146, 90, 0.08); padding: 10px 14px; border-radius: 0 8px 8px 0; color: var(--muted); font-size: 13.5px; margin-top: 12px; }
.callout b { color: var(--text); }

/* charts --------------------------------------------------------------- */
.card__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.card__head .card__label { margin-bottom: 0; }
.seg { display: inline-flex; gap: 4px; }
.seg__btn { border: 1px solid var(--line); background: transparent; color: var(--muted); font-family: var(--mono); font-size: 11px; padding: 2px 9px; border-radius: 6px; cursor: pointer; }
.seg__btn[aria-pressed="true"] { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.chart { position: relative; width: 100%; margin-top: 10px; }
.chart__svg { display: block; width: 100%; height: 100%; overflow: visible; touch-action: pan-y; }
.chart .grid line { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis text { fill: var(--dim); font: 11px var(--mono); }
.chart .axis .unit { fill: var(--muted); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line--muted { stroke: var(--dim); stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart .area { stroke: none; }
.chart__grad0 { stop-color: var(--accent); stop-opacity: 0.28; }
.chart__grad1 { stop-color: var(--accent); stop-opacity: 0; }
.chart__dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart__hover circle { fill: var(--accent); stroke: var(--bg); stroke-width: 2; }
.chart__hover circle + circle { fill: var(--dim); }
.chart__cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.chart__hit { cursor: crosshair; }
.chart__tip { position: absolute; top: 6px; z-index: 2; pointer-events: none; background: rgba(17, 25, 38, 0.96); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--text); white-space: nowrap; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35); }
.chart__tip b { color: var(--accent); font-weight: 600; }
.chart__tip .muted { color: var(--muted); }
.chart__legend { display: flex; gap: 18px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; color: var(--muted); margin-top: 8px; }
.chart__legend b { color: var(--text); font-weight: 600; }
.chart__legend i { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 6px; background: var(--accent); }
.chart__legend i.muted { background: var(--dim); }

/* miner page ---------------------------------------------------------- */
.minerhead { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.minerhead__addr { font-family: var(--mono); font-size: clamp(14px, 2.3vw, 20px); word-break: break-all; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.minerhead__meta { color: var(--muted); font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; }
.instlist { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.inst { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 14px 16px; }
.inst__head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 8px; }
.inst__name { font-family: var(--mono); font-size: 13px; }
.inst__rows { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; }
.inst__rows dt { color: var(--muted); }
.inst__rows dd { margin: 0; font-family: var(--mono); text-align: right; }
.big { font-family: var(--mono); font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.notice { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 26px; color: var(--muted); }
.notice h2 { margin: 0 0 8px; font-size: 18px; color: var(--text); }
.notice code { color: var(--text); }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 10px; color: var(--muted); font-size: 13px; }
.pager button { background: var(--surface-2); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.pager button:disabled { opacity: 0.4; cursor: default; }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; font-size: 13px; }

/* footer --------------------------------------------------------------- */
.foot { border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 13px; margin-top: 30px; }
.foot__inner { max-width: var(--maxw); margin: 0 auto; padding: 20px; display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 20px; }
@media (max-width: 760px) { .foot__inner { grid-template-columns: 1fr; } }
.foot__brand { display: flex; gap: 12px; align-items: flex-start; }
.foot__brand img { flex: 0 0 auto; border-radius: 50%; margin-top: 2px; }
.foot__status { font-family: var(--mono); font-size: 12px; color: var(--dim); }

/* utilities (the app never writes inline style attributes: CSP forbids them) */
.mt-8 { margin-top: 8px; }
.mt-14 { margin-top: 14px; }
.mb-10 { margin-bottom: 10px; }
.mb-14 { margin-bottom: 14px; }
.is-idle { opacity: 0.55; }
.is-hidden { display: none; }
.ledger__bar i.is-fee { opacity: 0.35; }

/* API documentation page */
.doc { max-width: 860px; }
.doc h1 { font-size: 28px; letter-spacing: -0.02em; margin: 6px 0 4px; }
.doc h2 { font-size: 18px; margin: 30px 0 8px; }
.doc p, .doc li { color: var(--muted); }
.doc code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; color: var(--text); }
.doc pre { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 8px; padding: 12px 14px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px; color: var(--text); }
.ep { display: grid; grid-template-columns: minmax(220px, auto) 1fr; gap: 6px 16px; margin: 10px 0 16px; }
.ep code { justify-self: start; }
.ep span { color: var(--muted); }
@media (max-width: 640px) { .ep { grid-template-columns: 1fr; } .ep span { margin-bottom: 8px; } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
