#selectionScreen {
    background-color: #f0f0f0;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
    text-align: center;
    color: #333;
}

#gameContainer {
    position: relative; /* Required for absolute positioning of the child overlay */
    text-align: center;
}

#country-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.country-button {
    border: 2px solid #ccc;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s;
}

.country-button:hover {
    transform: scale(1.1);
    border-color: #007bff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.instructions {
    font-size: 1.2em;
    margin-bottom: 30px;
    color: #555;
}

.country-button img {
    width: 100px;
    height: auto;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    background-color: #444;
    font-family: sans-serif;
    overflow: hidden;
}

#gameContainer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    position: relative;
    overflow: hidden;
}

canvas {
    width: 480px;
    height: 650px;
    max-width: 100vw;
    max-height: 100dvh;
    aspect-ratio: 480/650;
    display: block;
    background-color: #000;
    border: 1px solid #000;
    box-sizing: border-box;
    margin: 0 auto;
    box-shadow: 0 0 32px rgba(0,0,0,0.4);
}

body {
    background: linear-gradient(135deg, #444 0%, #222 100%);
}

#gameContainer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-width: 100vw;
    position: relative;
    overflow: hidden;
}

@media (max-width: 600px) {
    canvas {
        width: 100vw;
        height: auto;
        max-width: 100vw;
        max-height: 100dvh;
    }
    #gameOverScreen {
        width: 90vw;
        padding: 10px;
    }
    #audioToggleButton {
        font-size: 1.5em;
        padding: 6px 12px;
        top: 5px;
        right: 5px;
    }
    #restartButton {
        font-size: 1em;
        padding: 10px 20px;
    }
}


#gameOverScreen, #audioToggleButton, #restartButton {
    max-width: 90vw;
    box-sizing: border-box;
}

@media (max-width: 500px) {
    #gameContainer {
        padding: 0;
    }
    canvas {
        width: 100vw;
        height: auto;
        max-height: 80vh;
    }
    #gameOverScreen {
        width: 90vw;
        padding: 10px;
    }
    #audioToggleButton {
        font-size: 1.5em;
        padding: 6px 12px;
        top: 5px;
        right: 5px;
    }
    #restartButton {
        font-size: 1em;
        padding: 10px 20px;
    }
}


#gameOverScreen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(240, 240, 240, 0.95);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    color: #333;
    width: 50%;
}

#restartButton {
    margin-top: 20px;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    border: none;
    border-radius: 10px;
    background-color: #28a745;
    color: white;
    transition: background-color 0.2s, transform 0.2s;
}

#restartButton:hover {
    background-color: #218838;
    transform: scale(1.05);
}

@media (max-width: 425px) {
    #selectionScreen {
        padding: 20px;
    }

    h1 {
        font-size: 1.8em;
    }

    .instructions {
        font-size: 1em;
        margin-bottom: 20px;
    }

    #country-list {
        gap: 10px;
    }

    .country-button {
        padding: 8px;
    }

    .country-button img {
        width: 70px;
    }
}
