/* Mournhal: dark stone and gold (carried over from the old site's template). */
:root {
	--bg: #0c0e12;
	--bg-2: #14181f;
	--panel: #181d25;
	--panel-2: #1e242e;
	--line: #2a313d;
	--text: #d8dce3;
	--muted: #8d95a3;
	--gold: #d6a63c;
	--gold-2: #f0c561;
	--green: #4fbf6b;
	--red: #e0554f;
	--red-2: #f07a74;
	--discord: #5865f2;
	--radius: 6px;
	--font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
	--font-display: 'Cinzel', Georgia, serif;
	color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
	/* the artwork covers the whole viewport so no page ends in a flat band */
	background: var(--bg) url("img/hero.jpg") no-repeat center center fixed;
	background-size: cover;
	color: var(--text);
	font: 14px/1.55 var(--font-body);
	display: flex; flex-direction: column; min-height: 100vh;
}
body::before {
	content: "";
	position: fixed; inset: 0; z-index: -1;
	background: linear-gradient(180deg, rgba(12,14,18,0.50) 0%, rgba(12,14,18,0.78) 50%, rgba(12,14,18,0.86) 100%);
}
a { color: var(--gold-2); text-decoration: none; }
a:hover { color: #fff; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }
img { max-width: 100%; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; width: 100%; }
.muted { color: var(--muted); }
.gold { color: var(--gold-2); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--gold); color: #17120a; padding: 8px 12px; border-radius: var(--radius); }
.skip-link:focus { left: 8px; }

/* ---- top bar ------------------------------------------------------------ */
.topbar {
	position: sticky; top: 0; z-index: 50;
	background: rgba(12,14,18,0.85);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--line);
}
.topbar-inner { display: flex; align-items: center; gap: 22px; min-height: 56px; }
.brand { font: 700 22px/1 var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold-2); }
.topbar-status { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.topbar-status a { color: var(--text); }
.topbar-status strong { color: #fff; font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot-off { background: var(--red); }
.sep { width: 1px; height: 18px; background: var(--line); }
.topbar-account { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.login-inline, form.inline { display: flex; gap: 6px; margin: 0; }
.login-inline input {
	background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
	border-radius: var(--radius); padding: 6px 10px; width: 140px; font: inherit;
}
.login-inline input:focus { outline: none; border-color: var(--gold); }

/* ---- buttons ------------------------------------------------------------ */
.btn {
	display: inline-block; border-radius: var(--radius); padding: 7px 14px;
	font: 600 13px/1.2 var(--font-body); cursor: pointer; border: 1px solid transparent;
	transition: background .15s, border-color .15s, color .15s; text-align: center;
}
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-block { display: block; }
.btn-gold { background: var(--gold); color: #17120a; border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-2); color: #17120a; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--gold); color: #fff; }
.btn-outline { background: rgba(0,0,0,0.35); color: #fff; border-color: rgba(255,255,255,0.35); }
.btn-outline:hover { border-color: #fff; }
.btn-discord { background: var(--discord); color: #fff; border-color: var(--discord); }
.btn-discord:hover { background: #6d78ff; color: #fff; }
.btn-danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn-danger:hover { background: var(--red-2); color: #fff; }

/* ---- brand block (front page) ------------------------------------------ */
.brandbox { padding: 26px 20px 0; max-width: 460px; margin: 0 auto; width: 100%; }
.hero-kicker { color: var(--gold-2); font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; margin-bottom: 8px; }
.hero-title { font: 700 40px/1.05 var(--font-display); margin: 0 0 10px; color: #fff; letter-spacing: 0.06em; text-shadow: 0 4px 24px rgba(0,0,0,0.7); }
.hero-tagline { font-size: 14px; color: #e6e9ee; margin: 0 0 16px; text-shadow: 0 2px 8px rgba(0,0,0,0.8); }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
/* wide screens: pin it in the top-left corner beside the centred columns */
@media (min-width: 2120px) {
	.brandbox { position: absolute; top: 72px; left: 24px; margin: 0; max-width: 400px; padding: 20px 0 0; }
}

/* ---- layout ------------------------------------------------------------- */
.layout {
	display: grid; grid-template-columns: 220px minmax(0, 1fr) 260px; gap: 22px;
	padding-top: 26px; padding-bottom: 40px; align-items: start;
	flex: 1 1 auto; align-content: center;
}
.sidenav, .widgets { position: sticky; top: 72px; }
.sidenav-download { margin-bottom: 14px; }
.nav-group { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.nav-group-title {
	padding: 8px 12px; font: 700 12px/1 var(--font-display); letter-spacing: 0.14em; text-transform: uppercase;
	color: var(--gold-2); background: var(--panel-2); border-bottom: 1px solid var(--line);
}
.nav-link { display: block; padding: 7px 12px; color: var(--text); border-left: 2px solid transparent; font-size: 13px; }
.nav-link:hover { background: var(--panel-2); color: #fff; }
.nav-link.active { border-left-color: var(--gold); color: var(--gold-2); background: var(--panel-2); }
/* the staff panel stands apart from the player menu */
.nav-group-admin { border-color: rgba(224,85,79,0.45); }
.nav-group-admin .nav-group-title { color: var(--red-2); }

.content { min-width: 0; container-type: inline-size; }
.page-title { font: 700 26px/1.2 var(--font-display); color: #fff; margin: 0 0 14px; letter-spacing: 0.04em; }
.section-title { font: 700 18px/1.2 var(--font-display); color: #fff; margin: 22px 0 10px; letter-spacing: 0.04em; }
.content-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.content-box.narrow { max-width: 560px; }
.content-box > p:first-child { margin-top: 0; }
.content-box > p:last-child { margin-bottom: 0; }

/* ---- messages ----------------------------------------------------------- */
.flash, .alert { border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; border: 1px solid; }
.flash { background: rgba(79,191,107,0.10); border-color: rgba(79,191,107,0.45); color: #c9efd3; }
.alert-error { background: rgba(224,85,79,0.10); border-color: rgba(224,85,79,0.5); color: #f6c9c6; }

/* ---- news ---------------------------------------------------------------- */
.news-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; overflow: hidden; }
.news-card-head { padding: 14px 18px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.news-card-title { font: 700 18px/1.25 var(--font-display); margin: 0; color: #fff; }
.news-card-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.news-card-body { padding: 16px 18px; }
.prose p { margin: 0 0 10px; }
.prose h3, .prose h4 { font-family: var(--font-display); color: #fff; margin: 16px 0 8px; font-size: 16px; }
.prose ul, .prose ol { margin: 0 0 10px; padding-left: 22px; }
.prose li { margin-bottom: 5px; }
.prose strong { color: var(--gold-2); }

/* ---- widgets ------------------------------------------------------------ */
.widget { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; padding: 12px 14px; }
.widget-title { font: 700 12px/1 var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-2); margin-bottom: 10px; }
.widget-text { margin: 0 0 10px; font-size: 13px; }
.widget-more { display: block; margin-top: 8px; font-size: 12px; color: var(--muted); }
.widget-more:hover { color: var(--gold-2); }
.toplist { list-style: none; margin: 0; padding: 0; }
.toplist li { display: grid; grid-template-columns: 22px 1fr; column-gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.toplist li:last-child { border-bottom: 0; }
.toplist-rank { color: var(--gold); font-weight: 700; font-variant-numeric: tabular-nums; }
.toplist-name { color: #fff; font-weight: 600; }
.toplist-meta { grid-column: 2; color: var(--muted); font-size: 12px; }
.quarry { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; color: #fff; }
a.quarry:hover .quarry-name { color: var(--gold-2); }
.quarry-name { font-size: 15px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--muted); }
.txt-on { color: var(--green); }
.txt-off { color: var(--red); }

/* ---- tables ------------------------------------------------------------- */
.table-intro { margin: 0 0 12px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 8px 10px; background: var(--panel-2); color: var(--gold-2); font: 700 12px/1 var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .rank { color: var(--gold); font-weight: 700; width: 1%; }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.table .rank-row th { background: transparent; color: var(--gold-2); font: 700 13px/1.2 var(--font-display); letter-spacing: 0.04em; text-transform: none; padding-top: 14px; }
.table-foot { margin: 14px 0 0; font-size: 13px; }
.table-foot strong { color: var(--gold-2); }

/* ---- tabs and small labels ---------------------------------------------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tab { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); font-size: 13px; }
.tab:hover { border-color: var(--gold); color: #fff; }
.tab.active { border-color: var(--gold); color: var(--gold-2); background: var(--panel-2); }
.tag { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 11px; line-height: 18px; vertical-align: 1px; }
.tag-red { color: var(--red-2); border: 1px solid rgba(224,85,79,0.5); }
.guild-description { margin: 14px 0 0; white-space: pre-line; color: var(--text); line-height: 1.6; }

/* ---- forms -------------------------------------------------------------- */
.stack { display: flex; flex-direction: column; gap: 14px; align-items: stretch; }
.stack > .btn { align-self: flex-start; }
.field { margin: 0; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { display: block; font-weight: 600; color: #fff; margin-bottom: 5px; padding: 0; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=search], .field input[type=number], .field select {
	width: 100%; background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
	border-radius: var(--radius); padding: 9px 11px; font: inherit;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--gold); }
.field.has-error input { border-color: var(--red); }
.field-hint { color: var(--muted); font-size: 12px; margin-top: 5px; }
.stack > .field-hint { margin-top: -6px; }
.field-error { color: var(--red-2); font-size: 12px; margin-top: 5px; }
.form-section { font: 700 15px/1.2 var(--font-display); color: var(--gold-2); margin: 6px 0 -2px; letter-spacing: 0.06em; }
.choice-row { display: flex; gap: 18px; }
.field label.choice, label.choice { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; color: var(--text); cursor: pointer; }
.choice input { accent-color: var(--gold); width: 16px; height: 16px; margin: 0; }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-foot { margin: 16px 0 0; font-size: 13px; }
.filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.field-inline { min-width: 160px; }
.field-grow { flex: 1 1 240px; }

/* ---- character page ----------------------------------------------------- */
.details { margin: 0; }
.details > div { display: grid; grid-template-columns: 140px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.details > div:last-child { border-bottom: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; color: #fff; }
.deaths { list-style: none; margin: 0; padding: 0; }
.deaths li { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.deaths li:last-child { border-bottom: 0; }
.death-time { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- account page ------------------------------------------------------- */
.acc-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.acc-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px; overflow: hidden; }
.acc-panel-title {
	margin: 0; padding: 10px 14px; font: 700 13px/1 var(--font-display); letter-spacing: 0.08em; color: #fff;
	background: var(--panel-2); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px;
}
.acc-count { font: 600 11px/1 var(--font-body); color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 3px 7px; }
.acc-deleted { color: var(--red); }
.acc-links { display: flex; flex-direction: column; }
.acc-links a { padding: 9px 14px; border-bottom: 1px solid var(--line); color: var(--text); }
.acc-links a:last-child { border-bottom: 0; }
.acc-links a:hover { background: var(--panel-2); color: #fff; }
.acc-kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 13px; }
.acc-kv:last-child { border-bottom: 0; }
.acc-kv span { color: var(--muted); }
.acc-kv strong { color: #fff; font-weight: 500; text-align: right; overflow-wrap: anywhere; }
/* private values: dots plus a key button (site.js) */
/* a long value moves under its label instead of breaking mid-word */
.acc-kv { flex-wrap: wrap; }
.acc-kv strong { margin-left: auto; }
.secret { display: inline-flex; align-items: center; gap: 8px; }
.secret-mask { letter-spacing: 2px; color: var(--muted); }
.secret-value { overflow-wrap: anywhere; }
.secret-toggle {
	flex: none; white-space: nowrap;
	display: inline-flex; align-items: center; gap: 4px; background: transparent; cursor: pointer;
	border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted);
	padding: 2px 7px; font: 600 11px/1.4 var(--font-body);
}
.secret-toggle svg { width: 13px; height: 13px; }
.secret-toggle:hover, .secret-toggle[aria-pressed="true"] { color: var(--gold-2); border-color: var(--gold); }
/* side by side only when the middle column has room for both */
@container (max-width: 640px) { .acc-grid { grid-template-columns: 1fr; } }

/* ---- character cards (account page) ------------------------------------- */
.icon { width: 14px; height: 14px; flex: none; vertical-align: -2px; }
.btn .icon { margin-right: 5px; }
.btn-danger-ghost { background: transparent; color: var(--red-2); border-color: rgba(224,85,79,0.55); }
.btn-danger-ghost:hover { background: rgba(224,85,79,0.12); color: #fff; border-color: var(--red); }
.char-list { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 16px; }
.char-list-title { display: flex; align-items: center; gap: 9px; margin: 0 0 12px; font: 700 17px/1.2 var(--font-display); color: var(--gold-2); letter-spacing: 0.03em; }
.char-list-title .icon { width: 17px; height: 17px; color: var(--red-2); }
/* one compact row per character: outfit | name and details | level | buttons */
.char-row {
	display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
	padding: 7px 12px; margin-bottom: 7px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
}
.char-row.is-deleted { opacity: .55; }
.char-row .outfit { width: 40px; height: 40px; }
.char-name { font: 700 14px/1.25 var(--font-body); color: #fff; }
a.char-name:hover { color: var(--gold-2); }
.char-sub { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; color: var(--text); font-weight: 600; font-size: 12px; }
.char-sep { color: var(--line); font-size: 9px; }
.char-place { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.char-marker { width: 3px; height: 12px; border-radius: 2px; background: var(--muted); }
.char-marker.is-online { background: var(--green); box-shadow: 0 0 6px var(--green); }
.char-seen { color: var(--muted); font-weight: 400; white-space: nowrap; }
.char-guild { margin-top: 1px; font-size: 12px; color: var(--muted); }
.char-level { display: flex; flex-direction: column; align-items: flex-end; min-width: 52px; }
.char-level-num { font: 700 19px/1 var(--font-body); color: var(--gold-2); font-variant-numeric: tabular-nums; }
.char-level-label { margin-top: 2px; font: 700 9px/1 var(--font-body); color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; }
.char-xp { margin-top: 4px; width: 52px; height: 5px; border: 1px solid var(--line); border-radius: 2px; background: var(--panel); overflow: hidden; appearance: none; -webkit-appearance: none; }
.char-xp::-webkit-progress-bar { background: var(--panel); }
.char-xp::-webkit-progress-value { background: var(--red); }
.char-xp::-moz-progress-bar { background: var(--red); }
.char-buttons { display: flex; gap: 5px; }
.btn-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; }
.btn-icon .icon { margin: 0; }
.char-list-foot { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.outfit { width: 64px; height: 64px; image-rendering: pixelated; display: block; }
.outfit-none { border: 1px dashed var(--line); border-radius: var(--radius); }
.outfit-small { width: 48px; height: 48px; }
.acc-invites { margin-bottom: 16px; }
.acc-invite { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.acc-invite:last-child { border-bottom: 0; }
.acc-panel-title .icon { color: var(--gold-2); }

/* ---- page heads, guild management --------------------------------------- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head .page-title { margin: 0; }
.page-head-start { justify-content: flex-start; }
.flash-error { background: rgba(224,85,79,0.10); border-color: rgba(224,85,79,0.5); color: #f6c9c6; }
.guild-mine { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.guild-mine-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.guild-mine > .btn { align-self: flex-start; }
.manage-intro { margin: -4px 0 14px; }
.manage-section { margin-bottom: 14px; }
.manage-title { font: 700 16px/1.2 var(--font-display); color: #fff; margin: 0 0 12px; letter-spacing: 0.03em; }
.manage-empty { margin: 12px 0 0; }
.manage-danger { border-color: rgba(224,85,79,0.45); }
.manage-list { list-style: none; margin: 12px 0; padding: 0; }
.manage-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line); }
.manage-list li:last-child { border-bottom: 0; }
.row-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin: 0; }
.manage-list .row-form { align-items: center; flex: 1 1 auto; }
.row-form > input[type=text], form.inline select, .row-form select, .field textarea {
	background: var(--bg-2); border: 1px solid var(--line); color: var(--text); border-radius: var(--radius); padding: 7px 10px; font: inherit;
}
.field textarea { width: 100%; resize: vertical; line-height: 1.5; }
.row-form > input[type=text] { flex: 1 1 160px; min-width: 0; }
.row-form input:focus, .row-form select:focus, form.inline select:focus, .field textarea:focus { outline: none; border-color: var(--gold); }
.rank-meta { font-size: 12px; }
form.inline { align-items: center; }

/* ---- character page: equipment and quests ------------------------------- */
.char-page { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; }
@container (max-width: 600px) { .char-page { grid-template-columns: 1fr; } .char-equipment { justify-self: center; } }
.equip {
	display: grid; grid-template-columns: repeat(3, 70px); gap: 6px;
	grid-template-areas: "necklace head backpack" "left armor right" "ring legs ammo" ". feet .";
}
.slot-necklace { grid-area: necklace; } .slot-head { grid-area: head; } .slot-backpack { grid-area: backpack; }
.slot-left { grid-area: left; } .slot-armor { grid-area: armor; } .slot-right { grid-area: right; }
.slot-ring { grid-area: ring; } .slot-legs { grid-area: legs; } .slot-ammo { grid-area: ammo; }
.slot-feet { grid-area: feet; }
.slot {
	position: relative; width: 70px; height: 70px; display: flex; align-items: center; justify-content: center;
	background: var(--bg-2); border: 1px solid var(--line); border-radius: 5px;
}
.slot img { width: 64px; height: 64px; image-rendering: pixelated; }
.slot-empty { font-size: 10px; color: var(--muted); opacity: .55; text-align: center; line-height: 1.2; padding: 0 4px; }
.slot-fallback { font-size: 10px; color: var(--text); text-align: center; line-height: 1.2; padding: 0 4px; overflow-wrap: anywhere; }
.slot-count { position: absolute; right: 4px; bottom: 2px; font: 700 11px/1 var(--font-body); color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.slot[tabindex]:hover, .slot[tabindex]:focus { border-color: var(--gold); outline: none; }
/* the item card: shown on hover, or on focus for keyboards and touch */
.slot-card {
	display: none; position: absolute; z-index: 30; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
	width: max-content; min-width: 170px; max-width: 240px; padding: 9px 11px; text-align: left;
	background: #0f1217; border: 1px solid var(--line); border-radius: var(--radius);
	box-shadow: 0 8px 22px rgba(0,0,0,.6); font-size: 12px; line-height: 1.45; color: var(--text);
}
.slot:hover .slot-card, .slot:focus .slot-card { display: block; }
.slot-card-name { display: block; font-size: 13px; color: #fff; margin-bottom: 2px; }
.slot-card-tier { margin-bottom: 4px; font-weight: 600; }
.slot-card-roll { color: #e8c66a; }
.slot-card-char { color: #7fb3ff; }
.slot-card-slot { margin-top: 5px; color: var(--muted); font-size: 11px; }
/* rarity, in the game's tooltip colours (data/scripts/lib/itemrolls.lua) */
.tier-1 { color: #3fd13f; } .tier-2 { color: #4a9fff; } .tier-3 { color: #ff5ce8; } .tier-4 { color: #ff9a2a; } .tier-5 { color: #ff5400; }
.tier-edge-1 { border-color: rgba(63,209,63,.6); } .tier-edge-2 { border-color: rgba(74,159,255,.65); }
.tier-edge-3 { border-color: rgba(255,92,232,.65); } .tier-edge-4 { border-color: rgba(255,154,42,.7); }
.tier-edge-5 { border-color: rgba(255,84,0,.75); }
.quest-summary { margin: 0 0 10px; }
.quest-list { list-style: none; margin: 0; padding: 0; columns: 2 220px; column-gap: 24px; }
.quest-list li { padding: 3px 0; break-inside: avoid; }
.quest-check { color: var(--green); margin-right: 7px; font-weight: 700; }

/* ---- character bazaar --------------------------------------------------- */
.notice { border: 1px solid rgba(214,166,60,0.55); background: rgba(214,166,60,0.08); color: var(--text); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 14px; }
.crumb { margin: 0 0 8px; font-size: 13px; }
.bazaar-intro { margin: -4px 0 14px; line-height: 1.6; }
.field-level { width: 96px; }
.auction-list { display: flex; flex-direction: column; gap: 7px; }
.auction-list .char-row { margin-bottom: 0; }
.auction-price { display: flex; flex-direction: column; align-items: flex-end; min-width: 92px; }
.auction-price-num { font: 700 17px/1 var(--font-body); color: #fff; font-variant-numeric: tabular-nums; }
.auction-now { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.auction-now-num { font: 700 30px/1 var(--font-body); color: var(--gold-2); font-variant-numeric: tabular-nums; }
.auction-now-label { color: var(--muted); }
.auction-note { margin: 12px 0 0; line-height: 1.55; }
.bid-form { margin-top: 14px; }
.bid-form label { display: block; font-weight: 600; color: #fff; margin-bottom: 5px; }
.bid-form .field-hint { margin: 6px 0 0; line-height: 1.5; }
.row-form > input[type=number] {
	flex: 1 1 140px; min-width: 0; background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
	border-radius: var(--radius); padding: 7px 10px; font: inherit;
}
.auction-facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@container (max-width: 600px) { .auction-facts { grid-template-columns: 1fr; } }
.bazaar-terms { margin: 0 0 14px; padding-left: 20px; line-height: 1.55; }
.bazaar-terms li { margin-bottom: 5px; }
.stack > .bazaar-terms { margin: -4px 0 0; font-size: 13px; }
.bazaar-empty { margin: 0 0 4px; }
.bazaar-sub { font: 700 13px/1.2 var(--font-display); letter-spacing: 0.06em; color: #fff; margin: 4px 0 6px; }
.bazaar-mine { list-style: none; margin: 0 0 10px; padding: 0; }
.bazaar-mine li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 7px 12px; margin-bottom: 6px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; }
.bazaar-mine a { font-weight: 700; color: #fff; }
.bazaar-mine a:hover { color: var(--gold-2); }
.bazaar-state { margin-left: auto; }
.bazaar-mine .btn { padding: 3px 10px; font-size: 12px; }
.withdraw-form { margin-top: 12px; }
.buy-now { margin-top: 12px; }
.buy-now .auction-note { margin-top: 0; }
.buy-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.withdraw-form .field-hint { margin: 6px 0 0; }

/* ---- news editor (staff) ------------------------------------------------ */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 14px; align-items: start; }
@container (max-width: 640px) { .editor-grid { grid-template-columns: 1fr; } }
.format-help dl { margin: 0 0 10px; font-size: 13px; }
.format-help dt { color: var(--gold-2); font-weight: 600; margin-top: 9px; }
.format-help dt:first-child { margin-top: 0; }
.format-help dd { margin: 2px 0 0; color: var(--text); }
.format-help code, .prose code { background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; color: #fff; font-size: 12px; }
.news-preview { border-color: var(--gold); }
.news-actions { display: inline-flex; gap: 6px; justify-content: flex-end; }
.tag-green { color: var(--green); border: 1px solid rgba(79,191,107,0.45); }
.tag-muted { color: var(--muted); border: 1px solid var(--line); }

/* ---- rules page --------------------------------------------------------- */
.rules-intro, .rules-outro { color: var(--muted); line-height: 1.6; }
.rules-intro { margin: 0 0 18px; padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); }
.rules-outro { margin: 18px 0 0; font-style: italic; }
.rules-section { margin: 0 0 16px; padding: 0 0 14px; border-bottom: 1px solid var(--line); }
.rules-section:last-of-type { border-bottom: 0; }
.rules-section h2 { font: 700 17px/1.2 var(--font-display); color: #fff; margin: 0 0 8px; display: flex; align-items: center; gap: 10px; }
.rules-no { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #17120a; font: 700 13px var(--font-body); flex: none; }
.rules-section p { margin: 0 0 8px; line-height: 1.6; }
.rules-items { margin: 0; padding-left: 20px; }
.rules-items li { margin: 0 0 7px; line-height: 1.55; }
.rules-items strong { color: var(--gold-2); }

/* ---- download page ------------------------------------------------------ */
.dl-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 20px; padding: 16px 18px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); }
.dl-name { font: 700 18px/1.2 var(--font-display); color: #fff; margin-bottom: 4px; }
.dl-meta { color: var(--muted); font-size: 13px; }
.dl-btn { padding: 10px 18px; }
.dl-steps { list-style: none; counter-reset: dl; margin: 0; padding: 0; }
.dl-steps li { counter-increment: dl; position: relative; padding: 0 0 12px 38px; line-height: 1.55; }
.dl-steps li::before { content: counter(dl); position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--gold); color: #17120a; font: 700 13px var(--font-body); }
.dl-steps strong { color: var(--gold-2); }

/* ---- library ------------------------------------------------------------ */
.lib-intro { margin: 0 0 14px; line-height: 1.6; }
.lib-search { display: flex; gap: 8px; margin: 0 0 16px; }
.lib-search input { flex: 1 1 auto; min-width: 0; padding: 9px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); color: #fff; font: inherit; }
.lib-search input:focus { outline: none; border-color: var(--gold); }
.lib-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.lib-tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); }
.lib-tile:hover { border-color: var(--gold); color: #fff; }
.lib-tile-pic { width: 48px; height: 48px; flex: none; image-rendering: pixelated; object-fit: contain; }
.lib-tile .lib-item-pic { width: 48px; height: 48px; }
.lib-tile-name { display: block; font: 700 15px/1.2 var(--font-display); color: #fff; letter-spacing: 0.03em; }
.lib-tile-count { display: block; margin-top: 3px; font-size: 12px; color: var(--muted); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.lib-card { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); text-align: center; }
.lib-card:hover { border-color: var(--gold); color: #fff; }
.lib-card-name { font-weight: 600; color: #fff; font-size: 13px; line-height: 1.25; }
.lib-card-sub { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lib-pic { width: 64px; height: 64px; image-rendering: pixelated; object-fit: contain; display: block; }
.lib-pic-lg { width: 128px; height: 128px; flex: none; }
.lib-pic-sm { width: 32px; height: 32px; flex: none; }
.lib-pic-none { display: inline-block; border: 1px dashed var(--line); border-radius: var(--radius); }
.lib-item-pic { width: 32px; height: 32px; image-rendering: pixelated; display: block; flex: none; }
.lib-item-pic-lg { width: 64px; height: 64px; }
.lib-stars { color: var(--gold); letter-spacing: 1px; font-size: 12px; }
.lib-stars-off { color: var(--line); }
.lib-head { display: flex; gap: 16px; align-items: center; margin: 0 0 14px; }
.lib-head .page-title { margin: 0 0 4px; }
.lib-head-sub { display: flex; align-items: center; gap: 8px; color: var(--muted); flex-wrap: wrap; }
.lib-voice { margin: 8px 0 0; color: var(--text); font-style: italic; }
.lib-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 6px 0 0; }
.lib-facts dt { color: var(--muted); font-size: 12px; }
.lib-facts dd { margin: 0; color: #fff; font-weight: 600; }
.lib-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
.lib-two > .content-box { margin-bottom: 0; }
@container (max-width: 680px) { .lib-two { grid-template-columns: 1fr; } }
.lib-list { list-style: none; margin: 0; padding: 0; }
.lib-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.lib-list li:last-child { border-bottom: 0; }
.lib-list strong { color: #fff; }
.lib-look li { color: #fff; }
.lib-sub { font: 700 14px/1.2 var(--font-display); color: var(--gold-2); margin: 16px 0 6px; letter-spacing: 0.03em; }
.lib-details-tight { margin-top: 10px; }
.lib-sub-first { margin-top: 0; }
.lib-elements { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.lib-element { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); }
.lib-element strong { font-size: 15px; color: #fff; font-variant-numeric: tabular-nums; }
.lib-element.is-weak strong { color: var(--red-2); }
.lib-element.is-strong strong { color: var(--green); }
.lib-element.is-immune strong { color: var(--gold-2); }
.el { font-weight: 600; }
.el-physical { color: #cfd4dc; } .el-fire { color: #ff7a3d; } .el-earth { color: #6ccf4f; }
.el-energy { color: #c47dff; } .el-ice { color: #7fd6ff; } .el-holy { color: #ffe27a; } .el-death { color: #b48aa8; }
.el-lifedrain { color: #e0554f; } .el-manadrain { color: #6f8fff; } .el-drown { color: #4fb3bf; }
.lib-source { display: inline-flex; align-items: center; gap: 8px; color: #fff; }
.lib-source:hover { color: var(--gold-2); }
.lib-items td { vertical-align: middle; }
.lib-pic-col { width: 44px; }
.lib-stats-cell { color: var(--text); }
.lib-variants { margin-left: 6px; font-size: 11px; }
.lib-vocations { font-size: 11px; color: var(--muted); margin-top: 2px; }
.lib-results { list-style: none; margin: 0; padding: 0; }
.lib-results li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.lib-results li:last-child { border-bottom: 0; }
.lib-kind { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.lib-badge { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid var(--line); border-radius: 4px; font-size: 10px; line-height: 16px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.lib-npc-list { list-style: none; margin: 0; padding: 0; columns: 3 200px; column-gap: 18px; }
.lib-npc-list li { break-inside: avoid; padding: 4px 0; display: flex; align-items: center; gap: 8px; }
.lib-npc-pic { flex: none; }
/* the name and its badges, centred on the picture; badges that do not fit wrap under the name */
.lib-npc-text { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; min-width: 0; }
.lib-npc-text .lib-badge { margin-left: 0; }
.lib-npc-name { color: #fff; }
.lib-npc-name:hover, .lib-npc-pic:hover + .lib-npc-text .lib-npc-name { color: var(--gold-2); }
.lib-quest-list { list-style: none; margin: 0; padding: 0; }
.lib-quest-list li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.lib-quest-list li:last-child { border-bottom: 0; }
.lib-quest-name { color: #fff; font-weight: 600; }
.lib-words { font: 13px/1 ui-monospace, Consolas, monospace; color: var(--gold-2); background: var(--bg-2); padding: 2px 6px; border-radius: 4px; white-space: nowrap; }
.lib-spell { color: #fff; font-weight: 600; }
.lib-teacher-list { margin-bottom: 16px; }
tr:target td { background: rgba(214,166,60,0.10); }

/* ---- footer ------------------------------------------------------------- */
.footer { border-top: 1px solid var(--line); padding: 18px 0 30px; color: var(--muted); font-size: 12px; text-align: center; margin-top: auto; }

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 1000px) {
	.layout { grid-template-columns: 200px minmax(0, 1fr); }
	.widgets { grid-column: 1 / -1; position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
	.widget { margin-bottom: 0; }
}
@media (max-width: 760px) {
	.wrap { padding: 0 16px; }
	.topbar { position: static; }
	.topbar-inner { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
	/* the side menu becomes one compact row of links above the page */
	.sidenav { display: flex; flex-wrap: wrap; gap: 6px; }
	.sidenav-download { width: 100%; margin-bottom: 4px; }
	.nav-group { display: contents; }
	.nav-group-title { display: none; }
	.nav-link { border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; background: var(--panel); }
	.nav-link.active { border-color: var(--gold); }
	.topbar-account { margin-left: 0; flex-wrap: wrap; width: 100%; }
	.login-inline { flex-wrap: wrap; width: 100%; }
	.login-inline input { flex: 1 1 120px; width: auto; }
	.layout { grid-template-columns: 1fr; padding-top: 18px; }
	.sidenav { position: static; }
	.hero-title { font-size: 34px; }
	.acc-grid { grid-template-columns: 1fr; }
	.details > div, .deaths li { grid-template-columns: 1fr; gap: 2px; }
	/* phones: the buttons move under the details */
	.char-row { grid-template-columns: 40px minmax(0, 1fr) auto; row-gap: 6px; padding: 7px 10px; }
	.char-buttons { grid-column: 2 / -1; justify-content: flex-end; }
	.auction-price { grid-column: 2 / -1; flex-direction: row-reverse; justify-content: flex-end; align-items: baseline; gap: 6px; }
	.auction-price-num { font-size: 15px; }
	.bazaar-state { margin-left: 0; }
	.char-list { padding: 10px; }
	.content-box { padding: 16px; }
}
