/* Dark Wizardry — site styles. No external fonts or assets. */
:root {
  --bg: #0d0a14;
  --bg-2: #120e1b;
  --panel: #18121f;
  --panel-2: #1f1829;
  --border: #2d2439;
  --text: #e9e3f2;
  --muted: #9d92b2;
  --gold: #d9b45b;
  --gold-2: #f0d48a;
  --violet: #8b5cf6;
  --link: #c7a8ff;
  --missing: #ef7d7d;
  --ok: #7fd1a8;
  --danger: #e25555;
  --radius: 10px;
  --serif: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font: 16px/1.6 var(--sans); color: var(--text);
  background:
    radial-gradient(1200px 500px at 50% -200px, #2a1748 0%, transparent 70%),
    var(--bg);
}
main { flex: 1; padding-block: 2rem 3rem; }
.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }

h1, h2, h3, h4, h5 { font-family: var(--serif); line-height: 1.25; color: var(--gold-2); font-weight: 600; }
h1 { font-size: 2rem; margin: 0 0 1rem; }
h2 { font-size: 1.4rem; margin: 1.8rem 0 .6rem; }
h3 { font-size: 1.15rem; margin: 1.4rem 0 .4rem; }
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: #fff; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
code { font-family: var(--mono); font-size: .9em; background: var(--bg-2); border: 1px solid var(--border); padding: .05em .35em; border-radius: 4px; }
pre { background: var(--bg-2); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; overflow-x: auto; }
pre code { background: none; border: 0; padding: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: rgb(13 10 20 / .85); }
.header-row { display: flex; align-items: center; gap: 1.5rem; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--gold); font: 600 1.25rem var(--serif); letter-spacing: .02em; }
.logo { width: 28px; height: 28px; color: var(--gold); }
.main-nav { display: flex; gap: .25rem; flex: 1; }
.main-nav a { color: var(--text); text-decoration: none; padding: .4rem .75rem; border-radius: 6px; }
.main-nav a:hover { background: var(--panel-2); }
.main-nav a[aria-current="page"] { background: var(--panel-2); color: var(--gold-2); }
.user-nav { display: flex; align-items: center; gap: .75rem; }
.user-chip { text-decoration: none; color: var(--text); }
.discord-link {
  display: inline-flex; align-items: center; gap: .4rem; text-decoration: none; font-weight: 600; font-size: .9rem;
  color: #fff; background: #5865f2; border-radius: 999px; padding: .3rem .8rem .3rem .65rem;
}
.discord-link:hover { color: #fff; background: #6d78f5; }
.discord-link svg { width: 16px; height: 16px; }
.user-chip small { color: var(--muted); margin-left: .25rem; }
form.inline { display: inline; margin: 0; }
.link-button { background: none; border: 0; color: var(--link); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; text-underline-offset: 2px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; padding: 1.25rem 0; }

/* Panels & layout */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem 1.75rem; }
.panel + .panel { margin-top: 1.5rem; }
.panel > :first-child { margin-top: 0; }
.panel.narrow { max-width: 480px; margin-inline: auto; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.grid-2 > .panel { margin-top: 0; }
.callout { border: 1px solid var(--border); border-left: 3px solid var(--gold); background: var(--panel-2); border-radius: 8px; padding: .75rem 1.25rem; margin-top: 1.25rem; }
.callout h2 { margin-top: .25rem; }

/* Hero */
.hero { text-align: center; padding: 0 0 3rem; }
.splash {
  margin: 0 0 1.75rem; border-radius: 14px; overflow: hidden; position: relative;
  border: 1px solid #3a2c4d;
  box-shadow: 0 0 0 1px rgb(217 180 91 / .15), 0 20px 60px -10px rgb(139 92 246 / .45), 0 10px 30px rgb(0 0 0 / .6);
}
.splash img { display: block; width: 100%; height: auto; }
.splash::after { /* soft vignette so the art blends into the page */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 80px rgb(13 10 20 / .55);
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.hero h1 { font-size: clamp(2.5rem, 7vw, 4.5rem); margin: .25rem 0 .75rem; letter-spacing: .02em; text-shadow: 0 0 40px rgb(139 92 246 / .45); }
.eyebrow { text-transform: uppercase; letter-spacing: .2em; font-size: .8rem; color: var(--gold); margin: 0; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 40rem; margin: 0 auto 1.75rem; }
.actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
/* The game's status line (players online) and the Play now button in the header. */
.realm-status { text-align: center; margin: 0 0 1rem; color: var(--muted); }
.realm-status.up strong { color: var(--ok); }
.realm-status.down { color: var(--muted); font-style: italic; }
.user-nav .play-now { margin-left: .25rem; }

/* Buttons */
.button {
  display: inline-block; cursor: pointer; text-decoration: none; font: 600 .95rem var(--sans);
  color: #1b1206; background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border: 1px solid #b8913a; border-radius: 8px; padding: .55rem 1.15rem;
}
.button:hover { color: #000; filter: brightness(1.08); }
.button.ghost { background: transparent; color: var(--gold-2); border-color: var(--gold); }
.button.ghost:hover { background: rgb(217 180 91 / .1); color: #fff; }
.button.small { padding: .3rem .7rem; font-size: .85rem; }
.button.danger { background: var(--danger); border-color: #a33; color: #fff; }

/* Forms */
.stack { display: flex; flex-direction: column; gap: 1rem; }
.stack.tight { gap: .5rem; }
.row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.row.tight { gap: .4rem; flex-wrap: nowrap; }
.push-right { margin-left: auto; }
label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .9rem; }
label.check { flex-direction: row; align-items: center; font-weight: 400; }
input, textarea, select {
  font: 400 1rem var(--sans); color: var(--text); background: var(--bg-2);
  border: 1px solid var(--border); border-radius: 6px; padding: .55rem .7rem; width: 100%;
}
label.check input { width: auto; }
select { width: auto; padding: .3rem .5rem; font-size: .9rem; }
textarea { font-family: var(--mono); font-size: .92rem; line-height: 1.5; resize: vertical; }
input:focus, textarea:focus, select:focus, .button:focus-visible, a:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; }
.hint { color: var(--muted); font-size: .85rem; margin: -.5rem 0 0; }

/* Messages */
.notice, .error { border-radius: 8px; padding: .65rem 1rem; margin: 1rem 0 0; }
.notice { background: rgb(127 209 168 / .1); border: 1px solid rgb(127 209 168 / .35); color: var(--ok); }
.error { background: rgb(226 85 85 / .1); border: 1px solid rgb(226 85 85 / .4); color: #ffb3b3; margin: 0; }

/* Lists & tables */
ul.plain, ul.results { list-style: none; padding: 0; margin: 0; }
ul.plain li, ul.results li { padding: .4rem 0; border-bottom: 1px solid var(--border); }
ul.plain li:last-child { border-bottom: 0; }
ul.columns { columns: 3 220px; padding-left: 1.2rem; }
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: .5rem .75rem; border-bottom: 1px solid var(--border); vertical-align: top; }
th { color: var(--gold-2); font-family: var(--serif); background: var(--panel-2); }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

/* Wiki */
.wiki-layout { display: grid; grid-template-columns: 220px 1fr; gap: 1.5rem; align-items: start; }
.wiki-side { display: flex; flex-direction: column; gap: 1.25rem; position: sticky; top: 1rem; }
.side-links { display: flex; flex-direction: column; gap: .15rem; }
.side-links a { text-decoration: none; padding: .3rem .5rem; border-radius: 6px; color: var(--text); }
.side-links a:hover { background: var(--panel-2); color: var(--gold-2); }
.page-tools { border-top: 1px solid var(--border); padding-top: .75rem; }
.wiki-article { min-width: 0; }
.wiki-body { font-size: 1.02rem; }
.wiki-body blockquote { margin: 1rem 0; padding: .6rem 1rem; border-left: 3px solid var(--violet); background: var(--panel-2); border-radius: 0 6px 6px 0; color: var(--text); }
.wiki-body a.missing { color: var(--missing); }
.wiki-body a.external::after { content: " ↗"; font-size: .8em; }
.page-meta { color: var(--muted); font-size: .85rem; border-top: 1px solid var(--border); margin-top: 2rem; padding-top: .75rem; }
.preview { border: 1px dashed var(--gold); border-radius: 8px; padding: 1rem 1.25rem; margin-bottom: 1.5rem; }
.preview-label { margin: 0 0 .5rem; color: var(--gold); font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; }
.danger-zone { margin-top: 2rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.danger-zone summary { cursor: pointer; color: var(--missing); }
.danger-zone form { margin-top: .75rem; }

@media (max-width: 760px) {
  .wiki-layout { grid-template-columns: 1fr; }
  .wiki-side { position: static; }
  .main-nav { order: 3; flex-basis: 100%; }
  .panel { padding: 1.25rem; }
}

/* Character pages and leaderboards */
.row.spread { justify-content: space-between; }
.search-form input { width: 14rem; max-width: 100%; }
.tabs { display: flex; flex-wrap: wrap; gap: .25rem; border-bottom: 1px solid var(--border); margin: 1rem 0 .75rem; }
.tabs a { padding: .45rem .9rem; border-radius: 8px 8px 0 0; color: var(--muted); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--gold-2); background: var(--panel-2); border: 1px solid var(--border); border-bottom-color: var(--panel-2); margin-bottom: -1px; }
th.num, td.num { text-align: right; white-space: nowrap; }
.board td.rank { color: var(--gold); font-family: var(--serif); }
.board tbody tr:nth-child(-n+3) td.rank { color: var(--gold-2); font-weight: 700; }
.char-head h1 { margin-bottom: .25rem; }
.char-title { color: var(--gold); font-size: .6em; font-weight: 400; }
.tag { font-size: .45em; vertical-align: middle; border: 1px solid var(--violet); color: var(--link); border-radius: 6px; padding: .1rem .45rem; }
.seen { margin: .25rem 0 0; }
.online-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--ok); margin-right: .45rem; vertical-align: middle; }
.points { color: var(--gold-2); font-size: 1.3rem; }
.cat-progress li { display: grid; grid-template-columns: minmax(10rem, 16rem) 1fr 4.5rem; align-items: center; gap: .75rem; padding: .2rem 0; }
.cat-progress progress { width: 100%; height: .55rem; appearance: none; border: 0; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.cat-progress progress::-webkit-progress-bar { background: var(--panel-2); }
.cat-progress progress::-webkit-progress-value { background: var(--gold); }
.cat-progress progress::-moz-progress-bar { background: var(--gold); }
@media (max-width: 640px) { .cat-progress li { grid-template-columns: 1fr 4rem; } .cat-progress progress { grid-column: 1 / -1; grid-row: 2; } }

/* News: player update notes from the game (UPDATES.md there) */
.update + .update { margin-top: 1.1rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.update h2, .update h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.news-page .update h2 { font-size: 1.25rem; }
.update time { color: var(--gold); }
.update-title { font-weight: normal; }
.update ul { margin: 0; padding-left: 1.2rem; }
.update li + li { margin-top: .25rem; }

/* The realm in numbers: the home page's panel and /world (v0.1-00008). */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: .75rem; margin: .5rem 0 1rem; }
.stat { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: .75rem 1rem; display: flex; flex-direction: column; gap: .15rem; }
.stat-value { font: 600 1.6rem var(--serif); color: var(--gold-2); line-height: 1.1; }
.stat-label { color: var(--muted); font-size: .85rem; }
.realm-panel { margin-bottom: 1.5rem; }
.realm-panel .more { margin: 0; text-align: right; }
.world-page dl.facts { margin-bottom: .5rem; }

/* ── The wiki's game pages (v1.0-00014) ── */
.crumbs { margin: 0 0 .5rem; font-size: .85rem; }
.crumbs a { color: var(--muted); }
.game-text { font-style: italic; color: var(--text); }
blockquote.game-text { margin: 1rem 0; padding: .6rem 1rem; border-left: 3px solid var(--violet); background: var(--panel-2); border-radius: 0 6px 6px 0; }
.game-text p { margin: .4rem 0; }
.wiki-article dl.facts { margin: 1rem 0; }
.game-notes { margin-top: 2rem; border-top: 1px solid var(--border); padding-top: .5rem; }
.wiki-article .tabs { font-size: .9rem; }
.rar { text-transform: capitalize; }
.rar-common { color: #c9c4d6; }
.rar-uncommon { color: #7fd17f; }
.rar-rare { color: #6fa8ff; }
.rar-epic { color: #c084fc; }
.rar-legendary { color: #f0a040; }
