:root{--color-page:#11161d;--color-text:#e8edf2;--safe-top:env(safe-area-inset-top, 0px);--brand-accent-text:#efa8bd;--brand-accent:#d82b5f;--safe-left:env(safe-area-inset-left, 0px);--radius:10px;--color-surface-2:#222c38;--safe-right:env(safe-area-inset-right, 0px);--color-hairline:#2c3846;--font-display:"Barlow Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;--radius-pill:999px;--color-surface:#19212b;--color-muted:#b0b9c3;--radius-lg:14px;--radius-sm:6px;--color-gold:#f7c548;--dur-press:var(--dur-instant);--dur-instant:80ms;--ease-out:cubic-bezier(0.23, 1, 0.32, 1);--dur-fast:160ms;--press-scale:0.97;--safe-bottom:env(safe-area-inset-bottom, 0px)}
/*
 * The player wiki's styles. Only the game's tokens (`var(--…)`); scripts/build-wiki.ts copies their
 * values from src/client/styles/tokens.css into a :root block in front of this file and lints this
 * file with the same radius, weight and colour scales as the game (scripts/check-styles.ts).
 * Mobile first; the side page list joins from 900px.
 */
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/barlow-condensed-semibold.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/barlow-condensed-bold.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/barlow-condensed-extrabold.woff2") format("woff2");
}

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

html {
  color-scheme: dark;
  background: var(--color-page);
  color: var(--color-text);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--safe-top) + 72px);
}

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
}

a {
  color: var(--brand-accent-text);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  touch-action: manipulation;
}

:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  top: 0;
  left: calc(var(--safe-left) + 12px);
  z-index: 20;
  padding: 8px 14px;
  border-radius: var(--radius);
  background: var(--color-surface-2);
  transform: translateY(-120%);
}

.skip:focus {
  transform: translateY(calc(var(--safe-top) + 8px));
}

/* Top bar: brand, language switch, the way into the game. */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(var(--safe-top) + 10px) calc(var(--safe-right) + 16px) 10px calc(var(--safe-left) + 16px);
  border-bottom: 1px solid var(--color-hairline);
  background: color-mix(in srgb, var(--color-page) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--color-text);
  text-decoration: none;
}

.brand img {
  display: block;
  width: 88px;
  height: 32px;
}

.brand span {
  color: var(--brand-accent-text);
}

.lang {
  display: flex;
  margin-left: auto;
  padding: 3px;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
}

.lang a,
.play {
  display: grid;
  place-items: center;
  min-height: 34px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
}

.lang a {
  min-width: 44px;
  border-radius: var(--radius-pill);
  color: var(--color-muted);
}

.lang a[aria-current] {
  background: var(--color-surface-2);
  color: var(--color-text);
}

.play {
  padding: 0 16px;
  min-height: 40px;
  border: 1px solid color-mix(in srgb, var(--brand-accent) 55%, transparent);
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--brand-accent) 16%, var(--color-surface));
  color: var(--color-text);
}

/* Page frame. */
.layout {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 calc(var(--safe-right) + 16px) 0 calc(var(--safe-left) + 16px);
}

main {
  min-width: 0;
  padding: 16px 0 56px;
}

.sidebar {
  display: none;
}

.page-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--radius);
  color: var(--color-muted);
  text-decoration: none;
}

.page-list a[aria-current="page"] {
  background: var(--color-surface);
  color: var(--color-text);
}

.pages {
  margin-bottom: 8px;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
}

.pages summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  user-select: none;
  -webkit-user-select: none;
}

.pages summary::-webkit-details-marker {
  display: none;
}

.pages summary span {
  overflow: hidden;
  color: var(--color-muted);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pages summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  flex: none;
  border-right: 2px solid var(--color-muted);
  border-bottom: 2px solid var(--color-muted);
  transform: translateY(-2px) rotate(45deg);
}

.pages[open] summary::after {
  transform: translateY(2px) rotate(-135deg);
}

.pages nav {
  padding: 0 6px 6px;
}

.pages .page-list a[aria-current="page"] {
  background: var(--color-surface-2);
}

@media (min-width: 900px) {
  .layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 40px;
  }

  .sidebar {
    position: sticky;
    top: calc(var(--safe-top) + 72px);
    display: block;
    align-self: start;
    max-height: calc(100svh - 96px);
    overflow-y: auto;
    padding: 24px 0;
  }

  .pages {
    display: none;
  }

  main {
    padding-top: 28px;
  }
}

/* Reading. */
.prose {
  max-width: 70ch;
}

.prose h1,
.prose h2,
.prose h3 {
  font-family: var(--font-display);
  line-height: 1.1;
  text-wrap: balance;
}

.prose h1 {
  margin: 8px 0 8px;
  font-size: clamp(36px, 9vw, 52px);
  font-weight: 800;
  letter-spacing: 0.01em;
}

.prose h2 {
  margin: 44px 0 10px;
  font-size: 30px;
  font-weight: 700;
}

.prose h3 {
  margin: 28px 0 6px;
  font-size: 22px;
  font-weight: 700;
}

.prose .anchor {
  color: inherit;
  text-decoration: none;
}

.lead {
  margin: 0 0 20px;
  color: var(--color-muted);
  font-size: 18px;
  text-wrap: pretty;
}

.prose p,
.prose li {
  text-wrap: pretty;
}

.prose ul,
.prose ol {
  padding-left: 22px;
}

.prose li + li {
  margin-top: 6px;
}

.prose code {
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9em;
}

.prose strong {
  color: var(--color-text);
  font-weight: 700;
}

.on-page {
  margin: 0 0 8px;
  padding: 12px 16px;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-lg);
}

.on-page p {
  margin: 0 0 4px;
  color: var(--color-muted);
  font-size: 14px;
}

.on-page ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.on-page li + li {
  margin-top: 0;
}

/* The game's own rule lists, as the in-game "How it works" sheet shows them. */
.prose .rules {
  margin: 12px 0;
  padding: 4px 16px;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  list-style: none;
}

.prose .rules li {
  position: relative;
  margin: 0;
  padding: 10px 0 10px 18px;
}

.prose .rules li + li {
  border-top: 1px solid var(--color-hairline);
}

.prose .rules li::before {
  content: "";
  position: absolute;
  top: 1.2em;
  left: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-accent);
}

.tip {
  margin: 16px 0;
  padding: 12px 16px;
  border: 1px solid color-mix(in srgb, var(--color-gold) 35%, var(--color-hairline));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-gold) 7%, var(--color-surface));
}

.tip p {
  margin: 0;
}

.table {
  margin: 12px 0 20px;
  overflow-x: auto;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-lg);
}

.table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.45;
}

.table th,
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-hairline);
  text-align: left;
  vertical-align: top;
}

.table th {
  background: var(--color-surface);
  color: var(--color-muted);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

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

.table td:first-child {
  font-weight: 600;
}

.table-title,
.chip-group__title {
  margin: 20px 0 6px;
  color: var(--color-muted);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 16px;
  padding: 0;
  list-style: none;
}

.prose .chips li {
  margin: 0;
  padding: 4px 12px;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  font-size: 15px;
}

/* Index cards and the previous / next pager. */
.cards {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.prose .cards li {
  margin: 0;
}

.cards a,
.pager a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  height: 100%;
  padding: 14px 16px;
  border: 1px solid var(--color-hairline);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text);
  text-decoration: none;
  transition: transform var(--dur-press) var(--ease-out), border-color var(--dur-fast) ease;
}

.cards strong {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
}

.cards span {
  color: var(--color-muted);
  font-size: 15px;
  line-height: 1.45;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  max-width: 70ch;
  margin-top: 48px;
}

.pager a {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.2;
}

.pager span {
  color: var(--color-muted);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
}

.pager .next {
  grid-column: 2;
  text-align: right;
}

.cards a:active,
.pager a:active,
.play:active,
.lang a:active {
  transform: scale(var(--press-scale));
}

.play,
.lang a {
  transition: transform var(--dur-press) var(--ease-out);
}

@media (min-width: 600px) {
  .cards {
    grid-template-columns: 1fr 1fr;
  }
}

@media (hover: hover) and (pointer: fine) {
  .cards a:hover,
  .pager a:hover {
    border-color: color-mix(in srgb, var(--brand-accent) 55%, var(--color-hairline));
  }

  .page-list a:hover,
  .lang a:hover {
    color: var(--color-text);
  }

  .prose .anchor:hover {
    color: var(--brand-accent-text);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cards a,
  .pager a,
  .play,
  .lang a {
    transition: none;
  }
}

.foot {
  padding: 24px calc(var(--safe-right) + 16px) calc(var(--safe-bottom) + 24px) calc(var(--safe-left) + 16px);
  border-top: 1px solid var(--color-hairline);
  color: var(--color-muted);
  font-size: 14px;
  text-align: center;
}

.foot p {
  margin: 4px 0;
}

/* The 404 page holds both languages. */
section[lang] + section[lang] {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--color-hairline);
}
