/* DarkSpace identity tokens: cold gunmetal, tactical teal, faction signals. */
:root {
  color-scheme: dark;

  --bg: #000000;
  --bg-elev: #0a0e12;
  --bg-surface: #111920;
  --bg-surface-2: #1a232a;
  --border: rgba(132, 166, 156, 0.18);
  --border-strong: #3c4f4b;
  --fg: #c5d5e6;
  --fg-muted: #7a8a9a;
  --fg-dim: #4a5a6a;
  --accent: #84a69c;
  --accent-bright: #b8d5cc;
  --accent-glow: rgba(132, 166, 156, 0.2);
  --link-hover: #ffffff;
  --link-active: #ff9999;

  --welcome: #bdc794;
  --user: #eff3c6;
  --danger: #ff5959;
  --success: #33cc33;
  --warning: #ffffcc;
  --cream: #ddddcc;
  /* A player's status beside their name (gamecq player_badge()); the game's labels and chat use the same two */
  --player-subscriber: #ddba60;
  --player-vanguard: #a78bfa;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: "Arial Narrow", "Roboto Condensed", "Segoe UI", sans-serif;
  --font-serif: Georgia, "Century Schoolbook", "Times New Roman", serif;
  --font-mono: "JetBrains Mono", Consolas, Menlo, Monaco, monospace;

  --fs-xxs: 10px;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-base: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 19px;
  --fs-2xl: 24px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  --r-xs: 2px;
  --r-sm: 4px;
  --r: 6px;
  --r-lg: 10px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--border);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--border);

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --t-fast: 100ms var(--ease);
  --t: 150ms var(--ease);

  --page-max: 100vw;
  --nav-width: 224px;
  --rail-width: 280px;
  --control-height: 34px;
  --row-alt: rgba(132, 166, 156, 0.035);
  --surface-highlight: rgba(184, 213, 204, 0.055);
  --header-bg: linear-gradient(180deg, rgba(17, 25, 32, 0.98), rgba(5, 9, 12, 0.98));
  --header-line: linear-gradient(90deg, transparent, var(--accent), transparent);
  --focus-ring: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  --brand-tracking: 0.18em;
}


/* ---------- operational graphs ---------- */

.graph-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
}

.graph-window:first-child {
  grid-column: 1 / -1;
}

.graph-window .panel__heading {
  justify-content: space-between;
}

.graph-window .panel__heading small {
  color: var(--fg-dim);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.graph-chart-wrap {
  min-width: 0;
}

.graph-chart-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: var(--sp-3);
  overflow: hidden;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.graph-chart-summary > span {
  display: grid;
  gap: var(--sp-1);
  min-width: 0;
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-elev);
}

.graph-chart-summary small,
.graph-list__id,
.graph-list__readonly {
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.graph-chart-summary strong {
  overflow: hidden;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: var(--fs-md);
  text-overflow: ellipsis;
}

.graph-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 180px;
  overflow: visible;
}

.graph-chart__grid {
  stroke: var(--border);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.graph-chart__line {
  fill: none;
  stroke: var(--accent-bright);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}

.graph-chart__point {
  fill: var(--accent-bright);
  stroke: var(--bg-elev);
  stroke-width: 3;
  vector-effect: non-scaling-stroke;
}

.graph-chart__label {
  fill: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 12px;
}

.graph-chart__label--end {
  text-anchor: end;
}

.graph-empty {
  display: grid;
  gap: var(--sp-1);
  min-height: 180px;
  align-content: center;
}

.graph-list-wrap {
  border: 1px solid var(--border);
  border-radius: var(--r);
}

.graph-list {
  min-width: 860px;
}

.graph-list .number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.graph-list__name {
  margin-right: var(--sp-2);
  font-weight: 700;
}

.graph-list__current {
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-weight: 700;
}

.graph-sample-age {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  color: var(--fg-muted);
  white-space: nowrap;
}

.graph-sample-age::before {
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  content: "";
}

.graph-sample-age--stale::before {
  background: var(--danger);
}

.graph-editor {
  max-width: 960px;
}

.graph-editor__body {
  display: grid;
  gap: var(--sp-4);
}

.graph-editor__sql {
  min-height: 180px;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1.6;
}

.graph-editor__actions {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  justify-content: flex-end;
  margin-top: var(--sp-2);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}

.graph-confirm {
  max-width: 640px;
}

@media (max-width: 900px) {
  .graph-dashboard {
    grid-template-columns: 1fr;
  }

  .graph-window:first-child {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .graph-chart-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .graph-chart {
    min-height: 140px;
  }
}


/* ============================================================
   DarkSpace — modern dark-space dashboard stylesheet
   Preserves existing class semantics, modernizes type/color/space
   ============================================================ */
/* ============================================================
   BASE
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: #3a4a4f #0a0e12;
  scrollbar-width: thin;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.4;
  color: var(--fg);
  background: var(--bg);
  margin: 0;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Status bar iframe at top of page (iframe is 96x40, 3 lines must fit) */
.status-bar {
  background: transparent;
  color: var(--fg-muted);
  padding: 1px 6px;
  font-size: 10px;
  line-height: 1.25;
}
.status-bar table.status_text td {
  padding: 0;
  font-size: 10px;
  line-height: 1.25;
}
.status-bar b,
.status-bar strong {
  color: var(--accent-bright);
  font-weight: 600;
}

textarea,
input,
select,
button {
  font-family: inherit;
  font-size: var(--fs-base);
  color: var(--fg);
}

img {
  vertical-align: middle;
}

hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: var(--sp-4) 0;
}

::selection {
  background: rgba(132, 166, 156, 0.4);
  color: #fff;
}

/* Modern scrollbars */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: #3a4a4f;
  border-radius: 5px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: #556870;
}
::-webkit-scrollbar-corner {
  background: var(--bg);
}

/* ============================================================
   LINKS
   ============================================================ */

a {
  color: var(--accent);
  text-decoration: none;
  transition:
    color var(--t-fast),
    text-decoration-color var(--t);
}
a:visited {
  color: var(--accent);
}
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 2px;
}
a:active {
  color: var(--link-active);
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

/* ============================================================
   LISTS
   ============================================================ */

ul {
  list-style-type: square;
  padding-left: 20px;
}
ul.uniDoc {
  list-style-type: none;
  padding-left: 0;
}

/* ============================================================
   FORMS
   ============================================================ */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="url"],
textarea,
select {
  background: var(--bg-surface);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 10px;
  line-height: 1.3;
  transition:
    border-color var(--t),
    box-shadow var(--t);
}
input:hover,
textarea:hover,
select:hover {
  border-color: var(--border-strong);
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--accent);
  transform: translateY(1px);
}
textarea {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}

/* Buttons (all variants) */
button,
input[type="submit"],
input[type="button"],
input[type="reset"],
.button,
.lockbutton {
  display: inline-block;
  background: rgba(132, 166, 156, 0.12);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 6px 14px;
  line-height: 1.3;
  font-weight: 500;
  cursor: pointer;
  transition:
    background var(--t),
    border-color var(--t),
    color var(--t),
    transform var(--t-fast);
  text-decoration: none;
}
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
.button:hover,
.lockbutton:hover {
  background: rgba(132, 166, 156, 0.22);
  border-color: var(--accent);
  color: var(--link-hover);
}
button:active,
input[type="submit"]:active,
input[type="button"]:active,
.button:active,
.lockbutton:active {
  transform: translateY(1px);
}
button:focus-visible,
input[type="submit"]:focus-visible,
input[type="button"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.deletebutton {
  display: inline-block;
  background: rgba(255, 89, 89, 0.1);
  color: var(--danger);
  border: 1px solid rgba(255, 89, 89, 0.3);
  border-radius: var(--r-sm);
  padding: 6px 14px;
  cursor: pointer;
  transition:
    background var(--t),
    border-color var(--t),
    color var(--t);
}
.deletebutton:hover {
  background: rgba(255, 89, 89, 0.22);
  border-color: var(--danger);
  color: #ff8a8a;
}

/* ============================================================
   TYPOGRAPHY CLASSES (preserve existing contracts)
   ============================================================ */

.std_text {
  font-size: var(--fs-base);
}
.small_text {
  font-size: var(--fs-sm);
  color: var(--fg-muted);
}
.med_text {
  font-size: var(--fs-base);
  font-style: italic;
  color: var(--fg-muted);
}
.big_text {
  font-size: var(--fs-md);
}
.side_text {
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.menu_text {
  font-size: var(--fs-sm);
}
.status_text {
  font-size: var(--fs-xs);
  letter-spacing: 0.02em;
  color: var(--fg-muted);
}
.std_header {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--accent-bright);
  letter-spacing: 0.02em;
}
.news_header {
  font-size: var(--fs-sm);
  color: #cccccc;
  font-weight: 500;
}

.denied_bank {
  font-size: var(--fs-base);
  color: #0f5f5f;
}
.award_text {
  font-family: var(--font-serif);
  font-size: var(--fs-md);
  color: var(--warning);
}
.award_header {
  font-family: var(--font-serif);
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--warning);
  letter-spacing: 0.02em;
}

/* ============================================================
   UTILITIES (both naming conventions supported)
   ============================================================ */

.text-welcome,
.text_welcome {
  color: var(--welcome);
}
.text-user,
.text_user {
  color: var(--user);
}
.text-center,
.text_center {
  text-align: center;
}
.text-white,
.text_white {
  color: #ffffff;
}
.text-red,
.text_red {
  color: var(--danger);
}
.text-cream,
.text_cream {
  color: var(--cream);
}

/* Borders */
.std_border {
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.red_border {
  border: 1px solid var(--danger);
  border-radius: var(--r-sm);
}
.green_border {
  border: 1px solid var(--success);
  border-radius: var(--r-sm);
}

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */

.center-fit {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* Body grows with its content and is at least the viewport tall. */
html {
  height: 100%;
}
body {
  min-height: 100%;
}

/* ============================================================
   TABLES — breathing room, subtle row striping
   ============================================================ */

table.std_text,
table.small_text {
  border-collapse: separate;
  border-spacing: 0;
}
table.std_text > tbody > tr > td,
table.std_text > tbody > tr > th,
table.std_text > tr > td,
table.std_text > tr > th,
table.small_text > tbody > tr > td,
table.small_text > tbody > tr > th,
table.small_text > tr > td,
table.small_text > tr > th {
  padding: 3px 8px;
  vertical-align: top;
}
table.std_text th,
table.small_text th {
  font-weight: 600;
  color: var(--accent-bright);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.02em;
}

/* ============================================================
   CARDS (new markup emitted by draw_interface)
   ============================================================ */

.card {
  display: block;
  background: linear-gradient(
    180deg,
    rgba(14, 20, 25, 0.9),
    rgba(10, 14, 18, 0.9)
  );
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  margin: 0 auto var(--sp-4);
  overflow: hidden;
}

.card__header {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  background: linear-gradient(
    180deg,
    rgba(132, 166, 156, 0.08),
    rgba(132, 166, 156, 0.02)
  );
  border-bottom: 1px solid var(--border);
  color: var(--accent-bright);
  font-weight: 600;
  font-size: var(--fs-md);
  letter-spacing: 0.02em;
}

.card__body {
  display: block;
  padding: var(--sp-2) var(--sp-3);
}

.card__body > table:first-child {
  margin-top: calc(var(--sp-2) * -1);
}

/* ============================================================
   SIDEBOXES (right-column widgets)
   ============================================================ */

.sidebox {
  display: block;
  background: rgba(10, 14, 18, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  margin-bottom: var(--sp-3);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.sidebox__header {
  display: block;
  padding: 4px 8px;
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  background: linear-gradient(
    180deg,
    rgba(132, 166, 156, 0.15),
    rgba(132, 166, 156, 0.03)
  );
  border-bottom: 1px solid var(--border);
}

.sidebox__header--green {
  color: #7fc896;
  background: linear-gradient(
    180deg,
    rgba(51, 204, 51, 0.15),
    rgba(51, 204, 51, 0.03)
  );
  border-bottom-color: rgba(51, 204, 51, 0.3);
}
.sidebox__header--red {
  color: #ff8a8a;
  background: linear-gradient(
    180deg,
    rgba(255, 89, 89, 0.15),
    rgba(255, 89, 89, 0.03)
  );
  border-bottom-color: rgba(255, 89, 89, 0.3);
}
.sidebox__header--yellow {
  color: #e6d070;
  background: linear-gradient(
    180deg,
    rgba(255, 221, 102, 0.15),
    rgba(255, 221, 102, 0.03)
  );
  border-bottom-color: rgba(255, 221, 102, 0.3);
}

.sidebox__body {
  padding: var(--sp-2);
  font-size: var(--fs-sm);
}

/* Upcoming Events: highlight for events starting now */
.event-now {
  background: rgba(255, 89, 89, 0.18);
  border-left: 2px solid var(--danger);
  padding-left: 4px;
}

/* ============================================================
   LEFT NAV (from gamecq/php/menu.php — table.menu_text)
   ============================================================ */

table.menu_text,
table.menu_text td {
  font-size: var(--fs-xs);
  line-height: 1.25;
  font-family: var(--font-mono);
}
table.menu_text td {
  padding: 0;
  vertical-align: top;
}

/* Links — HUD rows with chevron that slides in on hover */
table.menu_text a {
  display: block;
  position: relative;
  /* Minimal horizontal padding — the 108px sidebar is narrow, any
	   reservation for a hover-state decoration forces long labels to
	   wrap permanently or touch the right chrome. */
  padding: 1px 4px 1px 4px;
  margin: 0;
  color: var(--fg);
  border-left: 2px solid transparent;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition:
    background var(--t-fast),
    color var(--t-fast),
    border-color var(--t-fast);
}
/* Country/language selector rows: <img flag> <a>Lang</a><br> — keep the
   anchor inline with its flag, don't inherit the block row styling which
   would drop the text onto a second line below the flag. */
table.menu_text img + a {
  display: inline;
  padding: 0;
  border-left: 0;
  background: none;
}
table.menu_text img + a:hover {
  background: none;
  text-decoration: underline;
  color: var(--link-hover);
}
table.menu_text a:hover {
  background: linear-gradient(90deg, var(--accent-glow), transparent 85%);
  border-left-color: var(--accent);
  color: var(--link-hover);
  text-decoration: none;
}

/* Bold emphasis inside nav links — accented with subtle HUD glow */
table.menu_text a b,
table.menu_text a strong {
  font-weight: 600;
  color: var(--accent);
  text-shadow: 0 0 6px var(--accent-glow);
}
table.menu_text a:hover b,
table.menu_text a:hover strong {
  color: var(--link-hover);
  text-shadow: 0 0 8px var(--accent);
}

/* Section headers — [ ADMIN ] bracketed HUD label with trailing rule */
table.menu_text td > b {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 10px 2px 3px;
  margin: 2px 0 0;
  font-style: normal;
  text-shadow: 0 0 8px var(--accent-glow);
}
table.menu_text td > b::before {
  content: "[";
  color: var(--fg-muted);
  font-weight: 400;
  letter-spacing: 0;
}
table.menu_text td > b::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--accent) 0, transparent);
  opacity: 0.6;
  margin-left: 2px;
}
table.menu_text td > b > i {
  font-style: normal;
  position: relative;
}
table.menu_text td > b > i::after {
  content: "]";
  color: var(--fg-muted);
  font-weight: 400;
  letter-spacing: 0;
  margin-left: 4px;
}

/* Dividers — ticked/dashed line for mechanical feel */
table.menu_text hr {
  border: 0;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    var(--border-strong) 0,
    var(--border-strong) 3px,
    transparent 3px,
    transparent 6px
  );
  margin: 6px 2px;
  color: transparent;
  opacity: 0.5;
}

/* Flags / icons embedded in menu HTML rows (e.g. country/language list).
   Source images specify their own width/height (e.g. 24x16 flags); just
   ensure they sit on the text baseline with a small gap. */
table.menu_text img {
  margin-right: 4px;
  vertical-align: middle;
}

/* ============================================================
   FORUMS (phpBB viewtopic / viewforum / index)
   ============================================================ */

/* --- Viewtopic post rows: inline bg on <tr> --- */
table.std_text
  tr[align="left"][style*="background-color"]:not(:has(b:only-child)) {
  background-color: transparent !important;
}

/* --- Listings (viewforum/index): inline bg on <td> --- */
/* Strip the ugly $color1/$color2 bg from every cell */
table.std_text td[style*="background-color"] {
  background-color: transparent !important;
  border-bottom: 1px solid var(--border);
}

/* Header row of listings: <tr style=bg align=left> with <b>text</b> cells — first row only */
table.std_text > tbody > tr:first-child[style*="background-color"] > td,
table.std_text > tr:first-child[style*="background-color"] > td {
  background: linear-gradient(
    180deg,
    rgba(132, 166, 156, 0.1),
    rgba(132, 166, 156, 0.02)
  ) !important;
  color: var(--accent-bright);
  border-bottom: 1px solid var(--border);
  padding: 6px 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Category title row (forum index) — has colspan=5 */
table.std_text tr > td[colspan="5"][style*="background-color"] {
  background: linear-gradient(
    180deg,
    rgba(132, 166, 156, 0.14),
    rgba(132, 166, 156, 0.03)
  ) !important;
  padding: 8px 14px !important;
  font-size: var(--fs-md);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-bottom: 1px solid var(--border);
  border-top: 1px solid var(--border);
}
table.std_text tr > td[colspan="5"][style*="background-color"] b,
table.std_text tr > td[colspan="5"][style*="background-color"] a,
table.std_text tr > td[colspan="5"][style*="background-color"] span {
  font-weight: 600 !important;
  color: var(--accent-bright) !important;
}

/* No alternating stripe or hover override on std_text rows — the inline
   row colors (forum $row_color, rankings #101414/#1D2323) already provide
   enough row separation, and the rgba overlays looked washed-out / odd. */

/* Re-exempt the header row and category rows from the stripe */
table.std_text > tbody > tr:first-child[style*="background-color"] > td,
table.std_text > tr:first-child[style*="background-color"] > td {
  background: linear-gradient(
    180deg,
    rgba(132, 166, 156, 0.1),
    rgba(132, 166, 156, 0.02)
  ) !important;
}
table.std_text tr > td[colspan="5"][style*="background-color"] {
  background: linear-gradient(
    180deg,
    rgba(132, 166, 156, 0.14),
    rgba(132, 166, 156, 0.03)
  ) !important;
}

/* Kill the inconsistent inline border-radius:2em from phpBB header cells —
   normalize to flat so forum index / viewforum / viewtopic all match */
table.std_text td[style*="border-top-left-radius"],
table.std_text td[style*="border-top-right-radius"],
table.std_text td[style*="border-bottom-left-radius"],
table.std_text td[style*="border-bottom-right-radius"] {
  border-radius: 0 !important;
}

/* Tighten padding on forum listing cells */
table.std_text tr > td[style*="background-color"] {
  padding: 6px 10px;
  vertical-align: top;
}

/* Forum name link (in forum index) — make it pop like a card title */
table.std_text tr > td[style*="background-color"] > a > b,
table.std_text
  tr
  > td[style*="background-color"]
  > *:not(b)
  + a[href*="viewforum"]
  b {
  font-size: var(--fs-md);
  color: var(--accent-bright);
}

/* Author info column (first td of a viewtopic post row — identified by .big_text inside) */
table.std_text tr[align="left"] > td:first-child:has(.big_text) {
  width: 180px;
  padding: 10px 12px;
  border-right: 1px solid var(--border);
  vertical-align: top;
  font-size: var(--fs-sm);
  color: var(--fg-muted);
}
table.std_text tr[align="left"] > td:first-child:has(.big_text) .big_text b {
  font-size: var(--fs-md);
  color: var(--fg);
}
table.std_text tr[align="left"] > td:first-child:has(.big_text) .side_text {
  display: inline-block;
  margin-top: 2px;
}

/* Post content column — only when there's an author column next to it */
table.std_text
  tr[align="left"]:has(> td:first-child .big_text)
  > td:nth-child(2) {
  padding: 10px 14px;
  vertical-align: top;
  line-height: 1.5;
}

/* <hr> inside posts — subtler */
table.std_text tr[align="left"] > td:nth-child(2) hr {
  margin: 8px 0;
  background: var(--border);
}

/* Post action links (edit/quote/ip/email) — image links at the bottom */
table.std_text tr[align="left"] > td:nth-child(2) > a img[border="0"],
table.std_text tr[align="left"] > td:nth-child(2) a[href*="editpost"] img,
table.std_text tr[align="left"] > td:nth-child(2) a[href*="reply"] img,
table.std_text tr[align="left"] > td:nth-child(2) a[href*="topicadmin"] img {
  opacity: 0.7;
  transition: opacity var(--t);
}
table.std_text tr[align="left"] > td:nth-child(2) a:hover img {
  opacity: 1;
}

/* BBCode quote blocks (rendered as BLOCKQUOTE inside a table) */
blockquote {
  margin: 8px 0;
  padding: 8px 12px;
  background: rgba(132, 166, 156, 0.06);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--fg-muted);
  font-style: italic;
}

/* phpBB BBCode wraps quote/code in <FONT SIZE=-2> which made the body text
   tiny. Override the legacy size attribute back to body size — CSS wins
   over the deprecated <font> attribute. */
table[border="0"][align="CENTER"] font[size="-2"],
table[border="0"][align="CENTER"] font[size="-1"],
table[border="0"][align="CENTER"] blockquote {
  font-size: inherit;
}

/* BBCode [code] blocks (rendered as PRE) */
pre {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--fg);
  overflow-x: auto;
  margin: 8px 0;
}

/* ============================================================
   BADGES & AWARDS (profile)
   ============================================================ */

.badge-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  justify-content: flex-start;
  padding: var(--sp-2) 0;
}

.badge,
.award {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  transition:
    transform var(--t-fast),
    box-shadow var(--t-fast),
    border-color var(--t-fast);
}
.badge:hover,
.award:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
  box-shadow:
    0 0 14px var(--accent-glow),
    var(--shadow-sm);
}
.badge {
  width: 112px;
}
.award {
  width: 88px;
}

.badge__image,
.award__image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  padding: 8px;
  min-height: 80px;
  border-bottom: 1px solid var(--border);
}
.badge__image img,
.award__image img {
  display: block;
  max-width: 100%;
  height: auto;
}

.badge__title,
.award__caption {
  font-size: var(--fs-xxs);
  padding: 6px 4px;
  text-align: center;
  width: 100%;
  background: linear-gradient(180deg, rgba(132, 166, 156, 0.08), transparent);
  line-height: 1.2;
  letter-spacing: 0.04em;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.badge__title {
  color: var(--accent-bright);
}
.award__caption {
  color: var(--cream);
}

/* ============================================================
   WIKI / MISC (preserved)
   ============================================================ */

.hot {
  color: var(--danger);
}
.hotter {
  color: #ff0000;
  font-weight: bold;
}

.tinybox {
  display: inline-block;
  padding: 4px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
}

.istopic {
  font-weight: 600;
  color: var(--accent-bright);
}
.thispic {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.isgallery {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

/* ============================================================
   FACEBOOK WIDGET (preserved behavior)
   ============================================================ */

.fan_box.full_widget .connect_top {
  border: none;
  background-color: #000;
  float: left;
  padding-top: 30px;
}
.fan_box.full_widget {
  border: none;
  background-color: #000;
}
.connect_top {
  background-color: #000 !important;
}
.connect_top a {
  color: #cccccc;
}
.connect_top a:hover {
  color: #cc0000;
}
.fan_box.connections {
  background-color: #000;
  border: none;
  color: #666;
}
.connect_button {
  color: #666;
  background-color: #000;
}

/* ============================================================
   SERVERS — list grid, detail header, canvas map, planet list
   ============================================================ */

/* ----- Shared: population / utilization meter ----- */
.server-meter {
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-top: 4px;
  min-width: 120px;
}
.server-meter__bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}
.server-meter__bar--cool {
  background: linear-gradient(90deg, #4a8a7a, #5fa38f);
}
.server-meter__bar--warm {
  background: linear-gradient(90deg, #b8a050, #ddba60);
}
.server-meter__bar--hot {
  background: linear-gradient(90deg, #c86050, #e07870);
}

/* ----- List view (gamecq/modules/servers.php) ----- */
.server-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
  padding: 0 2px;
}
.server-list-head__title {
  font-size: var(--fs-sm);
  color: var(--accent-bright);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}
.server-list-head__count {
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Inline-block grid. `font-size: 0` kills the whitespace gaps between
   inline-blocks; the cards set their own font-size to re-enable text. */
.server-grid {
  display: block;
  font-size: 0;
  margin: 0 calc(var(--sp-3) * -0.5);
}

.server-card {
  display: inline-block;
  vertical-align: top;
  width: 280px;
  margin: 0 var(--sp-3) var(--sp-3) 0;
  background: linear-gradient(
    180deg,
    rgba(14, 20, 25, 0.92),
    rgba(10, 14, 18, 0.72)
  );
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  text-decoration: none;
  font-size: var(--fs-base);
  transition:
    transform var(--t-fast),
    border-color var(--t-fast),
    box-shadow var(--t-fast);
}
.server-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow:
    0 0 18px var(--accent-glow),
    var(--shadow-sm);
  text-decoration: none;
}
/* Float-based head layout. `overflow: hidden` contains the floated
   name/pop. */
.server-card__head {
  display: block;
  overflow: hidden;
  padding: 10px 12px 4px;
}
.server-card__name {
  float: left;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--accent-bright);
  letter-spacing: 0.02em;
}
.server-card__pop {
  float: right;
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
}
.server-card__desc {
  padding: 0 12px 10px;
  font-size: var(--fs-sm);
  color: var(--fg);
  font-style: italic;
  line-height: 1.4;
  flex: 1;
}
.server-card__meter {
  height: 3px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  border-top: 1px solid var(--border);
}
.server-card__meter-bar {
  height: 100%;
}

/* ----- Detail header ----- */
.server-hdr {
  display: grid;
  gap: var(--sp-3);
}
.server-hdr__top {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
}
.server-hdr__title {
  flex: 1 1 240px;
  min-width: 0;
}
.server-hdr__eyebrow {
  margin-bottom: 3px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.server-hdr__name {
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--accent-bright);
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.server-hdr__desc {
  color: var(--fg-muted);
  font-style: italic;
  font-size: var(--fs-sm);
  margin-top: 2px;
}
.server-hdr__actions {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-wrap: wrap;
}
.server-hdr__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(80px, 1fr));
  border: 1px solid var(--border);
  background: var(--bg-surface);
}
.server-stat {
  display: flex;
  flex-direction: column;
  min-width: 60px;
  padding: var(--sp-3);
  border-left: 1px solid var(--border);
}
.server-stat:first-child {
  border-left: 0;
}
.server-stat__label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--fg-muted);
  line-height: 1.4;
}
.server-stat__value {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.server-stat__of {
  font-weight: 400;
  color: var(--fg-muted);
  font-size: var(--fs-sm);
}

/* ----- Faction legend (chips under header) ----- */
.faction-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: var(--sp-3) 0 var(--sp-2);
}
.faction-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 10px;
  background: rgba(10, 14, 18, 0.55);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: var(--fs-sm);
}
.faction-chip__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--fc, #808080);
  box-shadow: 0 0 8px var(--fc, rgba(132, 166, 156, 0.4));
}
.faction-chip__name {
  color: var(--fg);
  font-weight: 500;
}
.faction-chip__count {
  color: var(--fg-muted);
  font-size: var(--fs-xs);
}

/* ----- Canvas map ----- */
.server-map {
  margin: var(--sp-3) 0;
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.server-map__viewport {
  position: relative;
  width: 100%;
  height: 820px;
  background: radial-gradient(ellipse at center, #0b1520 0%, #02060a 100%);
  overflow: hidden;
  display: flex;
}
/* Sidebar column */
.server-map__sidebar {
  flex: 0 0 240px;
  max-width: 240px;
  background: rgba(6, 10, 14, 0.85);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}
/* Canvas stage column */
.server-map__stage {
  flex: 1 1 auto;
  position: relative;
  min-width: 0;
  overflow: hidden;
}
.server-map__canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  position: relative;
  z-index: 1;
}
.server-map__canvas.is-dragging {
  cursor: grabbing;
}

.server-map__hud {
  position: absolute;
  top: var(--sp-2);
  right: var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 3;
}
.server-map__btn {
  width: 28px;
  height: 28px;
  min-width: 0;
  padding: 0;
  border-radius: var(--r-sm);
  background: rgba(14, 20, 25, 0.85);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition:
    background var(--t-fast),
    border-color var(--t-fast),
    color var(--t-fast);
}
.server-map__btn:hover {
  background: rgba(132, 166, 156, 0.22);
  border-color: var(--accent);
  color: var(--link-hover);
}

.server-map__tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(8, 12, 16, 0.96);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  font-size: var(--fs-sm);
  min-width: 180px;
  max-width: 300px;
  color: var(--fg);
  box-shadow: var(--shadow);
  z-index: 4;
  line-height: 1.35;
}
.server-map__tooltip[hidden] {
  display: none;
}
.server-map__tooltip .tt-head {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-bright);
}
.server-map__tooltip .tt-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.server-map__tooltip .tt-sub {
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  margin-bottom: 6px;
  margin-top: 2px;
}
.server-map__tooltip .tt-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--fs-xs);
  padding: 2px 0;
}
.server-map__tooltip .tt-row > span:first-child {
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 9px;
  padding-top: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}
.server-map__tooltip .tt-row > span:last-child {
  color: var(--fg);
  text-align: right;
}
.server-map__tooltip .tt-muted {
  color: var(--fg-muted);
}
.server-map__tooltip .tt-hint {
  margin-top: 6px;
  font-size: var(--fs-xs);
  color: var(--accent);
  font-style: italic;
}

.server-map__fallback {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-muted);
  font-size: var(--fs-sm);
  text-align: center;
  padding: var(--sp-4);
  z-index: 2;
}

.server-map__legend-hint {
  position: absolute;
  bottom: var(--sp-2);
  left: var(--sp-2);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-dim);
  z-index: 3;
  pointer-events: none;
}

/* ----- Sidebar rows (sectors / planets) ----- */
.sm-side__head {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(132, 166, 156, 0.08), transparent);
  flex-shrink: 0;
}
.sm-side__back {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  padding: 0 0 6px;
  color: var(--accent);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
}
.sm-side__back:hover {
  color: var(--link-hover);
}
.sm-side__title {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--accent-bright);
  letter-spacing: 0.02em;
}
.sm-side__sub {
  font-size: var(--fs-xs);
  color: var(--fg-muted);
  margin-top: 2px;
}
.sm-side__list {
  overflow-y: auto;
  flex: 1 1 auto;
  padding: 4px 0;
}
.sm-side__row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 12px;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  color: var(--fg);
  font-size: var(--fs-sm);
  text-align: left;
  cursor: pointer;
  transition:
    background var(--t-fast),
    border-color var(--t-fast),
    color var(--t-fast);
}
.sm-side__row:hover {
  background: rgba(132, 166, 156, 0.1);
  border-left-color: var(--accent);
  color: var(--link-hover);
}
.sm-side__dot {
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #808080;
  box-shadow: 0 0 6px currentColor;
}
.sm-side__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sm-side__meta {
  flex: 0 0 auto;
  font-size: 10px;
  color: var(--fg-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

/* Nested sector → solar-system layout */
.sm-side__sector {
  border-bottom: 1px solid rgba(132, 166, 156, 0.1);
}
.sm-side__sector:last-child {
  border-bottom: 0;
}
.sm-side__sector-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 4px;
  cursor: pointer;
  background: transparent;
  transition: background var(--t-fast);
}
.sm-side__sector-head:hover {
  background: rgba(132, 166, 156, 0.08);
}
/* the new pilots' sector, whose ships are capped by rank (server_map.php's new_pilots) */
.sm-side__tag {
  flex: 0 0 auto;
  padding: 0 4px;
  border: 1px solid #8fd8b0;
  color: #8fd8b0;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sm-side__sector-head .sm-side__name {
  font-weight: 600;
  color: var(--accent-bright);
  letter-spacing: 0.02em;
}
.sm-side__sector-head .sm-side__meta {
  color: var(--fg-muted);
  font-size: 10px;
}
.sm-side__solar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 3px 12px 3px 26px;
  background: transparent;
  border: 0;
  border-left: 2px solid transparent;
  color: var(--fg);
  font-size: var(--fs-sm);
  text-align: left;
  cursor: pointer;
  transition:
    background var(--t-fast),
    border-color var(--t-fast),
    color var(--t-fast);
}
.sm-side__solar:hover {
  background: rgba(132, 166, 156, 0.1);
  border-left-color: var(--accent);
  color: var(--link-hover);
}
.sm-side__solar-dot {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #808080;
}
.sm-side__sector:last-of-type {
  padding-bottom: 6px;
}

@media screen and (max-width: 780px) {
  .server-hdr__top,
  .server-hdr__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .server-hdr__stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .server-map__viewport {
    height: auto;
    min-height: 720px;
    flex-direction: column;
  }

  .server-map__sidebar {
    flex: 0 0 auto;
    max-width: none;
    max-height: 260px;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .server-map__stage {
    min-height: 520px;
  }
}

@media screen and (max-width: 520px) {
  .server-hdr__stats {
    grid-template-columns: 1fr;
  }

  .server-stat {
    grid-column: auto;
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .server-stat:first-child {
    border-top: 0;
  }
}

/* ============================================================
   CONTENT PAGES (admin + report + public modules)
   Shared classes used across modules so each page renders with
   the same heading, summary panel, listing table, filter UI,
   action links, and form layout.
   ============================================================ */

/* Page heading + breadcrumb */
.cp-heading {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--accent-bright);
  margin: 0 0 8px 0;
  letter-spacing: 0.02em;
}
.profile-badges-section .badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 160px));
  gap: var(--sp-3);
  padding: 0;
}

.profile-badge {
  display: grid;
  grid-template-rows: minmax(104px, auto) minmax(48px, auto);
  min-width: 0;
  overflow: hidden;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t-fast), transform var(--t-fast);
}

.profile-badge:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.profile-badge__image {
  display: grid;
  min-height: 104px;
  padding: var(--sp-3);
  place-items: center;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}

.profile-badge__image img {
  display: block;
  width: 72px;
  height: 72px;
  max-width: 100%;
  mix-blend-mode: screen;
  object-fit: contain;
}

/* In place of the picture of a badge that has none yet (the supporter tiers): a gold star in a ring. */
.profile-badge__emblem {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  color: #ddba60;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 4px var(--bg-elev), inset 0 0 0 5px color-mix(in srgb, currentColor 45%, transparent);
  font-size: 30px;
  line-height: 1;
}

.profile-badge__emblem::before {
  content: "\2605";
}

.profile-badge__title {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: var(--sp-2) var(--sp-3);
  color: var(--fg);
  font-size: var(--fs-xs);
  font-weight: 650;
  line-height: 1.35;
  text-align: center;
  overflow-wrap: anywhere;
  white-space: normal;
}

/* The profile's achievements (modules/profile.php): an icon, the name with its wins, what earned it and when */
.achievement-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-3);
}

.profile-achievement {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.profile-achievement img {
  display: block;
  width: 64px;
  height: 64px;
}

.profile-achievement__name {
  color: var(--fg);
  font-size: var(--fs-sm);
  font-weight: 650;
  line-height: 1.3;
}

.profile-achievement--held {
  border-color: var(--accent);
}

.profile-achievement img.profile-achievement__hidden {
  filter: grayscale(1) brightness(0.45);
}

.profile-achievement__times {
  color: #ddba60;
  font-weight: 700;
}

.profile-achievement__desc,
.profile-achievement__date,
.profile-achievements__none {
  color: var(--fg-muted);
  font-size: var(--fs-xs);
  line-height: 1.4;
}

.detail-layout {
  display: grid;
  grid-template-columns: clamp(300px, 26vw, 390px) minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: start;
}

.detail-stack {
  display: grid;
  gap: var(--sp-4);
}

.detail-list {
  width: 100%;
  border-collapse: collapse;
}

.detail-list th,
.detail-list td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  text-align: left;
}

.detail-list tr:last-child th,
.detail-list tr:last-child td {
  border-bottom: 0;
}

.detail-list th {
  width: 38%;
  color: var(--fg-muted);
  background: var(--bg-elev);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.detail-list td {
  color: var(--fg);
  font-size: var(--fs-sm);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.detail-layout .clan-roster {
  margin-top: 0;
}

.profile-page .profile-info {
  display: table;
  table-layout: fixed;
}

.profile-page .profile-info > tbody {
  display: table-row-group;
}

.profile-page .profile-info tr {
  display: table-row;
  width: 100%;
  background: transparent;
  border: 0;
}

.profile-page .profile-info tr:not(:last-child) td {
  border-bottom: 1px solid var(--border);
}

.profile-page .profile-info td {
  display: table-cell;
  padding: var(--sp-3) var(--sp-4);
  vertical-align: middle;
}

.profile-page .profile-info__label {
  width: 42%;
  margin: 0;
  background: var(--bg-elev);
}

.profile-page .profile-info__value {
  align-self: center;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.profile-metric-groups {
  display: grid;
  gap: var(--sp-4);
}

.profile-metric-group {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.profile-metric-group h3 {
  margin: 0;
  padding: var(--sp-2) var(--sp-3);
  color: var(--accent-bright);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-list {
  margin: 0;
}

.metric-list > div {
  display: grid;
  grid-template-columns: minmax(180px, 42%) minmax(0, 1fr);
  min-height: 42px;
  border-bottom: 1px solid var(--border);
}

.metric-list > div:last-child {
  border-bottom: 0;
}

.metric-list dt,
.metric-list dd {
  display: flex;
  align-items: center;
  margin: 0;
  padding: var(--sp-2) var(--sp-3);
}

.metric-list dt {
  color: var(--fg-muted);
  background: var(--surface-highlight);
  font-size: var(--fs-xs);
}

.metric-list dd {
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.cp-back {
  display: inline-block;
  margin-bottom: 12px;
  font-size: var(--fs-sm);
}
.cp-add {
  font-weight: bold;
}

/* Page-level toolbar: bar at the top of a content page with optional
   title on the left and pill-style action buttons on the right. Built
   as a table (one row, two cells). Used by
   profile, clan, and any page with page-level actions. */
.cp-toolbar {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  margin-bottom: 14px;
}
.cp-toolbar td {
  padding: 8px 12px;
  vertical-align: middle;
}
.cp-toolbar__title {
  color: var(--accent-bright);
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.cp-toolbar__title small {
  color: var(--fg-muted);
  font-weight: normal;
  margin-left: 6px;
}

/* Pill-button action links. Variants for primary / admin / current. */
.cp-toolbar__link,
.cp-toolbar__current {
  display: inline-block;
  padding: 3px 10px;
  margin-left: 4px;
  border: 1px solid var(--border-strong);
  text-decoration: none;
  font-size: var(--fs-base);
  line-height: 1.4;
}
.cp-toolbar__link {
  background: var(--bg-surface);
  color: var(--fg);
}
.cp-toolbar__link:hover {
  background: var(--bg-surface-2);
  color: var(--link-hover);
}
.cp-toolbar__link--primary {
  background: #1c2e2b;
  border-color: #2d544d;
  color: var(--accent-bright);
}
.cp-toolbar__link--primary:hover {
  background: #23403b;
  border-color: #3d7068;
  color: var(--link-hover);
}
.cp-toolbar__link--admin {
  background: #2f1c1c;
  border-color: #5a2525;
  color: #f3cccc;
}
.cp-toolbar__link--admin:hover {
  background: #432121;
  border-color: #822f2f;
  color: var(--link-hover);
}
.cp-toolbar__current {
  background: var(--bg-surface-2);
  color: var(--link-hover);
  font-weight: bold;
}
.cp-toolbar__current--disabled {
  background: var(--bg);
  color: var(--fg-dim);
  font-weight: normal;
}

/* Summary panel: 2-column key/value strip used at the top of
   most listing pages. */
.cp-summary {
  width: auto;
  margin: 0 0 12px 0;
  font-size: var(--fs-base);
}
.cp-summary td {
  padding: 4px 12px 4px 0;
  vertical-align: top;
}
.cp-summary td b {
  color: var(--fg-muted);
  font-weight: 600;
}

/* Filter bar: [period] [status] [search] strip. Currently just
   a thin wrapper class so the bar matches everywhere; modules
   keep using inline links inside it. */
.cp-filter {
  margin: 0 0 12px 0;
  font-size: var(--fs-base);
}
.cp-filter td {
  padding: 2px 6px 2px 0;
}
.cp-filter b {
  color: var(--fg-muted);
}
.cp-filter a {
  margin-right: 4px;
}
.cp-filter .cur {
  color: var(--link-hover);
  font-weight: bold;
}

/* Pagination strip */
.cp-pager {
  font-size: var(--fs-sm);
  margin: 0 0 12px 0;
  color: var(--fg-muted);
}
.cp-pager a {
  margin-right: 6px;
}

/* Wrap wide tables in <div class='cp-scroll'> so phones (and
   any narrow viewport) can scroll horizontally instead of
   overflowing. */
.cp-scroll {
  overflow-x: auto;
}

/* Listing table */
.cp-list {
  width: 100%;
  font-size: var(--fs-base);
  border-collapse: collapse;
}
.cp-list th,
.cp-list td {
  padding: 4px 6px;
  vertical-align: top;
}
.cp-list thead tr,
.cp-list tr.cp-list__head {
  background: var(--bg-surface-2);
  color: var(--accent-bright);
  text-align: left;
}
.cp-list thead th,
.cp-list tr.cp-list__head td {
  font-weight: bold;
  padding: 6px;
}
/* Striping. Modules apply alternating row classes. The ladder per skin is bg-elev → bg-surface,
   sitting under the header's bg-surface-2. */
.cp-list tr.cp-row-a td {
  background: var(--bg-elev);
}
.cp-list tr.cp-row-b td {
  background: var(--bg-surface);
}
.cp-list tr.cp-row-dim td {
  color: var(--fg-dim);
}

/* Watch-type row tints (admin_watch, watchlist) — semantic washes,
   not skin palette: blue = watch, olive = kick, red = ban. */
.cp-list tr.cp-row-watch td {
  background: #022037;
}
.cp-list tr.cp-row-kick td {
  background: #282602;
}
.cp-list tr.cp-row-ban td {
  background: #300808;
}

/* Action-link cluster: [edit] [del] [dup]. Slightly bumped
   spacing so it's tappable on phones. */
.cp-actions {
  white-space: nowrap;
  text-align: right;
}
.cp-actions a {
  padding: 2px 4px;
  margin-left: 2px;
}

/* Status badges (used in listings: ON/off, CAPTURED, REFUSED) */
.cp-badge-ok {
  color: var(--accent);
  font-weight: bold;
}
.cp-badge-bad {
  color: var(--danger);
}
.cp-badge-warn {
  color: #ddba60;
}
.cp-badge-mute {
  color: var(--fg-dim);
}

/* Form layout: 180px label column, full-width inputs capped at
   600px so they don't stretch silly-wide on desktop but do go
   full width on narrow screens. */
.cp-form {
  width: 100%;
  font-size: var(--fs-base);
}
.cp-form td {
  padding: 6px;
  vertical-align: top;
}
.cp-form td.cp-form__label {
  width: 180px;
  font-weight: bold;
}
.cp-form td.cp-form__label small {
  display: block;
  font-weight: normal;
  color: var(--fg-muted);
}
.cp-form input[type="text"],
.cp-form input[type="password"],
.cp-form input[type="email"],
.cp-form textarea,
.cp-form select {
  width: 100%;
  max-width: 600px;
  box-sizing: border-box;
}

/* Footer note block — small italic explanatory text under a
   listing or form. */
.cp-foot {
  font-size: var(--fs-sm);
  color: var(--fg-muted);
  font-style: italic;
  margin-top: 8px;
}
.cp-foot code {
  font-style: normal;
  font-family: var(--font-mono);
  color: var(--accent);
}

/* Forum smilies. Stored inside post text as bare <img> with no class, so the
   only handle is the src. Baseline-aligned by default, which leaves them
   hanging below the line; middle plus a small lift centres them on the text's
   cap height rather than its x-height. */
img[src*="/smiles/"] {
  vertical-align: middle;
  position: relative;
  top: -2px;
}

/* --------------------------------------------------------------- smilies
   Forum smilies are Font Awesome 7 Free (Regular) glyphs, emitted by
   phpBB/functions.php smile() as <span class="smiley">&#xF118;</span>.
   The codepoint is written as an HTML entity, not a raw UTF-8 character:
   the site is Latin-1 end to end and a literal glyph would not survive.
   Font file and licence: interface/fonts/. */
@font-face {
  font-family: 'ds-smilies';
  src: url('fonts/fa-regular-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

.smiley {
  font-family: 'ds-smilies';
  font-weight: 400;
  font-style: normal;
  /* slightly larger than the surrounding text - a face needs more area than a
     letter to read at the same optical size */
  font-size: 1.15em;
  line-height: 1;
  color: #ddba60;
  /* sits on the text's optical centre; `middle` would align to x-height */
  vertical-align: -0.14em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===================================================================
 * GameCQ shared modern interface
 * Colour, typography and identity come from the :root tokens at the top of
 * this file.
 * =================================================================== */

/* ---------- resilient foundation ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color: var(--fg);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--border-strong) var(--bg-elev);
  scrollbar-width: thin;
}

body {
  min-width: 0;
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Tracking is a Latin-script device: Thai, Chinese, Japanese and Korean are
   set without it. Important because components across this file set their own. */
:lang(th),
:lang(zh),
:lang(ja),
:lang(ko) {
  letter-spacing: 0 !important;
}

/* Their faces follow the Latin ones in every stack: the system's first, then
   Noto. The stacks are declared again here, not only at :root, so that text in
   another language than the page's (the language picker's list) gets its own. */
:lang(th) {
  --font-script: "Leelawadee UI", "Noto Sans Thai";
}

:lang(zh-hans) {
  --font-script: "Microsoft YaHei", "PingFang SC", "Noto Sans SC";
}

:lang(zh-hant) {
  --font-script: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC";
}

:lang(ja) {
  --font-script: "Yu Gothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP";
}

:lang(ko) {
  --font-script: "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR";
}

:lang(th),
:lang(zh-hans),
:lang(zh-hant),
:lang(ja),
:lang(ko) {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, var(--font-script), sans-serif;
  --font-display: "Arial Narrow", "Roboto Condensed", "Segoe UI", var(--font-script), sans-serif;
  --font-mono: "JetBrains Mono", Consolas, Menlo, Monaco, var(--font-script), monospace;
}

::selection {
  color: var(--link-hover);
  background: var(--accent-glow);
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--accent-bright);
  text-decoration-color: color-mix(in srgb, var(--accent) 52%, transparent);
  text-underline-offset: 0.18em;
  transition: color var(--t-fast), text-decoration-color var(--t-fast);
}

a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}

a:active {
  color: var(--link-active);
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-block: 0 0.65em;
  color: var(--fg);
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1.15;
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4,
h5,
h6 { font-size: var(--fs-md); }

p {
  margin-block: 0 1em;
}

hr {
  height: 1px;
  border: 0;
  background: var(--border);
}

code,
kbd,
pre,
samp {
  font-family: var(--font-mono);
}

pre,
code {
  color: var(--fg);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

code {
  padding: 0.12em 0.3em;
}

pre {
  max-width: 100%;
  padding: var(--sp-3);
  overflow: auto;
}

/* ---------- page shell ---------- */

.modern-shell {
  min-height: 100dvh;
  color: var(--fg);
  background:
    linear-gradient(180deg, var(--surface-highlight), transparent 210px),
    var(--bg);
  isolation: isolate;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: var(--sp-2);
  left: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  color: var(--bg);
  background: var(--accent-bright);
  border-radius: var(--r-sm);
  font-weight: 700;
  transform: translateY(calc(-100% - var(--sp-4)));
  transition: transform var(--t-fast);
}

.skip-link:focus {
  color: var(--bg);
  transform: translateY(0);
}

.site-header {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto minmax(180px, 1fr);
  align-items: center;
  min-height: 74px;
  padding: var(--sp-3) max(var(--sp-4), calc((100vw - var(--page-max)) / 2));
  border-bottom: 1px solid var(--border-strong);
  background: var(--header-bg);
  box-shadow: var(--shadow-sm);
}

.site-header::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 1px;
  content: "";
  background: var(--header-line);
  opacity: 0.7;
}

.site-brand {
  display: inline-flex;
  gap: var(--sp-3);
  align-items: center;
  min-width: 0;
  color: var(--fg);
  text-decoration: none;
}

.site-brand:hover {
  color: var(--fg);
}

.site-brand__mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  color: var(--accent-bright);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 16px var(--accent-glow);
}

.site-brand__name {
  overflow: hidden;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  letter-spacing: var(--brand-tracking);
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.site-brand__strapline {
  display: block;
  margin-top: var(--sp-1);
  color: var(--fg-muted);
  font-size: var(--fs-xxs);
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.site-header__status {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.site-header__account {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.site-header__telemetry {
  min-width: 150px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  line-height: 1.35;
  text-align: left;
}

.site-header__welcome {
  align-self: flex-start;
  overflow: hidden;
  font-size: var(--fs-xs);
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-header__logout {
  display: inline-flex;
  flex: 0 0 auto;
  margin: 0;
}

/* Log out and the language picker's toggle are a pair: the same height,
   padding and type. Specific enough to win over .button's own. */
.site-header__account :is(.site-header__logout-button, .language-picker__toggle) {
  min-height: var(--control-height);
  padding: 6px 12px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: none;
}

/* The toggle shows the current language's flag and name. Its name gives way,
   like the welcome line, when the header is narrow; the open list overlays the
   page instead of pushing it down. */
.language-picker {
  position: relative;
  flex: 0 1 auto;
  min-width: 0;
}

.language-picker__toggle {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
  color: var(--fg);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
  list-style: none;
  cursor: pointer;
  transition: border-color var(--t-fast);
}

.language-picker__toggle::-webkit-details-marker {
  display: none;
}

.language-picker__toggle:hover,
.language-picker[open] > .language-picker__toggle {
  border-color: var(--accent);
}

.language-picker__toggle::after {
  flex: 0 0 auto;
  width: 5px;
  height: 5px;
  content: "";
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.language-picker[open] > .language-picker__toggle::after {
  transform: translateY(1px) rotate(-135deg);
}

.language-picker__current {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.language-picker__list {
  position: absolute;
  z-index: 30;
  top: calc(100% + var(--sp-1));
  right: 0;
  display: grid;
  gap: 2px;
  width: max-content;
  min-width: 100%;
  max-width: calc(100vw - 2 * var(--sp-4));
  margin: 0;
  padding: var(--sp-1);
  list-style: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-lg);
}

.language-picker__link,
.language-picker__link:visited {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  padding: 6px var(--sp-3);
  color: var(--fg-muted);
  border-left: 2px solid transparent;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  font-size: var(--fs-xs);
  text-decoration: none;
  white-space: nowrap;
}

.language-picker__link:hover {
  color: var(--fg);
  background: var(--surface-highlight);
  border-left-color: var(--border-strong);
}

.language-picker__flag {
  flex: 0 0 auto;
}

.language-picker__link[aria-current="true"] {
  color: var(--accent-bright);
  background: var(--accent-glow);
  border-left-color: var(--accent);
}

.site-status {
  display: inline-flex;
  gap: var(--sp-2);
  align-items: center;
  color: var(--fg-muted);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.site-status::before {
  width: 7px;
  height: 7px;
  content: "";
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px color-mix(in srgb, var(--success) 65%, transparent);
}

.site-status--warning::before { background: var(--warning); }
.site-status--offline::before { background: var(--danger); }

.site-layout {
  display: grid;
  grid-template-columns: var(--nav-width) minmax(0, 1fr) var(--rail-width);
  gap: var(--sp-4);
  width: min(100%, var(--page-max));
  margin-inline: auto;
  padding: var(--sp-4);
}

.site-layout--wide {
  grid-template-columns: var(--nav-width) minmax(0, 1fr);
}

.site-layout--wide .context-rail {
  display: none;
}

.site-nav,
.context-rail {
  align-self: start;
  min-width: 0;
}

.site-nav {
  position: sticky;
  top: var(--sp-4);
}

.site-nav__disclosure {
  margin: 0;
  padding: 0;
  border: 0;
}

.site-nav__toggle {
  display: none;
  cursor: pointer;
}

.site-nav__body {
  display: grid;
  gap: var(--sp-3);
}

.site-nav__legacy-list {
  padding: var(--sp-2);
}

.site-nav__legacy-list table.menu_text {
  width: 100%;
}

.site-nav__legacy-list table.menu_text a[aria-current="page"] {
  color: var(--accent-bright);
  background: var(--accent-glow);
  border-left-color: var(--accent);
  box-shadow: inset 2px 0 0 var(--accent);
}

.site-nav__section,
.context-card,
.panel,
.module-panel,
.cp-form,
.ticket-form {
  min-width: 0;
  overflow: hidden;
  background: linear-gradient(180deg, var(--surface-highlight), transparent 54px), var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}

.site-nav__heading,
.context-card__heading,
.panel__heading,
.module-panel__heading {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  min-height: 34px;
  margin: 0;
  padding: var(--sp-2) var(--sp-3);
  color: var(--accent-bright);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
}

.site-nav__list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: var(--sp-2);
  list-style: none;
}

.site-nav__link {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  min-height: 34px;
  padding: var(--sp-2) var(--sp-3);
  color: var(--fg-muted);
  border-left: 2px solid transparent;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  text-decoration: none;
}

.site-nav__link:hover {
  color: var(--fg);
  background: var(--surface-highlight);
  border-left-color: var(--border-strong);
}

.site-nav__link[aria-current="page"],
.site-nav__link--active {
  color: var(--accent-bright);
  background: var(--accent-glow);
  border-left-color: var(--accent);
}

.site-nav__meta {
  margin-left: auto;
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
}

.site-main {
  min-width: 0;
  padding: clamp(var(--sp-4), 2vw, var(--sp-6));
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}

.site-main--flush {
  padding: 0;
}

.site-main__content {
  display: flow-root;
  min-width: 0;
}

.context-rail {
  position: sticky;
  top: var(--sp-4);
  display: grid;
  gap: var(--sp-3);
}

.context-card__body,
.panel__body,
.module-panel__body {
  padding: var(--sp-3);
}

.context-search {
  display: grid;
  gap: var(--sp-2);
}

.context-search__input,
.context-search__submit {
  width: 100%;
}

.context-search__scope {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  flex-wrap: wrap;
  color: var(--fg-muted);
  font-size: var(--fs-xs);
}

.context-search__scope label {
  display: inline-flex;
  gap: var(--sp-1);
  align-items: center;
  cursor: pointer;
}

.site-footer {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  justify-content: space-between;
  width: min(100%, var(--page-max));
  min-height: 54px;
  margin-inline: auto;
  padding: var(--sp-3) var(--sp-4) var(--sp-6);
  color: var(--fg-dim);
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
}

.site-footer__links {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

/* ---------- reusable controls ---------- */

button,
input,
select,
textarea {
  max-width: 100%;
  color: var(--fg);
  font: inherit;
}

:where(input:not([type="checkbox"]):not([type="radio"]):not([type="image"]), select, textarea) {
  min-height: var(--control-height);
  padding: 6px 9px;
  color: var(--fg);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
}

textarea {
  min-height: 96px;
  line-height: 1.45;
  resize: vertical;
}

select {
  cursor: pointer;
}

input::placeholder,
textarea::placeholder {
  color: var(--fg-dim);
  opacity: 1;
}

:where(input, select, textarea):disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

button,
input[type="button"],
input[type="submit"],
input[type="reset"],
.button,
.cp-add {
  display: inline-flex;
  gap: var(--sp-2);
  align-items: center;
  justify-content: center;
  min-height: var(--control-height);
  padding: 6px 12px;
  color: var(--bg);
  background: var(--accent);
  border: 1px solid var(--accent-bright);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  text-transform: none;
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}

button:hover,
input[type="button"]:hover,
input[type="submit"]:hover,
input[type="reset"]:hover,
.button:hover,
.cp-add:hover {
  color: var(--bg);
  background: var(--accent-bright);
  transform: translateY(-1px);
}

.button--quiet,
.cp-back {
  color: var(--fg);
  background: var(--bg-surface-2);
  border-color: var(--border-strong);
}

.button--danger,
.ticket-form__danger {
  color: var(--link-hover);
  background: color-mix(in srgb, var(--danger) 70%, var(--bg-surface));
  border-color: var(--danger);
}

/* Visited links are more specific than .button. Keep action text legible
   without removing the useful visited colour from ordinary links. */
.button:visited,
.cp-add:visited {
  color: var(--bg);
}

.button--quiet:visited,
.cp-back:visited {
  color: var(--fg);
}

/* ---------- dense data and administration ---------- */

.cp-heading,
.page-heading {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  justify-content: space-between;
  margin: 0 0 var(--sp-4);
  padding-bottom: var(--sp-3);
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 650;
}

.cp-toolbar,
.filter-bar,
.action-bar {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  margin: 0 0 var(--sp-3);
  padding: var(--sp-2);
  overflow-x: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.cp-summary,
.summary-strip {
  min-height: 36px;
  margin-bottom: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  color: var(--fg-muted);
  background: var(--bg-surface);
  border-left: 2px solid var(--accent);
}

.summary-strip,
div.cp-summary {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  flex-wrap: wrap;
}

table.cp-summary {
  display: table;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

table.cp-summary td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

table.cp-summary tr:last-child td {
  border-bottom: 0;
}

.cp-filter {
  margin-bottom: var(--sp-3);
  padding: var(--sp-3);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

div.cp-filter,
form.cp-filter {
  display: flex;
  gap: var(--sp-2);
  align-items: flex-end;
  flex-wrap: wrap;
}

table.cp-filter {
  display: table;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

table.cp-filter td,
tr.cp-filter > td {
  padding: var(--sp-1) var(--sp-2);
  vertical-align: top;
}

tr.cp-filter {
  display: table-row;
}

.cp-scroll {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  scrollbar-color: var(--border-strong) var(--bg-elev);
  scrollbar-width: thin;
}

.cp-list {
  width: 100%;
  min-width: 520px;
  margin: 0;
  color: var(--fg);
  background: var(--bg-surface);
  border: 0;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: var(--fs-sm);
}

.cp-list > :is(thead, tbody, tfoot) > tr > :is(th, td),
.cp-list > tr > :is(th, td) {
  height: 38px;
  padding: var(--sp-2) var(--sp-3);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.cp-list > :is(thead, tbody, tfoot) > tr > :is(th, td):last-child,
.cp-list > tr > :is(th, td):last-child {
  border-right: 0;
}

.cp-list__head,
.cp-list thead {
  color: var(--accent-bright);
  background: var(--bg-elev);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cp-list__head > td,
.cp-list thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-elev);
}

.cp-list > tbody > tr:nth-child(even),
.cp-list > tr:nth-child(even):not(.cp-list__head),
.cp-list__row--alt {
  background: var(--row-alt);
}

.cp-list > tbody > tr:hover,
.cp-list > tr:not(.cp-list__head):hover,
.cp-list__row:hover {
  background: var(--surface-highlight);
}

.cp-actions {
  width: 1%;
  text-align: right !important;
  white-space: nowrap;
}

.cp-actions a + a,
.cp-actions button + button {
  margin-left: var(--sp-2);
}

.cp-pager {
  display: flex;
  gap: var(--sp-1);
  align-items: center;
  justify-content: flex-end;
  margin-top: var(--sp-3);
}

.cp-pager a,
.cp-pager span {
  display: grid;
  min-width: 30px;
  min-height: 30px;
  padding: var(--sp-1) var(--sp-2);
  place-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  text-decoration: none;
}

.cp-pager [aria-current="page"],
.cp-pager .selected {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent-bright);
}

.cp-form {
  margin-bottom: var(--sp-4);
  padding: var(--sp-4);
}

.cp-form table {
  width: 100%;
}

.cp-form td {
  padding: var(--sp-2);
  vertical-align: top;
}

.cp-form td:first-child:not(:only-child) {
  width: clamp(130px, 22%, 220px);
  color: var(--fg-muted);
  font-size: var(--fs-xs);
  font-weight: 650;
}

.cp-foot {
  display: flex;
  gap: var(--sp-2);
  justify-content: flex-end;
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}

/* ---------- support, profile, and live service modules ---------- */

.ticket-nav {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  padding: var(--sp-2);
  overflow-x: auto;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.ticket-nav a,
.ticket-nav__current {
  display: inline-flex;
  min-height: 30px;
  padding: var(--sp-1) var(--sp-2);
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}

.ticket-nav__current {
  color: var(--accent-bright);
  background: var(--accent-glow);
  border-left: 2px solid var(--accent);
  font-weight: 700;
}

.ticket-msg {
  margin-bottom: var(--sp-3);
  padding: var(--sp-3);
  color: var(--fg-muted);
  background: var(--bg-surface);
  border-left: 3px solid var(--border-strong);
}

.ticket-msg--ok {
  background: color-mix(in srgb, var(--success) 8%, var(--bg-surface));
  border-left-color: var(--success);
}

.ticket-msg--error {
  background: color-mix(in srgb, var(--danger) 8%, var(--bg-surface));
  border-left-color: var(--danger);
}

.ticket-status {
  display: inline-flex;
  min-height: 21px;
  padding: 1px 8px;
  color: var(--fg-muted);
  align-items: center;
  background: var(--bg-elev);
  border: 1px solid currentColor;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ticket-status--open { color: var(--accent-bright); }
.ticket-status--awaiting-staff { color: var(--warning); }
.ticket-status--awaiting-player { color: var(--success); }
.ticket-status--closed { color: var(--fg-muted); }
.ticket-status--terminated { color: var(--danger); }

.ticket-role {
  margin-left: var(--sp-1);
  color: var(--accent-bright);
  font-size: var(--fs-xs);
  font-weight: 500;
}

.ticket-list {
  width: 100%;
  min-width: 680px;
  margin-bottom: var(--sp-3);
  color: var(--fg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-collapse: collapse;
}

.ticket-list th,
.ticket-list td {
  height: 40px;
  padding: var(--sp-2) var(--sp-3);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.ticket-list th {
  color: var(--accent-bright);
  background: var(--bg-elev);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ticket-list tr:hover > td {
  background: var(--surface-highlight);
}

.ticket-list__id {
  width: 60px;
  color: var(--fg-dim);
  font-family: var(--font-mono);
}

.ticket-list__category,
.ticket-list__creator,
.ticket-list__status,
.ticket-list__date,
.ticket-list__action {
  white-space: nowrap;
}

.ticket-list__category { color: var(--accent-bright); }
.ticket-list__date { color: var(--fg-muted); }
.ticket-list__action { text-align: right; }

.ticket-thread {
  margin-bottom: var(--sp-4);
}

.ticket-thread__subject {
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-3);
  color: var(--fg);
  border-bottom: 1px solid var(--border-strong);
  font-size: var(--fs-lg);
  font-weight: 700;
}

.ticket-thread__category {
  display: inline-flex;
  min-height: 22px;
  margin-right: var(--sp-2);
  padding: 1px 8px;
  color: var(--accent-bright);
  align-items: center;
  background: var(--accent-glow);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ticket-message {
  margin-bottom: var(--sp-2);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.ticket-message--staff {
  background: linear-gradient(145deg, var(--surface-highlight), transparent 70%), var(--bg-surface);
  border-left: 2px solid var(--accent);
}

.ticket-message__meta {
  display: flex;
  gap: var(--sp-2);
  justify-content: space-between;
  padding: var(--sp-2) var(--sp-3);
  color: var(--fg-muted);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}

.ticket-message__author {
  color: var(--accent-bright);
  font-weight: 700;
}

.ticket-message__date {
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

.ticket-message__body {
  padding: var(--sp-3);
  overflow-wrap: anywhere;
}

.ticket-pager {
  margin-bottom: var(--sp-3);
  color: var(--fg-muted);
  font-size: var(--fs-xs);
}

.ticket-pager__current {
  padding-inline: var(--sp-1);
  color: var(--accent-bright);
  font-weight: 700;
}

.ticket-form {
  width: auto;
  margin: 0 0 var(--sp-4);
  padding: var(--sp-4);
}

.ticket-form__field {
  display: block;
  margin-bottom: var(--sp-3);
}

.ticket-form__label {
  display: block;
  margin-bottom: var(--sp-1);
  color: var(--fg-muted);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ticket-form__input,
.ticket-form__textarea,
.ticket-form__select {
  width: 100%;
}

.ticket-form__textarea {
  min-height: 190px;
}

.ticket-form__hint {
  margin-top: var(--sp-1);
  color: var(--fg-dim);
  font-size: var(--fs-xs);
}

.ticket-form__actions {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  justify-content: flex-end;
  margin-top: var(--sp-4);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--border);
}

.module-heading {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--border-strong);
}

.module-heading h1,
.module-title,
.section-title {
  margin: 0;
}

.module-heading h1 {
  color: var(--fg);
  font-size: clamp(var(--fs-xl), 2.4vw, 30px);
}

.module-heading__eyebrow {
  margin: 0 0 var(--sp-1);
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.module-heading__meta {
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

.section-title {
  font-size: var(--fs-lg);
}

.empty-state {
  padding: var(--sp-5);
  color: var(--fg-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
}

.staff-page,
.news-page {
  padding-bottom: var(--sp-3);
}

.staff-grid {
  display: grid;
  gap: var(--sp-4);
}

.staff-section {
  min-width: 0;
}

.staff-section__title {
  display: flex;
  gap: var(--sp-2);
  align-items: baseline;
  margin: 0 0 var(--sp-2);
  padding-bottom: var(--sp-2);
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.staff-section__count {
  color: var(--fg-dim);
  font-size: var(--fs-xxs);
  font-weight: 500;
}

.staff-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--sp-2);
}

.staff-card {
  min-width: 0;
  padding: var(--sp-3);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
}

.staff-card__name {
  color: var(--fg);
  font-size: var(--fs-md);
  font-weight: 700;
  text-decoration: none;
}

.staff-card__name:hover {
  color: var(--accent-bright);
}

.staff-card__roles {
  display: flex;
  gap: var(--sp-1);
  align-items: center;
  flex-wrap: wrap;
  margin-top: var(--sp-2);
}

.staff-badge {
  display: inline-flex;
  padding: 2px 6px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.4;
  text-transform: uppercase;
}

.staff-badge--admin { color: var(--danger); }
.staff-badge--dev { color: var(--accent-bright); }
.staff-badge--mod { color: var(--success); }
.staff-badge--editor { color: var(--warning); }

.news-article__head {
  display: flex;
  gap: var(--sp-3);
  align-items: flex-start;
  justify-content: space-between;
}

.news-page__embedded-title {
  margin-bottom: var(--sp-3);
}

.news-article__title {
  margin: 0;
  color: var(--fg);
  font-size: var(--fs-lg);
}

.news-article__link {
  color: inherit;
  text-decoration: none;
}

.news-article__link:hover,
.news-article__link:focus-visible {
  text-decoration: underline;
}

.news-article__byline {
  margin: var(--sp-1) 0 0;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
}

.news-article__mark {
  width: auto;
  max-width: min(220px, 32%);
  height: auto;
  object-fit: contain;
}

/* The category in words, where the page's language is not the badge image's
   English (news.php). */
.news-article__category {
  flex: 0 0 auto;
  max-width: min(220px, 32%);
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.news-article__body {
  color: var(--fg);
  font-size: var(--fs-sm);
  line-height: 1.65;
}

.account-page {
  width: 100%;
  max-width: 620px;
  margin-inline: auto;
}

.account-page--registration {
  max-width: 840px;
}

.account-page > table {
  width: 100% !important;
  padding: var(--sp-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
}

.account-page form input[type="text"],
.account-page form input[type="password"],
.account-page form input[type="email"] {
  width: min(100%, 420px);
}

.account-step {
  padding: var(--sp-3) !important;
  color: var(--fg-muted);
  background: var(--bg-elev);
  border-bottom: 2px solid var(--border);
}

.account-step--current {
  color: var(--fg);
  background: var(--bg-surface-2);
  border-bottom-color: var(--accent);
}

.account-step--complete {
  color: var(--success);
  border-bottom-color: var(--success);
}

.account-step__label {
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: 0.04em;
}

.account-message {
  display: inline-block;
  padding: var(--sp-2) var(--sp-3);
  color: var(--fg);
  background: var(--bg-surface);
  border-left: 3px solid var(--accent);
  font-size: var(--fs-sm);
}

.account-message--success {
  border-left-color: var(--success);
}

.account-message--error {
  border-left-color: var(--danger);
}

.account-hint {
  color: var(--fg-muted);
  font-size: var(--fs-xs);
  line-height: 1.55;
}

.event-count {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.event-remaining {
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  white-space: nowrap;
}

/* the cluster an event is in, on the Events page with every cluster shown */
.events-cluster {
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-style: normal;
  letter-spacing: 0.04em;
  white-space: nowrap;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
}

.cp-notice {
  margin: var(--sp-3) 0;
  padding: var(--sp-3);
  color: var(--fg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}

.cp-notice--error {
  border-left-color: var(--danger);
}

.cp-notice--success {
  border-left-color: var(--success);
}

.cp-muted,
.log-entry__actions {
  color: var(--fg-muted);
}

.log-entry__actions {
  text-align: left;
}

.cp-toolbar--section {
  margin-top: var(--sp-4);
}

.store-cart__summary,
.store-category__heading {
  padding: var(--sp-2) var(--sp-3) !important;
  color: var(--fg);
  background: var(--bg-surface-2) !important;
  border-left: 2px solid var(--accent);
}

.store-cart__count,
.store-panel__title {
  color: var(--fg);
  font-size: var(--fs-md);
}

.store-payment__label {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

.store-notice {
  display: block;
  margin-bottom: var(--sp-3);
  padding: var(--sp-3);
  color: var(--fg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--success);
  font-size: var(--fs-sm);
}

.store-notice--locked {
  border-left-color: var(--danger);
}

.profile-page {
  padding-bottom: var(--sp-3);
}

.profile-toolbar {
  justify-content: space-between;
}

.cp-toolbar__group {
  display: flex;
  gap: var(--sp-1);
  align-items: center;
  flex-wrap: wrap;
}

.cp-toolbar__group--actions {
  justify-content: flex-end;
}

.profile-grid {
  display: block;
  width: 100%;
  margin: 0;
}

.profile-grid > tbody,
.profile-grid > tbody > tr {
  display: block;
  width: 100%;
}

.profile-grid > tbody > tr {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}

.profile-grid > tbody > tr > td {
  display: block;
  width: auto !important;
  min-width: 0;
  padding: 0;
  vertical-align: top;
}

.profile-panel__title {
  margin: 0;
  padding: var(--sp-3);
  color: var(--accent-bright);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-bottom: 0;
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.profile-info,
.profile-ranking,
.profile-order__items {
  width: 100%;
  color: var(--fg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.profile-info td,
.profile-ranking td,
.profile-order__items th,
.profile-order__items td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.profile-info tr:last-child td,
.profile-ranking tr:last-child td,
.profile-order__items tr:last-child td {
  border-bottom: 0;
}

.profile-info__label,
.profile-ranking__label {
  width: min(42%, 190px);
  color: var(--fg-muted);
  background: var(--row-alt);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-info__value,
.profile-ranking__value {
  color: var(--fg);
  overflow-wrap: anywhere;
}

.profile-ranking__value--primary {
  color: var(--accent-bright);
  font-size: var(--fs-md);
  font-weight: 750;
}

.profile-progress {
  margin-top: var(--sp-3);
  padding: var(--sp-3);
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.profile-progress__track {
  height: 7px;
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
}

.profile-progress__fill {
  display: block;
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}

.profile-progress__caption {
  margin-top: var(--sp-2);
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

.profile-ranking__empty,
.profile-orders__empty {
  padding: var(--sp-4);
  color: var(--fg-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  font-style: italic;
}

.profile-order {
  margin-bottom: var(--sp-3);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.profile-order__head {
  display: flex;
  gap: var(--sp-3) var(--sp-5);
  padding: var(--sp-3);
  flex-wrap: wrap;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}

.profile-order__meta {
  color: var(--fg);
}

.profile-order__meta strong {
  margin-right: var(--sp-1);
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-order__status {
  font-weight: 700;
}

.profile-order__status--pending { color: var(--warning); }
.profile-order__status--complete { color: var(--success); }

.profile-order__items {
  border: 0;
}

.profile-order__items th {
  color: var(--accent-bright);
  background: var(--bg-elev);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-signature {
  padding: var(--sp-4);
  color: var(--fg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
}

/* ---------- fleet identity, management, and roster ---------- */

.clan-page {
  padding-bottom: var(--sp-3);
}

.clan-toolbar {
  justify-content: space-between;
}

.clan-toolbar .cp-toolbar__title {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
}

.clan-toolbar__faction {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.clan-tag {
  display: inline-grid;
  min-width: 46px;
  min-height: 28px;
  padding-inline: var(--sp-2);
  color: var(--accent-bright);
  place-items: center;
  background: var(--accent-glow);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
}

.clan-info {
  display: block;
  width: 100%;
  margin: 0;
  border: 0;
  font-size: var(--fs-sm);
}

.clan-info > tbody {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-2);
}

.clan-info tr {
  display: grid;
  min-width: 0;
  min-height: 82px;
  align-content: start;
  padding: var(--sp-3);
  background: linear-gradient(145deg, var(--surface-highlight), transparent 72%), var(--bg-surface);
  border: 1px solid var(--border);
}

.clan-info td {
  display: block;
  width: auto;
  padding: 0;
  border: 0;
}

.clan-info__label {
  margin-bottom: var(--sp-2);
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.clan-info__value {
  color: var(--fg);
  font-size: var(--fs-md);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.clan-info__note {
  display: block;
  margin-top: var(--sp-1);
  color: var(--fg-dim);
  font-size: var(--fs-xs);
  font-weight: 400;
}

.clan-info__insignia {
  display: block;
  width: 256px;
  height: 256px;
  max-width: 100%;
  object-fit: contain;
  border: 1px solid var(--border-strong);
}

.clan-roster {
  margin-top: var(--sp-5);
  overflow-x: auto;
  border: 1px solid var(--border);
}

.clan-roster__head {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  justify-content: space-between;
  min-width: 620px;
  padding: var(--sp-3);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border-strong);
}

.clan-roster__title {
  margin: 0;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-weight: 700;
}

.clan-roster__counts {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

.clan-members,
.clan-upgrade {
  width: 100%;
  min-width: 620px;
  color: var(--fg);
  background: var(--bg-surface);
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.clan-members th,
.clan-members td,
.clan-upgrade th,
.clan-upgrade td {
  height: 40px;
  padding: var(--sp-2) var(--sp-3);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.clan-members th:last-child,
.clan-members td:last-child,
.clan-upgrade th:last-child,
.clan-upgrade td:last-child {
  border-right: 0;
}

.clan-members th,
.clan-upgrade th {
  color: var(--accent-bright);
  background: var(--bg-elev);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.clan-members tr:hover > td,
.clan-upgrade tr:hover > td {
  background: var(--surface-highlight);
}

.clan-member--pending > td {
  color: var(--fg-dim);
}

.clan-member__name {
  color: var(--fg);
  font-weight: 700;
  text-decoration: none;
}

.clan-member__badges {
  display: inline-flex;
  gap: var(--sp-1);
  margin-left: var(--sp-2);
  vertical-align: middle;
}

.clan-badge {
  display: inline-flex;
  min-height: 18px;
  padding: 1px 6px;
  color: var(--fg);
  align-items: center;
  border: 1px solid currentColor;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.clan-member__badge--founder { color: var(--warning); }
.clan-member__badge--admin { color: var(--danger); }
.clan-member__badge--recruit { color: var(--accent-bright); }
.clan-member__badge--pending { color: var(--fg-dim); }

/* player_badge(): a Vanguard's diamond, or a subscriber's star, before or after a player's name */
.player-badge {
  display: inline-block;
  margin: 0 0.3em;
  font-size: 0.85em;
  line-height: 1;
  vertical-align: baseline;
}
.player-badge--vanguard { color: var(--player-vanguard); }
.player-badge--vanguard::before { content: "\25C6"; }
.player-badge--subscriber { color: var(--player-subscriber); }
.player-badge--subscriber::before { content: "\2605"; }

.clan-member__actions {
  white-space: nowrap;
}

.clan-member__actions a {
  display: inline-flex;
  min-height: 26px;
  margin-right: var(--sp-1);
  padding: var(--sp-1) var(--sp-2);
  color: var(--fg);
  align-items: center;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-strong);
  text-decoration: none;
}

.clan-member__actions a:hover {
  color: var(--link-hover);
  border-color: var(--accent);
}

.clan-upload,
.clan-form,
.clan-mail-form,
.clan-credits-form {
  width: min(100%, 760px);
  padding: var(--sp-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.clan-upload__label,
.clan-form__label,
.clan-mail-form__label,
.clan-credits-form__label {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.clan-upload__label {
  display: block;
  margin-bottom: var(--sp-2);
}

.clan-upload__hint,
.clan-form__hint,
.clan-credits-form__hint {
  margin-top: var(--sp-1);
  color: var(--fg-dim);
  font-size: var(--fs-xs);
}

.clan-form__row,
.clan-mail-form__row,
.clan-credits-form__row {
  display: grid;
  grid-template-columns: minmax(110px, 180px) minmax(0, 1fr);
  gap: var(--sp-3);
  align-items: start;
  margin-bottom: var(--sp-3);
}

.clan-form__label,
.clan-mail-form__label,
.clan-credits-form__label {
  padding-top: var(--sp-2);
}

.clan-form__input,
.clan-form__textarea,
.clan-form__select,
.clan-mail-form__textarea,
.clan-credits-form__input {
  width: 100%;
}

.clan-form__textarea,
.clan-mail-form__textarea {
  min-height: 150px;
}

.clan-form__actions,
.clan-mail-form__actions,
.clan-credits-form__actions {
  padding-left: min(193px, 28%);
}

.clan-form__requirements,
.clan-mail-form__intro {
  margin-bottom: var(--sp-3);
  padding: var(--sp-3);
  color: var(--fg-muted);
  background: var(--bg-elev);
  border-left: 2px solid var(--accent);
}

.clan-credits-form__error,
.clan-upgrade__expensive {
  color: var(--danger);
}

.clan-upgrade {
  margin-bottom: var(--sp-3);
}

.clan-upgrade__level {
  color: var(--accent-bright);
  font-weight: 700;
}

.clan-upgrade__cost,
.clan-upgrade__already {
  color: var(--fg-muted);
}

.clan-upgrade__action {
  text-align: right !important;
  white-space: nowrap;
}

/* ---------- rankings and fleet directory ---------- */

.ranking-page {
  min-width: 0;
}

.ranking-layout {
  display: grid;
  grid-template-columns: minmax(160px, 210px) minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: start;
}

.ranking-categories {
  position: sticky;
  top: var(--sp-3);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.ranking-categories__title {
  margin: 0;
  padding: var(--sp-3);
  color: var(--accent-bright);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ranking-categories__links {
  max-height: min(64vh, 620px);
  padding: var(--sp-2);
  overflow-y: auto;
}

.ranking-categories__links a {
  display: block;
  min-height: 31px;
  padding: var(--sp-1) var(--sp-2);
  color: var(--fg-muted);
  align-content: center;
  border-left: 2px solid transparent;
  text-decoration: none;
}

.ranking-categories__links a:hover,
.ranking-categories__links .is-current {
  color: var(--fg);
  background: var(--surface-highlight);
  border-left-color: var(--accent);
}

.ranking-categories__links .is-current {
  color: var(--accent-bright);
  font-weight: 700;
}

.ranking-results {
  min-width: 0;
}

.ranking-pager {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-3);
  padding: var(--sp-2) var(--sp-3);
  color: var(--fg-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.ranking-pager__links {
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ranking-pager__links a {
  display: grid;
  min-width: 30px;
  min-height: 28px;
  padding: var(--sp-1) var(--sp-2);
  place-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  text-decoration: none;
}

.cp-row--focus {
  background: var(--accent-glow) !important;
  box-shadow: inset 2px 0 0 var(--accent);
}

.cp-list a.is-current {
  color: var(--link-hover);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

.text-muted {
  color: var(--fg-dim);
}

.faction-heading__logo {
  width: auto;
  max-width: min(240px, 45%);
  max-height: 72px;
  object-fit: contain;
}

.faction-heading__title {
  display: inline-flex;
  gap: var(--sp-2);
  align-items: baseline;
  margin: 0;
}

.faction-heading__title small {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- screenshot archive ---------- */

.screenshot-album {
  margin-bottom: var(--sp-5);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.screenshot-album__header {
  display: flex;
  gap: var(--sp-3);
  align-items: baseline;
  justify-content: space-between;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border-strong);
}

.screenshot-album__header h2 {
  margin: 0;
  font-size: var(--fs-md);
}

.screenshot-album__header span {
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  white-space: nowrap;
}

.screenshot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: var(--sp-3);
  padding: var(--sp-4);
}

.screenshot-card {
  display: grid;
  min-height: 150px;
  padding: var(--sp-2);
  place-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: background var(--t), border-color var(--t), transform var(--t);
}

.screenshot-card:hover {
  background: var(--surface-highlight);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.screenshot-card img {
  width: 100%;
  height: auto;
  max-height: 190px;
  object-fit: contain;
}

.screenshot-card__caption {
  width: 100%;
  margin-top: var(--sp-2);
  color: var(--fg-muted);
  font-size: var(--fs-xs);
  text-align: center;
  overflow-wrap: anywhere;
}

body.screenshot-modal-open {
  overflow: hidden;
}

.screenshot-modal[hidden] {
  display: none;
}

.screenshot-modal {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(var(--sp-4), 3vw, 48px);
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
}

.screenshot-modal__frame {
  position: relative;
  display: flex;
  max-width: 100%;
  max-height: 100%;
  align-items: center;
  justify-content: center;
  padding: 2px;
  background: linear-gradient(135deg, var(--accent), var(--border-strong) 36%, var(--bg-elev) 72%);
  box-shadow: var(--shadow-lg), 0 0 36px var(--accent-glow);
  cursor: default;
}

.screenshot-modal__image {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - clamp(32px, 6vw, 96px));
  max-height: calc(100vh - clamp(32px, 6vw, 96px));
  object-fit: contain;
  background: #000;
}

.screenshot-modal__close {
  position: absolute;
  z-index: 1;
  top: var(--sp-3);
  right: var(--sp-3);
  min-width: 72px;
  min-height: var(--control-height);
  padding: 0 var(--sp-3);
  color: var(--fg);
  background: var(--bg-elev);
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
}

.screenshot-modal__close:hover {
  color: var(--link-hover);
  background: var(--bg-surface-2);
  border-color: var(--accent);
}

.screenshot-modal__close:focus {
  outline: none;
  box-shadow: var(--focus-ring), var(--shadow);
}

.screenshot-modal__nav {
  position: absolute;
  z-index: 1;
  top: 50%;
  display: none;
  width: 44px;
  height: 64px;
  margin-top: -32px;
  padding: 0 0 6px;
  color: var(--fg);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow);
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}

.screenshot-modal--gallery .screenshot-modal__nav {
  display: block;
}

.screenshot-modal__nav--prev {
  left: var(--sp-3);
}

.screenshot-modal__nav--next {
  right: var(--sp-3);
}

.screenshot-modal__nav:hover {
  color: var(--link-hover);
  border-color: var(--accent);
  opacity: 1;
}

.screenshot-modal__nav:focus {
  outline: none;
  box-shadow: var(--focus-ring), var(--shadow);
  opacity: 1;
}

.screenshot-modal__bar {
  position: absolute;
  right: var(--sp-3);
  bottom: var(--sp-3);
  left: var(--sp-3);
  display: none;
  gap: var(--sp-3);
  justify-content: space-between;
  padding: var(--sp-2) var(--sp-3);
  color: var(--fg);
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.screenshot-modal--gallery .screenshot-modal__bar {
  display: flex;
}

.screenshot-modal__counter {
  white-space: nowrap;
}

/* ---------- download library ---------- */

.download-category {
  margin-bottom: var(--sp-4);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.download-category__header {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-3);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border-strong);
}

.download-category__header h2 {
  margin: 0;
  font-size: var(--fs-md);
}

.download-category__actions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
  justify-content: flex-end;
  font-size: var(--fs-xs);
}

.download-category > .cp-scroll {
  border: 0;
  border-radius: 0;
}

.link-danger {
  color: var(--danger) !important;
}

.server-list,
.server-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  gap: var(--sp-3);
}

.server-card {
  display: grid;
  gap: var(--sp-2);
  min-width: 0;
  padding: var(--sp-3);
  color: var(--fg);
  background: linear-gradient(145deg, var(--surface-highlight), transparent 60%), var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: background var(--t), border-color var(--t), transform var(--t);
}

.server-card:hover {
  color: var(--fg);
  background: var(--bg-surface-2);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.server-card__head {
  display: flex;
  gap: var(--sp-3);
  align-items: baseline;
  justify-content: space-between;
}

.server-card__name {
  overflow: hidden;
  color: var(--fg);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-card__pop {
  flex: 0 0 auto;
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

.server-card__desc {
  min-height: 2.8em;
  color: var(--fg-muted);
  font-size: var(--fs-xs);
}

.server-card__meter {
  height: 4px;
  overflow: hidden;
  background: var(--bg-elev);
  border-radius: 999px;
}

.server-card__meter-bar {
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

.server-card__meter-bar--warning { background: var(--warning); }
.server-card__meter-bar--danger { background: var(--danger); }

/* ---------- unified home and context modules ---------- */

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.context-rail > .sidebox {
  margin: 0;
}

.context-rail__disclosure {
  min-width: 0;
}

.context-rail__toggle {
  display: none;
}

.context-rail__body {
  display: grid;
  gap: var(--sp-3);
}

.context-card-slot {
  min-width: 0;
}

.context-card-slot > .sidebox {
  height: 100%;
  margin: 0;
}

.context-rail__more {
  min-width: 0;
}

.context-rail__more-toggle {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: var(--sp-2) var(--sp-3);
  color: var(--fg-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  list-style: none;
  text-transform: uppercase;
}

.context-rail__more-toggle::-webkit-details-marker {
  display: none;
}

.context-rail__more-toggle::after {
  margin-left: auto;
  content: "+";
  font-family: var(--font-mono);
}

.context-rail__more[open] .context-rail__more-toggle::after {
  content: "−";
}

.context-rail__more-body {
  display: grid;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

.context-rail .sidebox__header,
.context-rail .sidebox__header--green,
.context-rail .sidebox__header--red,
.context-rail .sidebox__header--yellow {
  color: var(--accent-bright);
  background: var(--bg-elev);
  border-bottom-color: var(--border);
}

.context-rail .sidebox__body {
  padding: var(--sp-3);
}

.daily-shot {
  margin: 0;
}

.daily-shot__link {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.daily-shot__link::after {
  position: absolute;
  right: var(--sp-2);
  bottom: var(--sp-2);
  padding: 2px 6px;
  color: var(--fg);
  content: "View";
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xs);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.daily-shot__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--t);
}

.daily-shot__link:hover .daily-shot__image {
  transform: scale(1.025);
}

.funding-meter {
  display: grid;
  gap: var(--sp-3);
}

.funding-meter__summary {
  display: flex;
  gap: var(--sp-2);
  align-items: baseline;
  justify-content: space-between;
}

.funding-meter__summary strong {
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: var(--fs-lg);
}

.funding-meter__summary span,
.funding-meter__meta {
  color: var(--fg-muted);
  font-size: var(--fs-xxs);
}

.funding-meter__track {
  height: 8px;
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.funding-meter__fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  box-shadow: 0 0 12px var(--accent-glow);
}

.funding-meter--warning .funding-meter__fill { background: var(--warning); }
.funding-meter--complete .funding-meter__fill { background: var(--success); }

.funding-meter__meta {
  display: flex;
  justify-content: space-between;
}

.home-stack {
  display: grid;
  gap: var(--sp-4);
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--sp-3) var(--sp-5);
  padding-bottom: var(--sp-5);
  border-bottom: 1px solid var(--border);
}

.home-hero__heading {
  align-self: end;
}

.home-hero__eyebrow,
.forum-header__eyebrow {
  margin: 0 0 var(--sp-1);
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.home-hero h1 {
  margin: 0;
  letter-spacing: var(--brand-tracking);
  text-transform: uppercase;
}

.home-hero__release {
  margin: var(--sp-2) 0 0;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

.home-hero__media {
  align-self: center;
}

/* The profile's Subscribe button, for a player without a subscription: the home page's green. After .button's own rules, so
   it wins over them. */
.button--subscribe,
.button--subscribe:visited {
  color: var(--bg);
  background: var(--success);
  border-color: color-mix(in srgb, var(--success) 60%, white);
}

.button--subscribe:hover {
  color: var(--bg);
  background: color-mix(in srgb, var(--success) 75%, white);
}

/* The subscription page's banner: the fleet behind the game's name, darkened at the left and the foot so the name reads,
   with PayPal's badge in the upper right. */
.subscribe-banner {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 170px;
  margin-bottom: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--border-strong);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.2) 55%, transparent),
    linear-gradient(0deg, rgba(0, 0, 0, 0.7), transparent 60%),
    url('images/subscribe-banner.jpg') center 30% / cover no-repeat,
    var(--bg-elev);
}

.subscribe-banner::after {
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: var(--header-line);
  content: "";
}

.subscribe-banner__name {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  color: var(--accent-bright);
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: var(--brand-tracking);
  text-transform: uppercase;
  text-shadow: 0 2px 8px #000;
}

.subscribe-banner__name::before {
  width: 48px;
  height: 48px;
  background: url('images/darkspace-mark-2026-alpha.png') center / contain no-repeat;
  content: "";
}

.subscribe-banner__paypal {
  position: absolute;
  top: var(--sp-3);
  right: var(--sp-3);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow);
}

/* The subscription page's plan form: a plan a line with its price at the right, then the terms close under them. */
.subscribe-form {
  display: grid;
  gap: var(--sp-3);
  max-width: 680px;
}

.subscribe-plans {
  display: grid;
  gap: var(--sp-1);
}

.subscribe-plan {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  padding: 10px 14px;
  border: 1px solid var(--border);
  cursor: pointer;
}

.subscribe-plan:hover {
  border-color: var(--border-strong);
}

.subscribe-plan:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.subscribe-plan__price {
  margin-left: auto;
  font-weight: 700;
  white-space: nowrap;
}

.subscribe-plan__note {
  margin: 0 0 0 30px;
  color: var(--fg-muted);
  font-size: var(--fs-xs);
}

.subscribe-terms {
  display: grid;
  gap: var(--sp-2);
  font-size: var(--fs-sm);
}

.subscribe-terms p {
  margin: 0;
}

.subscribe-terms__accept {
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
}

/* The referral: its text, then the box for the friend's name or id under it, as the text says. */
.subscribe-referral {
  display: grid;
  gap: var(--sp-1);
  justify-items: start;
  font-size: var(--fs-xs);
}

/* Subscribe: the page's one call to act, the width of the form, larger than other buttons and green. After the buttons'
   own rules, so it wins over them. */
input.subscribe-submit {
  width: 100%;
  min-height: 52px;
  padding: 12px 24px;
  color: var(--bg);
  background: var(--success);
  border-color: color-mix(in srgb, var(--success) 60%, white);
  font-size: var(--fs-xl);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input.subscribe-submit:hover {
  color: var(--bg);
  background: color-mix(in srgb, var(--success) 75%, white);
}

/* The call to sign up, or to subscribe, beside the game's name, larger than other buttons and green. */
.home-hero__join,
.home-hero__join:visited {
  min-height: 40px;
  padding: 10px 22px;
  color: var(--bg);
  background: var(--success);
  border-color: color-mix(in srgb, var(--success) 60%, white);
  font-size: var(--fs-lg);
}

.home-hero__join:hover {
  color: var(--bg);
  background: color-mix(in srgb, var(--success) 75%, white);
}

.home-hero__copy {
  grid-column: 1 / -1;
  color: var(--fg-muted);
}

.home-hero__copy > img,
.home-hero__copy > a > img {
  display: block;
  width: 100%;
  margin-bottom: var(--sp-4);
  border: 1px solid var(--border);
}

.home-section {
  min-width: 0;
}

.server-status {
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
}

.server-status__header {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}

.server-status__title {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-xs);
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.server-status__count {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  text-transform: uppercase;
}

.server-status__list {
  display: grid;
}

.server-status__row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  gap: var(--sp-2) var(--sp-3);
  align-items: center;
  min-height: 62px;
  padding: var(--sp-3);
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.server-status__row:last-child {
  border-bottom: 0;
}

.server-status__row:hover {
  color: var(--fg);
  background: var(--surface-highlight);
}

.server-status__signal {
  width: 6px;
  height: 28px;
  background: var(--success);
  border-radius: 999px;
  box-shadow: 0 0 10px color-mix(in srgb, var(--success) 48%, transparent);
}

.server-status__identity {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.server-status__identity strong {
  overflow: hidden;
  color: var(--fg);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.server-status__identity span,
.server-status__population span {
  color: var(--fg-muted);
  font-size: var(--fs-xs);
}

.server-status__population {
  display: grid;
  justify-items: end;
  min-width: 90px;
}

.server-status__population strong {
  color: var(--accent-bright);
  font-family: var(--font-mono);
}

.server-status__meter {
  grid-column: 2 / -1;
  height: 3px;
  overflow: hidden;
  background: var(--bg-elev);
}

.server-status__fill {
  display: block;
  height: 100%;
  background: var(--success);
}

.server-status__fill--warm { background: var(--warning); }
.server-status__fill--hot { background: var(--danger); }

/* ---------- company home ---------- */

.company-home {
  display: grid;
  gap: var(--sp-6);
}

.company-hero {
  padding-bottom: var(--sp-5);
  border-bottom: 1px solid var(--border-strong);
}

.company-hero__eyebrow,
.company-section-heading > p {
  margin: 0 0 var(--sp-1);
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.company-hero h1 {
  margin: 0;
  letter-spacing: var(--brand-tracking);
  text-transform: uppercase;
}

.company-hero__copy {
  max-width: 68ch;
  margin-top: var(--sp-3);
  color: var(--fg-muted);
}

.company-hero__copy:empty {
  display: none;
}

.company-home__layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  gap: var(--sp-5);
  align-items: start;
}

.company-products,
.company-news {
  min-width: 0;
}

.company-section-heading {
  margin-bottom: var(--sp-3);
}

.company-section-heading h2 {
  margin: 0;
}

.product-grid {
  display: grid;
  gap: var(--sp-3);
}

.product-card {
  display: grid;
  overflow: hidden;
  color: var(--fg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--r);
  text-decoration: none;
  transition: background var(--t), border-color var(--t), transform var(--t);
}

.product-card:hover {
  color: var(--fg);
  background: var(--bg-surface-2);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.product-card__media {
  display: grid;
  min-height: 126px;
  padding: var(--sp-3);
  place-items: center;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}

.product-card__media img {
  width: min(100%, 300px);
  max-height: 140px;
  object-fit: contain;
}

.product-card__media--medusa img {
  max-height: 170px;
}

.product-card__body {
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-3);
}

.product-card__body strong {
  color: var(--fg);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
}

.product-card__body > span {
  color: var(--fg-muted);
  line-height: 1.5;
}

.product-card__body small {
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.company-news > table,
.company-news > .card,
.company-news > .panel {
  width: 100% !important;
}

/* ---------- site-native forums ---------- */

.forum-shell {
  display: grid;
  gap: var(--sp-4);
  min-width: 0;
}

.forum-header {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border-strong);
}

.forum-header h1 {
  margin: 0;
}

.forum-header__tools,
.forum-actions,
.forum-breadcrumbs,
.forum-statline {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  flex-wrap: wrap;
}

.forum-header__tools {
  justify-content: flex-end;
}

.forum-breadcrumbs {
  color: var(--fg-muted);
  font-size: var(--fs-xs);
}

.forum-breadcrumbs > span[aria-hidden] {
  color: var(--fg-dim);
}

.forum-actions {
  justify-content: flex-end;
}

.forum-moderators,
.forum-statline {
  margin: 0;
  padding: var(--sp-2) var(--sp-3);
  color: var(--fg-muted);
  background: var(--bg-surface);
  border-left: 2px solid var(--accent);
  font-size: var(--fs-xs);
}

.forum-statline {
  gap: var(--sp-4);
}

.forum-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.forum-frame,
.forum-frame > tbody,
.forum-frame > tbody > tr,
.forum-frame > tbody > tr > td {
  width: 100% !important;
  margin: 0;
  padding: 0;
  background: transparent !important;
  border: 0;
}

.forum-list,
.forum-thread {
  width: 100%;
  margin: 0;
  color: var(--fg);
  background: var(--bg-surface);
  border: 0;
  border-collapse: collapse;
  border-spacing: 0;
  table-layout: auto;
}

.forum-list :is(th, td),
.forum-thread :is(th, td) {
  padding: var(--sp-3);
  background: transparent !important;
  border-right: 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.forum-list__head,
.forum-thread__head {
  color: var(--fg-muted);
  background: var(--bg-elev);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.forum-list__head th:not(:nth-child(2)) {
  text-align: center;
}

.forum-list__category {
  background: var(--bg-surface-2);
}

.forum-list__category td {
  padding-block: var(--sp-2);
  color: var(--accent-bright);
  border-left: 2px solid var(--accent);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.forum-list__row:hover,
.forum-list__topic:hover {
  background: var(--surface-highlight);
}

.forum-list__icon {
  width: 38px;
  text-align: center !important;
}

.forum-list__icon img {
  width: auto;
  max-width: 20px;
  max-height: 20px;
}

.forum-list__subject {
  min-width: 240px;
  line-height: 1.45;
}

.forum-list__subject > a:first-child {
  color: var(--fg);
  font-weight: 700;
}

.forum-list__metric {
  width: 72px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-align: center !important;
  white-space: nowrap;
}

.forum-list__poster {
  width: 110px;
  color: var(--fg-muted);
  font-size: var(--fs-xs);
}

.forum-list__last {
  width: 170px;
  color: var(--fg-muted);
  font-size: var(--fs-xs);
  line-height: 1.4;
}

.forum-list__empty {
  padding: var(--sp-6) !important;
  color: var(--fg-muted);
  text-align: center !important;
}

.forum-legend,
.forum-pager,
.forum-thread-tools {
  width: 100% !important;
  color: var(--fg-muted);
  font-size: var(--fs-xs);
}

.forum-legend img {
  width: auto;
  max-width: 18px;
  max-height: 18px;
}

.forum-thread__author-heading {
  width: 170px;
}

.forum-post {
  background: var(--bg-surface);
}

.forum-post:nth-child(odd) {
  background: var(--row-alt);
}

.forum-post__author {
  width: 170px;
  color: var(--fg-muted);
  background: var(--bg-elev) !important;
  border-left: 2px solid var(--accent);
  font-size: var(--fs-sm);
  line-height: 1.45;
}

.forum-post__body {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.6;
}

.forum-post__meta {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  margin: calc(var(--sp-1) * -1) 0 var(--sp-3);
  padding-bottom: var(--sp-2);
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}

.forum-post__meta img {
  width: 16px;
  height: 16px;
}

.forum-post__actions img {
  width: auto;
  max-width: none;
  height: 20px;
  max-height: none;
}

/* A post's action in words, where the page's language is not the button
   images' English (phpBB functions.php, forum_action_button()). */
.forum-post__action {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 20px;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Player-posted images already stop at the column width (the global img
   rule); keep post images within the window too, so one full-size
   screenshot can't take over a thread. Signatures only get the width cap.
   interface.js marks the images that got shrunk and opens them in the
   screenshot viewer on click. */
.forum-post__content img {
  height: auto;
  max-height: 70vh;
  object-fit: contain;
}

.forum-post__signature img {
  max-height: none;
}

.forum-post__content img.post-image--zoomable {
  cursor: zoom-in;
}

.forum-post__signature {
  margin-top: var(--sp-5);
  padding-top: var(--sp-3);
  color: var(--fg-muted);
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
}

.forum-post__signature:empty {
  display: none;
}

.forum-post__actions {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  justify-content: flex-end;
  margin-top: var(--sp-3);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border);
}

.forum-post__actions a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: var(--sp-1) var(--sp-2);
  border: 1px solid transparent;
  border-radius: var(--r-xs);
}

.forum-post__actions a:hover,
.forum-post__actions a:focus-visible {
  background: var(--surface-highlight);
  border-color: var(--border);
}

.forum-shell form,
.forum-shell form > table,
.forum-shell > table {
  max-width: 100%;
}

.forum-shell form > table:not(.forum-thread) {
  width: 100% !important;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-collapse: separate;
  border-spacing: 0;
}

.forum-shell form > table:not(.forum-thread) td {
  padding: var(--sp-2);
}

/* ---------- unified content grammar ---------- */

.module-heading__actions {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.content-section {
  min-width: 0;
  margin-bottom: var(--sp-4);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}

.content-section__header,
.compose-form__header {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: var(--sp-3) var(--sp-4);
  background: linear-gradient(180deg, var(--surface-highlight), transparent), var(--bg-elev);
  border-bottom: 1px solid var(--border);
}

.content-section__header h2,
.compose-form__header h2 {
  margin: 0;
  font-size: var(--fs-lg);
}

.content-section__meta,
.compose-form__header > strong,
.compose-form__header small {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

.content-section__body {
  padding: var(--sp-4);
}

.content-section__body--flush {
  padding: 0;
}

.content-section__foot {
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: var(--sp-4);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-sm);
}

.detail-summary__item {
  display: grid;
  gap: var(--sp-1);
  min-width: 0;
  min-height: 72px;
  padding: var(--sp-3) var(--sp-4);
  align-content: center;
  border-right: 1px solid var(--border);
}

.detail-summary__item:last-child {
  border-right: 0;
}

.detail-summary__item > span {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.detail-summary__item > strong {
  overflow: hidden;
  color: var(--fg);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
  align-items: start;
}

.profile-info,
.clan-info {
  display: block;
  width: 100%;
  margin: 0;
  color: var(--fg);
  background: transparent;
  border: 0;
  border-collapse: separate;
  font-size: var(--fs-sm);
}

.profile-info > tbody,
.clan-info > tbody {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
}

.clan-info > tbody {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.profile-info tr,
.clan-info tr {
  display: grid;
  min-width: 0;
  min-height: 78px;
  padding: var(--sp-3) var(--sp-4);
  align-content: center;
  background: linear-gradient(145deg, var(--surface-highlight), transparent 72%), var(--bg-surface);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.profile-info td,
.clan-info td {
  display: block;
  width: auto;
  padding: 0;
  background: transparent;
  border: 0;
}

.profile-info__label,
.clan-info__label {
  width: auto;
  margin: 0 0 var(--sp-1);
  color: var(--fg-muted);
  background: transparent;
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.profile-info__value,
.clan-info__value {
  color: var(--fg);
  font-size: var(--fs-md);
  font-weight: 650;
  overflow-wrap: anywhere;
}

.profile-signature-section,
.profile-badges-section,
.profile-achievements-section,
.clan-roster {
  margin-top: var(--sp-4);
}

.profile-signature {
  background: transparent;
  border: 0;
  border-left: 2px solid var(--accent);
}

.clan-roster {
  overflow: hidden;
  border: 1px solid var(--border);
}

.clan-roster__head {
  min-width: 0;
}

.clan-roster .cp-scroll {
  border: 0;
  border-radius: 0;
}

.directory-section + .directory-section {
  margin-top: var(--sp-4);
}

/* ---------- unified forum overview, messages, and compose forms ---------- */

.forum-overview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  border-radius: var(--r-sm);
}

.forum-overview__item {
  display: grid;
  gap: var(--sp-1);
  min-height: 68px;
  padding: var(--sp-3);
  align-content: center;
  border-right: 1px solid var(--border);
}

.forum-overview__item:last-child {
  border-right: 0;
}

.forum-overview__item strong {
  color: var(--fg);
  font-family: var(--font-display);
  font-size: var(--fs-lg);
}

.forum-overview__item span {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.compose-form {
  width: 100%;
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}

.compose-form__header > div {
  min-width: 0;
}

.compose-form__header > div > span {
  display: block;
  margin-bottom: var(--sp-1);
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.compose-form__header h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compose-form__header small {
  display: block;
  margin-top: var(--sp-1);
}

.compose-form__body {
  display: grid;
  gap: var(--sp-4);
  padding: var(--sp-4);
}

.form-field {
  display: grid;
  gap: var(--sp-2);
  min-width: 0;
  margin: 0;
}

.form-field__label,
.form-options > legend {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-field__hint {
  color: var(--fg-dim);
  font-size: var(--fs-xs);
}

.form-field__control {
  width: 100%;
}

.form-field__static {
  min-height: var(--control-height);
  padding: 7px 10px;
  color: var(--fg);
  background: var(--bg-elev);
  border-left: 2px solid var(--accent);
}

.compose-form__editor {
  min-height: 320px;
  font-family: var(--font-sans);
  line-height: 1.55;
}

.form-options {
  display: grid;
  gap: var(--sp-2);
  min-width: 0;
  margin: 0;
  padding: var(--sp-3);
  background: var(--bg-elev);
  border: 1px solid var(--border);
}

.form-options > legend {
  padding-inline: var(--sp-2);
}

.form-options > label {
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
  color: var(--fg-muted);
  cursor: pointer;
}

.form-options input {
  margin-top: 0.2em;
}

.form-actions {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  justify-content: flex-end;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
}

.compose-form__review {
  margin-top: var(--sp-3);
  text-align: right;
}

.pm-toolbar {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2);
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.pm-toolbar__tabs {
  display: flex;
  gap: var(--sp-1);
  align-items: center;
}

.pm-toolbar__tabs a,
.pm-toolbar__tabs span {
  min-height: 32px;
  padding: var(--sp-1) var(--sp-3);
  align-content: center;
  text-decoration: none;
}

.pm-toolbar__tabs [aria-current="page"] {
  color: var(--accent-bright);
  background: var(--accent-glow);
  border-left: 2px solid var(--accent);
  font-weight: 700;
}

.pm-toolbar__count {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

.pm-list {
  display: grid;
  gap: var(--sp-2);
}

.pm-message {
  display: grid;
  grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.pm-message__author {
  display: grid;
  gap: var(--sp-1);
  padding: var(--sp-3);
  align-content: start;
  color: var(--fg-muted);
  background: var(--bg-elev);
  border-left: 2px solid var(--accent);
  font-size: var(--fs-xs);
}

.pm-message__main {
  min-width: 0;
  padding: var(--sp-3) var(--sp-4);
}

.pm-message__meta {
  margin-bottom: var(--sp-3);
  padding-bottom: var(--sp-2);
  color: var(--fg-muted);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

.pm-message__body {
  min-height: 44px;
  overflow-wrap: anywhere;
  line-height: 1.6;
}

.pm-message__actions {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  justify-content: flex-end;
  margin-top: var(--sp-4);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--border);
}

.pm-settings {
  display: flex;
  gap: var(--sp-2);
  align-items: flex-end;
  justify-content: flex-end;
  margin-top: var(--sp-3);
  padding: var(--sp-3);
  background: var(--bg-surface);
  border: 1px solid var(--border);
}

.pm-settings label {
  display: grid;
  gap: var(--sp-1);
  color: var(--fg-muted);
  font-size: var(--fs-xs);
}

.pm-settings input[type="text"] {
  width: 90px;
}

.cp-back {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-height);
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-decoration: none;
}

form > table.cp-form > tbody > tr:last-child > td:last-child {
  text-align: right;
}

form > table.cp-form > tbody > tr:last-child > td:last-child > a {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-height);
  margin-left: var(--sp-2);
  padding: 6px 12px;
  color: var(--fg);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: 700;
  text-decoration: none;
}

.account-form {
  max-width: 880px;
}

.admin-command-output {
  max-height: 65vh;
  margin: 0;
  overflow: auto;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 1.55;
  white-space: pre-wrap;
}

.cp-list tr:not(.cp-list__head) .cp-actions {
  font-size: 0;
}

.cp-list tr:not(.cp-list__head) .cp-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 2px 0 2px var(--sp-1);
  padding: 4px 9px;
  color: var(--fg);
  background: var(--bg-surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  font-size: var(--fs-xxs);
  font-weight: 700;
  text-decoration: none;
}

.cp-list tr:not(.cp-list__head) .cp-actions a:hover {
  color: var(--link-hover);
  background: var(--surface-highlight);
  border-color: var(--accent);
}

.cp-list tr:not(.cp-list__head) .cp-actions a[href*="delete"],
.cp-list tr:not(.cp-list__head) .cp-actions a[href*="remove"],
.cp-list tr:not(.cp-list__head) .cp-actions a[href*="leave"],
.cp-list tr:not(.cp-list__head) .cp-actions a[href*="demote"] {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 55%, var(--border));
}

.filter-chips {
  display: grid;
  gap: var(--sp-2);
  margin-bottom: var(--sp-4);
  padding: var(--sp-3);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}

.filter-chips__group {
  display: grid;
  grid-template-columns: minmax(100px, 140px) minmax(0, 1fr);
  gap: var(--sp-3);
  align-items: center;
}

.filter-chips__group > strong {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.filter-chips__items {
  display: flex;
  gap: var(--sp-1);
  align-items: center;
  flex-wrap: wrap;
}

.filter-chips__items a {
  min-height: 30px;
  padding: var(--sp-1) var(--sp-3);
  align-content: center;
  color: var(--fg-muted);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  text-decoration: none;
}

.filter-chips__items a:hover,
.filter-chips__items a[aria-current="page"] {
  color: var(--link-hover);
  background: var(--accent-glow);
  border-color: var(--accent);
}

.filter-panel {
  margin-bottom: var(--sp-4);
}

.filter-option-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-3);
}

.filter-id-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}

.killboard-summary .detail-summary__item small,
.cp-cell-meta {
  color: var(--fg-muted);
  font-size: var(--fs-xs);
}

.cp-empty {
  padding: var(--sp-6) !important;
  color: var(--fg-muted);
  text-align: center;
}

.killboard-results__foot {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}

.killboard-controls {
  margin-bottom: var(--sp-4);
}

.killboard-filter-player {
  align-items: start;
}

.killboard-player-control {
  display: grid;
  gap: var(--sp-2);
  min-width: 0;
}

.killboard-player-search {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  min-width: 0;
}

.killboard-player-search .form-field__control {
  flex: 1 1 auto;
  min-width: 180px;
  margin: 0;
}

.killboard-player-search button {
  flex: 0 0 auto;
}

.killboard-target {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  min-width: 0;
  padding: var(--sp-2) var(--sp-3);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
}

.killboard-target > span {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.killboard-target > strong {
  overflow: hidden;
  color: var(--fg);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.killboard-target > small {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  white-space: nowrap;
}

.killboard-target > a {
  margin-left: auto;
  align-self: center;
  font-size: var(--fs-xs);
}

.killboard-player-matches {
  display: grid;
  gap: var(--sp-2);
}

.killboard-player-matches > span {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.killboard-player-matches > div {
  display: flex;
  gap: var(--sp-1);
  flex-wrap: wrap;
}

.killboard-player-matches a {
  display: inline-grid;
  gap: 1px;
  min-width: 140px;
  padding: var(--sp-2);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  text-decoration: none;
}

.killboard-player-matches a small {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
}

.killboard-search-message,
.killboard-filter-strip {
  margin-bottom: var(--sp-3);
}

@media (max-width: 1180px) {
  .detail-summary,
  .forum-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clan-info > tbody {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-option-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .module-heading__actions,
  .content-section__header,
  .compose-form__header,
  .form-actions,
  .pm-toolbar,
  .pm-settings {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-summary,
  .forum-overview,
  .detail-columns,
  .filter-option-grid,
  .filter-id-grid,
  .detail-layout,
  .profile-layout,
  .profile-info > tbody,
  .clan-info > tbody {
    grid-template-columns: 1fr;
  }

  .filter-chips__group {
    grid-template-columns: 1fr;
  }

  .killboard-player-search {
    align-items: stretch;
    flex-direction: column;
  }

  .killboard-player-search .form-field__control {
    min-width: 0;
  }

  .killboard-target {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .detail-summary__item,
  .forum-overview__item {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .detail-summary__item:last-child,
  .forum-overview__item:last-child {
    border-bottom: 0;
  }

  .pm-message {
    grid-template-columns: 1fr;
  }

  .pm-message__author {
    border-bottom: 1px solid var(--border);
  }

  .pm-message__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .compose-form__editor {
    min-height: 240px;
  }
}

/* ---------- labels and feedback ---------- */

.badge,
.cp-badge,
.status-pill {
  display: inline-flex;
  gap: var(--sp-1);
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  color: var(--fg-muted);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge--success,
.cp-badge--yes,
.status-pill--success { color: var(--success); }

.badge--danger,
.cp-badge--no,
.status-pill--danger { color: var(--danger); }

.badge--warning,
.status-pill--warning { color: var(--warning); }

.notice,
.error,
.success,
.warning {
  margin-bottom: var(--sp-3);
  padding: var(--sp-3);
  color: var(--fg);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-sm);
}

.error { border-left-color: var(--danger); }
.success { border-left-color: var(--success); }
.warning { border-left-color: var(--warning); }

/* The Steam page's buttons that buy Vanguard time, in a row that wraps */
.steam-buy {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

/* ---------- compatibility affordances ---------- */

.popup-shell {
  min-height: 100dvh;
  padding: var(--sp-3);
  color: var(--fg);
  background:
    linear-gradient(180deg, var(--surface-highlight), transparent 150px),
    var(--bg);
}

.popup-shell > :first-child {
  margin-top: 0;
}

.popup-shell > :last-child {
  margin-bottom: 0;
}

.popup-shell table {
  max-width: 100%;
}

.page-width {
  width: min(100%, var(--page-max));
  margin-inline: auto;
}

.status-bar {
  color: var(--fg-muted);
}

.status-bar b,
.status-bar strong {
  color: var(--accent-bright);
}

.std_text,
.stdtext,
.forum_text,
.news_text {
  color: var(--fg);
  font-family: var(--font-sans);
}

.small_text,
.smalltext,
.forum_small,
.news_small {
  color: var(--fg-muted);
  font-size: var(--fs-xs);
}

/* ---------- responsive behaviour ---------- */

@media (max-width: 1180px) {
  .site-layout {
    grid-template-columns: var(--nav-width) minmax(0, 1fr);
  }

  .context-rail {
    position: static;
    grid-column: 1 / -1;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .context-rail__body {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .context-rail__more {
    grid-column: 1 / -1;
  }

  .context-rail__more-body {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .site-layout--wide .context-rail {
    display: none;
  }

  .clan-info > tbody {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 781px) {
  .site-nav__disclosure > .site-nav__body {
    display: grid !important;
  }
}

@media (max-width: 780px) {
  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 62px;
  }

  .site-header__status {
    display: none;
  }

  .site-brand__strapline {
    display: none;
  }

  .site-layout,
  .site-layout--wide {
    display: block;
    padding: var(--sp-2);
  }

  .site-nav {
    position: static;
    margin-bottom: var(--sp-2);
  }

  .site-nav__disclosure > .site-nav__toggle {
    display: flex;
    gap: var(--sp-2);
    align-items: center;
    min-height: 42px;
    padding: var(--sp-2) var(--sp-3);
    color: var(--accent-bright);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0.07em;
    list-style: none;
    text-transform: uppercase;
  }

  .site-nav__disclosure > .site-nav__toggle::-webkit-details-marker {
    display: none;
  }

  .site-nav__disclosure[open] > .site-nav__toggle {
    border-radius: var(--r) var(--r) 0 0;
  }

  .site-nav__disclosure > .site-nav__body {
    padding-top: var(--sp-2);
  }

  .site-nav__disclosure:not([open]) > .site-nav__body {
    display: none;
  }

  .site-main {
    padding: var(--sp-3);
  }

  .context-rail {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: var(--sp-2);
  }

  .context-rail__toggle {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: var(--sp-2) var(--sp-3);
    color: var(--accent-bright);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0.07em;
    cursor: pointer;
    list-style: none;
    text-transform: uppercase;
  }

  .context-rail__toggle::-webkit-details-marker {
    display: none;
  }

  .context-rail__toggle::after {
    margin-left: auto;
    content: "+";
    font-family: var(--font-mono);
  }

  .context-rail__disclosure[open] .context-rail__toggle::after {
    content: "−";
  }

  .context-rail__body {
    grid-template-columns: 1fr;
    margin-top: var(--sp-2);
  }

  .context-rail__more-body {
    grid-template-columns: 1fr;
  }

  .site-footer,
  .cp-heading,
  .ticket-form__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .cp-form table,
  .cp-form tbody,
  .cp-form tr,
  .cp-form td {
    display: block;
    width: 100% !important;
  }

  .profile-grid,
  .profile-grid > tbody,
  .profile-grid > tbody > tr,
  .profile-grid > tbody > tr > td {
    display: block;
    width: 100%;
  }

  .profile-grid__right {
    margin-top: var(--sp-3);
  }

  .module-heading,
  .profile-toolbar,
  .clan-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .news-article__head {
    flex-direction: column;
  }

  .news-article__mark,
  .news-article__category {
    max-width: 100%;
  }

  .cp-toolbar__group--actions {
    justify-content: flex-start;
  }

  .clan-info > tbody {
    grid-template-columns: 1fr;
  }

  .clan-form__row,
  .clan-mail-form__row,
  .clan-credits-form__row {
    grid-template-columns: 1fr;
    gap: var(--sp-1);
  }

  .clan-form__label,
  .clan-mail-form__label,
  .clan-credits-form__label,
  .clan-form__actions,
  .clan-mail-form__actions,
  .clan-credits-form__actions {
    padding-left: 0;
    padding-top: 0;
  }

  .ranking-layout {
    grid-template-columns: 1fr;
  }

  .ranking-categories {
    position: static;
  }

  .ranking-categories__links {
    display: flex;
    max-height: none;
    overflow-x: auto;
    overflow-y: visible;
  }

  .ranking-categories__links > div {
    flex: 0 0 auto;
  }

  .ranking-categories__links a {
    border-bottom: 2px solid transparent;
    border-left: 0;
  }

  .ranking-categories__links a:hover,
  .ranking-categories__links .is-current {
    border-bottom-color: var(--accent);
  }

  .ranking-pager {
    align-items: flex-start;
    flex-direction: column;
  }

  .ranking-pager__links {
    justify-content: flex-start;
  }

  .download-category__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .download-category__actions {
    justify-content: flex-start;
  }

  .home-hero {
    display: block;
  }

  .home-hero__media {
    margin-top: var(--sp-3);
  }

  .home-hero__copy {
    margin-top: var(--sp-4);
  }

  .company-home__layout {
    grid-template-columns: 1fr;
  }

  .server-status__row {
    grid-template-columns: 7px minmax(0, 1fr) auto;
    min-height: 58px;
  }

  .server-status__population {
    min-width: 68px;
  }

  .server-status__population span {
    font-size: var(--fs-xxs);
  }

  .forum-header {
    align-items: stretch;
    flex-direction: column;
  }

  .forum-header__tools,
  .forum-actions {
    justify-content: flex-start;
  }

  .forum-table-scroll {
    overflow: visible;
    border: 0;
  }

  .forum-frame,
  .forum-frame > tbody,
  .forum-frame > tbody > tr,
  .forum-frame > tbody > tr > td,
  .forum-list,
  .forum-list > tbody,
  .forum-thread,
  .forum-thread > tbody {
    display: block;
    width: 100% !important;
  }

  .forum-list__head,
  .forum-thread__head {
    display: none;
  }

  .forum-list__category {
    display: block;
    margin-top: var(--sp-3);
  }

  .forum-list__category:first-child {
    margin-top: 0;
  }

  .forum-list__category td {
    display: block;
    width: 100% !important;
  }

  .forum-list__row,
  .forum-list__topic {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 0 var(--sp-2);
    padding: var(--sp-3) 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
  }

  .forum-list__row > td,
  .forum-list__topic > td {
    display: block;
    width: auto !important;
    padding: var(--sp-1) var(--sp-2);
    border: 0;
    text-align: left !important;
  }

  .forum-list__icon {
    grid-row: 1 / span 6;
    grid-column: 1;
    padding-right: 0 !important;
  }

  .forum-list__subject,
  .forum-list__metric,
  .forum-list__poster,
  .forum-list__last {
    grid-column: 2;
    min-width: 0;
  }

  .forum-list__metric,
  .forum-list__poster {
    display: flex !important;
    gap: var(--sp-2);
    align-items: baseline;
    color: var(--fg-muted);
  }

  .forum-list__metric::before,
  .forum-list__poster::before {
    color: var(--fg-dim);
    content: attr(data-label) ":";
    font-family: var(--font-sans);
    font-size: var(--fs-xxs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .forum-list__last {
    margin-top: var(--sp-1);
  }

  .forum-post {
    display: block;
    margin-bottom: var(--sp-3);
    border: 1px solid var(--border);
    border-left: 2px solid var(--accent);
    border-radius: var(--r-sm);
  }

  .forum-post__author,
  .forum-post__body {
    display: block;
    width: 100% !important;
    padding: var(--sp-3) !important;
    border: 0;
  }

  .forum-post__author {
    border-bottom: 1px solid var(--border);
  }

  .forum-legend,
  .forum-thread-tools {
    display: block;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- store and server application surfaces ---------- */

.store-page {
  display: grid;
  gap: var(--sp-4);
}

.store-page > .module-heading,
.store-page .content-section,
.store-admin__category {
  margin-bottom: 0;
}

.store-section__eyebrow {
  margin: 0 0 var(--sp-1);
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.store-cart__items {
  display: grid;
}

.store-cart__item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto auto;
  gap: var(--sp-3);
  align-items: center;
  min-width: 0;
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
}

.store-cart__item:last-child {
  border-bottom: 0;
}

.store-cart__media,
.store-product-card__media,
.store-product-detail__media {
  display: grid;
  overflow: hidden;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  place-items: center;
}

.store-cart__media {
  width: 72px;
  height: 64px;
}

.store-cart__media img,
.store-product-card__media img,
.store-product-detail__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.store-cart__copy {
  display: grid;
  gap: var(--sp-1);
  min-width: 0;
}

.store-cart__copy h3,
.store-product-card h3 {
  margin: 0;
  font-size: var(--fs-md);
}

.store-cart__copy span {
  color: var(--fg-muted);
  font-size: var(--fs-xs);
}

.store-price {
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: var(--fs-md);
  white-space: nowrap;
}

.store-price--large {
  font-family: var(--font-display);
  font-size: clamp(var(--fs-xl), 2.2vw, 28px);
}

.store-cart__remove,
.store-product-card__actions,
.store-product-detail__purchase {
  margin: 0;
}

.store-checkout {
  display: grid;
  border-top: 1px solid var(--border);
}

.store-checkout > .notice,
.store-checkout > .form-options {
  margin: var(--sp-4) var(--sp-4) 0;
}

.store-checkout__actions {
  margin-top: 0;
}

.store-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-3);
  padding: var(--sp-4);
}

.store-product-card {
  position: relative;
  display: grid;
  grid-template-rows: 150px minmax(88px, 1fr) auto;
  min-width: 0;
  overflow: hidden;
  background: var(--bg-surface-2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  clip-path: polygon(0 0, calc(100% - var(--deck-cut, 10px)) 0, 100% var(--deck-cut, 10px), 100% 100%, var(--deck-cut, 10px) 100%, 0 calc(100% - var(--deck-cut, 10px)));
  transition: border-color var(--t-fast), transform var(--t-fast);
}

.store-product-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.store-product-card__media {
  border: 0;
  border-bottom: 1px solid var(--border);
}

.store-product-card__media img {
  padding: var(--sp-3);
}

.store-product-card__body {
  display: grid;
  gap: var(--sp-3);
  align-content: space-between;
  min-width: 0;
  padding: var(--sp-3) var(--sp-4);
}

.store-product-card__actions {
  display: flex;
  justify-content: flex-end;
  padding: 0 var(--sp-4) var(--sp-4);
}

.store-product-detail__body {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr) minmax(180px, 220px);
  gap: var(--sp-5);
  align-items: start;
  padding: var(--sp-4);
}

.store-product-detail__media {
  aspect-ratio: 1;
  min-height: 180px;
}

.store-product-detail__media img {
  padding: var(--sp-4);
}

.store-product-detail__copy {
  color: var(--fg-muted);
  font-size: var(--fs-sm);
  line-height: 1.65;
}

.store-product-detail__copy > :first-child {
  margin-top: 0;
}

.store-product-detail__purchase {
  display: grid;
  gap: var(--sp-4);
  padding: var(--sp-4);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
}

.store-payment-mark {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  justify-content: flex-end;
  color: var(--fg-dim);
  font-size: var(--fs-xs);
}

.store-payment-mark img {
  display: block;
  width: auto;
  max-width: 120px;
  max-height: 30px;
}

.store-admin__fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
}

.store-admin__catalog {
  display: grid;
  gap: var(--sp-4);
}

.store-admin__category .cp-scroll {
  border: 0;
  border-radius: 0;
}

.store-admin__danger {
  display: flex;
  gap: var(--sp-4);
  align-items: center;
  justify-content: space-between;
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  background: color-mix(in srgb, var(--danger) 8%, var(--bg-surface));
  border: 1px solid var(--border);
  border-left: 3px solid var(--danger);
}

.store-admin__danger > span {
  display: grid;
  gap: var(--sp-1);
}

.store-admin__danger small {
  color: var(--fg-muted);
}

.server-status--page {
  overflow: visible;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.server-status--page .server-status__page-heading {
  margin-bottom: var(--sp-4);
}

.server-status--page .server-status__list {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--sp-3);
}

.server-status--page .server-status__row,
.server-status--page .server-status__row:last-child {
  position: relative;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  min-height: 112px;
  padding: var(--sp-4);
  background: linear-gradient(150deg, var(--surface-highlight), transparent 54%), var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  box-shadow: var(--shadow-sm);
  clip-path: polygon(0 0, calc(100% - var(--deck-cut, 10px)) 0, 100% var(--deck-cut, 10px), 100% 100%, var(--deck-cut, 10px) 100%, 0 calc(100% - var(--deck-cut, 10px)));
}

.server-status--page .server-status__row:hover {
  border-color: var(--accent);
  border-left-color: var(--accent-bright);
  transform: translateY(-2px);
}

.server-status--page .server-status__signal {
  height: 42px;
}

.server-status--page .server-status__identity strong {
  font-family: var(--font-display);
  font-size: var(--fs-lg);
}

.server-status--page .server-status__meter {
  grid-column: 2 / -1;
  width: 100%;
}

.server-status__action {
  display: none;
}

.server-status--page .server-status__action {
  display: inline-flex;
  grid-column: 2 / -1;
  gap: var(--sp-2);
  align-items: center;
  justify-self: end;
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media screen and (max-width: 760px) {
  .store-cart__item {
    grid-template-columns: 64px minmax(0, 1fr);
    align-items: start;
  }

  .store-cart__media {
    width: 64px;
    height: 58px;
  }

  .store-cart__item > .store-price,
  .store-cart__remove {
    grid-column: 2;
  }

  .store-cart__remove {
    justify-self: start;
  }

  .store-product-detail__body {
    grid-template-columns: 1fr;
  }

  .store-product-detail__media {
    max-width: 260px;
  }

  .store-admin__fields {
    grid-template-columns: 1fr;
  }

  .store-admin__danger {
    align-items: stretch;
    flex-direction: column;
  }

  .store-admin__danger button {
    align-self: flex-start;
  }

  .server-status--page .server-status__list {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 520px) {
  .store-product-grid {
    grid-template-columns: 1fr;
    padding: var(--sp-3);
  }

  .store-checkout__actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .store-checkout__actions > * {
    width: 100%;
  }
}

@media print {
  .site-header,
  .site-nav,
  .context-rail,
  .site-footer,
  .cp-toolbar,
  .cp-actions {
    display: none !important;
  }

  .site-layout,
  .site-main {
    display: block;
    width: auto;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }
}

/* ---------- high-definition command-deck finish ---------- */

@media screen {
  :root {
    --deck-line: color-mix(in srgb, var(--accent) 46%, transparent);
    --deck-line-soft: color-mix(in srgb, var(--accent) 18%, transparent);
    --deck-line-hot: color-mix(in srgb, var(--accent-bright) 82%, white 18%);
    --deck-groove: color-mix(in srgb, var(--bg) 76%, var(--bg-surface-2));
    --deck-cut: 12px;
  }

  .site-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: clamp(18px, 2vw, 36px);
    /* Sideways only: the open language list hangs below the header. */
    overflow-x: clip;
    border-bottom: 0;
    box-shadow:
      inset 0 -1px 0 var(--deck-line),
      inset 0 -5px 14px color-mix(in srgb, var(--accent-glow) 36%, transparent),
      var(--shadow-sm);
  }

  .site-header::before {
    position: absolute;
    top: 0;
    left: clamp(16px, 4vw, 76px);
    width: clamp(210px, 28vw, 420px);
    height: 3px;
    content: "";
    background: linear-gradient(
      90deg,
      var(--deck-line-hot) 0 18%,
      var(--deck-line) 18% 72%,
      transparent 72% 75%,
      var(--deck-line) 75% 94%,
      transparent 94%
    );
    clip-path: polygon(0 0, 100% 0, calc(100% - 7px) 100%, 7px 100%);
  }

  .site-header::after {
    right: clamp(16px, 4vw, 76px);
    bottom: 0;
    left: clamp(16px, 4vw, 76px);
    height: 4px;
    background:
      repeating-linear-gradient(90deg, transparent 0 23px, var(--deck-line-soft) 23px 24px),
      linear-gradient(90deg, var(--deck-line-hot), var(--deck-line) 22%, transparent 68%);
    opacity: 1;
    clip-path: polygon(0 0, 72% 0, calc(72% + 6px) 100%, 100% 100%, 100% 0);
  }

  .site-brand__mark {
    width: 42px;
    height: 42px;
    flex-basis: 42px;
    border-radius: 0;
    clip-path: polygon(0 7px, 7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%);
    box-shadow:
      inset 0 0 16px var(--accent-glow),
      inset 3px 0 0 var(--deck-line-hot);
  }

  .site-brand__emblem {
    display: block;
    width: 30px;
    height: 30px;
    object-fit: contain;
  }

  .site-brand__emblem--darkspace {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .site-brand__emblem--palestar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 49%;
    filter: contrast(1.12) brightness(1.08);
  }

  .site-header__status {
    justify-content: flex-start;
  }

  .site-header__telemetry {
    display: inline-flex;
    align-items: stretch;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--deck-line);
    background: color-mix(in srgb, var(--bg-surface) 82%, transparent);
    clip-path: polygon(0 6px, 6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%);
  }

  .site-stat {
    display: grid;
    grid-template-columns: auto auto;
    gap: var(--sp-2);
    align-items: baseline;
    min-width: 86px;
    padding: 7px 11px;
    border-left: 1px solid var(--deck-line-soft);
    white-space: nowrap;
  }

  .site-stat:first-child {
    border-left: 0;
  }

  .site-stat__label {
    color: var(--fg-muted);
    font-size: var(--fs-xxs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .site-stat__value {
    color: var(--accent-bright);
    font-family: var(--font-display);
    font-size: var(--fs-sm);
    font-variant-numeric: tabular-nums;
    line-height: 1;
  }

  .site-header__telemetry .legacy-status-break {
    display: none;
  }

  .site-layout {
    position: relative;
  }

  .site-main {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
      linear-gradient(135deg, var(--deck-line-soft), transparent 72px),
      var(--bg-elev);
    border-color: var(--deck-line);
    border-radius: 0;
    clip-path: polygon(
      0 0,
      calc(100% - var(--deck-cut)) 0,
      100% var(--deck-cut),
      100% 100%,
      var(--deck-cut) 100%,
      0 calc(100% - var(--deck-cut))
    );
    box-shadow: none;
  }

  .site-main::before {
    position: absolute;
    z-index: 3;
    top: 0;
    right: 18px;
    left: 18px;
    height: 3px;
    pointer-events: none;
    content: "";
    background: linear-gradient(
      90deg,
      var(--deck-line-hot) 0 9%,
      var(--deck-line) 9% 63%,
      transparent 63% 65%,
      var(--deck-line) 65% 91%,
      transparent 91%
    );
    box-shadow: 0 0 9px var(--accent-glow);
  }

  .site-main::after {
    position: absolute;
    z-index: 3;
    top: 9px;
    right: 15px;
    width: 76px;
    height: 5px;
    pointer-events: none;
    content: "";
    background: repeating-linear-gradient(
      90deg,
      var(--deck-line) 0 1px,
      transparent 1px 7px
    );
  }

  .site-main__content {
    position: relative;
    z-index: 1;
  }

  .site-nav__section,
  .context-card,
  .panel,
  .module-panel,
  .cp-form,
  .ticket-form,
  .content-section,
  .compose-form {
    border-color: var(--deck-line);
    border-radius: 0;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
    box-shadow:
      inset 0 1px 0 var(--deck-line-soft),
      var(--shadow-sm);
  }

  .site-nav__heading,
  .context-card__heading,
  .panel__heading,
  .module-panel__heading,
  .content-section__header,
  .compose-form__header {
    position: relative;
    border-bottom-color: var(--deck-line);
    background:
      linear-gradient(90deg, var(--deck-line-soft), transparent 48%),
      var(--bg-elev);
  }

  .site-nav__heading::before,
  .context-card__heading::before,
  .panel__heading::before,
  .module-panel__heading::before,
  .content-section__header::before,
  .compose-form__header::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 54px;
    height: 3px;
    content: "";
    background: linear-gradient(90deg, var(--deck-line-hot), var(--deck-line), transparent);
  }

  .content-section__header::after,
  .compose-form__header::after {
    position: absolute;
    right: var(--sp-4);
    bottom: -1px;
    width: 88px;
    height: 2px;
    content: "";
    background: repeating-linear-gradient(90deg, var(--deck-line) 0 2px, transparent 2px 8px);
  }

  .detail-summary {
    background:
      linear-gradient(90deg, var(--deck-line-soft), transparent 96px),
      var(--bg-surface);
    border-color: var(--deck-line);
    border-left-color: var(--deck-line-hot);
    border-radius: 0;
  }

  .cp-scroll,
  .forum-table-scroll {
    border-color: var(--deck-line);
    border-radius: 0;
    clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%);
  }

  .cp-list thead th,
  .cp-list__head > td {
    border-bottom-color: var(--deck-line);
    background:
      repeating-linear-gradient(90deg, transparent 0 23px, var(--deck-line-soft) 23px 24px) bottom / 100% 1px no-repeat,
      linear-gradient(90deg, var(--deck-line-soft), transparent 68%),
      var(--bg-elev) !important;
  }

  .forum-list__head,
  .forum-thread__head {
    background:
      linear-gradient(90deg, var(--deck-line-soft), transparent 68%),
      var(--bg-elev);
  }

  .forum-list__head > th,
  .forum-thread__head > th {
    border-bottom-color: var(--deck-line);
    background: transparent !important;
  }

  .cp-list > tbody > tr:hover > td:first-child,
  .forum-list > tbody > tr:hover > td:first-child {
    box-shadow: inset 2px 0 0 var(--deck-line-hot);
  }

  :is(.button, .cp-toolbar__link, .cp-actions a, button, input[type="submit"], input[type="button"], .language-picker__toggle) {
    border-radius: 0;
    clip-path: polygon(0 0, calc(100% - 5px) 0, 100% 5px, 100% 100%, 5px 100%, 0 calc(100% - 5px));
  }
}

@media screen and (min-width: 781px) {
  .site-nav::before,
  .site-nav::after {
    position: absolute;
    right: -11px;
    pointer-events: none;
    content: "";
  }

  .site-nav::before {
    top: 9px;
    bottom: 9px;
    width: 2px;
    background: linear-gradient(180deg, transparent, var(--deck-line-hot) 7%, var(--deck-line) 45%, transparent 100%);
    box-shadow: 0 0 8px var(--accent-glow);
  }

  .site-nav::after {
    top: 22px;
    width: 8px;
    height: 132px;
    background: repeating-linear-gradient(180deg, var(--deck-line) 0 1px, transparent 1px 8px);
    clip-path: polygon(0 6px, 100% 0, 100% calc(100% - 6px), 0 100%);
  }
}

@media screen and (min-width: 1181px) {
  .context-rail::before {
    position: absolute;
    top: 9px;
    bottom: 9px;
    left: -11px;
    width: 2px;
    pointer-events: none;
    content: "";
    background: linear-gradient(180deg, transparent, var(--deck-line) 9%, var(--deck-line-hot) 52%, transparent 100%);
    box-shadow: 0 0 8px var(--accent-glow);
  }
}

@media screen and (max-width: 780px) {
  :root {
    --deck-cut: 8px;
  }

  .site-header::before,
  .site-header::after,
  .site-main::after {
    display: none;
  }

  /* Two rows: the brand, the language picker and Log out on the first, so the
     picker stays top right, and the welcome line under them. The brand keeps
     its width and the picker's name gives way. */
  .site-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: var(--sp-2);
    row-gap: var(--sp-1);
  }

  .site-brand {
    min-width: auto;
  }

  .site-header__account {
    display: contents;
  }

  .site-header__welcome {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .language-picker {
    justify-self: end;
    max-width: 100%;
  }

  .site-main::before {
    right: 12px;
    left: 12px;
  }
}

/* Too narrow for the brand's name beside the picker and Log out: its mark alone. */
@media screen and (max-width: 480px) {
  .site-brand__name {
    display: none;
  }
}

@media print {
  .site-main,
  .site-nav__section,
  .context-card,
  .panel,
  .module-panel,
  .cp-form,
  .ticket-form,
  .content-section,
  .compose-form,
  .cp-scroll,
  .forum-table-scroll {
    clip-path: none;
  }
}

/* ---------- statistics (gamecq/modules/stats.php, interface/stats.js) ---------- */

.stats,
.war-report {
  /* Faction identity, as the in-game navigation map draws territory (WindowNavigation.cpp controlFactionColor) */
  --stats-f-ugto: #dfe4ea;
  --stats-f-icc: #3c82ff;
  --stats-f-kluth: #f04848;
  --stats-f-ai: #5d6b78;
  /* Community servers: numbers as each host reports them */
  --stats-unverified: #ddba60;
  --stats-seq-0: #14212b;
  --stats-seq-1: #1d4e46;
  --stats-seq-2: #2f7564;
  --stats-seq-3: #5c9f88;
  --stats-seq-4: #9fd3bd;
  --stats-line: var(--deck-line, var(--border-strong));
  --stats-line-soft: var(--deck-line-soft, var(--border));
  --stats-line-hot: var(--deck-line-hot, var(--accent-bright));
  min-width: 0;
}

.stats .stats-r {
  text-align: right;
}
.stats .stats-mono {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.stats .stats-strong {
  font-weight: 600;
}
.stats .stats-muted {
  color: var(--fg-muted);
}
.stats .stats-dim {
  color: var(--fg-dim);
}
.stats .stats-fg {
  color: var(--fg);
}
.stats .stats-up {
  color: var(--success);
}
.stats .stats-down {
  color: var(--danger);
}
.stats .stats-empty {
  margin: 0;
  padding: var(--sp-6);
  color: var(--fg-muted);
  text-align: center;
}

.stats .stats-chips .filter-chips__items a {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.stats .stats-chips .stats-chip--community[aria-current="page"] {
  border-color: var(--stats-unverified);
  background: color-mix(in srgb, var(--stats-unverified) 14%, transparent);
}
.stats .stats-chip-sep {
  width: 1px;
  height: 22px;
  margin: 0 var(--sp-1);
  background: var(--border-strong);
}
.stats .stats-inline-form {
  display: inline-flex;
  gap: var(--sp-1);
  margin: 0;
}
.stats .stats-min {
  color: var(--fg-muted);
  font-size: var(--fs-sm);
}
.stats .stats-min strong {
  color: var(--accent-bright);
}

.stats .stats-input,
.stats .stats-select {
  min-width: 0;
  min-height: 30px;
  padding: 0 var(--sp-2);
  color: var(--fg);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font: inherit;
}
.stats .stats-select.is-active {
  border-color: var(--stats-unverified);
  color: var(--link-hover);
}
.stats .stats-check {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: var(--fg-muted);
  font-size: var(--fs-sm);
  cursor: pointer;
}
.stats .stats-btn {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 var(--sp-3);
  color: var(--fg);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.stats .stats-btn:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
  color: var(--link-hover);
}
.stats .stats-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  margin: 0;
}
.stats .stats-kb-pilot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  width: 100%;
  font-size: var(--fs-sm);
}

.stats .stats-tabs {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  margin: 0 0 var(--sp-4);
  border-bottom: 1px solid var(--stats-line);
}
.stats .stats-tab {
  position: relative;
  padding: 10px 10px 9px;
  color: var(--fg-muted);
  font-family: var(--font-display);
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}
.stats .stats-tab:hover {
  color: var(--fg);
}
.stats .stats-tab[aria-current="page"] {
  color: var(--accent-bright);
}
.stats .stats-tab[aria-current="page"]::after {
  position: absolute;
  right: 8px;
  bottom: -1px;
  left: 8px;
  height: 2px;
  content: "";
  background: var(--stats-line-hot);
  box-shadow: 0 0 8px var(--accent-glow);
}

.stats .stats-notice {
  margin: 0 0 var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  color: var(--cream);
  background: color-mix(in srgb, var(--stats-unverified) 7%, var(--bg-surface));
  border-left: 3px solid var(--stats-unverified);
  font-size: var(--fs-sm);
}
.stats .stats-notice strong {
  color: var(--stats-unverified);
}
.stats .stats-notice--you {
  background: color-mix(in srgb, var(--welcome) 7%, var(--bg-surface));
  border-left-color: var(--welcome);
}
.stats .stats-notice--you strong {
  color: var(--welcome);
}

.stats .cp-cell-meta {
  display: block;
}
.stats .stats-summary {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stats .stats-summary .detail-summary__item > strong {
  font-variant-numeric: tabular-nums;
}
.stats .content-section__foot:empty {
  display: none;
}

.stats .stats-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr));
  gap: 0 var(--sp-4);
}
.stats .stats-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: var(--sp-4);
}
.stats .stats-grid-2 > *,
.stats .stats-grid-3 > * {
  min-width: 0;
}

.stats .stats-rank {
  width: 2.5em;
  color: var(--fg-dim);
  font-family: var(--font-mono);
}
.stats .stats-rank.is-top {
  color: var(--accent-bright);
}
.stats .stats-pct {
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.stats .stats-pilot {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}
.stats .stats-pilot > a {
  font-weight: 600;
}
.stats .stats-tag {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: 0.04em;
}
a.stats-tag:hover {
  color: var(--link-hover);
}
.stats .stats-fdot {
  display: inline-block;
  flex: 0 0 8px;
  width: 8px;
  height: 8px;
  background: var(--fc, var(--stats-f-ai));
  transform: rotate(45deg);
}
.stats .stats-ai {
  display: inline-block;
  padding: 0 6px;
  color: var(--fg-muted);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.stats .stats-badge {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 1px 7px;
  color: var(--fg-muted);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}
.stats a.stats-badge:hover {
  color: var(--link-hover);
  border-color: var(--accent);
}
.stats .stats-badge--official {
  color: #9fc4ff;
  border-color: color-mix(in srgb, var(--stats-f-icc) 60%, transparent);
  background: color-mix(in srgb, var(--stats-f-icc) 12%, transparent);
}
.stats .stats-badge--community {
  color: var(--stats-unverified);
  border-color: color-mix(in srgb, var(--stats-unverified) 50%, transparent);
}
.stats .stats-badge--ok {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 45%, transparent);
}
.stats .stats-badge--off {
  color: var(--fg-dim);
}
.stats .stats-badge--solo {
  color: var(--accent-bright);
  border-color: var(--stats-line);
}

/* the faction standing */
.stats .stats-territory {
  display: flex;
  gap: 2px;
  height: 12px;
  margin: var(--sp-1) 0 var(--sp-2);
}
.stats .stats-territory > span {
  display: block;
  min-width: 2px;
  height: 100%;
  background: var(--fc);
}
.stats .stats-territory--inline {
  width: 140px;
  margin: 0;
}
.stats .stats-territory-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  margin-bottom: var(--sp-4);
  color: var(--fg-muted);
  font-size: var(--fs-xs);
}
.stats .stats-territory-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.stats .stats-war {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: var(--sp-3);
}
.stats .stats-war-card {
  position: relative;
  min-width: 0;
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  background:
    linear-gradient(
      160deg,
      color-mix(in srgb, var(--fc) 10%, transparent),
      transparent 60%
    ),
    var(--bg-elev);
  border: 1px solid color-mix(in srgb, var(--fc) 30%, var(--border));
}
.stats .stats-war-card::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  content: "";
  background: var(--fc);
}
.stats .stats-war-card__head {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  margin-bottom: var(--sp-3);
}
.stats .stats-war-card__head img {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-strong);
}
.stats .stats-war-card__head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.stats .stats-war-card__head small,
.stats .stats-war-card dt {
  display: block;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.stats .stats-war-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-2) var(--sp-3);
  margin: 0;
}
.stats .stats-war-card dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-lg);
  font-variant-numeric: tabular-nums;
}

/* highlights */
.stats .stats-hl {
  display: grid;
  gap: var(--sp-1);
  min-width: 0;
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-elev);
  border: 1px solid var(--border);
}
.stats .stats-hl > span {
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.stats .stats-hl > strong {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats .stats-hl > small {
  color: var(--fg-muted);
  font-size: var(--fs-xs);
}

/* the live feed */
.stats .stats-feed {
  margin: 0;
  padding: 0;
  list-style: none;
}
.stats .stats-feed li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--sp-3);
  align-items: center;
  padding: 8px var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.stats .stats-feed li:last-child {
  border-bottom: 0;
}
.stats .stats-feed time {
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}
.stats .stats-feed__what {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats .stats-feed__what .stats-pilot {
  display: inline-flex;
  flex-wrap: nowrap;
}
.stats .stats-feed__where {
  color: var(--fg-muted);
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.stats .stats-feed li.is-new {
  animation: stats-flash 2.4s var(--ease);
}
@keyframes stats-flash {
  from {
    background: color-mix(in srgb, var(--accent) 22%, transparent);
  }
  to {
    background: transparent;
  }
}
.stats .stats-live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--success);
  animation: stats-pulse 1.6s infinite;
}
@keyframes stats-pulse {
  50% {
    opacity: 0.35;
  }
}

/* charts */
.stats .stats-chart {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 120px;
}
.stats .stats-chart svg {
  display: block;
  width: 100%;
  overflow: visible;
}
.stats .stats-chart text {
  fill: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: 10px;
}
.stats .stats-chart__grid line {
  stroke: var(--border);
  stroke-width: 1;
}
.stats .stats-chart__xhair {
  stroke: var(--accent-bright);
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
.stats .stats-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  margin: 0 0 var(--sp-2);
  color: var(--fg-muted);
  font-size: var(--fs-xs);
}
.stats .stats-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.stats .stats-legend i {
  display: inline-block;
  width: 14px;
  height: 2px;
  background: var(--fc);
}
.stats .stats-legend i.stats-legend__box {
  width: 10px;
  height: 10px;
}
.stats-tip {
  position: fixed;
  z-index: 100;
  min-width: 150px;
  max-width: 260px;
  padding: 8px 10px;
  pointer-events: none;
  background: color-mix(in srgb, var(--bg-surface-2) 96%, transparent);
  border: 1px solid var(--deck-line, var(--border-strong));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  font-size: var(--fs-xs);
}
.stats-tip h4 {
  margin: 0 0 4px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.stats-tip div {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 6px;
  align-items: center;
}
.stats-tip div i {
  height: 2px;
  background: var(--fc);
}
.stats-tip b {
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.stats-tip span {
  color: var(--fg-muted);
}

.stats .stats-bars {
  display: grid;
  gap: 6px;
}
.stats .stats-bar-row {
  display: grid;
  grid-template-columns: minmax(90px, 140px) minmax(0, 1fr) auto;
  gap: var(--sp-3);
  align-items: center;
  font-size: var(--fs-sm);
}
.stats .stats-bar-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats .stats-bar-track {
  display: flex;
  gap: 2px;
  height: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
}
.stats .stats-bar-track--inline {
  display: inline-flex;
  width: 120px;
}
.stats .stats-bar-fill {
  min-width: 1px;
  height: 100%;
  background: var(--fc, var(--accent));
}
.stats .stats-bar-value {
  min-width: 4ch;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-align: right;
}
.stats .stats-spark {
  display: block;
}

.stats .stats-heat {
  display: grid;
  grid-template-columns: 34px repeat(24, minmax(0, 1fr));
  gap: 2px;
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: 9px;
}
.stats .stats-heat i {
  display: block;
  max-width: 100%;
  aspect-ratio: 1.4;
  border-radius: 1px;
}
.stats .stats-heat em {
  align-self: center;
  font-style: normal;
}
.stats .stats-heat .stats-heat__hour {
  text-align: center;
}
.stats .stats-heat-scale {
  display: flex;
  gap: 4px;
  align-items: center;
  margin-top: var(--sp-2);
  color: var(--fg-dim);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
}
.stats .stats-heat-scale i {
  display: inline-block;
  width: 14px;
  height: 8px;
}
.stats .stats-heat__l0 {
  background: var(--stats-seq-0);
}
.stats .stats-heat__l1 {
  background: var(--stats-seq-1);
}
.stats .stats-heat__l2 {
  background: var(--stats-seq-2);
}
.stats .stats-heat__l3 {
  background: var(--stats-seq-3);
  color: var(--bg);
}
.stats .stats-heat__l4 {
  background: var(--stats-seq-4);
  color: var(--bg);
}

.stats .stats-matrix .stats-cell {
  padding: 6px 4px;
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  text-align: center;
}
.stats .stats-matrix td.stats-heat__l0,
.stats .stats-matrix td.stats-heat__l1,
.stats .stats-matrix td.stats-heat__l2,
.stats .stats-matrix td.stats-heat__l3,
.stats .stats-matrix td.stats-heat__l4 {
  background-clip: padding-box;
}
.stats .stats-matrix .stats-rowh {
  text-align: right;
  white-space: nowrap;
}
.stats .stats-matrix__col {
  font-size: 10px;
}

/* the killboard */
.stats .stats-kills tr.is-link {
  cursor: pointer;
}
.stats .stats-kills tr.stats-killdetail > td {
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  background: var(--bg);
}
.stats .stats-killdetail__head {
  margin-bottom: 8px;
}
.stats .stats-final-blow {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-sm);
}
.stats .stats-assists {
  display: grid;
  gap: 4px;
  max-width: 520px;
}
.stats .stats-assists .stats-bar-row {
  grid-template-columns: minmax(120px, 200px) minmax(0, 1fr) auto;
}
.stats .stats-pager {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  justify-content: flex-end;
  padding: var(--sp-2) var(--sp-4);
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
}

/* a pilot's, fleet's, engagement's or server's page */
.stats .stats-back {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-bottom: var(--sp-3);
  color: var(--accent-bright);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-decoration: none;
  text-transform: uppercase;
}
.stats .stats-subheading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
}
.stats .stats-profile-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-4);
  align-items: center;
  margin-bottom: var(--sp-4);
  padding: var(--sp-4);
  background:
    linear-gradient(
      110deg,
      color-mix(in srgb, var(--fc) 14%, transparent),
      transparent 55%
    ),
    var(--bg-surface);
  border: 1px solid var(--stats-line);
}
.stats .stats-profile-head::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  content: "";
  background: var(--fc);
}
.stats .stats-profile-head img {
  width: 56px;
  height: 56px;
  border: 1px solid var(--border-strong);
}
.stats .stats-profile-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 30px);
  letter-spacing: 0.03em;
}
.stats .stats-profile-head--small {
  margin-bottom: 8px;
  padding: 12px;
}
.stats .stats-profile-head--small img {
  width: 40px;
  height: 40px;
}
.stats .stats-profile-head--small h2 {
  font-size: 20px;
}
.stats .stats-sub {
  color: var(--fg-muted);
  font-size: var(--fs-sm);
}
.stats .stats-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: auto;
}
.stats .stats-pill {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  padding: 4px 10px;
  color: var(--fg-muted);
  background: var(--bg-elev);
  border: 1px solid var(--stats-line);
  font-size: var(--fs-xs);
}
.stats .stats-pill b {
  color: var(--accent-bright);
  font-family: var(--font-display);
  font-size: var(--fs-md);
}
.stats .stats-sides {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: var(--sp-4);
}
.stats .stats-side {
  min-width: 0;
}
.stats .stats-side__top {
  margin-top: 12px;
}
.stats .stats-top-list {
  margin: 6px 0 0;
  padding-left: 20px;
}
.stats .stats-timeline {
  position: relative;
  height: 56px;
  margin-top: var(--sp-2);
  background: var(--bg-elev);
  border: 1px solid var(--border);
}
.stats .stats-timeline i {
  position: absolute;
  bottom: 4px;
  width: 3px;
  background: var(--fc);
  border-radius: 1px;
}
.stats .stats-timeline__ends {
  justify-content: space-between;
  margin-top: 6px;
}

@media (max-width: 780px) {
  .stats .stats-hide-sm {
    display: none;
  }
  .stats .stats-bar-row {
    grid-template-columns: minmax(80px, 110px) minmax(0, 1fr) auto;
  }
  .stats .stats-assists .stats-bar-row {
    grid-template-columns: minmax(90px, 140px) minmax(0, 1fr) auto;
  }
  .stats .stats-pills {
    margin-left: 0;
  }
  .stats .stats-heat {
    grid-template-columns: 26px repeat(24, minmax(0, 1fr));
    gap: 1px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stats .stats-feed li.is-new,
  .stats .stats-live-dot {
    animation: none;
  }
}

/* ---------- war report sidebox (darkspace/sideboxes/war_report.php) ---------- */

.war-report {
  display: grid;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
}
.war-report p {
  margin: 0;
}
.war-report__caption,
.war-report__label {
  display: block;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  font-size: var(--fs-xxs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.war-report__quiet {
  color: var(--fg-muted);
}
.war-report__factions {
  display: grid;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.war-report__factions li {
  display: flex;
  flex-wrap: wrap;
  gap: 2px var(--sp-2);
  align-items: baseline;
  justify-content: space-between;
}
.war-report__name {
  color: var(--fc);
  font-weight: 600;
}
.war-report__numbers {
  color: var(--fg-muted);
  font-size: var(--fs-xs);
}
.war-report__bar {
  display: block;
  flex: 1 0 100%;
  height: 4px;
  background: var(--bg-elev);
}
.war-report__bar i {
  display: block;
  height: 100%;
  min-width: 1px;
  background: var(--fc);
}
.war-report__item a {
  font-weight: 600;
}
.war-report__meta {
  display: block;
  color: var(--fg-muted);
  font-size: var(--fs-xs);
}
.war-report__more {
  justify-self: end;
  font-size: var(--fs-xs);
}

/* the Subscribers report */
.stats .subs-summary {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.stats .subs-summary--four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.stats .subs-summary .detail-summary__item {
  padding: var(--sp-3);
}
.stats .subs-summary small {
  color: var(--fg-muted);
  font-size: var(--fs-xs);
  line-height: 1.3;
}
.stats .subs-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 var(--sp-4);
}
.stats .subs-charts > * {
  min-width: 0;
}
.stats .subs-charts__wide {
  grid-column: 1 / -1;
}
.stats .subs-highlights {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
}
.stats .subs-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
  align-items: start;
}
.stats .subs-amount {
  margin-left: auto;
  color: var(--fg);
  font-family: var(--font-mono);
  letter-spacing: 0;
  text-transform: none;
}
.stats .subs-flush {
  min-width: 0;
  background: transparent;
}
.stats .subs-flush .number {
  text-align: right;
}
.stats .subs-box {
  display: inline-block;
  width: 10px;
  height: 10px;
}
.stats .subs-months {
  display: inline-grid;
  grid-template-columns: repeat(12, 9px);
  gap: 2px;
  vertical-align: middle;
}
.stats .subs-months i {
  display: block;
  height: 16px;
}
.stats .subs-months i.subs-cont {
  box-shadow: -2px 0 0 var(--stats-seq-3);
}
.stats .subs-key {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  margin-top: var(--sp-3);
  color: var(--fg-muted);
  font-size: var(--fs-xs);
}
.stats .subs-key span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.stats .subs-history dd {
  font-weight: 400;
}
.stats .subs-figures > summary {
  cursor: pointer;
}
@media (max-width: 1180px) {
  .stats .subs-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stats .subs-summary--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .stats .subs-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 1000px) {
  .stats .subs-charts {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 560px) {
  .stats .subs-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
