/* GameFan Wiki. Dark by default; <theme-toggle> switches to light and remembers it (html[data-theme=light]).
   The spec's theme tokens (--ink, --muted, --line, --accent, --bg, --card) are the dark ones; the
   rest of the palette is here. */
:root {
  color-scheme: dark;
  --bg-2: #10131b;
  --card-2: #1a1f2c;
  --raise: #222838;
  --link: #b9a6ff;
  --accent-2: #22d3ee;
  --accent-ink: #ffffff;
  --glow: rgba(139, 92, 246, .18);
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 8px 24px rgba(0, 0, 0, .25);
  --code-bg: #0a0c12;
  --warn-bg: #2a2110; --warn-line: #6b4f12; --warn-ink: #f5d68a;
  --add-bg: #0f2a1d; --add-ink: #7ee2a8;
  --del-bg: #2e1418; --del-ink: #ff9ba6;
  --danger: #f87171;
  --radius: 14px;
  --radius-sm: 10px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* a style's own (style-<name>, below): its headings' face and treatment, and what's behind the page */
  --display: var(--font);
  --display-weight: 800;
  --display-case: none;
  --display-track: -.02em;
  --pattern: none;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7fb; --bg-2: #eef0f6; --card: #ffffff; --card-2: #f7f8fc; --raise: #eceff6;
  --ink: #161a23; --muted: #5d6578; --line: #e2e5ee; --accent: #6d28d9; --link: #5b21b6;
  --glow: rgba(109, 40, 217, .10);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 20px rgba(16, 24, 40, .06);
  --code-bg: #111522;
  --warn-bg: #fff8e6; --warn-line: #f5c451; --warn-ink: #6b4a00;
  --add-bg: #12301f; --add-ink: #8ce9b3;
  --del-bg: #3a161c; --del-ink: #ffadb7;
  --danger: #c0262d;
}

/* ---------- page */
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0 auto; max-width: 1200px; min-height: 100vh; padding: 0 20px 48px;
  font: 16px/1.6 var(--font); color: var(--ink); -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 420px at 15% -120px, var(--glow), transparent 70%),
    radial-gradient(700px 360px at 95% -160px, color-mix(in srgb, var(--accent-2) 9%, transparent), transparent 70%),
    var(--pattern),
    var(--bg);
  background-attachment: fixed;
  display: grid; grid-template-columns: minmax(0, 1fr) 270px; grid-template-areas: "nav nav" "main side";
  column-gap: 24px; align-content: start;
}
body:not(:has(#sidebar > *)) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "nav" "main"; }
body > a[href="#main-content"] { position: absolute; left: -9999px; }
body > a[href="#main-content"]:focus { left: 16px; top: 12px; z-index: 50; background: var(--card); color: var(--ink); padding: 8px 12px; border-radius: 8px; }
#nav { grid-area: nav; position: sticky; top: 0; z-index: 20; }
#main-content { grid-area: main; min-width: 0; display: grid; gap: 20px; align-content: start; }
#sidebar { grid-area: side; display: grid; gap: 16px; align-content: start; align-self: start; position: sticky; top: 84px; }
#sidebar:empty, #footer:empty { display: none; }
#footer { padding: 32px 0 0; text-align: center; color: var(--muted); font-size: .88rem; }
@media (max-width: 880px) {
  body, body:not(:has(#sidebar > *)) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "nav" "main" "side"; padding: 0 14px 40px; }
  #sidebar { position: static; }
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.015em; margin: 0 0 .6em; }
h1, h2, .brand { font-family: var(--display); text-transform: var(--display-case); letter-spacing: var(--display-track); }
h1 { font-size: 1.9rem; font-weight: var(--display-weight); }
h2 { font-size: 1.3rem; font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 650; }
p { margin: 0 0 1em; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- top bar */
.bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: 0 -20px 24px; padding: 12px 20px;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(12px) saturate(140%); -webkit-backdrop-filter: blur(12px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.12rem; color: var(--ink); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand::before { content: ""; width: 10px; height: 22px; border-radius: 3px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.brand:has(img)::before { display: none; }
.brand .logo { width: 34px; height: 34px; object-fit: cover; border-radius: 9px; box-shadow: 0 0 0 1px var(--line); }
.search { flex: 1; min-width: 180px; max-width: 440px; }
.search input { border-radius: 999px; padding-left: 38px; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23949cb0' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m14 14-3.2-3.2'/%3E%3C/svg%3E") no-repeat 14px center; }
.who { display: flex; align-items: center; gap: 14px; margin-left: auto; flex-wrap: wrap; font-size: .93rem; }
@media (max-width: 880px) { .bar { margin: 0 -14px 18px; padding: 10px 14px; } .search { order: 3; max-width: none; flex-basis: 100%; } }

/* ---------- surfaces */
.card {
  background: linear-gradient(180deg, color-mix(in srgb, var(--card) 96%, white 4%), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; min-width: 0;
  box-shadow: var(--shadow);
}
:root[data-theme="light"] .card { background: var(--card); }
.card > h1:first-child, .card > h2:first-child { margin-top: 0; }
.narrow { max-width: 440px; margin: 32px auto; width: 100%; }
.narrow h1 { font-size: 1.6rem; }
.hero { padding: 28px 0 8px; }
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 850; letter-spacing: -.03em; margin: 0;
  background: linear-gradient(90deg, var(--ink) 20%, var(--link) 70%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { color: var(--muted); font-size: 1.12rem; margin: 8px 0 0; max-width: 46em; }
.muted { color: var(--muted); font-size: .92em; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  background: var(--card-2); border: 1px solid var(--line); font-size: .82rem; color: var(--ink); font-weight: 550;
}
a.pill:hover { border-color: var(--accent); text-decoration: none; }

/* ---------- lists of wikis */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.wikicard {
  position: relative; overflow: hidden; display: grid; gap: 4px; align-content: start;
  padding: 0 16px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink);
  background: var(--card-2); transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.wikicard::before {
  content: ""; display: block; height: 64px; margin: 0 -16px 10px;
  background: radial-gradient(120px 60px at 20% 30%, rgba(255, 255, 255, .18), transparent), linear-gradient(135deg, var(--accent), var(--accent-2));
  opacity: .85;
}
.wikicard:has(img)::before { display: none; }
.wikicard img { width: calc(100% + 32px); margin: 0 -16px 10px; aspect-ratio: 16/7; object-fit: cover; }
.wikicard:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); box-shadow: var(--shadow); text-decoration: none; }
.wikicard strong { font-size: 1.05rem; }
.wikicard .pill { justify-self: start; margin-top: 4px; }
.list { display: grid; gap: 2px; }
.row { display: flex; align-items: center; gap: 12px; padding: 9px 8px; flex-wrap: wrap; color: var(--ink); border-radius: 8px; }
a.row:hover { background: var(--card-2); text-decoration: none; }
.list > .row + .row { border-top: 1px solid var(--line); border-radius: 0; }
.columns { columns: 3 200px; column-gap: 24px; }
.columns > a { display: block; padding: 4px 0; break-inside: avoid; }
.catlist { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- side navigation */
.sidenav { display: grid; gap: 2px; padding: 12px; }
.sidenav a, .sidenav button { display: block; padding: 7px 12px; border-radius: 8px; color: var(--ink); font-size: .95rem; text-align: left; }
.sidenav a:hover { background: var(--card-2); color: var(--link); text-decoration: none; }

/* ---------- forms */
form { margin: 0; }
form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 14px; min-width: 0; }
form fieldset fieldset { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; background: var(--bg-2); }
legend { font-weight: 650; padding: 0 6px; color: var(--muted); font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .93rem; }
label > span { color: var(--ink); }
label:has(input[type=checkbox]) { display: flex; align-items: center; gap: 10px; font-weight: 450; }
.inline fieldset { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.inline label { flex: 1; min-width: 170px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], select, textarea, .input {
  font: inherit; font-weight: 400; font-size: .97rem; color: var(--ink); width: 100%;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2);
  transition: border-color .12s ease, box-shadow .12s ease;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--muted) 70%, transparent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
input[type=file] { font-size: .9rem; color: var(--muted); }
input[type=file]::file-selector-button { font: inherit; font-weight: 600; margin-right: 10px; padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--raise); color: var(--ink); cursor: pointer; }
textarea { resize: vertical; line-height: 1.55; }
textarea[name=body], textarea[name=code], .mono { font-family: var(--mono); font-size: .9rem; }

/* ---------- buttons */
.btn, button[type=submit] {
  font: inherit; font-weight: 650; font-size: .94rem; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm); cursor: pointer; text-decoration: none;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line)); background: transparent; color: var(--link);
  transition: background .12s ease, transform .06s ease, box-shadow .12s ease;
}
.btn:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); text-decoration: none; }
.btn.primary, button[type=submit] {
  border-color: transparent; color: var(--accent-ink);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, white 12%), var(--accent));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent);
}
.btn.primary:hover, button[type=submit]:hover { filter: brightness(1.08); }
.btn:active, button[type=submit]:active { transform: translateY(1px); }
.quiet, button.quiet[type=submit] {
  background: none; border: none; box-shadow: none; padding: 0; color: var(--link); font: inherit; font-weight: 500; cursor: pointer;
}
.quiet:hover, button.quiet[type=submit]:hover { text-decoration: underline; filter: none; }
.danger, .btn.danger, button.danger, button.danger[type=submit] {
  background: transparent; border: 1px solid color-mix(in srgb, var(--danger) 60%, var(--line)); color: var(--danger);
  box-shadow: none; border-radius: var(--radius-sm); padding: 9px 16px; font: inherit; font-weight: 650; cursor: pointer;
}
.danger:hover, button.danger[type=submit]:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); filter: none; }
.x, button.x[type=submit] { background: none; border: 0; box-shadow: none; cursor: pointer; color: var(--muted); padding: 0 2px; font-size: 1rem; }
.x:hover { color: var(--danger); }
[data-theme-toggle] {
  font: inherit; font-size: .88rem; cursor: pointer; border: 1px solid var(--line); background: var(--card-2); color: var(--ink);
  border-radius: 999px; padding: 4px 12px; line-height: 1.4;
}
[data-theme-toggle]:hover { border-color: var(--accent); }

/* ---------- messages */
.flash {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--raise); color: var(--ink); border: 1px solid var(--line); border-left: 3px solid var(--accent);
  padding: 10px 16px; border-radius: var(--radius-sm); box-shadow: var(--shadow); font-weight: 550;
  display: flex; align-items: center; gap: 10px;
}
.flash__inner { display: flex; flex: none; }   /* the runtime's icon: check.svg, or alert.svg for what went wrong */
.flash__inner img { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.danger-zone h2 { color: var(--danger); }
.spoilers { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); border-radius: var(--radius-sm); padding: 10px 14px; margin: 0 0 16px; font-weight: 550; }
.spoilers a { color: inherit; text-decoration: underline; }

/* ---------- a page */
.pagehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 16px; padding-bottom: 6px; }
.pagehead h1 { margin: 0 0 8px; font-size: 2.1rem; }
.pagetools { display: flex; gap: 14px; align-items: center; }
.version { color: var(--muted); margin: 0 0 12px; font-size: .92rem; }
.version::before { content: "\25C6  "; color: var(--accent-2); }
.infobox {
  float: right; width: 290px; margin: 0 0 18px 24px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden;
  background: var(--card-2); box-shadow: var(--shadow);
}
.infobox h2 {
  margin: 0; padding: 10px 14px; font-size: 1rem; text-align: center; letter-spacing: .02em;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 80%, black 20%), color-mix(in srgb, var(--accent-2) 55%, var(--accent)));
  color: #fff;
}
.infobox img { width: 100%; height: auto; display: block; }
.infobox dl { display: grid; grid-template-columns: auto 1fr; margin: 0; font-size: .92rem; }
.infobox dt, .infobox dd { padding: 8px 14px; border-top: 1px solid var(--line); margin: 0; }
.infobox dt { font-weight: 650; color: var(--muted); }
.infobox dd p { margin: 0; }
@media (max-width: 680px) { .infobox { float: none; width: auto; margin: 0 0 18px; } }

:is(.md, .editor-visual) { overflow-wrap: break-word; font-size: 1.02rem; line-height: 1.7; }
:is(.md, .editor-visual) > :first-child { margin-top: 0; }
:is(.md, .editor-visual) h1, :is(.md, .editor-visual) h2 { padding-bottom: 6px; border-bottom: 1px solid var(--line); margin-top: 1.6em; }
:is(.md, .editor-visual) h1 { font-size: 1.6rem; }
:is(.md, .editor-visual) h2 { font-size: 1.35rem; }
:is(.md, .editor-visual) h3 { margin-top: 1.4em; }
:is(.md, .editor-visual) ul, :is(.md, .editor-visual) ol { padding-left: 1.4em; margin: 0 0 1em; }
:is(.md, .editor-visual) li { margin: .25em 0; }
:is(.md, .editor-visual) li:empty { display: none; }
:is(.md, .editor-visual) img { max-width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }
:is(.md, .editor-visual) hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
:is(.md, .editor-visual) table { border-collapse: separate; border-spacing: 0; margin: 1.2em 0; display: block; overflow-x: auto; max-width: 100%; width: max-content; border: 1px solid var(--line); border-radius: var(--radius-sm); }
:is(.md, .editor-visual) th, :is(.md, .editor-visual) td { padding: 8px 14px; border-bottom: 1px solid var(--line); }
:is(.md, .editor-visual) tr:last-child td { border-bottom: 0; }
:is(.md, .editor-visual) th { background: var(--card-2); text-align: left; white-space: nowrap; font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
:is(.md, .editor-visual) tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--card-2) 55%, transparent); }
:is(.md, .editor-visual) tbody tr:hover td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
:is(.md, .editor-visual) th[data-sort] { cursor: pointer; user-select: none; }
:is(.md, .editor-visual) th[data-sort]:hover { color: var(--ink); }
:is(.md, .editor-visual) th[data-sort]::after { content: " \2195"; opacity: .5; font-size: .85em; }
:is(.md, .editor-visual) th[data-sort="asc"]::after { content: " \25B2"; color: var(--link); opacity: 1; }
:is(.md, .editor-visual) th[data-sort="desc"]::after { content: " \25BC"; color: var(--link); opacity: 1; }
:is(.md, .editor-visual) code { font-family: var(--mono); font-size: .88em; background: var(--card-2); border: 1px solid var(--line); border-radius: 6px; padding: .1em .35em; }
:is(.md, .editor-visual) pre, .help pre { background: var(--code-bg); color: #e6e9f2; padding: 14px 16px; border-radius: var(--radius-sm); overflow-x: auto; font-size: .88rem; border: 1px solid var(--line); }
:is(.md, .editor-visual) pre code { background: none; border: 0; padding: 0; color: inherit; }
:is(.md, .editor-visual) blockquote { border-left: 3px solid var(--accent); margin: 0 0 1em; padding: 4px 16px; color: var(--muted); background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 0 8px 8px 0; }
:is(.md, .editor-visual) input[type=checkbox] { vertical-align: middle; margin-right: 6px; }
.cats { clear: both; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 22px; padding-top: 14px; }
.help h2 { font-size: 1rem; }
.help pre { white-space: pre-wrap; font-size: .82rem; }
.help p { font-size: .88rem; }

/* ---------- history */
.diff { background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px 0; overflow-x: auto; font-size: .86rem; white-space: normal; }
.diff span { display: block; white-space: pre-wrap; padding: 1px 14px; font-family: var(--mono); color: #c9cfdd; }
.diff .add { background: var(--add-bg); color: var(--add-ink); }
.diff .del { background: var(--del-bg); color: var(--del-ink); }
.diff .same { opacity: .6; }
.facts { display: grid; gap: 10px; margin-top: 14px; }
.template { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; display: grid; gap: 10px; background: var(--bg-2); }

/* ---------- images */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.gallery figure { margin: 0; display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card-2); }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--bg-2); display: block; }
.gallery figcaption { display: grid; gap: 6px; font-size: .9rem; }
.snippet { font-size: .76rem !important; padding: 6px 8px !important; }

/* ---------- ads */
.ads { display: grid; gap: 12px; }
.ad { display: grid; gap: 4px; justify-items: center; padding: 10px; border: 1px dashed var(--line); border-radius: var(--radius-sm); }
.ad img { max-width: 100%; height: auto; border-radius: 8px; }
.ad-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
ad-network, ad-code { display: block; width: 100%; }
ad-code iframe { border-radius: 8px; }
@media (max-width: 880px) {
  .who > .muted { display: none; }
  .who { gap: 12px; }
  .card { padding: 18px 16px; }
  .pagehead h1 { font-size: 1.7rem; }
}
/* buttons keep their own width; separate forms in one card are set apart */
form fieldset > button[type=submit] { justify-self: start; min-width: 140px; }
.card form + form, .card form + p, .card form + .row { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.card .row:has(> .quiet, > form) { gap: 16px; }

/* ---------- a wiki's color: its bar carries .accent-<color>, so the whole page takes it */
.accent-violet  { --accent: #8b5cf6; --link: #b9a6ff; --accent-2: #22d3ee; }
.accent-blue    { --accent: #3b82f6; --link: #93c5fd; --accent-2: #a78bfa; }
.accent-cyan    { --accent: #0891b2; --link: #67e8f9; --accent-2: #34d399; }
.accent-emerald { --accent: #059669; --link: #6ee7b7; --accent-2: #22d3ee; }
.accent-amber   { --accent: #d97706; --link: #fcd34d; --accent-2: #f97316; }
.accent-rose    { --accent: #e11d48; --link: #fda4af; --accent-2: #f59e0b; }
body:has(#nav .accent-violet)  { --accent: #8b5cf6; --link: #b9a6ff; --accent-2: #22d3ee; --glow: rgba(139, 92, 246, .18); }
body:has(#nav .accent-blue)    { --accent: #3b82f6; --link: #93c5fd; --accent-2: #a78bfa; --glow: rgba(59, 130, 246, .18); }
body:has(#nav .accent-cyan)    { --accent: #0891b2; --link: #67e8f9; --accent-2: #34d399; --glow: rgba(8, 145, 178, .2); }
body:has(#nav .accent-emerald) { --accent: #059669; --link: #6ee7b7; --accent-2: #22d3ee; --glow: rgba(5, 150, 105, .2); }
body:has(#nav .accent-amber)   { --accent: #d97706; --link: #fcd34d; --accent-2: #f97316; --glow: rgba(217, 119, 6, .18); }
body:has(#nav .accent-rose)    { --accent: #e11d48; --link: #fda4af; --accent-2: #f59e0b; --glow: rgba(225, 29, 72, .18); }
:root[data-theme="light"] .accent-violet,  :root[data-theme="light"] body:has(#nav .accent-violet)  { --accent: #6d28d9; --link: #5b21b6; }
:root[data-theme="light"] .accent-blue,    :root[data-theme="light"] body:has(#nav .accent-blue)    { --accent: #2563eb; --link: #1d4ed8; }
:root[data-theme="light"] .accent-cyan,    :root[data-theme="light"] body:has(#nav .accent-cyan)    { --accent: #0891b2; --link: #0e7490; }
:root[data-theme="light"] .accent-emerald, :root[data-theme="light"] body:has(#nav .accent-emerald) { --accent: #059669; --link: #047857; }
:root[data-theme="light"] .accent-amber,   :root[data-theme="light"] body:has(#nav .accent-amber)   { --accent: #d97706; --link: #b45309; }
:root[data-theme="light"] .accent-rose,    :root[data-theme="light"] body:has(#nav .accent-rose)    { --accent: #e11d48; --link: #be123c; }
/* cards of wikis left violet still differ from their neighbors */
.grid > :nth-child(4n+2) > .wikicard.accent-violet::before, .grid > .wikicard.accent-violet:nth-child(4n+2)::before { filter: hue-rotate(70deg); }
.wikicard .cover { width: calc(100% + 32px); margin: 0 -16px 10px; aspect-ratio: 16/7; object-fit: cover; display: block; }

/* ---------- a wiki's banner */
.wikihero {
  position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line);
  min-height: 150px; display: grid; align-items: end; box-shadow: var(--shadow);
  background: radial-gradient(500px 200px at 15% 0%, rgba(255, 255, 255, .14), transparent 70%), linear-gradient(135deg, color-mix(in srgb, var(--accent) 75%, black 25%), color-mix(in srgb, var(--accent-2) 60%, var(--accent)));
}
.wikihero.has-banner { min-height: 240px; background: var(--bg-2); }
.wikihero .banner { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wikihero.has-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 30%, rgba(0, 0, 0, .78)); }
.wikihero-text { position: relative; z-index: 1; display: flex; align-items: flex-end; gap: 16px; padding: 20px 26px; color: #fff; }
.wikihero-text h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 850; letter-spacing: -.02em; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.wikihero-text p { margin: 4px 0 0; color: rgba(255, 255, 255, .85); font-size: 1.05rem; }
.herologo { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; border: 2px solid rgba(255, 255, 255, .7); box-shadow: 0 6px 20px rgba(0, 0, 0, .35); }
@media (max-width: 880px) { .wikihero-text { padding: 16px; } .herologo { width: 52px; height: 52px; } }
.hero .btn { margin-top: 16px; }
.narrow.wide { max-width: 560px; }

/* ---------- reading: links to pages still to write, contents */
.md a.new, .infobox a.new { color: var(--danger); text-decoration: underline dotted; text-underline-offset: 3px; }
.toc {
  display: inline-block; min-width: 220px; max-width: 340px; margin: 0 0 18px; padding: 12px 18px 12px 14px;
  background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: .92rem;
}
.toc strong { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }
.toc ul { margin: 0; padding: 0; list-style: none; }
.toc li { margin: 3px 0; padding-left: 12px; border-left: 2px solid var(--line); }
.toc li:hover { border-left-color: var(--accent); }
.toc li.sub { margin-left: 14px; font-size: .9em; }
.md :is(h2, h3) { scroll-margin-top: 84px; }

/* ---------- the editor: toolbar, text beside its preview */
.editor { display: grid; gap: 8px; }
.editor-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; background: var(--card-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.editor-bar button {
  font: inherit; font-size: .88rem; min-width: 34px; height: 32px; padding: 0 9px; border-radius: 8px; cursor: pointer;
  border: 1px solid transparent; background: transparent; color: var(--ink);
}
.editor-bar button:hover { background: var(--raise); border-color: var(--line); }
.editor-tabs { margin-left: auto; display: none; gap: 2px; padding: 2px; border-radius: 9px; background: var(--bg-2); }
.editor-tabs button.on { background: var(--accent); color: var(--accent-ink); }
.editor-kept { background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-ink); border-radius: var(--radius-sm); padding: 8px 12px; margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.editor-kept button { font: inherit; color: inherit; background: none; border: 1px solid var(--warn-line); border-radius: 8px; padding: 2px 10px; cursor: pointer; }
.editor-panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.editor-panes textarea { min-height: 540px; height: 100%; }
.editor-preview { min-height: 540px; max-height: 75vh; overflow: auto; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); }
.editor-preview .md { font-size: .97rem; }
.editor-images[hidden] { display: none; }
.editor-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--card-2); max-height: 260px; overflow: auto; }
.editor-images button { padding: 0; border: 2px solid transparent; border-radius: 8px; background: var(--bg-2); cursor: pointer; overflow: hidden; }
.editor-images button:hover { border-color: var(--accent); }
.editor-images img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
@media (max-width: 980px) {
  .editor-tabs { display: flex; }
  .editor-panes { grid-template-columns: minmax(0, 1fr); }
  .editor[data-show="write"] .editor-preview { display: none; }
  .editor[data-show="preview"] textarea { display: none; }
}
.editor-preview, .editor textarea { font-weight: 400; }
/* the visual editor: the text as it will look, the parts it keeps as Markdown locked */
.editor-mode { display: flex; gap: 2px; padding: 2px; border-radius: 9px; background: var(--bg-2); margin-right: 6px; }
.editor-bar .editor-mode button { border-radius: 7px; }
.editor-bar .editor-mode button.on { background: var(--accent); color: var(--accent-ink); }
.editor-visual { display: none; min-height: 540px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); outline: none; font-weight: 400; }
.editor-visual:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); }
.editor[data-mode="visual"] .editor-panes { grid-template-columns: minmax(0, 1fr); }
.editor[data-mode="visual"] .editor-visual { display: block; }
.editor[data-mode="visual"] .editor-panes > textarea, .editor[data-mode="visual"] .editor-preview, .editor[data-mode="visual"] .editor-tabs { display: none; }
.editor-visual a { color: var(--link); cursor: text; }
.editor-visual a.editor-wl { text-decoration: underline dotted; text-underline-offset: 3px; }
.editor-atom { display: inline-block; font-family: var(--mono); font-size: .85em; padding: 0 .45em; border-radius: 6px; border: 1px dashed var(--line); background: var(--card-2); color: var(--muted); user-select: all; }
.editor-locked { position: relative; margin: 0 0 1em; padding: 6px 12px; border: 1px dashed var(--line); border-radius: var(--radius-sm); user-select: none; }
.editor-locked:hover { border-color: var(--accent); }
.editor-locked-tools { display: flex; justify-content: flex-end; gap: 4px; margin-bottom: 4px; }
.editor-locked-tools button, .editor-locked-body > button { font: inherit; font-size: .8em; color: var(--muted); background: var(--raise); border: 1px solid var(--line); border-radius: 7px; padding: 2px 9px; cursor: pointer; }
.editor-locked-tools button:hover { color: var(--ink); }
.editor-locked-body > textarea { width: 100%; font-family: var(--mono); margin-bottom: 6px; }
.editor-locked-body > button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; margin-right: 4px; }

/* a subpage's parents, and a page's subpages */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .92em; color: var(--muted); margin: 0 0 6px; }
.crumbs a { color: var(--link); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { opacity: .6; }
.subpages { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.subpages h2 { font-size: 1rem; margin: 0 0 8px; }
.redirected { color: var(--muted); font-size: .92em; margin: 0 0 8px; }
.image-tools { margin: 6px 0; font-size: .92em; }
.image-tools summary { cursor: pointer; color: var(--link); }
.image-tools form { margin-top: 8px; }

/* Markdown's ::: tabs and ::: collapsed */
:is(.md, .editor-visual) .md-tabs { margin: 12px 0; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 14px 10px; }
:is(.md, .editor-visual) .md-tabbar { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 -14px 10px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); }
:is(.md, .editor-visual) .md-tabbar button { font: inherit; font-size: .92em; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 10px; cursor: pointer; }
:is(.md, .editor-visual) .md-tabbar button:hover { color: var(--ink); }
:is(.md, .editor-visual) .md-tabbar button.on { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
:is(.md, .editor-visual) .md-tab-title { margin: 12px 0 6px; }
:is(.md, .editor-visual) details.md-collapsed { margin: 12px 0; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 14px; }
:is(.md, .editor-visual) details.md-collapsed > summary { cursor: pointer; padding: 10px 0; font-weight: 600; }
:is(.md, .editor-visual) details.md-collapsed[open] > summary { border-bottom: 1px solid var(--line); margin-bottom: 8px; }

/* the editor's table grid */
.editor-table { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px; margin: 0 0 10px; background: var(--card-2); }
.editor-table-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.editor-table-tools button, .editor-table th button, .editor-table-row button { font: inherit; font-size: .9em; color: var(--ink); background: var(--raise); border: 1px solid var(--line); border-radius: 8px; padding: 3px 10px; cursor: pointer; }
.editor-table-tools button.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.editor-table-scroll { overflow-x: auto; }
.editor-table table { border-collapse: collapse; }
.editor-table td, .editor-table th { padding: 2px; vertical-align: middle; }
.editor-table th select { font: inherit; font-size: .85em; background: var(--bg-2); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; margin-right: 4px; }
.editor-table input.input { min-width: 7em; padding: 5px 8px; }
.editor-table-row { white-space: nowrap; }
.editor-table-row button { padding: 2px 6px; margin-right: 2px; }

/* watchlist and talk */
.pill.news { margin-left: 6px; background: var(--accent); color: var(--accent-ink); font-size: .78em; padding: 1px 7px; border-radius: 999px; }
.row.unseen { border-left: 3px solid var(--accent); padding-left: 8px; }
.talk .comment { border-bottom: 1px solid var(--line); padding: 12px 0; }
.talk .comment:last-child { border-bottom: 0; }
.talk .comment header { gap: 10px; align-items: baseline; font-size: .92em; }

/* an infobox template's table: a paged list laid out as a table (rows, then the list's pager) */
.facts-table { display: table; border-collapse: collapse; overflow-x: auto; width: 100%; }
.facts-row { display: table-row; }
.facts-row > span { display: table-cell; padding: 6px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts-row > span:first-child { white-space: nowrap; }
.facts-head > span { font-weight: 600; color: var(--muted); }
.facts-body { display: table-row-group; }
.facts-table .pager { display: table-caption; caption-side: bottom; }
.fact p { margin: 0; }

/* a paged list's links: the next page, and back to the start */
.pager { display: flex; gap: 16px; justify-content: center; margin-top: 16px; font-size: .95rem; }

/* moderation: the review queue */
.modlist { display: grid; gap: 14px; }
.moditem { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; display: grid; gap: 10px; }
.moditem .row { padding: 0; }
.moditem img { max-width: 100%; height: auto; border-radius: 8px; }
.moditem .diff { max-height: 360px; overflow-y: auto; }
.scores { display: flex; flex-wrap: wrap; gap: 6px; }
.pill.hot { border-color: var(--danger); color: var(--danger); font-weight: 650; }
.pill.good { border-color: color-mix(in srgb, var(--add-ink) 50%, var(--line)); color: var(--add-ink); }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
.card .moditem .row form + form { margin-top: 0; padding-top: 0; border-top: 0; }
.moditem .row { align-items: center; }

/* ads: each place a fixed size, so nothing moves when an ad loads; no ad grows past its place */
.ad { overflow: hidden; align-content: start; }
.ad ad-network, .ad ad-code { display: block; width: 100%; height: 100%; }
.ad iframe { width: 100%; height: 100%; border: 0; display: block; }
.ad-header { height: 118px; }
.ad-header ad-network, .ad-header ad-code { height: 90px; }
.ad-sidebar, .ad-article { height: 278px; }
.ad-sidebar ad-network, .ad-sidebar ad-code, .ad-article ad-network, .ad-article ad-code { height: 250px; }
.ad-header img, .ad-sidebar img, .ad-article img { max-height: 100%; object-fit: contain; }
@media (max-width: 640px) { .ad-header { height: 128px; } .ad-header ad-network, .ad-header ad-code { height: 100px; } }

/* hosting: the read-only notice, the metrics page's figures */
.readonly { margin: 0; padding: 8px 16px; text-align: center; background: var(--warn-bg); color: var(--warn-ink); border-bottom: 1px solid var(--warn-line); font-weight: 550; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 8px 0 14px; }
.stats > div { display: grid; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.stats strong { font-size: 1.6rem; }

/* ---------- a style: the site's (its bar carries .style-<name>) or a wiki's own. Each sets the
   tokens above, dark and light; the accent (.accent-<color>) is chosen apart, so any color goes with
   any style. Type is the reader's own system faces: no font is fetched from anywhere. */

/* classic: clean and bright (the defaults above) */

/* arcade: neon on black, bold and blocky */
body:has(#nav .style-arcade) {
  --bg: #07070c; --bg-2: #0d0d16; --card: #10101b; --card-2: #161625; --raise: #1e1e30; --line: #2a2a44;
  --ink: #f1f1ff; --muted: #9a9ac0;
  --radius: 6px; --radius-sm: 4px;
  --display: "Arial Black", "Segoe UI Black", "Helvetica Neue", Impact, system-ui, sans-serif;
  --display-weight: 900; --display-case: uppercase; --display-track: .01em;
  --pattern: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px) 0 0 / 100% 4px;
}
:root[data-theme="light"] body:has(#nav .style-arcade) {
  --bg: #f4f4fb; --bg-2: #eaeaf5; --card: #ffffff; --card-2: #f4f4fb; --raise: #e6e6f2; --line: #d8d8ea;
  --ink: #12121f; --muted: #55557a;
  --pattern: linear-gradient(rgba(0, 0, 0, .025) 1px, transparent 1px) 0 0 / 100% 4px;
}
body:has(#nav .style-arcade) :is(.card, .wikicard, .infobox) { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
body:has(#nav .style-arcade) :is(.hero, .wikihero-text) h1 { text-shadow: 0 0 18px color-mix(in srgb, var(--accent) 70%, transparent), 0 0 2px color-mix(in srgb, var(--accent) 90%, transparent); }
body:has(#nav .style-arcade) :is(.btn, button[type=submit]) { text-transform: uppercase; letter-spacing: .06em; font-size: .86rem; }
body:has(#nav .style-arcade) .wikicard:hover { box-shadow: 0 0 0 1px var(--accent), 0 0 24px color-mix(in srgb, var(--accent) 45%, transparent); }

/* fantasy: parchment, gold and serif headings */
body:has(#nav .style-fantasy) {
  --bg: #13100c; --bg-2: #1a1610; --card: #1e1912; --card-2: #262017; --raise: #30281c; --line: #3d3324;
  --ink: #f1e7d2; --muted: #b8a684; --accent-2: #d4a94a;
  --radius: 10px; --radius-sm: 8px;
  --display: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --display-weight: 700; --display-track: .005em;
  --pattern: radial-gradient(circle at 50% 0, rgba(212, 169, 74, .07), transparent 60%);
}
:root[data-theme="light"] body:has(#nav .style-fantasy) {
  --bg: #efe6d0; --bg-2: #e8dcc0; --card: #fbf5e6; --card-2: #f4ead3; --raise: #eadcbc; --line: #d9c7a0;
  --ink: #2b2115; --muted: #6e5c40; --accent-2: #a7781c;
  --pattern: radial-gradient(circle at 50% 0, rgba(167, 120, 28, .10), transparent 60%);
}
body:has(#nav .style-fantasy) .card { box-shadow: var(--shadow), inset 0 0 0 1px color-mix(in srgb, var(--accent-2) 18%, transparent); }
body:has(#nav .style-fantasy) :is(.md, .editor-visual) h2 { border-bottom: 0; padding-bottom: 0; }
body:has(#nav .style-fantasy) :is(.md, .editor-visual) h2::after { content: ""; display: block; height: 1px; margin-top: 8px; background: linear-gradient(90deg, var(--accent-2), transparent 80%); }
body:has(#nav .style-fantasy) :is(.hero, .wikihero-text) h1 { letter-spacing: .01em; }

/* sci-fi: cool steel and sharp angles */
body:has(#nav .style-scifi) {
  --bg: #070b10; --bg-2: #0b1219; --card: #0d151e; --card-2: #121d28; --raise: #182634; --line: #1f3142;
  --ink: #dbe8f2; --muted: #84a0b5;
  --radius: 3px; --radius-sm: 2px;
  --display: Bahnschrift, "DIN Alternate", "DIN Condensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --display-weight: 700; --display-case: uppercase; --display-track: .08em;
  --pattern: linear-gradient(90deg, rgba(120, 180, 220, .035) 1px, transparent 1px) 0 0 / 48px 48px, linear-gradient(rgba(120, 180, 220, .035) 1px, transparent 1px) 0 0 / 48px 48px;
}
:root[data-theme="light"] body:has(#nav .style-scifi) {
  --bg: #eef3f7; --bg-2: #e4ebf1; --card: #ffffff; --card-2: #f1f5f9; --raise: #e2e9ef; --line: #cfdbe5;
  --ink: #0f1c27; --muted: #4b6377;
  --pattern: linear-gradient(90deg, rgba(30, 80, 120, .05) 1px, transparent 1px) 0 0 / 48px 48px, linear-gradient(rgba(30, 80, 120, .05) 1px, transparent 1px) 0 0 / 48px 48px;
}
body:has(#nav .style-scifi) .card { border-top: 2px solid var(--accent); }
body:has(#nav .style-scifi) :is(.btn, button[type=submit]) { text-transform: uppercase; letter-spacing: .1em; font-size: .82rem; }
body:has(#nav .style-scifi) .wikicard { clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px)); }

/* cozy: soft, round and warm */
body:has(#nav .style-cozy) {
  --bg: #1a1620; --bg-2: #201b28; --card: #252030; --card-2: #2d2739; --raise: #362f44; --line: #3b3349;
  --ink: #f4eef8; --muted: #b3a8c2;
  --radius: 24px; --radius-sm: 16px;
  --display: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --display-weight: 800; --display-track: -.01em;
  --pattern: radial-gradient(600px 300px at 85% 110%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 70%);
}
:root[data-theme="light"] body:has(#nav .style-cozy) {
  --bg: #fbf6ef; --bg-2: #f5ede2; --card: #ffffff; --card-2: #fbf4ea; --raise: #f2e7d8; --line: #eadcca;
  --ink: #2c2433; --muted: #7a6b80;
}
body:has(#nav .style-cozy) :is(.btn, button[type=submit], input, select, textarea, .input) { border-radius: 999px; }
body:has(#nav .style-cozy) textarea { border-radius: var(--radius-sm); }
body:has(#nav .style-cozy) .wikicard:hover { transform: translateY(-3px) rotate(-.4deg); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .wikicard:hover { transform: none !important; }
}

/* ---------- the front page: the site's welcome, then shelves of wikis */
.sitehero {
  position: relative; overflow: hidden; isolation: isolate; border-radius: var(--radius); border: 1px solid var(--line);
  min-height: 340px; display: grid; align-items: end; margin-top: 6px; box-shadow: var(--shadow);
  background:
    radial-gradient(700px 320px at 85% 0%, color-mix(in srgb, var(--accent-2) 30%, transparent), transparent 70%),
    radial-gradient(800px 380px at 0% 100%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 70%),
    var(--pattern), var(--card);
}
.sitehero .banner { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.sitehero.has-picture::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(0, 0, 0, .82) 0%, rgba(0, 0, 0, .55) 45%, rgba(0, 0, 0, .1) 100%), linear-gradient(0deg, rgba(0, 0, 0, .45), transparent 50%); }
.sitehero-text { padding: 40px 44px; max-width: 720px; display: grid; gap: 14px; }
.sitehero h1 { margin: 0; font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1.02; letter-spacing: var(--display-track); }
.sitehero .tagline { margin: 0; font-size: clamp(1.05rem, 1.8vw, 1.3rem); color: var(--ink); opacity: .88; max-width: 34em; }
.sitehero .welcome { font-size: 1rem; color: var(--muted); }
.sitehero .welcome > :last-child { margin-bottom: 0; }
.sitehero.has-picture :is(h1, .tagline, .welcome, .sitestats) { color: #fff; text-shadow: 0 2px 14px rgba(0, 0, 0, .45); }
.sitehero.has-picture .welcome { color: rgba(255, 255, 255, .85); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 6px; }
.cta .search { flex: 1 1 320px; max-width: 520px; }
.search.big input { height: 52px; font-size: 1.05rem; padding-left: 44px; background-position: 17px center; box-shadow: 0 6px 24px rgba(0, 0, 0, .18); }
.cta .btn.primary { height: 52px; padding: 0 24px; font-size: 1rem; }
.sitestats { margin: 0; color: var(--muted); font-size: .95rem; }
.sitestats strong { color: var(--link); font-size: 1.15em; font-variant-numeric: tabular-nums; }
@media (max-width: 680px) { .sitehero { min-height: 0; } .sitehero-text { padding: 26px 20px; } .cta .btn.primary { width: 100%; } }

.shelf { display: grid; gap: 14px; margin-top: 10px; }
/* the site's own pages (About, Privacy, …), as a row of buttons under the front page's text */
.sitepages { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.shelf > h1 { margin: 6px 0 0; }
.shelf > h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.05rem; color: var(--muted); }
.shelf > h2::before { content: ""; width: 4px; height: 1.1em; border-radius: 2px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.shelf.featured > h2 { color: var(--ink); }
.grid.big { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.grid.big .wikicard::before, .grid.big .wikicard .cover { aspect-ratio: 16/8; height: auto; }

/* a wiki's card: its picture (or its colors), its name, its game, its tagline */
.wikicard { padding: 0 18px 18px; gap: 6px; border-radius: var(--radius); }
.wikicard::before { height: auto; aspect-ratio: 16/7; margin: 0 -18px 12px; }
.wikicard .cover { width: calc(100% + 36px); margin: 0 -18px 12px; }
.wikicard strong { font-family: var(--display); font-size: 1.15rem; line-height: 1.25; }
/* its picture first, then its logo over the picture's edge, its game, its name */
.wikicard::before, .wikicard .cover { order: -3; }
.wikicard .badge { order: -2; width: 52px; height: 52px; margin: -40px 0 2px; position: relative; object-fit: cover; border-radius: calc(var(--radius-sm) + 2px); border: 3px solid var(--card-2); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); background: var(--card-2); }
.wikicard > .muted { order: -1; margin-top: 0; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--link); }
.wikicard > span:not(.muted, .pill) { color: var(--muted); font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wikicard:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 70%, var(--line)); box-shadow: var(--shadow), 0 10px 30px color-mix(in srgb, var(--accent) 22%, transparent); }

/* an article's headings keep their style's face, not its capitals (long ones read better) */
:is(.md, .editor-visual) :is(h1, h2) { text-transform: none; letter-spacing: -.01em; }

/* ---------- a wiki's home: its banner, then its main page beside its panels */
.wikihero { min-height: 220px; }
.wikihero.has-banner { min-height: 320px; }
.wikihero.has-banner::after { background: linear-gradient(90deg, rgba(0, 0, 0, .8) 0%, rgba(0, 0, 0, .45) 55%, rgba(0, 0, 0, .15)), linear-gradient(0deg, rgba(0, 0, 0, .5), transparent 60%); }
.wikihero-text { align-items: flex-end; padding: 28px 32px; gap: 20px; }
.wikihero-words { display: grid; gap: 8px; min-width: 0; flex: 1; }
.wikihero-words h1 { line-height: 1.05; }
.wikihero-words p { max-width: 40em; }
.wikihero .cta { margin-top: 4px; }
.wikihero .cta .search { max-width: 460px; }
.wikihero .search.big input { background-color: rgba(10, 12, 18, .72); border-color: rgba(255, 255, 255, .18); color: #fff; }
.wikihero .search.big input::placeholder { color: rgba(255, 255, 255, .65); }
.wikihero .sitestats { color: rgba(255, 255, 255, .8); }
.wikihero .sitestats strong { color: #fff; }
.kicker { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .14em; color: rgba(255, 255, 255, .85); }
.herologo { width: 96px; height: 96px; border-radius: calc(var(--radius) + 4px); align-self: flex-end; }
@media (max-width: 880px) { .wikihero-text { flex-direction: column; align-items: flex-start; padding: 20px; } .herologo { width: 64px; height: 64px; } }

.panel { padding: 16px 18px; display: grid; gap: 10px; }
.panel h2 { font-size: .95rem; margin: 0; color: var(--muted); }
.panel .list { gap: 0; }
.panel .row { padding: 7px 0; gap: 2px 10px; font-size: .93rem; }
.panel .row > a { font-weight: 600; }
.panel .row .muted { font-size: .8rem; width: 100%; }
.more { font-size: .88rem; font-weight: 600; justify-self: start; }
.more::after { content: " \2192"; }

/* ---------- reading an article */
.pagehead { position: relative; border-bottom: 0; padding-bottom: 12px; }
.pagehead::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2) 30%, var(--line) 60%); border-radius: 2px; }
.pagehead h1 { font-family: var(--display); font-weight: var(--display-weight); letter-spacing: var(--display-track); line-height: 1.1; }
:is(.md, .editor-visual) h2 { display: flex; align-items: center; gap: 10px; }
:is(.md, .editor-visual) h2::before { content: ""; flex: none; width: 5px; height: .95em; border-radius: 2px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
:is(.md, .editor-visual) h3 { color: color-mix(in srgb, var(--ink) 85%, var(--link)); }
:is(.md, .editor-visual) th { background: color-mix(in srgb, var(--accent) 14%, var(--card-2)); color: var(--ink); }
:is(.md, .editor-visual) blockquote { border-left-width: 4px; color: var(--ink); background: color-mix(in srgb, var(--accent) 9%, transparent); }
:is(.md, .editor-visual) a:not(.new) { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent); text-underline-offset: 3px; }
:is(.md, .editor-visual) a:not(.new):hover { text-decoration-color: currentColor; }
.toc { border-top: 3px solid var(--accent); }
.toc strong::before { content: "\25C6  "; color: var(--accent-2); }

/* an infobox: an item card, glowing in the wiki's color */
.infobox { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow), 0 0 0 1px color-mix(in srgb, var(--accent) 15%, transparent), 0 10px 34px color-mix(in srgb, var(--accent) 16%, transparent); }
.infobox h2 { font-family: var(--display); text-transform: var(--display-case); letter-spacing: var(--display-track); padding: 12px 14px; }
.infobox h2 a { color: #fff; }
.infobox img { background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%), var(--bg-2); padding: 10px; object-fit: contain; max-height: 300px; }
.infobox dt { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; align-self: center; }
.infobox dd { font-weight: 600; }

/* a wiki with no main page yet */
.empty-wiki { display: grid; gap: 10px; justify-items: start; padding: 28px; }
.empty-wiki h2 { margin: 0; }
.empty-wiki p { margin: 0; }

/* a search box's magnifier (the text inputs' own background would hide it) */
.search input[type=text] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23949cb0' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m14 14-3.2-3.2'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 14px center; padding-left: 38px; }
.search.big input[type=text] { background-position: 17px center; padding-left: 44px; }
