body, html {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background-color: #f0f2f5;
    color: #1c1e21;
    /* --- NEW CSS FOR FLEXBOX LAYOUT --- */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

footer {
    /* No position properties needed */
    width: 100%;
    display: flex;
    justify-content: center;
    /* --- NEW CSS TO PUSH FOOTER TO THE BOTTOM --- */
    margin-top: auto;
}

.game-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    /* --- NEW CSS TO CENTER THE GAME CONTAINER --- */
    margin: auto;
}

/* Other styles remain unchanged */

#number-display {
    font-size: 8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    margin-bottom: 2rem;
    color: #333;
    transition: transform 0.1s ease-in-out;
}

#user-input {
    font-family: 'Roboto Mono', monospace;
    font-size: 3rem;
    text-align: center;
    border: none;
    border-bottom: 4px solid #ccc;
    background-color: transparent;
    width: 100%;
    max-width: 500px;
    outline: none;
    padding: 10px;
    transition: border-color 0.3s;
}

#user-input:focus {
    border-bottom-color: #0d6efd;
}

#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 input */
.shake {
    animation: shake 0.5s;
}

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

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

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

/* Responsive font sizes */
@media (max-width: 768px) {
    #number-display {
        font-size: 5rem;
    }

    #user-input {
        font-size: 2rem;
    }

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

.legal-text {
    color: #000000;
}