/* mc-admin: night-sky header, grass-block ground, hotbar nav, stone cards.
   Rules: every status pairs an icon + a word with its color; text contrast >= 4.5:1;
   tap targets >= 44px; no horizontal scroll at 375px; motion respects reduced-motion. */

/* ?v= is the WOFF2's static_url hash (test_static_cache pins it), so the browser keeps the font. */
@font-face { font-family: "Pixel"; src: url("/static/fonts/PressStart2P-Regular.woff2?v=9ddaaad3cf") format("woff2"), url("/static/fonts/PressStart2P-Regular.ttf") format("truetype"); font-display: swap; }

:root {
  --bg: #0e1420; --surface: #1c2433; --surface-2: #263044; --slot: #1b1e24; --slot-hi: #2f3542;
  --text: #eef2f7; --muted: #a8b3c4; --line: #33405a;
  --grass: #5fbf3a; --grass-dark: #3c7f22; --dirt: #7a5230; --dirt-dark: #4f351d;
  --stone: #7d8796; --gold: #f2c94c; --danger: #ff9a3c; --danger-bg: #9a4a00; --warn: #f0a33a;
  --ok-bg: #245fb0; --down-bg: #9a4a00; --warn-bg: #5f5200; --btn-bg: #245fb0;
  --term: #05080d; --term-text: #c9d1dc; --term-error: #ffb066;
  --sky-top: #070b1f; --sky-bottom: #1d2650; --radius: 2px;
  --block: inset -4px -4px 0 rgba(0,0,0,.35), inset 4px 4px 0 rgba(255,255,255,.08);
  --pressed: inset 4px 4px 0 rgba(0,0,0,.35), inset -4px -4px 0 rgba(255,255,255,.06);
  /* spacing scale: every gap, gutter and padding comes from here */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px;
  --gutter: var(--s-4); --section-gap: var(--s-5);
  /* state colors: blue for good, orange for bad (deuteranopia-safe); every state also has an icon and a word */
  --info: #8ec5ff; --bad: #ffb066;
  /* fields, chart wells, the heat ramp and the uptime ribbon's orange steps: tokens so light can restyle them */
  --field: #0b1018; --placeholder: #8d98ab; --badge-text: #ffffff;
  --well: rgba(0,0,0,.2); --well-strong: rgba(0,0,0,.25); --heat-0: rgba(255,255,255,.04);
  --heat-1: #184f95; --heat-2: #256abf; --heat-3: #3987e5; --heat-4: #6da7ec; --heat-5: #b7d3f6;
  --o1: #7a4310; --o1-text: #ffffff; --o2: #c76a1a; --o2-text: #1a0d00; --o3: #ff9a3c; --o3-text: #1a0d00;
  color-scheme: dark;
}
/* Light (CMD-53, mock B): warm parchment cards, a book-and-quill page. The head script sets data-theme
   from the ◐ pill (Auto follows prefers-color-scheme). Same blue/orange state axis; every text token
   passes 4.5:1 on every surface (tests/test_mcadmin_theme.py checks it). */
:root[data-theme="light"] {
  --bg: #f4efe2; --surface: #fffaf0; --surface-2: #efe6d2; --slot: #e8dec7; --slot-hi: #f7f1e3;
  --text: #2a2118; --muted: #5e5241; --line: #d8cbb0; --stone: #8a7f6b;
  --gold: #7a5000; --danger: #a04a00; --bad: #a04a00; --warn: #7d5600; --info: #1f5fae;
  --ok-bg: #245fb0; --btn-bg: #245fb0; --down-bg: #9a4a00; --danger-bg: #9a4a00; --warn-bg: #6e4f00;
  --field: #fffdf7; --placeholder: #6b604c; --badge-text: #2a2118;
  --well: rgba(94,82,65,.08); --well-strong: rgba(94,82,65,.14); --heat-0: rgba(94,82,65,.07);
  --heat-1: #cfe0f6; --heat-2: #9fc2ee; --heat-3: #5f97dd; --heat-4: #2f6fc2; --heat-5: #184f95;
  --o1: #f3c896; --o1-text: #1a0d00; --o2: #d9822f; --o2-text: #1a0d00; --o3: #a85308; --o3-text: #ffffff;
  --block: inset -4px -4px 0 rgba(0,0,0,.12), inset 4px 4px 0 rgba(255,255,255,.6);
  --pressed: inset 4px 4px 0 rgba(0,0,0,.16), inset -4px -4px 0 rgba(255,255,255,.5);
  color-scheme: light;
}
/* Dark islands in light: the sky keeps its phase colours, the console and job logs stay a terminal,
   and Minecraft title colours were stepped for the dark slot. */
:root[data-theme="light"] :is(.sky, .terminal, .joblog, .cos-title) {
  --surface: #1c2433; --surface-2: #263044; --slot: #1b1e24; --slot-hi: #2f3542;
  --text: #eef2f7; --muted: #a8b3c4; --line: #33405a; --stone: #7d8796;
  --gold: #f2c94c; --danger: #ff9a3c; --bad: #ffb066; --warn: #f0a33a; --info: #8ec5ff;
  --field: #0b1018; --placeholder: #8d98ab; --badge-text: #ffffff;
  --block: inset -4px -4px 0 rgba(0,0,0,.35), inset 4px 4px 0 rgba(255,255,255,.08);
  --pressed: inset 4px 4px 0 rgba(0,0,0,.35), inset -4px -4px 0 rgba(255,255,255,.06);
  color-scheme: dark;
}
/* custom properties inherit as values, but `color` was already computed on body: reset it on the islands */
:root[data-theme="light"] :is(.sky, .terminal) { color: var(--text); }
body[data-phase="dawn"]  { --sky-top: #3a4a8c; --sky-bottom: #f6a96b; }
body[data-phase="day"]   { --sky-top: #3f8ce0; --sky-bottom: #a9d8ff; }
body[data-phase="dusk"]  { --sky-top: #2b2a5e; --sky-bottom: #e7745a; }
body[data-phase="night"] { --sky-top: #070b1f; --sky-bottom: #1d2650; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }   /* .btn and friends set display */
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: hidden; }
a { color: var(--gold); }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

h1, h2, h3, .brand, .badge, .btn.big, .hotbar .slot-label, .big, .prompt {
  font-family: "Pixel", ui-monospace, monospace; font-weight: 400; letter-spacing: .02em; }
h1 { font-size: 1.05rem; line-height: 1.6; margin: 0; overflow-wrap: anywhere; }
h2 { font-size: .8rem; line-height: 1.7; margin: 0 0 var(--s-3); }
h3 { font-size: .65rem; line-height: 1.7; margin: 0 0 var(--s-2); color: var(--muted); }

.skip { position: absolute; left: -999px; top: .5rem; z-index: 20; background: var(--slot); color: var(--text); padding: .75rem 1rem; }
.skip:focus { left: .5rem; }

/* -- the sky ---------------------------------------------------------------- */
.sky { position: relative; overflow: hidden; padding: var(--s-4) var(--gutter) var(--s-5);
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom)); transition: background 2s ease; }
/* stars: only at night, static */
.sky::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 2s ease;
  background:
    linear-gradient(#fff,#fff) 12% 22% / 3px 3px no-repeat, linear-gradient(#fff,#fff) 27% 64% / 2px 2px no-repeat,
    linear-gradient(#fff,#fff) 41% 18% / 3px 3px no-repeat, linear-gradient(#cfd8ff,#cfd8ff) 55% 48% / 2px 2px no-repeat,
    linear-gradient(#fff,#fff) 66% 12% / 2px 2px no-repeat, linear-gradient(#fff,#fff) 72% 70% / 3px 3px no-repeat,
    linear-gradient(#cfd8ff,#cfd8ff) 88% 40% / 2px 2px no-repeat, linear-gradient(#fff,#fff) 6% 80% / 2px 2px no-repeat,
    linear-gradient(#fff,#fff) 94% 82% / 3px 3px no-repeat, linear-gradient(#fff,#fff) 34% 36% / 2px 2px no-repeat; }
body[data-phase="night"] .sky::before { opacity: .85; }
/* the square sun (or moon), parked by phase */
.sky-body { position: absolute; width: 40px; height: 40px; top: 14px; right: 12px;
  background: linear-gradient(#fff9d6,#fff9d6) 50% 50% / 20px 20px no-repeat, #ffe066;
  box-shadow: 0 0 0 4px rgba(255,224,102,.35), 0 0 44px 8px rgba(255,224,102,.55);
  transition: top 2s ease, right 2s ease, background-color 2s ease; }
body[data-phase="dusk"] .sky-body { background-color: #ffb347; }
/* wide screens: the sun travels in the open sky beside the hotbar, never over a control */
@media (min-width: 1000px) {
  .sky-top { padding-right: 0; }
  .sky-body { top: 92px; right: calc(50% - 410px - 110px); }
  body[data-phase="dawn"] .sky-body { top: 112px; right: calc(50% + 410px + 70px); }
  body[data-phase="dusk"] .sky-body { top: 112px; }
}
body[data-phase="night"] .sky-body {
  background: linear-gradient(#aeb8c9,#aeb8c9) 8px 8px / 8px 8px no-repeat,
              linear-gradient(#aeb8c9,#aeb8c9) 24px 22px / 8px 8px no-repeat,
              linear-gradient(#aeb8c9,#aeb8c9) 12px 28px / 4px 4px no-repeat, #e4eaf3;
  box-shadow: 0 0 0 4px rgba(228,234,243,.2), 0 0 36px 6px rgba(159,177,214,.45); }

.sky-top { position: relative; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--s-3); max-width: 1100px; margin: 0 auto var(--s-4); padding-right: 56px; }
/* brand and user sit on solid slots so the text keeps contrast on any sky */
.brand { display: inline-block; color: var(--text); text-decoration: none; font-size: .95rem; line-height: 1.4;
  padding: var(--s-3) var(--s-4); background: var(--slot); box-shadow: var(--block); text-shadow: 2px 2px 0 #000; }
.who { display: flex; gap: var(--s-2); align-items: center; margin: 0; }
/* ◐ theme pill: sits with the user slot on the right; on the login page it is alone on the right */
.theme-pill { margin-left: auto; white-space: nowrap; }
.theme-pill [aria-hidden] { font-family: system-ui, sans-serif; font-size: 1.1rem; line-height: 1; }
.who-name { display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: var(--s-1) var(--s-3) var(--s-1) var(--s-2);
  background: var(--slot); box-shadow: var(--block); }
.who-name img { image-rendering: pixelated; }

/* hotbar nav: one row of inventory slots; the current page gets the white selection frame */
.hotbar { position: relative; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: var(--s-1);
  max-width: 820px; margin: 0 auto; padding: 4px; background: #0a0c10;
  box-shadow: 0 0 0 2px #000, 0 6px 0 rgba(0,0,0,.35); }
.hotbar.nine { grid-template-columns: repeat(9, minmax(0, 1fr)); }

.hotbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-1);
  min-height: 60px; padding: var(--s-2) var(--s-1); color: var(--text); text-decoration: none;
  background: var(--slot); box-shadow: var(--block); }
.hotbar a { position: relative; }
.slot-badge { position: absolute; top: 2px; right: 4px; min-width: 1.2em; padding: 0 .3em; border-radius: 1em;
  background: var(--down-bg); color: #fff; font: 700 .7rem/1.2em system-ui, sans-serif; text-align: center; }
.hotbar .slot-icon { font-size: 1.25rem; line-height: 1; }
.hotbar .slot-label { font-size: .55rem; line-height: 1.3; white-space: nowrap; }
.hotbar a:hover { background: var(--slot-hi); }
.hotbar a:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.hotbar a[aria-current="page"] { background: var(--slot-hi);
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px #000, 0 0 0 2px #fff; position: relative; z-index: 1; }
.hotbar a[aria-current="page"] .slot-label { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* the ground: grass layer with a stepped edge over speckled dirt */
.ground { height: 28px;
  background:
    linear-gradient(#7fd856, #7fd856) 0 0 / 100% 2px no-repeat,
    linear-gradient(var(--grass), var(--grass)) 0 0 / 100% 8px no-repeat,
    linear-gradient(90deg, var(--grass) 0 8px, transparent 8px 20px, var(--grass-dark) 20px 28px, transparent 28px 40px) 0 8px / 40px 4px repeat-x,
    linear-gradient(90deg, var(--grass-dark) 0 4px, transparent 4px 36px) 12px 12px / 36px 4px repeat-x,
    linear-gradient(90deg, var(--dirt-dark) 0 4px, transparent 4px) 6px 16px / 28px 4px repeat-x,
    linear-gradient(90deg, var(--dirt-dark) 0 4px, transparent 4px) 20px 22px / 36px 4px repeat-x,
    linear-gradient(90deg, #946540 0 4px, transparent 4px) 30px 18px / 44px 4px repeat-x,
    var(--dirt);
  box-shadow: 0 4px 0 rgba(0,0,0,.35); }

/* -- layout + cards --------------------------------------------------------- */
main { max-width: 1100px; margin: var(--s-6) auto var(--s-7); padding: 0 var(--gutter); display: grid; gap: var(--section-gap); }
main > *, .grid > * { min-width: 0; }
.card { background: var(--surface); padding: var(--s-5); box-shadow: var(--block); border-radius: var(--radius); }
/* one vertical rhythm inside every card: first child flush, siblings 12px apart */
.card > * { margin-block: 0; }
.card > * + * { margin-top: var(--s-3); }
.card > h3:not(:first-child) { margin-top: var(--s-5); }
.card > ol:not(.flush), .card > ul:not(.chips):not(.timeline):not(.flush) { padding-left: var(--s-5); }
.card > ol > li + li, .card > ul:not(.chips):not(.timeline) > li + li { margin-top: var(--s-1); }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-2) var(--s-4); margin: 0; }
.page-head > * { margin: 0; }
.page-links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); margin: 0; }
.card.gold { box-shadow: var(--block), inset 0 4px 0 var(--gold); }
.card.banner { margin: 0; box-shadow: var(--block), inset 4px 0 0 var(--warn); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-2) var(--s-4); }
.card-head h2 { margin: 0; }
.section-title { margin: var(--s-2) 0 var(--s-3); }
.grid { display: grid; gap: var(--section-gap); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid.stats { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s-4); }
.grid.buttons { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.status { display: grid; gap: var(--section-gap); }
.loading { color: var(--muted); }
.muted { color: var(--muted); }
.offline { box-shadow: var(--block), inset 6px 0 0 var(--danger); padding-left: var(--s-6); }
.unreachable { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3) var(--s-4); }
.unreachable p { flex: 1 1 16rem; margin: 0; }
.cmd { margin: var(--s-2) 0 var(--s-3); padding: var(--s-2) var(--s-3); background: var(--surface-2); white-space: pre-wrap; overflow-wrap: anywhere; }

/* home */
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-4);
  background: linear-gradient(135deg, var(--surface-2), var(--surface)); }
.server-icon { flex: none; width: 64px; height: 64px; image-rendering: pixelated; box-shadow: 0 0 0 4px #000, var(--block); }
.server-icon.blank { background:
    linear-gradient(var(--grass), var(--grass)) 0 0 / 100% 18px no-repeat,
    linear-gradient(90deg, var(--grass) 0 8px, transparent 8px 16px) 0 18px / 16px 6px repeat-x,
    linear-gradient(90deg, var(--dirt-dark) 0 6px, transparent 6px) 10px 36px / 26px 6px repeat-x,
    var(--dirt); }
.hero-text { flex: 1 1 14rem; min-width: 0; }
.hero-text p { margin: var(--s-1) 0 0; color: var(--muted); }
.big { font-size: 1.35rem; line-height: 1.6; margin: var(--s-1) 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); }
.big .of { color: var(--muted); font-size: .8em; }
.badge { display: inline-block; font-size: .62rem; line-height: 1.6; padding: var(--s-1) var(--s-2);
  background: var(--surface-2); color: var(--badge-text); box-shadow: var(--block); white-space: nowrap; }
/* the status icon falls back to a system font and renders tiny next to pixel caps: enlarge it */
.badge::first-letter { font-family: system-ui, sans-serif; font-size: 1.5em; line-height: 1; }
.badge.up { background: var(--ok-bg); } .badge.down { background: var(--down-bg); } .badge.warn { background: var(--warn-bg); }
.badge.up, .badge.down, .badge.warn { color: #fff; }
.badges { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0; }
.spark-title { margin: var(--s-2) 0 0; color: var(--muted); font-size: .8rem; }
.spark { display: block; width: 100%; height: 44px; margin-top: var(--s-2); color: var(--info); background: var(--well); }
.spark-ok { stroke: var(--stone); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.spark-legend { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); margin: var(--s-2) 0 0; font-size: .85rem; color: var(--muted); }
.spark-legend b { color: var(--text); font-variant-numeric: tabular-nums; }
.players-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.player { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-4) var(--s-2) var(--s-2); font-weight: 600; }
.player img, .chip img { image-rendering: pixelated; box-shadow: 0 0 0 2px #000; flex: none; }
.empty { margin: 0; }
.map iframe { display: block; width: 100%; height: 60vh; min-height: 280px; border: 0; box-shadow: 0 0 0 4px #000; background: #000; }
/* CMD-71: the map (8 MB of BlueMap) waits behind a tap, so Home stays light on a phone. */
.map-stage { display: grid; place-items: center; align-content: center; gap: .75rem; min-height: 200px; padding: 1.5rem 1rem; text-align: center;
  box-shadow: 0 0 0 4px #000; color: #e9f1e4;
  background:
    linear-gradient(rgba(10, 16, 28, .55), rgba(10, 16, 28, .55)),
    repeating-conic-gradient(#3f6b35 0 25%, #4f7e3f 0 50%) 0 0 / 32px 32px; }
.map-stage[hidden] { display: none; }
.map-stage .btn { min-height: 44px; }
.map-stage .map-note { margin: 0; font-size: .9rem; opacity: .85; }

/* -- controls --------------------------------------------------------------- */
.btn { font: 600 1rem/1.2 system-ui, -apple-system, sans-serif; min-height: 44px; padding: var(--s-3) var(--s-4); border: 0; border-radius: var(--radius);
  cursor: pointer; color: #fff; background: var(--btn-bg); box-shadow: var(--block); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); -webkit-tap-highlight-color: transparent; }
.btn:hover { background-image: linear-gradient(rgba(0,0,0,.14), rgba(0,0,0,.14)); }
.btn:active { box-shadow: var(--pressed); transform: translateY(1px); }
.btn.big { width: 100%; min-height: 72px; font-size: .7rem; line-height: 1.6; padding: var(--s-3) var(--s-4); }
.btn.big span { font-family: system-ui, sans-serif; font-size: 1.3rem; }
.btn.ghost { background-color: var(--surface-2); color: var(--badge-text); }
.btn.danger { background-color: var(--danger-bg); }
.btn.small { padding: var(--s-2) var(--s-3); font-size: .9rem; }
.btn[disabled], .htmx-request .btn, .btn.htmx-request { opacity: .7; cursor: progress; }
.btn-sub { display: block; margin-top: var(--s-1); font: 400 .85rem/1.3 system-ui, -apple-system, sans-serif; text-transform: none; letter-spacing: 0; overflow-wrap: anywhere; }
/* Undo update with nothing to undo (CMD-52): a quiet, readable slab rather than a faded red one. */
.btn.danger[disabled] { opacity: 1; cursor: not-allowed; background-color: var(--surface-2); color: var(--badge-text); background-image: none; }
.btn.danger[disabled]:active { box-shadow: var(--block); transform: none; }
.grid.buttons form { margin: 0; }
.icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0;
  font-size: 1.05rem; border: 0; border-radius: var(--radius); cursor: pointer; color: var(--gold);
  background: var(--slot); box-shadow: var(--block); }
.icon.danger { color: var(--bad); }
.icon:hover { background: var(--slot-hi); }
.icon:active { box-shadow: var(--pressed); }
input, select { font: inherit; color: var(--text); background: var(--field); border: 2px solid var(--line); border-radius: var(--radius);
  padding: var(--s-2) var(--s-3); min-height: 44px; min-width: 0; }
input::placeholder { color: var(--placeholder); }
input:focus { outline: 3px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
input[type="checkbox"] { min-height: 0; width: 24px; height: 24px; margin: 0; accent-color: var(--btn-bg); }
.toggle { display: inline-flex; gap: var(--s-2); align-items: center; min-height: 44px; padding: 0 var(--s-1); cursor: pointer; user-select: none; }
.add-player, .cmd { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.add-player input[name=name] { flex: 1 1 14rem; }
.search { width: 100%; }
#results:empty { display: none; }
#results { margin-top: var(--s-3); }
.htmx-indicator { margin: var(--s-2) 0 0; }

/* players */
.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--s-3); }
.chip { display: flex; align-items: center; gap: var(--s-2); background: var(--surface-2); padding: var(--s-1) var(--s-1) var(--s-1) var(--s-2); box-shadow: var(--block); max-width: 100%; }
.chip-name { font-weight: 600; padding: 0 var(--s-1); overflow-wrap: anywhere; min-width: 0; }
.chip form { display: inline; margin: 0; }
.chip.op .chip-name { color: var(--gold); }
.chip-text { display: flex; flex-direction: column; min-width: 0; padding: 0 var(--s-1); }
.chip-text .chip-name { padding: 0; }
.chip-seen { color: var(--muted); font-size: .75rem; font-variant-numeric: tabular-nums; }
.chip-seen.never { font-style: italic; }
.chips-sub { margin: var(--s-4) 0 0; font-size: .9rem; color: var(--muted); }
.chips-note { margin: var(--s-1) 0 0; font-size: .8rem; }
.legend { margin: 0; line-height: 2; }
.key { display: inline-block; min-width: 1.8em; text-align: center; color: var(--text); background: var(--slot); box-shadow: var(--block); padding: 0 var(--s-1); }

/* console + job output */
.terminal { background: #0b0f15; }
.log, .joblog { font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--term-text); background: var(--term);
  white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; box-shadow: inset 0 0 0 2px #000; }
.log { list-style: none; margin: 0; padding: var(--s-3); height: 60vh; min-height: 260px; }
.log li { position: relative; padding-left: 1.6em; }
.log li::before { position: absolute; left: 0; width: 1.4em; }
.log li.info::before { content: "ℹ"; color: var(--muted); }
.log li.warn { color: var(--warn); } .log li.warn::before { content: "⚠"; }
.log li.error { color: var(--term-error); } .log li.error::before { content: "✖"; }
.log li.note { color: var(--muted); }
.card-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); }
.prompt { color: var(--grass); font-size: .9rem; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-3) 0 var(--s-2); }
.chip-form { display: contents; }
.chip { display: inline-flex; align-items: center; gap: var(--s-1); min-height: 40px; padding: var(--s-1) var(--s-3);
  background: var(--surface-2); color: var(--text); border: 0; border-radius: 999px; box-shadow: var(--block);
  font: inherit; font-size: .9rem; cursor: pointer; max-width: 100%; }
.chip.used { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip:hover { background: var(--slot-hi); }
.chip.htmx-request { opacity: .6; }
.cmd input { flex: 1 1 12rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.job { box-shadow: var(--block), inset 0 4px 0 var(--stone); }
.joblog { max-height: 40vh; margin: var(--s-3) 0 0; padding: var(--s-3); }

/* plugins */
.plugin h3 { color: var(--text); font-size: .7rem; overflow-wrap: anywhere; }
.plugin .meta { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); margin: 0; font-size: .9rem; overflow-wrap: anywhere; }
.plugin.has-error { box-shadow: var(--block), inset 0 4px 0 var(--danger); }
.plugin .actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-4); }
.plugin .actions form { margin: 0; }
.hit { display: flex; flex-direction: column; }
.hit form { margin-top: auto; }
.hit-head { display: flex; gap: var(--s-3); align-items: flex-start; }
.hit-head h3 { margin-bottom: var(--s-1); }
.summary { margin: var(--s-3) 0 var(--s-4); overflow-wrap: anywhere; }
.plugin-icon { flex: none; width: 48px; height: 48px; image-rendering: pixelated; box-shadow: 0 0 0 2px #000; background: var(--slot); object-fit: cover; }
.plugin-icon.blank { background: linear-gradient(var(--stone), var(--stone)) 12px 12px / 24px 24px no-repeat, var(--slot); }
.errors { font: 12px/1.45 ui-monospace, Menlo, monospace; color: var(--term-error); background: var(--term); padding: var(--s-2) var(--s-3);
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 8rem; overflow: auto; margin: 0; }

/* backups + history */
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table td, .table th { text-align: left; padding: var(--s-3) var(--s-2); border-bottom: 2px solid var(--surface-2); }
.table th { color: var(--muted); font-weight: 600; }
.filters { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: flex-end; margin: 0 0 var(--s-4); }
.filters label { display: flex; flex-direction: column; gap: var(--s-1); color: var(--muted); flex: 0 1 16rem; min-width: 10rem; }
.filters > a { display: inline-flex; align-items: center; min-height: 44px; }
.filters select { width: 100%; }
.more { margin: var(--s-4) 0 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-3); align-items: center; padding: var(--s-3) 0 var(--s-3) var(--s-4);
  border-bottom: 2px solid var(--surface-2); box-shadow: inset 4px 0 0 var(--ok-bg); }
.timeline li.bad { box-shadow: inset 4px 0 0 var(--danger); }
.timeline li.busy { box-shadow: inset 4px 0 0 var(--warn); }
.timeline li.muted { box-shadow: none; padding-left: 0; }
.timeline time { color: var(--muted); min-width: 10rem; font-variant-numeric: tabular-nums; }
.timeline .what { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.timeline .detail { color: var(--muted); }
.timeline .badge { white-space: normal; text-align: left; max-width: 100%; overflow-wrap: anywhere; }

/* toasts */
#toasts { position: fixed; right: var(--gutter); bottom: var(--gutter); display: grid; gap: var(--s-2); z-index: 10; width: min(420px, calc(100vw - 2 * var(--gutter))); }
.toast { margin: 0; padding: var(--s-3) var(--s-4); color: var(--text); background: var(--surface-2); box-shadow: var(--block), 0 6px 0 rgba(0,0,0,.4);
  overflow-wrap: anywhere; animation: pop .2s ease-out; }
.toast.ok { border-left: 6px solid var(--info); } .toast.error { border-left: 6px solid var(--danger); } .toast.busy { border-left: 6px solid var(--warn); } .toast.info { border-left: 6px solid var(--muted); }
.toast:has(.toast-close) { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-3); }
.toast-msg { flex: 1 1 12rem; min-width: 0; }
.toast-close { font: 600 .9rem/1.2 system-ui, -apple-system, sans-serif; min-height: 44px; min-width: 44px; padding: var(--s-2) var(--s-3);
  border: 0; border-radius: var(--radius); cursor: pointer; color: var(--text); background: var(--slot); box-shadow: var(--block); }
.toast-close:hover { background: var(--slot-hi); }
.toast-close:active { box-shadow: var(--pressed); }
.toast-details { flex: 1 0 100%; font-size: .85rem; color: var(--muted); }
.toast-details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--gold); }
.toast-details pre { margin: 0; max-height: 30vh; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
  font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }

/* stats: the numbers are the hero */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--s-3); }
.tile { background: var(--surface-2); padding: var(--s-4); box-shadow: var(--block); min-width: 0; }
.tile .num { display: block; font-family: "Pixel", ui-monospace, monospace; font-size: 1.05rem; line-height: 1.5; color: var(--text);
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile .lbl { display: block; margin-top: var(--s-1); color: var(--muted); font-size: .9rem; }
/* When the family plays: weekday rows x hour columns, hours played on one blue ramp
   (dark = little, bright = a lot, on the dark card). The hour labels share the cells' grid. */
.heat-sum { margin: 0 0 var(--s-3); }
.heat { display: grid; grid-template-columns: auto repeat(24, minmax(0, 1fr)); grid-auto-rows: 22px; gap: 2px;
  align-items: stretch; padding: var(--s-3); background: var(--well); }
.heat-day { grid-column: 1; padding-right: var(--s-2); color: var(--muted); font-size: .8rem; line-height: 22px; }
.heat-cell { display: block; border-radius: 3px; background: var(--heat-0); }
.heat-cell.l1 { background: var(--heat-1); } .heat-cell.l2 { background: var(--heat-2); } .heat-cell.l3 { background: var(--heat-3); }
.heat-cell.l4 { background: var(--heat-4); } .heat-cell.l5 { background: var(--heat-5); }
.heat-cell.peak { box-shadow: 0 0 0 2px var(--text); position: relative; z-index: 1; }
.heat-hour { grid-row: 8; justify-self: center; white-space: nowrap; color: var(--muted); font-size: .8rem; line-height: 22px; }
.heat-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); margin: var(--s-2) 0 0;
  color: var(--muted); font-size: .85rem; }
.heat-legend .heat-cell { width: 16px; height: 12px; }
.heat-table { margin-top: var(--s-3); }
.heat-table summary { cursor: pointer; color: var(--gold); }
.scroll-x { overflow-x: auto; max-width: 100%; }
.table.compact td, .table.compact th { padding: var(--s-1) var(--s-2); white-space: nowrap; font-size: .85rem; }

/* Who's playing today: one row per player, session bars on a shared time axis. */
.today { display: grid; gap: var(--s-3); }
.today-row { display: grid; grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr) 5.5rem; align-items: center; gap: var(--s-2) var(--s-4); }
.today-who { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: var(--s-2); min-width: 0; }
.today-who img { grid-row: span 2; image-rendering: pixelated; box-shadow: 0 0 0 2px #000; }
.today-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-live { grid-column: 2; font-size: .75rem; color: var(--text); }
.today-track { position: relative; height: 22px; background: var(--well-strong); border-radius: 4px; }
.today-bar { position: absolute; top: 4px; bottom: 4px; min-width: 4px; background: var(--info); border-radius: 4px; }
.today-bar.live { box-shadow: inset -3px 0 0 var(--text); }
.today-now { position: absolute; top: -3px; bottom: -3px; left: var(--now); width: 2px; background: var(--gold); }
.today-total { margin: 0; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.today-axis { grid-column: 2; position: relative; height: 1.3em; color: var(--muted); font-size: .75rem; }
.today-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.today-axis span:first-child { transform: none; } .today-axis span:last-child { transform: translateX(-100%); }
@media (max-width: 640px) {
  .today-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who total" "track track"; }
  .today-who { grid-area: who; } .today-total { grid-area: total; } .today-track { grid-area: track; }
  .today-axis-row { grid-template-areas: "axis axis"; margin-top: calc(-1 * var(--s-2)); }
  .today-axis { grid-area: axis; }
  .today-axis .minor { display: none; }
}
/* A player's week: seven labelled bars, one blue series; a missing night is a dashed gap. */
.week-sum { margin: 0 0 var(--s-3); }
.week, .week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s-2); padding: 0 var(--s-3); }
.week { align-items: end; padding-top: var(--s-3); background: var(--well); border-bottom: 2px solid var(--stone); }
.week-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 0; height: 132px; }
.week-val { font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; margin-bottom: 2px; }
.week-bar { width: min(100%, 44px); background: var(--info); border-radius: 4px 4px 0 0; }
.week-bar.gap { height: 24px; background: none; border: 2px dashed var(--line); border-bottom: 0; }
.week-col.best .week-bar { box-shadow: 0 0 0 2px var(--text); }
.week-days { margin: var(--s-1) 0 var(--s-4); color: var(--muted); font-size: .8rem; text-align: center; }
.week-days .today { color: var(--text); font-weight: 700; }
@media (max-width: 640px) { .week, .week-days { gap: var(--s-1); padding: 0 var(--s-2); } .week { padding-top: var(--s-3); } .week-val { font-size: .7rem; } }
/* Intruders: 30 days of tries. Blue bars (magnitude); orange outline + ● = some tries from an address not blocked. */
.tries-hero { margin: var(--s-3) 0 var(--s-5); }
.tries-sum { margin: 0 0 var(--s-3); }
.tries-sum strong { font-variant-numeric: tabular-nums; }
.tries-sum .open { color: var(--danger); }
.tries, .tries-days { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 2px; padding: 0 var(--s-2); }
.tries { align-items: end; padding-top: var(--s-3); background: var(--well); border-bottom: 2px solid var(--stone); }
.tries-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 0; height: 128px; }
.tries-val { font-size: .7rem; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; margin-bottom: 2px; }
.tries-dot { font-family: system-ui, sans-serif; font-size: .6rem; line-height: 1; color: var(--danger); margin-bottom: 2px; }
.tries-bar { width: min(100%, 22px); background: var(--info); border-radius: 4px 4px 0 0; }
.tries-bar.zero { height: 2px; background: var(--line); border-radius: 0; }
.tries-col.open .tries-bar { box-shadow: 0 0 0 2px var(--danger); }
.tries-col.today .tries-val { text-decoration: underline; }
.tries-days { margin: var(--s-1) 0 var(--s-2); color: var(--muted); font-size: .75rem; }
.tries-days span { white-space: nowrap; overflow: visible; display: flex; justify-content: center; }
.tries-days .today { color: var(--text); font-weight: 700; justify-content: flex-end; }
.tries-legend { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); margin: 0; font-size: .85rem; color: var(--muted); }
.tries-legend .sw { display: inline-block; width: 12px; height: 12px; margin-right: var(--s-1); vertical-align: -1px; background: var(--info); border-radius: 2px; }
.tries-legend .sw.open { background: none; width: auto; height: auto; color: var(--danger); font-style: normal; font-family: system-ui, sans-serif; }
@media (max-width: 600px) {
  .tries { padding: var(--s-2) 2px 0; }
  .tries-days { padding: 0 2px; }
  .tries-val { writing-mode: vertical-rl; transform: rotate(180deg); font-size: .65rem; }
}
.week-note { margin-top: calc(-1 * var(--s-2)); }
.tile .delta { display: block; margin-top: var(--s-1); color: var(--text); font-size: .8rem; font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.refresh { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); color: var(--muted); }
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s-4); }
.board-item { background: var(--surface-2); padding: var(--s-4); box-shadow: var(--block); min-width: 0; }
.board-item h3 { margin-bottom: var(--s-3); }
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.rank li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-1) var(--s-3); align-items: baseline; }
.rank .pos { font-family: "Pixel", ui-monospace, monospace; font-size: .7rem; color: var(--gold); min-width: 1.5em; }
.rank .val { grid-column: 2; font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rank .who-n { overflow-wrap: anywhere; }
.player-links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-4); }
.stat-lines { display: grid; gap: var(--s-2); }
.actions-row { display: flex; flex-wrap: wrap; gap: var(--s-3); }

/* login */
.login { width: 100%; max-width: 440px; margin: var(--s-6) auto; }
.login h1 { margin-bottom: var(--s-4); }
.login .toast { animation: none; margin-bottom: var(--s-4); }
.login form { display: grid; gap: var(--s-4); }
.login label { display: grid; gap: var(--s-1); font-weight: 600; }

.instant .sky, .instant .sky::before, .instant .sky-body { transition: none !important; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* phones */
@media (max-width: 640px) {
  :root { --gutter: var(--s-4); --section-gap: var(--s-4); }
  .sky { padding: var(--s-3) var(--gutter) var(--s-3); }
  /* brand, user and Log out share one row; the sun parks small in the gap between them */
  .sky-top { flex-wrap: nowrap; gap: var(--s-2); margin-bottom: var(--s-3); padding-right: 0; }
  .sky-body { width: 24px; height: 24px; top: 20px; right: auto; left: 150px; }
  .brand { flex: none; font-size: .7rem; padding: var(--s-3) var(--s-2); }
  .who { min-width: 0; gap: var(--s-2); }
  .who-name { min-width: 0; overflow: hidden; white-space: nowrap; padding-right: var(--s-2); }
  .who .btn { flex: none; padding-inline: var(--s-3); }
  /* the ◐ pill keeps its glyph and drops the word to leave the user slot room; aria-label still says it */
  .theme-pill:has(+ .who) { width: 44px; padding-inline: 0; flex: none; }
  .theme-pill:has(+ .who) .theme-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  /* with brand, ◐, user and Log out on one row there is no open sky left for the sun to park in */
  .sky:has(.who) .sky-body { display: none; }
  /* hotbar: one row that scrolls sideways (the current slot is centered on load, app.js).
     Slots are 72px; a label too long for that ("Intruders") widens its slot instead of overlapping. */
  .hotbar, .hotbar.nine { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: max-content;
    overflow-x: auto; overflow-y: hidden; scroll-snap-type: x; scrollbar-width: thin; overscroll-behavior-x: contain; }
  .hotbar a { min-width: 72px; min-height: 52px; padding: var(--s-1); gap: var(--s-1); scroll-snap-align: start; }
  main { margin-top: var(--s-4); padding: 0 var(--gutter); }
  .card { padding: var(--s-4); }
  h1 { font-size: .9rem; }
  .big { font-size: 1.1rem; }
  .timeline time { min-width: 0; width: 100%; }
  .filters label { flex-basis: 100%; }
  .log { height: 55vh; }
  /* stacked tables: each row is a card -- address + tries, names + what happened, last seen, then the action */
  .table.stack, .table.stack tbody { display: block; }
  .table.stack thead { display: none; }
  .table.stack tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s-1) var(--s-3); align-items: baseline;
    grid-template-areas: "address tries" "names kinds" "last last" "action action";
    padding: var(--s-3) 0; border-bottom: 2px solid var(--surface-2); }
  .table.stack td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .table.stack td[colspan] { grid-column: 1 / -1; }
  .table.stack td[data-label="Address"] { grid-area: address; }
  .table.stack td[data-label="Tries"] { grid-area: tries; text-align: right; }
  .table.stack td[data-label="Names"] { grid-area: names; }
  .table.stack td[data-label="What happened"] { grid-area: kinds; color: var(--muted); text-align: right; max-width: 45vw; }
  .table.stack td[data-label="Last seen"] { grid-area: last; }
  .table.stack td[data-label="Tries"]::before, .table.stack td[data-label="Last seen"]::before {
    content: attr(data-label) " "; color: var(--muted); }
  .table.stack td[data-label="First seen"] { display: none; }
  .table.stack td[data-label="Action"] { grid-area: action; display: grid; gap: var(--s-2); margin-top: var(--s-1); }
  .table.stack td[data-label="Action"]:not(:has(*)) { display: none; }
  .table.stack td[data-label="Action"] .btn { width: 100%; min-height: 44px; }
  .table.stack td[data-label="Action"] .badge { white-space: normal; justify-self: start; max-width: 100%; }
}
.backup-status { margin: 0 0 var(--s-3); }
.nowrap { white-space: nowrap; }
/* Update preview: what would change, then the button to do it. */
.job.preview .table { margin: var(--s-3) 0; }
.job.preview .table th[scope=row] { color: var(--text); }
.job.preview form { margin: var(--s-3) 0; }
.job.preview form .btn { width: auto; }
.preview-note { display: block; margin-top: 2px; color: var(--muted); font-weight: 400; font-size: .85rem; overflow-wrap: anywhere; }
.joblog-more summary { cursor: pointer; color: var(--gold); margin-top: var(--s-3); }
.job-why { margin: var(--s-3) 0; font-weight: 600; }
.job form { margin: var(--s-3) 0 0; }
.job form .btn { width: auto; }

/* Achievements: one completion ladder per category. The bar is the share of active players. */
.ach-key { margin-top: 0; }
.ach-cat + .ach-cat { margin-top: var(--s-5); }
.ach-cat h3 { margin-bottom: var(--s-2); }
.ach-ladder { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.ach-row { display: grid; grid-template-columns: minmax(9rem, 14rem) auto 1fr 6.5rem; align-items: center; gap: var(--s-3); padding: 2px 0; }
.ach-row:hover .ach-track { background: rgba(95, 191, 58, .26); }
.ach-row.off { opacity: .5; }
.ach-name { min-width: 0; overflow-wrap: anywhere; }
.ach-tag { display: inline-block; border: 1px solid var(--muted); color: var(--muted); font-size: .7rem; line-height: 1.3; padding: 0 4px; border-radius: var(--radius); vertical-align: 1px; }
.ach-pips { display: inline-flex; gap: 2px; }
.ach-pips i { width: 6px; height: 6px; background: var(--slot-hi); }
.ach-pips i.on { background: var(--gold); }
.ach-track { position: relative; height: 12px; background: rgba(95, 191, 58, .16); }
.ach-fill { position: absolute; inset: 0 auto 0 0; background: var(--grass); border-radius: 0 4px 4px 0; }
.ach-val { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.ach-pct { display: inline-block; min-width: 3.2em; color: var(--text); }
.ach-recent { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: var(--s-2) var(--s-4); }
.ach-recent li { background: var(--surface-2); padding: var(--s-2) var(--s-3); box-shadow: var(--block); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-2); }
.ach-what { color: var(--text); }
@media (max-width: 640px) {
  .ach-row { grid-template-columns: 1fr auto; gap: var(--s-1) var(--s-2); }
  .ach-track { grid-column: 1; }
}

/* Economy: one gold series. --coin passes the dark lightness band on both card surfaces;
   --coin-dim is the ordinal step for past weeks (validated as a pair with --coin). */
:root { --coin: #c98500; --coin-dim: #7d5a12; --coin-track: rgba(201, 133, 0, .16); }
.eco-head { display: grid; grid-template-columns: minmax(0, 2fr) minmax(12rem, 1fr); gap: var(--s-4); align-items: stretch; }
.eco-hero { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.eco-hero-lbl { color: var(--muted); font-size: .9rem; }
.eco-hero-num { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 3.25rem; font-weight: 700; line-height: 1.05;
  color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.eco-unit { font-size: 1.1rem; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.eco-delta { color: var(--text); font-size: .9rem; font-variant-numeric: tabular-nums; }
.eco-spark { display: block; width: 100%; max-width: 32rem; height: auto; margin-top: var(--s-3); overflow: visible; }
.eco-spark-base { stroke: var(--line); stroke-width: 1; }
.eco-spark-bar { fill: var(--coin-dim); }
.eco-spark-bar.now { fill: var(--coin); }
.eco-spark-hit { fill: transparent; }
.eco-spark-hit:hover { fill: rgba(255, 255, 255, .05); }
.eco-spark-axis { display: flex; justify-content: space-between; max-width: 32rem; font-size: .75rem; }
.eco-side { display: grid; gap: var(--s-3); align-content: start; }
.card > .eco-bars { list-style: none; margin: var(--s-3) 0 0; padding: 0; display: grid; gap: var(--s-2); }
.card > .eco-bars > li + li { margin-top: 0; }
.eco-row { display: grid; grid-template-columns: minmax(9rem, 16rem) 1fr 7.5rem; align-items: center; gap: var(--s-3); padding: 2px 0; }
.eco-row:hover .eco-track { background: rgba(201, 133, 0, .26); }
.eco-row.out .eco-val { color: var(--muted); }
.eco-name { min-width: 0; overflow-wrap: anywhere; color: var(--text); }
.eco-name .muted { font-size: .8rem; }
.eco-track { position: relative; height: 12px; background: var(--coin-track); }
.eco-fill { position: absolute; inset: 0 auto 0 0; background: var(--coin); border-radius: 0 4px 4px 0; }
.eco-val { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; color: var(--text); }
.eco-tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(20rem, 100%), 1fr)); gap: var(--s-4); }
.eco-tables > .card { min-width: 0; }
.eco-tables .card { margin: 0; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .eco-head { grid-template-columns: 1fr; }
  .eco-hero-num { font-size: 3rem; }
  .eco-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name val" "track track"; gap: var(--s-1) var(--s-2); }
  .eco-name { grid-area: name; }
  .eco-val { grid-area: val; }
  .eco-track { grid-area: track; }
  .eco-tables { grid-template-columns: minmax(0, 1fr); }
}

/* Objectives: one grass series. --leaf is the panel grass stepped into the dark lightness band
   (validated on both card surfaces); the track is the same hue at low alpha. */
:root { --leaf: #57ad35; --leaf-track: rgba(87, 173, 53, .16); }
.obj-head { display: grid; grid-template-columns: minmax(0, 2fr) minmax(12rem, 1fr); gap: var(--s-4); align-items: start; }
.obj-hero { min-width: 0; display: grid; gap: var(--s-4); }
.obj-hero h2 { margin: 0; }
.obj-goal { display: grid; gap: var(--s-1); }
.obj-goal-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-1) var(--s-3); align-items: baseline; }
.obj-goal-name { color: var(--text); font-size: 1.1rem; overflow-wrap: anywhere; }
.obj-goal-val { font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.obj-goal-val b { font-size: 1.6rem; }
.obj-goal .obj-track { height: 18px; }
.obj-track { position: relative; display: block; height: 12px; background: var(--leaf-track); }
.obj-fill { position: absolute; inset: 0 auto 0 0; background: var(--leaf); border-radius: 0 4px 4px 0; }
.obj-row:hover .obj-track, .obj-goal:hover .obj-track { background: rgba(87, 173, 53, .26); }
.obj-who { margin: 0; color: var(--text); font-size: .9rem; overflow-wrap: anywhere; }
.obj-person { white-space: nowrap; }
.obj-min { margin: 0; font-size: .8rem; }
.card > ul.obj-board:not(.chips) { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: grid; gap: var(--s-2); }
.card > ul.obj-board:not(.chips) > li + li { margin-top: 0; }
.obj-pick { display: flex; justify-content: space-between; gap: var(--s-3); align-items: baseline; padding: var(--s-2) 0; border-bottom: 2px solid var(--surface-2); }
.obj-pick-name { min-width: 0; color: var(--text); overflow-wrap: anywhere; }
.obj-pick-name .muted { font-size: .8rem; }
.obj-pick-n { white-space: nowrap; font-variant-numeric: tabular-nums; }
.obj-status { white-space: nowrap; color: var(--text); }
.obj-status.open { color: var(--warn); }
@media (max-width: 640px) {
  .obj-head { grid-template-columns: minmax(0, 1fr); }
  .obj-row .obj-track { grid-area: track; }
}

/* Player cosmetics strip: the active title as a chip in its Minecraft color (stepped to read at
   >= 4.5:1 on both card surfaces, see progress/cosmetics.py TITLE_HEX), badges as inventory slots,
   trophies as medals. Medal colors sit in the dark lightness band; silver is gray by meaning, so the
   place ("1st", "2nd", "3rd") is always printed on the medal and the name carries it too. */
:root { --medal-gold: #bd8b18; --medal-silver: #8696ae; --medal-bronze: #bb6c33; --medal-plain: var(--stone); }
.cos-strip { display: flex; flex-wrap: wrap; gap: var(--s-4) var(--s-6); align-items: flex-start;
  margin: var(--s-2) 0 var(--s-4); padding: var(--s-3) var(--s-4); background: var(--surface-2); box-shadow: var(--block); }
.cos-group { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.cos-lbl { color: var(--muted); font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; }
.cos-title { align-self: flex-start; font-family: "Pixel", monospace; font-size: .85rem; line-height: 1; color: var(--cos-c);
  padding: var(--s-2) var(--s-3); background: var(--slot); border: 2px solid var(--cos-c); box-shadow: inset 0 0 0 2px #000; }
.cos-badges, .cos-trophies { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); }
.card .cos-badges > li + li, .card .cos-trophies > li + li { margin-top: 0; }
.cos-badge { display: flex; align-items: center; gap: var(--s-2); }
.cos-slot { display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none; background: var(--slot);
  box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 var(--slot-hi); font-family: "Pixel", monospace; font-size: .9rem; color: var(--gold); }
.cos-name { color: var(--text); font-size: .95rem; overflow-wrap: anywhere; }
.cos-trophy { display: grid; grid-template-columns: auto 1fr; column-gap: var(--s-2); align-items: center; }
.cos-trophy .cos-date { grid-column: 2; font-size: .8rem; }
.cos-medal { grid-row: span 2; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--medal-plain); color: #10151f; font-family: "Pixel", monospace; font-size: .7rem;
  box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 4px #000, inset -3px -3px 0 rgba(0,0,0,.25), inset 3px 3px 0 rgba(255,255,255,.25); }
.cos-trophy.gold .cos-medal { background: var(--medal-gold); }
.cos-trophy.silver .cos-medal { background: var(--medal-silver); }
.cos-trophy.bronze .cos-medal { background: var(--medal-bronze); }
.cos-none { margin: 0; }
@media (forced-colors: active) { .cos-title, .cos-medal { border: 2px solid CanvasText; } }

/* Events: one amethyst series (--ev, validated in the dark band on both card surfaces). Teams use
   the same hue: red, green and yellow can't be told apart under color-vision deficiency, so the
   team's name labels each bar and its swatch is only a hint. The strip is the week: one column a
   day, each tile says its kind in words (Weekly, Flash, Added) and a running event says Live. */
:root { --ev: #9a6be0; --ev-track: rgba(154, 107, 224, .16); --ev-hover: rgba(154, 107, 224, .26); }
.ev-week-head, .ev-run-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline;
  gap: var(--s-1) var(--s-3); margin-bottom: var(--s-3); }
.ev-week-head h2, .ev-run-head h2 { margin: 0; }
.card > ol.ev-week { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s-2); }
.card > ol.ev-week > li + li { margin-top: 0; }
.ev-day { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; padding: var(--s-2); background: var(--slot);
  box-shadow: inset 2px 2px 0 #000, inset -2px -2px 0 var(--slot-hi); min-height: 9rem; }
.ev-day.today { box-shadow: inset 0 0 0 2px var(--ev), inset 2px 2px 0 4px #000; }
.ev-day-head { margin: 0; display: flex; flex-direction: column; line-height: 1.3; }
.ev-day-name { font-family: "Pixel", monospace; font-size: .65rem; color: var(--text); }
.ev-day-head .muted { font-size: .8rem; }
.ev-day-empty { margin: 0; font-size: .8rem; }
.ev-day-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.ev-day-list > li + li { margin-top: 0; }
.ev-tile { display: grid; gap: 2px; padding: var(--s-2); background: var(--surface-2); border-left: 4px solid var(--ev);
  min-width: 0; overflow-wrap: anywhere; }
.ev-tile.flash { border-left-style: dashed; }
.ev-tile.closed { border-left-color: var(--stone); }
.ev-tile.running, .ev-tile.voting { background: var(--ev-track); }
.ev-tile-time { font-size: .8rem; color: var(--text); font-variant-numeric: tabular-nums; }
.ev-tile-name { color: var(--text); font-weight: 600; line-height: 1.25; }
.ev-tile-kind { font-size: .75rem; }
.ev-live { color: var(--text); font-weight: 700; }
.ev-live [aria-hidden] { color: var(--ev); }
.card > .ev-bars { list-style: none; margin: var(--s-2) 0 var(--s-3); padding: 0; display: grid; gap: var(--s-2); }
.card > .ev-bars > li + li { margin-top: 0; }
.ev-row { display: grid; grid-template-columns: minmax(9rem, 14rem) 1fr 5rem; align-items: center; gap: var(--s-3); padding: 2px 0; }
.ev-row:hover .ev-track { background: var(--ev-hover); }
.ev-name { min-width: 0; overflow-wrap: anywhere; color: var(--text); display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.ev-name .muted { font-size: .8rem; }
.ev-rank { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 2.2em; }
.ev-swatch { width: 12px; height: 12px; flex: none; box-shadow: 0 0 0 2px #000; }
.ev-swatch.red { background: #e0524a; } .ev-swatch.blue { background: #4a8fe0; }
.ev-swatch.green { background: #3aa35a; } .ev-swatch.yellow { background: #e3c13b; }
.ev-track { position: relative; display: block; height: 12px; background: var(--ev-track); }
.ev-track.big { height: 18px; }
.ev-fill { position: absolute; inset: 0 auto 0 0; background: var(--ev); border-radius: 0 4px 4px 0; }
.ev-val { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; color: var(--text); }
.ev-goal { display: grid; gap: var(--s-1); margin-bottom: var(--s-3); }
.ev-goal-top { margin: 0; color: var(--text); font-variant-numeric: tabular-nums; }
.ev-goal-top b { font-size: 1.6rem; }
.ev-more { margin: 0 0 var(--s-3); font-size: .85rem; }
.card > ul.ev-history:not(.chips) { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(16rem, 100%), 1fr)); gap: var(--s-3); }
.card > ul.ev-history:not(.chips) > li + li { margin-top: 0; }
.ev-result { padding: var(--s-3); background: var(--surface-2); box-shadow: var(--block); display: grid; gap: var(--s-2); align-content: start; min-width: 0; }
.ev-result-head { margin: 0; display: flex; justify-content: space-between; gap: var(--s-2); flex-wrap: wrap; align-items: baseline; }
.ev-result-name { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.ev-result-head .muted, .ev-result-line { font-size: .85rem; }
.ev-result-line { margin: 0; color: var(--text); }
.ev-result.cancelled { opacity: .85; }
.ev-podium { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-1); }
.ev-podium > li + li { margin-top: 0; }
.ev-place { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.ev-place-txt { color: var(--text); overflow-wrap: anywhere; }
.ev-place-txt .muted { font-size: .8rem; }
.ev-medal { display: inline-grid; place-items: center; width: 22px; height: 22px; flex: none; border-radius: 50%;
  background: var(--medal-plain); color: #10151f; font-family: "Pixel", monospace; font-size: .6rem;
  box-shadow: 0 0 0 2px #000, inset -2px -2px 0 rgba(0,0,0,.25), inset 2px 2px 0 rgba(255,255,255,.25); }
.ev-place.p1 .ev-medal { background: var(--medal-gold); }
.ev-place.p2 .ev-medal { background: var(--medal-silver); }
.ev-place.p3 .ev-medal { background: var(--medal-bronze); }
.ev-foot { font-size: .85rem; }
@media (max-width: 900px) {
  .card > ol.ev-week { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(9.5rem, 1fr);
    overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--s-2); }
  .ev-day { scroll-snap-align: start; }
}
@media (max-width: 640px) {
  .ev-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name val" "track track"; gap: var(--s-1) var(--s-2); }
  .ev-name { grid-area: name; }
  .ev-val { grid-area: val; }
  .ev-track { grid-area: track; }
}
@media (forced-colors: active) { .ev-fill, .ev-swatch { background: CanvasText; } .ev-tile { border-left-color: CanvasText; } }

/* ---- Builds (build competitions) ---- */
.bd-hero { display: grid; gap: var(--s-3); box-shadow: var(--block), inset 0 4px 0 var(--ev);
  background: linear-gradient(135deg, var(--surface-2), var(--surface)); }
.bd-kicker { margin: 0; font-family: "Pixel", monospace; font-size: .65rem; color: var(--muted); letter-spacing: .04em; }
.bd-theme { margin: 0; font-size: 1.6rem; line-height: 1.2; color: var(--text); overflow-wrap: anywhere; }
.bd-theme .muted { display: block; margin-bottom: var(--s-2); font-size: .8rem; font-weight: 400; }
.bd-phases { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.bd-phases > li + li { margin-top: 0; }
.bd-phase { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-1) var(--s-3) var(--s-1) var(--s-1);
  background: var(--slot); color: var(--muted); }
.bd-phase.now { background: var(--ev-track); color: var(--text); font-weight: 700; box-shadow: inset 0 0 0 2px var(--ev); }
.bd-phase.done { color: var(--text); }
.bd-step { display: inline-grid; place-items: center; width: 22px; height: 22px; background: var(--surface-2);
  font-family: "Pixel", monospace; font-size: .55rem; }
.bd-phase.now .bd-step { background: var(--ev); color: #10151f; }
.bd-until { margin: 0; color: var(--text); }
.bd-stats { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-6); margin: 0; }
.bd-stats div { display: flex; flex-direction: column-reverse; }
.bd-stats dt { color: var(--muted); font-size: .8rem; }
.bd-stats dd { margin: 0; font-size: 1.6rem; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.bd-queue .bd-text { max-width: 28rem; overflow-wrap: anywhere; }
.bd-foot { margin: var(--s-3) 0 0; font-size: .85rem; }
.bd-gallery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-3); }
.bd-gallery > li + li { margin-top: 0; }
.bd-entry { display: grid; gap: var(--s-1); align-content: start; padding: var(--s-3); background: var(--surface-2);
  box-shadow: var(--block); border-left: 4px solid var(--stone); min-width: 0; }
.bd-entry.p1 { border-left-color: var(--medal-gold); } .bd-entry.p2 { border-left-color: var(--medal-silver); }
.bd-entry.p3 { border-left-color: var(--medal-bronze); }
.bd-entry p { margin: 0; }
.bd-entry-top { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.bd-title { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.bd-by { font-size: .8rem; font-variant-numeric: tabular-nums; }
.bd-desc { color: var(--text); font-size: .9rem; overflow-wrap: anywhere; }
.bd-votes { color: var(--text); font-variant-numeric: tabular-nums; }
.bd-place { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; color: var(--text); font-weight: 700; }
.bd-medal { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--medal-plain);
  color: #10151f; font-family: "Pixel", monospace; font-size: .55rem; box-shadow: inset -2px -2px 0 rgba(0,0,0,.3); }
.bd-place.p1 .bd-medal { background: var(--medal-gold); } .bd-place.p2 .bd-medal { background: var(--medal-silver); }
.bd-place.p3 .bd-medal { background: var(--medal-bronze); }
.bd-past { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.bd-past > li { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-3); margin: 0;
  padding: var(--s-2) 0; border-bottom: 2px solid var(--surface-2); }
.bd-past-theme { color: var(--text); font-weight: 600; }
.bd-past-win { color: var(--text); overflow-wrap: anywhere; }

/* ---- Polls ---- */
.pl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-4); }
.pl-list > li + li { margin-top: 0; }
.pl-poll { display: grid; gap: var(--s-2); padding: var(--s-3) var(--s-4); background: var(--surface-2); box-shadow: var(--block); min-width: 0; }
.pl-poll p { margin: 0; }
.pl-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--s-1) var(--s-3); }
.pl-q { color: var(--text); font-weight: 600; font-size: 1.05rem; overflow-wrap: anywhere; }
.pl-kind { font-size: .75rem; color: var(--muted); border: 1px solid var(--line); padding: 0 6px; white-space: nowrap; }
.pl-sum { color: var(--text); }
.pl-note { font-size: .85rem; }
.pl-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pl-bars > li + li { margin-top: 0; }
.pl-row { display: grid; grid-template-columns: minmax(7rem, 13rem) 1fr 5.5rem; align-items: center; gap: var(--s-3); padding: 2px 0; }
.pl-row:hover .pl-track { background: var(--ev-hover); }
.pl-label { min-width: 0; overflow-wrap: anywhere; color: var(--text); }
.pl-row.lead .pl-label { font-weight: 700; }
.pl-track { position: relative; display: block; height: 14px; background: var(--ev-track); }
.pl-fill { position: absolute; inset: 0 auto 0 0; background: var(--ev); border-radius: 0 4px 4px 0; }
.pl-poll.done .pl-fill { opacity: .7; }
.pl-poll.done .pl-row.lead .pl-fill { opacity: 1; }
.pl-val { text-align: right; white-space: nowrap; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---- Hall of Fame ---- */
.hof-hero { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: var(--s-4); }
.hof-feat { display: grid; gap: var(--s-1); align-content: start; padding: var(--s-5); min-width: 0;
  background: linear-gradient(160deg, rgba(189, 139, 24, .22), var(--surface) 70%); box-shadow: var(--block), inset 0 4px 0 var(--medal-gold); }
.hof-feat p { margin: 0; }
.hof-feat-lbl { font-family: "Pixel", monospace; font-size: .6rem; color: var(--muted); letter-spacing: .04em; }
.hof-feat-player { font-size: 1.9rem; font-weight: 700; line-height: 1.15; color: var(--text); overflow-wrap: anywhere; }
.hof-feat-name { color: var(--text); font-weight: 600; }
.hof-feat-detail { color: var(--gold); overflow-wrap: anywhere; }
.hof-feat-date { font-size: .85rem; }
.hof-wall { list-style: none; margin: 0; padding: 0; display: grid; }
.hof-wall > li + li { margin-top: 0; }
.hof-player { display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr); grid-template-areas: "name rack" ". counts";
  column-gap: var(--s-4); row-gap: 2px; align-items: center; padding: var(--s-3) 0; border-bottom: 2px solid var(--surface-2); }
.hof-name { grid-area: name; color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.hof-rank { display: inline-block; min-width: 1.6em; font-variant-numeric: tabular-nums; font-weight: 400; }
.hof-rack { grid-area: rack; display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.hof-counts { grid-area: counts; display: flex; flex-wrap: wrap; gap: 2px var(--s-3); font-size: .85rem; color: var(--text); }
.hof-c { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.hof-c .hof-token { width: 10px; height: 10px; }
.hof-token { display: inline-block; width: 16px; height: 16px; border-radius: 50%; background: var(--medal-plain);
  box-shadow: inset -2px -2px 0 rgba(0,0,0,.3), 0 0 0 2px var(--surface); }
.hof-token.gold { background: var(--medal-gold); } .hof-token.silver { background: var(--medal-silver); }
.hof-token.bronze { background: var(--medal-bronze); }
.hof-token.trophy { border-radius: 2px; transform: rotate(45deg) scale(.8); background: var(--gold); }
.hof-rack { column-gap: var(--s-3); }
.hof-group { display: inline-flex; align-items: center; gap: 3px; }
.hof-more { font-size: .75rem; margin: 0 var(--s-1); }
.hof-key { margin: var(--s-3) 0 0; font-size: .85rem; }
.hof-recent { list-style: none; margin: 0; padding: 0; display: grid; }
.hof-recent > li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s-3);
  margin: 0; padding: var(--s-2) 0; border-bottom: 2px solid var(--surface-2); }
.hof-badge { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--medal-plain);
  color: #10151f; font-family: "Pixel", monospace; font-size: .55rem; box-shadow: inset -2px -2px 0 rgba(0,0,0,.3); }
.hof-badge.gold { background: var(--medal-gold); } .hof-badge.silver { background: var(--medal-silver); }
.hof-badge.bronze { background: var(--medal-bronze); } .hof-badge.trophy { background: var(--gold); border-radius: 2px; }
.hof-line { color: var(--text); overflow-wrap: anywhere; }
.hof-when { font-size: .8rem; white-space: nowrap; }
@media (max-width: 640px) {
  .pl-row { grid-template-columns: minmax(0, 1fr) 4.5rem; grid-template-areas: "label val" "track track"; row-gap: 2px; }
  .pl-label { grid-area: label; } .pl-val { grid-area: val; } .pl-track { grid-area: track; }
  .hof-player { grid-template-columns: minmax(0, 1fr); grid-template-areas: "name" "rack" "counts"; }
  .hof-recent > li { grid-template-columns: auto minmax(0, 1fr); }
  .hof-when { grid-column: 2; }
  .bd-theme { font-size: 1.3rem; }
}

/* Server: 30-day uptime ribbon. Blue = up all day; an orange ramp + ✖ = down that day (darker-to-brighter = longer);
   ● = still down; hatched = before the panel kept track. Glyphs carry the state, shade only the length. */
.uptime-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s-2) var(--s-4); }
.uptime-head h2 { margin: 0; }
.uptime-hero { margin: 0; display: flex; align-items: baseline; gap: var(--s-2); flex-wrap: wrap; }
.uptime-num { font-size: 2.6rem; font-weight: 800; line-height: 1; letter-spacing: -.01em; }
.uptime-of { color: var(--muted); }
.uptime-sum { margin: var(--s-3) 0 var(--s-4); }
.uptime-sum strong { font-variant-numeric: tabular-nums; }
.up-cells, .up-days { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 2px; }
.up-cell { display: flex; align-items: center; justify-content: center; height: 36px; min-width: 0; border-radius: 2px;
  font-family: system-ui, sans-serif; font-size: .7rem; font-style: normal; line-height: 1; color: #1a0d00; }
.up-cell.lvl-0 { background: var(--ok-bg); }
.up-cell.lvl-1 { background: var(--o1); color: var(--o1-text); }
.up-cell.lvl-2 { background: var(--o2); color: var(--o2-text); }
.up-cell.lvl-3 { background: var(--o3); color: var(--o3-text); }
.up-cell.none { background: repeating-linear-gradient(45deg, var(--surface-2) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--line); }
.up-cell.today { box-shadow: inset 0 -3px 0 var(--text); }
.up-cell.ongoing { box-shadow: 0 0 0 2px var(--text); }
.up-days { margin: var(--s-1) 0 var(--s-3); color: var(--muted); font-size: .75rem; }
.up-days span { white-space: nowrap; display: flex; justify-content: center; }
.up-days .today { color: var(--text); font-weight: 700; justify-content: flex-end; }
.up-legend { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); margin: 0 0 var(--s-3); font-size: .85rem; color: var(--muted); }
.up-legend .up-cell { display: inline-flex; width: 16px; height: 16px; margin-right: 2px; vertical-align: -3px; font-size: .55rem; }
.up-list { margin-bottom: var(--s-2); }
@media (max-width: 600px) { .up-cell { height: 28px; font-size: .55rem; } .uptime-num { font-size: 2.2rem; } }

/* Backups: one bar per kept backup, oldest to newest, one scale from zero. Blue = normal; orange + ⚠ = under 70% of the one before. */
.bk-strip-wrap { margin: var(--s-3) 0 var(--s-4); }
.bk-drop { margin: 0 0 var(--s-3); }
.bk-strip, .bk-days { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; max-width: 560px; }
.bk-strip { align-items: end; height: 140px; padding: var(--s-2) var(--s-2) 0; background: var(--well); border-bottom: 2px solid var(--stone); }
.bk-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-width: 0; }
.bk-bar { width: min(100%, 24px); background: var(--info); border-radius: 4px 4px 0 0; }
.bk-col.drop .bk-bar { background: var(--danger); }
.bk-col.newest .bk-bar { box-shadow: 0 0 0 2px var(--text); }
.bk-val { font-size: .7rem; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; margin-bottom: 2px; }
.bk-flag { font-family: system-ui, sans-serif; font-size: .75rem; line-height: 1; margin-bottom: 2px; }
.bk-days { margin-top: var(--s-1); padding: 0 var(--s-2); color: var(--muted); font-size: .75rem; }
.bk-days span { display: flex; justify-content: center; white-space: nowrap; }
.bk-days .newest { color: var(--text); font-weight: 700; justify-content: flex-end; }
.bk-note { margin: var(--s-2) 0 0; font-size: .85rem; }
/* one address's strip: ✖ under the day it was blocked */
.tries-days .blocked { color: var(--text); font-weight: 700; font-family: system-ui, sans-serif; }
.tries-col.blocked { box-shadow: inset 0 -3px 0 var(--text); }
.tries-legend .sw.blocked { background: none; width: auto; height: auto; color: var(--text); font-style: normal; font-family: system-ui, sans-serif; }

/* History: day headings and the All / Problems only switch (▸ + aria-current mark the selected one, not colour alone) */
.day-head { margin: var(--s-5) 0 var(--s-1); color: var(--text); }
.seg { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0 0 var(--s-3); }
.seg a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s-4); background: var(--surface-2);
  color: var(--text); text-decoration: none; box-shadow: var(--block); }
.seg a[aria-current="page"] { background: var(--btn-bg); font-weight: 700; box-shadow: var(--pressed); }

/* -- home health row (health.py) ---------------------------------------------
   Glyph + word carry the state; the left bar and glyph colour only reinforce it
   (blue = ok, amber = needs a look, orange = down, stone = not tracked). */
.health-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); }
.health-head h2 { margin: 0; }
.health-verdict { margin: 0; }
.health-verdict .badge { font-size: .72rem; }
.health-tiles { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); }
.health-tile { --tone: var(--stone); display: grid; gap: var(--s-1); min-height: 44px; height: 100%; box-sizing: border-box;
  padding: var(--s-4) var(--s-4) var(--s-4) calc(var(--s-4) + 6px); color: var(--text); text-decoration: none;
  background: var(--surface-2); box-shadow: var(--block), inset 6px 0 0 var(--tone); }
.health-tile:hover { background: var(--slot-hi); }
.health-tile.is-ok { --tone: var(--ok-bg); } .health-tile.is-warn { --tone: var(--warn); } .health-tile.is-down { --tone: var(--danger); }
.ht-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--s-1) var(--s-2); }
.ht-label { color: var(--muted); font-size: .9rem; }
.ht-state { font-weight: 700; font-size: .9rem; white-space: nowrap; }
.ht-glyph { color: var(--tone); font-family: system-ui, sans-serif; }
.health-tile.is-ok .ht-glyph { color: var(--info); }
.ht-value { font-family: "Pixel", ui-monospace, monospace; font-size: 1.35rem; line-height: 1.5; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ht-note { color: var(--muted); font-size: .85rem; }
@media (max-width: 640px) {
  .health-tiles { grid-template-columns: 1fr; gap: var(--s-2); }
  .health-tile { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding-block: var(--s-3); }
  .ht-top { grid-column: 1; flex-direction: column; align-items: flex-start; }
  .ht-value { grid-column: 2; grid-row: 1 / span 2; font-size: 1.05rem; text-align: right; }
  .ht-note { grid-column: 1; }
}

/* Community: milestone bands, credit by source (28 stacked columns), top contributors.
   Source colours are a validated categorical set (dataviz, dark surface #1c2433, all checks pass);
   colour follows the source, and every value is also in the tooltip and the table. */
:root { --src-share: #3987e5; --src-objective: #d95926; --src-achievement: #199e70; --src-event: #c98500;
        --src-donation: #d55181; --src-other: var(--stone); --cm: var(--leaf); --cm-track: var(--leaf-track); }
.cm-band-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); }
.cm-band-head h2 { margin: 0; }
.cm-desc { margin: var(--s-2) 0 0; }
.cm-nums { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-2) var(--s-4); margin: var(--s-3) 0 var(--s-2); }
.cm-hero { font-size: 2.6rem; font-weight: 800; line-height: 1; letter-spacing: -.01em; }
.cm-of, .cm-left { color: var(--muted); } .cm-of b, .cm-left b { color: var(--text); }
.cm-track { position: relative; display: block; height: 16px; background: var(--cm-track); }
.cm-track.small { height: 12px; }
.cm-fill { position: absolute; inset: 0 auto 0 0; background: var(--cm); border-radius: 0 4px 4px 0; }
.cm-band:hover .cm-track, .eco-row:hover .cm-track { background: rgba(87, 173, 53, .26); }
.cm-checks { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: var(--s-3) 0 0; padding: 0; }
.cm-checks li { margin: 0; }
.cm-checks .ok > span[aria-hidden] { color: var(--grass); } .cm-checks .no > span[aria-hidden] { color: var(--bad); }
.cm-proj { margin: var(--s-2) 0 0; } .cm-opened { margin: var(--s-3) 0 0; }
.cm-sum { margin: var(--s-2) 0 var(--s-3); }
.cm-legend { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); margin: 0 0 var(--s-2); font-size: .9rem; }
.cm-legend span { display: inline-flex; align-items: center; gap: var(--s-1); }
.cm-key { display: inline-block; width: 12px; height: 12px; border-radius: 2px; background: var(--k); }
.cm-chart { display: block; width: 100%; height: 200px; }
@media (max-width: 640px) { .cm-chart { height: 150px; } }
.cm-chart .cm-grid, .cm-chart .cm-base { stroke: var(--line); stroke-width: 1; }
.cm-day { fill: transparent; outline: none; }
.cm-day:hover, .cm-day:focus-visible { fill: rgba(255, 255, 255, .06); }
.cm-day:focus-visible { stroke: var(--text); stroke-width: 1; }
.src-share { --k: var(--src-share); fill: var(--src-share); } .src-objective { --k: var(--src-objective); fill: var(--src-objective); }
.src-achievement { --k: var(--src-achievement); fill: var(--src-achievement); } .src-event { --k: var(--src-event); fill: var(--src-event); }
.src-donation { --k: var(--src-donation); fill: var(--src-donation); } .src-other { --k: var(--src-other); fill: var(--src-other); }
.cm-axis { display: grid; grid-template-columns: repeat(28, minmax(0, 1fr)); margin: var(--s-1) 0 0; color: var(--muted); font-size: .75rem; }
.cm-axis span { white-space: nowrap; display: flex; justify-content: center; overflow: visible; }
.cm-axis span:last-child { justify-content: flex-end; }
.cm-axis .today { color: var(--text); font-weight: 700; }
.cm-scale { margin: 0 0 var(--s-1); font-size: .75rem; text-align: right; }
.cm-rank { display: inline-block; min-width: 1.8em; font-variant-numeric: tabular-nums; }
.cm-cmds { list-style: none; margin: var(--s-2) 0 0; padding: 0; display: grid; gap: var(--s-2); }
.cm-cmds code { overflow-wrap: anywhere; }
.cm-cmds .muted { display: block; font-size: .85rem; }
.cm-change { display: block; white-space: nowrap; }

/* Announcements (player portal) */
.ann-form { display: grid; gap: var(--s-2); }
.ann-form label { display: grid; gap: var(--s-1); }
.ann-form textarea { width: 100%; font: inherit; }
.ann-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
.ann { background: var(--surface-2); padding: var(--s-2) var(--s-3); box-shadow: var(--block); }
.ann-head { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.ann-head form { margin-left: auto; }
.ann-title { overflow-wrap: anywhere; min-width: 0; }
.ann-body { white-space: pre-line; overflow-wrap: anywhere; }
/* Players: profile text waiting for review */
.bio-review { margin-bottom: var(--s-4); }
.bio-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); }
.bio-item { display: grid; gap: var(--s-2); padding: var(--s-2) var(--s-3); background: var(--surface-2); box-shadow: var(--block); }
.bio-item p { margin: 0; }
.bio-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.bio-item .actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.bio-item form { margin: 0; }
