/* Roots of a Kingdom — site styles. Palette taken from the game's UI theme. */
@font-face { font-family: "Go"; src: url("/static/fonts/Go-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Go"; src: url("/static/fonts/Go-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Go"; src: url("/static/fonts/Go-Italic.woff2") format("woff2"); font-style: italic; font-display: swap; }
@font-face { font-family: "Go Mono"; src: url("/static/fonts/Go-Mono.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Go Smallcaps"; src: url("/static/fonts/Go-Smallcaps.woff2") format("woff2"); font-display: swap; }

:root {
  --bg: #080503; --panel: #120C08; --panel2: #1a120b; --header: #32230F;
  --rim: #A07832; --rim-in: #5A4119; --rivet: #C8A046;
  --gold: #DCC378; --cream: #C3B491; --dim: #B4A47C; --muted: #8a7b5c;
  --parch: #e9d9b0; --parch2: #dcc694; --ink: #46260C; --ink-head: #7A2A0A;
  --accent: #E08A30; --green: #64D25A; --red: #F06969; --yellow: #FFE650; --blue: #6fb3e0;
  --wood1: #6b4520; --wood2: #4a2e14; --wood3: #2e1c0b;
  --radius: 2px; --maxw: 1180px;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; font: 16px/1.55 "Go", system-ui, sans-serif; color: var(--cream);
  background: linear-gradient(180deg, rgba(8,5,3,.78), rgba(8,5,3,.9)) fixed, var(--bg) url("/static/img/bg-page.webp") center / cover no-repeat fixed;
  min-height: 100vh; display: flex; flex-direction: column;
}
img.pixel, .pixel img { image-rendering: pixelated; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--yellow); text-decoration: underline; }
h1, h2, h3, h4 { font-family: "Go Smallcaps", "Go", sans-serif; color: var(--gold); line-height: 1.2; margin: 0 0 .6em; letter-spacing: .02em; }
h1 { font-size: 2rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
code, pre, kbd { font-family: "Go Mono", monospace; font-size: .92em; }
pre { overflow-x: auto; padding: .8em 1em; background: #0b0705; border: 1px solid var(--rim-in); }
:not(pre) > code { background: rgba(0,0,0,.35); padding: .05em .35em; }
hr { border: 0; border-top: 1px solid var(--rim-in); margin: 1.5em 0; }
small, .small { font-size: .85em; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 1rem; }
main { flex: 1; padding: 1.5rem 0 3rem; }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-header {
  background: linear-gradient(180deg, #3b2913, var(--header) 60%, #24180a);
  border-bottom: 3px solid var(--rim); box-shadow: 0 2px 0 var(--rim-in), 0 6px 18px rgba(0,0,0,.6);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 60px; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--gold); font-family: "Go Smallcaps"; font-size: 1.2rem; white-space: nowrap; }
.brand:hover { text-decoration: none; color: var(--yellow); }
.brand img { width: 40px; height: 40px; image-rendering: pixelated; }
.nav { display: flex; gap: .2rem; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--cream); padding: .45rem .75rem; border: 1px solid transparent; font-family: "Go Smallcaps"; }
.nav a:hover { color: var(--gold); text-decoration: none; background: rgba(0,0,0,.25); }
.nav a.active { color: var(--gold); border-color: var(--rim-in); background: rgba(0,0,0,.35); box-shadow: inset 0 -2px 0 var(--accent); }
.userbox { display: flex; align-items: center; gap: .5rem; white-space: nowrap; }
.userbox form { margin: 0; }
@media (max-width: 1250px) { .userbox .wide-only { display: none; } }
.nav-toggle { display: none; }
@media (max-width: 860px) {
  .site-header .wrap { flex-wrap: wrap; padding: .4rem 1rem; }
  .nav-toggle { display: inline-block; margin-left: auto; }
  .nav, .userbox { display: none; width: 100%; }
  .site-header.open .nav { display: flex; flex-direction: column; }
  .site-header.open .userbox { display: flex; padding-bottom: .6rem; }
}

.announce { background: linear-gradient(90deg, #5a2a08, #7a3a0a, #5a2a08); color: var(--yellow); text-align: center; padding: .45rem 1rem; border-bottom: 1px solid var(--rim-in); }
.announce p { margin: 0; }
.announce a { color: #fff; text-decoration: underline; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-footer { border-top: 3px solid var(--rim); background: #0d0805; padding: 1.5rem 0; color: var(--muted); font-size: .9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: center; justify-content: space-between; }
.site-footer nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.site-footer a { color: var(--dim); }
.site-footer img { height: 34px; width: auto; opacity: .85; }

/* ── Frames & panels ────────────────────────────────────────────────────── */
.frame {
  position: relative; background: var(--panel); border: 3px solid var(--rim);
  box-shadow: inset 0 0 0 2px var(--rim-in), inset 0 0 0 4px #0a0604, 0 6px 20px rgba(0,0,0,.55);
  padding: 1.4rem 1.5rem; margin-bottom: 1.5rem;
}
.frame::before, .frame::after, .frame > .rivets::before, .frame > .rivets::after {
  content: ""; position: absolute; width: 8px; height: 8px; background: var(--rivet);
  box-shadow: inset -2px -2px 0 #7a5a1e, inset 1px 1px 0 #f2d68a; border: 1px solid #3a2a0c;
}
.frame::before { top: 4px; left: 4px; } .frame::after { top: 4px; right: 4px; }
.frame > .rivets::before { bottom: 4px; left: 4px; } .frame > .rivets::after { bottom: 4px; right: 4px; }
.frame.tight { padding: .9rem 1rem; }
.frame > h2:first-child, .frame > h3:first-child, .frame-head { margin-top: 0; }
.frame-title {
  margin: -1.4rem -1.5rem 1.2rem; padding: .6rem 1.5rem; background: linear-gradient(180deg, #3b2913, var(--header));
  border-bottom: 2px solid var(--rim-in); display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.frame-title h1, .frame-title h2, .frame-title h3 { margin: 0; }
.frame.tight .frame-title { margin: -.9rem -1rem .9rem; padding: .5rem 1rem; }

/* Parchment: long-form reading surfaces */
.parchment {
  position: relative; color: var(--ink); background: var(--parch) linear-gradient(180deg, #f1e3bd, var(--parch) 20%, var(--parch2));
  border: 3px solid var(--rim); box-shadow: inset 0 0 0 2px #b89a5c, inset 0 0 40px rgba(122,42,10,.18), 0 6px 20px rgba(0,0,0,.55);
  padding: 2rem 2.2rem; margin-bottom: 1.5rem;
}
.parchment h1, .parchment h2, .parchment h3, .parchment h4 { color: var(--ink-head); }
.parchment a { color: #8a3a08; text-decoration: underline; }
.parchment a:hover { color: #c05010; }
.parchment hr { border-top-color: #b89a5c; }
.parchment .muted { color: #7d6440; }
.parchment pre { background: #f6ecd2; border-color: #b89a5c; color: var(--ink); }
.parchment :not(pre) > code { background: rgba(122,42,10,.1); }
.parchment blockquote { border-left-color: #b89a5c; color: #5c3a18; }
.parchment table th { background: rgba(122,42,10,.12); color: var(--ink-head); }
.parchment table td, .parchment table th { border-color: #c4a873; }
@media (max-width: 640px) { .parchment { padding: 1.2rem 1rem; } .frame { padding: 1.1rem 1rem; } .frame-title { margin: -1.1rem -1rem 1rem; padding: .6rem 1rem; } }

/* Markdown body */
.md { overflow-wrap: anywhere; }
.md img { max-width: 100%; height: auto; }
.md blockquote { margin: 0 0 1em; padding: .2em 1em; border-left: 3px solid var(--rim-in); color: var(--dim); }
.md ul, .md ol { padding-left: 1.5em; margin: 0 0 1em; }
.md table { border-collapse: collapse; margin-bottom: 1em; }
.md td, .md th { border: 1px solid var(--rim-in); padding: .3em .6em; }
.md > :last-child { margin-bottom: 0; }

/* ── Buttons (wood planks with rivets) ──────────────────────────────────── */
.btn, button, input[type=submit] {
  --b1: var(--wood1); --b2: var(--wood2);
  display: inline-flex; align-items: center; justify-content: center; gap: .45em; position: relative;
  font: 700 .95rem "Go", sans-serif; color: var(--gold); cursor: pointer; text-decoration: none; white-space: nowrap;
  padding: .55em 1.25em; border: 2px solid #1c1006; border-radius: var(--radius);
  background: repeating-linear-gradient(180deg, transparent 0 9px, rgba(0,0,0,.18) 9px 10px), linear-gradient(180deg, var(--b1), var(--b2));
  box-shadow: inset 0 1px 0 rgba(255,220,150,.25), inset 0 -2px 0 rgba(0,0,0,.35), 0 2px 0 #000;
  text-shadow: 0 1px 0 #000;
}
.btn::before, .btn::after, button::before, button::after {
  content: ""; position: absolute; top: 50%; width: 4px; height: 4px; margin-top: -2px; background: var(--rivet); box-shadow: 0 0 0 1px #3a2a0c;
}
.btn::before, button::before { left: 5px; } .btn::after, button::after { right: 5px; }
.btn:hover, button:hover { --b1: #7d5226; --b2: #573618; color: var(--yellow); text-decoration: none; }
.btn:active, button:active { transform: translateY(1px); box-shadow: inset 0 2px 4px rgba(0,0,0,.5); }
.btn:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.btn[disabled], button[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { --b1: #b4621c; --b2: #7a3a0a; color: #fff3cf; border-color: #2a1404; }
.btn-primary:hover { --b1: #cc7426; --b2: #8f4610; color: #fff; }
.btn-steam { --b1: #2b5a86; --b2: #17324f; color: #e8f2ff; border-color: #0a1520; font-size: 1.1rem; padding: .75em 1.6em; }
.btn-steam:hover { --b1: #33699c; --b2: #1c3d60; color: #fff; }
.btn-danger { --b1: #7a1f1a; --b2: #4d110e; color: #ffd6d0; }
.btn-danger:hover { --b1: #922620; --b2: #5e1511; color: #fff; }
.btn-sm, button.btn-sm { font-size: .8rem; padding: .3em .8em; }
.btn-sm::before, .btn-sm::after { display: none; }
.btn-link, button.btn-link { background: none; border: 0; box-shadow: none; padding: 0; color: var(--gold); font-weight: 400; text-shadow: none; }
.btn-link::before, .btn-link::after { display: none; }
.btn-link:hover { text-decoration: underline; }
.btn-big { font-size: 1.15rem; padding: .8em 1.8em; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.btn-row form { margin: 0; }
.inline { display: inline; margin: 0; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
label { display: block; font-weight: 700; color: var(--gold); margin-bottom: .3rem; }
label.check { display: inline-flex; align-items: center; gap: .4rem; font-weight: 400; color: var(--cream); cursor: pointer; }
input[type=text], input[type=search], input[type=number], input[type=url], input[type=color], select, textarea {
  width: 100%; font: 1rem "Go", sans-serif; color: var(--cream); background: #0b0705; border: 2px solid var(--rim-in);
  padding: .5rem .65rem; border-radius: var(--radius);
}
input[type=color] { padding: 2px; height: 2.4rem; width: 4rem; }
input:focus, select:focus, textarea:focus { border-color: var(--rim); outline: none; }
textarea { min-height: 9rem; resize: vertical; font-family: "Go Mono", monospace; font-size: .92rem; line-height: 1.5; }
textarea.tall { min-height: 22rem; }
input[type=file] { color: var(--dim); max-width: 100%; }
input[type=checkbox] { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; }
.field { margin-bottom: 1rem; }
.field .hint { font-size: .85rem; color: var(--muted); margin-top: .25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 1rem; }
@media (max-width: 720px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.errors { background: rgba(240,105,105,.12); border: 1px solid var(--red); color: var(--red); padding: .6rem 1rem; margin-bottom: 1rem; }
.errors ul { margin: 0; padding-left: 1.2rem; }
.filters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: end; }
.filters > * { flex: 1 1 140px; max-width: 260px; margin: 0; }
.filters .grow { flex: 3 1 240px; max-width: none; }
.filters button { flex: 0 0 auto; }

.editor-tabs { display: flex; gap: .3rem; margin-bottom: -2px; }
.editor-tabs button { font-size: .8rem; padding: .25em .9em; }
.editor-tabs button::before, .editor-tabs button::after { display: none; }
.editor-tabs button.on { --b1: #8a5a26; --b2: #6b4520; color: var(--yellow); }
.preview { min-height: 9rem; border: 2px solid var(--rim-in); padding: .8rem 1rem; background: #0b0705; }

/* ── Flash ──────────────────────────────────────────────────────────────── */
.flash { padding: .7rem 1rem; margin-bottom: 1.2rem; border: 2px solid; font-weight: 700; }
.flash.ok { border-color: var(--green); color: var(--green); background: rgba(100,210,90,.08); }
.flash.err { border-color: var(--red); color: var(--red); background: rgba(240,105,105,.08); }
.js-msg { min-height: 1.4em; margin: .6rem 0 0; font-weight: 700; }
.js-msg.err { color: var(--red); } .js-msg.ok { color: var(--green); }

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero { position: relative; margin: -1.5rem 0 2rem; border-bottom: 3px solid var(--rim); overflow: hidden;
  background: #000 url("/static/img/bg-hero.webp") center / cover no-repeat; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(8,5,3,.25), rgba(8,5,3,.85) 75%), linear-gradient(180deg, transparent 60%, var(--bg)); }
.hero .wrap { position: relative; z-index: 1; text-align: center; padding: 3.5rem 1rem 3rem; }
.hero-emblem { width: 144px; height: 144px; image-rendering: pixelated; filter: drop-shadow(0 6px 12px rgba(0,0,0,.9)); }
.hero-title { font: 700 clamp(2.2rem, 6vw, 4.2rem)/1.05 "Go Smallcaps", "Go", sans-serif; color: var(--gold); letter-spacing: .06em;
  margin: .4rem 0 1rem; text-shadow: 0 3px 0 #1b0f04, 0 0 24px rgba(0,0,0,.95), 0 0 6px rgba(0,0,0,.9); }
.hero .tagline { font: 700 1.5rem "Go Smallcaps"; color: var(--yellow); text-shadow: 0 2px 0 #000, 0 0 18px rgba(0,0,0,.9); margin: .6rem 0 .8rem; }
.hero .lead { max-width: 720px; margin: 0 auto 1.4rem; color: #efe3c0; text-shadow: 0 1px 2px #000; font-size: 1.05rem; }
.hero .btn-row { justify-content: center; }
.hero .release { margin-top: 1rem; color: var(--dim); text-shadow: 0 1px 2px #000; }
.badge-stage { display: inline-block; font: 700 .8rem "Go Smallcaps"; letter-spacing: .08em; color: #1b0f04; background: var(--accent); padding: .2em .7em; border: 2px solid #1b0f04; box-shadow: 0 2px 0 #000; }

/* ── Home layout ────────────────────────────────────────────────────────── */
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .cols { grid-template-columns: 1fr; } }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; margin-bottom: 1.5rem; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr; } }
.feature { margin: 0; }
.feature img { width: 100%; height: auto; display: block; border: 2px solid var(--rim-in); image-rendering: pixelated; margin-bottom: .8rem; }
.feature h3 { margin-bottom: .3rem; }
.feature p { margin: 0; color: var(--dim); font-size: .95rem; }

.news-item { padding: 1rem 0; border-bottom: 1px dashed var(--rim-in); display: grid; grid-template-columns: 180px 1fr; gap: 1rem; }
.news-item:last-child { border-bottom: 0; padding-bottom: 0; }
.news-item:first-of-type { padding-top: 0; }
.news-item.noimg { grid-template-columns: 1fr; }
.news-item img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border: 2px solid var(--rim-in); }
.news-item h3 { margin: 0 0 .25rem; font-size: 1.25rem; }
.news-item h3 a { color: var(--gold); }
.news-item p { margin: .4rem 0 0; color: var(--cream); }
@media (max-width: 600px) { .news-item { grid-template-columns: 1fr; } }
.meta { color: var(--muted); font-size: .85rem; }
.meta a { color: var(--dim); }
.pin { color: var(--accent); font-weight: 700; }
.news-hero { width: 100%; height: auto; border: 3px solid var(--rim); margin-bottom: 1.2rem; display: block; }

.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-list li { padding: .45rem 0; border-bottom: 1px dashed var(--rim-in); display: flex; gap: .5rem; align-items: baseline; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-row { display: flex; gap: 1rem; margin-bottom: 1rem; }
.stat { flex: 1; text-align: center; background: #0b0705; border: 1px solid var(--rim-in); padding: .5rem; }
.stat b { display: block; font-size: 1.6rem; color: var(--gold); }
.stat span { font-size: .8rem; color: var(--muted); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem; }
.gallery a { display: block; border: 2px solid var(--rim-in); line-height: 0; background: #000; }
.gallery a:hover { border-color: var(--gold); }
.gallery img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

.lightbox { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; padding: 2rem; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border: 3px solid var(--rim); box-shadow: 0 0 40px #000; }
.lightbox button { position: absolute; top: 50%; transform: translateY(-50%); font-size: 1.5rem; }
.lightbox .prev { left: 1rem; } .lightbox .next { right: 1rem; }
.lightbox .close { top: 1.5rem; right: 1rem; transform: none; }

.sprites { display: flex; justify-content: center; gap: 1rem; margin: .5rem 0 1rem; }
.sprites img { height: 48px; width: auto; image-rendering: pixelated; }

/* ── Tables / lists ─────────────────────────────────────────────────────── */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font: 700 .85rem "Go Smallcaps"; color: var(--gold); background: rgba(50,35,15,.6); padding: .5rem .6rem; border-bottom: 2px solid var(--rim-in); }
.table td { padding: .55rem .6rem; border-bottom: 1px solid #2a1d10; vertical-align: top; }
.table tr:hover td { background: rgba(160,120,50,.05); }
.table .num { text-align: right; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.row-title { font-weight: 700; font-size: 1.02rem; }
.row-sub { font-size: .83rem; color: var(--muted); margin-top: .15rem; }

.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a { padding: .35rem .9rem; border: 1px solid var(--rim-in); color: var(--cream); background: rgba(0,0,0,.25); }
.tabs a.on { border-color: var(--rim); color: var(--gold); background: var(--header); }
.tabs a:hover { text-decoration: none; color: var(--gold); }

.pager { display: flex; gap: .4rem; justify-content: center; align-items: center; margin-top: 1.2rem; }

/* ── Tags / status ──────────────────────────────────────────────────────── */
.tag { display: inline-block; font: 700 .72rem "Go", sans-serif; letter-spacing: .03em; padding: .12em .55em; border: 1px solid currentColor; border-radius: 2px; white-space: nowrap; vertical-align: middle; text-transform: uppercase; }
.st-new { color: var(--yellow); } .st-confirmed { color: var(--accent); } .st-in_progress { color: var(--blue); }
.st-fixed { color: var(--green); } .st-wont_fix, .st-closed { color: var(--muted); } .st-duplicate { color: #b48ce0; }
.sev-low { color: var(--muted); } .sev-normal { color: var(--dim); } .sev-high { color: var(--accent); } .sev-critical { color: var(--red); }
.kind { color: var(--cream); border-color: var(--rim-in); }
.role-admin { color: var(--red); } .role-moderator { color: var(--green); } .role-tester { color: var(--blue); } .role-user { color: var(--muted); }
.vis-public { color: var(--green); } .vis-registered { color: var(--blue); } .vis-testers { color: var(--accent); } .vis-hidden { color: var(--muted); }
.label { display: inline-block; font-size: .75rem; padding: .08em .5em; border-radius: 2px; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,.6); background: #555; border: 1px solid rgba(0,0,0,.4); }
.dot { display: inline-block; width: .7em; height: .7em; border-radius: 50%; }
.ok-text { color: var(--green); } .err-text { color: var(--red); } .warn-text { color: var(--accent); }

/* Vote button */
.vote { display: inline-flex; flex-direction: column; align-items: center; min-width: 3.2rem; padding: .25rem .4rem; font-size: .8rem; }
.vote b { font-size: 1.05rem; }
.vote::before, .vote::after { display: none; }
.vote.on { --b1: #8a5a16; --b2: #6b4510; color: var(--yellow); box-shadow: inset 0 0 0 1px var(--yellow); }
.vote-static { display: inline-flex; flex-direction: column; align-items: center; min-width: 3rem; color: var(--dim); font-size: .8rem; }
.vote-static b { font-size: 1.05rem; color: var(--gold); }

/* ── Issue / thread view ────────────────────────────────────────────────── */
.issue-head { display: flex; gap: 1rem; align-items: flex-start; }
.issue-head .grow { flex: 1; min-width: 0; }
.issue-head h1 { font-size: 1.6rem; margin: 0 0 .4rem; overflow-wrap: anywhere; }
.issue-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.5rem; }
@media (max-width: 900px) { .issue-layout { grid-template-columns: 1fr; } }
.sidebar .frame { padding: 1rem; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .35rem .8rem; margin: 0; font-size: .92rem; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; }

.post { display: grid; grid-template-columns: 150px minmax(0, 1fr); border: 2px solid var(--rim-in); background: var(--panel); margin-bottom: 1rem; scroll-margin-top: 80px; }
.post:target { border-color: var(--accent); }
.post .author { background: rgba(50,35,15,.45); padding: .9rem; border-right: 2px solid var(--rim-in); font-size: .85rem; color: var(--muted); }
.post .author b { display: block; font-size: 1rem; color: var(--gold); overflow-wrap: anywhere; }
.post .body { padding: .9rem 1.1rem; }
.post .post-meta { display: flex; justify-content: space-between; gap: 1rem; font-size: .82rem; color: var(--muted); margin-bottom: .6rem; flex-wrap: wrap; }
.post .post-actions { display: flex; gap: .8rem; margin-top: .8rem; font-size: .85rem; flex-wrap: wrap; align-items: center; }
.post .post-actions form { margin: 0; }
.post.staff .author { background: rgba(122,42,10,.25); }
.post.deleted .body { color: var(--muted); font-style: italic; }
@media (max-width: 640px) { .post { grid-template-columns: 1fr; } .post .author { border-right: 0; border-bottom: 2px solid var(--rim-in); padding: .5rem .9rem; } .post .author b { display: inline; margin-right: .5rem; } }

.event { display: flex; gap: .6rem; align-items: center; padding: .35rem .9rem; margin: 0 0 1rem 150px; font-size: .88rem; color: var(--dim); border-left: 3px solid var(--rim-in); }
.event b { color: var(--cream); }
@media (max-width: 640px) { .event { margin-left: 0; } }

.attachments { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: .8rem; }
.att { display: flex; flex-direction: column; gap: .25rem; border: 1px solid var(--rim-in); padding: .4rem; background: #0b0705; font-size: .8rem; max-width: 200px; }
.att img { max-width: 186px; max-height: 120px; object-fit: contain; background: #000; }
.att .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att form { margin: 0; }

details.box { border: 1px solid var(--rim-in); padding: .5rem .8rem; margin-bottom: 1rem; background: rgba(0,0,0,.2); }
details.box > summary { cursor: pointer; color: var(--gold); font-weight: 700; }
details.box[open] > summary { margin-bottom: .8rem; }

/* ── Forum ──────────────────────────────────────────────────────────────── */
.cat-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 90px 240px; gap: 1rem; align-items: center; padding: .9rem .2rem; border-bottom: 1px dashed var(--rim-in); }
.cat-row:last-child { border-bottom: 0; }
.cat-row h3 { margin: 0 0 .2rem; font-size: 1.15rem; }
.cat-row p { margin: 0; color: var(--dim); font-size: .92rem; }
.cat-row .n { text-align: center; } .cat-row .n b { display: block; color: var(--gold); font-size: 1.1rem; } .cat-row .n span { font-size: .75rem; color: var(--muted); }
.cat-row .last { font-size: .85rem; color: var(--muted); overflow: hidden; }
.cat-row .last a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .cat-row { grid-template-columns: 1fr 70px 70px; } .cat-row .last { display: none; } }
.thread-row { display: flex; gap: .9rem; align-items: center; }
.thread-row .grow { flex: 1; min-width: 0; }

/* ── Downloads ──────────────────────────────────────────────────────────── */
.build h2 { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.files { display: grid; gap: .6rem; margin: 1rem 0; }
.file { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 1rem; align-items: center; background: #0b0705; border: 1px solid var(--rim-in); padding: .6rem .8rem; }
.file .plat { font: 700 .95rem "Go Smallcaps"; color: var(--gold); }
.file .info { font-size: .85rem; color: var(--muted); min-width: 0; }
.file .info code { overflow-wrap: anywhere; font-size: .75rem; }
@media (max-width: 640px) { .file { grid-template-columns: 1fr; } }
.locked { padding: .8rem 1rem; border: 1px dashed var(--accent); color: var(--accent); }

.progress { height: 18px; border: 2px solid var(--rim-in); background: #0b0705; margin: .6rem 0; }
.progress > div { height: 100%; width: 0; background: repeating-linear-gradient(45deg, var(--accent) 0 10px, #c07020 10px 20px); transition: width .2s; }

/* ── Auth ───────────────────────────────────────────────────────────────── */
.auth-box { max-width: 480px; margin: 1rem auto; }
.auth-box .emblem { display: block; margin: 0 auto 1rem; width: 72px; height: 72px; image-rendering: pixelated; }
.passkey-btn { width: 100%; }

/* ── Admin ──────────────────────────────────────────────────────────────── */
.admin { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 1.5rem; }
@media (max-width: 860px) { .admin { grid-template-columns: 1fr; } }
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-nav a { padding: .45rem .8rem; color: var(--cream); border-left: 3px solid transparent; background: rgba(0,0,0,.25); display: flex; justify-content: space-between; }
.admin-nav a.on { border-left-color: var(--accent); color: var(--gold); background: var(--header); }
.admin-nav a:hover { text-decoration: none; color: var(--gold); }
.admin-nav h4 { margin: .9rem 0 .3rem; font-size: .8rem; color: var(--muted); letter-spacing: .1em; }
.count { background: var(--red); color: #fff; font-size: .72rem; padding: 0 .45em; border-radius: 8px; font-weight: 700; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; margin-bottom: 1.5rem; }
.card { background: var(--panel); border: 2px solid var(--rim-in); padding: .8rem; text-align: center; }
.card b { display: block; font-size: 1.8rem; color: var(--gold); }
.card span { color: var(--muted); font-size: .85rem; }
.copy-box { display: flex; gap: .5rem; } .copy-box input { flex: 1; }

.error-page { text-align: center; padding: 2rem 0; }
.error-page .code { font: 700 5rem "Go Smallcaps"; color: var(--accent); line-height: 1; text-shadow: 0 4px 0 #000; }
.error-page img { height: 64px; image-rendering: pixelated; margin: 1rem 0; }
.center-row { justify-content: center; }
.build details.box { margin: .5rem 0 0; }

/* ── Steam sign-in ──────────────────────────────────────────────────────── */
.or-sep { display: flex; align-items: center; gap: .8rem; margin: 1.2rem 0; color: var(--dim); font-size: .9rem; }
.or-sep::before, .or-sep::after { content: ""; flex: 1; border-top: 1px solid var(--rim-in, #5A4119); }
.auth-box .steam-btn { display: block; width: 100%; text-align: center; }
