:root {
    --bg-dark: #121212;
    --bg-card: #1E1E1E;
    --bg-card-hover: #2C2C2C;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --text-main: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #333333;

    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;

    --card-radius: 8px;
    --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
}

.bg-glow {
    display: none;
    /* Removed glow */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Navigation */
.top-nav {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 1.25rem;
}

.nav-logo img {
    height: 32px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    font-size: 0.95rem;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
}

.nav-links i {
    margin-right: 0.5rem;
}

/* Header */
/* Header */
.header {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.header-title {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    line-height: 1;
}

/* Search Form */
.search-form {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.form-group {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 4px;
    transition: all 0.2s;
    flex: 1;
}

/* Specific widths relative to importance */
.search-form .form-group:nth-child(1) {
    flex: 2;
}

/* Server select */
.search-form .form-group:nth-child(2) {
    flex: 2;
}

/* Search input */
.search-form .form-group:nth-child(3) {
    flex: 1;
}

/* Sort select */

.form-group:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-form input,
.search-form select {
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 0.8rem 1rem 0.8rem 2.8rem;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    width: 100%;
    cursor: pointer;
}

.search-form input {
    cursor: text;
}

.search-form .form-group:first-child select {
    border-left: none;
}


.search-form select {
    cursor: pointer;
    color: var(--text-secondary);
}

.search-form select option {
    background: var(--bg-card);
}

/* Table */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    overflow-x: auto;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.leaderboard-table th {
    background: var(--bg-card-hover);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}

.leaderboard-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.leaderboard-table tr:last-child td {
    border-bottom: none;
}

.leaderboard-table tr:hover td {
    background: var(--bg-card-hover);
    color: var(--text-main);
}

.table-rank {
    font-weight: 600;
    color: var(--text-muted);
}

.table-name a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-name a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.rank-1 .table-rank {
    color: #fbbf24;
}

.rank-2 .table-rank {
    color: #94a3b8;
}

.rank-3 .table-rank {
    color: #b45309;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.page-link:hover,
.page-link.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Badges */
.rank-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-owner {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-admin {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-vip {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

/* Player Profile */
.profile-hero {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 2rem;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-main {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.avatar-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
}

.avatar-img,
.avatar-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-card);
}

.avatar-placeholder {
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--bg-card);
    background: var(--text-muted);
}

.online .status-indicator {
    background: var(--success);
}

.player-name {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-meta {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.meta-group {
    display: flex;
    gap: 0.75rem;
}

.meta-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Stat Cards */
.stats-grid-premium {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 1.5rem;
}

.box-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 1rem;
}

.box-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.25rem;
    line-height: 1.1;
}

.box-sub {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 4px;
    background: var(--bg-card-hover);
    border-radius: 2px;
    margin: 0.75rem 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
}

/* Weapon & Hitbox Stats */
.advanced-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 1.5rem;
}

.stat-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.weapon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.weapon-card {
    background: var(--bg-card-hover);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.75rem;
}

.weapon-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.weapon-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.w-value {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Hitbox */
.hitbox-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.hitbox-label {
    width: 70px;
    color: var(--text-secondary);
}

.hitbox-bar-container {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.hitbox-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--info), #60a5fa);
    border-radius: 4px;
    transition: width 0.5s ease-out;
}

.hitbox-value {
    width: 45px;
    text-align: right;
    font-weight: 600;
    color: var(--text-main);
}

/* Favorites */
.favorites-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.fav-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.fav-icon {
    width: 48px;
    height: 48px;
    background: var(--bg-card-hover);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.25rem;
}

.fav-info h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.fav-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}

.fav-stat {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Footer */
.footer {
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
    padding: 2rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

.footer a:hover {
    color: var(--primary);
}

/* Utilities */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.back-btn:hover {
    color: var(--text-main);
}

/* Mobile */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .profile-hero {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }

    .profile-main {
        flex-direction: column;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-form {
        width: 100%;
        flex-direction: column;
    }

    .search-form input,
    .search-form select {
        width: 100%;
        border: none;
        border-bottom: 1px solid var(--border-color);
    }

    .search-form .form-group:last-child input,
    .search-form .form-group:last-child select {
        border-bottom: none;
    }
}

/* Podium Styles */
.podium-section {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1.5rem;
    margin-bottom: 3rem;
    padding-top: 2rem;
}

.podium-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 220px;
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
}

.podium-card:hover {
    transform: translateY(-5px);
    border-color: var(--text-muted);
}

.podium-card.rank-1 {
    height: 320px;
    border-color: rgba(251, 191, 36, 0.4);
    background: linear-gradient(180deg, rgba(251, 191, 36, 0.05) 0%, var(--bg-card) 100%);
    z-index: 2;
}

.podium-card.rank-2 {
    height: 270px;
    border-color: rgba(148, 163, 184, 0.4);
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.05) 0%, var(--bg-card) 100%);
}

.podium-card.rank-3 {
    height: 240px;
    border-color: rgba(180, 83, 9, 0.4);
    background: linear-gradient(180deg, rgba(180, 83, 9, 0.05) 0%, var(--bg-card) 100%);
}

.podium-rank {
    font-size: 4rem;
    font-weight: 800;
    opacity: 0.1;
    position: absolute;
    bottom: 0;
    right: 10px;
    line-height: 1;
    color: var(--text-main);
}

.podium-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--bg-card-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1rem;
    border: 3px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

.podium-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.rank-1 .podium-avatar {
    width: 100px;
    height: 100px;
    font-size: 2.5rem;
    border-color: #fbbf24;
}

.crown-icon {
    position: absolute;
    top: -25px;
    font-size: 2.5rem;
    color: #fbbf24;
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.3));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.podium-name {
    margin-bottom: 0.5rem;
    z-index: 1;
}

.podium-name a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.podium-name a:hover {
    color: var(--primary);
}

.podium-stat {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    z-index: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Responsive Podium */
@media (max-width: 768px) {
    .podium-section {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .podium-card {
        width: 100%;
        height: auto !important;
        flex-direction: row;
        justify-content: space-between;
        padding: 1rem;
        text-align: left;
    }

    .crown-icon {
        display: none;
    }

    .podium-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
        margin-bottom: 0;
        order: -1;
    }

    .rank-1 .podium-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }

    .podium-rank {
        position: static;
        font-size: 1.5rem;
        opacity: 0.5;
        width: 30px;
    }

    .podium-stat {
        align-items: flex-end;
        font-size: 1.1rem;
    }
}

/* Global Stats Summary */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-color: var(--text-secondary);
}

.summary-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.summary-info {
    display: flex;
    flex-direction: column;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.2;
}

.summary-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}
/* Chat History */
.chat-log {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 500px;
    overflow-y: auto;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}
.chat-row {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.9rem;
    align-items: center;
    flex-wrap: wrap;
}
.chat-row:hover { background: rgba(255, 255, 255, 0.05); }
.chat-row.team { border-left: 3px solid #eab308; }
.chat-time {
    color: var(--text-muted);
    font-size: 0.75rem;
    min-width: 110px;
    flex-shrink: 0;
}
.chat-tag {
    color: #eab308;
    font-weight: 600;
    font-size: 0.75rem;
}
.chat-msg {
    color: #e2e8f0;
    word-break: break-word;
    flex: 1;
}

/* Awards */
.awards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.award-card {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    transition: transform 0.15s ease;
}
.award-card:hover { transform: translateY(-2px); }
.award-card.award-me {
    border-color: #eab308;
    background: rgba(234, 179, 8, 0.1);
    box-shadow: 0 0 20px rgba(234, 179, 8, 0.2);
}
.award-icon {
    font-size: 1.75rem;
    color: #eab308;
    width: 48px;
    text-align: center;
}
.award-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.award-name { font-size: 1.05rem; font-weight: 600; color: #fff; margin: 0.1rem 0; }
.award-value { font-size: 0.9rem; color: #eab308; font-weight: 500; }

/* Feed (kills/deaths) */
.feed-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 420px;
    overflow-y: auto;
}
.feed-row {
    display: grid;
    grid-template-columns: 110px 100px 1fr 90px;
    gap: 0.5rem;
    padding: 0.5rem 0.6rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 6px;
    font-size: 0.85rem;
    align-items: center;
}
.feed-row:hover { background: rgba(255, 255, 255, 0.05); }
.feed-row.kill { border-left: 3px solid #22c55e; }
.feed-row.death { border-left: 3px solid #ef4444; }
.feed-time { color: var(--text-muted); font-size: 0.75rem; }
.feed-weapon { color: #fbbf24; font-weight: 500; }
.feed-target { color: #e2e8f0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-map { color: var(--text-muted); font-size: 0.75rem; text-align: right; }

/* Sessions table */
.sessions-table { display: flex; flex-direction: column; gap: 0.3rem; }
.session-head, .session-row {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1.2fr 0.5fr 0.5fr;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.9rem;
}
.session-head {
    background: rgba(74, 144, 226, 0.15);
    color: #fff;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.session-row { background: rgba(255, 255, 255, 0.02); }
.session-row:hover { background: rgba(255, 255, 255, 0.05); }
