:root {
    --bg-deep: #0a0b0f;
    --bg-card: #12141c;
    --bg-elevated: #181b26;
    --border: rgba(255, 255, 255, 0.06);
    --text: #e8eaef;
    --muted: #8b92a8;
    --accent: #e85d4c;
    --accent-dim: #c94a3b;
    --glow: rgba(232, 93, 76, 0.35);
    --font-sans: "DM Sans", system-ui, sans-serif;
    --font-display: "Outfit", var(--font-sans);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg-deep);
    background-image:
        radial-gradient(ellipse 120% 80% at 50% -30%, rgba(232, 93, 76, 0.12), transparent 55%),
        radial-gradient(ellipse 80% 50% at 100% 0%, rgba(80, 120, 255, 0.06), transparent 45%);
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--accent);
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
    background: rgba(10, 11, 15, 0.85);
    backdrop-filter: blur(12px);
}

.topbar-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-mark {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.brand-sub {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--muted);
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.nav-link {
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--muted);
    transition: color 0.15s, background 0.15s;
}

.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.nav-link.active {
    color: var(--text);
    background: rgba(232, 93, 76, 0.12);
}

.nav-cta {
    margin-left: 0.35rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-dim));
    color: #fff !important;
    font-weight: 600;
}

.nav-cta:hover {
    filter: brightness(1.08);
    color: #fff !important;
}

.nav-toggle {
    display: none;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
}

@media (max-width: 860px) {
    .nav-toggle {
        display: block;
    }

    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        padding: 0.75rem 1rem 1rem;
        background: rgba(10, 11, 15, 0.98);
        border-bottom: 1px solid var(--border);
        gap: 0.25rem;
    }

    .nav.is-open {
        display: flex;
    }

    .nav-cta {
        margin-left: 0;
        text-align: center;
    }
}

.main {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.25rem 4rem;
}

.hero {
    position: relative;
    padding: 3.5rem 0 2.5rem;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    width: 420px;
    height: 420px;
    left: 50%;
    top: 20%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, var(--glow), transparent 65%);
    pointer-events: none;
    opacity: 0.7;
}

.hero-inner {
    position: relative;
    text-align: center;
    max-width: 640px;
    margin: 0 auto;
}

.hero-eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent);
    margin: 0 0 0.75rem;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(2.25rem, 5vw, 3.25rem);
    letter-spacing: -0.03em;
    margin: 0 0 1rem;
    line-height: 1.1;
}

.hero-title-accent {
    display: block;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.55em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 0.35rem;
}

.hero-lead {
    color: var(--muted);
    margin: 0 0 1.75rem;
    font-size: 1.05rem;
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.65rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    min-width: 100px;
}

.stat-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--accent);
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--muted);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.35rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid transparent;
    transition: transform 0.12s, filter 0.12s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-dim));
    color: #fff;
}

.btn-primary:hover {
    filter: brightness(1.08);
    color: #fff;
}

.btn-secondary {
    background: var(--bg-elevated);
    border-color: var(--border);
    color: var(--text);
}

.btn-secondary:hover {
    border-color: rgba(232, 93, 76, 0.35);
    color: var(--text);
}

.feed {
    margin-top: 1rem;
}

.feed-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.feed-header h2 {
    font-family: var(--font-display);
    font-size: 1.35rem;
    margin: 0 0 0.35rem;
}

.feed-sub {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.post {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.35rem 1.5rem;
    margin-bottom: 1rem;
    transition: border-color 0.15s;
}

.post:hover {
    border-color: rgba(232, 93, 76, 0.2);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.85rem;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 0.65rem;
}

.post-badge {
    background: rgba(232, 93, 76, 0.15);
    color: var(--accent);
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.post-author {
    margin-left: auto;
}

.post-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin: 0 0 0.5rem;
}

.post-excerpt {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    padding: 2rem 1.25rem;
}

.footer-inner {
    max-width: 1120px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    font-family: var(--font-display);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-copy {
    margin: 0;
    font-size: 0.75rem;
    color: var(--muted);
    opacity: 0.85;
}

/* ----- Staff page (CavePvP-style sections) ----- */
.breadcrumb {
    padding: 1rem 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.breadcrumb-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.breadcrumb-list li:not(:last-child)::after {
    content: "/";
    margin-left: 0.35rem;
    opacity: 0.45;
    pointer-events: none;
}

.page-head {
    padding: 1rem 0 2rem;
}

.page-title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
}

.page-lead {
    margin: 0;
    color: var(--muted);
    max-width: 520px;
}

.staff-page-head .hero-eyebrow {
    margin-bottom: 0.35rem;
}

.link-muted {
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.link-muted:hover {
    color: var(--accent);
}

.alert {
    padding: 1rem 1.15rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.alert-error {
    background: rgba(232, 93, 76, 0.1);
    border-color: rgba(232, 93, 76, 0.35);
}

.alert-error strong {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--accent);
}

.alert-hint {
    margin: 0.75rem 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.alert code {
    font-size: 0.8em;
    background: var(--bg-deep);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

.staff-page .staff-body {
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.staff-head-centered {
    text-align: center;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.staff-head-centered .page-lead {
    margin-left: auto;
    margin-right: auto;
}

.staff-head-centered .page-lead a {
    color: var(--accent);
}

.staff-rank-block {
    margin-bottom: 3rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.staff-rank-block:last-child {
    margin-bottom: 0;
}

/* Rank group label — uses --rank-accent from Mongo rank color (set on .staff-rank-block) */
.staff-rank-pill {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--rank-accent, var(--accent));
    margin: 0 0 1.5rem;
    padding: 0.45rem 1.35rem;
    border-radius: 999px;
    /* Fallback when color-mix() is unsupported */
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    border: 1px solid var(--rank-accent, var(--accent));
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.staff-rank-empty {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    max-width: 28rem;
}

@supports (background: color-mix(in srgb, red, blue)) {
    .staff-rank-pill {
        background: linear-gradient(
            145deg,
            color-mix(in srgb, var(--rank-accent, var(--accent)) 24%, transparent),
            color-mix(in srgb, var(--rank-accent, var(--accent)) 8%, transparent)
        );
        border: 1px solid color-mix(in srgb, var(--rank-accent, var(--accent)) 42%, transparent);
        box-shadow: 0 0 28px color-mix(in srgb, var(--rank-accent, var(--accent)) 18%, transparent);
    }
}

/*
 * Staff grid: exactly 4 slots per row (fixed card width). Flex + max-width centers the whole block
 * and centers short last rows (1–3 players), matching CavePvP-style staff pages.
 */
.staff-card-grid {
    --staff-cols: 4;
    --staff-gap: 1.5rem;
    --staff-card-width: 140px;
    list-style: none;
    margin: 0 auto;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-content: flex-start;
    gap: var(--staff-gap);
    width: 100%;
    max-width: calc(var(--staff-cols) * var(--staff-card-width) + (var(--staff-cols) - 1) * var(--staff-gap));
    box-sizing: border-box;
}

.staff-card {
    flex: 0 0 var(--staff-card-width);
    width: var(--staff-card-width);
    max-width: var(--staff-card-width);
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.staff-card-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: var(--staff-card-width);
    min-height: 0;
    padding: 0.85rem 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.28);
    overflow: hidden;
    box-sizing: border-box;
}

.staff-card-inner:hover {
    border-color: rgba(232, 93, 76, 0.35);
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}

/* MCStats-style bust: fixed width, height follows image (no square crop / stretch) */
.staff-head-wrap {
    --staff-bust-width: 118px;
    width: 100%;
    max-width: var(--staff-bust-width);
    height: auto;
    min-height: 0;
    flex: 0 0 auto;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.45);
    background: #1a1c24;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
}

.staff-mc-face {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    vertical-align: bottom;
    object-fit: contain;
    object-position: center bottom;
    flex-shrink: 0;
    image-rendering: auto;
}

.staff-ign {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text);
    margin: 0 0 0.2rem;
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    word-break: break-word;
}

.staff-rank-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--rank-accent, var(--accent));
    text-align: center;
    line-height: 1.3;
    margin: 0;
    padding-top: 0;
    opacity: 0.95;
}

/* Tablet: 3 per row, still centered */
@media (max-width: 720px) {
    .staff-card-grid {
        --staff-cols: 3;
        --staff-card-width: 128px;
        --staff-gap: 1.15rem;
        max-width: calc(var(--staff-cols) * var(--staff-card-width) + (var(--staff-cols) - 1) * var(--staff-gap));
    }

    .staff-head-wrap {
        --staff-bust-width: 108px;
    }
}

/* Phone: 2 per row */
@media (max-width: 480px) {
    .staff-card-grid {
        --staff-cols: 2;
        --staff-card-width: 118px;
        --staff-gap: 0.85rem;
        max-width: calc(var(--staff-cols) * var(--staff-card-width) + (var(--staff-cols) - 1) * var(--staff-gap));
    }

    .staff-head-wrap {
        --staff-bust-width: 96px;
    }

    .staff-ign {
        font-size: 0.82rem;
    }
}

.staff-empty {
    color: var(--muted);
    font-size: 0.95rem;
    max-width: 560px;
}

.staff-empty code {
    font-size: 0.85em;
    background: var(--bg-elevated);
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
}

/* ——— Nav: Register + session ——— */
.nav-cta-group {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0.35rem;
}

.nav-register {
    background: linear-gradient(135deg, #3d8bfd, #6366f1);
    color: #fff !important;
    font-weight: 700;
    box-shadow: 0 0 24px rgba(99, 102, 241, 0.35);
}

.nav-register:hover {
    filter: brightness(1.1);
    color: #fff !important;
}

.nav-register.active {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25), 0 0 24px rgba(99, 102, 241, 0.4);
}

.nav-session {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
}

.nav-session-name {
    font-size: 0.85rem;
    color: var(--muted);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-link-button {
    font: inherit;
    cursor: pointer;
    border: none;
    background: transparent;
    color: var(--muted);
}

.nav-link-button:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 860px) {
    .nav-cta-group {
        margin-left: 0;
        flex-direction: column;
        width: 100%;
    }

    .nav-register,
    .nav-cta {
        text-align: center;
        width: 100%;
    }

    .nav-session {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }
}

/* ——— Auth pages (register / login) ——— */
.auth-page {
    display: flex;
    justify-content: center;
    padding-top: 2rem;
    padding-bottom: 4rem;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    padding: 2rem 1.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.auth-card--wide {
    max-width: 480px;
}

.verification-code-panel {
    margin-bottom: 1.5rem;
    text-align: center;
}

.verification-code-lead {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    color: var(--muted);
}

.verification-code-digits {
    font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.35em;
    padding: 0.85rem 1rem;
    margin: 0 0 1.25rem;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--accent);
}

.verification-code-instructions {
    margin: 0 0 0.5rem;
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.5;
}

.verification-code-command {
    margin: 0 0 1rem;
}

.verification-code-command code {
    font-size: 1.05rem;
    padding: 0.45rem 0.75rem;
    background: var(--bg-deep);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.verification-code-after {
    margin: 0;
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.5;
}

.verification-code-after a {
    color: var(--accent);
    font-weight: 600;
}

.auth-eyebrow {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--accent);
    margin: 0 0 0.5rem;
    text-align: center;
}

.auth-title {
    font-family: var(--font-display);
    font-size: 1.65rem;
    font-weight: 700;
    margin: 0 0 0.65rem;
    text-align: center;
    letter-spacing: -0.02em;
}

.auth-lead {
    margin: 0 0 1.5rem;
    font-size: 0.92rem;
    color: var(--muted);
    text-align: center;
    line-height: 1.5;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.auth-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-top: 0.5rem;
}

.auth-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-deep);
    color: var(--text);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.auth-input:focus {
    outline: none;
    border-color: rgba(232, 93, 76, 0.45);
    box-shadow: 0 0 0 3px rgba(232, 93, 76, 0.12);
}

.auth-submit {
    width: 100%;
    margin-top: 1rem;
    justify-content: center;
    padding: 0.75rem 1rem;
    border: none;
    cursor: pointer;
}

.auth-foot {
    margin: 1.35rem 0 0;
    text-align: center;
    font-size: 0.9rem;
    color: var(--muted);
}

.auth-foot a {
    color: var(--accent);
    font-weight: 600;
}

.auth-hint {
    margin: 1rem 0 0;
    font-size: 0.8rem;
    color: var(--muted);
    text-align: center;
    line-height: 1.45;
}

.auth-hint code {
    font-size: 0.85em;
    background: var(--bg-deep);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
}

.alert-success {
    background: rgba(80, 200, 120, 0.12);
    border-color: rgba(80, 200, 120, 0.35);
    color: var(--text);
}

.link-inline {
    color: var(--accent);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.page-flash {
    margin-top: 1rem;
    margin-bottom: 0;
}

.error-page-card {
    text-align: center;
}

.error-page-reason {
    font-weight: 600;
    color: var(--text);
}

.error-page-message {
    font-size: 0.9rem;
    color: var(--muted);
    margin: 0.5rem 0 0;
}

.error-page-path {
    font-size: 0.82rem;
    margin-top: 1rem;
}

.error-page-path code {
    font-size: 0.85em;
    background: var(--bg-deep);
    padding: 0.2rem 0.45rem;
    border-radius: 6px;
}

.error-page-actions {
    margin-top: 1.5rem;
}

/* ——— Forums ——— */
.forum-page {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1.25rem 4rem;
}

.forum-page-head {
    margin-bottom: 2rem;
}

.forum-page-head-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.forum-create-btn {
    flex-shrink: 0;
    align-self: center;
}

.forum-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.forum-category-card {
    display: block;
    padding: 1.35rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    transition: border-color 0.15s, transform 0.15s;
}

.forum-category-card:hover {
    border-color: rgba(232, 93, 76, 0.35);
    transform: translateY(-2px);
}

.forum-category-card-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    margin: 0 0 0.35rem;
}

.forum-category-card-count {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.forum-thread-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.forum-thread-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    margin-bottom: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.forum-thread-row:hover {
    border-color: rgba(232, 93, 76, 0.25);
}

.forum-thread-title {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.forum-thread-meta {
    font-size: 0.82rem;
    color: var(--muted);
}

.forum-thread-rank-pill {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    background: color-mix(in srgb, var(--pill-accent, #888) 22%, transparent);
    color: var(--text);
    flex-shrink: 0;
}

.forum-empty,
.feed-empty {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.55;
}

.forum-post-article {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem 1.5rem;
    margin-bottom: 2rem;
}

.forum-post-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.forum-post-title {
    font-family: var(--font-display);
    font-size: 1.65rem;
    margin: 0 0 1.25rem;
    line-height: 1.2;
}

.forum-author-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-deep);
    border-radius: 12px;
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.forum-author-face {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
}

.forum-author-meta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.forum-author-ign {
    font-weight: 700;
    font-size: 1.05rem;
}

.forum-author-rank {
    font-size: 0.85rem;
    font-weight: 600;
}

.forum-author-time {
    font-size: 0.8rem;
    color: var(--muted);
}

.forum-post-body-pre {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.65;
    margin: 0;
}

.forum-post-delete-form {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.forum-delete-thread-btn {
    font-size: 0.85rem;
}

.forum-comments-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin: 0 0 1rem;
}

.forum-comment-list {
    list-style: none;
    margin: 0 0 2rem;
    padding: 0;
}

.forum-comment-item {
    margin-bottom: 1rem;
}

.forum-comment-inner {
    display: flex;
    gap: 0.85rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.forum-comment-face {
    width: 48px;
    height: 48px;
    border-radius: 8px;
}

.forum-comment-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 0.75rem;
    font-size: 0.82rem;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.forum-comment-head .forum-author-ign {
    font-size: 0.95rem;
    color: var(--text);
}

.forum-comment-text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.forum-comment-delete-form {
    margin-top: 0.5rem;
}

.forum-delete-btn {
    font-size: 0.78rem;
    padding: 0.25rem 0.5rem;
    color: #f07178;
    background: transparent;
    border: 1px solid rgba(240, 113, 120, 0.35);
    border-radius: 6px;
    cursor: pointer;
}

.forum-delete-btn:hover {
    background: rgba(240, 113, 120, 0.1);
}

.forum-reply-title {
    font-size: 1rem;
    margin: 0 0 0.75rem;
}

.forum-textarea {
    width: 100%;
    min-height: 120px;
    padding: 0.75rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--bg-deep);
    color: var(--text);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    margin-bottom: 0.75rem;
}

.forum-textarea:focus {
    outline: none;
    border-color: rgba(232, 93, 76, 0.45);
}

.forum-login-hint {
    color: var(--muted);
    font-size: 0.9rem;
}

.forum-compose-form {
    max-width: 100%;
}

.post-title a {
    color: inherit;
}

.post-title a:hover {
    color: var(--accent);
}

/* --- Battlegrounds leaderboards --- */
.battlegrounds-lb-page .page-lead code {
    font-size: 0.85em;
}

.leaderboard-switch {
    display: flex;
    gap: 0.65rem;
    margin: 0 0 1rem;
}

.leaderboard-switch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 8.25rem;
    padding: 0.5rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--muted);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.leaderboard-switch-btn:hover {
    border-color: rgba(232, 93, 76, 0.45);
    color: var(--text);
}

.leaderboard-switch-btn.is-active {
    color: #ffffff;
    border-color: rgba(232, 93, 76, 0.65);
    background: linear-gradient(180deg, rgba(232, 93, 76, 0.85), rgba(176, 22, 8, 0.9));
}

.leaderboards-subhead {
    margin: 0 0 1rem;
}

.leaderboards-subtitle {
    margin: 0;
    font-size: 1rem;
    color: var(--muted);
    font-weight: 600;
}

.leaderboards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
    align-items: start;
}

.leaderboard-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem 1.35rem;
}

.leaderboard-panel-title {
    font-family: var(--font-display);
    font-size: 1.05rem;
    margin: 0 0 1rem;
    color: var(--text);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.leaderboard-table th {
    text-align: left;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.5rem 0.65rem 0.65rem 0;
    border-bottom: 1px solid var(--border);
}

.leaderboard-table td {
    padding: 0.55rem 0.65rem 0.55rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.leaderboard-table tr:last-child td {
    border-bottom: none;
}

.lb-rank {
    width: 2.25rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.lb-player-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lb-avatar {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid var(--border);
    flex: 0 0 24px;
    image-rendering: pixelated;
}

.lb-val {
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
}

.leaderboard-empty {
    color: var(--muted);
    font-size: 0.88rem;
    padding: 0.75rem 0 !important;
}
