/* ============================================
   THE CHRONICLER - Premium Fantasy Theme
   Deep cosmic x magical interface
   ============================================ */

:root {
    /* Core palette - Dark Theme (default) */
    --chr-bg-dark: #070b14;
    --chr-bg-card: rgba(15, 20, 36, 0.78);
    --chr-bg-surface: rgba(24, 31, 55, 0.9);
    --chr-border: rgba(147, 160, 199, 0.14);
    --chr-border-strong: rgba(140, 102, 255, 0.35);
    
    /* Primary colors */
    --chr-primary: #8b5cf6;
    --chr-primary-dim: #6d3df0;
    --chr-secondary: #4fd1ff;
    --chr-accent: #ffcc66;
    --chr-gold: #f2c66d;
    --chr-gold-dim: #c59b45;
    
    /* Semantic colors */
    --chr-red: #ef4444;
    --chr-green: #22c55e;
    --chr-blue: #3b82f6;
    --chr-purple: #a855f7;
    --chr-cyan: #06b6d4;
    
    /* Text */
    --chr-text: #f6f7fb;
    --chr-text-muted: #98a4c4;
    
    /* Shadows & effects */
    --chr-shadow-lg: 0 30px 80px rgba(0,0,0,.45);
    --chr-shadow-glow: 0 0 40px rgba(139,92,246,.18);
    --chr-shadow-gold: 0 0 40px rgba(242,198,109,.15);
    
    /* Radius */
    --chr-radius-xl: 22px;
    --chr-radius-lg: 16px;
    --chr-radius-md: 12px;
    --chr-radius-sm: 8px;
    
    /* Spotlight position */
    --spot-x: 50%;
    --spot-y: 50%;
}

/* Light Theme */
body.light-theme {
    --chr-bg-dark: #f8f9fc;
    --chr-bg-card: rgba(255, 255, 255, 0.9);
    --chr-bg-surface: rgba(241, 243, 249, 0.95);
    --chr-border: rgba(100, 116, 145, 0.2);
    --chr-border-strong: rgba(139, 92, 246, 0.4);
    
    --chr-text: #1e293b;
    --chr-text-muted: #64748b;
    
    --chr-shadow-lg: 0 20px 60px rgba(0,0,0,.08);
    --chr-shadow-glow: 0 0 30px rgba(139,92,246,.12);
    --chr-shadow-gold: 0 0 30px rgba(242,198,109,.1);
}

body.light-theme body.app-body {
    background:
        radial-gradient(circle at top, rgba(139, 92, 246, 0.08), transparent 35%),
        radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.06), transparent 25%),
        linear-gradient(180deg, #f8f9fc 0%, #f1f3f9 45%, #f5f6fa 100%);
}

body.light-theme .chronicler-nav {
    background: rgba(255, 255, 255, .85);
    border-bottom: 1px solid rgba(100, 116, 145, 0.15);
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
}

body.light-theme .bg-gradient {
    opacity: .15;
}

body.light-theme .bg-gradient-a {
    background: radial-gradient(circle, rgba(139,92,246,.5) 0%, transparent 70%);
}

body.light-theme .bg-gradient-b {
    background: radial-gradient(circle, rgba(6,182,212,.4) 0%, transparent 70%);
}

body.light-theme .bg-gradient-c {
    background: radial-gradient(circle, rgba(242,198,109,.3) 0%, transparent 70%);
}

body.light-theme .bg-grid {
    opacity: .04;
}

body.light-theme .bg-spotlight {
    background:
        radial-gradient(
            26rem circle at var(--spot-x) var(--spot-y),
            rgba(139,92,246,.06),
            transparent 55%
        );
}

body.light-theme .card, 
body.light-theme .chronicler-card {
    background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(248,250,252,.9));
    border: 1px solid rgba(100, 116, 145, 0.15);
}

body.light-theme .card:hover, 
body.light-theme .chronicler-card:hover {
    border-color: rgba(139,92,246,.3);
    box-shadow: var(--chr-shadow-lg), 0 0 20px rgba(139,92,246,.08);
}

body.light-theme .card-header {
    background: linear-gradient(180deg, rgba(241,243,249,.9), rgba(248,250,252,.7));
    border-bottom: 1px solid rgba(100, 116, 145, 0.1);
}

body.light-theme .form-control,
body.light-theme .form-select {
    background: rgba(255,255,255,.9);
    border: 1px solid rgba(100, 116, 145, 0.2);
    color: var(--chr-text);
}

body.light-theme .form-control:focus,
body.light-theme .form-select:focus {
    background: #fff;
    border-color: rgba(139,92,246,.5);
    box-shadow: 0 0 0 .2rem rgba(139,92,246,.1), 0 0 15px rgba(139,92,246,.06);
}

body.light-theme .dropdown-menu {
    background: rgba(255,255,255,.98);
    border: 1px solid rgba(100, 116, 145, 0.15);
}

body.light-theme .dropdown-item:hover {
    background: rgba(139, 92, 246, 0.1);
}

body.light-theme .entity-card,
body.light-theme .character-card,
body.light-theme .campaign-card {
    background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(248,250,252,.88));
    border: 1px solid rgba(100, 116, 145, 0.12);
}

body.light-theme .hero-section {
    background:
        radial-gradient(circle at top left, rgba(139,92,246,.12), transparent 30%),
        radial-gradient(circle at 80% 10%, rgba(6,182,212,.08), transparent 24%),
        linear-gradient(180deg, rgba(255,255,255,.95), rgba(248,250,252,.9));
    border: 1px solid rgba(100, 116, 145, 0.12);
}

body.light-theme .stat-card {
    background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(248,250,252,.9));
    border: 1px solid rgba(100, 116, 145, 0.12);
}

body.light-theme .campaign-launcher {
    background: linear-gradient(145deg, rgba(255,255,255,.98), rgba(248,250,252,.95));
    border: 1px solid rgba(100, 116, 145, 0.1);
}

body.light-theme .campaign-launcher:hover {
    border-color: rgba(139,92,246,.2);
}

body.light-theme .activity-item {
    border-bottom: 1px solid rgba(100, 116, 145, 0.08);
}

body.light-theme .activity-item:hover {
    background: rgba(139, 92, 246, 0.04);
}

body.light-theme .table thead th {
    background: rgba(241, 243, 249, .8);
    color: var(--chr-primary);
}

body.light-theme .chronicler-footer {
    background: rgba(248, 250, 252, .9);
    border-color: rgba(100, 116, 145, 0.1) !important;
}

body.light-theme .cursor-ring {
    border-color: rgba(100, 116, 145, 0.4);
    box-shadow: 0 0 20px rgba(139,92,246,.12);
}

body.light-theme .page-transition__veil {
    background:
        radial-gradient(circle at center, rgba(139,92,246,.06), transparent 30%),
        linear-gradient(180deg, rgba(248,250,252,.92), rgba(248,250,252,.98));
}

body.light-theme .notes-editor {
    background: rgba(255,255,255,.9);
    border: 1px solid rgba(100, 116, 145, 0.2);
}

body.light-theme .gm-notes {
    background: rgba(239, 68, 68, 0.04);
    border-color: rgba(239, 68, 68, 0.25);
}

body.light-theme ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(139,92,246,.5), rgba(6,182,212,.4));
}

body.light-theme ::-webkit-scrollbar-track {
    background: rgba(241, 243, 249, .5);
}

body.light-theme .feature-card {
    background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(248,250,252,.88));
    border: 1px solid rgba(100, 116, 145, 0.12);
}

body.light-theme .list-group-item {
    background: rgba(255,255,255,.7);
}

body.light-theme .list-group-item.active {
    background: linear-gradient(135deg, rgba(139,92,246,.12), rgba(139,92,246,.06));
    border-color: rgba(139,92,246,.3);
    color: var(--chr-primary);
}

body.light-theme .upload-option {
    background: rgba(241, 243, 249, .6);
    border-color: rgba(100, 116, 145, 0.15);
}

body.light-theme .campaign-cover-overlay {
    background: linear-gradient(transparent, rgba(0, 0, 0, .6));
}

body.light-theme .character-portrait-placeholder {
    background: linear-gradient(145deg, rgba(241,243,249,.95) 0%, rgba(226,232,240,.9) 100%);
}

body.light-theme .image-grid-overlay {
    background: rgba(0, 0, 0, .4);
}

body.light-theme .section-header-line {
    background: linear-gradient(90deg, var(--chr-primary), transparent);
}

/* ============================================
   BASE STYLES
   ============================================ */

html {
    font-size: 15px;
    min-height: 100%;
    scroll-behavior: smooth;
}

body.app-body {
    background:
        radial-gradient(circle at top, rgba(88, 28, 135, 0.18), transparent 35%),
        radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.12), transparent 25%),
        linear-gradient(180deg, #060914 0%, #0b1020 45%, #090d18 100%);
    color: var(--chr-text);
    font-family: 'Segoe UI', Inter, system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    cursor: none;
}

main.container, main.container-fluid {
    flex: 1;
}

::selection {
    background: rgba(139,92,246,.35);
    color: #fff;
}

a {
    color: var(--chr-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--chr-primary);
}

/* ============================================
   APP SHELL & BACKGROUND
   ============================================ */

.app-shell {
    position: relative;
    z-index: 2;
}

.app-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-gradient {
    position: absolute;
    width: 46rem;
    height: 46rem;
    filter: blur(80px);
    opacity: .28;
    border-radius: 50%;
    animation: floatOrb 18s ease-in-out infinite;
}

.bg-gradient-a {
    top: -10rem;
    left: -8rem;
    background: radial-gradient(circle, rgba(139,92,246,.85) 0%, transparent 70%);
}

.bg-gradient-b {
    top: 20%;
    right: -10rem;
    background: radial-gradient(circle, rgba(79,209,255,.7) 0%, transparent 70%);
    animation-duration: 24s;
}

.bg-gradient-c {
    bottom: -14rem;
    left: 35%;
    background: radial-gradient(circle, rgba(242,198,109,.45) 0%, transparent 70%);
    animation-duration: 20s;
}

.bg-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.bg-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: rgba(139, 92, 246, 0.6);
    border-radius: 50%;
    animation: floatParticle linear infinite;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10vh) scale(1);
        opacity: 0;
    }
}

.bg-grid {
    position: absolute;
    inset: 0;
    opacity: .08;
    background-image:
        linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
}

.bg-noise {
    position: absolute;
    inset: 0;
    opacity: .04;
    background-image:
        radial-gradient(circle at 25% 25%, rgba(255,255,255,.22) 0 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(255,255,255,.18) 0 1px, transparent 1px);
    background-size: 22px 22px, 28px 28px;
}

.bg-spotlight {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            26rem circle at var(--spot-x) var(--spot-y),
            rgba(79,209,255,.10),
            transparent 55%
        );
}

@keyframes floatOrb {
    0%, 100% { transform: translate3d(0,0,0) scale(1); }
    50% { transform: translate3d(0,-24px,0) scale(1.08); }
}

/* ============================================
   NAVBAR
   ============================================ */

.chronicler-nav {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10, 14, 28, .72);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255,255,255,.06);
    box-shadow: 0 12px 40px rgba(0,0,0,.25);
}

.brand-icon {
    color: var(--chr-gold);
    font-size: 1.5rem;
    filter: drop-shadow(0 0 12px rgba(242,198,109,.4));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.brand-icon:hover {
    transform: rotate(-10deg) scale(1.1);
}

.brand-text {
    color: var(--chr-gold);
    font-size: 1.2rem;
    letter-spacing: 1.5px;
    text-shadow: 0 0 24px rgba(242,198,109,.3);
}

.chronicler-nav .nav-link {
    position: relative;
    color: var(--chr-text-muted);
    padding: 0.5rem 1rem;
    transition: transform .18s ease, color .18s ease, opacity .18s ease;
}

.chronicler-nav .nav-link::after {
    content: "";
    position: absolute;
    left: .75rem;
    right: .75rem;
    bottom: .2rem;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, var(--chr-secondary), var(--chr-primary), transparent);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform .22s ease;
    opacity: .9;
}

.chronicler-nav .nav-link:hover {
    color: #fff;
    transform: translateY(-1px);
}

.chronicler-nav .nav-link:hover::after {
    transform: scaleX(1);
}

.ai-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--chr-green);
    margin-right: 6px;
    box-shadow: 0 0 8px var(--chr-green);
    animation: pulse 2s ease-in-out infinite;
}

.ai-status-label {
    font-size: 0.75rem;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.user-avatar {
    border: 2px solid var(--chr-border-strong);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.3);
}

/* ============================================
   DROPDOWN
   ============================================ */

.dropdown-menu {
    background: rgba(15, 20, 36, .95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--chr-border);
    border-radius: var(--chr-radius-md);
    box-shadow: var(--chr-shadow-lg);
    padding: 0.5rem;
}

.dropdown-item {
    color: var(--chr-text);
    border-radius: var(--chr-radius-sm);
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: rgba(139, 92, 246, 0.15);
    color: var(--chr-gold);
    transform: translateX(4px);
}

.dropdown-divider {
    border-color: var(--chr-border);
    margin: 0.5rem 0;
}

/* ============================================
   CARDS - Glassmorphism
   ============================================ */

.card, .chronicler-card {
    position: relative;
    background: linear-gradient(180deg, rgba(20,26,47,.88), rgba(13,18,35,.78));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--chr-radius-lg);
    box-shadow: var(--chr-shadow-lg);
    overflow: hidden;
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.card::before, .chronicler-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(255,255,255,.08), transparent 25%, transparent 60%, rgba(79,209,255,.05));
    pointer-events: none;
    border-radius: inherit;
}

.card:hover, .chronicler-card:hover {
    transform: translateY(-4px);
    border-color: rgba(139,92,246,.32);
    box-shadow: var(--chr-shadow-lg), var(--chr-shadow-glow);
}

.card-header {
    background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01));
    border-bottom: 1px solid rgba(255,255,255,.06);
    padding: 1rem 1.25rem;
}

.card-body {
    padding: 1.25rem;
}

/* ============================================
   BUTTONS - Premium Effects
   ============================================ */

.btn, .nav-link, .dropdown-item, .card, .stat-card {
    will-change: transform, opacity;
}

.btn-chronicle, .btn-outline-chronicle {
    position: relative;
    overflow: hidden;
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: .02em;
    transition: transform .16s ease, box-shadow .22s ease, border-color .22s ease;
}

.btn-chronicle {
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 45%, #4fd1ff 100%);
    border: 1px solid rgba(255,255,255,.16);
    color: #fff;
    box-shadow: 0 12px 30px rgba(124,58,237,.28);
}

.btn-chronicle::before, .btn-outline-chronicle::before {
    content: "";
    position: absolute;
    top: 0;
    left: -140%;
    width: 120%;
    height: 100%;
    transform: skewX(-24deg);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent);
    transition: left .55s ease;
}

.btn-chronicle:hover::before, .btn-outline-chronicle:hover::before {
    left: 140%;
}

.btn-chronicle:hover, .btn-outline-chronicle:hover {
    transform: translateY(-2px) scale(1.01);
    color: #fff;
}

.btn-chronicle:active, .btn-outline-chronicle:active {
    transform: translateY(1px) scale(.985);
}

.btn-outline-chronicle {
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(139,92,246,.4);
    color: #d7cbff;
}

.btn-outline-chronicle:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--chr-primary);
}

/* ============================================
   FORMS
   ============================================ */

.form-control, .form-select {
    background: rgba(17,23,43,.72);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.08);
    color: var(--chr-text);
    border-radius: 14px;
    transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}

.form-control:focus, .form-select:focus {
    background: rgba(17,23,43,.85);
    border-color: rgba(79,209,255,.6);
    box-shadow: 0 0 0 .2rem rgba(79,209,255,.12), 0 0 25px rgba(79,209,255,.08);
    transform: translateY(-1px);
}

.form-control::placeholder {
    color: var(--chr-text-muted);
    opacity: 0.6;
}

.form-label {
    color: var(--chr-text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: var(--chr-secondary);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero-section {
    position: relative;
    padding: 5rem 2rem;
    border-radius: var(--chr-radius-xl);
    background:
        radial-gradient(circle at top left, rgba(139,92,246,.22), transparent 30%),
        radial-gradient(circle at 80% 10%, rgba(79,209,255,.16), transparent 24%),
        linear-gradient(180deg, rgba(18,24,46,.85), rgba(10,14,28,.88));
    border: 1px solid rgba(255,255,255,.08);
    box-shadow: var(--chr-shadow-lg);
    overflow: hidden;
    text-align: center;
}

.hero-section::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(242,198,109,.15), transparent 70%);
    filter: blur(12px);
    animation: floatOrb 16s ease-in-out infinite;
    pointer-events: none;
}

.hero-section::after {
    content: "";
    position: absolute;
    bottom: -30%;
    right: -5%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(79,209,255,.12), transparent 70%);
    filter: blur(10px);
    animation: floatOrb 20s ease-in-out infinite reverse;
    pointer-events: none;
}

.hero-section h1 {
    color: var(--chr-gold);
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    text-shadow: 0 0 40px rgba(242,198,109,.3);
    letter-spacing: 2px;
}

.hero-section .lead {
    color: var(--chr-text);
    font-size: 1.3rem;
    font-weight: 300;
    margin-bottom: 1rem;
}

.hero-section p {
    color: var(--chr-text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

.hero-icon {
    font-size: 5rem;
    color: var(--chr-gold);
    filter: drop-shadow(0 0 30px rgba(242,198,109,.5));
    animation: float 3s ease-in-out infinite;
    margin-bottom: 1.5rem;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ============================================
   STAT CARDS
   ============================================ */

.stat-card {
    text-align: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--chr-primary), var(--chr-secondary));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-card:hover::after {
    transform: scaleX(1);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--chr-gold), var(--chr-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--chr-text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.stat-icon {
    font-size: 1.8rem;
    color: var(--chr-primary);
    margin-bottom: 0.5rem;
    opacity: 0.8;
}

/* ============================================
   PAGE HEADER
   ============================================ */

.page-header {
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--chr-gold), var(--chr-primary), transparent) 1;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
}

.page-header h1, .page-header h2 {
    color: var(--chr-gold);
    font-weight: 700;
    text-shadow: 0 0 24px rgba(242,198,109,.2);
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--chr-radius-md);
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--chr-green);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--chr-red);
}

.alert-warning {
    background: rgba(242, 198, 109, 0.12);
    border: 1px solid rgba(242, 198, 109, 0.3);
    color: var(--chr-gold);
}

.alert-info {
    background: rgba(79, 209, 255, 0.12);
    border: 1px solid rgba(79, 209, 255, 0.3);
    color: var(--chr-secondary);
}

/* ============================================
   TABLES
   ============================================ */

.table {
    color: var(--chr-text);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--chr-border);
    --bs-table-hover-bg: rgba(139, 92, 246, 0.08);
    --bs-table-striped-bg: rgba(255,255,255,0.02);
}

.table thead th {
    background: rgba(255,255,255,.04);
    border-bottom: 2px solid var(--chr-border-strong);
    color: var(--chr-gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.8rem;
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    font-weight: 600;
    padding: 0.4em 0.8em;
    border-radius: 999px;
    letter-spacing: 0.5px;
}

.badge-alive { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.badge-dead { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }
.badge-missing { background: linear-gradient(135deg, #a855f7, #9333ea); color: #fff; }
.badge-unknown { background: rgba(148, 163, 184, 0.3); color: var(--chr-text); }

.badge-active { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.badge-paused { background: linear-gradient(135deg, #f59e0b, #d97706); color: #0d1117; }
.badge-completed { background: linear-gradient(135deg, #3b82f6, #2563eb); color: #fff; }

.badge-gm { background: linear-gradient(135deg, var(--chr-gold), var(--chr-gold-dim)); color: #0d1117; }
.badge-player { background: linear-gradient(135deg, var(--chr-secondary), #0891b2); color: #0d1117; }

/* ============================================
   FOOTER
   ============================================ */

.chronicler-footer {
    background: rgba(10, 14, 28, .8);
    backdrop-filter: blur(12px);
    border-color: rgba(255,255,255,.06) !important;
}

/* ============================================
   SCROLLBAR
   ============================================ */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(139,92,246,.75), rgba(79,209,255,.65));
    border-radius: 999px;
}

::-webkit-scrollbar-track {
    background: rgba(255,255,255,.04);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(139,92,246,.9), rgba(79,209,255,.8));
}

/* ============================================
   PAGE REVEAL ANIMATION
   ============================================ */

.page-reveal {
    opacity: 0;
    transform: translateY(20px) scale(.985);
    transition: opacity .6s ease, transform .6s ease;
}

.page-reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* ============================================
   TILT CARD EFFECT
   ============================================ */

.tilt-card {
    transform-style: preserve-3d;
    perspective: 1000px;
}

/* ============================================
   CURSOR ELEMENTS
   ============================================ */

.cursor-dot, .cursor-ring {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0;
    transition: opacity .2s ease;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #fff;
    mix-blend-mode: screen;
    transform: translate(-50%, -50%);
}

.cursor-ring {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.35);
    box-shadow: 0 0 30px rgba(79,209,255,.18);
    transform: translate(-50%, -50%);
    transition: border-color .2s ease, box-shadow .2s ease, transform .1s ease;
}

body.cursor-ready .cursor-dot,
body.cursor-ready .cursor-ring {
    opacity: 1;
}

/* ============================================
   PAGE TRANSITION OVERLAY
   ============================================ */

.page-transition {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
    opacity: 0;
    transition: opacity .3s ease;
}

.page-transition.is-active {
    opacity: 1;
    pointer-events: all;
}

.page-transition__veil {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at center, rgba(79,209,255,.08), transparent 30%),
        linear-gradient(180deg, rgba(7,10,20,.85), rgba(7,10,20,.98));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.page-transition__sigil {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    margin-left: -40px;
    margin-top: -40px;
    border-radius: 50%;
    border: 2px solid rgba(242,198,109,.6);
    box-shadow: 0 0 30px rgba(242,198,109,.2), inset 0 0 20px rgba(242,198,109,.1);
    animation: spinSigil 1.2s linear infinite;
}

.page-transition__sigil::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 50%;
    border: 1px solid rgba(139,92,246,.5);
    animation: spinSigil 1.8s linear infinite reverse;
}

@keyframes spinSigil {
    from { transform: rotate(0deg) scale(.95); opacity: .7; }
    to { transform: rotate(360deg) scale(1.05); opacity: 1; }
}

/* ============================================
   ENTITY CARDS
   ============================================ */

.entity-card {
    background: linear-gradient(180deg, rgba(20,26,47,.88), rgba(13,18,35,.78));
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--chr-radius-lg);
    overflow: hidden;
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.entity-card:hover {
    transform: translateY(-6px);
    border-color: rgba(242,198,109,.3);
    box-shadow: var(--chr-shadow-lg), var(--chr-shadow-gold);
}

.entity-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    transition: transform .4s ease;
}

.entity-card:hover .entity-card-image {
    transform: scale(1.05);
}

.entity-card-body {
    padding: 1.25rem;
}

.entity-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--chr-gold);
    margin-bottom: 0.5rem;
}

.entity-card-description {
    color: var(--chr-text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================
   CHARACTER CARDS
   ============================================ */

.character-card {
    background: linear-gradient(180deg, rgba(20,26,47,.88), rgba(13,18,35,.78));
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--chr-radius-lg);
    overflow: hidden;
    transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

.character-card:hover {
    transform: translateY(-6px);
    border-color: rgba(139,92,246,.3);
    box-shadow: var(--chr-shadow-lg), var(--chr-shadow-glow);
}

.character-portrait {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
}

.character-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.character-card:hover .character-portrait img {
    transform: scale(1.08);
}

.character-portrait-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .3s ease;
}

.character-portrait:hover .character-portrait-overlay {
    opacity: 1;
}

.character-portrait-placeholder {
    background: linear-gradient(145deg, rgba(26,26,46,.9) 0%, rgba(22,33,62,.9) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.character-portrait-placeholder i {
    font-size: 4rem;
    color: var(--chr-text-muted);
    opacity: 0.5;
}

.character-info {
    padding: 1.25rem;
}

/* ============================================
   CAMPAIGN CARDS
   ============================================ */

.campaign-card {
    background: linear-gradient(180deg, rgba(20,26,47,.92), rgba(10,14,28,.88));
    border: 1px solid rgba(255,255,255,.06);
    border-radius: var(--chr-radius-lg);
    overflow: hidden;
    transition: all .25s ease;
}

.campaign-card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: rgba(242,198,109,.25);
    box-shadow: var(--chr-shadow-lg), 0 0 60px rgba(242,198,109,.08);
}

.campaign-card-body {
    padding: 1.25rem;
}

.campaign-card-title {
    color: var(--chr-gold);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

/* ============================================
   FORUM STYLES
   ============================================ */

.forum-post-card {
    background: linear-gradient(180deg, rgba(20,26,47,.85), rgba(13,18,35,.75));
    border: 1px solid rgba(255,255,255,.06);
    border-radius: var(--chr-radius-md);
    padding: 1.25rem;
    transition: all .22s ease;
}

.forum-post-card:hover {
    transform: translateY(-2px);
    border-color: rgba(242,198,109,.2);
    box-shadow: 0 8px 30px rgba(0,0,0,.2);
}

.category-badge {
    background: linear-gradient(135deg, rgba(242,198,109,.15), rgba(242,198,109,.05));
    color: var(--chr-gold);
    border: 1px solid rgba(242,198,109,.3);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.3em 0.8em;
    border-radius: 999px;
}

/* ============================================
   TIMELINE
   ============================================ */

.timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.75rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--chr-primary), var(--chr-secondary), var(--chr-gold));
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.3rem;
    top: 0.4rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--chr-bg-dark);
    border: 3px solid var(--chr-primary);
    box-shadow: 0 0 12px rgba(139, 92, 246, .4);
    transition: all .2s ease;
}

.timeline-item:hover::before {
    transform: scale(1.2);
    box-shadow: 0 0 20px rgba(139, 92, 246, .6);
}

.timeline-item.key-event::before {
    background: var(--chr-gold);
    border-color: var(--chr-gold);
    box-shadow: 0 0 16px rgba(242, 198, 109, .5);
}

/* ============================================
   CAMPAIGN NAVIGATION
   ============================================ */

.campaign-nav .nav-link {
    color: var(--chr-text-muted);
    border-left: 3px solid transparent;
    padding: 0.75rem 1rem;
    transition: all .2s ease;
    border-radius: 0 var(--chr-radius-sm) var(--chr-radius-sm) 0;
}

.campaign-nav .nav-link:hover,
.campaign-nav .nav-link.active {
    color: var(--chr-gold);
    border-left-color: var(--chr-gold);
    background: rgba(242, 198, 109, 0.08);
}

/* ============================================
   LIST GROUP
   ============================================ */

.list-group-item {
    background: rgba(20, 26, 47, .6);
    border-color: var(--chr-border);
    color: var(--chr-text-muted);
    transition: all .2s ease;
}

.list-group-item:hover {
    background: rgba(20, 26, 47, .8);
    color: var(--chr-text);
}

.list-group-item.active {
    background: linear-gradient(135deg, rgba(242,198,109,.2), rgba(242,198,109,.1));
    border-color: rgba(242,198,109,.4);
    color: var(--chr-gold);
}

/* ============================================
   NOTES EDITOR
   ============================================ */

.notes-editor {
    min-height: 300px;
    background: rgba(17,23,43,.72);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--chr-radius-md);
    padding: 1rem;
    color: var(--chr-text);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.notes-editor:focus {
    border-color: rgba(242,198,109,.5);
    outline: none;
    box-shadow: 0 0 0 .2rem rgba(242,198,109,.12), 0 0 25px rgba(242,198,109,.08);
}

.gm-notes {
    background: rgba(239, 68, 68, 0.06);
    border: 1px dashed rgba(239, 68, 68, 0.4);
    border-radius: var(--chr-radius-md);
}

/* ============================================
   EMPTY STATE
   ============================================ */

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--chr-text-muted);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--chr-border);
    opacity: 0.5;
}

/* ============================================
   IMAGE MODAL
   ============================================ */

.image-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10001;
}

.image-modal.open {
    display: flex;
}

.image-modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.image-modal-content img {
    max-width: 100%;
    max-height: 85vh;
    border-radius: var(--chr-radius-lg);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}

.image-modal-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255,255,255,.1);
    border: 1px solid rgba(255,255,255,.2);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 999px;
    transition: all .2s ease;
}

.image-modal-close:hover {
    background: rgba(255,255,255,.2);
    transform: scale(1.1);
}

.image-modal-info {
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    text-align: center;
    color: var(--chr-text-muted);
    font-size: 0.9rem;
}

/* ============================================
   UPLOAD AREAS
   ============================================ */

.upload-option {
    background: rgba(24, 31, 55, .6);
    border: 2px dashed rgba(255,255,255,.1);
    border-radius: var(--chr-radius-md);
    transition: all .25s ease;
    cursor: pointer;
}

.upload-option:hover {
    border-color: var(--chr-gold);
    background: rgba(242, 198, 109, 0.05);
    box-shadow: 0 0 20px rgba(242, 198, 109, 0.1);
}

.campaign-cover-container {
    position: relative;
    border-radius: var(--chr-radius-lg);
    overflow: hidden;
    box-shadow: var(--chr-shadow-lg);
    cursor: pointer;
}

.campaign-cover-container .campaign-cover-image {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}

.campaign-cover-container:hover .campaign-cover-image {
    transform: scale(1.05);
}

.campaign-cover-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .8));
    opacity: 0;
    transition: opacity .3s ease;
}

.campaign-cover-container:hover .campaign-cover-overlay {
    opacity: 1;
}

/* ============================================
   IMAGE GRID
   ============================================ */

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

.image-grid-item {
    position: relative;
    border-radius: var(--chr-radius-md);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1;
}

.image-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.image-grid-item:hover img {
    transform: scale(1.1);
}

.image-grid-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .3s ease;
}

.image-grid-item:hover .image-grid-overlay {
    opacity: 1;
}

/* ============================================
   STAT INPUT (CHARACTER SHEET)
   ============================================ */

.stat-input {
    background: rgba(24, 31, 55, .8) !important;
    border: 1px solid rgba(242,198,109,.3) !important;
    font-weight: bold;
    color: var(--chr-gold) !important;
    text-align: center;
    border-radius: var(--chr-radius-sm);
    transition: all .2s ease;
}

.stat-input:focus {
    border-color: var(--chr-gold) !important;
    box-shadow: 0 0 15px rgba(242,198,109,.2) !important;
}

/* ============================================
   RADAR CHART
   ============================================ */

.radar-chart-container {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 1rem auto;
}

.radar-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 50%;
}

.radar-area {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(139, 92, 246, .2);
    border: 2px solid rgba(139, 92, 246, .5);
}

.radar-point {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--chr-gold);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px var(--chr-gold);
}

/* ============================================
   CHR DIVIDER
   ============================================ */

.chr-divider {
    border-color: var(--chr-border);
    opacity: 0.5;
    margin: 1.5rem 0;
}

/* ============================================
   ENTITY LINK
   ============================================ */

.entity-link {
    color: var(--chr-secondary);
    text-decoration: none;
    border-bottom: 1px dotted rgba(79, 209, 255, .3);
    transition: all .2s ease;
}

.entity-link:hover {
    color: var(--chr-gold);
    border-bottom-color: var(--chr-gold);
}

/* ============================================
   INTERACTIVE LINK CLASS (for page transitions)
   ============================================ */

.interactive-link {
    cursor: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 1.5rem;
    }
    
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .bg-gradient {
        width: 30rem;
        height: 30rem;
    }
    
    .cursor-dot, .cursor-ring {
        display: none !important;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-icon {
        font-size: 3.5rem;
    }
    
    body.app-body {
        cursor: auto;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .bg-gradient,
    .page-transition__sigil,
    .bg-particle {
        animation: none !important;
    }

    .cursor-dot,
    .cursor-ring {
        display: none !important;
    }

    body.app-body {
        cursor: auto;
    }
    
    .page-reveal {
        opacity: 1;
        transform: none;
    }
}

/* ============================================
   ADDITIONAL COMPONENT STYLES
   ============================================ */

/* Feature cards on homepage */
.feature-card {
    position: relative;
    background: linear-gradient(180deg, rgba(20,26,47,.88), rgba(13,18,35,.78));
    backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: var(--chr-radius-lg);
    padding: 2rem;
    text-align: center;
    transition: all .25s ease;
    overflow: hidden;
}

.feature-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,.04), transparent 50%);
    pointer-events: none;
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: rgba(139,92,246,.3);
    box-shadow: var(--chr-shadow-lg), var(--chr-shadow-glow);
}

.feature-card-icon {
    font-size: 3rem;
    color: var(--chr-gold);
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 15px rgba(242,198,109,.3));
    transition: transform .3s ease;
}

.feature-card:hover .feature-card-icon {
    transform: scale(1.15) rotate(-5deg);
}

.feature-card h5 {
    color: var(--chr-text);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.feature-card p {
    color: var(--chr-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* Campaign launcher style cards */
.campaign-launcher {
    position: relative;
    background: linear-gradient(145deg, rgba(20,26,47,.95), rgba(10,14,28,.9));
    border: 1px solid rgba(255,255,255,.06);
    border-radius: var(--chr-radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all .25s ease;
    overflow: hidden;
}

.campaign-launcher::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--chr-gold), var(--chr-primary));
    opacity: 0;
    transition: opacity .25s ease;
}

.campaign-launcher:hover {
    transform: translateX(4px);
    border-color: rgba(242,198,109,.2);
    box-shadow: var(--chr-shadow-lg);
}

.campaign-launcher:hover::before {
    opacity: 1;
}

.campaign-launcher-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(242,198,109,.15), rgba(139,92,246,.1));
    border-radius: var(--chr-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--chr-gold);
    flex-shrink: 0;
}

.campaign-launcher-content {
    flex: 1;
    min-width: 0;
}

.campaign-launcher-title {
    color: var(--chr-gold);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.campaign-launcher-meta {
    color: var(--chr-text-muted);
    font-size: 0.85rem;
}

/* Dashboard activity item */
.activity-item {
    position: relative;
    padding: 1rem 1rem 1rem 3rem;
    border-bottom: 1px solid rgba(255,255,255,.04);
    transition: background .2s ease;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-item:hover {
    background: rgba(139, 92, 246, .04);
}

.activity-item::before {
    content: "";
    position: absolute;
    left: 1rem;
    top: 1.25rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--chr-primary);
    box-shadow: 0 0 8px rgba(139, 92, 246, .4);
}

.activity-item-title {
    color: var(--chr-text);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.activity-item-meta {
    color: var(--chr-text-muted);
    font-size: 0.8rem;
}

/* Section headers */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.section-header h3 {
    color: var(--chr-gold);
    font-weight: 600;
    margin: 0;
}

.section-header-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--chr-gold-dim), transparent);
}
