:root {
  --bg: #f6f7f9;
  --fg: #1d2127;
  --muted: #5b6470;
  --card: #ffffff;
  --border: #d9dde3;
  --accent: #2f6fdb;
  --danger: #c53b3b;
  --error-bg: #fdecec;
  --ok-bg: #eaf6ee;
  --ok: #2b8a4b;
  --warn: #c98a12;
  --warn-bg: #fdf3dd;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181c;
    --fg: #e4e7eb;
    --muted: #98a1ad;
    --card: #1e2227;
    --border: #333a42;
    --accent: #6b9ff0;
    --danger: #ef7676;
    --error-bg: #3a1f22;
    --ok-bg: #1d3326;
    --ok: #5cc27f;
    --warn: #e0a83a;
    --warn-bg: #3a2f17;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.5 system-ui, sans-serif; }
main { max-width: 42rem; margin: 0 auto; padding: 2rem 1rem; }
h1 { margin: 0 0 0.25rem; }
.lede, .hint, .who { color: var(--muted); }
a { color: var(--accent); }
pre { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 0.75rem; overflow-x: auto; }
.error { background: var(--error-bg); padding: 0.75rem; border-radius: 6px; }
.created { background: var(--ok-bg); border: 1px solid var(--ok); border-radius: 10px; padding: 0.5rem 1.25rem 1rem; margin-bottom: 1.5rem; }
.created h2 { display: flex; align-items: center; gap: 0.6rem; }
.tick { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--ok); color: var(--bg); font-size: 1rem; flex-shrink: 0; }
.token-row { display: flex; gap: 0.75rem; align-items: stretch; margin: 1rem 0; }
.token { flex: 1; min-width: 0; display: block; background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem 0.9rem; font: 1rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; user-select: all; }
button.copy { flex-shrink: 0; padding: 0.7rem 1.4rem; font-weight: 600; font-size: 1.05rem; min-width: 9rem; }
button.copy.copied { background: var(--ok); color: var(--bg); }
@media (max-width: 32rem) { .token-row { flex-direction: column; } button.copy { width: 100%; } }
ol.steps { padding-left: 1.25rem; }
ol.steps li { margin: 0.6rem 0; }
.button.big { padding: 0.55rem 1.1rem; font-weight: 600; }
.base { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 0.5rem 1rem; margin-bottom: 1rem; }
.base h3 { margin: 0.5rem 0; }
.status { font-size: 0.8rem; font-weight: normal; color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 0 0.5rem; }
details { margin: 0.5rem 0; }
form.create { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
form.inline { display: inline; }
fieldset.visibility { flex-basis: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 0.4rem 0.9rem 0.6rem; margin: 0; }
fieldset.visibility label { display: block; margin: 0.25rem 0; }
input { font: inherit; padding: 0.35rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; background: var(--card); color: var(--fg); }
button, .button { font: inherit; padding: 0.4rem 0.9rem; border: 0; border-radius: 6px; background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; display: inline-block; }
button.danger { background: var(--danger); }
button.link { background: none; color: var(--accent); padding: 0; text-decoration: underline; }

/* Control panel */
main.wide { max-width: 78rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 1rem; color: var(--muted); }
.crumbs .spacer { flex: 1; }
.page-head h1 { margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.page-head .hint { margin-top: 0.25rem; }
.notice { background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--accent); padding: 0.6rem 0.9rem; border-radius: 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.75rem; margin: 1rem 0; }
.tile { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem 0.9rem; display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.tile .label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.tile .value { font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile .value small { font-size: 1rem; color: var(--muted); font-weight: 400; }
.tile .sub { font-size: 0.85rem; color: var(--muted); overflow-wrap: anywhere; }
.tile.flagged, tr.flagged td:first-child { border-left: 4px solid var(--warn); }
meter { width: 100%; height: 0.6rem; }
td meter { width: 6rem; display: block; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: 8px; }
table.bases { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
table.bases th, table.bases td { padding: 0.5rem 0.7rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; white-space: nowrap; }
table.bases td:last-child { white-space: normal; min-width: 10rem; }
table.bases th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
table.bases tr:last-child td { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.badge { font-size: 0.8rem; font-weight: 500; border-radius: 999px; padding: 0.05rem 0.55rem; border: 1px solid var(--border); white-space: nowrap; }
.state-running { background: var(--ok-bg); }
.state-over-quota, .state-exited, .state-missing { background: var(--error-bg); }
.state-stopped-by-host { background: var(--warn-bg); }
.action-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 0.75rem; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.card h3 { margin: 0; }
.card .hint { margin: 0; font-size: 0.9rem; }
.card label { display: flex; flex-direction: column; gap: 0.25rem; }
.card button { align-self: flex-start; }
.danger-card { border-color: var(--danger); }
button.secondary { background: var(--card); color: var(--fg); border: 1px solid var(--border); }
pre.logs { max-height: 28rem; overflow: auto; font-size: 0.8rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.gamedata { margin: 1rem 0 1.5rem; }
.gamedata h2 { margin-bottom: 0.25rem; }
ul.versions { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }

/* Landing page */
button:hover, .button:hover { filter: brightness(1.1); }
.landing h1 { font-size: 2.2rem; line-height: 1.2; margin-top: 1rem; }
.landing .lede { font-size: 1.15rem; }
.landing ul { padding-left: 1.25rem; }
.landing li { margin: 0.35rem 0; }
.shot { margin: 1.5rem 0; }
.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 30px rgb(0 0 0 / 0.18); }
@media (min-width: 54rem) { .shot { margin-inline: -5rem; } }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1.25rem; align-items: center; }
.button.discord { background: #5865f2; display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.6rem 1.2rem; font-weight: 600; }
.button.discord svg { width: 1.3rem; height: 1.3rem; }
footer.site { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; margin-top: 2.5rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.9rem; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--accent); }
footer.site svg { width: 1em; height: 1em; vertical-align: -0.125em; margin-right: 0.35em; }
