:root {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color-scheme: dark;
  background: #0e1013;
  color: #f2f4f7;
  --panel: #171a1f;
  --line: #292e36;
  --muted: #9ba3af;
  --accent: #d9b85f;
  --danger: #e07373;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
.footer-locale { display: inline-flex; align-items: center; gap: 6px; }
.footer-locale label { color: var(--muted); white-space: nowrap; }
.footer-locale select { min-width: 122px; padding: 4px 7px; border-radius: 0; }

.topbar {
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5vw;
  border-bottom: 1px solid var(--line);
  background: #111419;
}

.brand { color: var(--accent); text-decoration: none; font-weight: 800; }
nav { display: flex; gap: 18px; }
nav a { color: var(--muted); text-decoration: none; }
.shell { width: min(1100px, 92vw); margin: 34px auto 80px; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.hidden { display: none !important; }

.toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) repeat(5, minmax(120px, auto));
  gap: 10px;
  margin: 22px 0;
}

input, select, textarea, button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111419;
  color: #f2f4f7;
  padding: 10px 12px;
}

button { cursor: pointer; }
.primary { background: var(--accent); color: #111; border-color: var(--accent); font-weight: 700; }

.card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.server-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.server-card h2 { margin: 0 0 8px; font-size: 1.1rem; }
.server-card h2 a { text-decoration: none; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: .82rem;
}

.vote { display: grid; grid-template-columns: 38px 54px 38px; align-items: center; text-align: center; }
.vote button { padding: 7px; }
.score { font-weight: 800; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kv { padding: 12px; border: 1px solid var(--line); border-radius: 8px; }
.kv strong { display: block; color: var(--muted); font-size: .8rem; margin-bottom: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid label { display: grid; gap: 6px; color: var(--muted); }
.full { grid-column: 1 / -1; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.ad-slot[hidden] { display: none !important; }
.local-launch { max-width: 680px; margin: 70px auto; }
.local-launch h1 { margin-top: 0; }
.local-launch code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #0e1013;
}
.local-open {
  display: inline-block;
  width: fit-content;
  margin-top: 8px;
  border-radius: 8px;
  padding: 10px 14px;
  text-decoration: none;
}

@media (max-width: 760px) {
  .topbar { gap: 12px; padding-block: 14px; }
  nav { gap: 10px; font-size: .9rem; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar input:first-child { grid-column: 1 / -1; }
  .server-card { grid-template-columns: 1fr; }
  .detail-grid, .form-grid { grid-template-columns: 1fr; }
}

/* Silkroad-era directory theme, using only bundled static assets. */
:root {
  color-scheme: dark;
  font-family: Tahoma, Verdana, Arial, sans-serif;
  font-size: 12px;
  color: #e9e9ea;
  --panel: #141412;
  --line: #494942;
  --muted: #aaa9a2;
  --accent: #c8ad72;
  --danger: #e4a39c;
}
html { min-height: 100%; background: #424f43; }
body {
  min-height: 100vh;
  background: url("./reference-scene.webp") center top / cover fixed no-repeat, #617a65;
}
a { text-decoration: none; }
button, input, select, textarea { font-size: 12px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid #e1bd65;
  outline-offset: 2px;
}

.hero {
  height: 198px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 29px;
}
.brand { display: flex; flex-direction: column; align-items: center; color: #100d0a; }
.brand-title {
  font-family: Impact, "Arial Black", Tahoma, sans-serif;
  text-transform: none;
  font-size: clamp(60px, 5.7vw, 94px);
  font-weight: 900;
  font-style: italic;
  font-stretch: condensed;
  line-height: .94;
  letter-spacing: -5px;
  -webkit-text-stroke: 1.1px #855422;
  text-shadow: 2px 2px 0 #c29552, -1px -1px 0 #7e4a20, 4px 5px 1px #4c361f44;
  transform: skewX(-8deg) rotate(-1.5deg);
}
.brand-subtitle {
  color: #24201d;
  margin: 4px 0 0 23px;
  font-family: Georgia, serif;
  font-size: 25px;
  letter-spacing: 18px;
  line-height: 1;
}

.shell {
  width: min(1510px, 85vw);
  margin: 0 auto 24px;
  min-height: 535px;
}
.directory-frame {
  position: relative;
  min-height: 510px;
  border: 1px solid #8e8978;
  border-radius: 9px 9px 2px 2px;
  background: #171716;
  box-shadow:
    inset 0 0 0 2px #080807,
    inset 0 0 0 4px #454438,
    0 0 0 2px #111210,
    0 10px 22px #0009;
}
.directory-frame::before {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 5px;
  border: 1px solid #77726388;
  border-radius: 3px;
}
.frame-heading {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font: bold 12px Tahoma, sans-serif;
  color: #fff;
  text-shadow: 1px 1px #000;
  border: 1px solid #272720;
  border-bottom: 2px ridge #777364;
  border-radius: 7px 7px 0 0;
  background:
    linear-gradient(180deg, #44433e 0%, #24241f 13%, #090a09 60%, #292823 100%);
  margin: 4px 4px 0;
}
.frame-content {
  margin: 0 6px 6px;
  padding: 18px 18px 20px;
  min-height: 467px;
  background:
    radial-gradient(circle at 15% 15%, #292827 0, transparent 44%),
    repeating-linear-gradient(25deg, #ffffff02 0px, #ffffff02 1px, transparent 1px, transparent 5px),
    #1b1b1b;
  border: 1px solid #35342e;
  box-shadow: inset 0 1px #080807, inset 0 0 0 2px #1c1c1a;
}
.tabs-and-tools { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.race-tabs { display: flex; align-items: flex-end; gap: 5px; min-width: 0; }
.race-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 11px 5px;
  min-height: 24px;
  border: 1px solid #77756d;
  border-radius: 4px 4px 0 0;
  color: #f7f8fc;
  white-space: nowrap;
  font-size: 11px;
  font-weight: bold;
  text-shadow: 0 1px 2px #000;
  box-shadow: inset 0 1px 0 #87929d88, 0 0 0 1px #101010;
  background: linear-gradient(180deg,#66768b 0%,#364b66 31%,#203148 60%,#182337 100%);
}
.race-tab:hover { filter: brightness(1.24); }
.race-tab[aria-selected="true"] {
  border-color: #a6b8c1;
  background: linear-gradient(#45afcf 0%, #156d96 48%, #134769 100%);
  color: #fff;
}
.tool-toggle {
  border-radius: 3px;
  padding: 3px 10px;
  min-height: 24px;
  border: 1px solid #6a6555;
  background: linear-gradient(#444236, #22211d);
  font-weight: bold;
  color: #e7dbc1;
}
.tool-toggle[aria-expanded="true"] { color: #fff; background: #4c4737; }
.filters-panel {
  display: grid;
  grid-template-columns: 2fr repeat(4, minmax(100px, 1fr));
  align-items: end;
  gap: 9px;
  margin: 8px 0 0;
  padding: 10px;
  border: 1px solid #555245;
  background: #11110f;
}
.filters-panel[hidden] { display: none; }
.filters-panel label { display: grid; gap: 4px; font-weight: 700; font-size: 11px; color: #b6b2a8; }
.filters-panel input, .filters-panel select {
  width: 100%;
  padding: 6px;
  border-radius: 2px;
  min-width: 0;
  border: 1px solid #6b665b;
  background: #232321;
  color: #f5f5f5;
}
.table-surround {
  margin-top: 0;
  padding: 33px 18px 13px;
  min-height: 395px;
  border: 1px solid #686761;
  background:
    repeating-linear-gradient(130deg, #eeeeee05 0px, #eeeeee05 1px, transparent 1px, transparent 4px),
    #272727;
  box-shadow: inset 0 0 0 2px #0d0d0c, inset 0 0 0 3px #494844;
}
.table-scroll { width: 100%; overflow-x: auto; scrollbar-color: #5e5a4e #111; }
.server-table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
  min-width: 750px;
  background: #030303;
  font-family: Tahoma, Verdana, sans-serif;
  font-size: 12px;
}
.server-table th {
  padding: 0;
  height: 21px;
  font-size: 11px;
  text-align: left;
  color: white;
  font-weight: bold;
  border: 1px solid #545869;
  border-left: 0;
  border-right: 0;
  text-shadow: 1px 1px #171d29;
  background: linear-gradient(#45536f, #303e55);
}
.server-table th:first-child { padding-left: 0; }
.sort-header {
  appearance: none;
  width: 100%;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 3px 7px;
  border: 0;
  border-radius: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: inherit;
  line-height: 1;
  text-align: left;
  text-shadow: inherit;
  cursor: pointer;
}
.server-table th:first-child .sort-header { padding-left: 21px; }
.sort-header:hover,
.sort-header:focus-visible {
  color: #fff6cf;
  background: #ffffff12;
  outline: none;
}
.sort-header.active { color: #fff5d2; }
.sort-indicator {
  flex: 0 0 auto;
  min-width: 10px;
  color: #d8c89a;
  font-size: 8px;
  text-align: center;
  opacity: .75;
}
.sort-header.active .sort-indicator {
  color: #fff2b7;
  opacity: 1;
}
.server-table td {
  height: 31px;
  padding: 3px 8px;
  border-bottom: 1px solid #303030;
  vertical-align: middle;
  color: #efefef;
  background: #030303;
}
.server-table tbody tr:hover td { background: #1b1c1a; }
.server-table th:first-child,.server-table td:first-child { padding-left: 21px; }
.server-table .name-cell { font-weight: 600; }
.server-table .name-cell a { color: #f4f4f4; }
.server-table .name-cell a:hover { color: #e1c68b; }
.server-table .notice-row td {
  color: #fff6e1;
  font-weight: 700;
  background: linear-gradient(#624019, #51310e);
  border-top: 1px solid #956a37;
  border-bottom: 1px solid #38280e;
}
.notice-symbol { margin-right: 14px; color: #ffda51; text-shadow: 0 0 7px #d09c20; }
.race-icons { display: inline-flex; align-items: center; gap: 4px; }
.race-icon {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  width: 15px;
  height: 15px;
  font-weight: bold;
  font-size: 8px;
  border: 1px solid #b38d4f;
  color: #ffdf93;
  background: radial-gradient(circle at 30% 25%, #9f3928, #501a18 60%, #220c0c);
  text-shadow: 0 1px #000;
}
.race-icon.eu {
  border-radius: 2px 2px 6px 6px;
  border-color: #8e9aaf;
  background: linear-gradient(125deg, #6a88bd, #20365b 55%, #1a2242);
  color: #f4f4d6;
}
.feature-icon {
  display: inline-grid;
  place-items: center;
  margin-right: 4px;
  width: 16px;
  height: 16px;
  border: 1px solid #ae996a;
  background: linear-gradient(130deg, #644f30, #231910);
  color: #ead3a2;
  font-size: 11px;
  text-shadow: 0 1px #000;
}
.listed-date { white-space: nowrap; }
.discord-cell { white-space: nowrap; }
.discord-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
}
.discord-link {
  color: #b8c6e3;
  font-weight: 700;
  text-decoration: none;
  text-shadow: 1px 1px #111722;
}
.discord-link:hover { color: #eef3ff; }
.discord-members {
  color: #e2d2a9;
  cursor: help;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  border-bottom: 1px dotted #706a58;
}
.website-button {
  width: 100px;
  max-width: 100%;
  display: inline-block;
  text-align: center;
  padding: 2px 8px;
  font: 11px Tahoma, sans-serif;
  color: #fae3b0;
  text-shadow: 1px 1px #211a11;
  border: 1px solid #aaa18a;
  outline: 1px solid #292314;
  box-shadow: inset 0 0 0 1px #544832, inset 0 1px #d3bd8c;
  background: linear-gradient(#84775b, #63543b);
}
.website-button:hover { background: linear-gradient(#a18b61, #7e6541); color: #fff; }
.website-button.disabled { opacity: .5; cursor: default; }
.cell-label, .portrait-status { display: none; }
.vote-mini { display: inline-flex; gap: 2px; align-items: center; margin-left: 12px; font-weight: normal; color: #afab9e; }
.vote-mini button { font-size: 10px; width: 17px; min-height: 17px; padding: 0; border-radius: 2px; color: #baac80; border: 1px solid #4a493e; background: #1c1d1d; }
.vote-mini button:hover { color: #fff; background: #485136; }
.vote-mini .score { min-width: 17px; text-align: center; font-weight: 600; font-size: 10px; }
.list-state {
  padding: 65px 20px;
  text-align: center;
  color: #c1bdaf;
  background: #080808 !important;
  line-height: 1.8;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.list-state strong { display: block; font-size: 14px; color: #e9dfc4; }
.list-status { color: #b5b09f; font-size: 11px; margin: 10px 0 0; display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: #78ad70; }
.status-dot.offline { background: #b69761; }
.pager button { padding: 4px 10px; border: 1px solid #8d8169; color: #ede1bf; border-radius: 2px; background: #3f3b30; }
.pager { justify-content: flex-end; margin-top: 9px; font-size: 11px; }
.site-footer {
  width: min(1510px, 85vw);
  margin: 0 auto 32px;
  padding: 9px 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  color: #d3cfb9;
  font-size: 11px;
  background: #121511b8;
  border: 1px solid #6a6658a0;
}
.site-footer nav { display: flex; gap: 22px; }
.site-footer a { color: #f0d79c; }
.site-footer a:hover { text-decoration: underline; }

/* Supporting pages share the framed game panel without changing their forms. */
.subpage { padding: 24px; }
.subpage h1 { margin: 0 0 19px; font-size: 22px; color: #e8d6b3; }
.subpage h2 { font-size: 16px; margin: 0; color: #e8d6b3; }
.subpage .card {
  border: 1px solid #676151;
  border-radius: 2px;
  background: #0e0e0d;
}
.subpage .card a { color: #f1d7a0; }
.subpage .primary {
  color: #231d13;
  border: 1px solid #d0b275;
  background: linear-gradient(#f1d69d, #b39558);
}
.subpage input, .subpage select, .subpage textarea, .subpage button {
  border-radius: 2px;
}
.subpage .vote { display: inline-flex; gap: 5px; }
.subpage .vote button { padding: 5px 8px; }
.subpage .detail-grid { margin: 14px 0; }
.subpage .kv { border-radius: 2px; background: #10100f; border-color: #5a5445; }
.offline-note { padding: 12px 15px; border: 1px solid #7f6f45; background: #352b1a; color: #f2dfb3; }

@media (max-width: 1100px) {
  .shell, .site-footer { width: 94vw; }
  .filters-panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 650px) {
  .hero { height: 155px; padding-top: 32px; }
  .brand-title { font-size: 57px; }
  .brand-subtitle { font-size: 16px; letter-spacing: 12px; }
  .shell, .site-footer { width: 97vw; }
  .frame-content { padding: 10px 7px; }
  .table-surround { padding: 15px 5px; min-height: 280px; }
  .race-tab { padding: 5px 7px; font-size: 10px; }
  .tool-toggle { font-size: 11px; }
  .filters-panel { grid-template-columns: 1fr 1fr; }
  .filters-panel label:first-child { grid-column: 1 / -1; }
  .subpage { padding: 15px 10px; }
  .site-footer nav { gap: 12px; flex-wrap: wrap; }
}

/* Portrait is its own layout, rather than a horizontally clipped desktop table.
   Narrow landscape phones use the same compact rows so that all actions fit. */
@media (orientation: portrait), (max-width: 820px) {
  html, body { min-width: 0; max-width: 100%; }
  body {
    background-position: center top;
    background-size: auto 100vh;
    background-attachment: scroll;
    background-repeat: no-repeat;
    background-color: #414d40;
  }
  .hero {
    height: clamp(112px, 19vh, 178px);
    padding-top: clamp(12px, 3vh, 30px);
  }
  .brand { max-width: 100%; }
  .brand-title {
    font-size: clamp(42px, 9vw, 80px);
    letter-spacing: -2px;
  }
  .brand-subtitle {
    font-size: clamp(12px, 2.3vw, 23px);
    letter-spacing: clamp(7px, 2vw, 17px);
    margin-left: 12px;
  }
  .shell, .site-footer {
    width: min(1100px, calc(100% - 16px));
    min-width: 0;
  }
  .shell { min-height: 0; }
  .directory-frame { min-height: 0; }
  .frame-content {
    min-height: 0;
    padding: clamp(8px, 2vw, 18px);
  }
  .tabs-and-tools {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
  .race-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 5px;
  }
  .race-tab {
    min-width: 0;
    min-height: 38px;
    padding: 7px 3px;
    font-size: clamp(9px, 1.7vw, 12px);
    white-space: normal;
    text-align: center;
    line-height: 1.15;
  }
  .tool-toggle {
    min-height: 40px;
    width: 100%;
    text-align: center;
  }
  .filters-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 7px 0;
    gap: 9px;
    padding: 9px;
  }
  .filters-panel label:first-child { grid-column: 1 / -1; }
  .filters-panel input, .filters-panel select { min-height: 39px; }
  .table-surround {
    min-height: 0;
    margin-top: 8px;
    padding: clamp(5px, 1.6vw, 14px);
  }
  .table-scroll { overflow: visible; }
  .server-table, .server-table tbody {
    display: block;
    min-width: 0;
    width: 100%;
    background: transparent;
  }
  .server-table colgroup { display: none; }
  .server-table thead {
    display: block;
    width: 100%;
    margin-bottom: 8px;
    overflow: visible;
  }
  .server-table thead tr {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 3px;
  }
  .server-table thead th {
    display: block;
    flex: 1 1 95px;
    min-width: 0;
    width: auto;
    height: auto;
    border: 1px solid #545869;
    background: linear-gradient(180deg, #46536b 0%, #39465d 100%);
  }
  .server-table thead .sort-header {
    width: 100%;
    min-height: 34px;
    padding: 6px 10px;
    white-space: nowrap;
  }
  .server-table thead th:first-child .sort-header { padding-left: 10px; }
  .server-table tbody {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 315px), 1fr));
    align-items: stretch;
    gap: 10px;
  }
  .server-table tbody tr:not(.notice-row):not(.empty-row) {
    display: grid;
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "name name"
      "races cap"
      "date features"
      "discord discord"
      "website website";
    align-content: start;
    gap: 0 10px;
    padding: 10px 11px 11px;
    border: 1px solid #6a6252;
    border-radius: 3px;
    background: linear-gradient(140deg, #1e1e1b, #070707 60%);
    box-shadow: inset 0 1px 0 #a18b5836, 0 2px 5px #0009;
  }
  .server-table tbody tr:not(.notice-row):not(.empty-row):hover {
    border-color: #b1a078;
    background: linear-gradient(140deg, #333027, #10100f 60%);
  }
  .server-table tbody tr:not(.notice-row):not(.empty-row) > td {
    display: flex;
    min-width: 0;
    width: 100%;
    height: auto;
    padding: 6px 1px;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    border: 0;
    border-bottom: 1px solid #3b3933;
    background: transparent;
    font-size: 12px;
  }
  .server-table tbody tr:not(.notice-row):not(.empty-row):hover > td {
    background: transparent;
  }
  .server-table tbody tr > .name-cell {
    grid-area: name;
    gap: 9px;
    flex-wrap: wrap;
    align-content: center;
    padding: 3px 0 9px !important;
    font-size: 14px !important;
    font-weight: bold;
    border-bottom-color: #877451 !important;
  }
  .server-table .name-cell > a {
    min-width: 0;
    overflow-wrap: anywhere;
    flex: 1 1 100px;
  }
  .portrait-status {
    display: inline-flex;
    border: 1px solid #595341;
    background: #393526;
    color: #d8c9a3;
    font-size: 10px;
    font-weight: normal;
    padding: 3px 6px;
    border-radius: 2px;
    text-transform: capitalize;
  }
  .server-table .vote-mini {
    flex: 0 0 auto;
    margin: 0;
    gap: 4px;
  }
  .server-table .vote-mini button {
    min-width: 30px;
    min-height: 30px;
    font-size: 12px;
  }
  .server-table .vote-mini .score { min-width: 23px; font-size: 12px; }
  .server-table tbody tr > td:nth-child(2) { grid-area: races; }
  .server-table tbody tr > td:nth-child(3) { grid-area: cap; }
  .server-table tbody tr > td:nth-child(4) { grid-area: date; }
  .server-table tbody tr > td:nth-child(5) { grid-area: features; }
  .server-table tbody tr > td:nth-child(6) {
    grid-area: discord;
    padding: 8px 1px !important;
  }
  .server-table tbody tr > td:nth-child(7) {
    grid-area: website;
    border-bottom: 0 !important;
    padding: 11px 0 0 !important;
  }
  .cell-label {
    display: inline-block;
    min-width: 0;
    color: #a9a398;
    font-size: 10px;
    line-height: 1.2;
  }
  .race-icons { gap: 5px; }
  .race-icon { width: 17px; height: 17px; }
  .discord-info {
    justify-content: flex-end;
    gap: 10px;
  }
  .website-button {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 36px;
    padding: 9px 8px;
    font-size: 12px;
  }
  .notice-row, .empty-row { display: block; grid-column: 1 / -1; }
  .notice-row td, .empty-row td {
    display: block;
    width: 100%;
    height: auto;
    min-width: 0;
    white-space: normal;
    padding: 12px !important;
  }
  .list-state { padding: 35px 15px !important; }
  .list-status { align-items: flex-start; }
  .pager { flex-wrap: wrap; }
  .subpage { min-width: 0; padding: clamp(12px, 2vw, 24px); }
  .subpage .detail-grid, .subpage .form-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  }
  .subpage .row { min-width: 0; }
  .subpage input, .subpage textarea, .subpage select { min-width: 0; max-width: 100%; }
  .subpage pre, .subpage code { overflow-wrap: anywhere; word-break: break-word; }
  .site-footer { align-items: center; }
  .site-footer nav { justify-content: space-around; flex: 1 1 100%; gap: 10px; }
}

@media (max-width: 410px) {
  .shell, .site-footer { width: calc(100% - 8px); }
  .directory-frame { border-radius: 4px; }
  .frame-heading { font-size: 11px; }
  .frame-content { margin: 0 4px 5px; padding: 7px 5px; }
  .table-surround { padding: 4px; }
  .server-table tbody { gap: 7px; }
  .filters-panel { grid-template-columns: minmax(0, 1fr); }
  .filters-panel label:first-child { grid-column: auto; }
  .race-tab { font-size: 10px; }
  .server-table tbody tr:not(.notice-row):not(.empty-row) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    padding: 8px 8px 10px;
    gap: 0 7px;
  }
}

/* Final closed-bezel system. Each visible border is its own clipped layer,
   so the chamfers stay closed instead of leaving open border ends. */
.directory-frame {
  --outer-cut: 8px;
  min-height: 510px;
  padding: 3px;
  overflow: hidden;
  clip-path: polygon(
    var(--outer-cut) 0,
    calc(100% - var(--outer-cut)) 0,
    100% var(--outer-cut),
    100% calc(100% - var(--outer-cut)),
    calc(100% - var(--outer-cut)) 100%,
    var(--outer-cut) 100%,
    0 calc(100% - var(--outer-cut)),
    0 var(--outer-cut)
  );
  background:
    linear-gradient(180deg, #8f8c80 0 1px, #4c4a42 1px 2px, #171815 2px 3px),
    radial-gradient(ellipse at 16% 8%, #49483f 0%, transparent 30%),
    radial-gradient(ellipse at 82% 70%, #2b2c29 0%, transparent 42%),
    linear-gradient(180deg, #242521 0%, #11120f 100%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  box-shadow: 0 8px 18px #0009;
}

.directory-frame::before,
.directory-frame::after {
  display: none;
}

.frame-bezel {
  --bezel-cut: 6px;
  min-height: inherit;
  padding: 3px;
  clip-path: polygon(
    var(--bezel-cut) 0,
    calc(100% - var(--bezel-cut)) 0,
    100% var(--bezel-cut),
    100% calc(100% - var(--bezel-cut)),
    calc(100% - var(--bezel-cut)) 100%,
    var(--bezel-cut) 100%,
    0 calc(100% - var(--bezel-cut)),
    0 var(--bezel-cut)
  );
  background:
    linear-gradient(180deg, #0b0c0a 0 1px, #56544b 1px 2px, #141512 2px 100%),
    radial-gradient(ellipse at 24% 20%, #33332e 0%, transparent 36%),
    radial-gradient(ellipse at 72% 82%, #242521 0%, transparent 48%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.frame-heading {
  height: 26px;
  clip-path: polygon(
    5px 0,
    calc(100% - 5px) 0,
    100% 5px,
    100% 100%,
    0 100%,
    0 5px
  );
  background-image:
    linear-gradient(180deg, #3e3d37 0 1px, #171815 1px 4px, #090a08 4px 22px, #35352f 22px 24px, #777469 24px 25px, #11120f 25px 26px);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.frame-content {
  min-height: 467px;
  background:
    radial-gradient(ellipse at 15% 24%, #242522 0%, transparent 28%),
    radial-gradient(ellipse at 78% 18%, #1d1e1b 0%, transparent 34%),
    radial-gradient(ellipse at 62% 78%, #20211e 0%, transparent 42%),
    linear-gradient(180deg, #1d1e1b 0%, #121311 100%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  box-shadow:
    inset 0 1px 0 #050605,
    inset 0 2px 0 #393933;
}

.table-surround {
  --panel-cut: 4px;
  padding: 3px;
  min-height: 395px;
  clip-path: polygon(
    var(--panel-cut) 0,
    calc(100% - var(--panel-cut)) 0,
    100% var(--panel-cut),
    100% calc(100% - var(--panel-cut)),
    calc(100% - var(--panel-cut)) 100%,
    var(--panel-cut) 100%,
    0 calc(100% - var(--panel-cut)),
    0 var(--panel-cut)
  );
  background:
    linear-gradient(180deg, #67675f 0 1px, #363730 1px 2px, #090a08 2px 3px),
    radial-gradient(ellipse at 18% 28%, #282925 0%, transparent 36%),
    radial-gradient(ellipse at 83% 67%, #20211e 0%, transparent 48%),
    linear-gradient(180deg, #20211e 0%, #141513 100%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  box-shadow: none;
}

.table-bezel {
  --panel-inner-cut: 2px;
  min-height: inherit;
  padding: 33px 17px 10px;
  clip-path: polygon(
    var(--panel-inner-cut) 0,
    calc(100% - var(--panel-inner-cut)) 0,
    100% var(--panel-inner-cut),
    100% calc(100% - var(--panel-inner-cut)),
    calc(100% - var(--panel-inner-cut)) 100%,
    var(--panel-inner-cut) 100%,
    0 calc(100% - var(--panel-inner-cut)),
    0 var(--panel-inner-cut)
  );
  background:
    radial-gradient(ellipse at 12% 10%, #20211e 0%, transparent 30%),
    radial-gradient(ellipse at 76% 72%, #1a1b18 0%, transparent 46%),
    linear-gradient(180deg, #1b1c19 0%, #111210 100%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  box-shadow:
    inset 0 0 0 1px #0b0c0a,
    inset 0 0 0 2px #41423c;
}

.race-tab {
  clip-path: polygon(
    4px 0,
    calc(100% - 4px) 0,
    100% 4px,
    100% calc(100% - 3px),
    calc(100% - 3px) 100%,
    3px 100%,
    0 calc(100% - 3px),
    0 4px
  );
  border: 0;
  outline: 0;
  box-shadow:
    inset 0 0 0 1px #777b7c,
    inset 0 1px 0 #657083,
    inset 0 -1px 0 #171d27;
  background:
    linear-gradient(180deg, #3e4b62 0%, #344258 100%);
}

.race-tab[aria-selected="true"] {
  border: 0;
  outline: 0;
  box-shadow:
    inset 0 0 0 1px #83aebd,
    inset 0 1px 0 #48a5c3,
    inset 0 -1px 0 #0b4057;
  background:
    linear-gradient(180deg, #238bae 0%, #176f91 100%);
}

.tool-toggle {
  clip-path: polygon(
    4px 0,
    calc(100% - 4px) 0,
    100% 4px,
    100% calc(100% - 3px),
    calc(100% - 3px) 100%,
    3px 100%,
    0 calc(100% - 3px),
    0 4px
  );
  border: 0;
  outline: 0;
  box-shadow:
    inset 0 0 0 1px #66655d,
    inset 0 0 0 2px #141511;
}

.server-table th {
  background:
    linear-gradient(180deg, #46536b 0%, #39465d 100%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

@media (orientation: portrait), (max-width: 820px) {
  .frame-bezel { --bezel-cut: 6px; }

  .table-bezel {
    padding: 9px 4px 8px;
  }

  .race-tab {
    background:
      linear-gradient(180deg, #3e4b62 0%, #344258 100%);
  }

  .race-tab[aria-selected="true"] {
    background:
      linear-gradient(180deg, #238bae 0%, #176f91 100%);
  }
}

.filters-panel {
  background:
    radial-gradient(ellipse at 16% 18%, #22231f 0%, transparent 34%),
    radial-gradient(ellipse at 78% 70%, #191a17 0%, transparent 48%),
    linear-gradient(180deg, #181916 0%, #10110f 100%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

@media (orientation: landscape) and (max-height: 510px) {
  .hero { height: 88px; padding-top: 6px; }
  .brand-title { font-size: clamp(36px, 7vh, 52px); }
  .brand-subtitle { font-size: 12px; letter-spacing: 8px; }
  .shell, .site-footer { width: min(1100px, calc(100% - 12px)); }
}

/* Artwork recovered from the supplied reference replaces the earlier
   placeholder landscape and generic logo font. Everything is bundled locally. */
body {
  background-image: url("./reference-scene.webp");
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
}
.brand-title {
  display: block;
  width: clamp(240px, 23.3vw, 413px);
  height: auto;
  aspect-ratio: 413 / 103;
  font-size: 0;
  letter-spacing: 0;
  -webkit-text-stroke: 0;
  text-shadow: none;
  transform: none;
  background: url("./silkroad-logo.svg") center / contain no-repeat;
}
.brand-subtitle {
  margin-top: -2px;
  margin-left: 15px;
  font-size: clamp(17px, 1.5vw, 26px);
  letter-spacing: clamp(12px, 1vw, 18px);
}
@media (min-width: 1101px) and (min-height: 550px) {
  .shell, .site-footer { width: min(1482px, 84.5vw); transform: translateX(7px); }
  .directory-frame { min-height: max(550px, calc(100vh - 200px)); }
  .frame-content { min-height: max(510px, calc(100vh - 240px)); }
}
@media (orientation: portrait), (max-width: 820px) {
  body {
    background-image: url("./reference-scene.webp");
    background-position: center top;
    background-size: auto 100vh;
    background-attachment: scroll;
  }
  .brand-title { width: clamp(190px, 55vw, 380px); font-size: 0; }
  .brand-subtitle {
    font-size: clamp(12px, 2.1vw, 20px);
    letter-spacing: clamp(6px, 1.6vw, 12px);
  }
  .shell, .site-footer { transform: none; }
}
@media (orientation: landscape) and (max-height: 510px) {
  .brand-title { width: min(260px, 30vw); font-size: 0; }
  .brand-subtitle { font-size: 12px; letter-spacing: 7px; }
}
.server-table tbody .placeholder-row td {
  height: 31px;
  background: #030303;
  border-bottom: 1px solid #292929;
}
@media (orientation: portrait), (max-width: 820px) {
  .server-table tbody tr.placeholder-row:not(.notice-row):not(.empty-row) { display: none !important; }
}

/* Fine reference details */
.frame-bezel {
  position: relative;
}

.frame-bezel::before,
.frame-bezel::after {
  content: "";
  position: absolute;
  z-index: 4;
  top: 20px;
  width: 7px;
  height: 11px;
  pointer-events: none;
  clip-path: polygon(50% 0, 100% 28%, 100% 72%, 50% 100%, 0 72%, 0 28%);
  background:
    linear-gradient(90deg, #181915 0 1px, #7d796b 1px 2px, #3b3a34 2px 5px, #0b0c0a 5px 7px);
  box-shadow: inset 0 0 0 1px #0a0b09;
}

.frame-bezel::before { left: -1px; }
.frame-bezel::after { right: -1px; transform: scaleX(-1); }

.tabs-and-tools {
  min-height: 24px;
  padding: 0 2px;
  align-items: end;
}

.race-tabs {
  gap: 5px;
}

.race-tab {
  min-height: 22px;
  padding: 3px 10px 4px;
  font: 700 11px Tahoma, Verdana, sans-serif;
  line-height: 1;
  text-shadow: 1px 1px 0 #121820;
}

.race-tab:hover {
  filter: none;
  background: linear-gradient(180deg, #46536a 0%, #38475e 100%);
}

.tool-toggle {
  width: 24px;
  min-width: 24px;
  min-height: 22px;
  padding: 2px;
  border-radius: 0;
  color: #c7bb96;
  font: 700 11px Tahoma, Verdana, sans-serif;
  background: linear-gradient(180deg, #2e2e28 0%, #1a1b18 100%);
}

.tool-toggle:hover,
.tool-toggle[aria-expanded="true"] {
  color: #f1dfaa;
  background: linear-gradient(180deg, #38372f 0%, #22211d 100%);
}

.website-button {
  width: 101px;
  padding: 2px 7px;
  border: 0;
  border-radius: 0;
  clip-path: polygon(2px 0, calc(100% - 2px) 0, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 0 calc(100% - 2px), 0 2px);
  box-shadow:
    inset 0 0 0 1px #c0b28d,
    inset 0 0 0 2px #4b402d,
    inset 0 1px 0 #8c7c5c;
  color: #f6e1aa;
  text-shadow: 1px 1px 0 #1b160e;
  background: linear-gradient(180deg, #756446 0%, #5e5037 100%);
}

.website-button:hover {
  color: #fff0c8;
  background: linear-gradient(180deg, #837150 0%, #69583d 100%);
}

@media (orientation: portrait), (max-width: 820px) {
  .race-tab {
    min-height: 38px;
    padding: 7px 3px;
  }

  .tool-toggle {
    width: 100%;
    min-height: 40px;
  }

  .tool-toggle::after {
    content: attr(data-label);
  }

  .server-table {
    margin-bottom: 14px;
  }

  .list-status {
    margin-top: 0;
    position: relative;
    clear: both;
  }

  .server-table tbody tr:not(.notice-row):not(.empty-row):not(.placeholder-row) {
    border-radius: 0;
    background:
      radial-gradient(ellipse at 18% 15%, #171815 0%, transparent 42%),
      linear-gradient(180deg, #111210 0%, #080908 100%);
    background-repeat: no-repeat;
    background-size: 100% 100%;
  }
}

html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .site-footer,
html[dir="rtl"] .tabs-and-tools,
html[dir="rtl"] .filters-panel,
html[dir="rtl"] .list-status,
html[dir="rtl"] .subpage {
  direction: rtl;
}
html[dir="rtl"] .server-table { direction: rtl; }
html[dir="rtl"] .sort-header { text-align: right; }
html[dir="rtl"] input[name="discord"],
html[dir="rtl"] #owner-secret,
html[dir="rtl"] code,
html[dir="rtl"] pre,
html[dir="rtl"] .discord-link,
html[dir="rtl"] .discord-members {
  direction: ltr;
  text-align: left;
}
