/* --- BASE STYLES --- */
* {
    box-sizing: border-box; /* Ensures padding doesn't push elements off-screen */
}

body { 
    font-family: Arial, sans-serif; 
    background-color: #f4f4f9; 
    text-align: center; 
    margin: 0; 
    padding: 15px; 
}

#game-container { 
    max-width: 800px; 
    margin: 0 auto; 
    background: white; 
    padding: 20px; 
    border-radius: 8px; 
    box-shadow: 0 4px 8px rgba(0,0,0,0.1); 
}

#map { 
    height: 500px; 
    width: 100%; 
    margin-top: 20px; 
    border-radius: 4px; 
    border: 1px solid #ccc; 
}

/* Forces the crosshair cursor for precision clicking */
.leaflet-container {
    cursor: crosshair !important;
}

/* --- MENU UI --- */
.menu-section { 
    margin-bottom: 20px; 
}

.menu-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

select {
    padding: 8px;
    font-size: 16px;
    border-radius: 4px;
    border: 1px solid #ccc;
}

#country-flag {
    height: 30px;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

button { 
    padding: 10px 20px; 
    font-size: 16px; 
    cursor: pointer; 
    background-color: #007bff; 
    color: white; 
    border: none; 
    border-radius: 4px; 
    transition: background-color 0.2s;
}

button:hover { 
    background-color: #0056b3; 
}

/* --- GAME UI --- */
#game-header { 
    display: none; 
    justify-content: space-between; 
    align-items: center; 
    flex-wrap: wrap; /* Allows wrapping on smaller screens */
    gap: 10px;
}

#target-name {
    margin: 0;
}

.score-board { 
    font-size: 16px; 
    font-weight: bold; 
}

#feedback { 
    font-size: 18px; 
    font-weight: bold; 
    margin-top: 15px; 
    color: #d9534f; 
}

/* --- SUMMARY TABLE --- */
.table-responsive {
    overflow-x: auto; /* Allows horizontal scrolling if the table is too wide */
}

.summary-table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 20px; 
    min-width: 400px; /* Ensures text doesn't squish too much */
}

.summary-table th, .summary-table td { 
    border: 1px solid #ddd; 
    padding: 10px; 
    text-align: center; 
}

.summary-table th { 
    background-color: #007bff; 
    color: white; 
}

.summary-table tr:nth-child(even) {
    background-color: #f9f9f9;
}


/* --- MOBILE RESPONSIVENESS (Screens smaller than 600px) --- */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    #game-container {
        padding: 15px;
    }

    /* Stack menu items vertically */
    .menu-row {
        flex-direction: column;
        gap: 10px;
    }

    /* Make inputs and buttons full width for easier tapping */
    select, button {
        width: 100%;
        padding: 12px; /* Slightly taller for thumbs */
    }

    #country-flag {
        height: 40px; /* Make flag a bit bigger on mobile */
    }

    /* Stack header elements */
    #game-header {
        flex-direction: column;
        text-align: center;
    }

    .score-board {
        font-size: 14px;
        line-height: 1.5;
    }
    
    /* Give the map a bit less height so the UI fits on screen */
    #map {
        height: 400px;
    }
}