feat(admin): region page redesign, resource ledger, drip and dark mode
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 4s
Foundation / checks (network) (push) Successful in 5s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (tsan) (push) Successful in 5s
Foundation / checks (deploy) (push) Successful in 4m40s
Foundation / postgres-tools (push) Successful in 30s
Foundation / server-image (push) Successful in 4m46s
Foundation / image (push) Successful in 5m34s

The region view adds the rules-13 drip and complete counts and totals over every
life and deposit. The region page is rebuilt around the map: a KPI strip (tick
pace, population, deposit capacity, region energy and matter, spent pool, next
drip), layer toggles that double as the legend, zoom and a scale, and tabs for
inspecting cells and deposits, resources (where each channel sits, the spent pool
and each channel's next drip), actions, the running tuning and session access.
The admin API serves the region tuning file read only (--region-tuning). Light
and dark themes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-28 07:54:28 -04:00
co-authored by Claude Opus 5.5
parent 68f2567253
commit 6338cc9142
13 changed files with 1595 additions and 480 deletions
+15 -2
View File
@@ -3,11 +3,13 @@
// evo-admin-api --listen ADDRESS:PORT --world N --jwks JSON --oidc-issuer URL
// --audience NAME --client NAME --role NAME --assets DIR
// --pg-passfile F --pg-service F [--region REGION=HOST:PORT ...] [--baseline-tuning F]
// [--region-tuning F]
//
// --assets holds the portal's index.html, app.js and style.css. Each --region names a
// region's operations address, whose /admin/view the portal may show; those regions adopt
// tuning revisions. --baseline-tuning is the revamp tuning file they opened with, shown
// until the first revision. No token is printed.
// until the first revision; --region-tuning the region tuning file they start with, shown
// read only. No token is printed.
#include "evo/persistence/postgres.hpp"
#include "evo/server/admin/admin_api.hpp"
@@ -35,7 +37,8 @@ void on_stop(int) {
}
struct Options {
std::string listen, jwks, oidc_issuer, audience, client, role, assets, baseline_tuning;
std::string listen, jwks, oidc_issuer, audience, client, role, assets, baseline_tuning,
region_tuning;
std::uint64_t world{};
std::map<std::uint64_t, std::string> regions; // Region to its operations address.
persistence::PgOptions pg;
@@ -74,6 +77,8 @@ std::optional<Options> parse(int argc, char** argv) {
o.assets = value;
else if (flag == "--baseline-tuning")
o.baseline_tuning = value;
else if (flag == "--region-tuning")
o.region_tuning = value;
else if (flag == "--pg-service")
pg_service = value;
else if (flag == "--pg-passfile")
@@ -169,6 +174,14 @@ int main(int argc, char** argv) {
}
config.baseline_tuning = std::move(*baseline);
}
if (!options->region_tuning.empty()) {
auto region = read_file(options->region_tuning);
if (!region) {
std::puts("error region-tuning");
return 2;
}
config.region_tuning = std::move(*region);
}
config.portal_config_json = "{\"issuer\":\"" + options->oidc_issuer + "\",\"client_id\":\"" +
options->client + "\",\"world\":" + std::to_string(options->world) +
"}\n";
File diff suppressed because it is too large Load Diff
+7 -1
View File
@@ -20,7 +20,13 @@
</div>
</nav>
<div class="who">
<span id="who" class="muted"></span>
<span id="env" class="env" hidden></span>
<div class="theme-switch" role="group" aria-label="Theme">
<button type="button" data-theme-choice="system" title="Follow the system">Auto</button>
<button type="button" data-theme-choice="light" title="Light">☀</button>
<button type="button" data-theme-choice="dark" title="Dark">☾</button>
</div>
<span id="who" class="muted small"></span>
<button id="sign-out" class="ghost" hidden>Sign out</button>
</div>
</header>
+505 -131
View File
@@ -1,217 +1,591 @@
/* ADR-0182 admin portal. Tokens first; dark is the default, light follows the system. */
/* ADR-0182 admin portal. Tokens first: light by default, dark from the system or the header's
theme switch (html[data-theme]). The region map reads the map tokens when it paints. */
:root {
--bg: #0f1419;
--panel: #161d24;
--panel-2: #1c252e;
--line: #2a3640;
--text: #dbe3ea;
--muted: #8a99a6;
--accent: #4fb3ff;
--good: #3ecf8e;
--warn: #f2b84b;
--bad: #ff6b6b;
--player: #4f8dff;
--online: #5ff2ff;
--wildlife: #3ecf8e;
--pool: rgba(120, 170, 255, 0.16);
--energy: #ffd84d;
--carbon: #b0b7bf;
--nitrogen: #9b7bff;
--phosphorus: #ff9a3c;
--other: #ff6fb5;
--radius: 8px;
--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
color-scheme: dark;
--bg: #f3f5f8;
--panel: #ffffff;
--panel-2: #f6f8fa;
--panel-3: #eef1f5;
--line: #e1e6ec;
--line-strong: #cfd6de;
--text: #17202a;
--muted: #5f6c79;
--faint: #8b96a2;
--accent: #2563eb;
--accent-soft: rgba(37, 99, 235, 0.1);
--on-accent: #ffffff;
--good: #15925f;
--good-soft: rgba(21, 146, 95, 0.1);
--warn: #b7791f;
--warn-soft: rgba(183, 121, 31, 0.12);
--bad: #d64545;
--bad-soft: rgba(214, 69, 69, 0.1);
--shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 3px rgba(16, 24, 40, 0.06);
--shadow-pop: 0 8px 24px rgba(16, 24, 40, 0.14);
/* Region map. */
--map-bg: #fbfcfd;
--map-grid: rgba(23, 32, 42, 0.05);
--map-edge: #cfd6de;
--map-glass: rgba(255, 255, 255, 0.86);
--player: #2f6fed;
--online: #06b6d4;
--wildlife: #16a34a;
--pool: rgba(37, 99, 235, 0.1);
--pool-edge: rgba(37, 99, 235, 0.45);
--patch: rgba(120, 90, 40, 0.14);
--select: #f59e0b;
--energy: #eab308;
--carbon: #4b5563;
--nitrogen: #8b5cf6;
--phosphorus: #f97316;
--other: #ec4899;
--radius: 10px;
--radius-sm: 7px;
--mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Menlo, Consolas, monospace;
color-scheme: light;
}
@media (prefers-color-scheme: light) {
:root {
--bg: #f5f7f9;
--panel: #ffffff;
--panel-2: #eef2f5;
--line: #d6dde3;
--text: #18212a;
--muted: #5d6b77;
--accent: #0b6bcb;
--pool: rgba(30, 90, 200, 0.12);
--carbon: #59626b;
color-scheme: light;
@media (prefers-color-scheme: dark) {
:root:not([data-theme="light"]) {
--bg: #0b0f14;
--panel: #121820;
--panel-2: #161e27;
--panel-3: #1c2531;
--line: #232d3a;
--line-strong: #2f3b4b;
--text: #e4eaf0;
--muted: #8d9aa8;
--faint: #64717f;
--accent: #5b9dff;
--accent-soft: rgba(91, 157, 255, 0.14);
--on-accent: #06101f;
--good: #3ecf8e;
--good-soft: rgba(62, 207, 142, 0.12);
--warn: #f2b84b;
--warn-soft: rgba(242, 184, 75, 0.13);
--bad: #ff6b6b;
--bad-soft: rgba(255, 107, 107, 0.12);
--shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
--shadow-pop: 0 10px 30px rgba(0, 0, 0, 0.55);
--map-bg: #070b10;
--map-grid: rgba(140, 170, 200, 0.06);
--map-edge: #2a3646;
--map-glass: rgba(18, 24, 32, 0.86);
--player: #5b9dff;
--online: #5ff2ff;
--wildlife: #3ecf8e;
--pool: rgba(91, 157, 255, 0.12);
--pool-edge: rgba(91, 157, 255, 0.5);
--patch: rgba(200, 160, 90, 0.14);
--select: #ffd166;
--energy: #ffd84d;
--carbon: #a3adb8;
--nitrogen: #a78bfa;
--phosphorus: #ff9a3c;
--other: #ff6fb5;
color-scheme: dark;
}
}
:root[data-theme="dark"] {
--bg: #0b0f14;
--panel: #121820;
--panel-2: #161e27;
--panel-3: #1c2531;
--line: #232d3a;
--line-strong: #2f3b4b;
--text: #e4eaf0;
--muted: #8d9aa8;
--faint: #64717f;
--accent: #5b9dff;
--accent-soft: rgba(91, 157, 255, 0.14);
--on-accent: #06101f;
--good: #3ecf8e;
--good-soft: rgba(62, 207, 142, 0.12);
--warn: #f2b84b;
--warn-soft: rgba(242, 184, 75, 0.13);
--bad: #ff6b6b;
--bad-soft: rgba(255, 107, 107, 0.12);
--shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
--shadow-pop: 0 10px 30px rgba(0, 0, 0, 0.55);
--map-bg: #070b10;
--map-grid: rgba(140, 170, 200, 0.06);
--map-edge: #2a3646;
--map-glass: rgba(18, 24, 32, 0.86);
--player: #5b9dff;
--online: #5ff2ff;
--wildlife: #3ecf8e;
--pool: rgba(91, 157, 255, 0.12);
--pool-edge: rgba(91, 157, 255, 0.5);
--patch: rgba(200, 160, 90, 0.14);
--select: #ffd166;
--energy: #ffd84d;
--carbon: #a3adb8;
--nitrogen: #a78bfa;
--phosphorus: #ff9a3c;
--other: #ff6fb5;
color-scheme: dark;
}
/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
background: var(--bg);
color: var(--text);
font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
-webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; margin: 0; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; }
h3 { font-size: 13px; font-weight: 600; margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.error { color: var(--bad); }
.good { color: var(--good); }
.small { font-size: 12px; }
.center { display: grid; place-items: center; min-height: 55vh; text-align: center; }
.center h1 { margin-bottom: 6px; }
.center .muted { margin-bottom: 18px; }
button {
font: inherit;
font-weight: 500;
color: var(--text);
background: var(--panel-2);
border: 1px solid var(--line);
border-radius: 6px;
padding: 5px 12px;
background: var(--panel);
border: 1px solid var(--line-strong);
border-radius: var(--radius-sm);
padding: 6px 13px;
cursor: pointer;
transition: background 0.12s, border-color 0.12s, color 0.12s;
white-space: nowrap;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.ghost { background: transparent; }
button:hover { border-color: var(--accent); color: var(--accent); }
button:disabled { opacity: 0.5; cursor: default; }
button:disabled:hover { border-color: var(--line-strong); color: var(--text); }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.primary:hover { filter: brightness(1.08); color: var(--on-accent); }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); }
button.ghost:hover { background: var(--panel-3); color: var(--text); }
button.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
button.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
button.icon { padding: 5px 9px; line-height: 1; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="search"], input[type="text"], input[type="number"], select {
font: inherit;
color: var(--text);
background: var(--panel);
border: 1px solid var(--line);
border-radius: 6px;
padding: 5px 10px;
min-width: 240px;
border: 1px solid var(--line-strong);
border-radius: var(--radius-sm);
padding: 6px 10px;
min-width: 0;
}
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12.5px; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type="search"] { width: 280px; }
input[type="checkbox"] { accent-color: var(--accent); }
/* ---------- Top bar ---------- */
.bar {
display: flex;
align-items: center;
gap: 24px;
padding: 10px 20px;
background: var(--panel);
gap: 28px;
height: 56px;
padding: 0 22px;
background: color-mix(in srgb, var(--panel) 88%, transparent);
backdrop-filter: saturate(1.4) blur(10px);
border-bottom: 1px solid var(--line);
position: sticky;
top: 0;
z-index: 2;
z-index: 10;
}
.brand { font-weight: 700; color: var(--text); letter-spacing: 0.02em; }
.brand span { color: var(--accent); font-weight: 500; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 700; color: var(--text); letter-spacing: 0.01em; }
.brand:hover { text-decoration: none; }
.brand::before {
content: "";
width: 18px;
height: 18px;
border-radius: 50%;
background: radial-gradient(circle at 35% 35%, var(--online), var(--player) 55%, var(--wildlife));
box-shadow: 0 0 12px color-mix(in srgb, var(--online) 45%, transparent);
}
.brand span { color: var(--muted); font-weight: 500; }
.sections { display: flex; gap: 20px; flex: 1; }
.section { display: flex; align-items: center; gap: 4px; }
.section { display: flex; align-items: center; gap: 2px; }
.section-name {
text-transform: uppercase;
font-size: 11px;
letter-spacing: 0.08em;
color: var(--muted);
margin-right: 6px;
font-size: 10.5px;
font-weight: 600;
letter-spacing: 0.1em;
color: var(--faint);
margin-right: 10px;
}
.section a { padding: 5px 10px; border-radius: 6px; color: var(--text); }
.section a.active { background: var(--panel-2); color: var(--accent); }
.who { display: flex; align-items: center; gap: 10px; }
.section a { padding: 6px 12px; border-radius: var(--radius-sm); color: var(--muted); font-weight: 500; }
.section a:hover { color: var(--text); background: var(--panel-3); text-decoration: none; }
.section a.active { background: var(--accent-soft); color: var(--accent); }
.who { display: flex; align-items: center; gap: 12px; }
.env {
font-size: 11px;
font-weight: 600;
letter-spacing: 0.06em;
text-transform: uppercase;
color: var(--warn);
background: var(--warn-soft);
border-radius: 999px;
padding: 2px 9px;
}
.theme-switch { display: flex; background: var(--panel-3); border-radius: 999px; padding: 2px; }
.theme-switch button {
border: 0;
background: transparent;
color: var(--muted);
border-radius: 999px;
padding: 3px 9px;
font-size: 13px;
line-height: 1.3;
}
.theme-switch button:hover { color: var(--text); }
.theme-switch button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
main { padding: 20px; max-width: 1600px; margin: 0 auto; }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 15px; margin: 20px 0 8px; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
/* ---------- Page ---------- */
main { padding: 22px 24px 40px; max-width: 1760px; margin: 0 auto; }
main:focus { outline: none; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.head .crumb { display: inline-block; font-size: 12.5px; margin-bottom: 4px; color: var(--muted); }
.head .crumb:hover { color: var(--accent); }
.title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.subtitle { color: var(--muted); margin-top: 3px; }
.card {
background: var(--panel);
border: 1px solid var(--line);
border-radius: var(--radius);
padding: 14px 16px;
padding: 16px 18px;
box-shadow: var(--shadow);
}
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.stat .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.stat .value { font-size: 18px; font-weight: 600; margin-top: 2px; }
.stat .value small { font-size: 12px; font-weight: 400; color: var(--muted); }
.card + .card { margin-top: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.stats, .kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat, .kpi {
background: var(--panel);
border: 1px solid var(--line);
border-radius: var(--radius);
padding: 12px 14px;
box-shadow: var(--shadow);
min-width: 0;
}
.stat .label, .kpi .label {
font-size: 11px;
font-weight: 600;
text-transform: uppercase;
letter-spacing: 0.07em;
color: var(--muted);
display: flex;
align-items: center;
gap: 6px;
}
.stat .value, .kpi .value { font-size: 21px; font-weight: 650; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .value small { font-size: 12px; font-weight: 400; color: var(--muted); }
.kpi .sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.warn { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
.kpi.warn .value { color: var(--warn); }
.kpi.bad { border-color: color-mix(in srgb, var(--bad) 55%, var(--line)); }
.kpi.bad .value { color: var(--bad); }
.kpi .meter { margin-top: 8px; }
.meter { height: 5px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.meter.warn > span { background: var(--warn); }
.meter.bad > span { background: var(--bad); }
.meter.smooth > span { transition: width 0.25s linear; }
/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--panel); }
table { border-collapse: collapse; width: 100%; background: var(--panel); }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--panel-2); cursor: pointer; user-select: none; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--panel-2); cursor: pointer; user-select: none; }
th.sorted { color: var(--text); }
th.sorted::after { content: " ▾"; }
th.sorted.up::after { content: " ▴"; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:hover { background: var(--panel-2); }
tbody tr.clickable { cursor: pointer; }
table.compact { font-size: 12.5px; background: transparent; }
table.compact td { padding: 6px 4px; white-space: normal; vertical-align: top; }
table.compact tr:hover { background: transparent; }
.badge {
display: inline-block;
display: inline-flex;
align-items: center;
gap: 5px;
font-size: 11.5px;
padding: 1px 8px;
font-weight: 500;
padding: 1px 9px;
border-radius: 999px;
border: 1px solid var(--line);
background: var(--panel-3);
color: var(--muted);
white-space: nowrap;
}
.badge.alive { color: var(--good); border-color: var(--good); }
.badge.dead { color: var(--bad); border-color: var(--bad); }
.badge.online { color: var(--online); border-color: var(--online); }
.badge.warn { color: var(--warn); border-color: var(--warn); }
.badge.alive { color: var(--good); background: var(--good-soft); }
.badge.dead { color: var(--bad); background: var(--bad-soft); }
.badge.online { color: var(--accent); background: var(--accent-soft); }
.badge.warn { color: var(--warn); background: var(--warn-soft); }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge .dot.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 7px 18px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
dl.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.window-controls { display: flex; gap: 8px; margin: 12px 0 8px; flex-wrap: wrap; }
.region-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; }
@media (max-width: 1000px) { .region-layout { grid-template-columns: 1fr; } }
.canvas-wrap {
position: relative;
background: var(--panel);
/* ---------- Region page ---------- */
.region-grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(420px, 30vw, 560px); gap: 16px; align-items: start; }
@media (max-width: 1150px) { .region-grid { grid-template-columns: 1fr; } }
.map-card {
display: flex;
flex-direction: column;
height: max(560px, calc(100vh - 250px));
border: 1px solid var(--line);
border-radius: var(--radius);
background: var(--panel);
overflow: hidden;
aspect-ratio: 1 / 1;
max-height: calc(100vh - 230px);
width: 100%;
box-shadow: var(--shadow);
}
.map-toolbar { display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.map-stage { position: relative; flex: 1; min-height: 0; background: var(--map-bg); }
.map-stage canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
.map-stage canvas.dragging { cursor: grabbing; }
.glass {
background: var(--map-glass);
backdrop-filter: blur(8px);
border: 1px solid var(--line);
border-radius: var(--radius-sm);
box-shadow: var(--shadow);
}
.map-layers { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
display: inline-flex;
background: var(--panel-2);
border: 1px solid var(--line);
align-items: center;
gap: 7px;
font-size: 12.5px;
font-weight: 500;
padding: 4px 10px 4px 8px;
border-radius: 999px;
color: var(--text);
cursor: pointer;
user-select: none;
}
.chip .count { color: var(--muted); font-variant-numeric: tabular-nums; }
.chip.off { opacity: 0.45; }
.chip.off .swatch { background: transparent !important; }
.chip:hover { border-color: var(--accent); }
.map-zoom { display: flex; overflow: hidden; flex: none; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); }
.map-zoom button { border: 0; border-radius: 0; background: transparent; padding: 5px 11px; font-size: 15px; line-height: 1.2; }
.map-zoom button + button { border-left: 1px solid var(--line); }
.map-zoom button:hover { background: var(--panel-3); }
.map-foot { position: absolute; left: 12px; right: 12px; bottom: 10px; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; pointer-events: none; }
.map-hint { font-size: 12px; color: var(--muted); padding: 3px 9px; }
.scale { font-size: 11.5px; color: var(--muted); padding: 4px 9px 3px; text-align: center; }
.scale .rule { height: 6px; border: 1.5px solid var(--muted); border-top: 0; margin-top: 2px; }
.map-banner {
position: absolute;
left: 50%;
top: 12px;
transform: translateX(-50%);
padding: 6px 14px;
font-size: 12.5px;
color: var(--warn);
border-color: color-mix(in srgb, var(--warn) 50%, var(--line));
}
.canvas-wrap canvas { display: block; width: 100%; height: 100%; cursor: crosshair; }
.overlay-note { position: absolute; left: 10px; bottom: 8px; font-size: 12px; color: var(--muted); pointer-events: none; }
.tooltip {
position: absolute;
pointer-events: none;
background: var(--panel-2);
border: 1px solid var(--line);
border-radius: 6px;
padding: 6px 8px;
padding: 8px 10px;
font-size: 12px;
max-width: 280px;
z-index: 1;
min-width: 170px;
max-width: 290px;
z-index: 3;
box-shadow: var(--shadow-pop);
}
.side { display: flex; flex-direction: column; gap: 12px; }
.legend { display: grid; grid-template-columns: 14px 1fr; gap: 6px 8px; align-items: center; font-size: 13px; }
.swatch { width: 12px; height: 12px; border-radius: 50%; }
.tooltip .tip-title { font-weight: 600; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.tooltip .tip-row { display: flex; justify-content: space-between; gap: 14px; }
.tooltip .tip-row span:first-child { color: var(--muted); }
.swatch { width: 10px; height: 10px; border-radius: 50%; flex: none; display: inline-block; }
.swatch.player { background: var(--player); }
.swatch.online { background: var(--online); }
.swatch.wildlife { background: var(--wildlife); }
.swatch.pool { background: var(--pool); border: 1px solid var(--accent); }
.swatch.pool { background: var(--pool); border: 1.5px solid var(--pool-edge); }
.swatch.patch { background: var(--patch); border: 1.5px solid var(--faint); border-radius: 2px; }
.swatch.energy { background: var(--energy); }
.swatch.carbon { background: var(--carbon); }
.swatch.nitrogen { background: var(--nitrogen); }
.swatch.phosphorus { background: var(--phosphorus); }
.swatch.other { background: var(--other); }
.toggles { display: flex; flex-direction: column; gap: 6px; }
.toggles label { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.error { color: var(--bad); }
.good { color: var(--good); }
.center { display: grid; place-items: center; min-height: 50vh; text-align: center; }
.window-controls { display: flex; gap: 8px; margin: 10px 0 8px; flex-wrap: wrap; }
.side input[type="text"] { width: 100%; min-width: 0; }
.small { font-size: 12px; margin-top: 6px; }
table.compact { margin-top: 10px; font-size: 12.5px; background: transparent; }
table.compact td { padding: 4px 6px; white-space: normal; }
button:disabled { opacity: 0.5; cursor: default; }
.action { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 10px; }
.action .row { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.amounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; margin-top: 6px; }
input.amount, input.count { min-width: 0; width: 100%; }
input.count { width: 80px; }
button.danger { color: var(--bad); border-color: var(--bad); }
.tuning-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 14px; }
@media (max-width: 1000px) { .tuning-layout { grid-template-columns: 1fr; } }
/* Side panel with tabs. */
.panel {
position: sticky;
top: 72px;
max-height: calc(100vh - 88px);
display: flex;
flex-direction: column;
background: var(--panel);
border: 1px solid var(--line);
border-radius: var(--radius);
box-shadow: var(--shadow);
overflow: hidden;
}
@media (max-width: 1150px) { .panel { position: static; max-height: none; } }
.tabs { flex: none; display: flex; gap: 2px; padding: 8px 8px 0; border-bottom: 1px solid var(--line); background: var(--panel-2); overflow-x: auto; }
.tabs button {
border: 0;
border-radius: var(--radius-sm) var(--radius-sm) 0 0;
background: transparent;
color: var(--muted);
padding: 8px 12px 9px;
font-size: 13px;
border-bottom: 2px solid transparent;
margin-bottom: -1px;
}
.tabs button:hover { color: var(--text); background: transparent; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); background: var(--panel); }
.tabs .tab-badge { margin-left: 6px; font-size: 10.5px; padding: 0 6px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
.panel-body { overflow-y: auto; padding: 4px 18px 18px; flex: 1; }
.block { padding: 16px 0; border-bottom: 1px solid var(--line); }
.block:last-child { border-bottom: 0; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.block-head .muted { font-size: 12px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 0 0 10px; }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }
.empty .big { font-size: 26px; margin-bottom: 6px; opacity: 0.6; }
/* Forms. */
.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.field label { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.field input, .field select { width: 100%; }
.form-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin-top: 10px; }
.form-row .grow { flex: 1; min-width: 120px; }
.form-row input.count { width: 84px; }
input.wide, .wide { width: 100%; }
.note { font-size: 12.5px; margin-top: 8px; min-height: 0; }
.note:empty { display: none; }
.segmented { display: inline-flex; background: var(--panel-3); border-radius: var(--radius-sm); padding: 2px; gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; color: var(--muted); padding: 4px 10px; font-size: 12.5px; border-radius: 5px; }
.segmented button.on { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
/* Resource ledger. */
table.ledger { font-size: 12.5px; background: transparent; }
table.ledger th { background: transparent; cursor: default; padding: 6px 6px; font-size: 10.5px; }
table.ledger td { padding: 6px 6px; }
table.ledger td:first-child, table.ledger th:first-child { padding-left: 0; }
table.ledger td:last-child, table.ledger th:last-child { padding-right: 0; }
table.ledger tr.total td { font-weight: 650; border-top: 1px solid var(--line-strong); }
table.ledger tr:hover { background: transparent; }
table.ledger th .swatch { margin-right: 4px; vertical-align: -1px; width: 8px; height: 8px; }
.split { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--panel-3); }
.split > span { display: block; height: 100%; }
.split-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.split-legend span { display: inline-flex; align-items: center; gap: 5px; }
.split-row { display: grid; grid-template-columns: 80px 1fr; gap: 10px; align-items: center; margin-top: 8px; font-size: 12px; }
/* Spent pool and drip. */
.drip-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.drip-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.drip-count { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.channels { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 6px; margin-top: 10px; }
.channel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 8px; min-width: 0; }
.channel .name { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.channel .amt { font-weight: 600; font-variant-numeric: tabular-nums; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel .sub { font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel.empty-ch { opacity: 0.55; }
.callout {
display: flex;
gap: 10px;
padding: 10px 12px;
border-radius: var(--radius-sm);
font-size: 12.5px;
background: var(--warn-soft);
color: var(--text);
border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
margin-bottom: 12px;
}
.callout::before { content: "!"; flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--warn); color: var(--panel); font-weight: 700; display: grid; place-items: center; font-size: 12px; }
.callout.info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.callout.info::before { content: "i"; background: var(--accent); }
/* Lists in the panel. */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item.clickable { cursor: pointer; }
.list-item.clickable:hover .grow { color: var(--accent); }
.list-item .sub { color: var(--muted); font-size: 11.5px; }
/* Inspector. */
.inspect-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.inspect-head .swatch { width: 14px; height: 14px; }
.inspect-head h2 { margin: 0; }
.inspect-head .grow { flex: 1; }
/* Tuning settings. */
.settings-group { margin-top: 6px; }
.settings-group summary {
cursor: pointer;
list-style: none;
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 0;
font-weight: 600;
font-size: 12.5px;
text-transform: capitalize;
border-bottom: 1px solid var(--line);
}
.settings-group summary::-webkit-details-marker { display: none; }
.settings-group summary::before { content: "▸"; color: var(--faint); margin-right: 8px; transition: transform 0.15s; display: inline-block; }
.settings-group[open] summary::before { transform: rotate(90deg); }
.settings-group summary .label { flex: 1; }
.setting { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 6px 0 6px 16px; border-bottom: 1px dashed var(--line); font-size: 12.5px; }
.setting:last-child { border-bottom: 0; }
.setting .key { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.setting .val { font-family: var(--mono); font-size: 12px; font-weight: 600; text-align: right; }
.setting .why { grid-column: 1 / -1; color: var(--muted); font-size: 11.5px; }
.setting.changed .val { color: var(--accent); }
mark { background: var(--warn-soft); color: inherit; border-radius: 2px; }
/* ---------- Tuning editor ---------- */
.tuning-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .tuning-layout { grid-template-columns: 1fr; } }
.tuning-layout .side { display: flex; flex-direction: column; gap: 14px; }
.tuning-layout .side .card + .card { margin-top: 0; }
textarea.tuning {
display: block;
width: 100%;
min-height: 60vh;
box-sizing: border-box;
min-height: 62vh;
font-family: var(--mono);
font-size: 12.5px;
line-height: 1.5;
line-height: 1.55;
color: var(--text);
background: var(--panel-2);
border: 1px solid var(--line);
border-radius: 6px;
padding: 10px 12px;
border-radius: var(--radius-sm);
padding: 12px 14px;
resize: vertical;
tab-size: 4;
}
textarea.tuning:focus { outline: none; border-color: var(--accent); }
.card input[type="text"].wide { width: 100%; min-width: 0; box-sizing: border-box; }
textarea.tuning:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.action { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.action .row { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }