html, body {
    font-family: Arial, sans-serif;
    /* min-height: 80vh;
    width: 100vw;
    overflow: hidden;
    */
    max-height: 1024px;
    margin: 0;
    padding: 0;
}

.game {
    display: flex;
    flex-direction: column;
    /* gap is a magical property that works with flex and grid */
    gap: var(--gap);
    padding: var(--gap);
    position: relative;
}

.game .game-area {
    /* this makes it so children with position:absolute ar positioned relatively to this element */
    position: relative;

    /* dirty trick to center an element */
    margin: 0 auto;
}

.game .game-area img {
    /* img is normally an inline element and may have some extra unwanted margins somewhere */
    display: block;
    width: 1334px;
    height: 775px;
}

.game .game-area #canvas {
    position: absolute;
    /* apparently canvas requires and explicit width/height - setting top/left/right/bottom would "stretch" the thing??? */
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.game .header {
    gap: var(--gap);
    padding: var(--gap);
    background-color: #333;
    color: white;
    border: red;
    display: grid;
    grid-template-columns: repeat(4, minmax(100px, 1fr));
}

.game .footer {
    /* display grid is nice for table-like stuff */
    display: grid;
    grid-template-columns: repeat(3, minmax(100px, 1fr));
    gap: var(--gap);
    padding: var(--gap);
    background-color: #333;
}

.game .footer button {
    padding: 0.75rem;
}


.countdown-overlay {
    position: absolute; /* Changed from fixed to absolute */
    top: 0;
    left: 0;
    right: 0;
    bottom: 0; /* This will now respect the parent container's boundaries */
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    pointer-events: none; /* Allows clicks to pass through */
    font-size: 70vmin; /* Approximately 70% of screen size */
    color: rgba(255, 255, 255, 0.1); /* Very transparent white text */
    text-align: center;
    /*
    border-color: red;
    border-style: solid;
    border-width: 5px;
    */
}

.stats-overlay {
    position: absolute;
    left: 50px; /* Slight indent from the left */
    bottom: 10px; /* Position at the bottom with a small offset */
    z-index: 1000;
    pointer-events: none; /* Allows clicks to pass through */
    font-family: "OCR-A", "Courier New", monospace; /* Doom-like square font */
    font-size: 8px; /* Adjusted for readability, modify as needed */
    color: rgba(255, 255, 255, 0.8); /* Slightly less transparent for visibility */
    text-align: left;
    line-height: 1.2; /* Tight line spacing for retro feel */
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); /* Optional: adds readability */
}

.stats-overlay ul {
    list-style: none; /* Removes default bullets */
    padding: 0;
    margin: 0;
}

#game-container {
    width: 100vw;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    background-color: #fff;
}

/*
#header {
    width: 100%;
    background-color: #333;
    color: white;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    flex-shrink: 0;
}

    */

#selected-countries {
    flex: 2;
    font-size: clamp(12px, 3vw, 14px);
    padding: 0 5px;
}

#score-display {
    flex: 1;
    font-size: clamp(14px, 3.5vw, 16px);
    font-weight: bold;
    text-align: center;
}

#countdown {
    flex: 1;
    font-size: clamp(16px, 4vw, 20px);
    color: #ff0;
    text-align: right;
    padding-right: 5px;
}

#prompt {
    width: 100%;
    padding: 10px;
    background-color: #444;
    color: white;
    font-size: clamp(14px, 3.5vw, 16px);
    font-weight: bold;
    text-align: center;
    box-sizing: border-box;
    flex-shrink: 0;
}

/*
#buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    padding: 5px;
    box-sizing: border-box;
}
*/

#button-row-1, #button-row-2 {
    display: flex;
/*    flex-wrap: nowrap; */
    justify-content: center;
    gap: 5px;
    grid-column: 1/-1;
/*    justify-content: space-between;
    gap: var(--gp);
    gap: 5px;
*/
}

#button-row-1 button, #button-row-2 button {
    width: calc(33.33% - 4px);
    padding: clamp(8px, 2vw, 12px);
    background-color: #007BFF;
    color: white;
    border: none;
    font-size: clamp(12px, 3vw, 16px);
    cursor: pointer;
    box-sizing: border-box;
    justify-content: center;
}

#button-row-2 button.active {
    background-color: #FF5733;
}

/*
#button-row-1 button:hover, #button-row-2 button:hover {
    background-color: #0056b3;
}
*/

.shape {
    position: absolute;
    width: clamp(20px, 4vw, 30px);
    height: clamp(20px, 4vw, 30px);
    border-radius: 50%;
    background-color: rgba(76, 175, 80, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: clamp(4px, 1vw, 6px);
    text-align: center;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s, border 0.3s, color 0.3s;
}

.shape.hide-names {
    color: transparent;
}

.shape.selected {
    border: 3px solid orange;
}

.shape.highlight {
    /* background-color: orange !important; */
    background-color: red !important;
    border: 3px solid orange;
}

@media (max-width: 600px) {
    #header {
        padding: 8px;
    }

    #selected-countries {
        font-size: clamp(10px, 2.5vw, 12px);
    }

    #score-display {
        font-size: clamp(12px, 3vw, 14px);
    }

    #countdown {
        font-size: clamp(14px, 3.5vw, 18px);
    }

    #prompt {
        font-size: clamp(12px, 3vw, 14px);
        padding: 8px;
    }

    .shape {
        width: clamp(20px, 4vw, 30px);
        height: clamp(20px, 4vw, 30px);
        font-size: clamp(4px, 1vw, 6px);
    }

    #button-row-1, #button-row-2 {
        flex-direction: column;
        gap: 3px;
    }

    #button-row-1 button, #button-row-2 button {
        width: 100%;
        padding: clamp(6px, 1.5vw, 10px);
        font-size: clamp(10px, 2.5vw, 14px);
    }
}
