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

body {
    font-family: monospace, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    min-height: 100vh;
    padding: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.leaderboard-container {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 0 20px rgba(0, 100, 255, 0.3);
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 8px;
}

.leaderboard-header h1 {
    color: #4a90e2;
    font-size: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(74, 144, 226, 0.5);
}

.leaderboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    margin: 8px 0;
    padding: 12px;
    border-radius: 8px;
}

.top-1 {
    background: linear-gradient(45deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    border: 1px solid gold;
}

.top-2 {
    background: linear-gradient(45deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.1));
    border: 1px solid silver;
}

.top-3 {
    background: linear-gradient(45deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.1));
    border: 1px solid #CD7F32;
}

.rank {
    font-size: 20px;
    width: 40px;
    text-align: center;
    flex-shrink: 0;
}

.rank i {
    font-size: 24px;
}

.wallet-address {
    width: 40%;
    padding: 0 10px;
    font-family: monospace;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}

.score {
    width: 25%;
    font-size: 16px;
    font-weight: bold;
    color: #4a90e2;
    text-align: right;
    padding: 0 10px;
    flex-shrink: 0;
}

.token-balance {
    width: 25%;
    font-size: 14px;
    font-weight: bold;
    color: #50c878;
    text-align: right;
    flex-shrink: 0;
}

@keyframes glow {
    0% {
        box-shadow: 0 0 5px rgba(74, 144, 226, 0.3);
    }

    50% {
        box-shadow: 0 0 15px rgba(74, 144, 226, 0.5);
    }

    100% {
        box-shadow: 0 0 5px rgba(74, 144, 226, 0.3);
    }
}

.top-1,
.top-2,
.top-3 {
    animation: glow 2s infinite;
}

/* Desktop styles */
@media (min-width: 768px) {
    body {
        padding: 20px;
    }

    .leaderboard-container {
        max-width: 600px;
        padding: 20px;
        border-radius: 15px;
    }

    .leaderboard-header h1 {
        font-size: 28px;
        letter-spacing: 2px;
    }

    .leaderboard-item {
        padding: 15px;
        margin: 10px 0;
    }

    .rank {
        font-size: 24px;
        width: 50px;
    }

    .rank i {
        font-size: 28px;
    }

    .wallet-address {
        font-size: 16px;
        padding: 0 15px;
    }

    .score {
        font-size: 18px;
    }

    .token-balance {
        font-size: 18px;
    }

    .loading-spinner p {
        font-size: 16px;
    }

    .spinner {
        width: 50px;
        height: 50px;
    }
}

.nav-buttons {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

#backButton {
    background: rgba(0, 0, 0, 0.5);
    color: #4a90e2;
    border: 1px solid #4a90e2;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    text-decoration: none;
    display: inline-block;
}

#backButton:hover {
    background: rgba(74, 144, 226, 0.2);
}

/* Mobile styles */
@media (max-width: 768px) {
    .nav-buttons {
        top: 10px;
        left: 10px;
    }

    #backButton {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* Loading Spinner styles */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(74, 144, 226, 0.1);
    border-left-color: #4a90e2;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

.loading-spinner p {
    color: #4a90e2;
    font-size: 14px;
    margin-top: 10px;
}

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

/* Error message styles */
.error-message {
    text-align: center;
    color: #ff4444;
    padding: 20px;
    background: rgba(255, 68, 68, 0.1);
    border-radius: 8px;
    margin: 10px 0;
}

/* Countdown Timer Styles */
.countdown-timer {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 15px;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.countdown-label {
    font-size: 14px;
    color: #aaa;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.countdown-value {
    font-size: 24px;
    font-weight: bold;
    color: #4a90e2;
    letter-spacing: 2px;
}

/* Animation cho đếm ngược khi sắp hết giờ */
@keyframes pulse {
    0% {
        color: #4a90e2;
    }

    50% {
        color: #ff6b6b;
    }

    100% {
        color: #4a90e2;
    }
}

.countdown-urgent {
    animation: pulse 1.5s infinite;
    color: #ff6b6b;
}

/* Desktop styles */
@media (min-width: 768px) {
    .countdown-timer {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        padding: 12px 20px;
    }

    .countdown-label {
        margin-bottom: 0;
    }

    .countdown-value {
        font-size: 28px;
    }
}