/* ===== RESET ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

body {
    height: 100vh;
    background: #111;
    color: white;
}

/* ===== PAGE CONTAINER ===== */

.page-container {
    position: relative; /* Needed for back button positioning */
    display: flex;
    flex-direction: column;
    height: 100vh;
    padding: 20px;
    gap: 20px;
}

/* ===== BACK BUTTON ===== */

.back-button {
    align-self: flex-start;
    text-decoration: none;
    color: white;
    background: #2a2a2a;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: 0.2s ease;
}

.back-button:hover {
    background: #444;
}

.back-button:hover {
    background: #444;
}

/* ===== TOP SECTION ===== */

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

.map-image {
    width: 20%;
    aspect-ratio: 16 / 9;
    background: #222;
    overflow: hidden;
    border-radius: 8px;
}

.map-image img {
    width: 50%;
    height: 50%;
    object-fit: cover;
}

.map-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.map-name {
    font-size: 2rem;
    margin-bottom: 10px;
}

.map-game {
    font-size: 1.2rem;
    opacity: 0.7;
}

/* ===== LEADERBOARDS SECTION ===== */

.leaderboards {
    flex: 1;
    display: flex;
    gap: 20px;
    overflow: hidden;
}

/* Each half (50/50) */
.leaderboard-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1b1b1b;
    padding: 15px;
    border-radius: 8px;
    overflow: hidden;
}

/* ===== SECTION BUTTON ===== */

.leaderboard-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #2a2a2a;
    border: none;
    color: white;
    cursor: pointer;
    margin-bottom: 15px;
    border-radius: 6px;
    transition: 0.2s ease;
}

.leaderboard-btn:hover {
    background: #3a3a3a;
}

.leaderboard-btn img {
    width: 24px;
    height: 24px;
}

/* ===== SCROLLABLE LIST ===== */

.leaderboard-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 5px; /* space for scrollbar */
}

/* Optional scrollbar styling */
.leaderboard-list::-webkit-scrollbar {
    width: 6px;
}

.leaderboard-list::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 10px;
}

/* ===== ENTRY ROW ===== */

.entry {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #2c2c2c;
    border-radius: 6px;
    transition: 0.2s ease;
}

.entry:hover {
    background: #3a3a3a;
}

/* Player info (name + flag together) */

.player-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-name {
    font-weight: bold;
}

.player-flag {
    font-size: 1rem;
}

/* Score */

.player-score {
    font-weight: bold;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 900px) {

    .map-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .map-image {
        width: 100%;
    }

    .leaderboards {
        flex-direction: column;
    }
}

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

.map-image {
    width: 40%;
    aspect-ratio: 16 / 9;
    background: #222;
}

.map-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.map-name {
    font-size: 2rem;
    margin-bottom: 10px;
}

.map-game {
    font-size: 1.2rem;
    opacity: 0.7;
}

/* ===== LEADERBOARDS ===== */

.leaderboards {
    flex: 1;
    display: flex;
    gap: 20px;
    overflow: hidden;
}

.leaderboard-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #1b1b1b;
    padding: 15px;
    border-radius: 8px;
    overflow: hidden;
}

/* Button */

.leaderboard-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #2a2a2a;
    border: none;
    color: white;
    cursor: pointer;
    margin-bottom: 15px;
}

.leaderboard-btn img {
    width: 24px;
    height: 24px;
}

/* Scrollable list */

.leaderboard-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Entry */

.entry {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    background: #2c2c2c;
    border-radius: 5px;
}

.player-name {
    font-weight: bold;
}

.player-country {
    opacity: 0.8;
}

.player-score {
    font-weight: bold;
}