/* ============================================================================
   offsets-site — v3 "refined slate".

   Premium, restrained dark theme in the Linear / Vercel idiom: neutral zinc
   surfaces, a single indigo accent used sparingly, crisp 1px borders, minimal
   glow, tight spacing. Design lives here; templates stay clean. Flip a token
   to reskin.
   ============================================================================ */

:root {
    /* ── Surface palette (neutral zinc, no hue tint) ── */
    --bg:            #09090b;
    --bg-elev-1:     #0e0e11;
    --bg-elev-2:     #141417;
    --bg-elev-3:     #1a1a1f;
    --bg-elev-4:     #212127;
    --border:        #212127;
    --border-strong: #2c2c34;
    --border-focus:  #3f3f6b;

    /* ── Type palette ── */
    --text:          #e6e6ea;
    --text-strong:   #fafafa;
    --text-muted:    #9a9aa6;
    --text-dim:      #66666f;

    /* ── Accent palette (single restrained indigo) ── */
    --accent:        #6366f1;
    --accent-2:      #818cf8;
    --accent-3:      #a5b4fc;
    --accent-hover:  #7c7ef5;
    --accent-soft:   rgba(99, 102, 241, 0.14);
    --accent-glow:   rgba(99, 102, 241, 0.22);

    /* ── Signal colours ── */
    --danger:        #f05252;
    --warn:          #f0a020;
    --ok:            #34d399;
    --info:          #38bdf8;

    /* ── Shape (slightly tighter radii than v2) ── */
    --radius-xs:     4px;
    --radius-sm:     6px;
    --radius:        8px;
    --radius-lg:     12px;
    --radius-xl:     16px;

    /* ── Type ── */
    --font-sans:     'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    --font-mono:     'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --font-display:  'Inter', system-ui, sans-serif;

    /* ── Depth (subtle — premium restraint) ── */
    --shadow-sm:     0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md:     0 6px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg:     0 18px 48px rgba(0, 0, 0, 0.5);
    --shadow-glow:   0 0 0 1px var(--accent-soft);

    /* ── Layout ── */
    --wrap-max:      1200px;
    --wrap-max-doc:  1340px;
    --header-h:      56px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    /* Single, near-flat neutral wash — no coloured blobs. */
    background-image:
        radial-gradient(ellipse 90% 50% at 50% -20%, rgba(99, 102, 241, 0.05), transparent 70%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--accent-2); text-decoration: none; transition: color .12s ease; }
a:hover { color: var(--accent-3); }
.muted { color: var(--text-muted); }
.dim   { color: var(--text-dim); }
.mono  { font-family: var(--font-mono); }

.wrap {
    width: 100%;
    max-width: var(--wrap-max);
    margin: 0 auto;
    padding: 0 24px;
}
.wrap-doc { max-width: var(--wrap-max-doc); }

/* ─── header / nav ───────────────────────────────────────────────────────── */

.site-header {
    position: sticky; top: 0; z-index: 50;
    backdrop-filter: blur(14px) saturate(1.15);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
    background: rgba(9, 9, 11, 0.78);
    border-bottom: 1px solid var(--border);
}
.site-header-inner {
    display: flex; align-items: center; gap: 20px;
    height: var(--header-h);
}
.brand {
    display: flex; align-items: center; gap: 9px;
    color: var(--text-strong); font-weight: 700; letter-spacing: -0.03em; font-size: 15px;
    flex-shrink: 0;
}
.brand:hover { color: var(--text-strong); }
.brand-dot {
    display: inline-block; width: 8px; height: 8px; border-radius: 2px;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.site-nav {
    display: flex; align-items: center; gap: 2px;
    flex: 1;
}
.site-nav-end {
    flex: 0 0 auto;
    margin-left: auto;
    gap: 4px;
}
.site-nav a, .site-nav .link-btn, .nav-link-btn {
    color: var(--text-muted); font-weight: 500;
    padding: 7px 12px; border-radius: var(--radius-sm);
    font-size: 13.5px;
    transition: color .12s ease, background-color .12s ease;
}
.site-nav a:hover, .site-nav .link-btn:hover, .nav-link-btn:hover {
    color: var(--text); background: var(--bg-elev-2);
}
.site-nav a.is-active {
    color: var(--text-strong);
    background: var(--bg-elev-2);
}
.site-nav .nav-cta {
    color: #fff !important;
    background: var(--accent) !important;
    font-weight: 600;
    margin-left: 4px;
}
.site-nav .nav-cta:hover { background: var(--accent-hover) !important; color: #fff !important; }

.nav-user {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 4px 10px 4px 4px !important;
    border-radius: 999px !important;
    border: 1px solid var(--border);
    background: var(--bg-elev-1);
}
.nav-user:hover { border-color: var(--border-strong); }
.nav-user-name { font-size: 13px; font-weight: 550; color: var(--text); max-width: 120px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-avatar {
    width: 26px; height: 26px; border-radius: 50%; object-fit: cover;
    display: block; background: var(--bg-elev-3);
}
.nav-avatar-fallback {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--accent-soft); color: var(--accent-2);
    font-size: 12px; font-weight: 700;
}
.site-footer-inner {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.footer-nav { display: flex; gap: 14px; }
.footer-nav a { color: var(--text-dim); font-size: 13px; }
.footer-nav a:hover { color: var(--text-muted); }

@media (max-width: 720px) {
    .nav-user-name { display: none; }
    .site-nav { gap: 0; }
    .site-nav a { padding: 7px 8px; font-size: 13px; }
}

/* ─── generic elements ───────────────────────────────────────────────────── */

.link-btn {
    appearance: none; background: none; border: 0; padding: 0;
    color: inherit; cursor: pointer; font: inherit;
}
.link-btn.danger { color: var(--danger); }
.link-btn.danger:hover { color: #fca5a5; }

.primary-btn {
    appearance: none; border: 0; cursor: pointer;
    background: var(--accent); color: white; font-weight: 600;
    padding: 9px 16px; border-radius: var(--radius-sm);
    transition: background-color .12s ease, transform .06s ease;
    font-size: 14px;
}
.primary-btn:hover { background: var(--accent-hover); }
.primary-btn:active { transform: translateY(1px); }

.ghost-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--bg-elev-2); color: var(--text-muted);
    padding: 8px 13px; border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 13px; font-weight: 500;
    transition: color .12s ease, background-color .12s ease, border-color .12s ease;
}
.ghost-btn:hover { color: var(--text); background: var(--bg-elev-3); border-color: var(--border-strong); }

.pill {
    display: inline-flex; align-items: center;
    font-size: 11px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase;
    padding: 3px 8px; border-radius: var(--radius-xs);
    background: var(--bg-elev-3); color: var(--text-muted); border: 1px solid var(--border);
}
.pill.accent { background: var(--accent-soft); color: var(--accent-2); border-color: transparent; }
.pill.warn   { background: rgba(240, 160, 32, 0.14); color: var(--warn); border-color: transparent; }
.pill.ok     { background: rgba(52, 211, 153, 0.12); color: #6ee7b7; border-color: transparent; }
.pill.dot::before {
    content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%;
    background: currentColor; margin-right: 6px;
}

.eyebrow {
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.12em;
    font-size: 11px; font-weight: 650; margin-bottom: 14px;
}

/* Live pulse dot for "just updated" indicator. */
.pulse-dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: var(--ok); position: relative; margin-right: 8px;
}
.pulse-dot::after {
    content: ""; position: absolute; inset: -2px; border-radius: 50%;
    background: var(--ok); opacity: 0.55;
    animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
    0%   { transform: scale(1);   opacity: 0.45; }
    100% { transform: scale(2.2); opacity: 0;    }
}

/* ─── main / footer ──────────────────────────────────────────────────────── */

.site-main { flex: 1 1 auto; padding: 64px 0 88px; position: relative; z-index: 1; }

.site-footer {
    border-top: 1px solid var(--border); padding: 20px 0; color: var(--text-dim);
    font-size: 13px; position: relative; z-index: 1;
}
.site-footer .wrap {
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 12px;
}
.site-footer .foot-links a { color: var(--text-dim); margin-left: 18px; }
.site-footer .foot-links a:hover { color: var(--text-muted); }

/* ─── landing / hero ─────────────────────────────────────────────────────── */

.hero { margin-bottom: 40px; }
.hero-centered { text-align: center; }
.hero-centered .stats-strip { text-align: left; }

/* Restrained mono badge above the hero title (no blink theatre). */
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-family: var(--font-mono); font-size: 12px;
    color: var(--text-muted);
    padding: 5px 12px; border-radius: 999px;
    background: var(--bg-elev-1); border: 1px solid var(--border);
    margin-bottom: 22px;
    user-select: none;
}
.hero-eyebrow .eyebrow-caret { color: var(--accent-2); font-weight: 700; }
.hero-eyebrow .eyebrow-cmd { color: var(--text-muted); }
.hero-eyebrow .eyebrow-cursor {
    display: inline-block; width: 6px; height: 13px;
    background: var(--accent-2); vertical-align: middle;
    animation: caret-blink 1.05s steps(2, start) infinite;
    margin-left: 1px; opacity: 0.8;
}
@keyframes caret-blink { to { visibility: hidden; } }

.hero-title {
    font-size: clamp(34px, 5vw, 58px);
    font-weight: 700; letter-spacing: -0.035em; line-height: 1.04;
    margin: 4px 0 16px;
    color: var(--text-strong);
    max-width: 820px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: geometricPrecision;
}
.hero-centered .hero-title { margin-left: auto; margin-right: auto; }
.hero-title .accent-word { color: var(--accent-2); }
.hero-sub {
    color: var(--text-muted); font-size: 17px; max-width: 600px; margin: 0;
    line-height: 1.6;
}
.hero-centered .hero-sub { margin-left: auto; margin-right: auto; }

/* ── Stats strip under the hero ── */
.stats-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin: 30px auto 40px;
    max-width: 680px;
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.stats-strip.stats-strip-4 {
    grid-template-columns: repeat(4, 1fr);
    max-width: 880px;
}
.stat {
    padding: 16px 20px;
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 5px;
}
.stat:last-child { border-right: 0; }
.stat-label {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--text-dim); font-weight: 600;
}
.stat-value {
    font-family: var(--font-display); font-size: 22px; font-weight: 650;
    color: var(--text-strong); letter-spacing: -0.02em; line-height: 1.1;
    display: flex; align-items: center; gap: 8px;
}
@media (max-width: 640px) {
    .stats-strip,
    .stats-strip.stats-strip-4 { grid-template-columns: 1fr; }
    .stat { border-right: 0; border-bottom: 1px solid var(--border); }
    .stat:last-child { border-bottom: 0; }
}

/* ── Section header ── */
.section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    margin: 4px 0 18px; gap: 12px; flex-wrap: wrap;
}
.section-head h2 {
    margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -0.01em;
    color: var(--text-strong);
    text-transform: uppercase; letter-spacing: 0.08em;
}
.section-head .section-sub { color: var(--text-dim); font-size: 13px; }

/* ── Game cards ── */
.game-grid {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.game-card {
    display: flex; flex-direction: column; gap: 10px;
    padding: 20px 20px 16px; background: var(--bg-elev-1);
    border: 1px solid var(--border); border-radius: var(--radius-lg);
    color: var(--text);
    transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
    position: relative; overflow: hidden;

    /* Staggered fade-in on load. --stagger is the loop index from the template. */
    opacity: 0;
    transform: translateY(6px);
    animation: card-in .45s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
    animation-delay: calc(var(--stagger, 0) * 50ms + 40ms);
}
@keyframes card-in {
    to { opacity: 1; transform: translateY(0); }
}
/* Thin per-game accent rail on the left, revealed on hover. */
.game-card::before {
    content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
    background: var(--accent);
    transform: scaleY(0); transform-origin: top;
    transition: transform .18s ease;
}
.game-card:hover {
    transform: translateY(-2px); border-color: var(--border-strong);
    background: var(--bg-elev-2);
}
.game-card:hover::before { transform: scaleY(1); }

.game-card-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
}
.game-card-name {
    font-size: 18px; font-weight: 650; letter-spacing: -0.02em;
    color: var(--text-strong);
    line-height: 1.2;
    display: flex; align-items: center; gap: 9px;
}
/* Small per-game colour token before the name. */
.game-card-name::before {
    content: ""; width: 8px; height: 8px; border-radius: 2px;
    background: var(--accent); flex: none;
}
.game-card-badge {
    font-family: var(--font-mono); font-size: 11px; font-weight: 550;
    background: var(--bg-elev-3); color: var(--text-muted);
    padding: 3px 8px; border-radius: var(--radius-xs); white-space: nowrap;
    border: 1px solid var(--border);
}
.game-card-badge.muted { color: var(--text-dim); }
.game-card-tagline {
    margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.5;
    min-height: 1.5em;
    font-family: var(--font-mono); letter-spacing: -0.01em;
}
.game-card-foot {
    display: flex; align-items: center; gap: 10px;
    margin-top: auto; padding-top: 12px;
    color: var(--text-dim); font-size: 12px;
    border-top: 1px solid var(--border);
    font-family: var(--font-mono);
    letter-spacing: 0.01em;
}
.game-card-count { color: var(--text-muted); }
.game-card-updated { color: var(--text-dim); margin-left: auto; }
.game-card-foot .arrow {
    color: var(--text-dim); font-weight: 600; transition: transform .16s ease, color .16s ease;
    font-family: var(--font-mono); font-size: 14px;
}
.game-card:hover .arrow { transform: translateX(3px); color: var(--accent-2); }

/* Respect reduced-motion for the staggered card entry + cursor. */
@media (prefers-reduced-motion: reduce) {
    .game-card {
        opacity: 1; transform: none; animation: none;
    }
    .hero-eyebrow .eyebrow-cursor { animation: none; }
}

/* ─── game hero (per-game page) ──────────────────────────────────────────── */

.game-hero {
    padding: 40px 0 28px; margin-bottom: 32px;
    border-bottom: 1px solid var(--border);
    position: relative; overflow: hidden;
}
/* Faint per-game colour bleed from the top — subtle, not a spotlight. */
.game-hero::before {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(
        180deg,
        color-mix(in oklab, var(--accent, #6366f1) 10%, transparent) 0%,
        transparent 70%
    );
    pointer-events: none;
}
.game-title {
    font-size: clamp(30px, 4.5vw, 46px);
    font-weight: 700; letter-spacing: -0.03em; margin: 8px 0 14px;
    color: var(--text-strong);
    position: relative;
}
.game-hero-meta {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    font-size: 14px; color: var(--text-muted); position: relative;
}
.pinned-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pinned-version { font-family: var(--font-mono); font-weight: 600; color: var(--text); }
.pinned-label   { color: var(--text-muted); }
.game-hero-meta .sep { color: var(--text-dim); }

.crumb {
    color: var(--text-muted); font-weight: 500;
    display: inline-flex; align-items: center; gap: 6px;
}
.crumb:hover { color: var(--accent-2); }
.crumb-arrow { color: var(--text-dim); font-family: var(--font-mono); }

/* ── Doc layout: 3-column ── TOC | article | history ── */
.doc-layout {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 250px;
    gap: 40px;
    align-items: start;
}
.doc-layout.two-col { grid-template-columns: minmax(0, 1fr) 250px; }
.doc-layout.one-col { grid-template-columns: 220px minmax(0, 1fr); }
.doc-layout.no-sidebars { grid-template-columns: minmax(0, 1fr); }

.build-main { min-width: 0; }

@media (max-width: 1100px) {
    .doc-layout, .doc-layout.two-col, .doc-layout.one-col {
        grid-template-columns: 1fr;
    }
    .toc, .history { position: static !important; }
}

/* ─── TOC sidebar ────────────────────────────────────────────────────────── */

.toc {
    position: sticky; top: calc(var(--header-h) + 24px);
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px 2px 2px 0;
    font-size: 13px;
}
.toc-title {
    margin: 0 0 12px; font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.09em; color: var(--text-dim); font-weight: 650;
}
.toc-list { list-style: none; padding: 0; margin: 0; }
.toc-list li { margin: 0; }
.toc-list a {
    display: block; padding: 5px 12px; margin: 1px 0;
    border-radius: 0;
    color: var(--text-dim); font-weight: 500;
    line-height: 1.4; font-size: 13px;
    transition: color .12s ease, border-color .12s ease;
    border-left: 2px solid var(--border);
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.toc-list a:hover { color: var(--text); border-left-color: var(--border-strong); }
.toc-list a.active {
    color: var(--text-strong); border-left-color: var(--accent);
    font-weight: 550;
}
.toc-list li.toc-h3 a { padding-left: 24px; font-size: 12px; color: var(--text-dim); }
.toc-list li.toc-h4 a { padding-left: 36px; font-size: 12px; color: var(--text-dim); }
.toc-empty { color: var(--text-dim); font-size: 12px; padding-left: 12px; }

/* ─── build toolbar (search + actions) ───────────────────────────────────── */

.build-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 20px; flex-wrap: wrap;
}
.search-input {
    flex: 1 1 300px; max-width: 520px;
    background: var(--bg-elev-1); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 9px 14px 9px 38px; font-size: 14px; font-family: inherit;
    transition: border-color .12s ease, background-color .12s ease;

    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239a9aa6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='8'/><path d='M21 21l-4.35-4.35'/></svg>");
    background-repeat: no-repeat;
    background-position: 12px center;
}
.search-input:focus {
    outline: none; border-color: var(--border-focus); background-color: var(--bg-elev-2);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.build-actions { display: flex; gap: 8px; }

/* ─── markdown body ──────────────────────────────────────────────────────── */

.markdown-body { font-size: 15px; }
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    letter-spacing: -0.02em; line-height: 1.3;
    margin: 36px 0 14px; scroll-margin-top: calc(var(--header-h) + 24px);
    color: var(--text-strong);
    font-weight: 650;
}
.markdown-body h1 { font-size: 26px; }
.markdown-body h2 {
    font-size: 19px; padding-top: 22px;
    border-top: 1px solid var(--border);
    position: relative;
}
.markdown-body h3 { font-size: 16px; }
.markdown-body h4 {
    font-size: 12px; color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.07em; font-weight: 650;
}

.markdown-body p, .markdown-body ul, .markdown-body ol { margin: 12px 0; }
.markdown-body ul, .markdown-body ol { padding-left: 22px; }
.markdown-body li { margin: 4px 0; }
.markdown-body strong { color: var(--text-strong); font-weight: 650; }
.markdown-body em { color: var(--text); }
.markdown-body a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border-strong); }
.markdown-body a:hover { text-decoration-color: var(--accent); }

/* Anchor link on headings (from python-markdown toc extension). */
.markdown-body h1 a, .markdown-body h2 a, .markdown-body h3 a,
.markdown-body h4 a, .markdown-body h5 a, .markdown-body h6 a,
.markdown-body .heading-anchor {
    color: inherit; text-decoration: none;
}
.markdown-body h2 a:hover, .markdown-body h3 a:hover,
.markdown-body h4 a:hover { color: var(--accent-2); }

.markdown-body code:not(pre code) {
    font-family: var(--font-mono); font-size: 0.86em;
    background: var(--bg-elev-3); color: var(--accent-2);
    padding: 2px 6px; border-radius: 4px; border: 1px solid var(--border);
}

.markdown-body blockquote {
    margin: 18px 0; padding: 12px 18px; color: var(--text-muted);
    border-left: 2px solid var(--accent); background: var(--bg-elev-1);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.markdown-body blockquote p { margin: 4px 0; }

.markdown-body table {
    width: 100%; border-collapse: collapse; margin: 18px 0;
    font-family: var(--font-mono); font-size: 13px;
    border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
.markdown-body th, .markdown-body td {
    padding: 8px 12px; border: 1px solid var(--border); text-align: left;
}
.markdown-body th {
    background: var(--bg-elev-2); color: var(--text-muted); font-weight: 600;
    text-transform: uppercase; font-size: 11px; letter-spacing: 0.05em;
}
.markdown-body tr:nth-child(2n) td { background: var(--bg-elev-1); }

/* ── Code blocks ── */
.markdown-body pre {
    position: relative;
    margin: 18px 0;
    padding: 38px 16px 16px;
    background: #0b0b0e !important;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
}
.markdown-body pre code {
    font-family: inherit; background: transparent !important; padding: 0 !important;
    color: var(--text);
}

/* Language label on top-left of the code block. Set via copy.js when we
   detect a `language-xxx` class on the child <code>. */
.code-lang {
    position: absolute; top: 10px; left: 14px;
    font-family: var(--font-mono); font-size: 10px; font-weight: 600;
    letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--text-dim); user-select: none;
}

/* Copy button injected by copy.js. Shown always at low opacity on desktop
   so it's not a hover-discovery mystery. */
.copy-btn {
    position: absolute; top: 8px; right: 8px;
    background: var(--bg-elev-3);
    color: var(--text-muted);
    border: 1px solid var(--border); border-radius: var(--radius-xs);
    padding: 4px 10px; font-size: 11px; font-weight: 600;
    font-family: var(--font-sans);
    letter-spacing: 0.03em; text-transform: uppercase;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity .12s ease, color .12s ease, background-color .12s ease, border-color .12s ease;
}
.markdown-body pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--text-strong); background: var(--accent); border-color: var(--accent); }
.copy-btn.copied { color: var(--ok); border-color: var(--ok); background: rgba(52, 211, 153, 0.12); }

.markdown-body .search-hidden { display: none; }

/* ─── history sidebar (per-game page) ───────────────────────────────────── */

.history {
    position: sticky; top: calc(var(--header-h) + 24px);
    background: var(--bg-elev-1); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 16px;
    max-height: calc(100vh - var(--header-h) - 48px);
    overflow-y: auto;
}
.history-title {
    margin: 0 0 10px; font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.09em; color: var(--text-dim); font-weight: 650;
}
.history-list { list-style: none; padding: 0; margin: 0; }
.history-list li { margin: 0; }
.history-list a {
    display: flex; flex-direction: column; gap: 3px;
    padding: 9px 11px; margin: 2px 0;
    border-radius: var(--radius-sm); color: var(--text-muted);
    font-size: 13px; border: 1px solid transparent;
    transition: color .12s ease, background-color .12s ease, border-color .12s ease;
}
.history-list a:hover { color: var(--text); background: var(--bg-elev-2); }
.history-list a.active {
    color: var(--text); background: var(--bg-elev-2);
    border-color: var(--border);
    box-shadow: inset 2px 0 0 var(--accent);
}
.history-version { font-family: var(--font-mono); color: var(--text-strong); font-weight: 600; font-size: 13px; }
.history-label   { font-size: 12px; }
.history-date    { font-size: 11px; }

/* ─── prev/next build nav ────────────────────────────────────────────────── */

.build-nav {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
    margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border);
}
.build-nav a {
    display: flex; flex-direction: column; gap: 4px;
    padding: 13px 15px; background: var(--bg-elev-1);
    border: 1px solid var(--border); border-radius: var(--radius);
    color: var(--text-muted);
    transition: border-color .12s ease, background-color .12s ease;
}
.build-nav a:hover { border-color: var(--border-strong); background: var(--bg-elev-2); }
.build-nav .nav-side {
    font-size: 11px; color: var(--text-dim); text-transform: uppercase;
    letter-spacing: 0.09em; font-weight: 600;
}
.build-nav .nav-name {
    font-family: var(--font-mono); font-size: 14px; color: var(--text-strong);
    font-weight: 600;
}
.build-nav a.next { text-align: right; }
.build-nav .nav-empty {
    background: transparent; border: 1px dashed var(--border);
    pointer-events: none; opacity: 0.5;
}
@media (max-width: 640px) {
    .build-nav { grid-template-columns: 1fr; }
}

/* ─── empty state ────────────────────────────────────────────────────────── */

.empty-state {
    padding: 56px 20px; text-align: center;
    background: var(--bg-elev-1); border: 1px dashed var(--border);
    border-radius: var(--radius-lg);
}
.empty-title { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-sub   { color: var(--text-muted); }

/* ─── admin ──────────────────────────────────────────────────────────────── */

.admin-wrap { max-width: 1100px; }
.admin-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.admin-head h1 { font-size: 24px; font-weight: 700; margin: 0; color: var(--text-strong); letter-spacing: -0.02em; }
.admin-actions { display: flex; gap: 10px; }

.admin-game {
    background: var(--bg-elev-1); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px; margin-bottom: 18px;
    position: relative; overflow: hidden;
}
.admin-game::before {
    content: ""; position: absolute; left: 0; top: 0; width: 2px; height: 100%;
    background: var(--accent);
}
.admin-game-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 14px; gap: 12px;
}
.admin-game-head h2 { margin: 0; font-size: 17px; font-weight: 650; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
    text-align: left; padding: 10px 12px;
    color: var(--text-dim); font-weight: 600;
    border-bottom: 1px solid var(--border);
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
}
.admin-table td {
    padding: 12px; border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table tr:hover td { background: var(--bg-elev-2); }
.row-actions { text-align: right; }
.row-actions a, .row-actions .link-btn {
    color: var(--text-muted); margin-left: 12px; font-size: 13px;
}
.row-actions a:hover, .row-actions .link-btn:hover { color: var(--text); }
.row-actions .link-btn.danger:hover { color: var(--danger); }

.admin-pw {
    margin-top: 26px; padding: 18px;
    background: var(--bg-elev-1); border: 1px solid var(--border);
    border-radius: var(--radius-lg);
}
.admin-pw summary { cursor: pointer; user-select: none; color: var(--text-muted); font-size: 14px; font-weight: 500; }
.admin-pw summary:hover { color: var(--text); }
.admin-pw form { margin-top: 16px; max-width: 400px; }

.flash {
    padding: 11px 15px; border-radius: var(--radius-sm);
    margin-bottom: 16px; font-size: 14px; border: 1px solid transparent;
}
.flash.ok  { background: rgba(52, 211, 153, 0.08); color: #6ee7b7; border-color: rgba(52, 211, 153, 0.3); }
.flash.err { background: rgba(240, 82, 82, 0.08); color: #fca5a5; border-color: rgba(240, 82, 82, 0.3); }

/* ─── forms / editor ─────────────────────────────────────────────────────── */

.build-form {
    background: var(--bg-elev-1); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 22px;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 20px; margin-bottom: 20px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.form-grid label > span { color: var(--text-muted); }
.form-grid input, .form-grid select {
    background: var(--bg-elev-2); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 9px 12px; font-size: 14px; font-family: inherit;
    transition: border-color .12s ease, background-color .12s ease;
}
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus {
    outline: none; border-color: var(--border-focus); background: var(--bg-elev-3);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-grid input:disabled { color: var(--text-muted); cursor: not-allowed; }
.form-grid .span-full { grid-column: 1 / -1; }
.checkbox-row { flex-direction: row !important; align-items: center; gap: 10px !important; grid-column: 1 / -1; }
.checkbox-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); }
.checkbox-row span { color: var(--text); font-size: 14px; }

.editor-head {
    display: flex; align-items: center; justify-content: space-between;
    margin: 4px 0 10px; gap: 12px;
}
.editor-head label { color: var(--text-muted); font-weight: 500; font-size: 13px; }
.editor-tabs { display: inline-flex; background: var(--bg-elev-2); border-radius: var(--radius-sm); padding: 3px; }
.editor-tab {
    appearance: none; background: transparent; border: 0;
    color: var(--text-muted); font-weight: 500; font-size: 13px;
    padding: 6px 14px; border-radius: var(--radius-xs); cursor: pointer;
}
.editor-tab.active { color: var(--text); background: var(--bg-elev-3); }

.editor-body { min-height: 400px; }
.editor-textarea {
    width: 100%; min-height: 500px;
    background: var(--bg-elev-2); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 16px; font-family: var(--font-mono); font-size: 13px; line-height: 1.6;
    resize: vertical;
}
.editor-preview {
    background: var(--bg-elev-1); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 16px 20px;
    min-height: 500px;
}
.form-foot { margin-top: 20px; display: flex; justify-content: flex-end; }

/* ─── auth ───────────────────────────────────────────────────────────────── */

.auth-wrap { max-width: 420px; margin-top: 56px; }
.auth-card {
    background: var(--bg-elev-1); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 30px; box-shadow: var(--shadow-md);
}
.auth-title { font-size: 21px; font-weight: 700; margin: 0 0 4px; color: var(--text-strong); letter-spacing: -0.02em; }
.auth-sub   { margin: 0 0 20px; font-size: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-muted); font-weight: 500; }
.auth-form input {
    background: var(--bg-elev-2); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 10px 12px; font-size: 14px; font-family: inherit;
}
.auth-form input:focus {
    outline: none; border-color: var(--border-focus); background: var(--bg-elev-3);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.auth-form .primary-btn { margin-top: 4px; }
.auth-error {
    padding: 10px 14px; background: rgba(240, 82, 82, 0.1); border: 1px solid rgba(240, 82, 82, 0.3);
    color: #fca5a5; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px;
}

pre[class*="language-"] { background: #0b0b0e !important; }

/* Scrollbar. */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
*::-webkit-scrollbar-track { background: transparent; }

/* ============================================================================
   Home page ambience — a single, subtle static grid behind the hero. No
   drifting blobs; the refined look leans on flat surfaces + crisp borders.
   ============================================================================ */

.home-bg-fx {
    position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0;
}
.hero, .games, .featured, .stats-strip { position: relative; z-index: 1; }

.fx-grid {
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 60px 60px;
    -webkit-mask-image: radial-gradient(ellipse 60% 50% at 50% 12%, #000 10%, transparent 70%);
            mask-image: radial-gradient(ellipse 60% 50% at 50% 12%, #000 10%, transparent 70%);
    opacity: 0.6;
}
/* Blobs removed in v3 — keep the classes inert in case templates still emit
   them, so nothing renders if markup lags behind. */
.fx-blob { display: none; }

/* Entry animations. */
.games .game-card { animation: card-in 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) both; }
.games .game-card:nth-child(1) { animation-delay: 0.05s; }
.games .game-card:nth-child(2) { animation-delay: 0.12s; }
.games .game-card:nth-child(3) { animation-delay: 0.19s; }
.games .game-card:nth-child(4) { animation-delay: 0.26s; }
.games .game-card:nth-child(5) { animation-delay: 0.33s; }
.games .game-card:nth-child(6) { animation-delay: 0.40s; }

.hero .eyebrow    { animation: hero-in 0.5s ease-out 0.05s both; }
.hero .hero-title { animation: hero-in 0.55s ease-out 0.10s both; }
.hero .hero-sub   { animation: hero-in 0.55s ease-out 0.18s both; }
.stats-strip      { animation: hero-in 0.55s ease-out 0.26s both; }

@keyframes hero-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .fx-grid { animation: none !important; }
    .games .game-card, .hero *, .stats-strip { animation: none !important; }
}


/* ─── owner-only admin management (dashboard) ────────────────────────────── */

.admin-manage {
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    margin-top: 32px;
    margin-bottom: 24px;
}
.admin-manage-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.admin-manage-head h2 {
    margin: 0; font-size: 18px; font-weight: 700; color: var(--text-strong);
}
.admin-manage .admin-table td,
.admin-manage .admin-table th { vertical-align: middle; }

.admin-manage details > summary {
    cursor: pointer; user-select: none;
}
.admin-manage details > summary::-webkit-details-marker { display: none; }

/* Invite URL cell — long token, allow overflow break. */
.invite-url {
    display: inline-block;
    max-width: 420px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    padding: 3px 8px;
    background: var(--bg-elev-3); border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 12px; color: var(--accent-2);
    vertical-align: middle;
}
.invite-url:hover { color: var(--accent-3); border-color: var(--border-strong); }


/* ─── API docs page ─────────────────────────────────────────────── */

.api-docs {
    padding-bottom: 80px;
}

.api-toc {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 40px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}

.api-toc a {
    font-size: 12.5px;
    font-weight: 500;
    padding: 5px 10px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid transparent;
}

.api-toc a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.api-section {
    margin: 40px 0;
    scroll-margin-top: 80px;
}

.api-section h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.api-section h2::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 20px;
    background: var(--accent-2, #8b5cf6);
    border-radius: 2px;
    box-shadow: 0 0 12px var(--accent-2, #8b5cf6);
}

.api-section h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 24px 0 8px;
    color: var(--text);
}

.api-section p {
    font-size: 14.5px;
    line-height: 1.65;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.api-section p strong {
    color: var(--text);
    font-weight: 600;
}

.api-section a {
    color: var(--accent-2, #8b5cf6);
    text-decoration: none;
}

.api-section a:hover { text-decoration: underline; }

/* Inline `code` — differentiate from Prism-highlighted block code. */
.api-section code.inline,
.api-section .col-desc code,
.api-endpoint-row code,
.api-notes code,
.api-note-inline code,
.api-status .desc code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 0.88em;
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: var(--accent-2, #8b5cf6);
    white-space: nowrap;
}

.api-notes {
    list-style: none;
    padding: 0;
    margin: 12px 0 0;
}

.api-notes li {
    position: relative;
    padding: 4px 0 4px 18px;
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-muted);
}

.api-notes li::before {
    content: "›";
    position: absolute;
    left: 4px;
    top: 4px;
    color: var(--accent-2, #8b5cf6);
    font-weight: 700;
}

.api-note-inline {
    margin-top: 14px;
    padding: 10px 14px;
    border-left: 3px solid var(--accent-2, #8b5cf6);
    background: rgba(139, 92, 246, 0.06);
    border-radius: 0 8px 8px 0;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text);
}

/* Endpoint table — flat two-column list styled as a grid. */
.api-endpoint-table {
    display: grid;
    gap: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    margin: 16px 0;
    background: rgba(255, 255, 255, 0.02);
}

.api-endpoint-row {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 2fr;
    gap: 16px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    align-items: baseline;
}

.api-endpoint-row:last-child { border-bottom: none; }

.api-endpoint-row.header {
    background: rgba(255, 255, 255, 0.03);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    font-weight: 600;
}

.api-endpoint-row.highlight {
    background: rgba(139, 92, 246, 0.08);
    border-left: 3px solid var(--accent-2, #8b5cf6);
    padding-left: 13px;
}

.api-endpoint-row .col-path code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12.5px;
    padding: 3px 8px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 5px;
    color: var(--text);
    white-space: nowrap;
}

.api-endpoint-row .col-desc {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-muted);
}

.api-endpoint-row .col-desc strong { color: var(--text); }

/* Status-code grid. */
.api-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 8px 0;
}

.api-status {
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
}

.api-status .code {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-2, #8b5cf6);
    letter-spacing: 0.02em;
}

.api-status .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-top: 2px;
}

.api-status .desc {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Slug grid. */
.api-slug-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.api-slug {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 12.5px;
    color: var(--text);
}

.api-slug .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
}

.api-slug.live .dot {
    background: var(--accent-2, #8b5cf6);
    box-shadow: 0 0 8px var(--accent-2, #8b5cf6);
}

/* Tighter mobile layout. */
@media (max-width: 640px) {
    .api-endpoint-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .api-endpoint-row.header .col-desc { display: none; }
}


/* Landing → hero pills (API docs + Discord invite).  Sits under the hero
   sub, above the stats.  Pills wrap onto their own lines on narrow screens. */
.hero-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 18px 0 24px;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px 7px 8px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.28);
    border-radius: 999px;
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.hero-pill:hover {
    background: rgba(139, 92, 246, 0.14);
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-1px);
}

.hero-pill-tag {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 3px 8px;
    background: var(--accent-2, #8b5cf6);
    color: #fff;
    border-radius: 999px;
}

.hero-pill-text { color: var(--text-muted); }

.hero-pill:hover .hero-pill-text { color: var(--text); }

.hero-pill-arrow {
    color: var(--accent-2, #8b5cf6);
    font-weight: 700;
    transition: transform 0.15s ease;
}

.hero-pill:hover .hero-pill-arrow { transform: translateX(3px); }

/* Discord variant — Blurple palette (#5865F2). */
.hero-pill--discord {
    background: rgba(88, 101, 242, 0.08);
    border-color: rgba(88, 101, 242, 0.32);
}
.hero-pill--discord:hover {
    background: rgba(88, 101, 242, 0.16);
    border-color: rgba(88, 101, 242, 0.55);
}
.hero-pill--discord .hero-pill-tag { background: #5865F2; }
.hero-pill--discord .hero-pill-arrow { color: #5865F2; }

/* Icon-only tag slot — swaps the text pill for a fixed square that
   hosts an inline SVG (used for the Discord logo).  Keeps the same
   visual footprint as a text tag so the pill height doesn't shift. */
.hero-pill-tag--icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: 26px;
    height: 20px;
    line-height: 0;
}
.hero-pill-tag--icon svg {
    width: 16px;
    height: 16px;
    display: block;
}

/* ─── Community board ─────────────────────────────────────────────────────── */
.comm-page { padding: 48px 0 80px; position: relative; z-index: 1; }
.wrap-narrow { max-width: 760px; }
.wrap-auth { max-width: 440px; }
.comm-header {
  display: flex; flex-wrap: wrap; gap: 24px;
  justify-content: space-between; align-items: flex-start;
  margin-bottom: 28px;
}
.comm-eyebrow {
  font-family: var(--font-mono); font-size: 12px; color: var(--accent-2);
  letter-spacing: 0.08em; text-transform: uppercase; margin: 0 0 6px;
}
.comm-title {
  font-size: 28px; font-weight: 750; letter-spacing: -0.03em;
  color: var(--text-strong); margin: 0 0 8px;
}
.comm-sub { margin: 0; max-width: 520px; line-height: 1.55; }
.comm-header-actions {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.comm-user-chip {
  font-size: 13px; color: var(--text-muted);
  padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elev-2);
}
.comm-breadcrumb { margin-bottom: 20px; font-size: 13px; }
.comm-breadcrumb a { color: var(--text-muted); }
.comm-breadcrumb a:hover { color: var(--accent-2); }

.comm-post-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.comm-post-card {
  border: 1px solid var(--border);
  background: var(--bg-elev-1);
  border-radius: var(--radius-lg);
  transition: border-color .12s ease, background .12s ease;
}
.comm-post-card:hover { border-color: var(--border-strong); background: var(--bg-elev-2); }
.comm-post-link { display: block; padding: 18px 20px; color: inherit; }
.comm-post-link:hover { color: inherit; }
.comm-post-title {
  font-size: 17px; font-weight: 650; color: var(--text-strong);
  margin: 0 0 6px; letter-spacing: -0.02em;
}
.comm-post-meta { font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.comm-post-excerpt { margin: 10px 0 0; font-size: 14px; line-height: 1.5; }

.comm-empty {
  text-align: center; padding: 48px 20px;
  border: 1px dashed var(--border); border-radius: var(--radius-lg);
}
.comm-thread {
  border: 1px solid var(--border); background: var(--bg-elev-1);
  border-radius: var(--radius-lg); padding: 24px; margin-bottom: 28px;
}
.comm-thread-head { margin-bottom: 18px; }
.comm-body { font-size: 15px; line-height: 1.65; color: var(--text); word-wrap: break-word; }
.comm-body pre { overflow-x: auto; }
.comm-section-title { font-size: 15px; font-weight: 650; color: var(--text-strong); margin: 0 0 14px; }
.comm-replies { margin-bottom: 28px; }
.comm-reply {
  border: 1px solid var(--border); background: var(--bg-elev-1);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px;
}
.comm-reply-box {
  border: 1px solid var(--border); background: var(--bg-elev-2);
  border-radius: var(--radius-lg); padding: 20px;
}
.comm-notice { margin: 0; font-size: 14px; }

.comm-form { display: flex; flex-direction: column; gap: 14px; }
.comm-form .field { display: flex; flex-direction: column; gap: 6px; }
.comm-form .field span { font-size: 12.5px; font-weight: 550; color: var(--text-muted); }
.comm-form input[type="text"],
.comm-form input[type="email"],
.comm-form input[type="password"],
.comm-form textarea {
  background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: var(--radius); color: var(--text);
  padding: 10px 12px; font: inherit; outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.comm-form input:focus, .comm-form textarea:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.comm-form textarea { resize: vertical; min-height: 100px; font-family: var(--font-sans); }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-error {
  background: rgba(240, 82, 82, 0.12); border: 1px solid rgba(240, 82, 82, 0.35);
  color: #fca5a5; padding: 10px 12px; border-radius: var(--radius); font-size: 13.5px;
}
.ok-text { color: var(--ok); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border-radius: var(--radius); font-size: 13.5px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; font-family: inherit;
  transition: background .12s, border-color .12s, color .12s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost {
  background: transparent; color: var(--text-muted); border-color: var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); background: var(--bg-elev-2); }
.btn-block { width: 100%; }
.inline-form { display: inline; margin: 0; }

.auth-card {
  border: 1px solid var(--border); background: var(--bg-elev-1);
  border-radius: var(--radius-xl); padding: 28px 26px;
  box-shadow: var(--shadow-md);
}
.auth-switch { margin-top: 18px; font-size: 13.5px; text-align: center; }
.dev-outbox {
  margin-top: 18px; padding: 14px; border-radius: var(--radius);
  background: rgba(240, 160, 32, 0.08); border: 1px solid rgba(240, 160, 32, 0.3);
}
.dev-link {
  display: block; margin-top: 8px; word-break: break-all;
  font-family: var(--font-mono); font-size: 12px; color: var(--accent-3);
}
.badge {
  display: inline-block; font-size: 10.5px; font-weight: 650;
  padding: 2px 7px; border-radius: 999px; letter-spacing: 0.02em;
  text-transform: uppercase;
}
.badge-ok { background: rgba(52, 211, 153, 0.15); color: var(--ok); }
.badge-warn { background: rgba(240, 160, 32, 0.15); color: var(--warn); }
.text-strong { color: var(--text-strong); }

/* ─── Community (integrated) ─────────────────────────────────────────────── */
.comm-page { padding: 36px 0 88px; }
.wrap-narrow { max-width: 740px; margin-left: auto; margin-right: auto; }
.wrap-auth { max-width: 420px; margin-left: auto; margin-right: auto; }
.wrap-profile { max-width: 960px; }

.comm-hero {
    display: flex; flex-wrap: wrap; gap: 20px 32px;
    justify-content: space-between; align-items: flex-end;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.comm-eyebrow {
    font-family: var(--font-mono); font-size: 11px; color: var(--accent-2);
    letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 8px;
}
.comm-title {
    font-size: clamp(26px, 4vw, 32px); font-weight: 750;
    letter-spacing: -0.035em; color: var(--text-strong); margin: 0 0 8px;
}
.comm-title-sm { font-size: 22px; margin: 0 0 4px; }
.comm-sub { margin: 0; max-width: 480px; line-height: 1.55; font-size: 14.5px; }
.comm-header-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.comm-breadcrumb {
    display: flex; gap: 8px; align-items: center;
    margin-bottom: 18px; font-size: 13px;
}
.comm-breadcrumb a { color: var(--text-muted); }
.comm-breadcrumb a:hover { color: var(--text); }

.comm-post-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.comm-post-card {
    border: 1px solid var(--border);
    background: var(--bg-elev-1);
    border-radius: var(--radius-lg);
    transition: border-color .12s, background .12s, transform .08s;
}
.comm-post-card:hover {
    border-color: var(--border-strong);
    background: var(--bg-elev-2);
}
.comm-post-link { display: block; padding: 16px 18px; color: inherit; }
.comm-post-link:hover { color: inherit; }
.comm-post-row { display: flex; gap: 14px; align-items: flex-start; }
.comm-post-body { min-width: 0; flex: 1; }
.comm-post-title {
    font-size: 16px; font-weight: 650; color: var(--text-strong);
    margin: 0 0 4px; letter-spacing: -0.02em;
}
.comm-post-meta {
    font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.dot-sep { opacity: 0.5; }
.comm-post-excerpt { margin: 8px 0 0; font-size: 13.5px; line-height: 1.5; }

.comm-avatar {
    width: 40px; height: 40px; border-radius: 10px; object-fit: cover;
    flex-shrink: 0; background: var(--bg-elev-3);
}
.comm-avatar-sm { width: 32px; height: 32px; border-radius: 8px; }
.comm-avatar-fallback {
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent-soft), var(--bg-elev-3));
    color: var(--accent-2); font-weight: 700; font-size: 14px;
}

.comm-empty {
    text-align: center; padding: 56px 24px;
    border: 1px solid var(--border); border-radius: var(--radius-xl);
    background: var(--bg-elev-1);
}
.comm-empty-title { font-weight: 650; color: var(--text-strong); margin: 0 0 6px; }

.comm-thread {
    border: 1px solid var(--border); background: var(--bg-elev-1);
    border-radius: var(--radius-xl); padding: 22px 24px; margin-bottom: 24px;
}
.comm-thread-head { margin-bottom: 16px; }
.comm-body { font-size: 14.5px; line-height: 1.65; color: var(--text); word-wrap: break-word; }
.comm-section-title {
    font-size: 13px; font-weight: 650; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 12px;
}
.comm-replies { margin-bottom: 22px; }
.comm-reply {
    border: 1px solid var(--border); background: var(--bg-elev-1);
    border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 8px;
}
.comm-reply-content { min-width: 0; flex: 1; }
.comm-reply-box {
    border: 1px solid var(--border); background: var(--bg-elev-2);
    border-radius: var(--radius-xl); padding: 18px 20px;
}
.comm-notice { margin: 0; font-size: 14px; }

.comm-form { display: flex; flex-direction: column; gap: 14px; }
.comm-form .field { display: flex; flex-direction: column; gap: 6px; }
.comm-form .field > span:first-child {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
}
.field-hint { font-size: 12px; }
.comm-form input[type="text"],
.comm-form input[type="email"],
.comm-form input[type="password"],
.comm-form input[type="file"],
.comm-form textarea {
    background: var(--bg); border: 1px solid var(--border-strong);
    border-radius: var(--radius); color: var(--text);
    padding: 10px 12px; font: inherit; outline: none;
    transition: border-color .12s, box-shadow .12s;
}
.comm-form input:focus, .comm-form textarea:focus {
    border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.comm-form textarea { resize: vertical; min-height: 96px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-error {
    background: rgba(240, 82, 82, 0.1); border: 1px solid rgba(240, 82, 82, 0.35);
    color: #fca5a5; padding: 10px 12px; border-radius: var(--radius); font-size: 13.5px;
}
.form-ok {
    background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.3);
    color: #6ee7b7; padding: 10px 12px; border-radius: var(--radius); font-size: 13.5px;
}

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 9px 14px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600;
    border: 1px solid transparent; cursor: pointer; font-family: inherit;
    transition: background .12s, border-color .12s, color .12s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost {
    background: var(--bg-elev-2); color: var(--text-muted); border-color: var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); }
.btn-block { width: 100%; }
.inline-form { display: inline; margin: 0; }

.auth-card {
    border: 1px solid var(--border); background: var(--bg-elev-1);
    border-radius: var(--radius-xl); padding: 28px 26px;
    box-shadow: var(--shadow-md);
}
.auth-switch { margin-top: 18px; font-size: 13.5px; text-align: center; }
.dev-outbox {
    margin-top: 16px; padding: 14px; border-radius: var(--radius);
    background: rgba(240, 160, 32, 0.08); border: 1px solid rgba(240, 160, 32, 0.28);
}
.dev-link {
    display: block; margin-top: 8px; word-break: break-all;
    font-family: var(--font-mono); font-size: 12px; color: var(--accent-3);
}
.badge {
    display: inline-block; font-size: 10px; font-weight: 700;
    padding: 2px 7px; border-radius: 999px; letter-spacing: 0.03em;
    text-transform: uppercase; vertical-align: middle;
}
.badge-ok { background: rgba(52, 211, 153, 0.14); color: var(--ok); }
.badge-warn { background: rgba(240, 160, 32, 0.14); color: var(--warn); }
.text-strong { color: var(--text-strong); }

/* Profile */
.profile-layout {
    display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start;
}
@media (max-width: 800px) {
    .profile-layout { grid-template-columns: 1fr; }
}
.profile-card {
    border: 1px solid var(--border); background: var(--bg-elev-1);
    border-radius: var(--radius-xl); padding: 24px 20px; text-align: center;
}
.profile-avatar-wrap { margin-bottom: 14px; }
.profile-avatar {
    width: 88px; height: 88px; border-radius: 22px; object-fit: cover;
    display: inline-block; background: var(--bg-elev-3);
    border: 1px solid var(--border);
}
.profile-avatar-fallback {
    width: 88px; height: 88px; border-radius: 22px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 32px; font-weight: 750; color: var(--accent-2);
    background: linear-gradient(145deg, var(--accent-soft), var(--bg-elev-3));
    border: 1px solid var(--border);
}
.profile-name {
    font-size: 18px; font-weight: 700; color: var(--text-strong);
    margin: 0 0 4px; letter-spacing: -0.02em;
}
.profile-email { font-size: 12.5px; margin: 0 0 10px; word-break: break-all; }
.profile-bio {
    font-size: 13.5px; color: var(--text-muted); margin: 12px 0 0;
    text-align: left; line-height: 1.5;
}
.profile-stats {
    display: flex; justify-content: center; gap: 20px;
    margin: 18px 0; padding: 12px 0;
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.profile-stats strong {
    display: block; font-size: 18px; color: var(--text-strong); letter-spacing: -0.02em;
}
.profile-stats span { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.profile-main {
    border: 1px solid var(--border); background: var(--bg-elev-1);
    border-radius: var(--radius-xl); padding: 24px 26px;
}
.profile-section-label {
    font-size: 12px; font-weight: 650; color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 0.06em;
    margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--border);
}
.profile-form { margin-top: 8px; }

.site-main { flex: 1; }

/* ─── Community v2: categories, rep, uploads, chat ───────────────────────── */

.comm-cats {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin: 0 0 22px; padding: 0;
}
.comm-cat {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px;
    font-size: 12.5px; font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-elev-1);
    border: 1px solid var(--border);
    text-decoration: none;
    transition: border-color .12s, color .12s, background .12s;
}
.comm-cat:hover { color: var(--text); border-color: var(--border-strong); }
.comm-cat.is-active {
    color: #fff;
    background: var(--accent);
    border-color: transparent;
}
.comm-cat-count {
    font-size: 11px; font-weight: 700; opacity: 0.75;
    font-family: var(--font-mono);
}
.comm-cat.is-active .comm-cat-count { opacity: 0.9; }

.comm-post-title-row {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    margin-bottom: 4px;
}
.comm-post-title-row .comm-post-title,
.comm-post-title-row .comm-title { margin: 0; }

.cat-badge {
    display: inline-block; font-size: 10px; font-weight: 700;
    padding: 2px 7px; border-radius: 999px;
    letter-spacing: 0.03em; text-transform: uppercase;
    background: rgba(139, 92, 246, 0.14); color: var(--accent-2, #a78bfa);
    flex-shrink: 0;
}
.cat-offsets { background: rgba(99, 102, 241, 0.16); color: #a5b4fc; }
.cat-community { background: rgba(52, 211, 153, 0.14); color: #6ee7b7; }
.cat-help { background: rgba(251, 191, 36, 0.14); color: #fcd34d; }
.cat-dumps { background: rgba(244, 114, 182, 0.14); color: #f9a8d4; }
.cat-general { background: rgba(148, 163, 184, 0.14); color: #cbd5e1; }

.rep-inline, .rep-pill {
    font-size: 11px; font-weight: 650; font-family: var(--font-mono);
    color: var(--accent-2); opacity: 0.9;
}
.rep-pill {
    margin-left: 6px; padding: 1px 6px;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.25);
}
.has-img {
    font-size: 10px; font-weight: 700; letter-spacing: 0.04em;
    color: var(--ok); text-transform: uppercase;
}

.vote-box { flex-shrink: 0; margin-left: auto; }
.vote-form { margin: 0; }
.vote-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 10px; border-radius: var(--radius-sm);
    font-size: 12.5px; font-weight: 700; font-family: inherit;
    background: var(--bg-elev-3); color: var(--text-muted);
    border: 1px solid var(--border); cursor: pointer;
    transition: color .12s, border-color .12s, background .12s;
}
.vote-btn:hover { color: var(--text); border-color: var(--border-strong); }
.vote-btn.is-voted {
    color: var(--accent-2);
    border-color: rgba(139, 92, 246, 0.45);
    background: rgba(139, 92, 246, 0.12);
}
.vote-btn-sm { padding: 4px 8px; font-size: 11.5px; }
.vote-static { cursor: default; }
.vote-count { font-weight: 600; }

.comm-attach { margin-top: 16px; }
.comm-attach-img {
    max-width: 100%; max-height: 420px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: block; object-fit: contain;
    background: var(--bg);
}
.comm-attach-sm { max-height: 280px; }

.comm-form select {
    background: var(--bg); border: 1px solid var(--border-strong);
    border-radius: var(--radius); color: var(--text);
    padding: 10px 12px; font: inherit; outline: none;
    transition: border-color .12s, box-shadow .12s;
}
.comm-form select:focus {
    border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Live chat */
.wrap-chat { max-width: 820px; }
.chat-shell {
    border: 1px solid var(--border);
    background: var(--bg-elev-1);
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex; flex-direction: column;
    min-height: 480px;
}
.chat-log {
    flex: 1; overflow-y: auto;
    padding: 16px 18px;
    display: flex; flex-direction: column; gap: 10px;
    max-height: 56vh; min-height: 360px;
    background: linear-gradient(180deg, var(--bg-elev-1), var(--bg));
}
.chat-msg {
    display: flex; gap: 10px; align-items: flex-start;
}
.chat-av {
    width: 32px; height: 32px; border-radius: 8px;
    object-fit: cover; flex-shrink: 0; background: var(--bg-elev-3);
}
.chat-av-fallback {
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700; color: var(--accent-2);
    background: linear-gradient(135deg, var(--accent-soft), var(--bg-elev-3));
}
.chat-msg-body { min-width: 0; flex: 1; }
.chat-msg-meta {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline;
    font-size: 12px; color: var(--text-muted); margin-bottom: 2px;
}
.chat-msg-meta strong { color: var(--text-strong); font-size: 13px; }
.chat-msg-meta time { font-family: var(--font-mono); font-size: 11px; opacity: 0.7; }
.chat-msg-text {
    font-size: 14px; line-height: 1.5; color: var(--text);
    word-wrap: break-word; white-space: pre-wrap;
}
.chat-compose {
    display: flex; gap: 8px; padding: 12px 14px;
    border-top: 1px solid var(--border);
    background: var(--bg-elev-2);
}
.chat-compose input[type="text"] {
    flex: 1; background: var(--bg); border: 1px solid var(--border-strong);
    border-radius: var(--radius); color: var(--text);
    padding: 10px 12px; font: inherit; outline: none;
}
.chat-compose input:focus {
    border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.chat-status { margin: 0; padding: 0 14px 12px; font-size: 12.5px; }
.chat-gate {
    margin: 0; padding: 16px 18px;
    border-top: 1px solid var(--border);
    background: var(--bg-elev-2);
}
.comm-thread-head-main { min-width: 0; flex: 1; }

/* Community bodies reuse offset markdown styles (code fences, headings) */
.comm-body.md-body h1,
.comm-body.md-body h2,
.comm-body.md-body h3,
.comm-body.md-body h4 {
    color: var(--text-strong);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 18px 0 10px;
    line-height: 1.25;
}
.comm-body.md-body h1 { font-size: 22px; }
.comm-body.md-body h2 { font-size: 18px; }
.comm-body.md-body h3 { font-size: 15px; }
.comm-body.md-body pre {
    margin: 12px 0;
    padding: 14px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    position: relative;
}
.comm-body.md-body pre code {
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text);
    background: none;
    border: 0;
    padding: 0;
}
.comm-body.md-body code:not(pre code) {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 1px 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: var(--accent-2, #a78bfa);
}

/* Pop-in / stagger (same feel as home game cards) */
.comm-hero {
    opacity: 0;
    transform: translateY(8px);
    animation: hero-in 0.5s ease-out 0.05s both;
}
.comm-cats {
    opacity: 0;
    transform: translateY(6px);
    animation: hero-in 0.45s ease-out 0.12s both;
}
.comm-post-list .comm-post-card {
    opacity: 0;
    transform: translateY(8px);
    animation: card-in 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.comm-post-list .comm-post-card:nth-child(1)  { animation-delay: 0.08s; }
.comm-post-list .comm-post-card:nth-child(2)  { animation-delay: 0.13s; }
.comm-post-list .comm-post-card:nth-child(3)  { animation-delay: 0.18s; }
.comm-post-list .comm-post-card:nth-child(4)  { animation-delay: 0.23s; }
.comm-post-list .comm-post-card:nth-child(5)  { animation-delay: 0.28s; }
.comm-post-list .comm-post-card:nth-child(6)  { animation-delay: 0.33s; }
.comm-post-list .comm-post-card:nth-child(7)  { animation-delay: 0.38s; }
.comm-post-list .comm-post-card:nth-child(8)  { animation-delay: 0.43s; }
.comm-post-list .comm-post-card:nth-child(9)  { animation-delay: 0.48s; }
.comm-post-list .comm-post-card:nth-child(10) { animation-delay: 0.53s; }
.comm-post-list .comm-post-card:nth-child(n+11) { animation-delay: 0.58s; }

.comm-empty,
.comm-thread,
.comm-replies,
.comm-reply-box,
.chat-shell,
.profile-layout > *,
.auth-card {
    opacity: 0;
    transform: translateY(8px);
    animation: card-in 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.comm-thread { animation-delay: 0.08s; }
.comm-replies { animation-delay: 0.14s; }
.comm-reply-box { animation-delay: 0.20s; }
.chat-shell { animation-delay: 0.10s; }
.profile-layout > *:nth-child(1) { animation-delay: 0.08s; }
.profile-layout > *:nth-child(2) { animation-delay: 0.16s; }
.auth-card { animation-delay: 0.08s; }

.admin-community-page .admin-head {
    opacity: 0;
    transform: translateY(8px);
    animation: hero-in 0.45s ease-out 0.04s both;
}
.admin-pop {
    opacity: 0;
    transform: translateY(8px);
    animation: card-in 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}
.admin-pop:nth-of-type(1) { animation-delay: 0.08s; }
.admin-pop:nth-of-type(2) { animation-delay: 0.14s; }
.admin-pop:nth-of-type(3) { animation-delay: 0.20s; }
.admin-pop:nth-of-type(4) { animation-delay: 0.26s; }

@media (prefers-reduced-motion: reduce) {
    .comm-hero, .comm-cats, .comm-post-list .comm-post-card,
    .comm-empty, .comm-thread, .comm-replies, .comm-reply-box,
    .chat-shell, .profile-layout > *, .auth-card,
    .admin-community-page .admin-head, .admin-pop {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }
}

/* Admin community extras */
.admin-tabs {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin: 0 0 20px;
}
.admin-tabs a {
    padding: 6px 12px; border-radius: 999px;
    font-size: 12.5px; font-weight: 600;
    color: var(--text-muted);
    border: 1px solid var(--border);
    background: var(--bg-elev-1);
}
.admin-tabs a:hover { color: var(--text); border-color: var(--border-strong); }
.admin-inline-form select {
    background: var(--bg); border: 1px solid var(--border);
    color: var(--text); border-radius: 6px; padding: 4px 6px; font: inherit; font-size: 12.5px;
}
.admin-rep-form {
    display: inline-flex; align-items: center; gap: 6px;
}
.admin-rep-form input[type="number"] {
    width: 72px; background: var(--bg); border: 1px solid var(--border);
    color: var(--text); border-radius: 6px; padding: 4px 6px; font: inherit; font-size: 13px;
}
.admin-cat-edit {
    display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin-right: 10px;
}
.admin-cat-edit input[type="text"],
.admin-cat-new-row input[type="text"] {
    background: var(--bg); border: 1px solid var(--border);
    color: var(--text); border-radius: 6px; padding: 6px 8px; font: inherit; font-size: 13px;
}
.admin-cat-edit input[type="number"],
.admin-cat-new-row input[type="number"] {
    background: var(--bg); border: 1px solid var(--border);
    color: var(--text); border-radius: 6px; padding: 6px 8px; font: inherit; font-size: 13px;
}
.admin-check {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 12.5px; color: var(--text-muted); cursor: pointer;
}
.admin-cat-new-row {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.admin-community-page .admin-manage { scroll-margin-top: 80px; }

/* Role badges (owner / mod / trusted / …) */
.role-badges {
    display: flex; flex-wrap: wrap; gap: 5px; justify-content: center;
    margin: 8px 0 4px;
}
.role-badge {
    display: inline-block;
    font-size: 10px; font-weight: 750;
    padding: 2px 7px; border-radius: 999px;
    letter-spacing: 0.04em; text-transform: uppercase;
    vertical-align: middle;
}
.role-badge-sm { font-size: 9px; padding: 1px 6px; }
.role-owner   { background: rgba(251, 191, 36, 0.18); color: #fcd34d; border: 1px solid rgba(251, 191, 36, 0.35); }
.role-mod     { background: rgba(96, 165, 250, 0.16); color: #93c5fd; border: 1px solid rgba(96, 165, 250, 0.35); }
.role-trusted { background: rgba(52, 211, 153, 0.14); color: #6ee7b7; border: 1px solid rgba(52, 211, 153, 0.3); }
.role-dev     { background: rgba(167, 139, 250, 0.16); color: #c4b5fd; border: 1px solid rgba(167, 139, 250, 0.35); }
.role-vip     { background: rgba(244, 114, 182, 0.14); color: #f9a8d4; border: 1px solid rgba(244, 114, 182, 0.3); }

.author-link, .author-inline a {
    color: var(--text-strong); text-decoration: none; font-weight: 650;
}
.author-link:hover { color: var(--accent-2); }
.comm-post-title a {
    color: inherit; text-decoration: none;
}
.comm-post-title a:hover { color: var(--accent-2); }
.excerpt-link { color: inherit; text-decoration: none; }
.excerpt-link:hover { color: var(--text); }
.comm-avatar-link { flex-shrink: 0; line-height: 0; }
.author-inline {
    display: inline-flex; flex-wrap: wrap; gap: 5px; align-items: center;
}
.admin-roles-form {
    display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center;
    max-width: 280px;
}
.profile-post-list .comm-post-title { font-size: 15px; }
