:root {
  --bg: #15171c;
  --card: #1e212a;
  --card2: #262a35;
  --text: #e8e8ec;
  --mut: #9298a6;
  --acc: #d4453a;
  --acc2: #e8716a;
  --border: #30343f;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}
a { color: var(--acc2); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  display: flex; align-items: center; gap: 20px;
  padding: 12px 18px; background: var(--card); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10; flex-wrap: wrap;
}
.topbar .brand { display: flex; align-items: center; }
.topbar .brand img { height: 38px; display: block; }
.topbar nav { display: flex; gap: 14px; flex: 1; }
.topbar nav a { color: var(--mut); font-weight: 600; }
.topbar nav a.active { color: var(--acc2); }
.auth-area { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--mut); }
main { max-width: 820px; margin: 0 auto; padding: 18px 14px 60px; position: relative; z-index: 1; }
/* Decorative OG cameo flanking the content - only where there's room either side; never on mobile. */
.side-art {
  display: none; position: fixed; bottom: 0; width: 260px; height: auto; opacity: 0.9;
  pointer-events: none; filter: drop-shadow(0 0 30px rgba(0,0,0,0.6)); image-rendering: pixelated;
}
.side-art-left { left: max(0px, calc(50% - 650px)); }
.side-art-right { right: max(0px, calc(50% - 650px)); transform: scaleX(-1); }
@media (min-width: 1400px) { .side-art { display: block; } }
h1 { font-size: 22px; margin: 4px 0 16px; }
h2 { font-size: 18px; margin: 0 0 4px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 10px;
}
.list-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 8px;
}
.list-row:hover { border-color: var(--acc); }
.list-row .meta { color: var(--mut); font-size: 12px; white-space: nowrap; text-align: right; }
.pill {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 5px;
  background: var(--acc); color: #fff; margin-right: 6px; vertical-align: middle;
}
.pill.locked { background: #555; }
.post {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; margin-bottom: 10px;
}
.post .byline { font-size: 12px; color: var(--mut); margin-bottom: 8px; display: flex; gap: 8px; align-items: center; }
.post .byline b { color: var(--text); }
.post .body { white-space: pre-wrap; word-break: break-word; }
.post .actions { margin-top: 8px; font-size: 12px; }
.post .actions a { margin-right: 10px; }
textarea, input[type=text], input[type=email], input[type=password] {
  width: 100%; background: var(--card2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 10px; font-family: inherit; font-size: 14px;
}
textarea { min-height: 110px; resize: vertical; }
button {
  background: var(--acc); color: #fff; border: none; border-radius: 8px;
  padding: 9px 16px; font-weight: 600; cursor: pointer; font-size: 14px;
}
button:hover { background: var(--acc2); }
button.secondary { background: var(--card2); color: var(--text); border: 1px solid var(--border); }
.form-row { margin-bottom: 10px; }
.err { color: var(--acc2); font-size: 13px; margin: 6px 0; }
.muted { color: var(--mut); }
.crumb { font-size: 13px; margin-bottom: 10px; color: var(--mut); }
.wiki-body { white-space: pre-wrap; line-height: 1.6; }
.wiki-body h1, .wiki-body h2, .wiki-body h3 { margin-top: 1.2em; }
.wiki-body code { background: var(--card2); padding: 2px 5px; border-radius: 4px; }
.wiki-table { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: 13px; }
.wiki-table th, .wiki-table td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; white-space: nowrap; }
.wiki-table th { background: var(--card2); color: var(--acc2); }
.wiki-table { display: block; overflow-x: auto; }
.wiki-img { max-width: 100%; border-radius: 8px; margin: 10px 0; display: block; }
.wiki-refs { font-size: 13px; color: var(--mut); padding-left: 20px; }
.wiki-refs li { margin-bottom: 4px; }
.wiki-refs .back { margin-left: 4px; }
sup a { color: var(--acc2); }
.img-upload-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.img-upload-row input[type=file] { color: var(--mut); font-size: 12px; }
.wiki-hero {
  text-align: center; padding: 36px 16px; margin: -18px -14px 16px; border-radius: 0 0 14px 14px;
  background-size: cover; background-position: center; position: relative;
}
.wiki-hero::before {
  content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(21,23,28,0.35), rgba(21,23,28,0.92)); border-radius: inherit;
}
.wiki-hero img, .wiki-hero p { position: relative; z-index: 1; }
.wiki-hero img { height: 90px; margin: 0 auto 10px; display: block; filter: drop-shadow(0 2px 10px rgba(0,0,0,0.6)); }
.wiki-hero p { color: var(--text); margin: 0; text-shadow: 0 1px 4px rgba(0,0,0,0.8); }
.wiki-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 16px; }
.wiki-card {
  display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px; transition: border-color 0.15s;
}
.wiki-card:hover { border-color: var(--acc); text-decoration: none; }
.wiki-card img { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; image-rendering: pixelated; flex-shrink: 0; }
.wiki-card h2 { margin: 0 0 2px; font-size: 15px; }
.wiki-card p { margin: 0; color: var(--mut); font-size: 12px; }
.breadcrumb { font-size: 13px; color: var(--mut); margin-bottom: 10px; }
.breadcrumb a { color: var(--mut); text-decoration: underline; }
.cat-footer { margin-top: 24px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 12px; color: var(--mut); }
.infobox {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px; margin: 0 0 14px; max-width: 320px;
}
.infobox img { width: 100%; max-width: 160px; display: block; margin: 0 auto 10px; image-rendering: pixelated; }
.infobox-title { font-weight: 700; text-align: center; margin-bottom: 8px; color: var(--acc2); }
.infobox-rows { width: 100%; border-collapse: collapse; font-size: 13px; }
.infobox-rows th, .infobox-rows td { padding: 4px 6px; border-top: 1px solid var(--border); text-align: left; }
.infobox-rows th { color: var(--mut); font-weight: 600; white-space: nowrap; }
.infobox-rows tr:first-child th, .infobox-rows tr:first-child td { border-top: none; }
.extra-nav-gap { margin-left: 4px; }
#extraNav a { margin-left: 14px; }
