@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@500;700&display=swap');

:root {
    --bg-deep: #03040b;
    --bg-card: rgba(10, 10, 30, 0.75);
    --bg-card-hover: rgba(18, 18, 50, 0.85);
    --bg-header: rgba(14, 14, 40, 0.9);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-glow: rgba(255, 255, 255, 0.12);
    --text: #e4e6f0;
    --text-dim: #7a7d9e;
    --text-bright: #ffffff;
    --gold: #f0c85b;
    --gold-bright: #ffe083;
    --gold-glow: rgba(240, 200, 91, 0.35);
    --cyan: #00d4ff;
    --cyan-glow: rgba(0, 212, 255, 0.3);
    --purple: #a855f7;
    --purple-glow: rgba(168, 85, 247, 0.25);
    --red: #ef4444;
    --green: #22c55e;
    --accent1: #f0c85b;
    --accent2: #00d4ff;
    --accent3: #a855f7;
    --accent4: #f472b6;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --font: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font);
    background: var(--bg-deep);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* ============ ANIMATED BACKGROUND ============ */

.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.bg-layer::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 50% at 20% 20%, rgba(168, 85, 247, 0.07) 0%, transparent 55%),
        radial-gradient(ellipse 70% 45% at 80% 75%, rgba(0, 212, 255, 0.05) 0%, transparent 55%),
        radial-gradient(ellipse 60% 35% at 50% 45%, rgba(240, 200, 91, 0.03) 0%, transparent 50%);
    animation: bgPulse 8s ease-in-out infinite alternate;
}

.bg-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 40%, black 20%, transparent 70%);
}

@keyframes bgPulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

/* ============ CONTAINER ============ */

.container {
    position: relative;
    z-index: 1;
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

/* ============ HERO ============ */

.hero-section {
    position: relative;
    margin-bottom: 28px;
    padding: 36px 32px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-align: center;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(240, 200, 91, 0.4), rgba(168, 85, 247, 0.3), rgba(0, 212, 255, 0.3), rgba(240, 200, 91, 0.2));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.hero-glow {
    position: absolute;
    width: 300px;
    height: 300px;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(240, 200, 91, 0.12) 0%, transparent 70%);
    pointer-events: none;
    animation: heroGlow 4s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0% { transform: translateX(-50%) scale(1); opacity: 0.7; }
    100% { transform: translateX(-50%) scale(1.2); opacity: 1; }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    background: rgba(240, 200, 91, 0.12);
    border: 1px solid rgba(240, 200, 91, 0.25);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 16px;
}

.pulse-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold-bright);
    box-shadow: 0 0 8px var(--gold-glow), 0 0 16px var(--gold-glow);
    animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

.hero-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.title-line1 {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 6px;
    color: var(--text-dim);
    text-transform: uppercase;
}

.title-line2 {
    font-size: 52px;
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, #ffffff 0%, #f0c85b 40%, #ffe083 70%, #f0c85b 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
    filter: drop-shadow(0 0 20px rgba(240, 200, 91, 0.3));
    animation: titleShine 4s linear infinite;
}

@keyframes titleShine {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.hero-meta {
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}

.meta-sep {
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.15);
}

/* ============ LEADERBOARD ============ */

.leaderboard {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.lb-header {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-dim);
}

.lb-row {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border-subtle);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
    transform: translateY(12px);
}

.lb-row:nth-child(2) { animation-delay: 0.05s; }
.lb-row:nth-child(3) { animation-delay: 0.1s; }
.lb-row:nth-child(4) { animation-delay: 0.15s; }
.lb-row:nth-child(5) { animation-delay: 0.2s; }
.lb-row:nth-child(6) { animation-delay: 0.25s; }
.lb-row:nth-child(7) { animation-delay: 0.3s; }
.lb-row:nth-child(8) { animation-delay: 0.35s; }
.lb-row:nth-child(9) { animation-delay: 0.4s; }
.lb-row:nth-child(10) { animation-delay: 0.45s; }
.lb-row:nth-child(11) { animation-delay: 0.5s; }
.lb-row:nth-child(12) { animation-delay: 0.55s; }
.lb-row:nth-child(13) { animation-delay: 0.6s; }
.lb-row:nth-child(14) { animation-delay: 0.65s; }
.lb-row:nth-child(15) { animation-delay: 0.7s; }
.lb-row:nth-child(16) { animation-delay: 0.75s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lb-row:last-child {
    border-bottom: none;
}

.lb-row:hover {
    background: var(--bg-card-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
    z-index: 2;
}

.lb-row:hover .avatar {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 16px rgba(240, 200, 91, 0.15);
}

.lb-row:hover .rank-img {
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
    transform: scale(1.08);
}

.lb-row:hover .progress-fill.xp-fill {
    filter: brightness(1.2);
}

.lb-row:hover .progress-fill.hs-fill {
    filter: brightness(1.2);
}

/* ============ COLUMNS ============ */

.lb-col {
    padding: 0 10px;
}

.lb-col-pos {
    width: 60px;
    flex-shrink: 0;
    text-align: center;
}

.lb-col-player {
    flex: 1;
    min-width: 0;
}

.lb-col-xp {
    width: 150px;
    flex-shrink: 0;
}

.lb-col-frags,
.lb-col-deaths {
    width: 80px;
    flex-shrink: 0;
    text-align: center;
}

.lb-col-hs {
    width: 110px;
    flex-shrink: 0;
    text-align: center;
}

.lb-col-rank {
    width: 100px;
    flex-shrink: 0;
    text-align: center;
}

/* ============ POSITION BADGE ============ */

.pos-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.05);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    transition: all 0.3s ease;
}

.pos-1 {
    background: linear-gradient(135deg, #f0c85b, #ffe083);
    color: #1a1200;
    border-color: transparent;
    box-shadow: 0 0 16px var(--gold-glow), 0 0 32px rgba(240, 200, 91, 0.15);
    width: 36px;
    height: 36px;
    font-size: 16px;
}

.pos-2 {
    background: linear-gradient(135deg, #b0b8c8, #d4dce8);
    color: #1a1d24;
    border-color: transparent;
    box-shadow: 0 0 12px rgba(180, 190, 210, 0.25);
    width: 34px;
    height: 34px;
}

.pos-3 {
    background: linear-gradient(135deg, #c4895a, #e0a878);
    color: #1a0e04;
    border-color: transparent;
    box-shadow: 0 0 10px rgba(200, 140, 90, 0.25);
    width: 34px;
    height: 34px;
}

/* ============ PLAYER INFO ============ */

.player-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.flag {
    width: 24px;
    height: 16px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    object-fit: cover;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    object-fit: cover;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.03);
}

.player-details {
    min-width: 0;
    overflow: hidden;
}

.pname {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    transition: color 0.3s ease;
}

.pid {
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-top: 1px;
}

/* ============ XP COLUMN ============ */

.xp-value {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--cyan);
    margin-bottom: 5px;
    text-shadow: 0 0 10px var(--cyan-glow);
}

/* ============ STATS ============ */

.lb-col-frags,
.lb-col-deaths {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
}

.lb-col-frags {
    color: var(--text-bright);
}

.lb-col-deaths {
    color: var(--text-dim);
}

/* ============ HS% COLUMN ============ */

.hs-value {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 4px;
}

/* ============ PROGRESS BARS ============ */

.progress-bar {
    height: 5px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
    overflow: hidden;
    width: 100%;
    position: relative;
}

.progress-bar-sm {
    height: 4px;
    width: 72px;
    margin: 0 auto;
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
    width: var(--w);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.2) 45%, rgba(255, 255, 255, 0.35) 50%, rgba(255, 255, 255, 0.2) 55%, transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.xp-fill {
    background: linear-gradient(90deg, #00b8e6, #00d4ff, #5ee4ff);
    box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

.hs-fill {
    background: linear-gradient(90deg, #d4a030, #f0c85b, #ffe083);
    box-shadow: 0 0 8px rgba(240, 200, 91, 0.3);
}

/* ============ RANK IMAGE ============ */

.rank-img {
    height: 38px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 6px rgba(255, 255, 255, 0.05));
    transition: all 0.3s ease;
}

/* ============ LEADER ROW (#1) ============ */

.lb-row-leader {
    background: linear-gradient(180deg, rgba(240, 200, 91, 0.08) 0%, rgba(240, 200, 91, 0.02) 100%);
    border-bottom: 1px solid rgba(240, 200, 91, 0.2);
}

.lb-row-leader::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(240, 200, 91, 0.3), transparent);
}

.lb-row-leader:hover {
    background: linear-gradient(180deg, rgba(240, 200, 91, 0.12) 0%, rgba(240, 200, 91, 0.04) 100%);
    box-shadow: 0 4px 32px rgba(240, 200, 91, 0.1), 0 0 80px rgba(240, 200, 91, 0.04);
}

.lb-row-leader .pname {
    color: var(--gold-bright);
}

.lb-row-leader .avatar {
    border-color: rgba(240, 200, 91, 0.4);
    box-shadow: 0 0 12px rgba(240, 200, 91, 0.15);
}

/* ============ PAGINATION ============ */

.pagination-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding: 16px 20px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.pagination {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text-dim);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: all 0.25s ease;
    cursor: pointer;
}

.page-btn:hover {
    color: var(--text-bright);
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-btn.active {
    color: #1a1200;
    background: linear-gradient(135deg, #f0c85b, #ffe083);
    border-color: transparent;
    font-weight: 700;
    box-shadow: 0 0 12px var(--gold-glow);
    pointer-events: none;
}

.credit {
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}

/* ============ EMPTY STATE ============ */

.empty-state {
    padding: 48px 24px;
    text-align: center;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.empty-state-sub {
    font-size: 12px;
    color: var(--text-dim);
    opacity: 0.6;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 860px) {
    .container {
        padding: 12px 8px 24px;
    }

    .hero-section {
        padding: 24px 16px;
        margin-bottom: 16px;
    }

    .title-line2 {
        font-size: 32px;
    }

    .title-line1 {
        font-size: 10px;
        letter-spacing: 4px;
    }

    .lb-header {
        display: none;
    }

    .lb-row {
        flex-wrap: wrap;
        padding: 14px 12px;
        gap: 8px;
    }

    .lb-col-pos {
        width: auto;
    }

    .lb-col-player {
        flex: 1 1 calc(100% - 60px);
        order: 1;
    }

    .lb-col-xp {
        width: 100%;
        order: 3;
        padding: 0 12px;
        margin-top: 4px;
    }

    .lb-col-frags {
        width: auto;
        order: 4;
    }

    .lb-col-deaths {
        width: auto;
        order: 5;
    }

    .lb-col-hs {
        width: auto;
        order: 6;
    }

    .lb-col-rank {
        width: auto;
        order: 2;
        margin-left: auto;
    }

    .xp-value {
        font-size: 11px;
    }

    .lb-col-frags,
    .lb-col-deaths {
        font-size: 12px;
    }

    .rank-img {
        height: 28px;
    }

    .avatar {
        width: 30px;
        height: 30px;
    }

    .pname {
        font-size: 12px;
    }

    .pid {
        font-size: 9px;
    }

    .pagination-wrap {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .page-btn {
        min-width: 30px;
        height: 30px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .title-line2 {
        font-size: 26px;
    }

    .title-line1 {
        font-size: 9px;
        letter-spacing: 3px;
    }

    .hero-badge {
        font-size: 9px;
        letter-spacing: 2px;
        padding: 4px 10px;
    }

    .lb-row {
        padding: 10px 8px;
        gap: 6px;
    }

    .lb-col {
        padding: 0 4px;
    }

    .progress-bar-sm {
        width: 52px;
    }

    .rank-img {
        height: 24px;
    }

    .avatar {
        width: 28px;
        height: 28px;
    }
}
