/* ============================================
                   CSS RESET & BASE
                ============================================ */
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            min-height: 100vh;
            font-family: 'Be Vietnam Pro', sans-serif;
            background: #0a0a0a;
            padding: 20px;
            position: relative;
            overflow-x: hidden;
        }

        /* ============================================
                   ANIMATED BACKGROUND
                ============================================ */
        .bg-container {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            z-index: 0;
            overflow: hidden;
        }

        .bg-overlay {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: 
                radial-gradient(ellipse at 20% 50%, rgba(200, 0, 0, 0.12) 0%, transparent 60%),
                radial-gradient(ellipse at 80% 50%, rgba(200, 0, 0, 0.08) 0%, transparent 60%),
                radial-gradient(ellipse at 50% 100%, rgba(100, 0, 0, 0.15) 0%, transparent 50%),
                linear-gradient(180deg, #0a0a0a 0%, transparent 30%, transparent 70%, #0a0a0a 100%);
        }

        /* Particles */
        .particles {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
            z-index: 1;
        }

        .particle {
            position: absolute;
            width: 2px;
            height: 2px;
            background: rgba(255, 50, 50, 0.4);
            border-radius: 50%;
            animation: float-particle linear infinite;
        }

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

        /* Glow Lines */
        .glow-line {
            position: fixed;
            height: 2px;
            background: linear-gradient(90deg, transparent, rgba(255, 0, 0, 0.15), rgba(255, 0, 0, 0.3), rgba(255, 0, 0, 0.15), transparent);
            z-index: 1;
            animation: glow-line-move 8s ease-in-out infinite;
            pointer-events: none;
        }

        .glow-line:nth-child(1) { top: 15%; left: -100%; width: 200%; animation-delay: 0s; }
        .glow-line:nth-child(2) { top: 50%; left: -100%; width: 150%; animation-delay: 3s; opacity: 0.4; }
        .glow-line:nth-child(3) { top: 80%; left: -100%; width: 180%; animation-delay: 6s; opacity: 0.3; }

        @keyframes glow-line-move {
            0% { transform: translateX(-50%); opacity: 0; }
            10% { opacity: 1; }
            90% { opacity: 1; }
            100% { transform: translateX(50%); opacity: 0; }
        }

        /* ============================================
                   MAIN CONTAINER
                ============================================ */
        .container {
            position: relative;
            z-index: 10;
            max-width: 1200px;
            margin: 0 auto;
        }

        /* ============================================
                   GLASS CARD
                ============================================ */
        .glass-card {
            background: rgba(10, 10, 10, 0.80);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            border-radius: 20px;
            border: 1px solid rgba(255, 0, 0, 0.08);
            box-shadow: 
                0 0 60px rgba(255, 0, 0, 0.04),
                inset 0 1px 0 rgba(255, 255, 255, 0.04);
            padding: 30px 35px;
            transition: all 0.4s ease;
            margin-bottom: 24px;
        }

        .glass-card:hover {
            border-color: rgba(255, 0, 0, 0.15);
            box-shadow: 
                0 0 80px rgba(255, 0, 0, 0.06),
                inset 0 1px 0 rgba(255, 255, 255, 0.06);
        }

        /* ============================================
                   HEADER CARD
                ============================================ */
        .header-card {
            text-align: center;
            padding: 40px 35px 30px;
        }

        .header-card .logo-icon {
            font-size: 48px;
            color: #ff0000;
            display: block;
            margin-bottom: 10px;
            text-shadow: 0 0 60px rgba(255, 0, 0, 0.3);
            animation: pulse-icon 3s ease-in-out infinite;
        }

        @keyframes pulse-icon {
            0%, 100% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.05); opacity: 0.8; }
        }

        .header-card h1 {
            font-family: 'Be Vietnam Pro', sans-serif;
            font-weight: 900;
            font-size: 34px;
            letter-spacing: 6px;
            text-transform: uppercase;
            background: linear-gradient(135deg, #ff0000, #ff4444, #ff0000);
            background-size: 200% 200%;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            animation: gradient-shift 4s ease-in-out infinite;
            margin-bottom: 6px;
        }

        @keyframes gradient-shift {
            0%, 100% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
        }

        .header-card .subtitle {
            font-size: 16px;
            color: rgba(255, 255, 255, 0.35);
            font-weight: 300;
            letter-spacing: 3px;
        }

        .header-card .divider {
            width: 80px;
            height: 2px;
            margin: 14px auto 18px;
            background: linear-gradient(90deg, transparent, rgba(255, 0, 0, 0.3), transparent);
        }

        .btn-back {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 10px 24px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 10px;
            color: rgba(255, 255, 255, 0.5);
            text-decoration: none;
            font-size: 14px;
            font-weight: 600;
            letter-spacing: 1px;
            transition: all 0.3s ease;
        }

        .btn-back:hover {
            color: #ffffff;
            background: rgba(255, 0, 0, 0.08);
            border-color: rgba(255, 0, 0, 0.15);
            transform: translateX(-4px);
        }

        .btn-back i { font-size: 14px; }

        /* ============================================
                   MODE SELECTOR
                ============================================ */
        .mode-selector {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 10px;
        }

        .mode-btn {
            padding: 10px 20px;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.06);
            border-radius: 10px;
            color: rgba(255, 255, 255, 0.4);
            font-family: 'Be Vietnam Pro', sans-serif;
            font-size: 13px;
            font-weight: 600;
            letter-spacing: 1px;
            text-transform: uppercase;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .mode-btn:hover {
            background: rgba(255, 0, 0, 0.06);
            border-color: rgba(255, 0, 0, 0.10);
            color: rgba(255, 255, 255, 0.7);
        }

        .mode-btn.active {
            background: rgba(255, 0, 0, 0.10);
            border-color: rgba(255, 0, 0, 0.20);
            color: #ff4444;
            box-shadow: 0 0 30px rgba(255, 0, 0, 0.05);
        }

        .mode-btn .mode-icon {
            margin-right: 6px;
        }

        /* ============================================
                   STATS GRID
                ============================================ */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 16px;
        }

        .stat-box {
            text-align: center;
            padding: 18px 16px;
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid rgba(255, 255, 255, 0.04);
            border-radius: 12px;
            transition: all 0.3s ease;
        }

        .stat-box:hover {
            border-color: rgba(255, 0, 0, 0.08);
            background: rgba(255, 255, 255, 0.03);
        }

        .stat-box .stat-icon {
            font-size: 22px;
            color: #ff0000;
            display: block;
            margin-bottom: 4px;
        }

        .stat-box .stat-number {
            font-family: 'Be Vietnam Pro', sans-serif;
            font-size: 24px;
            font-weight: 900;
            color: #ffffff;
            display: block;
        }

        .stat-box .stat-label {
            font-size: 11px;
            color: rgba(255, 255, 255, 0.25);
            text-transform: uppercase;
            letter-spacing: 2px;
            margin-top: 2px;
        }

        /* ============================================
                   TABLE
                ============================================ */
        .table-wrapper {
            overflow-x: auto;
            margin-top: 4px;
        }

        .leaderboard-table {
            width: 100%;
            border-collapse: collapse;
            font-size: 14px;
        }

        .leaderboard-table thead th {
            padding: 12px 14px;
            text-align: left;
            font-size: 11px;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            color: rgba(255, 255, 255, 0.2);
            border-bottom: 1px solid rgba(255, 255, 255, 0.04);
            background: transparent;
            position: sticky;
            top: 0;
            z-index: 5;
        }

        .leaderboard-table tbody td {
            padding: 12px 14px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.03);
            color: rgba(255, 255, 255, 0.5);
            transition: all 0.2s ease;
        }

        .leaderboard-table tbody tr {
            transition: all 0.3s ease;
        }

        .leaderboard-table tbody tr:hover td {
            background: rgba(255, 0, 0, 0.04);
            color: rgba(255, 255, 255, 0.7);
        }

        .leaderboard-table tbody tr:nth-child(even) td {
            background: rgba(255, 255, 255, 0.01);
        }

        .leaderboard-table tbody tr:nth-child(even):hover td {
            background: rgba(255, 0, 0, 0.04);
        }

        /* Rank column */
        .rank-cell {
            font-family: 'Be Vietnam Pro', sans-serif;
            font-weight: 900;
            font-size: 14px;
            color: rgba(255, 255, 255, 0.15) !important;
        }

        .rank-cell.top1 { color: #ffd700 !important; }
        .rank-cell.top2 { color: #c0c0c0 !important; }
        .rank-cell.top3 { color: #cd7f32 !important; }

        .rank-cell .rank-badge {
            display: inline-block;
            width: 28px;
            height: 28px;
            line-height: 28px;
            text-align: center;
            border-radius: 50%;
            font-size: 12px;
            font-weight: 700;
        }

        .rank-cell .rank-badge.gold {
            background: rgba(255, 215, 0, 0.15);
            color: #ffd700;
        }
        .rank-cell .rank-badge.silver {
            background: rgba(192, 192, 192, 0.15);
            color: #c0c0c0;
        }
        .rank-cell .rank-badge.bronze {
            background: rgba(205, 127, 50, 0.15);
            color: #cd7f32;
        }
        .rank-cell .rank-badge.normal {
            background: rgba(255, 255, 255, 0.04);
            color: rgba(255, 255, 255, 0.15);
        }

        /* Username column */
        .username-cell {
            font-weight: 600;
            color: rgba(255, 255, 255, 0.7) !important;
        }

        .username-cell .medal-icon {
            display: inline-block;
            width: 24px;
            height: 24px;
            line-height: 24px;
            text-align: center;
            border-radius: 50%;
            font-size: 10px;
            font-weight: 700;
            margin-right: 6px;
        }

        .username-cell .medal-icon.gold {
            background: rgba(255, 215, 0, 0.15);
            color: #ffd700;
        }
        .username-cell .medal-icon.silver {
            background: rgba(192, 192, 192, 0.15);
            color: #c0c0c0;
        }
        .username-cell .medal-icon.bronze {
            background: rgba(205, 127, 50, 0.15);
            color: #cd7f32;
        }
        .username-cell .medal-icon.normal {
            background: rgba(255, 255, 255, 0.04);
            color: rgba(255, 255, 255, 0.2);
        }

        /* Score column */
        .score-cell {
            font-family: 'Be Vietnam Pro', sans-serif;
            font-weight: 700;
            color: rgba(255, 255, 255, 0.5) !important;
            font-size: 13px;
        }

        /* Stats columns */
        .stat-cell {
            font-size: 13px;
            font-weight: 500;
        }

        .stat-cell .stat-highlight {
            color: rgba(255, 255, 255, 0.3);
            font-size: 11px;
            font-weight: 300;
        }

        .stat-cell .kd-ratio {
            color: #4ade80;
        }

        .stat-cell .win-streak {
            color: #fbbf24;
        }

        /* ============================================
                   PAGINATION
                ============================================ */
        .pagination {
            display: flex;
            justify-content: center;
            gap: 6px;
            flex-wrap: wrap;
            margin-top: 4px;
        }

        .pagination a {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 36px;
            height: 36px;
            padding: 0 12px;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.04);
            border-radius: 8px;
            color: rgba(255, 255, 255, 0.3);
            text-decoration: none;
            font-size: 13px;
            font-weight: 600;
            transition: all 0.3s ease;
        }

        .pagination a:hover:not(.active):not(.disabled) {
            background: rgba(255, 255, 255, 0.06);
            color: rgba(255, 255, 255, 0.6);
            border-color: rgba(255, 255, 255, 0.08);
        }

        .pagination a.active {
            background: rgba(255, 0, 0, 0.12);
            border-color: rgba(255, 0, 0, 0.20);
            color: #ff4444;
            box-shadow: 0 0 30px rgba(255, 0, 0, 0.05);
        }

        .pagination a.disabled {
            opacity: 0.2;
            pointer-events: none;
        }

        .pagination .page-info {
            display: flex;
            align-items: center;
            padding: 0 12px;
            font-size: 12px;
            color: rgba(255, 255, 255, 0.15);
        }

        /* ============================================
                   FOOTER
                ============================================ */
        .footer-card {
            text-align: center;
            padding: 22px 35px;
        }

        .footer-card p {
            color: rgba(255, 255, 255, 0.12);
            font-size: 13px;
            font-weight: 300;
            letter-spacing: 0.5px;
        }

        .footer-card p:last-child {
            font-size: 11px;
            color: rgba(255, 255, 255, 0.06);
            margin-top: 4px;
        }

        /* ============================================
                   RESPONSIVE
                ============================================ */
        @media (max-width: 992px) {
            .glass-card { padding: 24px 20px; }
            .header-card { padding: 30px 20px; }
        }

        @media (max-width: 768px) {
            .header-card h1 { font-size: 26px; letter-spacing: 3px; }
            .header-card .logo-icon { font-size: 38px; }
            .header-card .subtitle { font-size: 14px; }
            .stats-grid { grid-template-columns: repeat(2, 1fr); }
            .mode-selector { gap: 8px; }
            .mode-btn { font-size: 11px; padding: 8px 14px; }
            .leaderboard-table { font-size: 12px; }
            .leaderboard-table thead th { font-size: 9px; letter-spacing: 1px; padding: 8px 10px; }
            .leaderboard-table tbody td { padding: 8px 10px; }
            .rank-cell { font-size: 12px; }
            .score-cell { font-size: 12px; }
            .pagination a { min-width: 32px; height: 32px; font-size: 12px; padding: 0 10px; }
            .header-card .btn-back { font-size: 12px; padding: 8px 16px; }
        }

        @media (max-width: 480px) {
            .glass-card { padding: 16px 12px; border-radius: 14px; }
            .header-card h1 { font-size: 20px; letter-spacing: 2px; }
            .header-card .logo-icon { font-size: 30px; }
            .header-card { padding: 20px 12px; }
            .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
            .stat-box { padding: 12px 10px; }
            .stat-box .stat-number { font-size: 18px; }
            .stat-box .stat-icon { font-size: 18px; }
            .mode-btn { font-size: 10px; padding: 6px 10px; }
            .leaderboard-table { font-size: 11px; }
            .leaderboard-table thead th { font-size: 8px; letter-spacing: 0.5px; padding: 6px 6px; }
            .leaderboard-table tbody td { padding: 6px 6px; }
            .rank-cell { font-size: 11px; }
            .rank-cell .rank-badge { width: 22px; height: 22px; line-height: 22px; font-size: 10px; }
            .score-cell { font-size: 11px; }
            .stat-cell { font-size: 11px; }
            .pagination a { min-width: 28px; height: 28px; font-size: 11px; padding: 0 8px; }
            .pagination .page-info { font-size: 10px; padding: 0 8px; }
        }

        /* ============================================
                   SCROLLBAR
                ============================================ */
        ::-webkit-scrollbar { width: 6px; height: 6px; }
        ::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.3); }
        ::-webkit-scrollbar-thumb { background: rgba(255, 0, 0, 0.3); border-radius: 3px; }
        ::-webkit-scrollbar-thumb:hover { background: rgba(255, 0, 0, 0.5); }

        /* ============================================
                   EMPTY STATE
                ============================================ */
        .empty-state {
            text-align: center;
            padding: 40px 20px;
        }

        .empty-state .empty-icon {
            font-size: 48px;
            color: rgba(255, 255, 255, 0.04);
            margin-bottom: 12px;
        }

        .empty-state p {
            color: rgba(255, 255, 255, 0.15);
            font-size: 15px;
        }


/* CSS formerly attached to markup, moved out of PHP. */
.cf-leaderboard-style-a755a335 {display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; flex-wrap: wrap; gap: 8px;}
.cf-leaderboard-style-3499bf7d {font-family: 'Be Vietnam Pro', sans-serif; font-size: 16px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,0.3);}
.cf-leaderboard-style-a95a6ea6 {color: #ff0000; margin-right: 8px;}
.cf-leaderboard-style-4a2f79c9 {font-size: 11px; color: rgba(255,255,255,0.1);}
.cf-leaderboard-style-13cbe03b {text-align: right;}
.cf-leaderboard-style-72a68ac3 {text-align: center;}
.cf-leaderboard-style-72a68ac3 {text-align: center;}
.cf-leaderboard-style-72a68ac3 {text-align: center;}
.cf-leaderboard-style-72a68ac3 {text-align: center;}
.cf-leaderboard-style-72a68ac3 {text-align: center;}
.cf-leaderboard-style-72a68ac3 {text-align: center;}
.cf-leaderboard-style-13cbe03b {text-align: right;}
.cf-leaderboard-style-72a68ac3 {text-align: center;}
.cf-leaderboard-style-998cbdb1 {font-size: 11px; color: rgba(255,255,255,0.08);}
.cf-leaderboard-style-130bf05b {text-align: center; font-size: 12px;}
.cf-leaderboard-style-0eea1c2e {color: rgba(255,255,255,0.15); font-size: 10px;}
.cf-leaderboard-style-130bf05b {text-align: center; font-size: 12px;}
.cf-leaderboard-style-1c252f2f {color: rgba(255,255,255,0.10); font-size: 10px;}
.cf-leaderboard-style-130bf05b {text-align: center; font-size: 12px;}
.cf-leaderboard-style-9d2df933 {text-align: center; font-size: 12px; color: rgba(255,255,255,0.3);}
.cf-leaderboard-style-130bf05b {text-align: center; font-size: 12px;}
.cf-leaderboard-style-1c252f2f {color: rgba(255,255,255,0.10); font-size: 10px;}

.medal-badge { font-size: 11px; font-weight: 700; background: rgba(255,215,0,.08); padding: 2px 10px; border-radius: 50px; border: 1px solid rgba(255,215,0,.10); }
.medal-grade-1 { color: #ffd700; }
.medal-grade-2 { color: #c0c0c0; }
.medal-grade-3 { color: #cd7f32; }
.medal-grade-default { color: rgba(255,255,255,.2); }
