body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    background: #f0f0f0; /* Light gray background */
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    align-items: center;
    overflow-x: hidden;
}

header {
    background-color: #fff;
    color: #2196f3;
    padding: 20px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

h1 {
    margin: 0;
    font-weight: 700;
}

#homeButton {
    background-color: #2196f3;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#homeButton:hover {
    background-color: #1976d2;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    width: 90%;
    max-width: 1000px;
    margin-top: 20px;
}

.leaderboard-container {
    margin-bottom: 20px;
    width: 100%;
    background-color: #fff; /* White category background */
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1); /* More pronounced shadow */
    border: 1px solid #eee; /* Light gray border */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.leaderboard-container:hover {
    transform: translateY(-3px); /* Slightly lift on hover */
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
}

.leaderboard-container h2 {
    color: #2196f3; /* Blue category title */
    border-bottom: 2px solid #2196f3; /* Blue underline */
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.6em;
    font-weight: 600;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #ddd; 
}

th, td {
    padding: 10px 15px;
    text-align: center;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f5f5f5; /* Light gray header background */
    color: #333; /* Darker header text */
    font-weight: 600;
}

td:nth-child(2) {
    text-align: left;
}

td:nth-child(3), td:nth-child(4), td:nth-child(5), td:nth-child(6) {
    text-align: right;
}

.medal {
    width: 20px;
    height: 20px;
    margin-right: 5px;
}

.error {
    color: #f44336;
    margin-top: 20px;
    text-align: center;
    font-size: 1.2em;
}

.watchers-container {
    display: flex;
    align-items: center; /* Vertically align images */
}

.user-face {
    width: 40px; /* Adjust size as needed */
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 5px;
    border: 1px solid white;
    box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
}

footer {
    background-color: #fff;
    padding: 10px;
    text-align: center;
    border-top: 1px solid #eee;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    main {
        padding: 20px;
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
    }

    #homeButton {
        padding: 8px 12px;
    }

    .leaderboard-container {
        padding: 15px;
    }

    .leaderboard-container h2 {
        font-size: 1.4em; /* Slightly smaller font size */
    }

    table {
        width: 100%;
        font-size: 14px; /* Slightly smaller font size for readability */
    }

    th, td {
        padding: 8px 12px;
    }

    .watchers-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-face {
        width: 30px;
        height: 30px;
    }
}

/* Mobile Adjustments for smaller screens (max-width: 480px) */
@media (max-width: 480px) {
    body {
        font-size: 14px; /* Smaller font size */
    }

    header {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px;
    }

    #homeButton {
        padding: 6px 10px;
    }

    .leaderboard-container {
        padding: 10px;
    }

    .leaderboard-container h2 {
        font-size: 1.2em;
    }

    table {
        width: 100%;
        font-size: 12px;
    }

    th, td {
        padding: 6px 10px;
    }

    .watchers-container {
        flex-direction: column;
        align-items: flex-start;
    }

    .user-face {
        width: 25px;
        height: 25px;
    }

    footer {
        padding: 8px;
    }
}
