html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
}

*,
*::before,
*::after {
  box-sizing: border-box; 
}

.topheader {
    width: 100%;
    background-color: rgba(255, 255, 255, 0);
    padding: 10px 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.topheader h1, .topheader .time-left {
    background-color: rgba(255, 255, 255, 0.5);
    width: 100%;
    padding: 5px 0;
    margin: 5px 0;
}

.time-left {
    margin: 30px;
    padding: 30px;
    display: flex;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 90%; 
    margin: auto;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* More responsive grid */
    gap: 10px;
    max-height: 80vh; /* Limits the height to 80% of the viewport height */
    width: 100%;
    padding: 10px;
}

.images-grid img {
    max-width: 200px;
    max-height: 100%;
    border: 1px solid transparent;
    border-radius: 3px; /* Adjust the value to get the desired roundness */
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    
    
    width: 100%;
    align-self: center;
    justify-self: center;
}

img.selected {
    border: 1px solid gray;
}

.incorrect {
    border: 1px solid red;
}

.duplicate {
    transition: background-color 0.3s;
    display: inline-block;
    /*padding: 5px;*/
    /*border: 1px solid #000;*/
}

.correct {
    background-color: green;
}

#result-bottom-field {
    padding: 5px;
    margin-top: 5px;
    background-color: rgba(255, 255, 255, 0.5);
}

button {
    padding: 10px;
    font-size: 16px;
    cursor: pointer;
}

#result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.overlay-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    width: 80%;
    max-width: 600px;
}

.hidden {
    display: none !important;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.3s, opacity 0.3s ease-in-out;
}

.notification {
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 2px;
    padding: 16px;
    position: fixed;
    z-index: 1;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.2);
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transition: visibility linear 0.3s, opacity 0.3s linear;
}

.notification-show {
    visibility: visible;
    opacity: 1;
    transition: visibility 0s linear, opacity 0.3s linear;
}

.disable-clicks {
    pointer-events: none;
}

.birthday-message {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    background-color: #fff;
    padding: 10px 0;
}


.main-container {
    min-height: calc(100vh + 58.5px);  /* Use at least 100% of the viewport height */
    display: flex;
    flex-direction: column; /* Vertical stacking */
    justify-content: space-between; /* Stretch to occupy height */

}


.bottom-footer {
    text-align: center;
    background-color: #fff; /* Ensures visibility against any background */
    padding: 10px 0;
    width: 100%; /* Full width */
    position: sticky;
    bottom: 0; /* Stick to the bottom */
    box-shadow: 0 -2px 4px rgba(0,0,0,0.1); /* Visual separation from content */

}
.additional2-content {
    padding: 20px;
    text-align: center; /* Centers text and inline elements inside the div */
    background: #000000; /* Just for better visibility */
    color: #ffffff; /* Ensures text is visible against the dark background */
    width: 100%; /* Takes the full width to maintain consistent layout */
    display: flex; /* Using flex to center content */
    flex-direction: column; /* Stack children vertically */
    align-items: center; /* Center children horizontally */
    justify-content: center; /* Center children vertically */
}

@media (max-width: 600px) {
    .images-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); /* Adjust for smaller screens */
        margin-top: -10%;
        max-height: unset !important;
        grid-auto-rows: 60px !important;
        
    }
    .images-grid img {
      max-height: 75% !important;
    }
    
    .topheader, .time-left {
        padding: 5px;
    }
}

/*To avoid abrupt changes when resizing, consider adding CSS transitions to the grid elements and the game container:*/
.game-container, .images-grid img {
    transition: height 0.3s ease-in-out, width 0.3s ease-in-out;
    transition: border 0.1s;
}

#easy-button {
    padding: 10px 20px;
    font-size: 16px;
    color: white;
    background-color: green;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 10px;
}

#easy-button.disabled {
    background-color: lightgrey;
    cursor: not-allowed;
}

.result-button {

    padding: 10px 20px;
        font-size: 16px;
        color: white;
        border: none;
        border-radius: 5px;
        cursor: pointer;
        margin: 10px;
}
.result-button.share {
    background-color: green;
}
.result-button.replay {
    background-color: steelblue;
}


