/* =============================================
   PALETTE - MODIFIE ICI TES COULEURS
   ============================================= */
:root {
    /* === COULEURS PRINCIPALES === */
    --color-dark: #182429;        /* Fond principal */
    --color-teal: #2a9d8f;        /* Accent principal */
    --color-yellow: #e9c46a;      /* Or / Highlight */
    --color-orange: #f4a261;      /* Accent secondaire */
    --color-red: #e76f51;         /* Accent tertiaire */

    /* === BACKGROUNDS === */
    --bg-primary: var(--color-dark);
    --bg-secondary: #1d3a44;
    --bg-card: rgba(42, 157, 143, 0.08);
    --bg-card-hover: rgba(42, 157, 143, 0.15);
    
    /* === BORDURES === */
    --border-subtle: rgba(42, 157, 143, 0.2);
    --border-medium: rgba(42, 157, 143, 0.4);
    
    /* === TEXTES === */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-muted: rgba(255, 255, 255, 0.5);
    
    /* === PODIUM === */
    --gold: var(--color-yellow);
    --gold-glow: rgba(233, 196, 106, 0.4);
    --silver: var(--color-teal);
    --silver-glow: rgba(42, 157, 143, 0.4);
    --bronze: var(--color-red);
    --bronze-glow: rgba(231, 111, 81, 0.4);
    
    /* === ACCENT === */
    --accent: var(--color-teal);
    --accent-glow: rgba(42, 157, 143, 0.4);
    
    /* === RAYONS === */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

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

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== BACKGROUND EFFECTS ===== */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image: 
        linear-gradient(rgba(42, 157, 143, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(42, 157, 143, 0.04) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

.bg-glow {
    position: fixed;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 900px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 60%);
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

/* ===== HEADER ===== */
header {
    position: relative;
    z-index: 1;
    padding: 80px 24px 60px;
    text-align: center;
}

.header-content {
    margin-bottom: 40px;
}

.logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 24px;
}

.logo {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--gold) 0%, var(--color-orange) 100%);
    border-radius: 50%;
    position: relative;
    z-index: 2;
}

.logo svg {
    width: 36px;
    height: 36px;
    color: var(--bg-primary);
}

.logo-ring {
    position: absolute;
    inset: -8px;
    border: 2px solid var(--gold);
    border-radius: 50%;
    opacity: 0.4;
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.4; }
    100% { transform: scale(1.3); opacity: 0; }
}

h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 500;
}

/* ===== STATS ROW ===== */
.stats-row {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-medium);
    transform: translateY(-2px);
}

.stat-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(42, 157, 143, 0.15);
    border-radius: var(--radius-md);
}

.stat-icon svg {
    width: 22px;
    height: 22px;
    color: var(--accent);
}

.stat-icon.gold {
    background: rgba(233, 196, 106, 0.15);
}

.stat-icon.gold svg {
    color: var(--gold);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ===== CONTAINER ===== */
.container {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

/* ===== PODIUM ===== */
.podium-section {
    margin-bottom: 48px;
}

.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
}

.podium-item {
    position: relative;
    width: 100%;
    max-width: 200px;
    padding: 32px 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: translateY(20px);
}

.podium-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.podium-item:hover {
    transform: translateY(-8px);
}

/* Gold - First Place */
.podium-item.gold {
    order: 2;
    padding-top: 48px;
    border-color: rgba(233, 196, 106, 0.5);
    background: linear-gradient(180deg, rgba(233, 196, 106, 0.12) 0%, var(--bg-card) 100%);
    box-shadow: 0 0 60px var(--gold-glow);
}

.podium-item.gold:hover {
    box-shadow: 0 0 80px var(--gold-glow);
}

.podium-item.gold .podium-avatar {
    background: linear-gradient(135deg, var(--gold) 0%, var(--color-orange) 100%);
    box-shadow: 0 8px 32px var(--gold-glow);
}

.podium-item.gold .podium-score {
    color: var(--gold);
}

.podium-item.gold .bar-fill {
    background: linear-gradient(90deg, var(--gold), var(--color-orange));
    width: 100%;
}

/* Silver - Second Place */
.podium-item.silver {
    order: 1;
    border-color: rgba(42, 157, 143, 0.5);
    background: linear-gradient(180deg, rgba(42, 157, 143, 0.12) 0%, var(--bg-card) 100%);
}

.podium-item.silver .podium-avatar {
    background: linear-gradient(135deg, var(--silver) 0%, #238b7e 100%);
    box-shadow: 0 8px 32px var(--silver-glow);
}

.podium-item.silver .podium-score {
    color: var(--silver);
}

.podium-item.silver .bar-fill {
    background: linear-gradient(90deg, var(--silver), #238b7e);
    width: 75%;
}

/* Bronze - Third Place */
.podium-item.bronze {
    order: 3;
    border-color: rgba(231, 111, 81, 0.5);
    background: linear-gradient(180deg, rgba(231, 111, 81, 0.12) 0%, var(--bg-card) 100%);
}

.podium-item.bronze .podium-avatar {
    background: linear-gradient(135deg, var(--bronze) 0%, var(--color-orange) 100%);
    box-shadow: 0 8px 32px var(--bronze-glow);
}

.podium-item.bronze .podium-score {
    color: var(--bronze);
}

.podium-item.bronze .bar-fill {
    background: linear-gradient(90deg, var(--bronze), var(--color-orange));
    width: 60%;
}

.crown-icon {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--gold);
    animation: float 3s ease-in-out infinite;
}

.crown-icon svg {
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 4px 12px var(--gold-glow));
}

@keyframes float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-6px); }
}

.podium-rank {
    position: absolute;
    top: 12px;
    right: 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-muted);
}

.podium-avatar {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--bg-primary);
}

.podium-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.podium-score {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.podium-bar {
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1s ease-out;
}

/* ===== SEARCH ===== */
.search-wrapper {
    margin-bottom: 24px;
}

.search-container {
    position: relative;
    max-width: 400px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-container input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all 0.3s ease;
}

.search-container input::placeholder {
    color: var(--text-muted);
}

.search-container input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ===== TABLE ===== */
.table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
    backdrop-filter: blur(10px);
}

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

thead {
    background: rgba(0, 0, 0, 0.2);
}

th {
    padding: 16px 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: left;
}

th.col-rank {
    width: 80px;
}

th.col-score {
    text-align: right;
}

tbody tr {
    border-top: 1px solid var(--border-subtle);
    transition: all 0.2s ease;
}

tbody tr:hover {
    background: var(--bg-card-hover);
}

td {
    padding: 16px 20px;
}

/* Rank Cell */
.cell-rank {
    width: 80px;
}

.rank-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Top 3 rank styling */
.top-1 .rank-number {
    background: rgba(233, 196, 106, 0.2);
    color: var(--gold);
}

.top-2 .rank-number {
    background: rgba(42, 157, 143, 0.2);
    color: var(--silver);
}

.top-3 .rank-number {
    background: rgba(231, 111, 81, 0.2);
    color: var(--bronze);
}

/* Player Cell */
.cell-player {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent) 0%, #238b7e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.top-1 .player-avatar {
    background: linear-gradient(135deg, var(--gold) 0%, var(--color-orange) 100%);
    color: var(--bg-primary);
}

.top-2 .player-avatar {
    background: linear-gradient(135deg, var(--silver) 0%, #238b7e 100%);
    color: var(--bg-primary);
}

.top-3 .player-avatar {
    background: linear-gradient(135deg, var(--bronze) 0%, var(--color-orange) 100%);
    color: var(--bg-primary);
}

.player-name {
    font-weight: 500;
}

.leader-badge {
    padding: 4px 10px;
    background: rgba(233, 196, 106, 0.15);
    border-radius: 20px;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Score Cell */
.cell-score {
    text-align: right;
}

.score-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.score-label {
    margin-left: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    header {
        padding: 60px 16px 40px;
    }
    
    .container {
        padding: 0 16px 60px;
    }
    
    .podium {
        gap: 8px;
    }
    
    .podium-item {
        max-width: 140px;
        padding: 24px 12px 16px;
    }
    
    .podium-item.gold {
        padding-top: 40px;
    }
    
    .podium-avatar {
        width: 48px;
        height: 48px;
        font-size: 1.125rem;
    }
    
    .podium-name {
        font-size: 0.875rem;
    }
    
    .podium-score {
        font-size: 1rem;
    }
    
    .crown-icon svg {
        width: 32px;
        height: 32px;
    }
    
    .stats-row {
        flex-direction: column;
        align-items: center;
    }
    
    .stat-card {
        width: 100%;
        max-width: 280px;
    }
    
    th, td {
        padding: 12px 16px;
    }
    
    .player-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }
    
    .leader-badge {
        display: none;
    }
}

@media (max-width: 480px) {
    .podium-item {
        max-width: 110px;
        padding: 20px 8px 12px;
    }
    
    .podium-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .podium-name {
        font-size: 0.75rem;
    }
    
    .podium-score {
        font-size: 0.875rem;
        margin-bottom: 8px;
    }
    
    .podium-rank {
        font-size: 0.75rem;
        top: 8px;
        right: 8px;
    }
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.season-dropdown {
    appearance: none;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 8px 32px 8px 12px;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23e9c46a' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.season-dropdown:hover {
    border-color: var(--gold);
    background-color: rgba(233, 196, 106, 0.1);
}

.season-dropdown:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.season-dropdown option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 12px;
}

/* ===== ANIMATIONS ===== */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.podium-item:nth-child(1) { animation-delay: 0.1s; }
.podium-item:nth-child(2) { animation-delay: 0s; }
.podium-item:nth-child(3) { animation-delay: 0.2s; }

tbody tr {
    animation: fade-in-up 0.4s ease-out backwards;
}

tbody tr:nth-child(1) { animation-delay: 0.05s; }
tbody tr:nth-child(2) { animation-delay: 0.1s; }
tbody tr:nth-child(3) { animation-delay: 0.15s; }
tbody tr:nth-child(4) { animation-delay: 0.2s; }
tbody tr:nth-child(5) { animation-delay: 0.25s; }
tbody tr:nth-child(n+6) { animation-delay: 0.3s; }