/* CSS Stylesheet for Leaderboard Page */

body {
    background-color: #020617;
    background-attachment: fixed;
    min-height: 100vh;
}

.leaderboard-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    animation: fadeIn 0.8s ease;
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.guild-avatar {
    width: 70px;
    height: 70px;
    border-radius: 20px;
    border: 2px solid var(--border-bright);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
}

.header-title h1 {
    font-size: 2.2rem;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #fff 0%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-title p {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
}

.btn-back {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 10px 20px;
    border-radius: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    transition: var(--transition-standard);
}

.btn-back:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-bright);
    transform: translateX(-4px);
    color: white;
}

/* --- PODIUM --- */
.podium-container {
    display: grid;
    grid-template-columns: 1fr 1.1fr 1fr;
    gap: 24px;
    align-items: flex-end;
    margin-bottom: 48px;
}

.podium-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 32px 20px;
    text-align: center;
    backdrop-filter: var(--glass-blur);
    position: relative;
    transition: var(--transition-standard);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.podium-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-bright);
}

.podium-avatar-container {
    position: relative;
    margin-bottom: 16px;
    z-index: 3;
}

.podium-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #ccc;
}

.podium-crown {
    position: absolute;
    top: -24px;
    left: 50%;
    transform: translateX(-50%) rotate(-5deg);
    font-size: 2rem;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

.podium-rank-badge {
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
    color: white;
    white-space: nowrap;
}

/* Rank specific styling */
.rank-1 .podium-avatar {
    width: 110px;
    height: 110px;
    border-color: #ffd700; /* Gold */
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}
.rank-1 .podium-rank-badge { background: linear-gradient(135deg, #ffd700, #ff8c00); }
.rank-1 {
    background: linear-gradient(to top, rgba(255, 215, 0, 0.05), rgba(15, 23, 42, 0.6));
    border-color: rgba(255, 215, 0, 0.2);
}

.rank-2 .podium-avatar {
    border-color: #c0c0c0; /* Silver */
    box-shadow: 0 0 25px rgba(192, 192, 192, 0.2);
}
.rank-2 .podium-rank-badge { background: linear-gradient(135deg, #c0c0c0, #708090); }
.rank-2 {
    background: linear-gradient(to top, rgba(192, 192, 192, 0.05), rgba(15, 23, 42, 0.6));
    border-color: rgba(192, 192, 192, 0.2);
}

.rank-3 .podium-avatar {
    border-color: #cd7f32; /* Bronze */
    box-shadow: 0 0 25px rgba(205, 127, 50, 0.2);
}
.rank-3 .podium-rank-badge { background: linear-gradient(135deg, #cd7f32, #8b4513); }
.rank-3 {
    background: linear-gradient(to top, rgba(205, 127, 50, 0.05), rgba(15, 23, 42, 0.6));
    border-color: rgba(205, 127, 50, 0.2);
}

/* Custom Neon Glow rotating border on Top 1 Avatar */
.rank-1 .podium-avatar-container::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    width: calc(100% + 10px);
    height: calc(100% + 10px);
    background: linear-gradient(45deg, #ffd700, #ff8c00, #ff0055, #ffd700);
    background-size: 400% 400%;
    border-radius: 50%;
    z-index: 1;
    animation: rotateNeonGlow 4s linear infinite;
    filter: blur(6px);
    opacity: 0.8;
}
.rank-1 .podium-avatar {
    position: relative;
    z-index: 2;
}
.rank-1 .podium-crown,
.rank-1 .podium-rank-badge {
    z-index: 3;
}
@keyframes rotateNeonGlow {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Hover shimmer light sweep on Podium Cards */
.podium-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -150%;
    width: 60%;
    height: 200%;
    transform: rotate(25deg);
    pointer-events: none;
    z-index: 4;
    transition: none;
}
.podium-card:hover::after {
    left: 150%;
    transition: all 0.9s cubic-bezier(0.19, 1, 0.22, 1);
}
.rank-1::after {
    background: linear-gradient(to right, rgba(255, 215, 0, 0) 0%, rgba(255, 215, 0, 0.4) 50%, rgba(255, 215, 0, 0) 100%);
}
.rank-2::after {
    background: linear-gradient(to right, rgba(192, 192, 192, 0) 0%, rgba(192, 192, 192, 0.4) 50%, rgba(192, 192, 192, 0) 100%);
}
.rank-3::after {
    background: linear-gradient(to right, rgba(205, 127, 50, 0) 0%, rgba(205, 127, 50, 0.4) 50%, rgba(205, 127, 50, 0) 100%);
}

.rank-1:hover {
    box-shadow: 0 10px 40px rgba(255, 215, 0, 0.2);
    border-color: rgba(255, 215, 0, 0.45);
}
.rank-2:hover {
    box-shadow: 0 10px 35px rgba(192, 192, 192, 0.15);
    border-color: rgba(192, 192, 192, 0.4);
}
.rank-3:hover {
    box-shadow: 0 10px 35px rgba(205, 127, 50, 0.15);
    border-color: rgba(205, 127, 50, 0.4);
}

/* Floating Ember Particles inside Podium Cards */
.podium-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}
.podium-particles .particle {
    position: absolute;
    bottom: -15px;
    border-radius: 50%;
    opacity: 0;
}
@keyframes floatEmber {
    0% {
        transform: translateY(0) scale(0.5);
        opacity: 0;
    }
    20% {
        opacity: 0.8;
    }
    100% {
        transform: translateY(-240px) scale(1.3);
        opacity: 0;
    }
}
.podium-card:hover .podium-particles .particle {
    animation: floatEmber 3s infinite linear;
}
.rank-1 .particle { background: #ffd700; box-shadow: 0 0 8px #ffd700; }
.rank-2 .particle { background: #c0c0c0; box-shadow: 0 0 8px #c0c0c0; }
.rank-3 .particle { background: #cd7f32; box-shadow: 0 0 8px #cd7f32; }

.podium-particles .particle:nth-child(1) { left: 12%; width: 6px; height: 6px; animation-delay: 0s; animation-duration: 2.5s; }
.podium-particles .particle:nth-child(2) { left: 32%; width: 8px; height: 8px; animation-delay: 0.5s; animation-duration: 3.2s; }
.podium-particles .particle:nth-child(3) { left: 52%; width: 5px; height: 5px; animation-delay: 1.2s; animation-duration: 2.8s; }
.podium-particles .particle:nth-child(4) { left: 72%; width: 9px; height: 9px; animation-delay: 0.2s; animation-duration: 3.5s; }
.podium-particles .particle:nth-child(5) { left: 88%; width: 6px; height: 6px; animation-delay: 1.8s; animation-duration: 3s; }

.podium-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: white;
    margin-bottom: 8px;
    font-family: 'Outfit';
    position: relative;
    z-index: 3;
}

.podium-stats {
    display: flex;
    gap: 16px;
    font-size: 0.9rem;
    margin-top: 8px;
    position: relative;
    z-index: 3;
}

.podium-stat-box {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 10px;
}

/* --- FILTRE RECHERCHE --- */
.search-container {
    margin-bottom: 24px;
    position: relative;
}

.search-input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 16px 16px 16px 50px;
    font-size: 1rem;
    color: white;
    font-family: inherit;
    outline: none;
    transition: var(--transition-standard);
}

.search-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
    background: rgba(15, 23, 42, 0.85);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* --- LIST TABLE --- */
.leaderboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 28px;
    backdrop-filter: var(--glass-blur);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.leaderboard-table th {
    padding: 20px 24px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    border-bottom: 1px solid var(--border-color);
    background: rgba(2, 6, 23, 0.4);
}

.leaderboard-table td {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.95rem;
}

.leaderboard-row {
    transition: all 0.2s ease;
}

.leaderboard-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.td-rank {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-muted);
    width: 80px;
}

.rank-number-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
}

.td-member {
    display: flex;
    align-items: center;
    gap: 16px;
}

.member-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.member-name {
    font-weight: 700;
    color: white;
    font-family: 'Outfit';
}

.td-level {
    width: 120px;
}

.level-badge {
    background: rgba(99, 102, 241, 0.15);
    color: var(--color-primary);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 4px 12px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.85rem;
    display: inline-block;
    position: relative;
    z-index: 3;
}

.td-progress {
    min-width: 250px;
}

.progress-bar-container {
    width: 100%;
    max-width: 300px;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin-bottom: 6px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    border-radius: 4px;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.td-total-xp {
    font-weight: 700;
    color: var(--color-secondary);
    font-size: 1rem;
    text-align: right;
    width: 150px;
}

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


/* --- TABS --- */
.leaderboard-tabs {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 12px 24px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
    border-color: rgba(255, 255, 255, 0.2);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

/* --- BADGES --- */
.member-badges-container {
    display: inline-flex;
    gap: 6px;
    margin-left: 10px;
    align-items: center;
}

.member-badge-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: help;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.member-badge-pill:hover {
    transform: scale(1.15);
}

.badge-top_general {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.badge-chatter {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.badge-speaker {
    background: rgba(45, 212, 191, 0.15);
    border-color: rgba(45, 212, 191, 0.3);
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.2);
}

.badge-elite {
    background: rgba(244, 63, 94, 0.15);
    border-color: rgba(244, 63, 94, 0.3);
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.2);
}

.badge-booster {
    background: rgba(236, 72, 153, 0.15);
    border-color: rgba(236, 72, 153, 0.3);
    box-shadow: 0 0 10px rgba(236, 72, 153, 0.2);
}

/* --- CHECKBOX CUSTOM --- */
.compare-checkbox-container {
    display: inline-block;
    position: relative;
    cursor: pointer;
    width: 22px;
    height: 22px;
    user-select: none;
}

.compare-checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.compare-checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 22px;
    width: 22px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.compare-checkbox-container:hover input ~ .compare-checkmark {
    border-color: rgba(255, 255, 255, 0.35);
    background-color: rgba(255, 255, 255, 0.1);
}

.compare-checkbox-container input:checked ~ .compare-checkmark {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-color: transparent;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.compare-checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.compare-checkbox-container input:checked ~ .compare-checkmark:after {
    display: block;
}

.compare-checkbox-container .compare-checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* --- FLOATING BAR --- */
.compare-floating-bar {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    padding: 16px 24px;
    border-radius: 20px;
    z-index: 999;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
}

.compare-bar-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.compare-count-text {
    font-weight: 700;
    font-size: 0.95rem;
    color: white;
    white-space: nowrap;
}

.compare-selected-users {
    display: flex;
    gap: 12px;
}

.selected-user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px 12px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
}

.selected-user-pill-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.btn-compare-launch {
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-compare-launch:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    box-shadow: none;
    cursor: not-allowed;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.compare-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease;
    overflow-y: auto;
    padding: 20px;
}

.compare-modal-content {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
    border-radius: 28px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.compare-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.compare-modal-header h2 {
    font-size: 1.5rem;
    color: white;
    margin: 0;
}

.close-modal-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0;
    line-height: 1;
}

.close-modal-btn:hover {
    color: white;
}

.compare-versus-grid {
    display: grid;
    grid-template-columns: 1fr 60px 1fr;
    padding: 40px 32px;
    align-items: center;
    gap: 20px;
    overflow-y: auto;
}

.compare-user-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 32px 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.compare-user-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.compare-user-name {
    font-size: 1.3rem;
    color: white;
    margin: 0 0 24px 0;
    font-weight: 800;
}

.compare-metrics {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.04);
    padding: 12px 18px;
    border-radius: 12px;
    transition: all 0.25s ease;
}

.metric-row.winner {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.metric-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.metric-value {
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.metric-row.winner .metric-value {
    color: #10b981;
}

.compare-vs-divider {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.compare-vs-divider span {
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.activity-stat-text {
    font-size: 0.9rem;
    color: white;
    font-weight: 600;
    display: flex;
    align-items: center;
}

/* Animations */
@keyframes slideUp {
    from { transform: translate(-50%, 50px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}


/* --- TOAST NOTIFICATIONS --- */
.toast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(239, 68, 68, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 16px 24px;
    border-radius: 16px;
    z-index: 1002;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast-icon {
    font-size: 1.25rem;
}

.toast-message {
    font-weight: 700;
    font-size: 0.95rem;
    font-family: 'Outfit', sans-serif;
}

@keyframes slideInRight {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* --- XP BOOST BANNER DYNAMIQUE --- */
.xp-boost-banner {
    position: relative;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(239, 68, 68, 0.12) 100%);
    border: 1px dashed rgba(245, 158, 11, 0.4);
    border-radius: 20px;
    padding: 16px 24px;
    margin-bottom: 32px;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    overflow: hidden;
    animation: pulseBoostBanner 3s infinite alternate;
}

.xp-boost-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
    transform: skewX(-25deg);
    animation: bannerShimmer 5s infinite linear;
}

@keyframes bannerShimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

@keyframes pulseBoostBanner {
    0% {
        border-color: rgba(245, 158, 11, 0.35);
        box-shadow: 0 4px 15px rgba(245, 158, 11, 0.04);
    }
    100% {
        border-color: rgba(245, 158, 11, 0.7);
        box-shadow: 0 4px 25px rgba(245, 158, 11, 0.18);
    }
}

.boost-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    z-index: 2;
}

.boost-badge {
    background: #f59e0b;
    color: #020617;
    font-weight: 850;
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 6px;
    letter-spacing: 0.1em;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
    animation: flashBadge 1.2s infinite alternate;
}

@keyframes flashBadge {
    0% { opacity: 0.8; }
    100% { opacity: 1; }
}

.boost-text {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    font-family: 'Outfit', sans-serif;
    letter-spacing: 0.02em;
}

.boost-text b {
    color: #f59e0b;
}

/* --- TRANSITIONS FLUIDES POUR LE 3D TILT --- */
.podium-card, .compare-user-card {
    transition: transform 0.18s ease-out, border-color 0.25s ease, box-shadow 0.25s ease;
    transform-style: preserve-3d;
}

.podium-card:hover, .compare-user-card:hover {
    transition: transform 0.05s ease-out, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* ==========================================
   RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================== */

/* Medium devices (Tablets, less than 1024px) */
@media (max-width: 1024px) {
    .leaderboard-wrapper {
        padding: 24px 16px;
    }
    
    .podium-container {
        gap: 16px;
    }
    
    .podium-card {
        padding: 24px 12px;
    }
    
    .rank-1 .podium-avatar {
        width: 100px;
        height: 100px;
    }
    
    .podium-avatar {
        width: 80px;
        height: 80px;
    }
}

/* Small devices (Phones/Tablets, less than 768px) */
@media (max-width: 768px) {
    .leaderboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 24px;
    }
    
    .header-left {
        gap: 12px;
    }
    
    .guild-avatar {
        width: 56px;
        height: 56px;
        border-radius: 16px;
    }
    
    .header-title h1 {
        font-size: 1.7rem;
    }
    
    .header-title p {
        font-size: 0.9rem;
    }
    
    .btn-back {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }

    /* Défilement horizontal de sécurité sur la table bento */
    .leaderboard-card {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* XP Boost Banner mobile */
    .xp-boost-banner {
        padding: 12px 16px;
        border-radius: 12px;
    }
    
    .boost-content {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .boost-text {
        font-size: 0.85rem;
    }

    /* Tabs scrollable horizontalement sur mobile */
    .leaderboard-tabs {
        justify-content: flex-start;
        overflow-x: auto;
        width: 100%;
        padding: 4px 4px 12px 4px;
        gap: 8px;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    
    .leaderboard-tabs::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Podium vertical sur mobile avec le Top 1 en premier */
    .podium-container {
        display: flex;
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        margin-bottom: 24px;
    }
    
    .podium-card {
        padding: 16px;
        display: grid !important;
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto;
        gap: 8px 12px;
        align-items: center;
        text-align: left;
    }
    
    .podium-avatar-container {
        grid-column: 1;
        grid-row: 1 / span 2;
        margin: 0;
        align-self: center;
    }
    
    .podium-avatar {
        width: 60px !important;
        height: 60px !important;
        border-width: 3px;
    }
    
    .rank-1 .podium-avatar {
        width: 70px !important;
        height: 70px !important;
    }
    
    .podium-crown {
        top: -18px;
        font-size: 1.5rem;
    }
    
    .podium-name {
        grid-column: 2;
        grid-row: 1;
        font-size: 1.1rem;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    
    .member-badges-container {
        margin-left: 0;
        margin-top: 2px;
    }
    
    .podium-card .level-badge {
        grid-column: 3;
        grid-row: 1;
        justify-self: end;
        margin: 0;
    }
    
    .podium-stats {
        grid-column: 2 / span 2;
        grid-row: 2;
        margin: 0;
        justify-self: start;
        font-size: 0.85rem;
    }

    /* Ordre des cartes sur le podium vertical */
    .podium-card.rank-1 { order: 1 !important; }
    .podium-card.rank-2 { order: 2 !important; }
    .podium-card.rank-3 { order: 3 !important; }

    /* Masquer la progression et simplifier le tableau */
    .td-progress {
        display: none !important;
    }
    .leaderboard-table th:nth-child(4),
    .leaderboard-table td:nth-child(4) {
        display: none !important;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 12px 10px;
        font-size: 0.85rem;
    }
    
    .td-rank {
        width: 40px;
    }
    
    .rank-number-pill {
        width: 26px;
        height: 26px;
        font-size: 0.8rem;
    }
    
    .member-avatar {
        width: 32px;
        height: 32px;
        border-radius: 8px;
    }
    
    .td-member {
        gap: 8px;
    }
    
    .td-level {
        width: 90px;
    }
    
    .level-badge {
        padding: 2px 8px;
        font-size: 0.75rem;
    }
    
    .td-total-xp {
        width: 90px;
        font-size: 0.85rem;
    }
    
    .td-compare {
        width: 50px;
    }

    /* Modal de comparaison */
    .compare-versus-grid {
        grid-template-columns: 1fr;
        padding: 16px;
        gap: 12px;
    }
    
    .compare-user-card {
        padding: 16px;
    }
    
    .compare-user-avatar {
        width: 64px;
        height: 64px;
        margin-bottom: 8px;
    }
    
    .compare-user-name {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .metric-row {
        padding: 8px 12px;
        border-radius: 8px;
    }
    
    .metric-label {
        font-size: 0.8rem;
    }
    
    .metric-value {
        font-size: 0.9rem;
    }
    
    .compare-vs-divider {
        padding: 4px 0;
    }
    
    .compare-vs-divider span {
        width: 32px;
        height: 32px;
        font-size: 1rem;
        transform: rotate(90deg);
    }
    
    /* Barre de comparaison flottante */
    .compare-floating-bar {
        width: calc(100% - 24px);
        bottom: 16px;
        padding: 10px 14px;
        border-radius: 16px;
    }
    
    .compare-bar-content {
        width: 100%;
        justify-content: space-between;
        gap: 8px;
    }
    
    .compare-count-text {
        font-size: 0.85rem;
    }
    
    .selected-user-pill {
        padding: 4px;
        background: transparent;
        border: none;
    }
    
    .selected-user-pill span {
        display: none; /* Cacher le nom pour ne garder que l'avatar */
    }
    
    .selected-user-pill-avatar {
        width: 28px;
        height: 28px;
        border: 1px solid rgba(255,255,255,0.2);
    }
    
    .btn-compare-launch {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
}

/* Extra small devices (Phones, less than 576px) */
@media (max-width: 576px) {
    .leaderboard-card {
        border-radius: 16px;
    }
    
    .leaderboard-table {
        min-width: 480px; /* Force un défilement horizontal interne propre si la largeur physique de l'écran est inférieure */
    }
}


