/* Custom styles for the color match game */
body,
html {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: #f0f2f5;
    color: #1c1e21;
    /* --- NEW CSS FOR FLEXBOX LAYOUT --- */
    display: flex;
    /* Make body a flex container */
    flex-direction: column;
    /* Stack children vertically */
    min-height: 100vh;
    /* Ensure body takes full viewport height */
}

footer {
    /* Remove absolute positioning */
    /* position: absolute; */
    /* bottom: 0; */
    width: 100%;
    display: flex;
    justify-content: center;
    /* --- NEW CSS TO PUSH FOOTER TO THE BOTTOM --- */
    margin-top: auto;
    /* This pushes the footer to the bottom in a flex column */
}

.game-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    /* Remove fixed height, let margin auto handle spacing */
    /* height: 100%; */
    text-align: center;
    padding: 20px;
    /* --- NEW CSS TO CENTER THE GAME CONTAINER --- */
    margin: auto;
    /* This centers the container horizontally and vertically */
}

#color-word-display {
    font-size: 6rem;
    /* Slightly smaller for more button space */
    font-weight: 700;
    margin-bottom: 2.5rem;
    text-transform: uppercase;
    transition: transform 0.2s ease;
}

#button-container {
    display: grid;
    /* UPDATED: 3 columns for 9 buttons */
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    max-width: 700px;
    /* Adjusted max-width for 3 columns */
}

.color-btn {
    font-size: 1.2rem;
    /* Smaller font for more buttons */
    font-weight: 600;
    padding: 18px 8px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: transform 0.1s ease, box-shadow 0.2s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    /* Make text pop a bit */
}

.color-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

#score-display {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 2rem;
    font-weight: 700;
    color: #555;
}

#timer-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 8px;
    width: 100%;
    background-color: #0d6efd;
    transition: width 0.1s linear, background-color 0.5s;
}

/* Game Over Screen Styling */
#game-over-screen {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.final-score-text {
    font-size: 1.5rem;
    color: #555;
}

.final-score-value {
    font-size: 5rem;
    font-weight: 700;
    color: #0d6efd;
}

/* Animation for incorrect choice */
.shake {
    animation: shake 0.4s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-15px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(15px);
    }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    #button-container {
        /* On medium screens, stay at 3 columns */
        grid-template-columns: repeat(3, 1fr);
        max-width: 700px;
    }
}

@media (max-width: 768px) {
    #color-word-display {
        font-size: 3rem;
        margin-bottom: 2rem;
    }

    #button-container {
        /* Stack to 2 columns on smaller screens */
        grid-template-columns: repeat(2, 1fr);
        max-width: 500px;
    }

    .color-btn {
        font-size: 1rem;
        padding: 15px 8px;
    }

    #score-display {
        font-size: 1.5rem;
    }
}

.legal-text {
    color: #000000;
}