/* A wiki's pages: the side panel and the article beside it (see server/src/wiki/render.ts). */
html { scroll-padding-top: 16px; }
body { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
aside { position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto; padding: 16px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
aside .home { font-size: 18px; font-weight: 600; text-decoration: none; }
#search input { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-small); padding: 5px 8px; }
#sections { display: flex; flex-direction: column; }
#sections a { padding: 5px 8px; border-radius: var(--radius-small); color: var(--text); text-decoration: none; }
#sections a:hover { background: var(--panel); }
#sections a.current { background: var(--panel); color: var(--accent); }
.other-pages { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 0; padding-top: 12px; border-top: 1px solid var(--line); }
#account { font-size: 13px; }
/* Whose game it is, and where to buy it. */
.credit { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.credit p { margin: 0 0 8px; white-space: normal; }
.credit b { color: var(--text); font-weight: 600; }
.credit .store { display: block; padding: 6px 10px; text-align: center; font-size: 14px; font-weight: 600; color: var(--on-accent); background: var(--accent); border-radius: var(--radius-small); text-decoration: none; }
.credit .store:hover { filter: brightness(1.1); }
#version { margin: 0; color: var(--muted); font-size: 12px; }

main { padding: 24px 32px 64px; min-width: 0; }
article { max-width: 820px; }
article header { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
h1 { margin: 0; font-size: 28px; font-weight: 600; overflow-wrap: anywhere; }
.kind { margin: 2px 0 0; color: var(--muted); }
h2 { margin: 28px 0 8px; padding-bottom: 4px; font-size: 19px; font-weight: 600; border-bottom: 1px solid var(--line); }
h3 { margin: 20px 0 6px; font-size: 16px; color: var(--accent); }
h4 { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
p { margin: 0 0 10px; white-space: pre-line; }
code { font: 13px ui-monospace, monospace; background: var(--panel); border: 1px solid var(--line); border-radius: calc(var(--radius) / 2); padding: 0 4px; overflow-wrap: anywhere; }
.icon { width: 22px; height: 22px; object-fit: contain; vertical-align: middle; margin-right: 6px; }
.icon.big { width: 72px; height: 72px; margin: 0; }
.empty { color: var(--muted); }
/* A question mark beside something that is not confirmed; its title says why. */
.doubt { margin-left: 4px; padding: 0 4px; border: 1px solid currentColor; border-radius: 50%; font-size: 0.8em; text-decoration: none; cursor: help; opacity: 0.8; }

.table { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 5px 12px 5px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { color: var(--muted); font-weight: normal; font-size: 13px; }

article ul { margin: 0 0 10px; padding-left: 20px; }
article li { padding: 2px 0; }
ul.entries, ul.sections, ul.results { list-style: none; padding: 0; }
ul.entries { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 20px; }
ul.entries li { display: flex; flex-direction: column; padding: 5px 0; border-bottom: 1px solid var(--rule); min-width: 0; }
ul.entries a { text-decoration: none; overflow-wrap: anywhere; }
ul.entries a:hover, ul.results a:hover { text-decoration: underline; }
ul.entries small { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
ul.results li { padding: 8px 0; border-bottom: 1px solid var(--rule); }
ul.results a { text-decoration: none; }
ul.results li > small { color: var(--muted); margin-left: 8px; }
ul.results p { margin: 2px 0 0; color: var(--muted); white-space: normal; overflow-wrap: anywhere; }
mark, ::target-text { background: var(--accent); color: var(--on-accent); }
mark { border-radius: 2px; padding: 0 1px; }
ul.sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
ul.sections li { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: grid; gap: 2px; }
ul.sections a { font-size: 18px; font-weight: 600; text-decoration: none; }
ul.sections span, ul.sections small { color: var(--muted); }

/* The game's own words: a short passage, or a whole text to read. */
blockquote { margin: 0 0 10px; padding: 2px 0 2px 14px; border-left: 2px solid var(--line); color: var(--muted); }
blockquote p:last-child { margin-bottom: 0; }
blockquote.reading { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; color: inherit; }
.lead { font-size: 16px; }
.note { color: var(--muted); font-size: 13px; margin: 0 0 6px; }
pre.code { font: 12px/1.5 ui-monospace, monospace; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; overflow-x: auto; tab-size: 4; }

/* Parts within parts: a part of a part is headed smaller, and a part of that is set off by a line. */
.part .part { margin-bottom: 8px; }
.part .part .part { border-left: 2px solid var(--line); padding: 2px 0 2px 12px; margin: 0 0 14px; }
.part .part .part blockquote { border: 0; padding: 0; margin: 0 0 6px; color: inherit; }
.part .part .part blockquote p { margin: 0 0 4px; }

/* A page with a card of facts beside it. */
article:has(.with-card) { max-width: 1080px; }
.with-card { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 32px; align-items: start; }
.card { position: sticky; top: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.card td { padding: 4px 8px 4px 0; font-size: 13px; }
.card td:first-child { color: var(--muted); white-space: nowrap; }
.card tr:last-child td { border-bottom: 0; }
.model { aspect-ratio: 1; display: grid; place-items: center; margin-bottom: 8px; }
.model canvas { width: 100%; height: 100%; cursor: grab; touch-action: none; }
.model .icon { width: 96px; height: 96px; margin: 0; image-rendering: pixelated; }
.card .download { margin: 0 0 8px; font-size: 13px; text-align: center; }

/* The note shown before the Support link goes on. */
dialog.support { max-width: min(480px, calc(100vw - 32px)); padding: 16px 20px; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: calc(var(--radius) * 4 / 3); }
dialog.support::backdrop { background: #0009; }
dialog.support h2 { border: 0; padding: 0; margin: 0 0 8px; font-size: 18px; }
dialog.support div { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; margin-top: 12px; }
dialog.support a { border: 1px solid var(--accent); border-radius: var(--radius-small); padding: 4px 10px; text-decoration: none; }

@media (max-width: 900px) {
  .with-card { grid-template-columns: minmax(0, 1fr); }
  .card { position: static; order: -1; max-width: 320px; }
}
@media (max-width: 720px) {
  body { grid-template-columns: minmax(0, 1fr); }
  aside { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  #sections { flex-direction: row; flex-wrap: wrap; }
  .credit { margin-top: 0; }
  main { padding: 16px; }
}
/* A link into one of the node's own pages, such as a place on its map. */
article a.tool { padding: 0 6px; font-size: 12px; border: 1px solid var(--line); border-radius: var(--radius-small); text-decoration: none; white-space: nowrap; }
article a.tool:hover { border-color: var(--accent); }
