/* ============================================================
   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: 1400px;
    
    /* 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);
    overflow-x: hidden;
    max-width: 100vw;
}

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

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

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

.site-switcher-toast {
    position: fixed;
    left: 50%;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -44%);
    max-width: calc(100vw - 24px);
    padding: 10px 16px;
    border: 1px solid var(--border-accent);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(10, 14, 26, 0.97), rgba(30, 41, 75, 0.94));
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(var(--accent-rgb), 0.15);
    backdrop-filter: blur(8px);
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.site-switcher-toast.visible {
    opacity: 1;
    transform: translate(-50%, -50%);
}

@media (max-width: 640px) {
    .site-switcher-toast {
        padding: 10px 12px;
        font-size: 0.8rem;
        letter-spacing: 0.05em;
    }
}

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

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; height: 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.45s 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: 100px 20px 40px; /* Centered padding */
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center; /* Center horizontally */
        justify-content: center; /* Center vertically */
    }
    #main-nav {
        top: 65px; /* Adjust for taller mobile competition bar */
    }
    .hero-content {
        padding: 0;
        text-align: center;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    .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 {
        margin: 0 auto;
        padding: 8px 32px;
        font-size: 0.8rem;
        letter-spacing: 1.5px;
        gap: 8px;
        clip-path: polygon(10% 0%, 100% 0%, 90% 100%, 0% 100%);
        display: inline-flex;
    }
    .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.65rem;
    }
    .hide-mobile {
        display: none;
    }
    .comp-paused-result {
        margin-left: 3px !important;
        letter-spacing: 1.5px !important;
    }
    .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;
}

.comp-paused-result {
    color: var(--accent);
    font-weight: 800;
    margin-left: 6px;
    letter-spacing: 2px;
    opacity: 1 !important;
}

@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); }
}

@keyframes amberPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; box-shadow: 0 0 5px rgba(249, 158, 26, 0.5); }
    50% { transform: scale(1.1); opacity: 0.4; box-shadow: 0 0 10px rgba(249, 158, 26, 0.8); }
}

.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;
}

.paused-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: amberPulse 3s 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);
}

.site-switcher {
    position: relative;
}

.site-switcher-toggle {
    padding: 0;
    border: none;
    background: none;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.site-switcher-toggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 6px;
    border-radius: 4px;
}

.site-switcher-caret {
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-top: -3px;
    opacity: 0.8;
    transition: transform 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.site-switcher.open .site-switcher-caret {
    transform: rotate(-135deg) translateY(-1px);
    color: var(--accent);
    opacity: 1;
}

.site-switcher-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    min-width: 250px;
    width: max-content;
    padding: 8px;
    border-radius: 8px;
    background: rgba(8, 12, 22, 0.98);
    border: 1px solid var(--accent-dim);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(18px);
    z-index: 1105;
}

.site-switcher-menu[hidden] {
    display: none;
}

.site-switcher-link {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 14px;
    border-radius: 6px;
    font-family: var(--font-display);
    font-weight: 600;
    text-transform: uppercase;
    color: var(--ow-white);
    transition: background 0.25s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transform: translateZ(0);
}

.site-switcher-link-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.site-switcher-link-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.site-switcher-link-label {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    text-align: left;
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    transition: color 0.2s ease, opacity 0.2s ease;
}

.site-switcher-link-accent {
    font-size: 0.9rem;
    letter-spacing: 1.4px;
    color: var(--text-primary);
    transition: color 0.25s ease;
}

.site-switcher-link:hover,
.site-switcher-link:focus-visible {
    background: var(--accent-dim);
}

.site-switcher-link:hover .site-switcher-link-label {
    color: rgba(255,255,255,0.7);
}

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

/* Overwatch Factions (Sombra Purple) */
.site-switcher-link.ow-link .site-switcher-link-accent { color: #d28cff; text-shadow: 0 0 10px rgba(187, 41, 255, 0.55); }
.site-switcher-link.ow-link:hover, .site-switcher-link.ow-link:focus-visible { background: rgba(187, 41, 255, 0.16); }
.site-switcher-link.ow-link:hover .site-switcher-link-accent, .site-switcher-link.ow-link:focus-visible .site-switcher-link-accent { color: #f5edff; }

/* Marvel Rivals (Galacta Pink/Red) */
.site-switcher-link.mr-link .site-switcher-link-accent { color: #ff6b8b; text-shadow: 0 0 10px rgba(255, 107, 139, 0.55); }
.site-switcher-link.mr-link:hover, .site-switcher-link.mr-link:focus-visible { background: rgba(255, 107, 139, 0.16); }
.site-switcher-link.mr-link:hover .site-switcher-link-accent, .site-switcher-link.mr-link:focus-visible .site-switcher-link-accent { color: #ffe3e9; }

/* CP Night City (Netrunner Yellow) */
.site-switcher-link.cp-link .site-switcher-link-accent { color: #fcee0a; text-shadow: 0 0 12px rgba(252, 238, 10, 0.55); }
.site-switcher-link.cp-link:hover, .site-switcher-link.cp-link:focus-visible { background: rgba(252, 238, 10, 0.14); }
.site-switcher-link.cp-link:hover .site-switcher-link-accent, .site-switcher-link.cp-link:focus-visible .site-switcher-link-accent { color: #ffffff; text-shadow: 0 0 16px rgba(252, 238, 10, 0.8); }

/* LoLTFT Runeterra (Hextech Gold) */
.site-switcher-link.lol-link .site-switcher-link-accent { color: #c8aa6e; text-shadow: 0 0 12px rgba(200, 170, 110, 0.4); }
.site-switcher-link.lol-link:hover, .site-switcher-link.lol-link:focus-visible { background: rgba(200, 170, 110, 0.15); }
.site-switcher-link.lol-link:hover .site-switcher-link-accent, .site-switcher-link.lol-link:focus-visible .site-switcher-link-accent { color: #fff4d4; text-shadow: 0 0 16px rgba(200, 170, 110, 0.7); }

/* AoT Titans (Ymir Orange) */
.site-switcher-link.ymir-link .site-switcher-link-accent { color: #ff9a3c; text-shadow: 0 0 12px rgba(255, 154, 60, 0.55); }
.site-switcher-link.ymir-link:hover, .site-switcher-link.ymir-link:focus-visible { background: rgba(255, 154, 60, 0.16); }
.site-switcher-link.ymir-link:hover .site-switcher-link-accent, .site-switcher-link.ymir-link:focus-visible .site-switcher-link-accent { color: #ffe7cf; text-shadow: 0 0 16px rgba(255, 154, 60, 0.8); }

/* Ninja Scrolls (Naruto Orange) */
.site-switcher-link.shinobi-link .site-switcher-link-accent { color: #ffb15e; text-shadow: 0 0 12px rgba(249, 115, 22, 0.5); }
.site-switcher-link.shinobi-link:hover, .site-switcher-link.shinobi-link:focus-visible { background: rgba(249, 115, 22, 0.14); }
.site-switcher-link.shinobi-link:hover .site-switcher-link-accent, .site-switcher-link.shinobi-link:focus-visible .site-switcher-link-accent { color: #fff3e0; text-shadow: 0 0 16px rgba(249, 115, 22, 0.78); }

/* Wrestling Chronicles (Arena Cyan) */
.site-switcher-link.wf-link .site-switcher-link-accent { color: #22d3ee; text-shadow: 0 0 12px rgba(34, 211, 238, 0.5); }
.site-switcher-link.wf-link:hover, .site-switcher-link.wf-link:focus-visible { background: rgba(34, 211, 238, 0.14); }
.site-switcher-link.wf-link:hover .site-switcher-link-accent, .site-switcher-link.wf-link:focus-visible .site-switcher-link-accent { color: #bff5ff; text-shadow: 0 0 16px rgba(34, 211, 238, 0.78); }

.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-language-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    min-height: 36px;
    padding: 5px 8px 5px 12px;
    border: 1px solid var(--accent-dim);
    border-radius: 4px;
    background: rgba(5, 8, 15, 0.72);
    box-shadow: inset 0 0 14px rgba(249, 158, 26, 0.06);
    transform: translateY(-1px);
}

.nav-language-control-top {
    margin-left: -16px;
}

.nav-language-control-mobile {
    display: none;
}

.nav-language-label {
    font-family: var(--font-display);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 1.4px;
    color: var(--accent);
    text-transform: uppercase;
    text-shadow: 0 0 10px var(--accent-glow);
    white-space: nowrap;
}

.nav-language-select-wrap {
    position: relative;
    min-width: 108px;
}

.nav-language-select {
    width: 100%;
    min-height: 28px;
    appearance: none;
    color: var(--text-primary);
    background: rgba(5, 8, 15, 0.88);
    border: 1px solid var(--border-accent);
    border-radius: 3px;
    padding: 5px 28px 5px 9px;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    outline: none;
}

.nav-language-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.18);
}

.nav-language-select option,
.hero-language-select option {
    color: #05080f;
    background: var(--ow-white);
}

.nav-language-caret {
    position: absolute;
    right: 10px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.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-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-language-control {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 42px;
    box-sizing: border-box;
    padding: 0 10px 0 15px;
    border: 1px solid rgba(var(--accent-rgb), 0.28);
    background: linear-gradient(90deg, rgba(5, 8, 15, 0.82), rgba(14, 18, 31, 0.68));
    box-shadow: inset 0 0 14px rgba(249, 158, 26, 0.05);
    backdrop-filter: blur(12px);
    border-radius: 2px;
    clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.hero-language-label {
    font-family: var(--font-display);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 1.45px;
    color: var(--accent);
    text-transform: uppercase;
    text-shadow: 0 0 12px var(--accent-glow);
    white-space: nowrap;
}

.hero-language-select-wrap {
    position: relative;
    min-width: 142px;
}

.hero-language-select {
    width: 100%;
    height: 30px;
    box-sizing: border-box;
    appearance: none;
    color: var(--text-primary);
    background: rgba(5, 8, 15, 0.84);
    border: 1px solid var(--border-accent);
    border-radius: 2px;
    padding: 5px 34px 5px 12px;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    outline: none;
    box-shadow: inset 0 0 14px rgba(249, 158, 26, 0.08);
}

.hero-language-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.18), inset 0 0 14px rgba(249, 158, 26, 0.12);
}

.hero-language-select option {
    color: #05080f;
    background: var(--ow-white);
}

.hero-language-caret {
    position: absolute;
    right: 12px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--accent);
    border-bottom: 2px solid var(--accent);
    transform: translateY(-65%) rotate(45deg);
    pointer-events: none;
    filter: drop-shadow(0 0 8px var(--accent-glow));
}
.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;
}

@media (max-width: 768px) {
    .hero-actions {
        justify-content: center;
        gap: 12px;
    }
    .hero-language-control {
        margin: 0;
        gap: 8px;
        height: 42px;
        padding: 0 8px 0 12px;
        max-width: min(92vw, 340px);
    }
    .hero-language-label {
        font-size: 0.58rem;
        letter-spacing: 1.6px;
    }
    .hero-language-select-wrap {
        min-width: 132px;
    }
    .hero-language-select {
        min-height: 32px;
        font-size: 0.72rem;
        letter-spacing: 0.6px;
    }
    .hero-title {
        font-size: clamp(2.2rem, 10vw, 3.2rem);
        margin-bottom: 12px;
        line-height: 1.05;
    }
    .hero-title-line {
        display: block;
        margin: 0 auto;
    }
}
@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);
}

@media (max-width: 768px) {
    .hero-subtitle {
        font-size: 0.95rem; /* Slightly smaller for premium feel */
        margin: 0 auto 40px; /* Tighter gap to keep elements locked in screen */
        max-width: 85%;
        text-align: center;
        opacity: 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: 768px) {
    .hero-stats {
        flex-direction: row;
        gap: 20px;
        padding: 5px 0;
        clip-path: none;
        border-radius: 0;
        background: transparent;
        border: none;
        max-width: none;
        width: 100%;
        justify-content: center;
        margin-bottom: 30px; /* Lock close to CTA */
        backdrop-filter: none;
        overflow-x: visible; /* Prevent scrollbar on numbers */
    }
    .stat-item {
        min-width: unset;
        flex: 1;
        max-width: 100px;
    }
    .stat-number {
        font-size: 1.4rem;
        margin-bottom: 2px;
    }
    .stat-label {
        font-size: 0.55rem;
        letter-spacing: 1px;
    }
    .stat-divider {
        display: none;
    }
}
.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: 38px;
    height: 38px;
    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: var(--container-max);
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.map-a11y-hint {
    margin: 6px auto 18px;
    color: var(--text-muted);
    font-size: 0.88rem;
    max-width: 760px;
    line-height: 1.45;
}
.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:focus-visible,
.zoom-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2);
}
.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;
}
#network-canvas:focus-visible {
    box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 4px rgba(var(--accent-rgb), 0.25);
}
.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: 38px;
    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;
    left: 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-back {
    position: absolute;
    top: 20px;
    left: 20px;
    min-width: 112px;
    height: 40px;
    padding: 0 14px;
    border-radius: 2px;
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    transition: all 0.25s ease;
    z-index: 10;
    border: 1px solid var(--border);
    cursor: pointer;
}
.modal-back:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-dim);
}
.modal-back.hidden {
    display: none;
}
.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: 84px 48px 40px;
    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%);
    position: relative;
}
.modal-body.is-loading > *:not(.modal-skeleton-overlay) {
    opacity: 0;
    pointer-events: none;
}
.modal-skeleton-overlay {
    position: absolute;
    inset: 24px;
    display: none;
    gap: 14px;
}
.modal-body.is-loading .modal-skeleton-overlay {
    display: grid;
}
.skeleton-line,
.skeleton-chip {
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.18) 45%, rgba(255,255,255,0.05) 100%);
    background-size: 220% 100%;
    animation: skeletonFlow 1.2s ease-in-out infinite;
}
.skeleton-line {
    height: 14px;
}
.skeleton-line.long { width: 100%; }
.skeleton-line.medium { width: 72%; }
.skeleton-line.short { width: 42%; }
.skeleton-chip {
    height: 56px;
}
.img-skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.2) 45%, rgba(255,255,255,0.08) 100%);
    background-size: 220% 100%;
    animation: skeletonFlow 1.2s ease-in-out infinite;
    color: transparent !important;
}
@keyframes skeletonFlow {
    0% { background-position: 200% 0; }
    100% { background-position: -30% 0; }
}
.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: 10px;
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
}

/* Custom sidebar scrollbar like the image */
.rel-faction-list::-webkit-scrollbar {
    width: 4px;
}
.rel-faction-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
}
.rel-faction-list::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 10px;
    box-shadow: 0 0 10px var(--accent-glow);
}
.rel-faction-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent; /* Boxes gone as requested */
    border: 1px solid transparent; /* Boxes gone as requested */
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    width: 100%;
    font-family: var(--font-display);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 1.2px;
    color: var(--text-secondary);
}
.rel-faction-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transform: translateX(4px);
}
.rel-faction-btn.active {
    background: rgba(var(--accent-rgb), 0.1);
    border-color: rgba(var(--accent-rgb), 0.2);
    color: var(--accent);
    text-shadow: 0 0 8px var(--accent-glow);
}
.rel-faction-btn .btn-icon {
    font-size: 1.1rem;
    width: 38px;
    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;
    flex-shrink: 0; /* Prevent squeezing */
    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: 14px;
    height: 14px;
    display: block;
}

.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 {
    opacity: 0.8;
}
.footer-logo span:last-child .accent {
    color: var(--sombra-purple);
    text-shadow: 0 0 10px var(--sombra-purple-glow);
}
.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-language-control-top {
        display: none;
    }
    .nav-language-control-mobile {
        display: inline-flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        width: 100%;
        min-height: auto;
        padding: 12px 0 16px;
        border-width: 0 0 1px;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        transform: none;
    }
    .nav-language-control-mobile .nav-language-select-wrap {
        width: 100%;
    }
    .nav-language-control-mobile .nav-language-select {
        min-height: 38px;
        font-size: 0.92rem;
    }
    .site-switcher-menu {
        left: 0;
        min-width: 220px;
    }
    .site-switcher-link {
        font-size: 0.72rem;
        letter-spacing: 1.2px;
    }
    .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: 0;
        margin-right: 0;
        width: 100%;
        border-radius: 0;
    }
    .modal {
        max-height: 95vh;
        width: 100%;
        margin: 0;
    }
    .modal-header {
        padding: 72px 24px 14px;
        flex-direction: row;
        gap: 16px;
    }
    .modal-back {
        top: 12px;
        left: 12px;
        min-width: 92px;
        height: 34px;
        font-size: 0.62rem;
        padding: 0 10px;
    }
    .modal-close {
        top: 12px;
        right: 12px;
        width: 34px;
        height: 34px;
        font-size: 1.2rem;
    }
    .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;
        margin: 0 auto;
        text-align: center;
    }
    .hero-title {
        font-size: clamp(2.2rem, 10vw, 3.2rem);
        margin: 0 auto 12px;
        line-height: 1.05;
        text-align: center;
        display: block;
    }
    .hero-subtitle {
        font-size: 0.95rem;
        margin: 0 auto 40px;
        text-align: center;
        max-width: 90%;
    }
    .command-palette {
        padding: 12vh 12px 12px;
    }
    .command-palette-head {
        padding: 12px;
    }
    .command-input-wrap {
        padding: 10px;
    }
    .command-result {
        padding: 9px 10px;
    }
    /* 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;
    }
    
    /* Influence Explorer Mobile Fixes */
    .rel-focus-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
        padding-bottom: 24px;
    }
    .rel-focus-info h3 {
        font-size: 1.6rem;
    }
    .rel-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .rel-mini-card {
        padding: 20px;
    }
    .rel-mini-desc {
        font-size: 0.8rem;
    }
}

/* ---------- 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;
}

/* ---------- COMMAND PALETTE ---------- */
.command-palette {
    position: fixed;
    inset: 0;
    z-index: 10030;
    background: rgba(4, 7, 14, 0.85);
    backdrop-filter: blur(8px) saturate(140%);
    padding: 18vh 24px 24px;
}
.command-palette.hidden {
    display: none;
}
.command-palette-panel {
    max-width: 760px;
    margin: 0 auto;
    border: 1px solid var(--border-accent);
    background: linear-gradient(180deg, rgba(19, 24, 39, 0.96), rgba(12, 16, 26, 0.98));
    border-radius: 10px;
    box-shadow: 0 25px 80px rgba(0,0,0,0.65), 0 0 28px rgba(var(--accent-rgb), 0.18);
    overflow: hidden;
}
.command-palette-head {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.command-palette-head h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
}
.command-shortcut-hint {
    font-family: var(--font-display);
    font-size: 0.68rem;
    letter-spacing: 1px;
    color: var(--text-muted);
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: 4px;
}
.command-input-wrap {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}
#command-palette-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 12px 14px;
}
#command-palette-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.2);
}
.command-results {
    max-height: min(52vh, 460px);
    overflow-y: auto;
    padding: 8px;
}
.command-result {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
    width: 100%;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 10px 12px;
    background: transparent;
    color: var(--text-primary);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}
.command-result:hover,
.command-result.active {
    background: rgba(var(--accent-rgb), 0.14);
    border-color: rgba(var(--accent-rgb), 0.45);
}
.command-result-icon {
    font-family: var(--font-display);
    color: var(--accent);
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.command-result-label {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: 0.6px;
}
.command-result-meta {
    color: var(--text-muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.command-empty {
    padding: 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
}
@media (max-width: 768px) {
    .command-palette {
        padding: 12vh 12px 12px;
    }
    .command-palette-head {
        padding: 12px;
    }
    .command-input-wrap {
        padding: 10px;
    }
    .command-result {
        padding: 9px 10px;
    }
}

/* ---------- 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;
    }
}

/* --- Era Categorization & Member Chips --- */
.era-group { margin-bottom: 24px; }
.era-label { font-family: var(--font-display); font-size: 0.7rem; font-weight: 700; letter-spacing: 2px; color: var(--accent); text-transform: uppercase; margin-bottom: 12px; opacity: 0.8; display: flex; align-items: center; gap: 10px; }
.era-label::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--accent-dim), transparent); }
.members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.member-role { font-size: 0.68rem; color: var(--text-muted); }
@media (max-width: 768px) { .members-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }


/* Hub Link Center */
.nav-hub-link-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: opacity 0.2s ease;
    z-index: 10;
}
.nav-hub-text {
    white-space: nowrap;
}
.nav-hub-link-center:hover {
    opacity: 0.7;
}
.nav-hub-icon {
    width: 38px;
    height: 38px;
}
@media (max-width: 768px) {
    .nav-hub-link-center .nav-hub-text { display: none; }
}

@media (max-width: 768px) {
    #main-nav {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: center;
        column-gap: 10px;
    }
    .site-switcher {
        justify-self: start;
        min-width: 0;
    }
    .site-switcher-toggle {
        gap: 8px;
        min-width: 0;
    }
    .nav-logo {
        gap: 8px;
        min-width: 0;
        max-width: 100%;
    }
    .nav-logo-text {
        font-size: 0.84rem;
        letter-spacing: 1.05px;
        white-space: nowrap;
    }
    .nav-logo-icon-container {
        width: 32px;
        height: 32px;
    }
    .nav-logo-icon {
        width: 100%;
        height: 100%;
    }
    .nav-hub-link-center {
        position: static;
        transform: none;
        justify-self: center;
    }
    .nav-hub-icon {
        width: 32px;
        height: 32px;
    }
    .mobile-menu-toggle {
        justify-self: end;
    }
}

@media (min-width: 769px) {
    #main-nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: clamp(18px, 2.4vw, 34px);
        padding-left: clamp(34px, 2.1vw, 60px);
        padding-right: clamp(34px, 2.1vw, 60px);
    }
    #main-nav.scrolled {
        padding-left: clamp(34px, 2.1vw, 60px);
        padding-right: clamp(34px, 2.1vw, 60px);
    }
    .site-switcher {
        flex: 0 0 auto;
        min-width: 0;
    }
    .nav-language-control-top {
        display: inline-flex;
    }
    .nav-logo-text {
        white-space: nowrap;
    }
    .nav-hub-link-center {
        display: flex;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    .nav-links {
        margin-left: auto;
        min-width: 0;
        gap: clamp(14px, 1.7vw, 24px);
    }
    .nav-links > * {
        flex-shrink: 0;
    }
    .nav-link,
    .nav-kofi-btn {
        white-space: nowrap;
    }
}

@media (min-width: 769px) and (max-width: 1500px) {
    .nav-hub-link-center {
        display: none;
    }
}

.site-switcher-menu {
    min-width: 300px;
    max-width: min(340px, calc(100vw - 32px));
    padding: 10px;
}

.site-switcher-link {
    position: relative;
    align-items: center;
    gap: 14px;
    min-height: 58px;
    padding: 12px 14px 12px 16px;
    overflow: hidden;
}

.site-switcher-link::before {
    content: '';
    position: absolute;
    top: 12px;
    bottom: 12px;
    left: 0;
    width: 2px;
    background: var(--switcher-accent, var(--accent));
    opacity: 0.45;
}

.site-switcher-link:hover::before,
.site-switcher-link:focus-visible::before {
    opacity: 1;
    box-shadow: 0 0 14px var(--switcher-glow, var(--accent-glow));
}

.site-switcher-link-icon {
    width: 34px;
    height: 34px;
}

.site-switcher-link-label {
    gap: 4px;
    min-width: 0;
    font-size: 1rem;
    letter-spacing: 0;
    line-height: 1.12;
}

.site-switcher-link-kicker {
    font-size: 0.56rem;
    letter-spacing: 2px;
    color: var(--text-muted);
    opacity: 0.9;
}

.site-switcher-link-accent {
    font-size: 0.92rem;
    letter-spacing: 1.45px;
}

.site-switcher-link.ow-link { --switcher-accent: #d28cff; --switcher-glow: rgba(187, 41, 255, 0.55); }
.site-switcher-link.mr-link { --switcher-accent: #ff6b8b; --switcher-glow: rgba(255, 107, 139, 0.55); }
.site-switcher-link.cp-link { --switcher-accent: #fcee0a; --switcher-glow: rgba(252, 238, 10, 0.55); }
.site-switcher-link.lol-link { --switcher-accent: #c8aa6e; --switcher-glow: rgba(200, 170, 110, 0.45); }
.site-switcher-link.ymir-link { --switcher-accent: #ff9a3c; --switcher-glow: rgba(255, 154, 60, 0.55); }
.site-switcher-link.shinobi-link { --switcher-accent: #ffb15e; --switcher-glow: rgba(249, 115, 22, 0.5); }
.site-switcher-link.wf-link { --switcher-accent: #22d3ee; --switcher-glow: rgba(34, 211, 238, 0.5); }

.site-switcher-link .site-switcher-link-accent {
    color: var(--switcher-accent, currentColor);
    text-shadow: 0 0 12px var(--switcher-glow, transparent);
}

.site-switcher-toggle .nav-logo-icon-container,
.site-switcher-toggle .nav-logo-mark {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.site-switcher-link[aria-disabled="true"] {
    opacity: 0.68;
    cursor: default;
}

.site-switcher-link[aria-disabled="true"]:hover,
.site-switcher-link[aria-disabled="true"]:focus-visible {
    opacity: 0.78;
    background: rgba(255, 255, 255, 0.05);
}

@media (max-width: 640px) {
    .rel-interface {
        gap: 16px;
        padding: 14px;
        min-height: 0;
    }
    .rel-selector-sidebar {
        min-width: 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding-right: 0;
        padding-bottom: 14px;
    }
    .rel-selector-header {
        margin-bottom: 14px;
    }
    .rel-faction-list {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        max-height: none;
        overflow: visible;
        padding-right: 0;
        padding-bottom: 0;
    }
    .rel-faction-btn {
        width: 100%;
        min-width: 0;
        min-height: 66px;
        flex-direction: column;
        justify-content: center;
        gap: 6px;
        padding: 9px 5px;
        text-align: center;
        white-space: normal;
        font-size: 0.68rem;
        line-height: 1.18;
        letter-spacing: 0.45px;
        font-weight: 800;
        overflow-wrap: anywhere;
    }
    .rel-faction-btn:hover {
        transform: translateY(-1px);
    }
    .rel-faction-btn .btn-icon {
        width: auto;
        font-size: 1.15rem;
        line-height: 1;
    }
    .rel-faction-btn .btn-name {
        display: block;
        max-width: 100%;
        overflow-wrap: anywhere;
    }
}
