/* ============================================================
   OVERWATCH FACTIONS — STYLES
   Premium dark theme with OW-inspired orange/amber accents
   ============================================================ */

/* ---------- RESET & BASE ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Surfaces */
    --bg-deepest: #05080f;
    --bg-deep: #080c16;
    --bg-surface: #0a0e1a;
    --bg-card: #12182b;
    --bg-card-hover: #19213d;
    --bg-elevated: #1e294b;

    /* Accents - Classic Overwatch Orange */
    --accent: #f99e1a;
    --accent-rgb: 249, 158, 26;
    --accent-hover: #ffb340;
    --accent-dim: rgba(249, 158, 26, 0.15);
    --accent-glow: rgba(249, 158, 26, 0.3);
    
    /* Sombra Purple (Theme Branding) */
    --sombra-purple: #bb29ff;
    --sombra-purple-glow: rgba(187, 41, 255, 0.6);

    --secondary: #06b6d4;
    --secondary-rgb: 6, 182, 212;
    --pink: #db2777;
    --pink-rgb: 219, 39, 119;
    --danger: #b91c1c;
    --danger-rgb: 185, 28, 28;
    --purple: #8b5cf6;
    --purple-rgb: 139, 92, 246;
    --green: #22c55e;
    --green-rgb: 34, 197, 94;

    /* Overwatch Specific */
    --ow-blue: #405275;
    --ow-white: #f0edf2;
    --ow-orange: #f99e1a;
    --ow-dark: #0a0e1a;
    --ow-light-blue: #06b6d4;

    /* Text */
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Borders */
    --border: rgba(255, 255, 255, 0.06);
    --border-accent: rgba(249, 158, 26, 0.25);

    /* Decryption Effect */
.d-char {
    color: var(--sombra-purple);
    text-shadow: 0 0 8px var(--sombra-purple-glow);
    font-family: 'Courier New', Courier, monospace;
}

/* Typography */
    --font-display: 'Rajdhani', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --section-pad: 50px;
    --container-max: 1320px;
    
    /* Effects */
    --glass: rgba(17, 24, 39, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-deep);
}

body {
    font-family: var(--font-body);
    background: var(--bg-deepest);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
}

/* Accessibility Focus States */
:focus-visible {
    outline: 2px solid var(--accent) !important;
    outline-offset: 3px;
    border-radius: 2px;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---------- LOADING SCREEN ---------- */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 9999;
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
    opacity: 0.3;
}

#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--bg-deepest);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.8s cubic-bezier(0.77, 0, 0.175, 1);
}
#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.loader-logo-img {
    width: 100px;
    height: auto;
    filter: drop-shadow(0 0 15px var(--sombra-purple-glow));
    animation: iconPulse 2s infinite ease-in-out;
}
.loader-text {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 4px;
    color: var(--text-secondary);
    text-transform: uppercase;
}
.loader-bar {
    width: 200px;
    height: 3px;
    background: var(--bg-card);
    border-radius: 3px;
    overflow: hidden;
}
.loader-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #ff6b2b);
    border-radius: 3px;
    animation: loaderFill 1.5s ease-out forwards;
}
@keyframes loaderFill {
    to { width: 100%; }
}

/* ---------- RESET & BASE ---------- */
/* Removed scanline and loader status styling to keep it clean */

/* ---------- SOMBRA BANNER ---------- */
.sombra-banner-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -2;
}

.sombra-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 90% center; /* Shift her even more to the right edge */
    opacity: 1;
    filter: brightness(0.85) contrast(1.2) saturate(1.2) drop-shadow(0 0 20px rgba(187, 41, 255, 0.3));
    animation: bannerFlicker 12s infinite, bannerDrift 40s infinite alternate ease-in-out;
}

@keyframes bannerDrift {
    0% { transform: scale(1) translateX(0); }
    100% { transform: scale(1.03) translateX(0.5%); } /* Drifts inward toward Sombra on the right */
}

.sombra-banner-fade {
    position: absolute;
    inset: 0;
    /* Use a layered gradient: 
       1. Purple glow center-point right where Sombra is
       2. Shadow on the left to keep text readability high 
       3. Bottom fade for sections below
    */
    background: 
        radial-gradient(circle at 85% 45%, var(--sombra-purple-glow) 0%, transparent 60%),
        linear-gradient(to right, var(--bg-deepest) 0%, var(--bg-deepest) 20%, rgba(5, 8, 15, 0.4) 50%, transparent 80%),
        linear-gradient(to bottom, transparent 50%, var(--bg-deepest) 98%);
}

@keyframes bannerFlicker {
    0%, 8%, 10%, 30%, 31%, 100% { opacity: 1; filter: brightness(0.85) contrast(1.2); }
    9%, 30.5% { opacity: 1; filter: brightness(1.1) contrast(1.4) drop-shadow(0 0 20px var(--sombra-purple-glow)); }
}

/* ---------- HERO SECTION ---------- */
#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 120px 8% 60px;
    overflow: hidden;
}

@media (max-width: 768px) {
    #hero {
        padding: 220px 0 40px; /* Further increased padding to prevent title clipping */
        min-height: auto;
    }
    #main-nav {
        top: 65px; /* Adjust for taller mobile competition bar */
    }
    .hero-content {
        padding: 0 15px; /* Tighter padding */
    }
    .sombra-banner-img {
        width: auto;
        min-width: 400%;
        height: 115%;
        object-position: left 35%; /* Nudge her higher in the frame */
        animation: bannerFlicker 12s infinite, mobileSombraPan 18s infinite cubic-bezier(0.45, 0.05, 0.55, 0.95);
    }
    .hero-cta {
        padding: 8px 24px;
        font-size: 0.75rem;
        letter-spacing: 1px;
        gap: 8px;
        clip-path: polygon(10% 0%, 100% 0%, 90% 100%, 0% 100%);
    }
    .hero-cta svg {
        width: 14px;
        height: 14px;
    }
}

@keyframes mobileSombraPan {
    0%, 2%   { transform: translateX(0); }           /* Start */
    12%, 40% { transform: translateX(-36%); }        /* FOCUS 1: Hold on Sombra */
    60%, 70% { transform: translateX(-75%); }        /* SCAN: Right side data patterns */
    82%, 88% { transform: translateX(-36%); }        /* FOCUS 2: Return to Sombra */
    100%     { transform: translateX(0); }           /* RESET: Gradual return to start (12% time for 36% distance) */
}
.hero-bg-effects {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.hex-grid {
    position: absolute;
    inset: -20% -10%;
    opacity: 0.04;
}
.hero-glow {
    position: absolute;
    top: -30%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(80px);
    animation: heroGlowPulse 6s ease-in-out infinite;
}
@keyframes heroGlowPulse {
    0%, 100% { opacity: 0.4; transform: translateX(-50%) scale(1); }
    50% { opacity: 0.6; transform: translateX(-50%) scale(1.1); }
}

/* Nav */
#main-nav {
    position: fixed;
    top: 70px; /* Shifted down to match new bar height */
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 60px;
    background: rgba(10, 14, 26, 0.8);
    backdrop-filter: blur(24px) saturate(180%);
    border-bottom: 1px solid var(--accent-dim);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-menu-toggle {
    display: none;
}

/* ---------- GLOBAL COMPETITION BAR ---------- */
.competition-bar-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1010;
    background: linear-gradient(180deg, rgba(8, 12, 24, 0.98) 0%, rgba(5, 8, 15, 0.95) 100%);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 0 20px;
    display: flex;
    justify-content: center;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    height: 70px; /* Increased from 60px */
}

.competition-bar-wrapper.hidden {
    transform: translateY(-100%);
}

.competition-bar-content {
    width: 100%;
    max-width: 750px; /* Reduced width for a more focused HUD feel */
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px; /* Slightly more gap */
    padding-bottom: 6px; /* Added padding under the bar */
    animation: barAmbientPulse 4s ease-in-out infinite;
}

@media (max-width: 600px) {
    .competition-bar-wrapper {
        height: auto;
        padding-top: 8px;
        padding-bottom: 8px;
    }
    .competition-bar-content {
        gap: 6px;
    }
    .comp-meta-info {
        gap: 8px;
    }
    .comp-title {
        font-size: 0.75rem;
    }
    .comp-faction-name {
        display: none;
    }
    .comp-faction {
        min-width: 60px;
    }
    .comp-faction-percent {
        font-size: 0.85rem;
    }
    .comp-main-row {
        gap: 10px;
    }
}

@keyframes barAmbientPulse {
    0%, 100% { opacity: 0.95; filter: brightness(1); }
    50% { opacity: 1; filter: brightness(1.2) drop-shadow(0 0 5px rgba(var(--accent-rgb), 0.1)); }
}

.comp-faction-percent.updating {
    animation: percentUpdate 0.5s ease-out;
}

@keyframes percentUpdate {
    0% { transform: scale(1); color: #fff; }
    50% { transform: scale(1.1); color: var(--accent); }
    100% { transform: scale(1); }
}

.comp-progress-fill.updating .progress-glow {
    opacity: 1;
    height: 100%;
}

.comp-meta-info {
    display: flex;
    justify-content: center; /* Center correctly */
    align-items: center;
    gap: 15px; /* Separation between labels */
    width: 100%;
    margin-bottom: -1px;
}

.comp-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1.5px;
    opacity: 0.95;
}

@keyframes redPulse {
    0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 5px rgba(255, 0, 0, 0.8); }
    50% { transform: scale(1.2); opacity: 0.6; box-shadow: 0 0 12px rgba(255, 0, 0, 1); }
}

.comp-live-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: -4px;
    transform: translateY(-2px); /* Shifted higher */
}

.live-dot {
    width: 6px;
    height: 6px;
    background: #ef4444;
    border-radius: 50%;
    animation: redPulse 2s infinite ease-in-out;
}
.comp-week-gold {
    color: var(--accent);
    font-weight: 800;
    font-style: italic;
    margin-left: 5px;
}

.comp-main-row {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    position: relative;
}

.comp-faction {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.comp-faction.talon { justify-content: flex-end; }
.comp-faction.overwatch { justify-content: flex-start; }

.comp-faction-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.comp-faction.talon .comp-faction-icon { filter: drop-shadow(0 0 4px rgba(185, 28, 28, 0.5)); }
.comp-faction.overwatch .comp-faction-icon { filter: drop-shadow(0 0 4px rgba(249, 158, 26, 0.5)); }

.comp-faction-details {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.comp-faction-name {
    font-family: var(--font-display);
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.comp-faction-percent {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
}

.comp-faction.talon .comp-faction-percent { color: var(--danger); }
.comp-faction.overwatch .comp-faction-percent { color: var(--accent); }

/* --- Easter Egg: Sad Winston Mouse Follower --- */
.easter-egg-follower {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 150px;
    background: url('sad-winston.jpg') center/cover no-repeat;
    border: 1px solid var(--accent);
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8), 0 0 20px var(--accent-glow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 9999;
    transform: translateX(-50%); /* Center on JS left coordinate */
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.competition-bar-wrapper.is-losing:hover .easter-egg-follower {
    opacity: 1;
    visibility: visible;
}

.artist-credit {
    position: absolute;
    top: 8px; /* Move to top */
    right: 8px;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.9); /* Pure white text */
    letter-spacing: 1.5px;
    text-shadow: 0 0 5px rgba(0,0,0,0.8), 0 0 10px rgba(0,0,0,0.5); /* Shadow for readability without box */
    pointer-events: none;
}

.artist-credit:hover {
    color: var(--accent);
}

.comp-progress-container {
    flex: 1;
    height: 18px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.06);
    display: flex;
    position: relative;
    clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
    overflow: hidden;
}

.comp-progress-fill {
    height: 100%;
    transition: width 1s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
}

.comp-progress-fill.talon { background: linear-gradient(90deg, #300808, #b91c1c); }
.comp-progress-fill.overwatch { background: linear-gradient(270deg, #503105, #f99e1a); }

.comp-progress-divider {
    position: absolute;
    top: -5px;
    bottom: -5px;
    left: 51.35%;
    width: 3px;
    background: #fff;
    box-shadow: 0 0 12px rgba(255,255,255,0.9);
    z-index: 10;
    transform: translateX(-50%) skewX(-15deg);
    transition: left 1s cubic-bezier(0.19, 1, 0.22, 1);
}

/* Adjust Main Nav repositioning */
#main-nav {
    top: 60px;
}

.competition-bar-wrapper.hidden + #main-nav {
    top: 0 !important;
}

.comp-bar-glitch {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.3;
    animation: glitchLine 4.5s infinite linear;
}

@keyframes glitchLine {
    0% { transform: translateX(-100%); opacity: 0; }
    10% { opacity: 0.3; }
    20% { transform: translateX(100%); }
    21% { opacity: 0; }
    100% { transform: translateX(100%); opacity: 0; }
}

#main-nav.scrolled {
    padding: 10px 60px;
    background: rgba(5, 8, 15, 0.98);
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}
.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(1rem, 4vw, 1.4rem);
    letter-spacing: 2px;
}
.nav-logo-img {
    height: 38px;
    width: auto;
    filter: drop-shadow(0 0 10px var(--sombra-purple-glow));
    animation: iconPulse 4s infinite ease-in-out, navGlitch 12s infinite steps(1);
}

.nav-logo-text .accent {
    color: var(--sombra-purple);
    text-shadow: 0 0 10px var(--sombra-purple-glow);
}

@keyframes navGlitch {
    0%, 97%, 100% { transform: scale(1); opacity: 1; filter: none; }
    98% { transform: scale(1.1) skewX(20deg); opacity: 0.8; filter: hue-rotate(90deg); }
    99% { transform: scale(0.9) skewX(-20deg); opacity: 0.9; filter: hue-rotate(-90deg); }
}
@keyframes iconPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}
.accent {
    color: var(--accent);
}
.nav-links {
    display: flex;
    gap: 40px;
    align-items: center;
}
.nav-link {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 1.5px;
    color: var(--ow-white);
    transition: all 0.3s ease;
    position: relative;
    text-transform: uppercase;
    opacity: 0.7;
}
.nav-link:hover {
    color: var(--accent);
    opacity: 1;
    text-shadow: 0 0 10px var(--accent-glow);
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px var(--accent-glow);
}
.nav-link:hover::after {
    width: 100%;
}
.nav-link.active {
    opacity: 1;
    color: var(--accent);
}
.nav-link.active::after {
    width: 100%;
}

.nav-kofi-btn {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 1.5px;
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 4px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    border: 1px solid var(--accent-dim);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 0 10px var(--accent-glow);
    /* Remove redundant margin, gap handles it */
    transform: translateY(-1px); /* Micro-adjustment for baseline matching */
}

.nav-kofi-btn svg {
    display: block; /* Helps with alignment in flex */
}

.nav-kofi-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Hero Content */
.hero-content {
    position: relative;
    z-index: 10;
    text-align: left;
    max-width: 700px;
    animation: heroFadeIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}
@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(40px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.hero-badge {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 5px;
    color: var(--accent);
    padding: 10px 24px;
    border: 1px solid var(--border-accent);
    background: var(--accent-dim);
    border-radius: 2px;
    margin-bottom: 28px;
    text-transform: uppercase;
    clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
}
.hero-title {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 800;
    line-height: 0.95;
    letter-spacing: 1px;
    margin-bottom: 28px;
    text-transform: uppercase;
    /* Stronger text shadow for busy backgrounds */
    filter: drop-shadow(0 0 20px rgba(0,0,0,0.8));
    animation: textGlitch 8s infinite steps(1);
    position: relative;
}

@keyframes textGlitch {
    0%, 95%, 100% { transform: translate(0); text-shadow: none; }
    96% { transform: translate(-2px, 1px); text-shadow: 2px 0 var(--secondary), -2px 0 var(--pink); }
    97% { transform: translate(2px, -1px); text-shadow: -2px 0 var(--secondary), 2px 0 var(--pink); }
    98% { transform: translate(-1px, -2px); text-shadow: 1px 0 var(--secondary), -1px 0 var(--pink); }
    99% { transform: translate(1px, 2px); text-shadow: -1px 0 var(--secondary), 1px 0 var(--pink); }
}
.hero-title-line {
    display: block;
}
@keyframes shine {
    to { background-position: 200% center; }
}

.accent-line {
    background: linear-gradient(90deg, var(--accent), #ff6b2b, var(--accent));
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shine 3s linear infinite;
}
.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-primary);
    max-width: 550px;
    margin: 0 0 20px;
    line-height: 1.6;
    font-weight: 500;
    text-shadow: 0 0 15px var(--sombra-purple-glow), 0 2px 10px rgba(0,0,0,0.9);
}
.hero-stats {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 40px;
    margin-bottom: 20px;
    background: rgba(255,255,255,0.03);
    padding: 30px 50px;
    border-radius: 4px;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    clip-path: polygon(20px 0, 100% 0, calc(100% - 20px) 100%, 0 100%);
    width: fit-content;
    overflow-x: auto;
}
@media (max-width: 640px) {
    .hero-stats {
        flex-direction: column;
        gap: 8px;
        padding: 18px 12px;
        clip-path: none;
        border-radius: 4px;
        background: rgba(8, 12, 22, 0.4);
        max-width: 140px;
        align-items: center;
    }
    .stat-number {
        font-size: 1.8rem;
        margin-bottom: 2px;
    }
    .stat-label {
        font-size: 0.6rem;
        letter-spacing: 2px;
    }
    .stat-divider {
        width: 40px;
        height: 1px;
        background: linear-gradient(to right, transparent, var(--border), transparent);
        margin: 4px 0;
    }
}
.stat-item {
    text-align: center;
    min-width: 120px;
}
.stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 8px;
    text-shadow: 0 0 20px var(--accent-glow);
}
.stat-label {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--text-muted);
    text-transform: uppercase;
}
.stat-divider {
    width: 2px;
    height: 50px;
    background: linear-gradient(to bottom, transparent, var(--border), transparent);
}
.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 10px 32px;
    background: var(--accent);
    color: #05080f;
    border-radius: 2px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 25px var(--accent-glow);
    clip-path: polygon(10% 0%, 100% 0%, 90% 100%, 0% 100%);
    position: relative;
    overflow: hidden;
}
.hero-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s;
}
.hero-cta:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 50px var(--accent-glow);
    background: var(--accent-hover);
}
.hero-cta:hover::before {
    left: 100%;
}
.hero-cta span {
    position: relative;
    z-index: 1;
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}
.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    animation: scrollBounce 2s ease-in-out infinite;
}
@keyframes scrollBounce {
    0%, 100% { transform: rotate(45deg) translate(0, 0); opacity: 0.5; }
    50% { transform: rotate(45deg) translate(5px, 5px); opacity: 1; }
}

/* ---------- SECTIONS SHARED ---------- */
section {
    padding: var(--section-pad) 20px;
    max-width: var(--container-max);
    margin: 0 auto;
}
.section-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}
.section-badge {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 5px;
    color: var(--accent);
    padding: 8px 24px;
    border: 1px solid var(--border-accent);
    background: var(--accent-dim);
    border-radius: 2px;
    margin-bottom: 12px;
    text-transform: uppercase;
    clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
}
.section-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent);
    margin: 16px auto 0;
    border-radius: 2px;
    box-shadow: 0 0 15px var(--accent-glow);
}
.section-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- Overwatch UI Elements --- */
.ow-slanted {
    clip-path: polygon(10px 0%, 100% 0%, calc(100% - 10px) 100%, 0% 100%);
}
.ow-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    position: relative;
}
.ow-glow-text {
    text-shadow: 0 0 10px var(--accent-glow);
}
.ow-button {
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 10px 24px;
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    clip-path: polygon(12% 0, 100% 0, 88% 100%, 0 100%);
}
.ow-button:hover {
    background: var(--accent);
    color: var(--bg-deepest);
    box-shadow: 0 0 20px var(--accent-glow);
}
.ow-button-fill {
    background: var(--accent);
    color: var(--bg-deepest);
    border: none;
}
.ow-button-fill:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
}

/* ---------- NETWORK MAP ---------- */
#network-map {
    max-width: 1100px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}
.map-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.map-btn {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 10px 24px;
    border-radius: 4px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.map-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--bg-card-hover);
}
.map-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}
.map-container {
    position: relative;
    width: 100%;
    height: 80vh;
    min-height: 650px;
    max-height: 1000px;
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    cursor: grab;
}
.map-container:active {
    cursor: grabbing;
}
.map-container.fullscreen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}
#network-canvas {
    width: 100%;
    height: 100%;
    display: block;
}
.node-tooltip {
    position: absolute;
    padding: 12px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: 8px;
    pointer-events: none;
    z-index: 100;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    max-width: 280px;
    transition: opacity 0.2s ease;
}
@media (max-width: 768px) {
    .node-tooltip {
        left: 50% !important;
        top: 20px !important;
        transform: translateX(-50%) !important;
        max-width: 90%;
        width: calc(100% - 40px);
        text-align: center;
        border-width: 2px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.8);
    }
}
.node-tooltip.hidden {
    opacity: 0;
    visibility: hidden;
}
.node-tooltip h4 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.node-tooltip p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.map-legend {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: 1px;
}
.legend-color {
    width: 24px;
    height: 3px;
    border-radius: 2px;
}
.legend-color.alliance { background: var(--green); box-shadow: 0 0 8px rgba(34, 197, 94, 0.4); }
.legend-color.conflict { background: var(--danger); box-shadow: 0 0 8px rgba(226, 54, 54, 0.4); }
.legend-color.complex { background: var(--purple); box-shadow: 0 0 8px rgba(139, 92, 246, 0.4); }
.legend-color.former { background: var(--secondary); box-shadow: 0 0 8px rgba(6, 182, 212, 0.4); }

/* --- Zoom Controls --- */
.map-zoom-controls {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 50;
}
.zoom-btn {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: rgba(26, 34, 54, 0.9);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    backdrop-filter: blur(8px);
    line-height: 1;
}
.zoom-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(26, 34, 54, 0.95);
}

/* ---------- FACTION CARDS ---------- */
.faction-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}
.search-box {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin-bottom: 8px;
}
.search-box input {
    width: 100%;
    padding: 14px 20px 14px 46px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
}
.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
    background: var(--bg-card-hover);
}
.search-box input::placeholder {
    color: var(--text-muted);
}
.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: color 0.3s ease;
    pointer-events: none;
}
.search-box:focus-within .search-icon {
    color: var(--accent);
}
.faction-filters {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}
.faction-filter-btn {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 8px 20px;
    border-radius: 4px;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: var(--bg-card);
    transition: all 0.3s ease;
}
.faction-filter-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.faction-filter-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

.factions-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
}

.faction-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 32px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
    animation: cardFadeIn 0.6s ease-out both;
    display: flex;
    flex-direction: column;
    flex: 1 1 340px;
    max-width: 420px;
}
.faction-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    background: var(--card-accent, var(--accent));
    opacity: 0.6;
    transition: width 0.4s ease;
}
.faction-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--card-accent, var(--accent)) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 0;
    pointer-events: none;
}
.faction-card:hover {
    border-color: var(--card-accent, var(--accent));
    background: var(--bg-card-hover);
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}
.faction-card:hover::before {
    width: 8px;
    opacity: 1;
}
.faction-card:hover::after {
    opacity: 0.05;
}
@keyframes cardFadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}
.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    background: var(--card-accent-dim, var(--accent-dim));
    border: 1px solid var(--card-accent-border, var(--border-accent));
}
.card-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.card-alignment {
    font-family: var(--font-display);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 3px;
    display: inline-block;
}
.card-alignment.heroic {
    color: var(--green);
    background: var(--green-dim);
}
.card-alignment.villainous {
    color: var(--danger);
    background: var(--danger-dim);
}
.card-alignment.neutral {
    color: var(--secondary);
    background: var(--secondary-dim);
}
.card-alignment.complex {
    color: var(--purple);
    background: var(--purple-dim);
}

.card-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 12px 0 18px;
    display: -webkit-box;
    line-clamp: 3;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-members {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.card-member-tag {
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 3px;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* --- Member avatar row (portrait circles on faction cards) --- */
.card-members-row {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
    gap: 0;
}
.card-member-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--bg-card);
    margin-left: -8px;
    flex-shrink: 0;
    transition: transform 0.25s ease, z-index 0s;
    position: relative;
    z-index: 1;
    background: var(--bg-elevated);
}
.card-member-avatar:first-child {
    margin-left: 0;
}
.card-member-avatar:hover {
    transform: scale(1.2) translateY(-2px);
    z-index: 10;
    border-color: var(--accent);
}
.card-member-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
    display: block;
}
.card-member-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1;
}
.card-member-more {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-elevated);
    border: 2px solid var(--bg-card);
    line-height: 1;
}

/* --- Faction SVG logos --- */
.faction-logo-svg {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.faction-logo-svg svg {
    width: 100%;
    height: 100%;
}
.faction-logo-emoji {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

/* --- Hero portrait images in member chips --- */
.member-avatar-img {
    border-radius: 50%;
    object-fit: cover;
    object-position: center 15%;
    flex-shrink: 0;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
}
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}
.card-connections {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 1px;
}
.card-view-btn {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: var(--accent);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.3s ease;
}
.faction-card:hover .card-view-btn {
    gap: 10px;
}

/* ---------- MODAL ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10005;
    background: rgba(5, 8, 15, 0.92);
    backdrop-filter: blur(12px) saturate(180%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}
.modal {
    background: var(--bg-surface);
    border: 1px solid var(--glass-border);
    border-radius: 2px;
    max-width: 850px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    transform: translateY(40px) scale(0.95);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 0 100px rgba(0, 0, 0, 0.9), 0 0 0 1px var(--border);
    display: flex;
    flex-direction: column;
    border-top: 4px solid var(--accent);
}
.modal-overlay.visible .modal {
    transform: translateY(0) scale(1);
}
.modal::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(225deg, var(--accent-dim) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}
.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 2px;
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
    border: 1px solid var(--border);
    cursor: pointer;
    clip-path: polygon(15% 0%, 100% 0%, 85% 100%, 0% 100%);
}
.modal-close:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    transform: scale(1.1);
}
.modal-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 40px 48px;
    background: linear-gradient(to bottom, var(--bg-card), var(--bg-surface));
    border-bottom: 1px solid var(--border);
    position: relative;
}
.modal-header::after {
    content: 'TOP SECRET // CLASSIFIED';
    position: absolute;
    bottom: 12px;
    right: 48px;
    font-family: var(--font-display);
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    opacity: 0.5;
}
.modal-icon {
    width: 72px;
    height: 72px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    background: var(--accent-dim);
    border: 1px solid var(--border-accent);
    flex-shrink: 0;
    box-shadow: 0 0 20px var(--accent-glow);
}
.modal-title {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-primary);
    line-height: 1;
}
.modal-alignment {
    margin-top: 8px;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 3px;
}
.modal-body {
    padding: 48px;
    overflow-y: auto;
    background-image: radial-gradient(circle at 50% 50%, rgba(249, 158, 26, 0.02) 0%, transparent 70%);
}
.modal-section {
    margin-bottom: 40px;
}
.modal-section:last-child {
    margin-bottom: 0;
}
.modal-section h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.modal-section h3::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-accent), transparent);
}
.modal-section p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}
.member-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all 0.3s ease;
}
.member-chip:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
}
.member-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
    font-family: var(--font-display);
}
.member-name {
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.member-chip.former .member-name {
    color: var(--text-muted);
    text-decoration: line-through;
}

.relationship-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 10px;
}

.rel-modal-card {
    display: flex;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.rel-modal-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-dim);
    transform: translateX(6px);
}

/* Simplified Quick Intel Grid for Modal */
.modal-intel-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 5px;
}

.intel-category {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.intel-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.intel-category.alliance .intel-label { color: var(--green); }
.intel-category.alliance .intel-icon { color: var(--green); }
.intel-category.alliance .intel-chip { border-color: rgba(var(--green-rgb), 0.2); }
.intel-category.alliance .intel-chip:hover { border-color: var(--green); background: rgba(var(--green-rgb), 0.1); }
.intel-category.conflict .intel-label { color: var(--danger); }
.intel-category.complex .intel-label { color: var(--purple); }
.intel-category.former .intel-label { color: var(--secondary); }

.intel-icon svg {
    width: 14px;
    height: 14px;
}

.intel-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.intel-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.intel-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-dim);
    transform: translateY(-2px);
}

.intel-chip .faction-logo-svg {
    width: 16px;
    height: 16px;
}

/* Deep Dive CTA */
.modal-intel-cta {
    margin-top: 25px;
    background: linear-gradient(90deg, var(--accent-dim), transparent);
    border: 1px solid var(--accent-dim);
    border-radius: 4px;
    padding: 15px 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    position: relative;
    overflow: hidden;
}

.modal-intel-cta:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    transform: translateX(5px);
}

.modal-intel-cta .cta-inner {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-intel-cta .cta-text {
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--accent);
    opacity: 0.8;
}

.modal-intel-cta .cta-arrow {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
}

/* Pulse Highlight for navigation */
.pulse-highlight {
    animation: explorerPulse 1s ease-out;
}

@keyframes explorerPulse {
    0% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(var(--accent-rgb), 0); }
    100% { box-shadow: 0 0 0 0 rgba(var(--accent-rgb), 0); }
}

/* ---------- RELATIONSHIP EXPLORER (NETWORK INTEL) ---------- */
.rel-interface {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: 4px;
    min-height: 500px;
}

@media (max-width: 900px) {
    .rel-interface {
        grid-template-columns: 1fr;
    }
    .rel-selector-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding-right: 0;
        padding-bottom: 24px;
    }
    .rel-faction-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
    }
    .rel-faction-btn {
        width: auto;
        white-space: nowrap;
    }
}
.rel-selector-sidebar {
    border-right: 1px solid var(--border);
    padding-right: 24px;
    display: flex;
    flex-direction: column;
}
.rel-selector-header {
    margin-bottom: 24px;
}
.rel-selector-header h3 {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--text-muted);
}
.rel-selector-line {
    height: 2px;
    background: var(--accent);
    width: 40px;
    margin-top: 8px;
}
.rel-faction-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    max-height: 500px;
    padding-right: 12px;
}
.rel-faction-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
    font-family: var(--font-display);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 1px;
    color: var(--text-secondary);
}
.rel-faction-btn:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--accent-dim);
    transform: translateX(3px);
}
.rel-faction-btn.active {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
}
.rel-faction-btn .btn-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.rel-focus-display {
    display: flex;
    flex-direction: column;
    position: relative;
}
.rel-empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}
.rel-empty-icon {
    font-size: 2.5rem;
    color: var(--accent-dim);
    margin-bottom: 16px;
    opacity: 0.3;
}
.rel-empty-state h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: 3px;
    margin-bottom: 8px;
}
.rel-empty-state p {
    color: var(--text-muted);
    font-size: 0.85rem;
    max-width: 280px;
}

.rel-focus-header {
    display: flex;
    align-items: center;
    gap: 24px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
    animation: fadeInSlide 0.5s ease-out;
}
.rel-focus-icon {
    width: 64px;
    height: 64px;
    background: var(--accent-dim);
    border: 1px solid var(--accent);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
}
.rel-focus-info h3 {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-primary);
    line-height: 1;
}
.rel-focus-info p {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.rel-categories {
    display: flex;
    flex-direction: column;
    gap: 32px;
}
.rel-cat-section h4 {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.rel-cat-section h4::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.05), transparent);
}
.rel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}
.rel-mini-card {
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.rel-mini-card:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--accent-dim);
}
.rel-mini-card.alliance { 
    background: rgba(var(--green-rgb), 0.05); 
    border-color: rgba(var(--green-rgb), 0.15);
}
.rel-mini-card.conflict { 
    background: rgba(var(--danger-rgb), 0.05); 
    border-color: rgba(var(--danger-rgb), 0.15);
}
.rel-mini-card.complex { 
    background: rgba(var(--purple-rgb), 0.05); 
    border-color: rgba(var(--purple-rgb), 0.15);
}
.rel-mini-card.former { 
    background: rgba(var(--secondary-rgb), 0.05); 
    border-color: rgba(var(--secondary-rgb), 0.15);
}

.rel-mini-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--accent);
}
.rel-mini-card.alliance::before { background: var(--green); }
.rel-mini-card.conflict::before { background: var(--danger); }
.rel-mini-card.complex::before { background: var(--purple); }
.rel-mini-card.former::before { background: var(--secondary); }

.rel-mini-card.alliance .rel-mini-target { color: var(--green); }
.rel-mini-card.conflict .rel-mini-target { color: var(--danger); }
.rel-mini-card.complex .rel-mini-target { color: var(--purple); }
.rel-mini-card.former .rel-mini-target { color: var(--secondary); }

.rel-mini-target {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.95rem;
    color: var(--text-primary);
}
.rel-mini-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.rel-mini-type {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rel-mini-type svg {
    width: 16px;
    height: 16px;
}

.rel-mini-type-text {
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 4px;
}

.rel-mini-card.alliance .rel-mini-type-text { color: var(--accent); }
.rel-mini-card.conflict .rel-mini-type-text { color: var(--danger); }
.rel-mini-card.complex .rel-mini-type-text { color: var(--purple); }
.rel-mini-card.former .rel-mini-type-text { color: var(--secondary); }
.rel-mini-card.alliance .rel-mini-type { color: var(--accent); background: var(--accent-dim); }
.rel-mini-card.conflict .rel-mini-type { color: var(--danger); background: var(--danger-dim); }
.rel-mini-card.complex .rel-mini-type { color: var(--purple); background: var(--purple-dim); }
.rel-mini-card.former .rel-mini-type { color: var(--secondary); background: var(--secondary-dim); }

@keyframes fadeInSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- TIMELINE ---------- */
.timeline-container {
    position: relative;
    padding-left: 60px;
    max-width: 1000px;
    margin: 0 auto;
}
.timeline-container::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, 
        transparent 0%, 
        var(--accent) 15%, 
        var(--accent) 85%, 
        transparent 100%);
    box-shadow: 0 0 20px rgba(249, 158, 26, 0.2);
    z-index: 1;
}
/* Cyber-accent line */
.timeline-container::after {
    content: '';
    position: absolute;
    left: 20.5px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.4);
    z-index: 2;
}
.timeline-item {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    margin-bottom: 40px;
    padding: 32px;
    border-radius: 4px;
    opacity: 0;
    transform: translateX(40px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-md);
}
.timeline-item.visible {
    opacity: 1;
    transform: translateX(0);
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -46px; /* Centered on the 2px line */
    top: 40px;
    width: 14px;
    height: 14px;
    background: var(--bg-deepest);
    border: 2px solid var(--accent);
    box-shadow: 0 0 15px var(--accent-glow);
    z-index: 5;
    transform: rotate(45deg);
    animation: timelinePulse 3s infinite ease-in-out;
}

/* Horizontal connector line */
.timeline-item::after {
    content: '';
    position: absolute;
    left: -40px;
    top: 46px;
    width: 40px;
    height: 2px;
    background: linear-gradient(to right, var(--accent), transparent);
    z-index: 1;
}

@keyframes timelinePulse {
    0%, 100% { box-shadow: 0 0 15px var(--accent-glow); border-color: var(--accent); }
    50% { box-shadow: 0 0 25px var(--accent), 0 0 10px var(--accent); border-color: #fff; }
}
.timeline-date {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 12px;
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent-dim);
    clip-path: polygon(10% 0, 100% 0, 90% 100%, 0 100%);
}
.timeline-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: 1px;
    color: var(--text-primary);
    text-transform: uppercase;
}
.timeline-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 20px;
}
.timeline-factions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.timeline-tag {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 6px 14px;
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    text-transform: uppercase;
}
.timeline-tag:hover {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: var(--accent);
}
.timeline-tag .faction-logo-svg {
    width: 16px;
    height: 16px;
}

/* ---------- FOOTER ---------- */
#footer {
    padding: 40px 20px;
    border-top: 1px solid var(--border);
    text-align: center;
}
.footer-content {
    max-width: var(--container-max);
    margin: 0 auto;
}
.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 2px;
    margin-bottom: 12px;
    color: var(--text-muted);
}
.footer-logo-img {
    height: 30px;
    width: auto;
    filter: grayscale(1) opacity(0.6);
    transition: all 0.3s ease;
}
.footer-logo:hover .footer-logo-img {
    filter: grayscale(0) opacity(1) drop-shadow(0 0 10px var(--sombra-purple-glow));
}
.footer-logo span:last-child {
    color: var(--sombra-purple);
    opacity: 0.8;
}
.footer-note {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 6px;
}
.kofi-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    padding: 2px 4px;
}
.kofi-link:hover {
    color: #fff;
    background: var(--accent);
    border-radius: 4px;
    box-shadow: 0 0 10px var(--accent-glow);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    #main-nav {
        padding: 12px 20px;
    }
    /* Mobile Nav Overhaul */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 6px;
        width: 30px;
        background: none;
        border: none;
        cursor: pointer;
        z-index: 1001;
    }
    .menu-bar {
        width: 100%;
        height: 2px;
        background: var(--accent);
        transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: 0 0 8px var(--accent-glow);
    }
    #main-nav.menu-open .menu-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    #main-nav.menu-open .menu-bar:nth-child(2) { opacity: 0; }
    #main-nav.menu-open .menu-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .nav-links {
        display: flex;
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: rgba(8, 12, 22, 0.98);
        backdrop-filter: blur(20px);
        padding: 100px 40px;
        flex-direction: column;
        gap: 30px;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        border-left: 1px solid var(--accent-dim);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
    }
    #main-nav.menu-open .nav-links {
        right: 0;
    }
    .nav-link {
        font-size: 1.2rem;
        letter-spacing: 2px;
        padding: 10px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    .nav-kofi-btn {
        text-align: center;
        font-size: 1.1rem;
        padding: 15px;
        margin-top: 10px;
    }
    .factions-grid {
        grid-template-columns: 1fr;
    }
    .map-container {
        height: 550px;
        min-height: auto;
        margin-left: -10px;
        margin-right: -10px;
        width: calc(100% + 20px);
        border-radius: 0;
    }
    .modal {
        max-height: 95vh;
        width: 100%;
        margin: 0;
    }
    .modal-header {
        padding: 30px 24px 10px;
        flex-direction: row;
        gap: 16px;
    }
    .modal-icon {
        width: 50px;
        height: 50px;
    }
    .modal-title {
        font-size: 1.5rem;
    }
    .modal-body {
        padding: 20px 24px;
    }
    .members-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
    section {
        padding: 30px 0; 
    }
    .section-header {
        padding: 0 15px;
    }
    .section-title {
        font-size: 1.8rem;
    }
    .hero-content {
        padding: 0 20px;
    }
    .hero-title {
        font-size: clamp(1.5rem, 7vw, 2.2rem);
        margin-bottom: 12px;
        line-height: 1.1;
    }
    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 30px;
    }
    /* Timeline Mobile Fixes */
    .timeline-container {
        padding-left: 30px; /* Tighter timeline */
    }
    .timeline-container::before {
        left: 15px;
    }
    .timeline-container::after {
        left: 15.5px;
    }
    .timeline-item::before {
        left: -22px;
        width: 12px;
        height: 12px;
        top: 34px;
    }
    .timeline-item::after {
        left: -20px;
        top: 39px;
        width: 20px;
    }
    .timeline-item {
        padding: 20px;
    }
    .timeline-change-item {
        flex-wrap: wrap;
        gap: 6px;
        font-size: 0.8rem;
    }
    .change-hero-group {
        padding: 2px 6px;
    }
    .timeline-ripples, .timeline-changes {
        padding: 0;
    }
}

/* ---------- STATUS & LINKS ---------- */
.status-tag {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: inline-block;
}
.status-active, .status-expanding { color: var(--green); }
.status-disbanded, .status-destroyed, .status-defunct { color: var(--danger); }
.status-diminished, .status-retreated, .status-weakened, .status-diminished-threat { color: var(--secondary); }
.status-hidden { color: var(--purple); }
.status-active-warfare { color: #facc15; } /* Yellow/Orange */

.faction-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px dashed var(--accent-dim);
    padding: 0 4px;
    border-radius: 4px;
}
.faction-link:hover {
    color: var(--accent-hover);
    border-bottom-color: var(--accent);
    background: var(--accent-dim);
    transform: translateY(-1px);
}
.faction-link-logo {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateY(-1px);
}
.faction-link-logo svg, .faction-link-logo .faction-logo-svg {
    width: 100%;
    height: 100%;
}

/* --- Timeline Ripple Enhancement --- */
.timeline-ripples, .timeline-changes {
    margin-top: 16px;
    padding: 0;
    background: none;
    border: none;
}
.ripple-header, .change-header {
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.8;
}
.ripple-header::after, .change-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.05);
}
.ripple-list, .change-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.timeline-ripple-item, .timeline-change-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: auto;
}
.timeline-ripple-item {
    cursor: pointer;
    transition: transform 0.2s ease;
}
.timeline-ripple-item:hover {
    transform: translateX(4px);
}
.timeline-change-item {
    flex-direction: row;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.timeline-change-item .change-icon {
    font-family: monospace;
    font-weight: bold;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}
.timeline-change-item.joined .change-icon { color: var(--green); }
.timeline-change-item.left .change-icon { color: var(--danger); }
.timeline-change-item .change-hero {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-primary);
    margin-right: 4px;
    cursor: pointer;
    transition: color 0.2s ease;
}
.timeline-change-item .change-hero:hover {
    color: var(--accent);
    text-decoration: underline;
}
.timeline-change-item .change-faction {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 600;
    margin-left: 4px;
    transition: opacity 0.2s ease;
}
.timeline-change-item .change-faction:hover {
    opacity: 0.8;
    text-decoration: underline;
}
.timeline-change-item .change-faction .faction-logo-svg {
    width: 14px;
    height: 14px;
}
.ripple-faction {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}
.ripple-impact {
    font-size: 0.78rem;
    color: var(--text-secondary);
    line-height: 1.4;
    padding-left: 20px;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- Hero Modal Specifics --- */
.hero-modal-portrait {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--accent);
    background: var(--bg-elevated);
    flex-shrink: 0;
}
.hero-modal-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
}
.hero-modal-portrait.initials {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-dim);
}
.hero-journey-timeline {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.journey-section-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 4px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
}
.hero-affiliation-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.hero-affiliation-card:hover {
    border-color: var(--accent);
    transform: translateX(4px);
    background: var(--bg-card-hover);
}
.hero-affiliation-card.former {
    background: var(--bg-card);
    opacity: 0.85;
}
.hero-affiliation-card.former:hover {
    opacity: 1;
}
.hero-affiliation-logo {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.hero-affiliation-info {
    flex-grow: 1;
}
.hero-affiliation-name {
    font-family: var(--font-display);
    font-size: 1.20rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 2px;
}
.hero-affiliation-role {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.hero-affiliation-status {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Timeline Roster Changes */
.timeline-change-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    font-size: 0.85rem;
    margin-bottom: 6px;
}
.change-hero-group {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    transition: all 0.2s ease;
}
.change-hero-group:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}
.change-hero {
    font-weight: 700;
    color: var(--text-primary);
}
.change-action {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.8rem;
}
.change-faction {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

/* --- Hero & Enhanced Linkification --- */
.hero-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    color: var(--text-primary);
    font-weight: 600;
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 0 2px;
    vertical-align: middle;
}

.hero-link:hover {
    background: var(--accent);
    color: var(--bg-deepest);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.inline-member-avatar {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.inline-member-initials {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    color: var(--text-muted);
}

.faction-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    color: var(--accent);
    font-weight: 600;
    font-family: var(--font-display);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    text-decoration: none;
    line-height: 1.2;
    vertical-align: middle;
    margin: 0 2px;
}

.faction-link:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.faction-link-logo {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- BACK TO TOP ---------- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--bg-card);
    border: 1px solid var(--accent-dim);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    clip-path: polygon(20% 0%, 100% 0%, 80% 100%, 0% 100%);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--accent);
    color: var(--bg-deepest);
    border-color: var(--accent);
    transform: translateY(-8px);
    box-shadow: 0 15px 50px var(--accent-glow);
}

.back-to-top svg {
    filter: drop-shadow(0 0 5px currentColor);
    transition: transform 0.3s ease;
}

.back-to-top:hover svg {
    transform: scale(1.1);
}

.back-to-top:active {
    transform: translateY(0) scale(0.9);
}

.btn-glitch {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: translateX(-100%);
    pointer-events: none;
}

.back-to-top:hover .btn-glitch {
    animation: btnShine 0.8s forwards;
}

@keyframes btnShine {
    to { transform: translateX(100%); }
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
    }
}
