:root {
            --lonestar: #64c4f4;
            --valkyra: #c73d3d;
            --manticore: #08a20e;
            --panel-glass: rgba(18, 22, 34, 0.75);
            --panel-border: rgba(255, 255, 255, 0.08);
            --gold: #ffb300;
        }

        body {
            background-color: #0b0e14;
            background-image: 
                radial-gradient(circle at 15% 10%, rgba(100, 196, 244, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 85% 15%, rgba(199, 61, 61, 0.05) 0%, transparent 40%),
                radial-gradient(circle at 50% 60%, rgba(8, 162, 14, 0.04) 0%, transparent 50%);
            color: #d1d7e0;
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            margin: 0;
            padding: 0;
        }

        .factions-page {
            max-width: 1400px;
            margin: 20px auto 10px auto;
            padding: 0 20px;
        }

        /* Hero Header */
        .factions-hero {
            display: flex;
            align-items: flex-end;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 16px;
            margin-bottom: 20px;
            padding-bottom: 16px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        }

        .hero-left-col .breadcrumb {
            display: flex;
            align-items: center;
            gap: 8px;
            font-family: 'Rajdhani', sans-serif;
            font-size: 13px;
            font-weight: 700;
            letter-spacing: 1.5px;
            text-transform: uppercase;
            color: #717d96;
            margin-bottom: 6px;
        }

        .hero-left-col .breadcrumb a {
            color: var(--gold);
            text-decoration: none;
            transition: color 0.2s;
        }

        .hero-left-col .breadcrumb a:hover {
            color: #fff;
        }

        .hero-title {
            font-family: 'Rajdhani', sans-serif;
            font-size: 34px;
            font-weight: 800;
            letter-spacing: 1px;
            color: #ffffff;
            margin: 0 0 4px 0;
            display: flex;
            align-items: center;
            gap: 12px;
            text-transform: uppercase;
        }

        .hero-title span {
            color: var(--gold);
            text-shadow: 0 0 20px rgba(255, 179, 0, 0.4);
        }

        .hero-subtitle {
            font-size: 13px;
            color: #8c9ba5;
            max-width: 680px;
            line-height: 1.4;
            margin: 0;
        }

        /* Hero Right (Outlier Tag + Timeframe) */
        .hero-right-col {
            display: flex;
            align-items: center;
            gap: 14px;
            flex-wrap: wrap;
        }

        .outlier-tag {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            font-size: 12px;
            font-family: 'JetBrains Mono', monospace;
            color: #ffb300;
            background: rgba(255, 179, 0, 0.08);
            border: 1px solid rgba(255, 179, 0, 0.25);
            border-radius: 4px;
            padding: 6px 12px;
            white-space: nowrap;
        }

        .outlier-tag svg {
            color: var(--gold);
            flex-shrink: 0;
        }

        /* Timeframe Navigation Pills */
        .time-pill-group {
            display: inline-flex;
            background: rgba(14, 18, 28, 0.85);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 4px;
            padding: 3px;
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
        }

        .time-pill {
            font-family: 'Rajdhani', sans-serif;
            font-size: 13px;
            font-weight: 700;
            letter-spacing: 1px;
            color: #8c9ba5;
            padding: 6px 14px;
            border-radius: 4px;
            text-decoration: none;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .time-pill:hover {
            color: #fff;
            background: rgba(255, 255, 255, 0.05);
        }

        .time-pill.active {
            color: #0b0e14;
            background: var(--gold);
            font-weight: 800;
            border-radius: 4px;
            box-shadow: 0 0 16px rgba(255, 179, 0, 0.5);
        }

        /* KPI Faction Cards Grid */
        .factions-kpi-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 18px;
            margin-bottom: 22px;
        }

        .kpi-card {
            background: var(--panel-glass);
            border: 1px solid var(--panel-border);
            border-radius: 0;
            padding: 24px;
            position: relative;
            overflow: hidden;
            backdrop-filter: blur(14px);
            transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
        }

        .kpi-card:hover {
            transform: translateY(-4px);
        }

        .kpi-card.lonestar {
            border-top: 4px solid var(--lonestar);
            background: linear-gradient(180deg, rgba(100, 196, 244, 0.08) 0%, rgba(18, 22, 34, 0.75) 40%);
        }
        .kpi-card.lonestar:hover {
            box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), 0 0 25px rgba(100, 196, 244, 0.25);
            border-color: rgba(100, 196, 244, 0.4);
        }

        .kpi-card.valkyra {
            border-top: 4px solid var(--valkyra);
            background: linear-gradient(180deg, rgba(199, 61, 61, 0.08) 0%, rgba(18, 22, 34, 0.75) 40%);
        }
        .kpi-card.valkyra:hover {
            box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), 0 0 25px rgba(199, 61, 61, 0.25);
            border-color: rgba(199, 61, 61, 0.4);
        }

        .kpi-card.manticore {
            border-top: 4px solid var(--manticore);
            background: linear-gradient(180deg, rgba(8, 162, 14, 0.08) 0%, rgba(18, 22, 34, 0.75) 40%);
        }
        .kpi-card.manticore:hover {
            box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5), 0 0 25px rgba(8, 162, 14, 0.25);
            border-color: rgba(8, 162, 14, 0.4);
        }

        /* Card Top Header */
        .kpi-card-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 18px;
        }

        .faction-title-block {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .faction-emblem {
            width: 44px;
            height: 44px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Rajdhani', sans-serif;
            font-weight: 800;
            font-size: 16px;
            border: 1px solid rgba(255, 255, 255, 0.15);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
        }

        .kpi-card.lonestar .faction-emblem {
            background: rgba(100, 196, 244, 0.15);
            color: var(--lonestar);
            border-color: rgba(100, 196, 244, 0.4);
            box-shadow: 0 0 15px rgba(100, 196, 244, 0.2);
        }

        .kpi-card.valkyra .faction-emblem {
            background: rgba(199, 61, 61, 0.15);
            color: var(--valkyra);
            border-color: rgba(199, 61, 61, 0.4);
            box-shadow: 0 0 15px rgba(199, 61, 61, 0.2);
        }

        .kpi-card.manticore .faction-emblem {
            background: rgba(8, 162, 14, 0.15);
            color: var(--manticore);
            border-color: rgba(8, 162, 14, 0.4);
            box-shadow: 0 0 15px rgba(8, 162, 14, 0.2);
        }

        .faction-names {
            display: flex;
            flex-direction: column;
        }

        .faction-names h2 {
            font-family: 'Rajdhani', sans-serif;
            font-size: 24px;
            font-weight: 800;
            letter-spacing: 1px;
            margin: 0;
            text-transform: uppercase;
            color: #ffffff;
        }

        .kpi-card.lonestar .faction-names h2 { color: var(--lonestar); text-shadow: 0 0 12px rgba(100, 196, 244, 0.4); }
        .kpi-card.valkyra .faction-names h2 { color: var(--valkyra); text-shadow: 0 0 12px rgba(199, 61, 61, 0.4); }
        .kpi-card.manticore .faction-names h2 { color: var(--manticore); text-shadow: 0 0 12px rgba(8, 162, 14, 0.4); }

        .faction-names span {
            font-size: 11px;
            color: #79869a;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .faction-rank-badge {
            font-family: 'Rajdhani', sans-serif;
            font-size: 11px;
            font-weight: 800;
            padding: 4px 10px;
            border-radius: 0;
            letter-spacing: 1px;
            text-transform: uppercase;
            border: 1px solid rgba(255, 255, 255, 0.1);
            background: rgba(0, 0, 0, 0.4);
        }

        .kpi-card.lonestar .faction-rank-badge { color: var(--lonestar); border-color: rgba(100, 196, 244, 0.3); }
        .kpi-card.valkyra .faction-rank-badge { color: var(--valkyra); border-color: rgba(199, 61, 61, 0.3); }
        .kpi-card.manticore .faction-rank-badge { color: var(--manticore); border-color: rgba(8, 162, 14, 0.3); }

        /* Positive Profit Rate Hero Block */
        .kpi-wr-block {
            background: rgba(10, 14, 22, 0.6);
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 0;
            padding: 18px 16px;
            margin-bottom: 20px;
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }

        .wr-top-meta {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            margin-bottom: 10px;
        }

        .wr-label {
            font-family: 'Rajdhani', sans-serif;
            font-size: 13px;
            font-weight: 700;
            letter-spacing: 1px;
            color: #8c9ba5;
            text-transform: uppercase;
        }

        .wr-percentage {
            font-family: 'JetBrains Mono', monospace;
            font-size: 32px;
            font-weight: 800;
            line-height: 1;
            transition: color 0.3s ease;
        }

        .wr-bar-container {
            width: 100%;
            height: 8px;
            background: rgba(255, 255, 255, 0.08);
            border-radius: 0;
            overflow: hidden;
            margin-bottom: 8px;
            position: relative;
        }

        .wr-bar-fill {
            height: 100%;
            border-radius: 0;
            transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .kpi-card.lonestar .wr-bar-fill { background: linear-gradient(90deg, rgba(100, 196, 244, 0.6), #64c4f4); box-shadow: 0 0 10px rgba(100, 196, 244, 0.5); }
        .kpi-card.valkyra .wr-bar-fill { background: linear-gradient(90deg, rgba(199, 61, 61, 0.6), #c73d3d); box-shadow: 0 0 10px rgba(199, 61, 61, 0.5); }
        .kpi-card.manticore .wr-bar-fill { background: linear-gradient(90deg, rgba(8, 162, 14, 0.6), #08a20e); box-shadow: 0 0 10px rgba(8, 162, 14, 0.5); }

        .wr-sub-detail {
            font-size: 11px;
            color: #79869a;
            font-weight: 600;
        }

        /* 2-Stat Financial Blocks in one row (50% each) */
        .kpi-stat-rows {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
        }

        .kpi-stat-row {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            gap: 8px;
            padding: 10px 12px;
            background: rgba(14, 18, 28, 0.5);
            border-radius: 0;
            border: 1px solid rgba(255, 255, 255, 0.05);
            min-width: 0;
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
        }

        .kpi-stat-header {
            display: flex;
            flex-direction: column;
            gap: 3px;
        }

        .kpi-stat-label {
            color: #8c9ba5;
            font-family: 'Rajdhani', sans-serif;
            font-weight: 700;
            font-size: 11px;
            letter-spacing: 0.5px;
            text-transform: uppercase;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .kpi-stat-value {
            font-family: 'JetBrains Mono', monospace;
            font-weight: 700;
            font-size: 14px;
            color: #ffffff;
            white-space: nowrap;
        }

        .kpi-row-bar-container {
            width: 100%;
            height: 5px;
            background: rgba(255, 255, 255, 0.08);
            border-radius: 0;
            overflow: hidden;
            position: relative;
        }

        .kpi-row-bar-fill {
            height: 100%;
            border-radius: 0;
            transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .val-profit-pos { color: #38ef7d; }
        .val-profit-neg { color: #ff5252; }

        /* Macro Analytics 3-Columns Grid */
        .macro-row-three {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 18px;
            margin-bottom: 22px;
        }

        .chart-glass-panel {
            background: rgba(18, 22, 34, 0.7);
            border: 1px solid var(--panel-border);
            border-radius: 0;
            padding: 20px;
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
            position: relative;
        }

        .panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 16px;
        }

        .panel-title {
            font-family: 'Rajdhani', sans-serif;
            font-size: 18px;
            font-weight: 800;
            letter-spacing: 1px;
            color: #ffffff;
            text-transform: uppercase;
            margin: 0;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .panel-title::before {
            content: '//';
            color: var(--gold);
            font-weight: 800;
        }

        .panel-badge {
            font-family: 'Rajdhani', sans-serif;
            font-size: 12px;
            font-weight: 700;
            color: #8c9ba5;
            background: rgba(255, 255, 255, 0.05);
            padding: 3px 8px;
            border-radius: 0;
            border: 1px solid rgba(255, 255, 255, 0.08);
        }

        /* Timeline Card */
        .timeline-card {
            margin-bottom: 24px;
        }

        .timeline-controls {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .metric-toggle-btn {
            font-family: 'Rajdhani', sans-serif;
            font-size: 13px;
            font-weight: 700;
            color: #8c9ba5;
            background: rgba(18, 24, 36, 0.85);
            border: 1px solid rgba(255, 255, 255, 0.12);
            border-radius: 4px;
            padding: 6px 14px;
            cursor: pointer;
            transition: all 0.2s ease;
            outline: none;
        }

        .metric-toggle-btn:hover {
            color: #fff;
            background: rgba(255, 255, 255, 0.08);
            border-color: rgba(255, 255, 255, 0.25);
        }

        .metric-toggle-btn.active {
            color: #0b0e14;
            background: var(--gold);
            font-weight: 800;
            border-color: var(--gold);
            border-radius: 4px;
            box-shadow: 0 0 12px rgba(255, 179, 0, 0.4);
        }

        /* Faction Leaderboards Grid */
        .lb-section-container {
            margin-bottom: 20px;
        }
        .lb-section-container:last-child {
            margin-bottom: 5px;
        }

        .lb-section-title-wrap {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
        }

        .faction-lb-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 18px;
        }

        .lb-column-card {
            background: rgba(18, 22, 34, 0.7);
            border: 1px solid var(--panel-border);
            border-radius: 0;
            padding: 16px 14px;
            backdrop-filter: blur(14px);
            -webkit-backdrop-filter: blur(14px);
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
            position: relative;
        }

        .lb-column-card.lonestar {
            border-top: 3px solid var(--lonestar);
        }

        .lb-column-card.valkyra {
            border-top: 3px solid var(--valkyra);
        }

        .lb-column-card.manticore {
            border-top: 3px solid var(--manticore);
        }

        .lb-column-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        }

        .lb-faction-title {
            display: flex;
            align-items: center;
            gap: 8px;
            font-family: 'Rajdhani', sans-serif;
            font-size: 16px;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .lb-column-badge {
            font-family: 'Rajdhani', sans-serif;
            font-size: 11px;
            font-weight: 800;
            color: #8c9ba5;
            background: rgba(255, 255, 255, 0.05);
            padding: 2px 7px;
            border-radius: 0;
            border: 1px solid rgba(255, 255, 255, 0.08);
        }

        .lb-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 12px;
        }

        .lb-table th {
            font-family: 'Rajdhani', sans-serif;
            font-size: 11px;
            font-weight: 800;
            letter-spacing: 0.8px;
            text-transform: uppercase;
            color: #79869a;
            padding: 6px 8px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        }

        .lb-table td {
            padding: 7px 8px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.03);
            font-family: 'JetBrains Mono', monospace;
            font-size: 12px;
            vertical-align: middle;
        }

        .lb-table tr:hover td {
            background: rgba(255, 255, 255, 0.03);
        }

        .lb-rank {
            font-family: 'Rajdhani', sans-serif;
            font-weight: 800;
            font-size: 13px;
            color: #79869a;
        }

        .lb-rank.rank-1 { color: #ffb300; }
        .lb-rank.rank-2 { color: #d1d7e0; }
        .lb-rank.rank-3 { color: #cd7f32; }

        .lb-player-link {
            display: flex;
            align-items: center;
            gap: 8px;
            text-decoration: none;
            color: #e1e7f0;
            transition: color 0.15s ease;
            overflow: hidden;
        }

        .lb-player-link:hover {
            color: var(--gold);
        }

        .lb-avatar {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            border: 1px solid rgba(255, 255, 255, 0.15);
            flex-shrink: 0;
            object-fit: cover;
        }

        .lb-player-name {
            font-family: 'Rajdhani', sans-serif;
            font-size: 13px;
            font-weight: 700;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: 130px;
        }

        .table-faction-pill {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            box-shadow: 0 0 8px currentColor;
        }

        /* Responsive */
        @media (max-width: 1100px) {
            .factions-kpi-grid {
                grid-template-columns: 1fr;
            }
            .macro-row-three {
                grid-template-columns: 1fr;
            }
            .faction-lb-grid {
                grid-template-columns: 1fr;
            }
        }

        @media (max-width: 768px) {
            .hero-title {
                font-size: 28px;
            }
            .time-pill-group {
                width: 100%;
                justify-content: space-between;
            }
            .time-pill {
                padding: 6px 10px;
                font-size: 11px;
            }
            .panel-header {
                flex-direction: column;
                align-items: flex-start;
                gap: 10px;
            }
            .timeline-controls {
                width: 100%;
                overflow-x: auto;
                padding-bottom: 5px;
            }
        }
