/* The wiki wears the game's colors and faces: the dark ground of the realm,
   bone-colored words, brass for what can be pressed. Matches :root in
   client/game.css. */
@font-face {
  font-family: Baskervville;
  font-weight: 400;
  font-display: swap;
  src: url("/wiki/fonts/baskervville-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-weight: 400;
  font-display: swap;
  src: url("/wiki/fonts/dm-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "DM Sans";
  font-weight: 600;
  font-display: swap;
  src: url("/wiki/fonts/dm-sans-latin-600-normal.woff2") format("woff2");
}
:root {
  --ground: #172b2b;
  --panel: #1c3432;
  --raised: #21403c;
  --line: #afba9638;
  --ink: #efe8d4;
  --muted: #b7bda6;
  --brass: #d4b77a;
  --brass-ink: #192b2b;
  color-scheme: dark;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ground);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: var(--brass);
  text-underline-offset: 3px;
}
a:hover {
  color: #ecd9a8;
}
:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
}
h1,
h2,
h3 {
  font-family: Baskervville, Georgia, serif;
  font-weight: 400;
  line-height: 1.2;
  margin: 0;
}
code {
  font-size: 0.9em;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--raised);
}
kbd {
  font:
    600 0.8em "DM Sans",
    system-ui,
    sans-serif;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--raised);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: -999px;
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 3;
  padding: 8px 12px;
  background: var(--brass);
  color: var(--brass-ink);
}
.button {
  display: inline-block;
  padding: 9px 18px;
  border-radius: 5px;
  background: var(--brass);
  color: var(--brass-ink);
  font-weight: 600;
  text-decoration: none;
}
.button:hover {
  color: var(--brass-ink);
  background: #e3c98f;
}
.button.quiet {
  background: none;
  color: var(--ink);
  border: 1px solid var(--line);
  margin-left: 8px;
}
.button.quiet:hover {
  background: var(--raised);
  color: var(--ink);
}

/* ── The bar across the top ─────────────────────────────────────────────── */
.top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 10px 24px;
  background: #132524f2;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
  font:
    400 22px Baskervville,
    Georgia,
    serif;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.wordmark span {
  font:
    600 11px "DM Sans",
    system-ui,
    sans-serif;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--brass);
}
.search {
  position: relative;
  flex: 1;
  max-width: 420px;
  margin-left: auto;
}
.search label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.search input {
  width: 100%;
  padding: 9px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
}
.search input::placeholder {
  color: var(--muted);
}
#results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 12px 30px #0008;
  max-height: 70vh;
  overflow: auto;
}
#results li {
  padding: 8px 10px;
  color: var(--muted);
}
#results li:has(a) {
  padding: 0;
}
#results a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 10px;
  border-radius: 4px;
  color: var(--ink);
  text-decoration: none;
}
#results a:hover,
#results a:focus-visible {
  background: var(--raised);
}
#results a span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

/* ── The page ───────────────────────────────────────────────────────────── */
.frame {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 48px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}
.pages {
  position: sticky;
  top: 76px;
  align-self: start;
  max-height: calc(100vh - 96px);
  overflow: auto;
  font-size: 14.5px;
}
.pages h2,
.toc h2,
.eyebrow {
  font:
    600 11px "DM Sans",
    system-ui,
    sans-serif;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 8px;
}
.pages section + section {
  margin-top: 22px;
}
.pages ul,
.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pages a {
  display: block;
  padding: 5px 10px;
  margin-left: -10px;
  border-radius: 4px;
  color: var(--ink);
  text-decoration: none;
}
.pages a:hover {
  background: var(--panel);
}
.pages a[aria-current] {
  background: var(--raised);
  color: var(--brass);
}
main {
  min-width: 0;
}
h1 {
  font-size: 44px;
  margin-bottom: 10px;
}
.lede {
  font-size: 19px;
  color: var(--muted);
  max-width: 62ch;
  margin: 0 0 28px;
}
.toc {
  padding: 16px 20px;
  margin-bottom: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.toc ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 22px;
}
main section {
  padding-top: 34px;
  /* A link to a section lands below the bar. */
  scroll-margin-top: 60px;
}
main h2 {
  font-size: 29px;
  padding-bottom: 8px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
main h3 {
  font-size: 22px;
}
main p,
main ul,
main ol {
  max-width: 72ch;
}
main li {
  margin: 4px 0;
}

/* ── Tables ─────────────────────────────────────────────────────────────── */
.table {
  overflow-x: auto;
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}
th,
td {
  padding: 9px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
tbody tr:last-child > * {
  border-bottom: 0;
}
thead th {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--panel);
  white-space: nowrap;
}
tbody th {
  font-weight: 600;
  white-space: nowrap;
}
tbody tr:hover {
  background: #ffffff07;
}
.n {
  text-align: right;
}
td ul {
  margin: 0;
  padding-left: 18px;
}

/* ── Cards and lists of terms ───────────────────────────────────────────── */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.card {
  display: block;
  padding: 18px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  scroll-margin-top: 72px;
}
a.card {
  color: var(--ink);
  text-decoration: none;
}
a.card:hover {
  background: var(--raised);
  border-color: #d4b77a66;
}
a.card strong {
  display: block;
  font:
    400 21px Baskervville,
    Georgia,
    serif;
  color: var(--brass);
  margin-bottom: 4px;
}
a.card span {
  color: var(--muted);
  font-size: 14.5px;
}
article.card {
  margin: 16px 0;
}
article.card > p {
  margin: 8px 0 12px;
}
.flavor {
  font-family: Baskervville, Georgia, serif;
  font-style: italic;
  font-size: 17px;
  color: var(--muted);
}
.tag {
  font:
    600 11px "DM Sans",
    system-ui,
    sans-serif;
  letter-spacing: 1px;
  text-transform: uppercase;
  vertical-align: middle;
  margin-left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--brass);
  border: 1px solid #d4b77a66;
}
.terms {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 18px;
  margin: 0;
  font-size: 14.5px;
}
.terms dt {
  color: var(--muted);
}
.terms dd {
  margin: 0;
}
.terms ul {
  margin: 0;
  padding-left: 18px;
}
footer {
  padding: 22px 24px 40px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .frame {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    padding: 20px 16px 48px;
  }
  .pages {
    position: static;
    max-height: none;
    padding: 14px 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
  }
  .pages ul {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 6px;
  }
  .pages a {
    margin-left: 0;
  }
  .pages section + section {
    margin-top: 12px;
  }
  .top {
    gap: 12px;
    padding: 10px 16px;
  }
  .wordmark span {
    display: none;
  }
  h1 {
    font-size: 34px;
  }
  .terms {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .terms dd {
    margin-bottom: 8px;
  }
}
@media print {
  .top,
  .pages,
  .toc,
  footer {
    display: none;
  }
  :root {
    color: #000;
    background: #fff;
  }
}
