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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: #e2e8f0;
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    padding: 30px 0 20px;
    border-bottom: 1px solid rgba(96, 165, 250, 0.2);
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    background: linear-gradient(90deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    color: #94a3b8;
    font-size: 1.1rem;
}

.last-update {
    margin-top: 10px;
    color: #64748b;
    font-size: 0.9rem;
}

.last-update span {
    color: #60a5fa;
    font-weight: 600;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(96, 165, 250, 0.15);
    border-radius: 16px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(96, 165, 250, 0.4);
    box-shadow: 0 10px 30px rgba(96, 165, 250, 0.15);
}

.stat-card.highlight {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(167, 139, 250, 0.2));
    border-color: rgba(167, 139, 250, 0.3);
}

.stat-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

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

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: #60a5fa;
}

.stat-card.highlight .stat-value {
    background: linear-gradient(90deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    color: #94a3b8;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

section {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(96, 165, 250, 0.1);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    backdrop-filter: blur(10px);
}

section h2 {
    font-size: 1.4rem;
    color: #60a5fa;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(96, 165, 250, 0.2);
}

.servers-list,
.leaderboard {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.server-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(96, 165, 250, 0.1);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.server-card:hover {
    border-color: rgba(96, 165, 250, 0.3);
    background: rgba(15, 23, 42, 0.8);
}

.server-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.server-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e2e8f0;
}

.server-id {
    color: #64748b;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
}

.server-stats {
    display: flex;
    gap: 20px;
    text-align: right;
}

.server-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.server-stat-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #60a5fa;
}

.server-stat-label {
    font-size: 0.75rem;
    color: #64748b;
    text-transform: uppercase;
}

.server-stat.positive {
    color: #4ade80;
}

.server-stat.negative {
    color: #f87171;
}

.retention-bar {
    width: 100%;
    height: 8px;
    background: rgba(100, 116, 139, 0.3);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.retention-fill {
    height: 100%;
    background: linear-gradient(90deg, #f87171, #fb923c, #4ade80);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(96, 165, 250, 0.1);
    border-radius: 10px;
    padding: 15px 20px;
    transition: all 0.2s ease;
}

.leaderboard-item:hover {
    border-color: rgba(96, 165, 250, 0.3);
    transform: translateX(5px);
}

.rank {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1rem;
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
}

.rank.gold {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #1e293b;
}

.rank.silver {
    background: linear-gradient(135deg, #cbd5e1, #94a3b8);
    color: #1e293b;
}

.rank.bronze {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #1e293b;
}

.player-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.player-name {
    font-weight: 600;
    color: #e2e8f0;
}

.player-tag {
    font-size: 0.75rem;
    color: #64748b;
    font-family: 'Courier New', monospace;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-stats {
    display: flex;
    gap: 20px;
    text-align: right;
}

.player-stat {
    text-align: right;
}

.player-stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #a78bfa;
}

.player-stat-label {
    font-size: 0.7rem;
    color: #64748b;
    text-transform: uppercase;
}

.no-data {
    text-align: center;
    color: #64748b;
    padding: 30px;
    font-style: italic;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #64748b;
}

.breadcrumb a {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #a78bfa;
}

.breadcrumb span {
    color: #94a3b8;
}

/* Retention section */
.retention-section {
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(96, 165, 250, 0.1);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    backdrop-filter: blur(10px);
}

.retention-section h2 {
    font-size: 1.4rem;
    color: #60a5fa;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(96, 165, 250, 0.2);
}

.retention-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(96, 165, 250, 0.1);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
}

.retention-bar-bg {
    width: 100%;
    height: 16px;
    background: rgba(100, 116, 139, 0.3);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.retention-bar {
    height: 100%;
    border-radius: 8px;
    transition: width 0.5s ease;
}

.retention-label {
    font-size: 1.1rem;
    color: #e2e8f0;
    margin-bottom: 8px;
}

.retention-detail {
    font-size: 0.85rem;
    color: #64748b;
}

/* Server name link */
.server-name-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.server-name-link:hover {
    color: #60a5fa;
}

/* Footer link */
footer a {
    color: #60a5fa;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    text-align: center;
    padding: 30px 0;
    color: #64748b;
    border-top: 1px solid rgba(96, 165, 250, 0.1);
    margin-top: 20px;
}

footer p {
    margin-bottom: 5px;
}

.footer-note {
    font-size: 0.85rem;
    color: #475569;
}

.code {
    background: rgba(96, 165, 250, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: #60a5fa;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #60a5fa;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(96, 165, 250, 0.2);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .server-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .server-stats {
        width: 100%;
        justify-content: space-between;
    }

    .leaderboard-item {
        flex-wrap: wrap;
    }

    .player-stats {
        width: 100%;
        justify-content: flex-start;
        gap: 15px;
    }
}


/* ── Indicateur de fraîcheur des données (temps réel vs statique) ── */
.live-status {
    display: inline-block;
    font-size: 0.85em;
    opacity: 0.85;
}

.live-status.live-on {
    color: #4ade80;
    opacity: 1;
    font-weight: 600;
}
