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

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #43e97b;
    --danger: #f5576c;
    --warning: #ffa726;
    --info: #4facfe;
    --dark: #1a1a2e;
    --darker: #16213e;
    --light: #f5f5f5;
    --white: #ffffff;
    --text: #e4e4e7;
    --text-muted: #a1a1aa;
    --border: #27272a;
    --shadow: rgba(0, 0, 0, 0.3);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* ==================== NAVBAR ==================== */
.navbar {
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px var(--shadow);
}

.nav-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 2rem;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: bold;
    color: #ffd700;
    white-space: nowrap;
}

.nav-brand i {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
}

.nav-brand span {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.25rem;
    justify-content: center;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
}

.nav-link i {
    font-size: 1.1rem;
}

.nav-link:hover {
    color: var(--white);
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* ==================== CONTAINER ==================== */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2.5rem;
    min-height: calc(100vh - 200px);
}

.page {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title {
    font-size: 2.75rem;
    margin-bottom: 2.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.page-title i {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 3rem;
}

.page-title::after {
    content: '';
    flex: 1;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), transparent);
    border-radius: 10px;
    margin-left: 1rem;
}

/* ==================== STATS CARDS ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px var(--shadow);
    border-color: var(--primary);
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 4px 20px var(--shadow);
}

.stat-info h3 {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.status-dot {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--success);
    animation: pulse 2s infinite;
    box-shadow: 0 0 20px var(--success);
}

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

/* ==================== CARDS ==================== */
.card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 2rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 40px var(--shadow);
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(102, 126, 234, 0.05);
}

.card-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

/* ==================== BUTTONS ==================== */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #38f9d7);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #f093fb);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 87, 108, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

/* ==================== TABLES ==================== */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: rgba(102, 126, 234, 0.1);
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 2px solid var(--border);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

.data-table tbody tr {
    transition: all 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.text-center {
    text-align: center;
}

/* ==================== LEADERBOARD ==================== */
.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--primary);
    transform: translateX(10px);
}

.leaderboard-rank {
    font-size: 2rem;
    font-weight: bold;
    width: 60px;
    text-align: center;
}

.rank-1 { color: #FFD700; text-shadow: 0 0 20px rgba(255, 215, 0, 0.5); }
.rank-2 { color: #C0C0C0; text-shadow: 0 0 20px rgba(192, 192, 192, 0.5); }
.rank-3 { color: #CD7F32; text-shadow: 0 0 20px rgba(205, 127, 50, 0.5); }

.leaderboard-info {
    flex: 1;
    margin-left: 1.5rem;
}

.leaderboard-name {
    font-size: 1.25rem;
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.leaderboard-stats {
    display: flex;
    gap: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.leaderboard-elo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

/* ==================== ACHIEVEMENTS ==================== */
.achievements-categories {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.filter-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--primary);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-color: transparent;
    color: white;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.achievement-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.achievement-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.achievement-card:hover::before {
    opacity: 1;
}

.achievement-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px var(--shadow);
}

.achievement-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.achievement-icon {
    font-size: 3rem;
    filter: drop-shadow(0 4px 10px var(--shadow));
}

.achievement-title {
    font-size: 1.25rem;
    font-weight: bold;
}

.achievement-description {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.achievement-reward {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(67, 233, 123, 0.1);
    border: 1px solid rgba(67, 233, 123, 0.3);
    border-radius: 6px;
    color: var(--success);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ==================== API DOCS ==================== */
.api-docs {
    display: grid;
    gap: 2rem;
}

.api-section {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border);
}

.api-section h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

.api-endpoint {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 3px solid var(--primary);
}

.method {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.method.get {
    background: var(--info);
    color: white;
}

.method.post {
    background: var(--success);
    color: white;
}

.method.delete {
    background: var(--danger);
    color: white;
}

.api-endpoint code {
    flex: 1;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    color: var(--primary);
}

.api-endpoint p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ==================== FILTERS ==================== */
.filters {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.filters select {
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filters select:hover {
    border-color: var(--primary);
}

/* ==================== FOOTER ==================== */
.footer {
    background: rgba(26, 26, 46, 0.95);
    border-top: 2px solid var(--border);
    margin-top: 4rem;
    padding: 3rem 0 1rem;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--primary);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.footer-section a:hover {
    color: var(--primary);
    transform: translateX(5px);
}

.footer-bottom {
    text-align: center;
    padding: 1rem 2rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .nav-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .nav-brand {
        justify-content: center;
    }

    .nav-menu {
        justify-content: center;
        flex-wrap: wrap;
    }

    .nav-controls {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .nav-link span {
        display: none;
    }

    .nav-link {
        padding: 0.65rem;
    }

    .page-title {
        font-size: 1.75rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .search-input {
        width: 150px !important;
    }

    .search-input:focus {
        width: 200px !important;
    }
}

/* ==================== SEARCH & CONTROLS ==================== */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-container {
    position: relative;
}

.search-input {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    width: 250px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    width: 300px;
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: rgba(26, 26, 46, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-results.show {
    display: block;
}

.search-result-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

.search-result-item:last-child {
    border-bottom: none;
}

/* ==================== THEME TOGGLE ==================== */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: var(--primary);
    transform: rotate(20deg);
}

body.light-theme {
    --dark: #f5f5f5;
    --darker: #ffffff;
    --text: #1a1a2e;
    --text-muted: #666;
    --border: #e0e0e0;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
}

body.light-theme .navbar,
body.light-theme .card,
body.light-theme .stat-card {
    background: rgba(255, 255, 255, 0.8);
}

/* ==================== CONNECTION INDICATOR ==================== */
.connection-indicator {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

#ws-status {
    font-size: 0.75rem;
    color: var(--danger);
    animation: pulse 2s infinite;
}

#ws-status.connected {
    color: var(--success);
}

.connection-indicator .tooltip {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.connection-indicator:hover .tooltip {
    opacity: 1;
}

/* ==================== LIVE INDICATOR ==================== */
.live-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--danger);
    font-size: 0.9rem;
    font-weight: 600;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--danger);
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px var(--danger);
}

/* ==================== CHARTS ==================== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.charts-grid canvas {
    max-height: 300px;
}

/* ==================== PROGRESS BARS ==================== */
.progress-item {
    margin-bottom: 1.5rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.progress-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.progress-value {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.progress-bar-container {
    height: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 10px;
    transition: width 0.6s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-bar.complete {
    background: linear-gradient(90deg, var(--success), #38f9d7);
}

/* ==================== TOURNAMENT BRACKET ==================== */
.bracket-view {
    overflow-x: auto;
    padding: 2rem;
}

.bracket-round {
    display: inline-block;
    vertical-align: top;
    margin-right: 3rem;
}

.bracket-round-title {
    text-align: center;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.bracket-match {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 2rem;
    padding: 0.5rem;
    min-width: 200px;
    position: relative;
}

.bracket-match::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    width: 3rem;
    height: 2px;
    background: var(--border);
}

.bracket-match:last-child::after {
    display: none;
}

.bracket-player {
    padding: 0.75rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.bracket-player.winner {
    background: rgba(67, 233, 123, 0.1);
    border-left: 3px solid var(--success);
    font-weight: bold;
}

.bracket-player.loser {
    opacity: 0.6;
}

.bracket-player:first-child {
    border-bottom: 1px solid var(--border);
}

.bracket-vs {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0.25rem 0;
}

/* ==================== RESPONSIVE BRACKET ==================== */
@media (max-width: 768px) {
    .bracket-view {
        padding: 1rem;
    }

    .bracket-round {
        margin-right: 1.5rem;
    }

    .bracket-match::after {
        width: 1.5rem;
    }
}

/* ==================== UTILITIES ==================== */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
}

.error {
    background: rgba(245, 87, 108, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.success {
    background: rgba(67, 233, 123, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* ==================== STEAM AUTH ====================*/
.btn-steam {
    background: linear-gradient(135deg, #171a21, #1b2838);
    color: white;
    border: 1px solid #2a475e;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-steam:hover {
    background: linear-gradient(135deg, #1b2838, #2a475e);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(42, 71, 94, 0.4);
}

.btn-steam i {
    font-size: 1.1rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-avatar:hover {
    transform: scale(1.05);
    border-color: var(--success);
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text);
}

.user-elo {
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
}

.user-dropdown {
    position: relative;
}

.user-dropdown-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-dropdown-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--primary);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: rgba(26, 26, 46, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 200px;
    box-shadow: 0 10px 40px var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border);
}

.user-dropdown-menu a:last-child {
    border-bottom: none;
}

.user-dropdown-menu a:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
}

/* ==================== MODAL ====================*/
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--darker);
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* ==================== PLAYER PROFILE ====================*/
.profile-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.profile-main {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.profile-details h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.profile-rank {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: bold;
}

.profile-stats-quick {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.quick-stat {
    text-align: center;
}

.quick-stat-value {
    font-size: 2rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quick-stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.stats-grid-detailed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 3px solid var(--primary);
}

.stat-item-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
}

.stat-item-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text);
}

.stat-item-value.positive {
    color: var(--success);
}

.stat-item-value.negative {
    color: var(--danger);
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

