@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Poppins', sans-serif;
}

.leaderboard-table thead th {
    padding: 12px 15px;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: #888;
    text-align: left;
    border-bottom: 2px solid #eee;
}
.leaderboard-table thead .th-score {
    text-align: right;
}

.leaderboard-table tbody td {
    padding: 15px;
    vertical-align: middle;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}
.leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

.leaderboard-table .rank {
    font-weight: 700;
    font-size: 1.1rem;
    color: #333;
    width: 60px;
    text-align: center;
}

.leaderboard-table .user {
    display: flex;
    align-items: center;
}
.leaderboard-table .user .avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
}
.leaderboard-table .user .username {
    font-weight: 600;
}

.leaderboard-table .score {
    text-align: right;
    font-weight: 700;
    font-size: 1.1rem;
    color: #e67e22;
}

/* --- Top 3 Styling --- */
.leaderboard-table .rank-1,
.leaderboard-table .rank-2,
.leaderboard-table .rank-3 {
    font-weight: 700;
}

.leaderboard-table .rank-1 .rank::before,
.leaderboard-table .rank-2 .rank::before,
.leaderboard-table .rank-3 .rank::before {
    font-size: 1.5rem;
    display: block;
    margin: -5px auto 5px;
}

.leaderboard-table .rank-1 .rank::before { content: '\1F947'; }
.leaderboard-table .rank-2 .rank::before { content: '\1F948'; }
.leaderboard-table .rank-3 .rank::before { content: '\1F949'; }

.leaderboard-table .rank-1 { background-color: #fffbeb; }
.leaderboard-table .rank-2 { background-color: #f8f9fa; }
.leaderboard-table .rank-3 { background-color: #fef5e7; }

/* =========================================================
   VIIMEKSI PÄIVITETTY - BANNER (selkeämpi + LIVE + stale)
   ========================================================= */

.last-updated-banner {
    display: flex;
    align-items: center;
    gap: 12px;

    padding: 16px 18px;
    margin: 14px 0 20px;

    border-radius: 14px;

    background: linear-gradient(135deg, #2563eb, #1e40af);

    color: #ffffff;
    font-size: 16px;
    font-weight: 600;

    box-shadow:
        0 10px 28px rgba(37, 99, 235, 0.38),
        inset 0 0 0 1px rgba(255,255,255,0.18);
}

.last-updated-banner .icon {
    font-size: 20px;
    opacity: 0.95;
    flex: 0 0 auto;
}

.last-updated-banner .text {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    line-height: 1.35;
}

.last-updated-banner .last-updated-date {
    font-weight: 900;
    font-size: 16px;
    letter-spacing: 0.2px;
}

.last-updated-banner .last-updated-relative {
    font-size: 13px;
    font-weight: 700;
    opacity: 0.98;
    background: rgba(255,255,255,0.18);
    padding: 4px 10px;
    border-radius: 999px;
}

.last-updated-banner::after {
    content: "LIVE";
    margin-left: auto;
    padding: 6px 10px;
    border-radius: 999px;
    background: #22c55e;
    color: #052e1b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.4px;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.12);
}

/* stale = yli 24h vanha */
.last-updated-banner.stale {
    background: linear-gradient(135deg, #f59e0b, #b45309);
    box-shadow:
        0 10px 28px rgba(245, 158, 11, 0.35),
        inset 0 0 0 1px rgba(255,255,255,0.18);
}

.last-updated-banner.stale::after {
    content: "PÄIVITÄ";
    background: #111827;
    color: #ffffff;
}
