:root {
  --bg: #1c212b; --panel: #222834; --panel-alt: #252c39; --border: #2d3441; --grid: #343c4b;
  --text: #e6edf3; --text-2: #c9d1d9; --muted: #8b95a5;
  --good: #66bb6a; --bad: #ef5350; --idle: #788496; --on-pill: #10131a;
  --accent: #6cc04a; --accent-fill: rgba(108, 192, 74, .18);
  --radius: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #eef1f5; --panel: #ffffff; --panel-alt: #f6f8fa; --border: #d9dee6; --grid: #e4e8ee;
    --text: #1d2330; --text-2: #2b3240; --muted: #5d6676;
    --good: #2e8b3a; --bad: #c62828; --idle: #8a93a3; --on-pill: #ffffff;
    --accent: #3d8a22; --accent-fill: rgba(61, 138, 34, .14);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-size: 14px; line-height: 1.4; -webkit-text-size-adjust: 100%; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 14px 16px 28px; }

header.top { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.title { position: relative; font-size: 22px; margin: 0; font-weight: 750; flex: 1 1 auto; letter-spacing: .3px; }
/* title-screen style splash: yellow, tilted, gently pulsing */
.splash { display: inline-block; margin-left: 14px; color: #ffef3a; font-size: 14px; font-weight: 700;
          text-shadow: 2px 2px 0 #3f3f00; --tilt: -8deg; transform: rotate(var(--tilt)); transform-origin: left center; white-space: nowrap;
          animation: splash .9s ease-in-out infinite alternate; }
@keyframes splash { to { transform: rotate(var(--tilt)) scale(1.08); } }
@media (prefers-color-scheme: light) { .splash { color: #b8860b; text-shadow: 1px 1px 0 #fff3b0; } }
@media (prefers-reduced-motion: reduce) { .splash { animation: none; } }
@media (max-width: 520px) { .splash { display: block; width: max-content; margin: 10px 0 2px 4px; --tilt: -3deg; font-size: 13px; } }

/* looks like an entry in Minecraft's multiplayer list (always dark, like the game) */
.entry { display: flex; gap: 12px; align-items: flex-start; margin-top: 12px; padding: 8px; border-radius: 4px;
         background: #0b0b0b; border: 2px solid #6f6f6f; color: #fff; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.entry img { width: 64px; height: 64px; image-rendering: pixelated; flex: none; }
.entry-text { flex: 1; min-width: 0; }
.entry-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.entry-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-right { display: flex; align-items: center; gap: 8px; color: #aaa; flex: none; font-variant-numeric: tabular-nums; }
.bars { display: inline-flex; align-items: flex-end; gap: 1px; height: 14px; }
.bars i { width: 3px; background: #333; }
.bars i:nth-child(1) { height: 3px; } .bars i:nth-child(2) { height: 5px; } .bars i:nth-child(3) { height: 8px; }
.bars i:nth-child(4) { height: 11px; } .bars i:nth-child(5) { height: 14px; }
.bars.q5 i, .bars.q4 i:nth-child(-n+4), .bars.q3 i:nth-child(-n+3) { background: #55ff55; }
.bars.q2 i:nth-child(-n+2), .bars.q1 i:nth-child(1) { background: #ffaa00; }
.entry .motd { margin-top: 4px; white-space: pre-line; line-height: 1.35; overflow-wrap: anywhere; color: #aaa; }
.entry .motd b { font-weight: 700; }
.entry .motd .it { font-style: italic; }
.pill { border-radius: 999px; padding: 4px 14px; font-weight: 700; font-size: 12.5px; color: var(--on-pill);
        background: var(--idle); white-space: nowrap; }
.pill.on { background: var(--good); }
.pill.off { background: var(--bad); }

.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; margin-top: 12px; min-width: 0; }
h2 { font-size: 14px; margin: 0 0 8px; font-weight: 650; }
.label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.big { font-size: 18px; font-weight: 650; }
.hint { color: var(--muted); font-size: 12.5px; margin: 0; flex-basis: 100%; }

.join { display: flex; flex-wrap: wrap; gap: 10px 32px; align-items: flex-end; }
.addr { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.addr code { font-size: 18px; font-weight: 650; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; overflow-wrap: anywhere; }
button.small { font: inherit; font-size: 13px; color: var(--text); background: var(--panel-alt); border: 1px solid var(--border);
               border-radius: 6px; padding: 4px 10px; cursor: pointer; }
button.small:hover { border-color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; margin-top: 12px; }
.tile { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; min-width: 0; }
.tile .v { font-size: 22px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.bar { height: 4px; border-radius: 2px; background: var(--grid); margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }

.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; } }

.count { color: var(--muted); font-weight: 500; }
.players { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.players li { display: flex; align-items: center; gap: 8px; background: var(--panel-alt); border: 1px solid var(--border);
              border-radius: 6px; padding: 4px 10px 4px 4px; }
.players img, .regulars img { width: 24px; height: 24px; border-radius: 3px; image-rendering: pixelated; background: var(--grid); flex: none; }
.regulars img { width: 18px; height: 18px; vertical-align: -4px; margin-right: 6px; }
.empty { color: var(--muted); }
.players li.plain { background: none; border: none; padding: 0; }

.events { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; }
.events li { display: flex; gap: 8px; padding: 3px 0; border-bottom: 1px solid var(--border); }
.events li:last-child { border-bottom: none; }
.events time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; width: 92px; }
.ev-join { color: var(--good); } .ev-leave { color: var(--muted); }

.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.sub { color: var(--muted); font-size: 12.5px; }
.chart { position: relative; height: 200px; }
.chart.small { height: 150px; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 11px; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--accent-fill); stroke: none; }
.chart .barm { fill: var(--accent); }
.chart .gap { fill: var(--grid); opacity: .5; }
.chart .cross { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.chart .nodata { fill: var(--muted); font-size: 12px; }

.regulars { width: 100%; border-collapse: collapse; }
.regulars th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 0 0 4px; }
.regulars td { padding: 4px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.regulars .num { text-align: right; font-variant-numeric: tabular-nums; }

.tip { position: fixed; pointer-events: none; background: var(--panel-alt); border: 1px solid var(--border); color: var(--text);
       border-radius: 6px; padding: 6px 9px; font-size: 12.5px; box-shadow: 0 4px 14px rgba(0,0,0,.25); z-index: 10; white-space: nowrap; }
.tip b { font-variant-numeric: tabular-nums; }
.foot { color: var(--muted); font-size: 12px; margin-top: 16px; text-align: center; }
