/* ═══════════════════════════════════════════════════════════════════════════
   POETIC GOBLIN — Comic Fantasy Stylesheet
   Colors: White, Blue, Black, Orange / Comic-book aesthetic
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;800;900&family=Nunito:wght@400;600;700;800;900&family=Press+Start+2P&display=swap');

:root {
    --bg-white: #ffffff;
    --bg-light: #f4f6fa;
    --bg-card: #ffffff;
    --bg-dark: #0f1923;
    --bg-darker: #0a1118;

    --blue: #1a73e8;
    --blue-light: #4a9af5;
    --blue-pale: #e8f0fe;
    --blue-dark: #0d47a1;

    --orange: #ff6b2b;
    --orange-light: #ff8f5e;
    --orange-pale: #fff3ed;
    --orange-dark: #d4501a;

    --black: #1a1a2e;
    --black-soft: #2d2d44;

    --text-primary: #1a1a2e;
    --text-body: #3d3d56;
    --text-muted: #7a7a8e;
    --text-dim: #a0a0b2;
    --text-white: #ffffff;

    --border-light: #e2e6ef;
    --border-medium: #c8cdd8;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
    --shadow-pop: 0 6px 20px rgba(255, 107, 43, 0.25);

    --font-display: 'Cinzel', serif;
    --font-title: 'Cinzel', serif;
    --font-body: 'Nunito', sans-serif;
    --font-pixel: 'Press Start 2P', monospace;

    --nav-height: 64px;
    --sidebar-width: 280px;
    --content-max: 660px;
    --radius: 12px;
    --radius-pixel: 4px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-body);
    background-color: var(--bg-light);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--orange); }
img { max-width: 100%; height: auto; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-light); }
::-webkit-scrollbar-thumb { background: var(--blue-light); border-radius: 4px; }

/* ─── Pixel Art Icon System ──────────────────────────────────────────── */
.px-icon {
    width: 1.1em; height: 1.1em;
    vertical-align: -0.15em;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    display: inline-block;
    flex-shrink: 0;
}
.px-icon-lg { width: 2rem; height: 2rem; vertical-align: middle; }
.px-icon-xl { width: 3rem; height: 3rem; vertical-align: middle; }
.px-icon-hero { width: 4rem; height: 4rem; vertical-align: middle; }
.px-icon-huge { width: 10rem; height: 10rem; }

/* ─── Brand Styling ──────────────────────────────────────────────────── */
.brand-blue { color: var(--blue-light); }

/* ─── Retro Pixel Accents ────────────────────────────────────────────── */
.pixel-label, .post-type-label, .search-result-type, .trait-category {
    font-family: var(--font-pixel);
    font-size: 0.55rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.sidebar-card h3, .annals-sidebar-title {
    font-family: var(--font-pixel);
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

h1,h2,h3,h4,h5,h6 {
    font-family: var(--font-display);
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: 0.04em;
}
h1 { font-size: 2.4rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.3rem; }

/* ─── Navbar ──────────────────────────────────────────────────────────── */
.navbar {
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: var(--bg-dark);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 2rem; z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.nav-brand { display: flex; align-items: center; gap: 0.6rem; }
.nav-brand-icon { width: 32px; height: 32px; image-rendering: pixelated; image-rendering: crisp-edges; }
.nav-brand-text {
    font-family: var(--font-title);
    font-size: 1.4rem; color: var(--orange);
    letter-spacing: 0.06em;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}
.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.45rem 0.9rem; border-radius: 8px;
    color: rgba(255,255,255,0.6);
    font-family: var(--font-display);
    font-size: 0.95rem; letter-spacing: 0.04em;
    transition: all 0.2s;
}
.nav-link:hover, .nav-link.active {
    color: var(--orange);
    background: rgba(255,107,43,0.1);
}
.nav-link .icon { font-size: 1.1rem; }
.nav-user { display: flex; align-items: center; gap: 0.6rem; }
.nav-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    border: 2px solid var(--orange);
    object-fit: cover; background: var(--black-soft);
}
.nav-identity { display: flex; align-items: center; gap: 0.5rem; }
.nav-char-info { display: flex; flex-direction: column; line-height: 1.15; }
.nav-char-name { font-family: var(--font-display); font-size: 0.9rem; color: #fff; letter-spacing: 0.03em; }
.nav-username { font-size: 0.65rem; color: rgba(255,255,255,0.4); }

/* ─── Layout ──────────────────────────────────────────────────────────── */
.page-wrapper { padding-top: var(--nav-height); min-height: 100vh; }
.main-layout { display: flex; max-width: 1100px; margin: 0 auto; padding: 1.5rem; gap: 1.5rem; }
.content-main { flex: 1; max-width: var(--content-max); min-width: 0; }
.sidebar { width: var(--sidebar-width); flex-shrink: 0; }
.sidebar-card {
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}
.sidebar-card h3 {
    font-size: 0.95rem; color: var(--blue-dark); margin-bottom: 0.75rem;
    letter-spacing: 0.06em;
}

/* ─── Cards ───────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1rem;
    box-shadow: var(--shadow-sm); transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); }

/* ─── Search Bar ──────────────────────────────────────────────────────── */
.search-bar {
    display: flex; gap: 0.5rem;
    background: var(--bg-card); border: 2px solid var(--border-light);
    border-radius: 50px; padding: 0.4rem 0.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s;
}
.search-bar:focus-within { border-color: var(--blue); }
.search-bar input {
    flex: 1; border: none; background: none; outline: none;
    font-family: var(--font-body); font-size: 0.95rem;
    color: var(--text-primary); padding: 0.4rem 0.75rem;
}
.search-bar input::placeholder { color: var(--text-dim); }
.search-bar button {
    padding: 0.5rem 1.2rem; border: none; border-radius: 50px;
    background: var(--blue); color: white;
    font-family: var(--font-display); font-size: 0.9rem;
    letter-spacing: 0.04em; cursor: pointer; transition: background 0.2s;
}
.search-bar button:hover { background: var(--blue-dark); }

/* ─── Post Composer / Create Button ───────────────────────────────────── */
.create-post-btn {
    display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    width: 100%; padding: 1rem;
    background: linear-gradient(135deg, var(--orange), var(--orange-dark));
    color: white; border: none; border-radius: var(--radius);
    font-family: var(--font-display); font-size: 1.2rem;
    letter-spacing: 0.06em; cursor: pointer;
    box-shadow: var(--shadow-pop);
    transition: all 0.2s;
    text-decoration: none;
    margin-bottom: 1.25rem;
}
.create-post-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 107, 43, 0.35);
    color: white;
}

/* ─── Post Card ───────────────────────────────────────────────────────── */
.post-card {
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius); margin-bottom: 1rem;
    overflow: hidden; box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}
.post-card:hover { box-shadow: var(--shadow-md); }
.post-header { display: flex; align-items: center; gap: 0.75rem; padding: 1rem 1.25rem 0; }
.post-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    border: 2px solid var(--blue-light); object-fit: cover;
    background: var(--bg-light); flex-shrink: 0;
}
.post-meta { flex: 1; min-width: 0; }
.post-author {
    font-family: var(--font-display); font-size: 1rem;
    color: var(--text-primary); letter-spacing: 0.03em;
}
.post-author:hover { color: var(--orange); }
.post-info { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; color: var(--text-dim); flex-wrap: wrap; }
.post-username-badge { color: var(--text-muted); }

.post-type-badge {
    display: inline-flex; align-items: center; gap: 0.2rem;
    padding: 0.15rem 0.5rem; border-radius: 4px;
    font-size: 0.7rem; font-family: var(--font-display);
    letter-spacing: 0.05em; font-weight: 700;
}
.post-type-badge.campaign { background: var(--blue-pale); color: var(--blue-dark); }
.post-type-badge.story { background: var(--orange-pale); color: var(--orange-dark); }
.post-type-badge.art { background: #f0e6ff; color: #6b21a8; }

.post-title-bar {
    padding: 0.6rem 1.25rem 0;
    font-family: var(--font-display);
    font-size: 1.3rem; color: var(--text-primary);
    letter-spacing: 0.03em;
}
.post-content { padding: 0.6rem 1.25rem; font-size: 0.95rem; line-height: 1.7; white-space: pre-wrap; word-wrap: break-word; }
.post-image { width: 100%; max-height: 500px; object-fit: cover; }
.post-description { padding: 0.5rem 1.25rem 0; font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; }

/* Tags */
.post-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0.5rem 1.25rem; }
.post-tag {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.2rem 0.6rem; border-radius: 20px;
    font-size: 0.75rem; font-weight: 700;
    font-family: var(--font-body);
}
.post-tag.location { background: var(--blue-pale); color: var(--blue-dark); }
.post-tag.age { background: var(--orange-pale); color: var(--orange-dark); }
.post-tag.character { background: #e8f5e9; color: #2e7d32; }
.post-tag.user-tag { background: #fce4ec; color: #c62828; }

/* Campaign sessions */
.session-list { padding: 0 1.25rem; }
.session-item {
    padding: 0.75rem; margin: 0.4rem 0; background: var(--bg-light);
    border-left: 3px solid var(--blue); border-radius: 0 8px 8px 0;
}
.session-title { font-family: var(--font-display); font-size: 0.95rem; color: var(--blue-dark); letter-spacing: 0.03em; margin-bottom: 0.25rem; }
.session-content { font-size: 0.9rem; color: var(--text-body); line-height: 1.6; }
.session-expand-btn {
    display: block; width: 100%; padding: 0.5rem; margin: 0.5rem 0;
    background: var(--blue-pale); border: 1px dashed var(--blue-light);
    border-radius: 8px; color: var(--blue);
    font-family: var(--font-display); font-size: 0.85rem;
    cursor: pointer; text-align: center; letter-spacing: 0.04em;
    transition: all 0.2s;
}
.session-expand-btn:hover { background: var(--blue); color: white; border-style: solid; }

.post-actions {
    display: flex; align-items: center; gap: 0.25rem;
    padding: 0.5rem 1.25rem 0.75rem;
    border-top: 1px solid var(--border-light); margin-top: 0.5rem;
}
.post-action-btn {
    display: flex; align-items: center; gap: 0.35rem;
    padding: 0.45rem 0.7rem; border: none; background: transparent;
    color: var(--text-muted); font-family: var(--font-body); font-weight: 700;
    font-size: 0.85rem; border-radius: 6px; cursor: pointer;
    transition: all 0.2s;
}
.post-action-btn:hover { background: var(--blue-pale); color: var(--blue); }
.post-action-btn.liked { color: var(--orange); }
.post-action-btn.delete-btn:hover { background: #fce4ec; color: #c62828; }
.post-action-btn .icon { font-size: 1rem; }

/* Comments */
.comments-section { padding: 0 1.25rem 1rem; display: none; }
.comments-section.open { display: block; }
.comment { display: flex; gap: 0.5rem; padding: 0.6rem 0; border-top: 1px solid var(--border-light); }
.comment:first-child { border-top: none; }
.comment-avatar {
    width: 28px; height: 28px; border-radius: 50%;
    border: 1px solid var(--blue-light); object-fit: cover;
    background: var(--bg-light); flex-shrink: 0;
}
.comment-body { flex: 1; }
.comment-author { font-family: var(--font-display); font-size: 0.8rem; color: var(--text-primary); letter-spacing: 0.02em; }
.comment-text { font-size: 0.85rem; color: var(--text-body); margin-top: 0.1rem; }
.comment-time { font-size: 0.7rem; color: var(--text-dim); margin-top: 0.1rem; }
.comment-input-row { display: flex; gap: 0.4rem; margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px solid var(--border-light); }
.comment-input {
    flex: 1; padding: 0.45rem 0.7rem; background: var(--bg-light);
    border: 1px solid var(--border-light); border-radius: 20px;
    color: var(--text-primary); font-family: var(--font-body); font-size: 0.85rem;
}
.comment-input:focus { outline: none; border-color: var(--blue); }

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    padding: 0.6rem 1.2rem; border: none; border-radius: 8px;
    font-family: var(--font-display); font-size: 0.9rem;
    letter-spacing: 0.04em; cursor: pointer; transition: all 0.2s;
    text-decoration: none;
}
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover { background: var(--blue-dark); color: white; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-orange { background: var(--orange); color: white; }
.btn-orange:hover { background: var(--orange-dark); color: white; transform: translateY(-1px); box-shadow: var(--shadow-pop); }
.btn-secondary { background: var(--bg-light); color: var(--text-body); border: 1px solid var(--border-light); }
.btn-secondary:hover { border-color: var(--blue); color: var(--blue); }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border-light); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-danger { background: transparent; color: #c62828; border: 1px solid #ffcdd2; }
.btn-danger:hover { background: #ffebee; }
.btn-follow { padding: 0.35rem 0.9rem; font-size: 0.8rem; }
.btn-follow.following { background: var(--bg-light); color: var(--text-muted); border: 1px solid var(--border-light); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* ─── Forms ───────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.2rem; }
.form-label {
    display: block; font-family: var(--font-display);
    font-size: 0.9rem; color: var(--text-primary);
    margin-bottom: 0.35rem; letter-spacing: 0.04em;
}
.form-input {
    width: 100%; padding: 0.65rem 1rem;
    background: var(--bg-light); border: 2px solid var(--border-light);
    border-radius: 8px; color: var(--text-primary);
    font-family: var(--font-body); font-size: 0.95rem;
    transition: border-color 0.2s;
}
.form-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,115,232,0.1); }
.form-input::placeholder { color: var(--text-dim); }
textarea.form-input { min-height: 100px; resize: vertical; }
select.form-input { cursor: pointer; }
.form-hint { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.25rem; }

/* ─── Profile ─────────────────────────────────────────────────────────── */
.profile-header {
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius); padding: 2rem; margin-bottom: 1.5rem;
    text-align: center; position: relative; overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.profile-header::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 80px;
    background: linear-gradient(135deg, var(--blue), var(--orange));
    opacity: 0.15;
}
.profile-avatar-large {
    width: 100px; height: 100px; border-radius: 50%;
    border: 4px solid var(--orange); object-fit: cover;
    background: var(--bg-light); position: relative; z-index: 1; margin: 0 auto 1rem;
}
.profile-display-name { font-family: var(--font-title); font-size: 1.8rem; color: var(--text-primary); margin-bottom: 0.1rem; letter-spacing: 0.04em; }
.profile-username { color: var(--text-dim); font-size: 0.9rem; margin-bottom: 0.5rem; font-weight: 700; }
.profile-stats { display: flex; justify-content: center; gap: 2rem; padding-top: 1rem; border-top: 1px solid var(--border-light); margin-top: 1rem; }
.profile-stat { text-align: center; }
.profile-stat-value { font-family: var(--font-display); font-size: 1.3rem; color: var(--text-primary); }
.profile-stat-label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 700; }

/* ─── Trait chips (profile) ───────────────────────────────────────────── */
.trait-badge {
    display: inline-flex; align-items: center; gap: 0.2rem;
    padding: 0.25rem 0.7rem; border-radius: 20px;
    font-size: 0.8rem; font-family: var(--font-display);
    letter-spacing: 0.03em;
}
.trait-badge:nth-child(1) { background: var(--blue-pale); color: var(--blue-dark); }
.trait-badge:nth-child(2) { background: var(--orange-pale); color: var(--orange-dark); }
.trait-badge:nth-child(3) { background: #e8f5e9; color: #2e7d32; }

/* ─── Avatar Placeholder ──────────────────────────────────────────────── */
.avatar-placeholder {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--blue), var(--orange));
    color: white; font-family: var(--font-display);
    font-weight: 700; border-radius: 50%;
}

/* ─── File Input ──────────────────────────────────────────────────────── */
.file-input-label {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.45rem 0.75rem; background: var(--bg-light);
    border: 2px dashed var(--border-medium); border-radius: 8px;
    color: var(--text-muted); font-size: 0.85rem; cursor: pointer;
    transition: all 0.2s;
}
.file-input-label:hover { border-color: var(--blue); color: var(--blue); }
.file-input-label input[type="file"] { position: absolute; opacity: 0; width: 0; height: 0; }

/* ─── Flash Messages ──────────────────────────────────────────────────── */
.flash-messages { position: fixed; top: calc(var(--nav-height) + 0.75rem); right: 1.5rem; z-index: 2000; display: flex; flex-direction: column; gap: 0.5rem; max-width: 400px; }
.flash {
    padding: 0.7rem 1.2rem; border-radius: 8px; font-size: 0.9rem; font-weight: 600;
    display: flex; align-items: center; gap: 0.4rem;
    animation: flashIn 0.3s ease-out; cursor: pointer;
    box-shadow: var(--shadow-md);
}
@keyframes flashIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }
.flash-success { background: #e8f5e9; color: #2e7d32; }
.flash-error { background: #ffebee; color: #c62828; }
.flash-warning { background: #fff8e1; color: #f57f17; }
.flash-info { background: var(--blue-pale); color: var(--blue-dark); }

/* ─── Empty State ─────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--text-dim); }
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; display: block; opacity: 0.5; }
.empty-state h3 { color: var(--text-muted); margin-bottom: 0.5rem; }

/* ─── Divider ─────────────────────────────────────────────────────────── */
.divider {
    display: flex; align-items: center; gap: 1rem; margin: 1.25rem 0;
    color: var(--text-dim); font-size: 0.85rem;
    font-family: var(--font-display); letter-spacing: 0.06em;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border-light); }

/* ─── User Items ──────────────────────────────────────────────────────── */
.user-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border-light); }
.user-item:last-child { border-bottom: none; }
.user-item-avatar { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--blue-light); object-fit: cover; background: var(--bg-light); flex-shrink: 0; }
.user-item-info { flex: 1; min-width: 0; }
.user-item-name { font-family: var(--font-display); font-size: 0.9rem; color: var(--text-primary); letter-spacing: 0.03em; }
.user-item-title { font-size: 0.75rem; color: var(--text-dim); font-weight: 600; }

/* ─── Landing Page ────────────────────────────────────────────────────── */
.landing {
    min-height: 100vh; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center;
    padding: 2rem; background: var(--bg-dark); position: relative; overflow: hidden;
}
.landing::before {
    content: ''; position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 30% 30%, rgba(26,115,232,0.15) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 70%, rgba(255,107,43,0.15) 0%, transparent 60%);
    pointer-events: none;
}
.landing-content { position: relative; z-index: 1; max-width: 650px; }
.landing-icon { width: 128px; height: 128px; margin-bottom: 1rem; display: block; animation: bounce 2s ease-in-out infinite; image-rendering: pixelated; image-rendering: crisp-edges; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.landing-title {
    font-family: var(--font-title); font-size: 3.5rem; color: var(--orange);
    letter-spacing: 0.06em; margin-bottom: 0.3rem;
    text-shadow: 3px 3px 0 rgba(0,0,0,0.3);
}
.landing-subtitle { font-family: var(--font-display); font-size: 1.4rem; color: rgba(255,255,255,0.5); margin-bottom: 2rem; letter-spacing: 0.06em; }
.landing-desc { font-size: 1.1rem; color: rgba(255,255,255,0.75); margin-bottom: 2.5rem; line-height: 1.8; }
.landing-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.landing-buttons .btn { padding: 0.85rem 2rem; font-size: 1.1rem; }
.landing-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 4rem; }
.landing-feature {
    padding: 1.5rem; border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius); background: rgba(255,255,255,0.05);
}
.landing-feature-icon { font-size: 2rem; margin-bottom: 0.75rem; display: block; image-rendering: pixelated; }
.landing-feature-icon .px-icon-lg { width: 2.5rem; height: 2.5rem; }
.landing-feature h3 { font-size: 1.05rem; margin-bottom: 0.5rem; color: var(--orange); font-family: var(--font-pixel); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em; }
.landing-feature p { font-size: 0.9rem; color: rgba(255,255,255,0.5); }

/* ─── Auth Pages ──────────────────────────────────────────────────────── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--bg-light); }
.auth-card {
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: 16px; padding: 2.5rem; width: 100%; max-width: 420px;
    box-shadow: var(--shadow-lg); position: relative;
}
.auth-card::before {
    content: ''; position: absolute; top: -2px; left: 20%; right: 20%; height: 3px;
    background: linear-gradient(90deg, var(--blue), var(--orange));
    border-radius: 2px;
}
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-header h1 { font-size: 1.6rem; color: var(--blue-dark); margin-bottom: 0.2rem; }
.auth-header p { color: var(--text-dim); font-size: 0.9rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border-light); font-size: 0.9rem; color: var(--text-dim); }

/* ─── Search results ──────────────────────────────────────────────────── */
.search-results-users {
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius); padding: 1rem;
    margin-bottom: 1rem; box-shadow: var(--shadow-sm);
}
.search-results-users h3 { font-size: 0.85rem; color: var(--blue); margin-bottom: 0.5rem; }

/* ─── Responsive ──────────────────────────────────────────────────────── */
.nav-hamburger { display:none; background:none; border:none; color:rgba(255,255,255,0.7); cursor:pointer; padding:0.5rem; border-radius:6px; }
.nav-hamburger .px-icon { width: 24px; height: 24px; }
.nav-hamburger:hover { color:var(--orange); background:rgba(255,107,43,0.1); }

@media (max-width: 900px) {
    .sidebar { display: none; }
    .main-layout { padding: 1rem; }
    .content-main { max-width: 100%; }
    .annals-sidebar { display: none; }
    .annals-layout { padding: 1rem; }
}
@media (max-width: 700px) {
    .nav-hamburger { display: block; }
    .nav-links, .nav-user {
        display: none; position: fixed; top: var(--nav-height); left: 0; right: 0;
        background: var(--bg-dark); flex-direction: column; padding: 0.5rem 1rem 1rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.3); z-index: 999;
    }
    .nav-links.open, .nav-user.open { display: flex; }
    .nav-user.open { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 0.75rem; }
    .nav-link { padding: 0.6rem 0.75rem; }
    .navbar { padding: 0 1rem; }
}
@media (max-width: 600px) {
    .nav-link span:not(.icon) { display: none; }
    .nav-char-info { display: none; }
    .landing-title { font-size: 2.5rem; }
    .landing-features { grid-template-columns: 1fr; }
    .profile-stats { gap: 1rem; }
    .post-title-bar { font-size: 1.1rem; }
}

/* ─── Pagination ─────────────────────────────────────────────────────── */
.pagination {
    display: flex; align-items: center; justify-content: center; gap: 1rem;
    padding: 1.5rem 0; margin-top: 0.5rem;
}
.pagination-btn {
    padding: 0.5rem 1.2rem; border-radius: 8px;
    background: var(--blue); color: white;
    font-family: var(--font-display); font-size: 0.85rem;
    text-decoration: none; letter-spacing: 0.04em; transition: all 0.2s;
}
.pagination-btn:hover { background: var(--blue-dark); color: white; transform: translateY(-1px); }
.pagination-info { font-size: 0.85rem; color: var(--text-dim); font-family: var(--font-display); letter-spacing: 0.04em; }

/* ─── Comment Delete ─────────────────────────────────────────────────── */
.comment-delete-btn {
    background: none; border: none; color: var(--text-dim); cursor: pointer;
    font-size: 0.7rem; padding: 0 0.3rem; margin-left: 0.5rem;
    transition: color 0.2s; opacity: 0;
}
.comment:hover .comment-delete-btn { opacity: 1; }
.comment-delete-btn:hover { color: #c62828; }

/* ─── Message Badge ───────────────────────────────────────────────────── */
.msg-badge {
    position: absolute; top: 2px; right: 0;
    background: var(--orange); color: white;
    font-size: 0.6rem; font-weight: 800;
    min-width: 16px; height: 16px;
    border-radius: 50%; display: flex;
    align-items: center; justify-content: center;
    line-height: 1;
}

/* ─── Messages / DM System ────────────────────────────────────────────── */
.inbox-list { display: flex; flex-direction: column; gap: 0; }
.inbox-item {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.9rem 1.25rem; background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    transition: background 0.15s; cursor: pointer;
    text-decoration: none; color: inherit;
}
.inbox-item:hover { background: var(--blue-pale); color: inherit; }
.inbox-item.unread { background: var(--orange-pale); font-weight: 700; }
.inbox-item.unread:hover { background: #ffe8d6; }
.inbox-avatar { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--blue-light); object-fit: cover; background: var(--bg-light); flex-shrink: 0; }
.inbox-info { flex: 1; min-width: 0; }
.inbox-name { font-family: var(--font-display); font-size: 0.95rem; color: var(--text-primary); letter-spacing: 0.03em; }
.inbox-preview { font-size: 0.82rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.inbox-time { font-size: 0.72rem; color: var(--text-dim); flex-shrink: 0; }
.inbox-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); flex-shrink: 0; }

.conv-header {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 1rem 1.25rem; background: var(--bg-card);
    border-bottom: 1px solid var(--border-light);
    position: sticky; top: var(--nav-height); z-index: 10;
    box-shadow: var(--shadow-sm);
}
.conv-header-name { font-family: var(--font-display); font-size: 1.1rem; color: var(--text-primary); letter-spacing: 0.03em; }
.conv-header-username { font-size: 0.78rem; color: var(--text-dim); }
.conv-messages {
    display: flex; flex-direction: column; gap: 0.5rem;
    padding: 1.25rem; min-height: 400px; max-height: 60vh;
    overflow-y: auto; background: var(--bg-light);
}
.msg-bubble { display: flex; gap: 0.5rem; max-width: 75%; }
.msg-bubble.mine { margin-left: auto; flex-direction: row-reverse; }
.msg-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border-light); background: var(--bg-card); }
.msg-body { padding: 0.6rem 0.9rem; border-radius: 16px; font-size: 0.9rem; line-height: 1.5; max-width: 100%; word-break: break-word; }
.msg-bubble:not(.mine) .msg-body { background: var(--bg-card); border: 1px solid var(--border-light); color: var(--text-body); border-bottom-left-radius: 4px; }
.msg-bubble.mine .msg-body { background: var(--blue); color: white; border-bottom-right-radius: 4px; }
.msg-time { font-size: 0.65rem; color: var(--text-dim); margin-top: 0.15rem; padding: 0 0.5rem; }
.msg-bubble.mine .msg-time { text-align: right; }
.conv-input-bar {
    display: flex; gap: 0.5rem; padding: 0.75rem 1.25rem;
    background: var(--bg-card); border-top: 1px solid var(--border-light);
}
.conv-input {
    flex: 1; padding: 0.6rem 1rem; background: var(--bg-light);
    border: 2px solid var(--border-light); border-radius: 24px;
    font-family: var(--font-body); font-size: 0.95rem; color: var(--text-primary);
}
.conv-input:focus { outline: none; border-color: var(--blue); }
.conv-send-btn {
    padding: 0.6rem 1.2rem; background: var(--blue); color: white;
    border: none; border-radius: 24px; font-family: var(--font-display);
    font-size: 0.9rem; cursor: pointer; transition: background 0.2s;
    letter-spacing: 0.04em;
}
.conv-send-btn:hover { background: var(--blue-dark); }

/* ─── Annals / Wiki Styles ────────────────────────────────────────────── */
.annals-layout {
    display: flex; max-width: 1200px; margin: 0 auto;
    padding: 1.5rem; gap: 1.5rem;
}
.annals-content { flex: 1; min-width: 0; }
.annals-sidebar {
    width: 260px; flex-shrink: 0;
    position: sticky; top: calc(var(--nav-height) + 1rem);
    align-self: flex-start; max-height: calc(100vh - var(--nav-height) - 2rem);
    overflow-y: auto;
}
.annals-sidebar-card {
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius); padding: 1rem;
    box-shadow: var(--shadow-sm); margin-bottom: 1rem;
}
.annals-sidebar-title {
    font-family: var(--font-display); font-size: 0.85rem;
    color: var(--blue-dark); letter-spacing: 0.05em;
    padding-bottom: 0.5rem; margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-light);
}
.annals-nav-item {
    display: block; padding: 0.45rem 0.75rem;
    font-size: 0.85rem; color: var(--text-muted);
    border-radius: 6px; transition: all 0.15s;
    text-decoration: none; margin: 0.1rem 0; font-weight: 600;
}
.annals-nav-item:hover { background: var(--blue-pale); color: var(--blue-dark); }
.annals-nav-item.active { background: var(--blue); color: white; }
.annals-nav-item .age-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    background: var(--border-light); color: var(--text-dim);
    font-size: 0.7rem; font-weight: 800; margin-right: 0.35rem;
}
.annals-nav-item.active .age-num { background: rgba(255,255,255,0.25); color: white; }
.annals-nav-item:hover .age-num { background: var(--blue-light); color: white; }

.annals-article {
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow-sm);
}
.annals-article-title {
    font-family: var(--font-title); font-size: 2rem;
    color: var(--text-primary); margin-bottom: 0.5rem; letter-spacing: 0.04em;
}
.annals-article-subtitle {
    font-family: var(--font-display); font-size: 1rem;
    color: var(--text-dim); margin-bottom: 1.5rem; letter-spacing: 0.04em;
}
.annals-article-body {
    font-size: 1rem; line-height: 1.85; color: var(--text-body); white-space: pre-wrap;
}
.annals-divider { border: none; border-top: 1px solid var(--border-light); margin: 1.5rem 0; }
.annals-breadcrumb {
    display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap;
    font-size: 0.82rem; color: var(--text-dim); margin-bottom: 1rem; font-weight: 600;
}
.annals-breadcrumb a { color: var(--blue); }
.annals-breadcrumb a:hover { color: var(--orange); }
.annals-breadcrumb .sep { color: var(--border-medium); }

.century-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.6rem; margin-top: 1.25rem;
}
.century-card {
    padding: 0.9rem 1rem; background: var(--bg-light);
    border: 1px solid var(--border-light); border-radius: 8px;
    transition: all 0.2s; text-decoration: none; color: inherit;
}
.century-card:hover { border-color: var(--blue); background: var(--blue-pale); transform: translateY(-2px); box-shadow: var(--shadow-md); color: inherit; }
.century-card-num { font-family: var(--font-display); font-size: 0.8rem; color: var(--blue); letter-spacing: 0.05em; }
.century-card-name { font-size: 0.85rem; color: var(--text-primary); font-weight: 700; margin-top: 0.15rem; }

.story-list { margin-top: 1.25rem; }
.story-link {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.75rem 1rem; margin: 0.35rem 0;
    background: var(--bg-light); border: 1px solid var(--border-light);
    border-radius: 8px; border-left: 3px solid var(--orange);
    transition: all 0.2s; text-decoration: none; color: inherit;
}
.story-link:hover { border-left-color: var(--blue); background: var(--blue-pale); transform: translateX(4px); color: inherit; }
.story-link-icon { font-size: 1.1rem; }
.story-link-title { font-family: var(--font-display); font-size: 0.95rem; color: var(--text-primary); letter-spacing: 0.03em; }

.annals-search-bar {
    display: flex; gap: 0.5rem; background: var(--bg-card); border: 2px solid var(--border-light);
    border-radius: 50px; padding: 0.4rem 0.5rem; margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm); transition: border-color 0.2s;
}
.annals-search-bar:focus-within { border-color: var(--blue); }
.annals-search-bar input {
    flex: 1; border: none; background: none; outline: none;
    font-family: var(--font-body); font-size: 0.95rem; color: var(--text-primary); padding: 0.4rem 0.75rem;
}
.annals-search-bar button {
    padding: 0.5rem 1.2rem; border: none; border-radius: 50px;
    background: var(--blue); color: white;
    font-family: var(--font-display); font-size: 0.9rem; letter-spacing: 0.04em; cursor: pointer;
}

.search-result-item {
    padding: 1rem; margin-bottom: 0.6rem; background: var(--bg-card);
    border: 1px solid var(--border-light); border-radius: 8px; transition: box-shadow 0.2s;
}
.search-result-item:hover { box-shadow: var(--shadow-md); }
.search-result-type {
    display: inline-block; padding: 0.1rem 0.45rem;
    font-size: 0.7rem; font-family: var(--font-display);
    letter-spacing: 0.05em; border-radius: 4px; margin-bottom: 0.3rem;
}
.search-result-type.age { background: var(--blue-pale); color: var(--blue-dark); }
.search-result-type.century { background: var(--orange-pale); color: var(--orange-dark); }
.search-result-type.story { background: #e8f5e9; color: #2e7d32; }
.search-result-type.user_story { background: #e3f2fd; color: #1565c0; }
.search-result-title { font-family: var(--font-display); font-size: 1rem; color: var(--text-primary); letter-spacing: 0.03em; }
.search-result-snippet { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.2rem; line-height: 1.5; }

/* ─── About Page ─────────────────────────────────────────────────────── */
.about-page {
    max-width: 800px; margin: calc(var(--nav-height) + 2rem) auto 2rem;
    padding: 0 1.5rem;
}
.about-hero {
    text-align: center; padding: 3rem 2rem;
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius); box-shadow: var(--shadow-md);
    margin-bottom: 2rem; position: relative; overflow: hidden;
}
.about-hero::before {
    content: ''; position: absolute; inset: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(26,115,232,0.06) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(255,107,43,0.06) 0%, transparent 60%);
    pointer-events: none;
}
.about-hero > * { position: relative; z-index: 1; }
.about-mascot {
    width: 192px; height: 192px;
    image-rendering: pixelated; image-rendering: crisp-edges;
    margin: 0 auto 1.5rem; display: block;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 8px 16px rgba(74,140,63,0.3));
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.about-title {
    font-family: var(--font-title); font-size: 2.8rem;
    color: var(--orange); letter-spacing: 0.06em; margin-bottom: 0.3rem;
    text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}
.about-tagline {
    font-family: var(--font-pixel); font-size: 0.6rem;
    color: var(--text-dim); letter-spacing: 0.1em;
    text-transform: uppercase; margin-bottom: 0;
}
.about-content {
    background: var(--bg-card); border: 1px solid var(--border-light);
    border-radius: var(--radius); padding: 2rem 2.5rem;
    box-shadow: var(--shadow-sm);
}
.about-content h2 {
    font-family: var(--font-pixel); font-size: 0.65rem;
    color: var(--blue); text-transform: uppercase;
    letter-spacing: 0.1em; margin-bottom: 1rem;
    padding-bottom: 0.75rem; border-bottom: 2px dashed var(--border-light);
}
.about-content p {
    font-size: 1rem; line-height: 1.85; color: var(--text-body);
    margin-bottom: 1.25rem;
}
.about-content strong { color: var(--text-primary); }
.about-features {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
    margin: 1.5rem 0;
}
.about-feature-item {
    display: flex; align-items: flex-start; gap: 0.75rem;
    padding: 1rem; background: var(--bg-light);
    border: 1px solid var(--border-light); border-radius: 8px;
}
.about-feature-item .px-icon { width: 1.5rem; height: 1.5rem; flex-shrink: 0; margin-top: 0.1rem; }
.about-feature-item h3 {
    font-family: var(--font-pixel); font-size: 0.5rem;
    color: var(--blue-dark); text-transform: uppercase;
    letter-spacing: 0.06em; margin-bottom: 0.3rem;
}
.about-feature-item p { font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 0; }
.about-cta {
    text-align: center; margin-top: 2rem;
    padding-top: 1.5rem; border-top: 2px dashed var(--border-light);
}
.about-cta p {
    font-family: var(--font-pixel); font-size: 0.5rem;
    color: var(--text-dim); text-transform: uppercase;
    letter-spacing: 0.08em; margin-bottom: 1rem;
}
.about-donate-links {
    display: flex; gap: 1rem; justify-content: center;
    margin-top: 1.25rem; flex-wrap: wrap;
}
.donate-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-size: 0.85rem; padding: 0.55rem 1.25rem;
}
@media (max-width: 600px) {
    .about-features { grid-template-columns: 1fr; }
    .about-title { font-size: 2rem; }
    .about-mascot { width: 128px; height: 128px; }
    .about-content { padding: 1.5rem; }
}

/* ─── Retro Pixel Decorative ─────────────────────────────────────────── */
.auth-card::before {
    content: ''; position: absolute; top: -3px; left: 20%; right: 20%; height: 3px;
    background: repeating-linear-gradient(90deg, var(--blue) 0px, var(--blue) 4px, transparent 4px, transparent 8px, var(--orange) 8px, var(--orange) 12px, transparent 12px, transparent 16px);
    border-radius: 0;
}
.post-card::after {
    content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px;
    background: repeating-linear-gradient(90deg, var(--blue) 0px, var(--blue) 3px, transparent 3px, transparent 6px);
    opacity: 0; transition: opacity 0.3s;
}
.post-card { position: relative; overflow: hidden; }
.post-card:hover::after { opacity: 0.3; }

/* ═══════════════════════════════════════════════════════════════════════════
   DARK MODE
   ═══════════════════════════════════════════════════════════════════════════ */
body.dark-mode {
    --bg-white: #1a1a2e;
    --bg-light: #12121f;
    --bg-card: #1e1e32;
    --bg-dark: #0a0a14;
    --bg-darker: #06060c;

    --blue: #4a9af5;
    --blue-light: #6ab4ff;
    --blue-pale: #1a2a40;
    --blue-dark: #6ab4ff;

    --orange: #ff8f5e;
    --orange-light: #ffaa80;
    --orange-pale: #2a1a10;
    --orange-dark: #ffaa80;

    --black: #e0e0f0;
    --black-soft: #c0c0d8;

    --text-primary: #e8e8f4;
    --text-body: #b8b8cc;
    --text-muted: #8888a0;
    --text-dim: #606078;
    --text-white: #ffffff;

    --border-light: #2a2a42;
    --border-medium: #3a3a58;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
    --shadow-pop: 0 6px 20px rgba(255, 143, 94, 0.2);

    color-scheme: dark;
}

/* Dark mode navbar already dark — just tweak borders */
body.dark-mode .navbar {
    background: var(--bg-darker);
    box-shadow: 0 2px 10px rgba(0,0,0,0.6);
}

/* Cards and inputs */
body.dark-mode .card,
body.dark-mode .sidebar-card,
body.dark-mode .auth-card,
body.dark-mode .annals-article,
body.dark-mode .annals-sidebar-card,
body.dark-mode .search-result-item,
body.dark-mode .inbox-item,
body.dark-mode .conv-header,
body.dark-mode .conv-input-bar {
    background: var(--bg-card);
    border-color: var(--border-light);
}

body.dark-mode .form-input,
body.dark-mode .bs-textarea,
body.dark-mode .conv-input,
body.dark-mode .annals-search-bar,
body.dark-mode select.form-input {
    background: var(--bg-light);
    border-color: var(--border-light);
    color: var(--text-primary);
}

body.dark-mode .form-input:focus,
body.dark-mode .bs-textarea:focus,
body.dark-mode .conv-input:focus {
    border-color: var(--blue);
}

/* Trait chips and badges */
body.dark-mode .trait-chip {
    background: var(--bg-card);
    border-color: var(--border-light);
    color: var(--text-muted);
}
body.dark-mode .trait-chip.selected {
    background: var(--blue-pale);
    border-color: var(--blue);
    color: var(--blue);
}
body.dark-mode .trait-badge {
    background: var(--blue-pale);
    border-color: var(--border-light);
    color: var(--blue);
}

/* Post cards */
body.dark-mode .post-card::after {
    background: repeating-linear-gradient(90deg, var(--blue) 0px, var(--blue) 3px, transparent 3px, transparent 6px);
}

/* Race/class option tiles */
body.dark-mode .rc-option {
    background: var(--bg-card);
    border-color: var(--border-light);
}
body.dark-mode .rc-option:hover {
    background: var(--blue-pale);
    border-color: var(--blue);
}
body.dark-mode .rc-option.selected {
    background: var(--orange-pale);
    border-color: var(--orange);
}

/* Buttons */
body.dark-mode .btn-ghost {
    border-color: var(--border-light);
    color: var(--text-muted);
}
body.dark-mode .btn-ghost:hover {
    border-color: var(--blue);
    color: var(--blue);
    background: var(--blue-pale);
}

/* Scrollbar */
body.dark-mode::-webkit-scrollbar-track { background: var(--bg-light); }
body.dark-mode::-webkit-scrollbar-thumb { background: var(--border-medium); }

/* Messages */
body.dark-mode .msg-bubble:not(.mine) .msg-body {
    background: var(--bg-card);
    border-color: var(--border-light);
    color: var(--text-body);
}
body.dark-mode .conv-messages { background: var(--bg-light); }

/* Inbox */
body.dark-mode .inbox-item:hover { background: var(--blue-pale); }
body.dark-mode .inbox-item.unread { background: var(--orange-pale); }
body.dark-mode .inbox-item.unread:hover { background: #2a1a10; }

/* Century/story cards */
body.dark-mode .century-card { background: var(--bg-card); border-color: var(--border-light); }
body.dark-mode .century-card:hover { background: var(--blue-pale); border-color: var(--blue); }
body.dark-mode .story-link { background: var(--bg-card); border-color: var(--border-light); }
body.dark-mode .story-link:hover { background: var(--blue-pale); }

/* Landing — already dark, no changes needed */

/* Auth card stripe */
body.dark-mode .auth-card::before {
    background: repeating-linear-gradient(90deg, var(--blue) 0px, var(--blue) 4px, transparent 4px, transparent 8px, var(--orange) 8px, var(--orange) 12px, transparent 12px, transparent 16px);
}

/* Avatar picker */
body.dark-mode .avatar-option { background: var(--bg-card); border-color: var(--border-light); }
body.dark-mode .trait-grid { background: var(--bg-light); border-color: var(--border-light); }

/* About page */
body.dark-mode .about-hero { background: var(--bg-card); border-color: var(--border-light); }
body.dark-mode .about-content { background: var(--bg-card); border-color: var(--border-light); }
body.dark-mode .about-feature-item { background: var(--bg-light); border-color: var(--border-light); }

/* Nav links in mobile dropdown */
body.dark-mode .nav-links.open,
body.dark-mode .nav-user.open {
    background: var(--bg-darker);
}

/* Flash messages */
body.dark-mode .flash { border-color: var(--border-light); }

/* Pixel icons — invert filter for dark backgrounds where needed */
body.dark-mode .nav-hamburger .px-icon { filter: none; }

/* Profile */
body.dark-mode .profile-header { border-color: var(--border-light); }

/* ─── Theme Toggle Switch ────────────────────────────────────────────── */
.theme-toggle {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 0; gap: 1rem;
}
.theme-toggle-label {
    font-family: var(--font-display); font-size: 0.95rem;
    color: var(--text-primary); letter-spacing: 0.03em;
}
.theme-toggle-sub {
    font-size: 0.8rem; color: var(--text-dim); margin-top: 0.15rem;
}
.toggle-switch {
    position: relative; width: 52px; height: 28px;
    background: var(--border-medium); border-radius: 14px;
    cursor: pointer; transition: background 0.3s; flex-shrink: 0;
    border: 2px solid var(--border-light);
}
.toggle-switch.active {
    background: var(--blue); border-color: var(--blue);
}
.toggle-switch::after {
    content: ''; position: absolute;
    top: 2px; left: 2px;
    width: 20px; height: 20px;
    background: white; border-radius: 50%;
    transition: transform 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch.active::after {
    transform: translateX(24px);
}
.theme-toggle-icons {
    display: flex; align-items: center; gap: 0.5rem;
}
.theme-toggle-icons .px-icon { width: 1.3em; height: 1.3em; }

/* ═══════════════════════════════════════════════════════════════════════════
   SCRIBE TIER SYSTEM — Avatar borders & badges
   ═══════════════════════════════════════════════════════════════════════════ */

/* Tier badge base */
.scribe-badge {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.15rem 0.5rem; border-radius: 12px;
    font-family: var(--font-display); font-size: 0.72rem;
    letter-spacing: 0.04em; font-weight: 600; white-space: nowrap;
}
.scribe-badge-bronze { background: #efebe9; color: #6d4c41; border: 1px solid #bcaaa4; }
.scribe-badge-silver { background: #f5f5f5; color: #616161; border: 1px solid #bdbdbd; }
.scribe-badge-gold   { background: #fff8e1; color: #f57f17; border: 1px solid #ffe082; }
.scribe-badge-purple { background: #f3e5f5; color: #6a1b9a; border: 1px solid #ce93d8; }
.scribe-badge-legendary { background: linear-gradient(135deg, #fff3e0, #ffe0b2); color: #e65100; border: 1px solid #ffb74d; }

/* Avatar border rings */
.avatar-ring { position: relative; display: inline-block; }
.avatar-ring img, .avatar-ring .avatar-placeholder {
    position: relative; z-index: 1;
}
.avatar-ring::before {
    content: ''; position: absolute; inset: -4px;
    border-radius: 50%; z-index: 0;
}
.avatar-ring-bronze::before  { background: linear-gradient(135deg, #8d6e63, #d7ccc8, #8d6e63); }
.avatar-ring-silver::before  { background: linear-gradient(135deg, #9e9e9e, #e0e0e0, #9e9e9e); }
.avatar-ring-gold::before    { background: linear-gradient(135deg, #f9a825, #fff176, #f9a825); }
.avatar-ring-purple::before  { background: linear-gradient(135deg, #7b1fa2, #ce93d8, #7b1fa2); }
.avatar-ring-legendary::before {
    background: conic-gradient(#ff6f00, #f9a825, #ff6f00, #e65100, #ff6f00);
    animation: legendaryRing 3s linear infinite;
}
@keyframes legendaryRing {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
/* Mask the spinning gradient to just a ring */
.avatar-ring-legendary::after {
    content: ''; position: absolute;
    inset: 0; border-radius: 50%;
    background: var(--bg-card); z-index: 0;
}
.avatar-ring-legendary img, .avatar-ring-legendary .avatar-placeholder {
    z-index: 2;
}

/* Profile-specific large ring */
.profile-avatar-ring { position: relative; display: inline-block; margin-bottom: 1rem; }
.profile-avatar-ring::before {
    content: ''; position: absolute; inset: -6px;
    border-radius: 50%; z-index: 0;
}
.profile-avatar-ring-bronze::before  { background: linear-gradient(135deg, #8d6e63, #d7ccc8, #8d6e63); }
.profile-avatar-ring-silver::before  { background: linear-gradient(135deg, #9e9e9e, #e0e0e0, #9e9e9e); }
.profile-avatar-ring-gold::before    { background: linear-gradient(135deg, #f9a825, #fff176, #f9a825); }
.profile-avatar-ring-purple::before  { background: linear-gradient(135deg, #7b1fa2, #ce93d8, #7b1fa2); }
.profile-avatar-ring-legendary::before {
    background: conic-gradient(#ff6f00, #f9a825, #ff6f00, #e65100, #ff6f00);
    animation: legendaryRing 3s linear infinite;
}
.profile-avatar-ring-legendary::after {
    content: ''; position: absolute;
    inset: 0; border-radius: 50%;
    background: var(--bg-card); z-index: 0;
}
.profile-avatar-ring img, .profile-avatar-ring .avatar-placeholder {
    position: relative; z-index: 2;
}

/* Canon story glow */
.annals-canon-badge {
    display: inline-flex; align-items: center; gap: 0.25rem;
    padding: 0.2rem 0.6rem; border-radius: 12px;
    background: linear-gradient(135deg, #fff8e1, #ffe0b2);
    color: #e65100; border: 1px solid #ffb74d;
    font-family: var(--font-display); font-size: 0.72rem;
    font-weight: 700; letter-spacing: 0.04em;
}
.annals-story-canon {
    border-left: 3px solid #f9a825 !important;
    background: linear-gradient(135deg, var(--bg-card), #fffde7) !important;
}

/* Hall of Scribes */
.hall-card {
    display: flex; align-items: center; gap: 1rem;
    padding: 1rem 1.2rem; background: var(--bg-card);
    border-radius: 12px; border: 1px solid var(--border-light);
    transition: transform 0.2s, box-shadow 0.2s;
}
.hall-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.hall-rank {
    font-family: var(--font-display); font-size: 1.4rem;
    font-weight: 800; color: var(--text-dim); min-width: 2.5rem; text-align: center;
}
.hall-rank-1 { color: #f9a825; font-size: 1.8rem; }
.hall-rank-2 { color: #9e9e9e; font-size: 1.6rem; }
.hall-rank-3 { color: #8d6e63; font-size: 1.5rem; }
.hall-info { flex: 1; min-width: 0; }
.hall-name { font-family: var(--font-display); font-size: 1rem; color: var(--text-primary); font-weight: 600; }
.hall-username { font-size: 0.8rem; color: var(--text-dim); }
.hall-count { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--blue); text-align: right; }

/* Tier progress bar */
.tier-progress-bar {
    width: 100%; height: 8px; background: var(--bg-light);
    border-radius: 4px; overflow: hidden; margin-top: 0.3rem;
}
.tier-progress-fill {
    height: 100%; border-radius: 4px; transition: width 0.5s ease;
}

/* Donation sidebar card */
.sidebar-donate-card:hover { background: rgba(255,111,0,0.12) !important; }

