/* ============================================================
   CP NIGHT CITY - STYLES
   Premium dark theme with neon cyberpunk accents
   ============================================================ */

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

:root {
    --bg-deepest: #050816;
    --bg-deep: #08101c;
    --bg-surface: #0c1526;
    --bg-card: #111b2e;
    --bg-card-hover: #17233a;
    --bg-elevated: #1b2944;
    --accent: #fcee09;
    --accent-rgb: 252, 238, 9;
    --accent-hover: #fff56a;
    --accent-dim: rgba(252, 238, 9, 0.14);
    --accent-glow: rgba(252, 238, 9, 0.34);
    --secondary: #00e5ff;
    --secondary-rgb: 0, 229, 255;
    --secondary-dim: rgba(0, 229, 255, 0.14);
    --pink: #ff4ecd;
    --pink-rgb: 255, 78, 205;
    --pink-dim: rgba(255, 78, 205, 0.14);
    --danger: #ff5a5f;
    --danger-rgb: 255, 90, 95;
    --danger-dim: rgba(255, 90, 95, 0.16);
    --purple: #9d7dff;
    --purple-rgb: 157, 125, 255;
    --purple-dim: rgba(157, 125, 255, 0.14);
    --green: #8aff4f;
    --green-rgb: 138, 255, 79;
    --green-dim: rgba(138, 255, 79, 0.14);
    --rel-alliance: var(--green);
    --rel-conflict: var(--danger);
    --rel-complex: var(--purple);
    --rel-former: var(--secondary);
    --sombra-purple: #00e5ff;
    --sombra-purple-glow: rgba(0, 229, 255, 0.48);
    --text-primary: #f4f8ff;
    --text-secondary: #9eb3ca;
    --text-muted: #647792;
    --border: rgba(255, 255, 255, 0.07);
    --border-accent: rgba(252, 238, 9, 0.28);
    --font-display: 'Oxanium', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
    --section-pad: 50px;
    --container-max: 1400px;
    --glass: rgba(10, 17, 31, 0.72);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow-sm: 0 4px 10px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 16px 28px rgba(0, 0, 0, 0.28);
    --shadow-lg: 0 30px 60px rgba(0, 0, 0, 0.4);
}

.d-char {
    color: var(--secondary);
    text-shadow: 0 0 10px var(--sombra-purple-glow);
    font-family: 'Courier New', Courier, monospace;
}

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:
        radial-gradient(circle at top right, rgba(252, 238, 9, 0.08), transparent 30%),
        radial-gradient(circle at left bottom, rgba(0, 229, 255, 0.08), transparent 30%),
        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, var(--border-strong, var(--border)));
    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;
    }
}

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

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

body::after {
    content: '';
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(rgba(18, 24, 42, 0) 50%, rgba(0, 0, 0, 0.12) 50%),
        linear-gradient(90deg, rgba(252, 238, 9, 0.025), rgba(0, 229, 255, 0.02), rgba(255, 78, 205, 0.025));
    z-index: 9999;
    background-size: 100% 3px, 4px 100%;
    pointer-events: none;
    opacity: 0.22;
}

#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 18px var(--accent-glow)) drop-shadow(0 0 12px var(--sombra-purple-glow));
    animation: iconPulse 2s infinite ease-in-out;
}
.loader-text {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--text-secondary);
    text-transform: uppercase;
}
.loader-bar {
    width: 220px;
    height: 3px;
    background: var(--bg-card);
    border-radius: 3px;
    overflow: hidden;
}
.loader-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--secondary), var(--pink));
    border-radius: 3px;
    animation: loaderFill 1.5s ease-out forwards;
}
@keyframes loaderFill {
    to { width: 100%; }
}

.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: center;
    opacity: 1;
    filter: brightness(0.92) contrast(1.12) saturate(1.12);
    animation: bannerFlicker 14s infinite, bannerDrift 32s infinite alternate ease-in-out;
}

@keyframes bannerDrift {
    0% { transform: scale(1) translateX(0); }
    100% { transform: scale(1.04) translateX(0.4%); }
}

.sombra-banner-fade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 72% 24%, rgba(252, 238, 9, 0.35) 0%, transparent 30%),
        radial-gradient(circle at 18% 78%, rgba(0, 229, 255, 0.2) 0%, transparent 28%),
        linear-gradient(to right, rgba(5, 8, 22, 0.96) 0%, rgba(5, 8, 22, 0.68) 28%, rgba(5, 8, 22, 0.2) 58%, rgba(5, 8, 22, 0.4) 100%),
        linear-gradient(to bottom, transparent 50%, var(--bg-deepest) 98%);
}

@keyframes bannerFlicker {
    0%, 15%, 17%, 52%, 100% { opacity: 1; filter: brightness(0.92) contrast(1.12) saturate(1.12); }
    16%, 52.4% { opacity: 1; filter: brightness(1.04) contrast(1.18) saturate(1.2); }
}

/* ---------- 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: 110px 20px 56px;
        min-height: 100vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    #main-nav {
        top: 0;
    }
    .hero-content {
        padding: 0;
        text-align: center;
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    .sombra-banner-img {
        width: 100%;
        min-width: 100%;
        height: 100%;
        object-position: center;
        animation: bannerFlicker 14s infinite, bannerDrift 28s infinite alternate ease-in-out;
    }
    .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%, 100% { transform: translateX(0); }
}
.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: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 60px;
    background: rgba(5, 10, 22, 0.82);
    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;
}


#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;
    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: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 6px;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: var(--ow-white);
    opacity: 0.85;
    transition: background 0.25s ease, color 0.25s ease, opacity 0.25s ease;
}

.site-switcher-link-icon {
    width: 22px;
    height: 22px;
    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: inline-flex;
    align-items: baseline;
    gap: 6px;
}

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

.site-switcher-link.galacta-link .site-switcher-link-icon img {
    filter: drop-shadow(0 0 10px rgba(224, 41, 41, 0.55));
}

.site-switcher-link.galacta-link .site-switcher-link-accent {
    color: #ff6363;
    text-shadow: 0 0 10px rgba(224, 41, 41, 0.55);
}

.site-switcher-link.galacta-link:hover,
.site-switcher-link.galacta-link:focus-visible {
    background: rgba(224, 41, 41, 0.14);
    color: #fde8e8;
}

.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 rgba(var(--accent-rgb), 0.28);
    border-radius: 0;
    background: rgba(5, 8, 15, 0.72);
    box-shadow: inset 0 0 14px rgba(var(--accent-rgb), 0.06);
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%, 8px 50%);
    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: 0;
    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(--text-primary);
}

.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-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: none;
    position: relative;
}

.hero-title-line {
    display: block;
}

@media (max-width: 768px) {
    .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;
    }
}
.accent-line {
    color: var(--accent);
    background: none;
    -webkit-text-fill-color: currentColor;
    text-shadow: 0 0 12px rgba(var(--accent-rgb), 0.22);
}
.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-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(var(--accent-rgb), 0.05);
    backdrop-filter: blur(12px);
    border-radius: 0;
    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: 0;
    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(var(--accent-rgb), 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(var(--accent-rgb), 0.12);
}

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

/* ---------- 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(--rel-alliance); box-shadow: 0 0 8px rgba(var(--green-rgb), 0.4); }
.legend-color.conflict { background: var(--rel-conflict); box-shadow: 0 0 8px rgba(var(--danger-rgb), 0.4); }
.legend-color.complex { background: var(--rel-complex); box-shadow: 0 0 8px rgba(var(--purple-rgb), 0.4); }
.legend-color.former { background: var(--rel-former); box-shadow: 0 0 8px rgba(var(--secondary-rgb), 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.corporate {
    color: #ff8b84;
    background: rgba(255, 59, 48, 0.14);
}
.card-alignment.gang {
    color: var(--pink);
    background: var(--pink-dim);
}
.card-alignment.government {
    color: var(--accent);
    background: var(--accent-dim);
}
.card-alignment.mercenary {
    color: #ffb35d;
    background: rgba(255, 159, 28, 0.14);
}
.card-alignment.nomad {
    color: var(--secondary);
    background: var(--secondary-dim);
}
.card-alignment.community {
    color: var(--green);
    background: var(--green-dim);
}
.card-alignment.militia {
    color: #a9ff75;
    background: rgba(138, 255, 79, 0.14);
}

.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-territory-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 24px;
    margin: 0 0 16px;
}
.card-territory-chip,
.card-territory-more,
.card-territory-empty {
    font-family: var(--font-display);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    border-radius: 3px;
    line-height: 1;
}
.card-territory-chip {
    padding: 6px 8px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.card-territory-more,
.card-territory-empty {
    color: var(--text-muted);
    padding: 6px 0;
}
.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: 38px;
    height: 38px;
    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, border-color 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    z-index: 1;
    background: var(--bg-elevated);
}
.card-member-avatar:first-child {
    margin-left: 0;
}
.card-member-avatar:hover {
    transform: scale(1.95) translateY(-6px);
    z-index: 18;
    border-color: var(--accent);
    box-shadow:
        0 0 0 2px rgba(var(--accent-rgb), 0.28),
        0 0 0 7px rgba(var(--accent-rgb), 0.16),
        0 0 18px rgba(var(--accent-rgb), 0.16),
        0 18px 30px rgba(0, 0, 0, 0.45);
}
.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);
    display: block;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    transform-origin: center center;
    position: relative;
    z-index: 1;
}
.member-avatar-img:hover,
.member-chip:hover .member-avatar-img {
    transform: scale(1.95);
    z-index: 18;
    box-shadow:
        0 0 0 2px rgba(var(--accent-rgb), 0.26),
        0 0 0 6px rgba(var(--accent-rgb), 0.14),
        0 0 16px rgba(var(--accent-rgb), 0.15);
}
.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;
}

/* ---------- DISTRICT CONTROL ---------- */
.territory-interface {
    display: grid;
    grid-template-columns: 230px 1fr;
    gap: 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 24px;
    border-radius: 4px;
    min-height: 430px;
    max-width: 100%;
}
.territory-selector-sidebar {
    border-right: 1px solid var(--border);
    padding-right: 24px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.territory-district-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: visible;
}
.territory-district-btn {
    width: 100%;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-align: left;
    color: var(--text-secondary);
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    font-family: var(--font-display);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    white-space: normal;
    cursor: pointer;
    transition: all 0.25s ease;
}
.territory-district-btn:hover,
.territory-district-btn:focus-visible {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    transform: translateX(4px);
    outline: none;
}
.territory-district-btn.active {
    background: rgba(var(--accent-rgb), 0.1);
    border-color: rgba(var(--accent-rgb), 0.22);
    color: var(--accent);
    text-shadow: 0 0 8px var(--accent-glow);
}
.territory-focus-display {
    min-width: 0;
}
.territory-focus-header {
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 18px;
}
.territory-focus-kicker {
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 8px;
}
.territory-focus-header h3 {
    font-family: var(--font-display);
    font-size: 1.55rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.territory-focus-header p {
    max-width: 620px;
    color: #c4ccd8;
    font-size: 0.9rem;
    line-height: 1.65;
    overflow-wrap: anywhere;
}
.territory-pressure-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.territory-pressure-row {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 12px;
    padding: 11px 14px;
    text-align: left;
    white-space: normal;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-left: 3px solid var(--territory-faction, var(--accent));
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.25s ease;
}
.territory-pressure-row:hover,
.territory-pressure-row:focus-visible {
    background: rgba(255, 255, 255, 0.045);
    border-color: rgba(255, 255, 255, 0.18);
    border-left-color: var(--territory-faction, var(--accent));
    transform: translateX(4px);
    outline: none;
}
.territory-pressure-logo {
    width: 28px;
    height: 28px;
    min-width: 0;
}
.territory-pressure-main {
    display: grid;
    gap: 5px;
    min-width: 0;
    max-width: 100%;
}
.territory-pressure-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}
.territory-pressure-name {
    font-family: var(--font-display);
    color: #f4f8ff;
    font-size: 0.86rem;
    font-weight: 800;
    letter-spacing: 0.45px;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}
.territory-pressure-level {
    flex-shrink: 0;
    min-height: 20px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 3px;
    color: #dce4ef;
    background: rgba(255, 255, 255, 0.07);
    font-family: var(--font-body);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    line-height: 1.1;
    text-transform: uppercase;
}
.territory-pressure-level.stronghold {
    color: var(--accent);
    border-color: var(--border-accent);
    background: var(--accent-dim);
}
.territory-pressure-level.base {
    color: #99ff8c;
    border-color: rgba(153, 255, 140, 0.44);
    background: rgba(92, 255, 122, 0.11);
}
.territory-pressure-level.citywide {
    color: #9eefff;
    border-color: rgba(var(--secondary-rgb), 0.35);
    background: rgba(var(--secondary-rgb), 0.1);
}
.territory-pressure-level.operation {
    color: #82b4ff;
    border-color: rgba(130, 180, 255, 0.4);
    background: rgba(72, 122, 255, 0.12);
}
.territory-pressure-level.influence {
    color: #c9bcff;
    border-color: rgba(var(--purple-rgb), 0.32);
    background: rgba(var(--purple-rgb), 0.1);
}
.territory-pressure-level.legacy {
    color: #ffbd73;
    border-color: rgba(255, 189, 115, 0.4);
    background: rgba(255, 138, 70, 0.1);
}
.territory-pressure-level.contested {
    color: var(--danger);
    border-color: rgba(var(--danger-rgb), 0.35);
    background: rgba(var(--danger-rgb), 0.12);
}
.territory-pressure-note {
    display: block;
    min-width: 0;
    max-width: 100%;
    color: #e0e6ef;
    font-size: 0.88rem;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
}
.territory-empty {
    padding: 18px;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-style: italic;
}
@media (max-width: 900px) {
    .territory-interface {
        grid-template-columns: 1fr;
    }
    .territory-selector-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border);
        padding-right: 0;
        padding-bottom: 20px;
    }
    .territory-district-list {
        flex-direction: row;
        overflow-x: auto;
        max-height: none;
        padding-bottom: 8px;
    }
    .territory-district-btn {
        width: auto;
        min-width: max-content;
    }
}
@media (max-width: 640px) {
    .territory-interface {
        gap: 16px;
        padding: 14px;
        min-height: 0;
    }
    .territory-selector-sidebar {
        padding-bottom: 14px;
    }
    .territory-district-list {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        overflow: visible;
        padding-bottom: 0;
    }
    .territory-district-btn {
        width: 100%;
        min-width: 0;
        min-height: 42px;
        justify-content: center;
        padding: 9px 5px;
        text-align: center;
        font-size: 0.62rem;
        line-height: 1.15;
        letter-spacing: 0.45px;
        overflow-wrap: anywhere;
    }
    .territory-district-btn:hover,
    .territory-district-btn:focus-visible {
        transform: translateY(-1px);
    }
    .territory-focus-header {
        padding-bottom: 16px;
        margin-bottom: 14px;
    }
    .territory-focus-kicker {
        font-size: 0.58rem;
        letter-spacing: 1.7px;
    }
    .territory-focus-header h3 {
        font-size: 1.28rem;
        letter-spacing: 1.4px;
    }
    .territory-focus-header p {
        font-size: 0.84rem;
        line-height: 1.55;
    }
    .territory-pressure-list {
        gap: 8px;
    }
    .territory-pressure-row {
        grid-template-columns: 28px minmax(0, 1fr);
        gap: 10px;
        padding: 11px 10px;
    }
    .territory-pressure-row:hover,
    .territory-pressure-row:focus-visible {
        transform: translateY(-1px);
    }
    .territory-pressure-logo {
        width: 24px;
        height: 24px;
    }
    .territory-pressure-head {
        align-items: flex-start;
        justify-content: flex-start;
        gap: 6px;
    }
    .territory-pressure-name {
        font-size: 0.78rem;
        line-height: 1.2;
        letter-spacing: 0.25px;
    }
    .territory-pressure-level {
        padding: 3px 7px;
        font-size: 0.58rem;
    }
    .territory-pressure-note {
        font-size: 0.8rem;
        line-height: 1.42;
    }
}

/* ---------- 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;
}
.territory-detail-grid {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.territory-detail-card {
    display: grid;
    grid-template-columns: minmax(132px, max-content) minmax(0, 1fr);
    align-items: center;
    column-gap: 14px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-left: 3px solid rgba(var(--accent-rgb), 0.7);
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.08), rgba(255, 255, 255, 0.018) 34%, transparent);
}
.territory-detail-card.stronghold {
    border-color: var(--border);
    border-left-color: var(--accent);
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.1), rgba(255, 255, 255, 0.02) 38%, transparent);
}
.territory-detail-card.base {
    border-color: rgba(153, 255, 140, 0.28);
    border-left-color: #99ff8c;
    background: linear-gradient(90deg, rgba(92, 255, 122, 0.1), rgba(255, 255, 255, 0.018) 38%, transparent);
}
.territory-detail-card.citywide {
    border-color: rgba(var(--secondary-rgb), 0.26);
    border-left-color: #9eefff;
    background: linear-gradient(90deg, rgba(var(--secondary-rgb), 0.09), rgba(255, 255, 255, 0.018) 38%, transparent);
}
.territory-detail-card.operation {
    border-color: rgba(130, 180, 255, 0.28);
    border-left-color: #82b4ff;
    background: linear-gradient(90deg, rgba(72, 122, 255, 0.1), rgba(255, 255, 255, 0.018) 38%, transparent);
}
.territory-detail-card.influence {
    border-color: rgba(var(--purple-rgb), 0.28);
    border-left-color: #c9bcff;
    background: linear-gradient(90deg, rgba(var(--purple-rgb), 0.1), rgba(255, 255, 255, 0.018) 38%, transparent);
}
.territory-detail-card.legacy {
    border-color: rgba(255, 189, 115, 0.28);
    border-left-color: #ffbd73;
    background: linear-gradient(90deg, rgba(255, 138, 70, 0.1), rgba(255, 255, 255, 0.018) 38%, transparent);
}
.territory-detail-card.contested {
    border-color: rgba(var(--danger-rgb), 0.35);
    border-left-color: var(--danger);
    background: linear-gradient(90deg, rgba(var(--danger-rgb), 0.1), rgba(255, 255, 255, 0.018) 38%, transparent);
}
.territory-detail-topline {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-width: 0;
}
.territory-detail-district {
    font-family: var(--font-display);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}
.territory-detail-level {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 4px 8px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.07);
    font-family: var(--font-body);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.2px;
    line-height: 1.1;
    text-transform: uppercase;
    color: #dce4ef;
}
.territory-detail-card.stronghold .territory-detail-level {
    border-color: rgba(var(--accent-rgb), 0.56);
    background: rgba(var(--accent-rgb), 0.16);
    color: var(--accent-hover);
}
.territory-detail-card.base .territory-detail-level {
    border-color: rgba(153, 255, 140, 0.44);
    background: rgba(92, 255, 122, 0.12);
    color: #b7ffae;
}
.territory-detail-card.citywide .territory-detail-level {
    border-color: rgba(var(--secondary-rgb), 0.42);
    background: rgba(var(--secondary-rgb), 0.12);
    color: #9eefff;
}
.territory-detail-card.operation .territory-detail-level {
    border-color: rgba(130, 180, 255, 0.42);
    background: rgba(72, 122, 255, 0.12);
    color: #a8c7ff;
}
.territory-detail-card.influence .territory-detail-level {
    border-color: rgba(var(--purple-rgb), 0.38);
    background: rgba(var(--purple-rgb), 0.12);
    color: #c9bcff;
}
.territory-detail-card.legacy .territory-detail-level {
    border-color: rgba(255, 189, 115, 0.42);
    background: rgba(255, 138, 70, 0.12);
    color: #ffd0a0;
}
.territory-detail-card.contested .territory-detail-level {
    border-color: rgba(var(--danger-rgb), 0.55);
    background: rgba(var(--danger-rgb), 0.16);
    color: #ffb7ba;
}
.territory-detail-card p,
.modal-empty {
    color: #d1d8e4;
    font-size: 0.88rem;
    line-height: 1.45;
    margin: 0;
}
.territory-detail-card p {
    grid-column: auto;
}
@media (max-width: 640px) {
    .territory-detail-card {
        grid-template-columns: 1fr;
        gap: 6px;
    }
    .territory-detail-topline {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
    .territory-detail-card p {
        grid-column: 1;
    }
}
.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-chip.associate {
    border-style: dashed;
    background: rgba(255, 255, 255, 0.025);
}
.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;
}
.member-chip.associate .member-name {
    color: var(--text-secondary);
}

.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: 4px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 500px;
    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;
}

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

.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: opacity(0.95) drop-shadow(0 0 8px rgba(var(--accent-rgb), 0.3));
    transition: all 0.3s ease;
}
.footer-logo:hover .footer-logo-img {
    filter: 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);
}

/* ---------- SITE SWITCHER ---------- */
.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(5, 7, 15, 0.98); border: 1px solid var(--border-accent, var(--border)); box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45); backdrop-filter: blur(18px); z-index: 1205; }
.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, var(--font-heading)); font-weight: 600; text-transform: uppercase; color: var(--text-primary); transition: background 0.25s ease; text-decoration: none; -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: rgba(255, 255, 255, 0.08); }
.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 Site Theme (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); }

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

/* Ymir's Coordinate (Signature Orange) */
.site-switcher-link.ymir-link .site-switcher-link-accent { color: #ff7c30; text-shadow: 0 0 12px rgba(255, 124, 48, 0.58); }
.site-switcher-link.ymir-link:hover, .site-switcher-link.ymir-link:focus-visible { background: rgba(255, 124, 48, 0.16); }
.site-switcher-link.ymir-link:hover .site-switcher-link-accent, .site-switcher-link.ymir-link:focus-visible .site-switcher-link-accent { color: #ffd8bd; text-shadow: 0 0 16px rgba(255, 124, 48, 0.78); }

/* Ninja Scrolls (Naruto Orange) */
.site-switcher-link.shinobi-link .site-switcher-link-accent { color: #ff9d3d; 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.16); }
.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.75); }
.nav-logo-icon-container { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 34px; height: 34px; }
.nav-logo-icon { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 8px rgba(var(--accent-rgb), 0.5)); }
.site-switcher-menu.mobile-menu-open { display: none; }
@media (max-width: 768px) {
    .site-switcher-menu { left: 0; min-width: 220px; }
    .site-switcher-link { font-size: 0.72rem; letter-spacing: 1.2px; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    #main-nav {
        padding: 12px 20px;
        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;
        font-size: 0.82rem;
        letter-spacing: 1.1px;
        min-width: 0;
        max-width: 100%;
    }
    .nav-logo-icon-container {
        width: 30px;
        height: 30px;
        padding: 5px;
    }
    .nav-logo-icon {
        width: 100%;
        height: 100%;
    }
    .nav-logo-text {
        white-space: nowrap;
    }
    .nav-hub-link-center {
        position: static;
        transform: none;
        justify-self: center;
    }
    .nav-hub-icon {
        width: 32px;
        height: 32px;
    }
    /* Mobile Nav Overhaul */
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        gap: 6px;
        width: 30px;
        background: none;
        border: none;
        cursor: pointer;
        justify-self: end;
        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);
    }
    .nav-language-control-top {
        display: none;
    }
    .nav-language-control-mobile {
        display: inline-flex;
        width: 100%;
        justify-content: space-between;
        margin: 0;
        padding: 10px 12px;
    }
    .nav-language-control-mobile .nav-language-select-wrap {
        min-width: 150px;
    }
    .nav-language-control-mobile .nav-language-select {
        min-height: 34px;
        font-size: 0.8rem;
    }
    #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);
    }
    .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;
    }
    .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: 134px;
    }
    .hero-language-select {
        font-size: 0.78rem;
        letter-spacing: 0.8px;
    }
    .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: 76px;
    height: 76px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent);
    background: var(--bg-elevated);
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.16);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    position: relative;
    z-index: 1;
}
.hero-modal-portrait:hover {
    transform: scale(1.32) translateY(-4px);
    z-index: 18;
    box-shadow:
        0 0 0 3px rgba(var(--accent-rgb), 0.24),
        0 0 0 9px rgba(var(--accent-rgb), 0.14),
        0 0 20px rgba(var(--accent-rgb), 0.16);
}
.hero-modal-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 15%;
    transition: transform 0.28s ease;
}
.hero-modal-portrait:hover img {
    transform: scale(1.14);
}
.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);
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    transform-origin: center center;
    position: relative;
    z-index: 1;
}
.inline-member-avatar:hover,
.hero-link:hover .inline-member-avatar {
    transform: scale(2.25);
    z-index: 18;
    box-shadow:
        0 0 0 2px rgba(var(--accent-rgb), 0.24),
        0 0 0 6px rgba(var(--accent-rgb), 0.14),
        0 0 14px rgba(var(--accent-rgb), 0.15);
}

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

/* ---------- NIGHT CITY THEME PASS (V1) ---------- */
:root {
    --bg-deepest: #040507;
    --bg-deep: #080b10;
    --bg-surface: #10151d;
    --bg-card: #10161f;
    --bg-card-hover: #161f2a;
    --bg-elevated: #1e2835;
    --accent: #fcee09;
    --accent-rgb: 252, 238, 9;
    --accent-hover: #fff36a;
    --accent-dim: rgba(252, 238, 9, 0.14);
    --accent-glow: rgba(252, 238, 9, 0.38);
    --secondary: #12d8d2;
    --secondary-rgb: 18, 216, 210;
    --pink: #ff5f8a;
    --pink-rgb: 255, 95, 138;
    --pink-dim: rgba(255, 95, 138, 0.15);
    --purple: #ff8f3b;
    --purple-rgb: 255, 143, 59;
    --purple-dim: rgba(255, 143, 59, 0.14);
    --sombra-purple: #ffb347;
    --sombra-purple-glow: rgba(255, 179, 71, 0.46);
    --text-primary: #edf2f8;
    --text-secondary: #a6b2c2;
    --text-muted: #6f7c8f;
    --border: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(252, 238, 9, 0.34);
    --font-display: 'Teko', sans-serif;
    --font-body: 'Space Grotesk', sans-serif;
    --font-mono: 'Share Tech Mono', 'Courier New', monospace;
    --ow-white: var(--text-primary);
}

/* Keep landing hero typography on the original profile. */
#hero .hero-badge,
#hero .hero-title,
#hero .stat-number,
#hero .stat-label,
#hero .hero-cta {
    font-family: 'Oxanium', sans-serif;
}

body {
    background:
        radial-gradient(circle at 82% 8%, rgba(252, 238, 9, 0.12), transparent 30%),
        radial-gradient(circle at 8% 88%, rgba(18, 216, 210, 0.08), transparent 28%),
        linear-gradient(130deg, #040507 0%, #090c11 35%, #080a0e 100%);
}

body::after {
    background:
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.015) 0 2px, transparent 2px 4px),
        repeating-linear-gradient(90deg, rgba(var(--accent-rgb), 0.04) 0 1px, transparent 1px 72px),
        linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.18) 100%);
    background-size: 100% 4px, 72px 100%, 100% 100%;
    opacity: 0.22;
    mix-blend-mode: screen;
    animation: citySignalScan 14s linear infinite;
}

@keyframes citySignalScan {
    0% { background-position: 0 0, 0 0, 0 0; }
    100% { background-position: 0 64px, 72px 0, 0 0; }
}

#main-nav {
    background: linear-gradient(180deg, rgba(4, 5, 8, 0.94) 0%, rgba(4, 5, 8, 0.78) 100%);
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.3);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.45);
}

#main-nav::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: repeating-linear-gradient(90deg, rgba(var(--accent-rgb), 0.85) 0 24px, transparent 24px 38px);
    opacity: 0.3;
    pointer-events: none;
}

#main-nav::after {
    content: '';
    position: absolute;
    left: 12%;
    right: 12%;
    bottom: 1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.85), transparent);
    transform: translateX(-30%);
    animation: navDataSweep 6s linear infinite;
    pointer-events: none;
}

@keyframes navDataSweep {
    to { transform: translateX(30%); }
}

.nav-logo-text .accent {
    color: var(--accent);
    text-shadow: 0 0 14px rgba(var(--accent-rgb), 0.55);
}

.nav-logo-icon {
    filter: drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.6));
}

.nav-link {
    letter-spacing: 1.9px;
    font-size: 0.84rem;
}

.nav-link::after {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    box-shadow: none;
}

.nav-kofi-btn {
    border-radius: 0;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%);
}

.section-badge {
    font-family: var(--font-mono);
    letter-spacing: 3.2px;
    padding: 7px 18px;
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.2), rgba(var(--accent-rgb), 0.06));
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%);
}

.section-title::after {
    width: 110px;
    height: 3px;
    border-radius: 0;
    background: linear-gradient(90deg, transparent, var(--accent), var(--secondary), transparent);
    box-shadow: none;
}

.map-btn,
.faction-filter-btn {
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: linear-gradient(145deg, rgba(16, 22, 31, 0.92), rgba(14, 20, 30, 0.8));
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 8px 50%);
}

.map-btn:hover,
.faction-filter-btn:hover {
    border-color: rgba(var(--accent-rgb), 0.82);
    box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.2);
}

.map-btn.active,
.faction-filter-btn.active {
    background: linear-gradient(130deg, rgba(var(--accent-rgb), 0.2), rgba(var(--accent-rgb), 0.08));
    border-color: rgba(var(--accent-rgb), 0.95);
    color: var(--accent);
    box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.25), 0 0 20px rgba(var(--accent-rgb), 0.18);
}

.map-container {
    border-radius: 0;
    border: 1px solid rgba(var(--accent-rgb), 0.26);
    background: linear-gradient(180deg, rgba(8, 12, 18, 0.98), rgba(6, 9, 14, 0.98));
    box-shadow: 0 24px 46px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(18, 216, 210, 0.08);
    clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.map-container::before {
    content: 'TACTICAL RELAY';
    position: absolute;
    top: 10px;
    left: 14px;
    padding: 2px 8px;
    font-family: var(--font-mono);
    font-size: 0.63rem;
    letter-spacing: 1.8px;
    color: rgba(var(--accent-rgb), 0.75);
    border: 1px solid rgba(var(--accent-rgb), 0.35);
    background: rgba(5, 8, 12, 0.8);
    z-index: 2;
    pointer-events: none;
}

.map-container.fullscreen {
    clip-path: none;
}

.map-container.fullscreen::before {
    display: none;
}

.faction-card {
    border-radius: 0;
    border: 1px solid rgba(255, 255, 255, 0.11);
    background:
        linear-gradient(160deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 55%),
        linear-gradient(180deg, rgba(16, 22, 32, 0.94), rgba(11, 16, 24, 0.92));
    clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.faction-card::before {
    width: 2px;
    background: linear-gradient(180deg, var(--card-accent, var(--accent)) 0%, transparent 80%);
    opacity: 0.95;
}

.faction-card::after {
    background: repeating-linear-gradient(135deg, rgba(var(--accent-rgb), 0.11) 0 10px, transparent 10px 22px);
    opacity: 0.02;
}

.faction-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 22px 45px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(var(--accent-rgb), 0.16);
}

.card-icon {
    border-radius: 0;
    clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 8px 100%, 0 calc(100% - 8px));
}

.card-title {
    letter-spacing: 1.4px;
}

.footer-logo:hover .footer-logo-img {
    filter: opacity(1) drop-shadow(0 0 10px rgba(var(--accent-rgb), 0.45));
}

.footer-logo span:last-child .accent {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
}

@media (max-width: 768px) {
    .map-container,
    .faction-card,
    .map-btn,
    .faction-filter-btn {
        clip-path: none;
        border-radius: 8px;
    }
}


/* 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-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;
        padding: 5px;
    }
    .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;
    }
}

.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 (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,
    .nav-language-control {
        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 {
    flex-direction: column;
    align-items: flex-start;
    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;
}
