/* Minecraft server status. Dark by default; light follows the OS or the toggle. */
:root {
  color-scheme: dark;
  --page: #0c0e12;
  --surface: #16191f;
  --surface-2: #1d2129;
  --surface-3: #262b35;
  --ink: #eef0f3;
  --ink-2: #a1a8b3;
  --ink-3: #6f7784;
  --grid: #2a2f38;
  --axis: #474d58;
  --ring: rgba(255,255,255,0.08);
  --accent: #6ccf5d;
  --accent-ink: #0b1a08;
  --good: #0aac23; --good-ink: #53c556;
  --warn: #fbb315;
  --bad: #dc3c3d; --bad-ink: #f07a7a;
  --total: #8ea6c4;
  --s1: #338ced; --s2: #e76624; --s3: #00a888; --s4: #d28e05; --s5: #e24d8b; --s6: #0aac23; --s7: #9887ef;
  --seq-0: #1b2330; --seq-1: #173a63; --seq-2: #1b64be; --seq-3: #338ced; --seq-4: #84b9f3; --seq-5: #cce3fd;
  --shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 8px 24px rgba(0,0,0,0.35);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --pixel: "Silkscreen", ui-monospace, monospace;
  --r: 14px;
}
@media (prefers-color-scheme: light) {
  :root:where(:not([data-theme="dark"])) {
    color-scheme: light;
    --page: #eef1f4; --surface: #ffffff; --surface-2: #f5f7f9; --surface-3: #e8ecf0;
    --ink: #191b1f; --ink-2: #5e6570; --ink-3: #8a919c; --grid: #e7e9ec; --axis: #c2c6cc; --ring: rgba(11,11,11,0.08);
    --accent: #3d9b2f; --accent-ink: #ffffff; --good-ink: #006c10; --bad-ink: #b42b2c;
    --total: #4f6687; --s1: #257de0; --s2: #f47230; --s3: #00b894; --s4: #f2a600; --s5: #ee7fac; --s6: #008a17; --s7: #6a4ce2;
    --seq-0: #eef2f7; --seq-1: #cce3fd; --seq-2: #84b9f3; --seq-3: #338ced; --seq-4: #1b64be; --seq-5: #0e3d7e;
    --shadow: 0 1px 2px rgba(16,24,40,0.06), 0 6px 18px rgba(16,24,40,0.06);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --page: #eef1f4; --surface: #ffffff; --surface-2: #f5f7f9; --surface-3: #e8ecf0;
  --ink: #191b1f; --ink-2: #5e6570; --ink-3: #8a919c; --grid: #e7e9ec; --axis: #c2c6cc; --ring: rgba(11,11,11,0.08);
  --accent: #3d9b2f; --accent-ink: #ffffff; --good-ink: #006c10; --bad-ink: #b42b2c;
  --total: #4f6687; --s1: #257de0; --s2: #f47230; --s3: #00b894; --s4: #f2a600; --s5: #ee7fac; --s6: #008a17; --s7: #6a4ce2;
  --seq-0: #eef2f7; --seq-1: #cce3fd; --seq-2: #84b9f3; --seq-3: #338ced; --seq-4: #1b64be; --seq-5: #0e3d7e;
  --shadow: 0 1px 2px rgba(16,24,40,0.06), 0 6px 18px rgba(16,24,40,0.06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--page); min-height: 100vh; }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; }
.sky { position: fixed; inset: 0 0 auto 0; height: 360px; z-index: -1; pointer-events: none;
  background: radial-gradient(1200px 300px at 50% -60px, color-mix(in oklab, var(--s1) 22%, transparent), transparent 70%); }

/* Header */
.top { position: relative; }
.top__inner { max-width: 1240px; margin: 0 auto; padding: 18px 20px 14px; display: flex; align-items: center; gap: 16px; }
.home { font-size: 13px; color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.home:hover { color: var(--ink); }
.top__title { display: flex; align-items: center; gap: 12px; flex: 1; justify-content: center; }
.top__title h1 { font: 700 clamp(20px, 3.2vw, 30px)/1 var(--pixel); letter-spacing: 0.5px; }
.block { width: 30px; height: 30px; flex: none; image-rendering: pixelated; border-radius: 3px;
  background:
    linear-gradient(#6ccf5d 0 0) 0 0 / 100% 34% no-repeat,
    conic-gradient(from 0deg, #8b5a2b 25%, #7a4e25 0 50%, #8b5a2b 0 75%, #6e4521 0) 0 0 / 10px 10px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,0.25), 0 2px 0 rgba(0,0,0,0.3); }
.top__right { display: flex; align-items: center; gap: 10px; }
.pulse { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.pulse__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 color-mix(in oklab, var(--good) 60%, transparent); animation: ping 2s infinite; }
.pulse.stale .pulse__dot { background: var(--warn); animation: none; }
@keyframes ping { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.icon-btn { background: var(--surface); border: 1px solid var(--ring); width: 34px; height: 34px; border-radius: 10px; cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); }
.grass { height: 8px; background:
  repeating-linear-gradient(90deg, #5cb84d 0 8px, #4ea341 8px 16px, #6ccf5d 16px 24px, #4ea341 24px 32px);
  box-shadow: 0 4px 0 #7a4e25; margin-bottom: 4px; opacity: 0.9; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 20px 40px; display: flex; flex-direction: column; gap: 40px; }
.section-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 { font: 700 18px/1.2 var(--pixel); letter-spacing: 0.3px; }
.section-sub { margin: 0; color: var(--ink-2); font-size: 13.5px; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(260px, 1.3fr) repeat(3, minmax(150px, 1fr)); gap: 14px; }
.hero__main { background: var(--surface); border: 1px solid var(--ring); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px 22px; display: flex; flex-direction: column; gap: 8px; }
.hero__label { color: var(--ink-2); font-size: 13.5px; font-weight: 600; }
.hero__num { font-size: 64px; font-weight: 700; line-height: 1; letter-spacing: -1.5px; }
.hero__num small { font-size: 18px; font-weight: 600; color: var(--ink-2); letter-spacing: 0; margin-left: 6px; }
.hero__heads { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; align-items: center; }
.hero__empty { color: var(--ink-3); font-size: 13.5px; }
.tile { background: var(--surface); border: 1px solid var(--ring); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tile__label { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.tile__value { font-size: 28px; font-weight: 650; line-height: 1.15; letter-spacing: -0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile__value small { font-size: 14px; color: var(--ink-2); font-weight: 600; letter-spacing: 0; margin-left: 3px; }
.tile__note { color: var(--ink-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter { height: 8px; border-radius: 99px; background: color-mix(in oklab, var(--s1) 22%, var(--surface-3)); overflow: hidden; margin-top: 6px; }
.meter > span { display: block; height: 100%; background: var(--s1); border-radius: 99px; }
.meter.warn > span { background: var(--warn); }
.meter.bad > span { background: var(--bad); }

/* Server cards */
.servers { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.srv { position: relative; background: var(--surface); border: 1px solid var(--ring); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 12px; cursor: pointer; transition: transform 120ms, border-color 120ms; overflow: hidden; }
.srv::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c); opacity: 0.9; }
.srv:hover { transform: translateY(-2px); border-color: color-mix(in oklab, var(--c) 50%, var(--ring)); }
.srv:focus-visible { outline: 2px solid var(--c); outline-offset: 2px; }
.srv.is-down { opacity: 0.85; }
.srv.is-archived { opacity: 0.75; }
.srv__top { display: flex; gap: 12px; align-items: flex-start; }
.srv__icon { width: 56px; height: 56px; border-radius: 10px; image-rendering: pixelated; flex: none; background: var(--surface-3); object-fit: cover; display: grid; place-items: center; font: 700 20px var(--pixel); color: var(--ink-2); }
.srv__id { flex: 1; min-width: 0; }
.srv__name { font-size: 17px; font-weight: 700; line-height: 1.25; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.srv__addr { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font: 12.5px/1 ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--ring); border-radius: 7px; padding: 5px 8px; cursor: copy; }
.srv__addr:hover { color: var(--ink); }
.motd { font: 13px/1.35 ui-monospace, "Cascadia Mono", Consolas, monospace; background: #0a0b0d; color: #aaa; border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; word-break: break-word; min-height: 2.9em; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 99px; white-space: nowrap; }
.pill--up { background: color-mix(in oklab, var(--good) 18%, transparent); color: var(--good-ink); }
.pill--down { background: color-mix(in oklab, var(--bad) 18%, transparent); color: var(--bad-ink); }
.pill--arch { background: var(--surface-3); color: var(--ink-2); }
.chipline { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--ring); border-radius: 6px; padding: 2px 7px; white-space: nowrap; }
.srv__players { display: flex; flex-direction: column; gap: 8px; }
.srv__count { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.srv__count b { font-size: 24px; font-weight: 700; }
.srv__count span { color: var(--ink-2); font-size: 13px; }
.who { display: flex; flex-wrap: wrap; gap: 6px; }
.who__p { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-2); border: 1px solid var(--ring); border-radius: 8px; padding: 3px 8px 3px 3px; font-size: 13px; font-weight: 600; cursor: pointer; }
.who__p:hover { background: var(--surface-3); }
.who__p small { color: var(--ink-3); font-weight: 500; }
.head { width: 22px; height: 22px; border-radius: 4px; image-rendering: pixelated; background: var(--surface-3); flex: none; }
.head--lg { width: 64px; height: 64px; border-radius: 8px; }
.srv__spark { height: 44px; }
.srv__spark svg { display: block; width: 100%; height: 44px; overflow: visible; }
.srv__foot { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; border-top: 1px solid var(--grid); padding-top: 10px; }
.stat { min-width: 0; }
.stat__k { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.4px; font-weight: 700; }
.stat__v { font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.srv__links { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 650; text-decoration: none; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--ring); cursor: pointer; }
.btn:hover { background: var(--surface-3); }

/* Filters */
.filters { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 10px 0; margin-bottom: 6px;
  background: color-mix(in oklab, var(--page) 88%, transparent); backdrop-filter: blur(8px); }
.seg { display: inline-flex; background: var(--surface); border: 1px solid var(--ring); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 650; cursor: pointer; color: var(--ink-2); }
.seg button:hover { color: var(--ink); background: var(--surface-2); }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--page); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--ring); background: var(--surface); border-radius: 99px; padding: 5px 11px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-2); }
.chip:hover { color: var(--ink); }
.chip[aria-checked="true"] { color: var(--ink); border-color: var(--ink-2); background: var(--surface-2); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--ink-3)); flex: none; }

.hist-body { display: flex; flex-direction: column; gap: 14px; transition: opacity 150ms; }
.hist-body.loading { opacity: 0.55; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.span-2 { grid-column: span 2; }
.card { background: var(--surface); border: 1px solid var(--ring); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.card__head h3 { font-size: 15.5px; font-weight: 700; }
.card__sub { margin: 2px 0 0; color: var(--ink-2); font-size: 12.5px; }
.tbl-btn { border: 1px solid var(--ring); background: var(--surface-2); border-radius: 7px; padding: 4px 9px; font-size: 12px; font-weight: 650; color: var(--ink-2); cursor: pointer; }
.tbl-btn:hover, .tbl-btn[aria-pressed="true"] { color: var(--ink); background: var(--surface-3); }
.chart { position: relative; min-height: 60px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .empty, .empty { color: var(--ink-3); font-size: 13.5px; padding: 28px 0; text-align: center; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: -2px 0 8px; font-size: 12.5px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); display: inline-block; }
.legend .line-key { width: 14px; height: 2px; border-radius: 2px; }
.axis text, .tick { fill: var(--ink-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.gridline { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.hit { fill: transparent; cursor: crosshair; }
.mark:hover, .mark.is-hot { filter: brightness(1.18); }
.cell { cursor: default; }
.cell:hover { stroke: var(--ink); stroke-width: 1.5; }
.xhair { stroke: var(--ink-2); stroke-width: 1; shape-rendering: crispEdges; pointer-events: none; }

/* Data tables (table view of each chart, leaderboard, ops) */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--ink-3); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px; padding: 6px 8px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid var(--grid); white-space: nowrap; font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.data-table { max-height: 340px; overflow: auto; }
.board tr[data-player] { cursor: pointer; }
.board tr[data-player]:hover td { background: var(--surface-2); }
.board .rank { color: var(--ink-3); width: 28px; }
.board .pname { display: flex; align-items: center; gap: 9px; font-weight: 650; }
.board .online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); display: inline-block; }
.splitbar { display: flex; gap: 2px; height: 8px; width: 160px; min-width: 80px; }
.splitbar span { height: 100%; background: var(--c); border-radius: 99px; min-width: 3px; }
.timecell { display: flex; align-items: center; gap: 10px; }
.timecell b { min-width: 64px; text-align: right; font-weight: 650; }
.muted { color: var(--ink-2); }

/* Bars list (deaths, top blocks, etc.) */
.bars { display: flex; flex-direction: column; gap: 7px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 150px) 1fr 56px; align-items: center; gap: 10px; font-size: 13px; }
.bar-row__label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.bar-row__track { height: 14px; position: relative; }
.bar-row__fill { height: 100%; background: var(--c, var(--s1)); border-radius: 0 4px 4px 0; min-width: 2px; }
.bar-row__val { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; font-weight: 600; }

/* Feed */
.feed { list-style: none; margin: 0; padding: 0; max-height: 460px; overflow-y: auto; display: flex; flex-direction: column; }
.feed li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 7px 2px; border-bottom: 1px solid var(--grid); font-size: 13.5px; }
.feed li:last-child { border-bottom: 0; }
.feed .ico { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; font-size: 14px; background: var(--surface-2); }
.feed .when { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.feed .srvname { color: var(--ink-2); }
.feed .pl { font-weight: 650; cursor: pointer; }
.feed .pl:hover { text-decoration: underline; }
.mini-h { font-size: 13px; color: var(--ink-2); margin: 14px 0 8px; font-weight: 700; }
.versions { display: flex; flex-direction: column; gap: 8px; }
.vline { display: grid; grid-template-columns: 130px 1fr; gap: 10px; align-items: center; font-size: 12.5px; }
.vline__track { position: relative; height: 18px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.vline__seg { position: absolute; top: 0; bottom: 0; background: color-mix(in oklab, var(--c) 35%, var(--surface-2)); border-right: 2px solid var(--surface); font-size: 10.5px; padding: 1px 4px; color: var(--ink); overflow: hidden; white-space: nowrap; }

/* World */
.world-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin-bottom: 14px; }
.fact { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--ring); border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow); cursor: pointer; min-width: 0; }
.fact:hover { background: var(--surface-2); }
.fact__ico { font-size: 22px; width: 40px; height: 40px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.fact__k { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.fact__v { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fact__n { font-size: 12.5px; color: var(--ink-3); }

/* Machine */
.machine { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }

/* Tooltip */
.tooltip { position: fixed; z-index: 50; pointer-events: none; background: var(--surface-3); color: var(--ink); border: 1px solid var(--ring); border-radius: 9px; padding: 8px 10px; font-size: 12.5px; box-shadow: 0 8px 24px rgba(0,0,0,0.3); max-width: 280px; }
.tooltip .tt-h { color: var(--ink-2); font-size: 11.5px; margin-bottom: 4px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 8px; }
.tooltip .tt-row b { font-variant-numeric: tabular-nums; }
.tooltip .tt-row span { color: var(--ink-2); }
.tooltip .tt-key { width: 12px; height: 2px; border-radius: 2px; background: var(--c); flex: none; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--page); padding: 9px 16px; border-radius: 10px; font-weight: 650; font-size: 13.5px; z-index: 60; }

/* Player modal */
.modal { border: 0; padding: 0; background: transparent; max-width: min(920px, 96vw); width: 100%; color: var(--ink); }
.modal::backdrop { background: rgba(5,6,8,0.65); backdrop-filter: blur(3px); }
.modal__inner { background: var(--page); border: 1px solid var(--ring); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 14px; max-height: 92vh; overflow-y: auto; }
.pm-head { display: flex; gap: 16px; align-items: center; }
.pm-head img.body { width: 72px; height: auto; image-rendering: pixelated; }
.pm-head h2 { font: 700 24px/1.2 var(--pixel); }
.pm-close { margin-left: auto; align-self: flex-start; }
.cal { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 11px); gap: 3px; overflow-x: auto; padding-bottom: 4px; }
.cal i { width: 11px; height: 11px; border-radius: 2px; background: var(--seq-0); }

.foot { text-align: center; color: var(--ink-3); font-size: 12px; padding: 10px 20px 30px; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr 1fr; }
  .hero__main { grid-column: span 2; }
  .grid-2 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .world-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .wrap { padding: 16px 12px 30px; gap: 30px; }
  .top__inner { padding: 14px 12px 10px; flex-wrap: wrap; }
  .top__title { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .top__right { margin-left: auto; }
  .servers { grid-template-columns: 1fr; }
  .srv__foot { grid-template-columns: repeat(2, 1fr); }
  .hero__num { font-size: 52px; }
  .tile__value { font-size: 23px; }
  .filters { position: static; }
  .seg button { padding: 6px 9px; }
  .vline { grid-template-columns: 90px 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
