/* 2bitServers "Bootseq" theme: CRT boot screen / terminal.
   Monospace everywhere, no border radius, one shadow (the CTA). */

:root {
  --bg-page: #050514;
  --bg: #0a0a23;
  --bg-panel: #000000;
  --line: #1f1f3a;
  --line-2: #2a2a4a;
  --fg: #e8e8ff;
  --fg-dim: #8a8aa8;
  --fg-mute: #6a6a88;
  --cyan: #00f0ff;
  --magenta: #ff2cdf;
  --violet: #9b5cff;
  --yellow: #ffe94a;
  --green: #9aff7a;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

/* Scrollbars: square, dark track, block thumb that lights up on hover. */
/* Standard properties for Firefox; Chromium ignores ::-webkit-scrollbar once they're set, so only there. */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-width: thin; scrollbar-color: var(--fg-mute) var(--bg-panel); }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-panel); }
::-webkit-scrollbar-thumb { background: var(--fg-mute); border: 2px solid var(--bg-panel); border-radius: 0; }
::-webkit-scrollbar-thumb:hover { background: var(--magenta); }
::-webkit-scrollbar-thumb:active { background: var(--cyan); }
::-webkit-scrollbar-corner { background: var(--bg-panel); }
.console::-webkit-scrollbar-track { border-left: 1px dashed var(--line); }

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* JetBrains Mono would merge "--" in modes like -rw-r--r-- */
  font-variant-ligatures: none;
}

a { color: var(--cyan); text-decoration: none; transition: color 120ms; }
a:hover { color: var(--magenta); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
::selection { background: var(--magenta); color: var(--bg); }

h1, h2, h3, h4 { font-weight: 700; margin: 0 0 12px; }
p { margin: 0 0 12px; }
code, pre { font-family: var(--mono); }
img.crisp { image-rendering: pixelated; image-rendering: crisp-edges; }

/* Colour helpers */
.c-cyan { color: var(--cyan); }
.c-magenta { color: var(--magenta); }
.c-violet { color: var(--violet); }
.c-yellow { color: var(--yellow); }
.c-green { color: var(--green); }
.c-dim { color: var(--fg-dim); }
.c-mute { color: var(--fg-mute); }
.c-line { color: var(--line); }

/* ---------- Site chrome ---------- */

.bios {
  display: flex;
  gap: 18px;
  padding: 8px 24px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--line);
  color: var(--fg-mute);
  font-size: 11px;
}
.bios .bios-time { margin-left: auto; }
.bios .bios-post { margin-left: 6px; color: var(--green); }

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 20px 32px;
  border-bottom: 1px dashed var(--line);
}
.nav-logo img { height: 44px; width: auto; display: block; }
.nav-links, .nav-user { display: flex; gap: 24px; font-size: 13px; align-items: center; flex-wrap: wrap; }
.nav-user { gap: 18px; }
.nav a { color: var(--fg-dim); }
.nav a:hover, .nav a.nav-strong { color: var(--cyan); }
.nav a.nav-strong:hover { color: var(--magenta); }
.nav .nav-credits { color: var(--fg-mute); }

.footer {
  display: flex;
  gap: 18px;
  padding: 20px 32px;
  background: var(--bg-panel);
  border-top: 1px solid var(--line);
  font-size: 12px;
  margin-top: 48px;
}
.footer .footer-ready { margin-left: auto; color: var(--green); }

.site { min-height: 100vh; display: flex; flex-direction: column; }
.site > main { flex: 1; }

/* ---------- Layout ---------- */

.wrap { max-width: 1100px; margin: 0 auto; padding: 32px; }
.wrap-narrow { max-width: 560px; }
.wrap-mid { max-width: 760px; }
.section { padding: 32px; max-width: 1100px; margin: 0 auto 32px; }

/* ┌─ ./section-title ──────────────┐ */
.term-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  overflow: hidden;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 400;
  color: var(--fg);
}
.term-title .tt-corner { color: var(--magenta); }
.term-title .tt-note { font-size: 12px; color: var(--fg-mute); }
.term-title .tt-note.ok { color: var(--green); }
.term-title .tt-note.bad { color: var(--magenta); }
.term-title .tt-rule {
  flex: 1;
  min-width: 24px;
  color: var(--magenta);
  overflow: hidden;
  display: flex;
}
.term-title .tt-rule::before {
  content: "────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────";
  flex: 1;
  overflow: hidden;
}
.term-title .tt-rule::after { content: "┐"; }

/* Black box that holds rows */
.panel { background: var(--bg-panel); border: 1px solid var(--line); }
.panel + .panel { border-top: none; }
.panel-pad { padding: 18px; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
  color: inherit;
}
.row:last-child { border-bottom: none; }

/* Key/value lists (account page etc.) */
.kv {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 18px;
  margin: 0;
  font-size: 13px;
}
.kv dt { color: var(--fg-mute); }
.kv dd { margin: 0; color: var(--fg); overflow-wrap: anywhere; }

.prompt::before { content: "> "; color: var(--cyan); }
.fineprint { color: var(--fg-mute); font-size: 12px; }
.mt-18 { margin-top: 18px; }
.mt-24 { margin-top: 24px; }
.muted { color: var(--fg-mute); }
.dim { color: var(--fg-dim); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-block;
  background: var(--cyan);
  color: var(--bg);
  border: none;
  padding: 12px 20px;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 4px 4px 0 var(--magenta);
  transition: transform 120ms, box-shadow 120ms;
  text-align: center;
}
.btn:hover { color: var(--bg); transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--magenta); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--magenta); }
.btn:disabled { background: var(--fg-mute); box-shadow: none; transform: none; cursor: default; }
.btn-lg { padding: 14px 22px; font-size: 14px; }
.btn-sm { padding: 7px 12px; font-size: 12px; box-shadow: 3px 3px 0 var(--magenta); }
.btn-sm:hover { box-shadow: 1px 1px 0 var(--magenta); }
.btn-block { display: block; width: 100%; }

.btn-ghost {
  background: transparent;
  color: var(--cyan);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn-ghost:hover { color: var(--magenta); border-color: var(--magenta); box-shadow: none; transform: none; }

.btn-ghost-danger { color: var(--magenta); }
.btn-ghost:disabled { background: transparent; color: var(--fg-mute); border-color: var(--line); }
.btn-danger { background: var(--magenta); box-shadow: 4px 4px 0 var(--violet); }
.btn-danger:hover { box-shadow: 2px 2px 0 var(--violet); }

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: var(--cyan);
  cursor: pointer;
}
.link-btn:hover { color: var(--magenta); }
.link-btn.danger { color: var(--magenta); }
.link-btn:disabled { color: var(--fg-mute); cursor: default; }

/* ---------- Forms ---------- */

.form { display: flex; flex-direction: column; gap: 16px; }
.form > .btn:not(.btn-block) { align-self: flex-start; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--fg-dim); }
.field-inline { flex-direction: row; align-items: center; gap: 10px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field .hint { color: var(--fg-mute); font-size: 11px; }
.field .hint-bad { color: var(--magenta); }

/* Configure page server type picker (islands/ServerTypePicker.tsx) */
label.type-option { cursor: pointer; align-items: flex-start; }
label.type-option:hover { background: var(--bg); }
label.type-option.picked { background: var(--bg); box-shadow: inset 2px 0 0 var(--cyan); }
label.type-option input[type="radio"] { accent-color: var(--cyan); margin-top: 3px; flex: none; }
.type-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

/* Configure page modpack picker (islands/ModpackPicker.tsx) */
.modpack-picker .tabs { margin-bottom: 0; }
.modpack-results { max-height: 420px; overflow-y: auto; }
button.modpack-row { width: 100%; background: none; border: none; border-bottom: 1px dashed var(--line); font: inherit; font-size: 13px; text-align: left; color: inherit; cursor: pointer; align-items: flex-start; }
button.modpack-row:hover, button.modpack-row:focus-visible { background: var(--bg); }
button.modpack-row:disabled { cursor: progress; }
.modpack-picked .modpack-row { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; }
.modpack-icon { width: 36px; height: 36px; flex: none; border: 1px solid var(--line); background: var(--bg); object-fit: cover; }
.modpack-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.modpack-summary { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.modpack-meta { font-size: 11px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="search"], input[type="datetime-local"], textarea, select {
  width: 100%;
  background: var(--bg-panel);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
}
input:focus, textarea:focus, select:focus { border-color: var(--cyan); outline: none; }
input[type="checkbox"] { accent-color: var(--cyan); width: 16px; height: 16px; }
textarea { min-height: 80px; resize: vertical; }
fieldset { border: 1px dashed var(--line); padding: 16px 18px; margin: 0; display: flex; flex-direction: column; gap: 14px; }
legend { color: var(--magenta); padding: 0 8px; font-size: 12px; }

/* ---------- Notices & status ---------- */

.notice { border: 1px solid var(--line); background: var(--bg-panel); padding: 10px 14px; margin: 12px 0; font-size: 13px; }
.notice::before { color: var(--fg-mute); }
.notice-error { border-color: var(--magenta); color: var(--magenta); }
.notice-error::before { content: "[ FAIL ] "; }
.notice-ok { border-color: var(--green); color: var(--green); }
.notice-ok::before { content: "[ OK ] "; }
.notice-info { color: var(--fg-dim); }
.notice-info::before { content: "[ .. ] "; }
.notice-warn { border-color: var(--yellow); color: var(--yellow); }
.notice-warn::before { content: "[ !! ] "; }
.verify-email-banner { margin-bottom: 24px; }
.verify-email-banner > p { display: inline; margin: 0; }
.verify-email-banner .resend-verification { margin-top: 10px; }
.resend-verification .notice { margin: 8px 0 0; }

.status::before { content: "● "; }
.status-active, .status-ready, .status-online, .status-running, .status-ws-connected { color: var(--green); }
.status-installing, .status-cancelled, .status-stopped, .status-pending, .status-restoring-backup, .status-restoring_backup, .status-maintenance,
.status-starting, .status-stopping, .status-ws-connecting { color: var(--yellow); }
.status-suspended, .status-ended, .status-install-failed, .status-install_failed, .status-reinstall_failed, .status-expired,
.status-ws-disconnected, .status-ws-unavailable { color: var(--magenta); }
/* A stopped game server is normal, not an error. */
.server-console .status-offline, .server-card .status-offline, .status-unknown, .status-unavailable, .status-abandoned { color: var(--fg-mute); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.region-row .status-offline { color: var(--magenta); }

/* ---------- Tables (admin) ---------- */

.table { width: 100%; border-collapse: collapse; background: var(--bg-panel); border: 1px solid var(--line); font-size: 13px; }
.table th { text-align: left; font-weight: 400; color: var(--fg-mute); padding: 10px 14px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 14px; border-bottom: 1px dashed var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: none; }
.table-actions { display: flex; gap: 14px; }

/* ---------- Admin panel (components/admin/AdminShell.tsx) ---------- */

.admin-layout { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 28px; align-items: start; }
.admin-nav { position: sticky; top: 16px; font-size: 13px; border: 1px solid var(--line); background: var(--bg-panel); padding: 12px 0; }
.admin-nav-title { color: var(--magenta); font-size: 12px; margin: 0 0 6px; padding: 0 14px; }
.admin-nav ul { list-style: none; margin: 0; padding: 0; }
.admin-nav a { display: block; padding: 5px 14px; color: var(--fg-dim); }
.admin-nav a::before { content: "  "; white-space: pre; }
.admin-nav a:hover { color: var(--cyan); }
.admin-nav a.active { color: var(--cyan); background: var(--bg); }
.admin-nav a.active::before { content: "> "; color: var(--magenta); }
.admin-main { min-width: 0; }
.admin-main-narrow { max-width: 760px; }

/* Overview tiles: label, big number, a line of detail. */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.stat { background: var(--bg-panel); border: 1px solid var(--line); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; color: inherit; }
a.stat:hover { border-color: var(--cyan); color: inherit; }
.stat-label { color: var(--fg-mute); font-size: 12px; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--fg); }
.stat-detail { color: var(--fg-dim); font-size: 12px; }
.stat-alert { border-color: var(--magenta); }
.stat-alert .stat-value { color: var(--magenta); }
.checklist { margin: 0; padding-left: 22px; font-size: 13px; color: var(--fg-dim); display: flex; flex-direction: column; gap: 8px; }
.checklist strong { color: var(--fg); font-weight: 400; }
.checklist code, .admin-main code { color: var(--yellow); overflow-wrap: anywhere; }
.pager { display: flex; gap: 14px; align-items: center; justify-content: flex-end; margin-top: 14px; font-size: 13px; }
.filter-form { margin-bottom: 18px; }
.cell-wide { min-width: 280px; }
.filter-form select, .filter-form input { padding: 8px 10px; font-size: 13px; }

details.debug { margin-top: 24px; font-size: 12px; color: var(--fg-mute); }
details.debug pre { background: var(--bg-panel); border: 1px solid var(--line); padding: 12px; overflow-x: auto; }

/* ---------- Homepage ---------- */

.hero { padding: 48px 32px 80px; max-width: 1100px; margin: 0 auto; }
.boot-log { color: var(--fg-dim); font-size: 13px; line-height: 1.7; margin: 0 0 32px; white-space: pre; overflow-x: auto; }
.boot-log-sm { margin-bottom: 18px; }
.hero h1 { font-size: 56px; line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
.hero .lede { font-size: 16px; line-height: 1.7; color: var(--fg-dim); margin: 32px 0 0; max-width: 640px; }
.cta-row { margin-top: 36px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cta-row .or { color: var(--fg-mute); font-size: 13px; }

.cursor { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* Game list */
.game-head { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.game-head .term-title { flex: 1; min-width: 0; margin: 0; }
.game-search {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 240px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  padding: 0 0 0 10px;
}
.game-search:focus-within { border-color: var(--cyan); }
.game-search-key { color: var(--magenta); font-size: 12px; border: 1px solid var(--line-2); padding: 0 5px; }
.game-search input { flex: 1; min-width: 0; border: none; background: transparent; padding: 8px 10px 8px 0; font-size: 13px; }
.game-search input:focus { border: none; }
.game-search input::-webkit-search-cancel-button { filter: grayscale(1) brightness(1.6); cursor: pointer; }
.game-row { cursor: pointer; transition: background 120ms; text-decoration: none; }
a.game-row, button.game-row { width: 100%; background: none; border: none; border-bottom: 1px dashed var(--line); font: inherit; font-size: 13px; text-align: left; color: inherit; }
.game-row:hover { background: var(--bg); }
.game-row:hover .deploy { color: var(--cyan); }
.game-row .idx { width: 32px; color: var(--fg-mute); flex: none; }
.game-row .slug { width: 130px; flex: none; }
.game-row .desc { flex: 1; color: var(--fg-dim); min-width: 0; }
.game-row .price { flex: none; white-space: nowrap; }
.game-row .per { color: var(--fg-mute); }
.game-row .deploy { flex: none; margin-left: 6px; color: var(--fg-mute); transition: color 120ms; white-space: nowrap; }
.game-row.open { background: var(--bg); }
.game-row .deploy.sold-out, .game-row:hover .deploy.sold-out { color: var(--magenta); }
.tier-row { padding-left: 50px; }
.tier-row .slug { width: 112px; }
.game-more { color: var(--fg-mute); cursor: default; }
.game-more:hover { background: none; }
.game-more-links { display: flex; gap: 14px; flex: none; }

/* Regions */
.region-map {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  padding: 20px;
  margin: 0;
  color: var(--line-2);
  font-size: 11px;
  /* At 1.2 each half-block (▀ ▄) is about square, which the map is drawn for. */
  line-height: 1.2;
  overflow-x: auto;
  white-space: pre;
}
.region-map .marker { color: var(--cyan); background: var(--bg-panel); text-shadow: 0 0 6px var(--cyan); }
.region-row { font-size: 12px; padding: 10px 18px; }
.region-row .code { width: 70px; color: var(--cyan); flex: none; }
.region-row .city { width: 140px; color: var(--fg-dim); flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.region-row .node { width: 160px; color: var(--fg-mute); flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.region-row .bar { flex: none; white-space: pre; }
.region-row .bar .cells-sm { display: none; }
.region-row .load { width: 50px; text-align: right; flex: none; }
.region-row .state { margin-left: auto; white-space: nowrap; }

/* ---------- Account ---------- */

.account-section { margin-bottom: 40px; }
.account-section .panel-pad > .kv + *, .cancel-subscription, .stop-server, .restore-server { margin-top: 18px; }
.server-card + .server-card { border-top: none; }
.server-card h3 { font-size: 14px; color: var(--cyan); margin-bottom: 12px; }
.server-card .actions { margin-top: 16px; display: flex; gap: 16px; flex-wrap: wrap; }
.server-billing { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.panel-password { max-width: 420px; margin-top: 16px; }

/* ---------- Server controls ---------- */

.status-power { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.status-line { font-size: 13px; }
.meters { grid-template-columns: 80px 1fr; gap: 4px 14px; font-size: 12px; }
.meter { white-space: pre; }
.power-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.crumbs { font-size: 12px; color: var(--fg-dim); margin-bottom: 18px; }

.server-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.server-side { display: flex; flex-direction: column; gap: 20px; }
.side-title { font-size: 12px; font-weight: 400; color: var(--magenta); margin-bottom: 12px; }
.side-title::before { content: "┌─ "; }
.kv-stack { grid-template-columns: 1fr; gap: 2px; }
.kv-stack dd { margin-bottom: 10px; }
.kv-stack dd:last-child { margin-bottom: 0; }

.console-head { display: flex; justify-content: space-between; font-size: 11px; margin: 4px 0 6px; }
.console-head-right { display: flex; gap: 14px; align-items: baseline; }
.console-head .link-btn { font-size: 11px; }
.console {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  margin: 0;
  padding: 12px 14px;
  height: 420px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--fg-dim);
  overflow-anchor: none; /* the island decides where the pane scrolls */
}
.console-wrap { position: relative; }
.console-latest { position: absolute; right: 22px; bottom: 14px; }
.console-sys { color: var(--yellow); }
.console-err { color: var(--magenta); }
.console-cmd { color: var(--cyan); }
.console-input {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-top: none;
  padding: 0 0 0 14px;
}
.console-input input { border: none; background: transparent; padding: 10px 12px 10px 0; font-size: 13px; }
.console-input input:focus { border: none; }
.console-input:focus-within { border-color: var(--cyan); }

/* ---------- Server tabs (shared building blocks for islands/server/*) ---------- */

.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 20px;
  font-size: 13px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}
.tab { padding: 8px 9px; color: var(--fg-dim); border: 1px solid transparent; border-bottom: none; margin-bottom: -1px; }
.tab::before { content: "[ "; color: var(--fg-mute); }
.tab::after { content: " ]"; color: var(--fg-mute); }
.tab:hover { color: var(--cyan); }
.tab.active { color: var(--cyan); background: var(--bg-panel); border-color: var(--line); }
/* Second row under a top-row tab that has sections of its own (server settings). */
.subtabs { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: -8px 0 18px; font-size: 12px; }
.subtab { color: var(--fg-dim); }
.subtab::before { content: "  "; white-space: pre; }
.subtab:hover { color: var(--cyan); }
.subtab.active { color: var(--cyan); }
.subtab.active::before { content: "> "; }

/* Row of actions above a list: buttons left, filters/info right. */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }
.empty { color: var(--fg-mute); padding: 18px 0; }
.empty::before { content: "> "; color: var(--cyan); }
.badge { display: inline-block; border: 1px solid var(--line-2); padding: 0 6px; font-size: 11px; color: var(--fg-dim); }
.badge-cyan { border-color: var(--cyan); color: var(--cyan); }
.badge-green { border-color: var(--green); color: var(--green); }
.badge-magenta { border-color: var(--magenta); color: var(--magenta); }
.badge-yellow { border-color: var(--yellow); color: var(--yellow); }
.table-compact td, .table-compact th { padding: 7px 12px; }
/* Wide tables scroll inside this wrapper; relative so sr-only children can't widen the page. */
.table-scroll { overflow-x: auto; position: relative; }
.table tr.selected td { background: var(--bg); }
.row-actions { display: flex; gap: 12px; justify-content: flex-end; white-space: nowrap; }
.inline-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1; min-width: 160px; }
.section-gap { margin-top: 28px; }

/* /admin/email/previews: each email in a sandboxed iframe */
.email-preview { border-top: none; background: var(--bg-page); }
.email-preview iframe { display: block; width: 100%; height: clamp(820px, 120vw, 1000px); border: 0; background: var(--bg-page); }
.email-preview-text { margin: 12px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 12px; color: var(--fg-dim); }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }
/* Copyable values (components/server/ui/CopyValue.tsx, CopyButton.tsx). */
.copy-value { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; max-width: 100%; }
.copy-text { overflow-wrap: anywhere; word-break: break-all; }
.copy-actions { display: inline-flex; gap: 12px; font-size: 12px; white-space: nowrap; }
.copy-btn { font-size: 12px; white-space: nowrap; }

/* Modal dialogs: <dialog class="term-dialog"> opened with showModal(). */
dialog.term-dialog {
  background: var(--bg-panel);
  color: var(--fg);
  border: 1px solid var(--cyan);
  box-shadow: 6px 6px 0 var(--magenta);
  padding: 0;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
}
dialog.term-dialog::backdrop { background: rgba(5, 5, 20, 0.8); }
dialog.term-dialog .dialog-head { padding: 12px 18px; border-bottom: 1px dashed var(--line); color: var(--magenta); font-size: 13px; }
dialog.term-dialog .dialog-head::before { content: "┌─ "; }
dialog.term-dialog .dialog-body { padding: 18px; overflow: auto; max-height: calc(100vh - 160px); }
dialog.term-dialog .dialog-actions { display: flex; gap: 12px; justify-content: flex-end; padding: 12px 18px; border-top: 1px dashed var(--line); }

/* ---------- Auth pages ---------- */

.auth-box { max-width: 460px; margin: 40px auto; }
.auth-box .panel { padding: 24px; }
.auth-switch { margin-top: 18px; font-size: 13px; color: var(--fg-mute); }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .nav { flex-wrap: wrap; padding: 16px; gap: 14px; }
  .nav-links .fkey { display: none; }
  .bios { padding: 8px 16px; flex-wrap: wrap; gap: 8px 18px; }
  .wrap, .section { padding: 24px 16px; }
  .hero { padding: 32px 16px 56px; }
  .hero h1 { font-size: 36px; }
  .footer { padding: 16px; flex-wrap: wrap; }
  .game-head { flex-wrap: wrap; }
  .game-head .term-title { flex-basis: 100%; }
  .game-search { width: 100%; }
  .game-row { flex-wrap: wrap; row-gap: 4px; }
  .game-row .slug { flex: 1; width: auto; }
  .game-row .deploy { display: none; }
  .game-row .deploy.sold-out { display: inline; margin-left: 6px; }
  .game-row .desc { order: 5; flex-basis: 100%; padding-left: 44px; }
  .tier-row { padding-left: 30px; }
  .tier-row .desc { padding-left: 24px; }
  .game-more .desc { order: 0; flex-basis: auto; padding-left: 0; }
  .region-row .node { display: none; }
  .region-row .bar .cells-lg { display: none; }
  .region-row .bar .cells-sm { display: inline; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dd { margin-bottom: 10px; }
  .field-row { grid-template-columns: 1fr; }
  .table { display: block; overflow-x: auto; position: relative; }
  .server-layout { grid-template-columns: 1fr; }
  .console { height: 320px; }
  .admin-layout { grid-template-columns: 1fr; gap: 18px; }
  .admin-nav { position: static; padding: 8px; }
  .admin-nav-title { display: none; }
  .admin-nav ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 2px; }
  .admin-nav a { padding: 6px 8px; }
  .admin-nav a::before { content: none; }
  .admin-nav a.active::before { content: none; }
}

@media (max-width: 560px) {
  .hero h1 { font-size: 28px; }
  .boot-log { font-size: 10px; }
  .region-row { gap: 8px; padding: 10px 12px; }
  .region-row .code { width: 44px; }
  .region-row .city { width: auto; flex: 1; min-width: 0; }
  .region-row .load { width: 36px; }
  .region-row .state .state-label { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
  .btn, .game-row, a { transition: none; }
}

/* admin: money */
.money-sub { font-size: 12px; margin-top: 2px; }
.money-badge { margin-left: 6px; }
.money-heading { font-size: 15px; margin: 0 0 4px; }
.money-help { font-size: 13px; margin: 0 0 10px; }
.status-completed { color: var(--green); }
.status-payment-due, .status-refunded { color: var(--yellow); }
.status-failed { color: var(--magenta); }

/* admin: users */
.cell-num { text-align: right; }
.admin-user-search { flex: 1 1 260px; }
.admin-user-search input { width: 100%; }
.admin-cell-email { overflow-wrap: anywhere; min-width: 160px; }
.admin-crumb { font-size: 13px; margin-bottom: 8px; }
.admin-user-actions { margin-top: 16px; }
.admin-user-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 14px; align-items: start; }
.admin-key { font-size: 11px; white-space: nowrap; margin-right: 6px; }
.admin-user > h2.term-title { margin-top: 32px; }
.status-abandoned { color: var(--fg-mute); }
@media (max-width: 900px) {
  .admin-user-grid { grid-template-columns: minmax(0, 1fr); }
}

/* support: customer tickets (routes/support/*, components/support/*, islands/support/*) */
.ticket-row { gap: 14px; align-items: flex-start; }
.ticket-row:hover { background: var(--bg); }
.ticket-row:hover .ticket-row-subject { color: var(--cyan); }
.ticket-row-num { flex: none; width: 52px; }
.ticket-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ticket-row-subject { color: var(--fg); overflow-wrap: anywhere; }
.ticket-row-meta { font-size: 12px; }
.ticket-row .status { flex: none; white-space: nowrap; font-size: 12px; }
.ticket-status-open { color: var(--cyan); }
.ticket-status-waiting { color: var(--yellow); }
.ticket-status-resolved { color: var(--green); }
.ticket-status-closed, .ticket-status-unconfirmed { color: var(--fg-mute); }
.ticket-subject { font-size: 15px; color: var(--fg); margin: 0 0 14px; overflow-wrap: anywhere; }
.ticket-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 18px; }
.ticket-status-action .notice { margin: 8px 0 0; }
.ticket-thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.ticket-msg { border: 1px solid var(--line); border-left-width: 3px; background: var(--bg-panel); padding: 12px 16px; }
.ticket-msg-customer { border-left-color: var(--violet); }
.ticket-msg-staff { border-left-color: var(--cyan); }
.ticket-msg-system { border-left-color: var(--line); border-style: dashed; color: var(--fg-dim); font-size: 12px; }
.ticket-msg-head { display: flex; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap; font-size: 12px; margin: 0 0 8px; }
.ticket-msg-author { color: var(--magenta); }
.ticket-msg-staff .ticket-msg-author { color: var(--cyan); }
.ticket-msg-system .ticket-msg-author { color: var(--fg-mute); }
.ticket-msg-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.55; }
.ticket-files { list-style: none; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 8px; font-size: 12px; overflow-wrap: anywhere; }
.ticket-thumb { display: block; width: fit-content; margin-bottom: 4px; }
.ticket-thumb img { display: block; max-width: min(240px, 100%); max-height: 160px; border: 1px solid var(--line); }
.ticket-picked { list-style: none; margin: 4px 0 0; padding: 0; font-size: 12px; color: var(--fg); overflow-wrap: anywhere; }
.help-links { margin-top: 12px; }
@media (max-width: 560px) {
  .ticket-row { flex-wrap: wrap; }
  .ticket-row-num { width: auto; }
  .ticket-row-main { flex-basis: 100%; order: 2; }
}

/* support: guest pages (routes/contact.tsx, routes/contact/confirm.tsx, routes/support/guest/[number].tsx) */
/* The contact form's honeypot: off-screen rather than display:none, which some bots skip. */
.guest-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.guest-access-link code { overflow-wrap: anywhere; word-break: break-all; }
.guest-status-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.guest-status-actions .notice { flex-basis: 100%; }
@media (max-width: 560px) {
  .guest-field-row { grid-template-columns: minmax(0, 1fr); }
  .footer { flex-wrap: wrap; gap: 8px 18px; padding: 16px; }
}

/* admin: support tickets (routes/admin/tickets/*, islands/admin/Ticket*.tsx, components/admin/TicketParts.tsx) */
.admtk-status { white-space: nowrap; }
.admtk-status-open { color: var(--magenta); }
.admtk-status-waiting { color: var(--yellow); }
.admtk-status-resolved { color: var(--green); }
.admtk-status-closed, .admtk-status-unconfirmed { color: var(--fg-mute); }
.admtk-priority-normal { color: var(--fg-dim); }
.admtk-search { flex: 1 1 220px; }
.admtk-search input { width: 100%; }
.admtk-row-current, .admtk-row-current:hover { background: var(--bg); }
.admtk-subject { font-size: 16px; color: var(--fg); margin: 0 0 6px; overflow-wrap: anywhere; }
.admtk-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; margin: 0 0 18px; }
.admtk-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.admtk-main, .admtk-side { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.admtk-thread { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.admtk-msg { border: 1px solid var(--line); border-left-width: 3px; background: var(--bg-panel); padding: 10px 14px; }
.admtk-msg-customer { border-left-color: var(--violet); }
.admtk-msg-staff { border-left-color: var(--cyan); }
.admtk-msg-system { border-left-color: var(--line); border-style: dashed; color: var(--fg-dim); font-size: 12px; }
/* Internal notes: striped yellow edge and a tinted body, so they never pass for a public reply. */
.admtk-msg-internal {
  border-color: var(--yellow);
  border-style: dashed;
  border-left-style: solid;
  background: repeating-linear-gradient(135deg, var(--bg-panel) 0 12px, var(--bg) 12px 24px);
}
.admtk-msg-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; margin: 0 0 6px; }
.admtk-msg-when { margin-left: auto; }
.admtk-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.55; }
.admtk-files { list-style: none; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 8px; font-size: 12px; overflow-wrap: anywhere; }
.admtk-thumb { display: block; max-width: min(240px, 100%); max-height: 160px; border: 1px solid var(--line); margin-bottom: 4px; }
.admtk-mode { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.admtk-mode label { cursor: pointer; color: var(--fg-dim); }
.admtk-mode .admtk-mode-on { color: var(--cyan); }
.admtk-reply-note .admtk-mode .admtk-mode-on { color: var(--yellow); }
.admtk-reply-note textarea { border-color: var(--yellow); }
.admtk-controls { display: flex; flex-direction: column; gap: 14px; }
.admtk-control { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.admtk-control select { width: 100%; }
.admtk-related { border-color: var(--magenta); }
.admtk-server-actions { margin-top: 10px; }
.admtk-context-block { min-width: 0; }
.admtk-list { list-style: none; margin: 0 0 8px; padding: 0; font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.admtk-list li { padding: 2px 4px; }
@media (max-width: 1000px) {
  .admtk-layout { grid-template-columns: minmax(0, 1fr); }
}

/* Game requests (/request-game, /admin/game-requests) */
.gamereq-status-open { color: var(--cyan); }
.gamereq-status-planned { color: var(--yellow); }
.gamereq-status-added { color: var(--green); }
.gamereq-status-declined { color: var(--fg-mute); }
.gamereq-note { white-space: pre-wrap; color: var(--fg-dim); }
.gamereq-planned { margin: 0; padding: 0; list-style: none; }
.gamereq-planned li { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.gamereq-planned li:last-child { border-bottom: none; }

/* Maintenance (/maintenance, the site banner, /admin/maintenance) */
.maint-banner { border-bottom: 1px dashed var(--line); background: var(--bg-panel); padding: 10px 32px; font-size: 13px; color: var(--fg-dim); }
.maint-banner p { margin: 0; }
.maint-banner p + p { margin-top: 4px; }
.maint-banner-tag { color: var(--yellow); }
.maint-banner-now .maint-banner-tag { color: var(--magenta); }
.maint-list { display: flex; flex-direction: column; gap: 14px; }
.maint-head { margin: 0 0 10px; }
.maint-message { white-space: pre-wrap; color: var(--fg-dim); font-size: 13px; }
.maint-notice .kv { margin-bottom: 10px; }
.maint-phase-draft { color: var(--fg-mute); }
.maint-phase-upcoming { color: var(--yellow); }
.maint-phase-ongoing { color: var(--magenta); }
.maint-phase-ended { color: var(--green); }
.maint-phase-cancelled { color: var(--fg-mute); }
@media (max-width: 700px) {
  .maint-banner { padding: 10px 16px; }
}

/* ---------- /admin/smashplank: server-rendered SVG charts (components/admin/SmashplankCharts.tsx) ---------- */
/* Series slot a = cyan, b = violet; marketing markers are dashed yellow. Text stays in text tokens. */
.chart-panel { padding-bottom: 10px; }
.chart-scroll { overflow-x: auto; position: relative; }
.chart { display: block; width: 100%; min-width: 560px; height: auto; font-family: var(--mono); }
.chart text { fill: var(--fg-mute); font-size: 10px; }
.chart-grid { stroke: var(--line); stroke-width: 1; }
.chart-baseline { stroke: var(--line-2); stroke-width: 1; }
.chart-axis-note { font-size: 9px; }
.chart-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dashed { stroke-width: 1.5; stroke-dasharray: 4 3; }
.chart-line.chart-tone-a { stroke: var(--cyan); }
.chart-line.chart-tone-b { stroke: var(--violet); }
.chart-dot { stroke: var(--bg-panel); stroke-width: 2; }
.chart-dot.chart-tone-a, .chart-bar.chart-tone-a { fill: var(--cyan); }
.chart-dot.chart-tone-b, .chart-bar.chart-tone-b { fill: var(--violet); }
.chart-hover rect, .chart-hit-rect { fill: transparent; }
.chart-hover rect:hover, .chart-bars:hover .chart-hit-rect { fill: var(--bg); }
.chart-marker line { stroke: var(--yellow); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-marker line.chart-hit { stroke: transparent; stroke-width: 9; stroke-dasharray: none; }
.chart-marker text { fill: var(--fg-dim); }
.chart-markers a:hover .chart-marker line:not(.chart-hit) { stroke: var(--magenta); stroke-dasharray: none; }
.chart-markers a:hover .chart-marker text { fill: var(--magenta); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0 0 10px; padding: 0; font-size: 12px; color: var(--fg-dim); }
.chart-legend li { display: flex; align-items: center; gap: 6px; }
.chart-swatch { display: inline-block; width: 14px; height: 0; border-top: 2px solid; }
.chart-swatch-a { border-color: var(--cyan); }
.chart-swatch-b { border-color: var(--violet); }
.chart-swatch-dashed { border-top-style: dashed; }
.chart-swatch-marker { width: 0; height: 12px; border-top: none; border-left: 1px dashed var(--yellow); }
.chart-empty { color: var(--fg-mute); padding: 28px 0; text-align: center; margin: 0; }
.chart-empty::before { content: "> "; color: var(--cyan); }
.smashplank-setup .kv { margin: 12px 0; }
.smashplank-daily summary { cursor: pointer; color: var(--fg-dim); font-size: 13px; margin-bottom: 10px; }
.smashplank-notes { white-space: pre-line; max-width: 460px; }
.smashplank-copy { margin-top: 6px; }
.smashplank-sources .muted { font-size: 11px; margin-left: 4px; }
.live-status.warn { color: var(--yellow); }
.campaign-link { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; border: 1px dashed var(--line-2); padding: 10px 12px; }
.campaign-link code { color: var(--yellow); overflow-wrap: anywhere; }
