/* Isekai Pool site. Self-contained: system fonts, no icon font, no CDN, no inline styles (CSP: style-src 'self').
   Dark by default; follows the visitor's system when it asks for light. */

:root {
  color-scheme: dark light;
  --bg: #0d0e1a;
  --bg-glow-a: rgba(139, 123, 255, 0.16);
  --bg-glow-b: rgba(45, 212, 191, 0.10);
  --surface: #151729;
  --surface-2: #1c1f36;
  --border: #2a2e4d;
  --text: #ecedf8;
  --muted: #a3a8c8;
  --accent: #8b7bff;
  --accent-ink: #0d0e1a;
  --accent-2: #2dd4bf;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 24px rgba(0, 0, 0, 0.25);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6fc;
    --bg-glow-a: rgba(139, 123, 255, 0.14);
    --bg-glow-b: rgba(45, 212, 191, 0.12);
    --surface: #ffffff;
    --surface-2: #eef0fa;
    --border: #d9dcef;
    --text: #181a30;
    --muted: #5a6086;
    --accent: #5b46e0;
    --accent-ink: #ffffff;
    --accent-2: #0d9488;
    --good: #059669;
    --warn: #b45309;
    --bad: #dc2626;
    --shadow: 0 1px 2px rgba(24, 26, 48, 0.06), 0 8px 24px rgba(24, 26, 48, 0.06);
  }
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 480px at 8% -8%, var(--bg-glow-a), transparent 60%),
    radial-gradient(800px 420px at 100% 0%, var(--bg-glow-b), transparent 60%);
  background-repeat: no-repeat;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; border-radius: 6px; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 10;
  background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { left: 8px; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 5;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap { display: flex; align-items: center; gap: 18px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; display: block; }
.brand small { font-weight: 600; color: var(--muted); }
.nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; padding: 4px 0; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  color: var(--muted); padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: 0.95rem; white-space: nowrap;
}
.nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); box-shadow: 0 -2px 0 var(--accent) inset; }

/* ---------- layout ---------- */
main { flex: 1; padding: 36px 0 56px; }
h1 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); line-height: 1.12; margin: 0 0 14px; letter-spacing: -0.02em; }
h2 { font-size: 1.3rem; margin: 40px 0 14px; letter-spacing: -0.01em; }
h3 { font-size: 1.05rem; margin: 0 0 6px; }
p { margin: 0 0 14px; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 62ch; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.page-head { margin-bottom: 24px; }
.page-head p { color: var(--muted); max-width: 68ch; margin: 0; }

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.grid.stats.four, .grid.stats.six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .grid.stats.six { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 880px) { .grid.stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.grid.stats + .grid.stats { margin-top: 14px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
}
.card h2, .card h3 { margin-top: 0; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; border: 1px solid var(--border); border-radius: 22px;
  padding: clamp(26px, 5vw, 52px);
  background:
    radial-gradient(520px 260px at 90% 10%, color-mix(in srgb, var(--accent) 28%, transparent), transparent 70%),
    radial-gradient(480px 240px at 0% 100%, color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 70%),
    var(--surface);
  box-shadow: var(--shadow);
}
.hero h1 span { background: linear-gradient(90deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 24px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 80%, transparent); font-size: 0.88rem; color: var(--muted);
}
.chip b { color: var(--text); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 11px;
  font: inherit; font-weight: 700; cursor: pointer; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
.btn:hover { text-decoration: none; border-color: var(--accent); }
.btn.primary { background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 55%, var(--accent-2))); color: var(--accent-ink); border-color: transparent; }

/* ---------- stat tiles ---------- */
.stat { display: flex; flex-direction: column; gap: 4px; min-height: 92px; }
.stat .label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); font-weight: 600; }
.stat .value { font-size: 1.55rem; font-weight: 750; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat .sub { font-size: 0.85rem; color: var(--muted); }
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin-right: 6px; vertical-align: middle; }
.live-dot.on { background: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 25%, transparent); }
.status { font-size: 0.88rem; color: var(--muted); margin: 10px 0 0; }

/* ---------- node sync meter ---------- */
.sync-slot { margin: 18px 0 6px; }
.sync-slot[hidden] { display: none; }
.card.sync { border-left: 5px solid var(--accent); }
.card.sync.ok { border-left-color: var(--good); }
.card.sync.warn { border-left-color: var(--warn); }
.card.sync h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 10px; }
.card.sync p { margin: 8px 0 0; font-size: 0.93rem; }
progress.meter {
  display: block; width: 100%; height: 14px; border: 0; border-radius: 999px; overflow: hidden;
  background: var(--surface-2); appearance: none; -webkit-appearance: none;
}
progress.meter::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
progress.meter::-webkit-progress-value { background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; }
progress.meter::-moz-progress-bar { background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; }

/* ---------- steps ---------- */
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.steps li { counter-increment: step; position: relative; }
.steps li::before {
  content: counter(step); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--accent-2); font-weight: 800; margin-bottom: 10px;
}

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
th, td { text-align: left; padding: 11px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--surface-2); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
td .addr { font-family: var(--mono); }
.empty { padding: 22px; color: var(--muted); text-align: center; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; border: 1px solid currentColor; }
.badge.good { color: var(--good); }
.badge.warn { color: var(--warn); }
.badge.bad { color: var(--bad); }

/* ---------- forms ---------- */
.search { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 18px; }
.search input {
  flex: 1 1 280px; min-width: 0; padding: 11px 14px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-family: var(--mono);
}
.search input::placeholder { color: var(--muted); }
label.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- charts ---------- */
.chart-card h3 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .line { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.s0 { stroke: var(--accent); }
.chart .line.s1 { stroke: var(--accent-2); }
.chart .line.s2 { stroke: var(--warn); }
.chart .area.s0 { fill: url(#g-s0); }
stop.t0 { stop-color: var(--accent); stop-opacity: 0.35; }
stop.t1 { stop-color: var(--accent); stop-opacity: 0; }
.chart .cursor { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .dot.s0 { fill: var(--accent); }
.chart .dot.s1 { fill: var(--accent-2); }
.chart .dot.s2 { fill: var(--warn); }
.chart .tip-bg { fill: var(--surface-2); stroke: var(--border); }
.chart .tip-text { fill: var(--text); font-size: 12px; font-family: var(--font); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 0.85rem; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.legend i.s0 { background: var(--accent); }
.legend i.s1 { background: var(--accent-2); }
.legend i.s2 { background: var(--warn); }

/* ---------- prose / code ---------- */
.prose > p, .prose > ul { max-width: 74ch; }
.prose h2 { margin-top: 38px; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: 6px 0; }
code, pre { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }
pre { background: var(--surface-2); border: 1px solid var(--border); padding: 14px 16px; border-radius: 12px; overflow-x: auto; }
pre code { background: none; border: 0; padding: 0; }
.notice {
  border: 1px solid var(--border); border-left: 4px solid var(--accent-2); background: var(--surface); border-radius: 12px;
  padding: 14px 16px; margin: 18px 0; color: var(--muted);
}
.notice b { color: var(--text); }
details { margin: 0; }
details summary { cursor: pointer; color: var(--accent); font-weight: 600; }
details[open] summary { margin-bottom: 6px; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; font-variant-numeric: tabular-nums; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 26px 0 34px; color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 26px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer p { margin: 0; max-width: 62ch; }

@media (max-width: 640px) {
  .site-header .wrap { flex-wrap: wrap; padding-top: 8px; padding-bottom: 4px; gap: 4px 12px; }
  .nav { margin-left: 0; width: 100%; }
  main { padding-top: 24px; }
  th, td { padding: 10px 12px; }
}

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

/* ---------- DigiByte site: blue accent (the rest is shared with the KOTO site) ---------- */
:root { --accent: #5aa2ff; --accent-2: #22d3ee; }
@media (prefers-color-scheme: light) { :root { --accent: #1d5fd1; --accent-2: #0e7490; } }
dl.status-list { grid-template-columns: max-content 1fr; gap: 12px 22px; }
dl.status-list dt { font-weight: 700; color: var(--text); }
dl.status-list dd { margin: 0; color: var(--muted); }
dl.status-list .badge { margin-right: 8px; }
@media (max-width: 640px) { dl.status-list { grid-template-columns: 1fr; gap: 2px; } dl.status-list dd { margin-bottom: 12px; } }
