body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif;
    margin: 0;
    background-color: #f0f8ff;
}
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-in-out, visibility 0.5s;
}
.hidden {
    opacity: 0;
    visibility: hidden;
}
.game-container {
    text-align: center;
    background-color: #ffffff;
    padding: 40px;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
#challenge-area h1 {
    font-size: 4rem;
    color: #333;
    margin: 10px 0;
}
#challenge-area img, #animation-area img {
    max-width: 200px;
    max-height: 200px;
    margin-top: 20px;
    min-height: 200px;
}
#mic-button {
    background-color: #ff4757;
    border: none;
    border-radius: 50%;
    width: 100px;
    height: 100px;
    cursor: pointer;
    margin-top: 30px;
    color: white;
    box-shadow: 0 5px 15px rgba(255, 71, 87, 0.5);
    transition: transform 0.2s;
}
#mic-button:hover {
    transform: scale(1.1);
}
#mic-button.is-listening {
    animation: pulse 2s infinite;
}
#status-text {
    margin-top: 20px;
    font-size: 1.2rem;
    color: #576574;
    min-height: 1.5rem;
}
#next-button {
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 15px 30px;
    font-size: 1.2rem;
    font-family: inherit;
    cursor: pointer;
    margin-top: 20px;
    transition: background-color 0.2s;
}
#next-button:hover {
    background-color: #27ae60;
}
#start-screen img {
    max-width: 300px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
#play-button {
    background-color: #007bff;
    color: white;
    font-size: 1.5rem;
    font-family: inherit;
    padding: 15px 50px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(0, 123, 255, 0.4);
    transition: transform 0.2s;
}
#play-button:hover {
    transform: scale(1.05);
}
#final-celebration-screen {
    background-color: #2c3e50;
    color: white;
}
#final-celebration-screen h2 {
    font-size: 4rem;
    margin-bottom: 10px;
}
#quote-display {
    font-size: 1.2rem;
    font-style: italic;
    max-width: 400px;
    margin: 20px;
}
#play-again-button {
    background-color: #f39c12;
    color: white;
    font-size: 1.5rem;
    padding: 15px 50px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 30px;
    transition: transform 0.2s;
}
#play-again-button:hover {
    transform: scale(1.05);
}
.fireworks {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}
.fireworks .before, .fireworks .after {
    content: '';
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    box-shadow: -120px -218.67px #00ff40, 248px -16.67px #00ff40, 190px 16.33px #00ff40, -113px -308.67px #ff0040, -109px -287.67px #ff0040, -52px -142.67px #ff0040, -53px -177.67px #ff00bf, 314px -308.67px #ff00bf, -9px -267.67px #ff00bf, -44px -212.67px #ff00bf, 150px -215.67px #00ffbf, 81px -203.67px #00ffbf, -154px -112.67px #00ffbf, -107px -310.67px #00ffbf, -106px -135.67px #00ffbf, -91px -172.67px #00ffbf, -35px -300.67px #00ffbf;
    animation: firework 2s infinite;
}
.fireworks .after {
    animation-delay: 1s;
    position: absolute;
    left: 50%;
    top: 50%;
}
@keyframes firework {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(3); opacity: 0; }
}

@media (max-width: 600px) {

    /* Make the main game card have less padding on small screens */
    .game-container {
        padding: 20px;
    }

    /* Make the main word smaller */
    #challenge-area h1 {
        font-size: 2.5rem;
    }

    /* Make the images slightly smaller */
    #challenge-area img, #animation-area img {
        max-width: 150px;
        min-height: 150px;
    }

    /* Make the microphone button smaller */
    #mic-button {
        width: 80px;
        height: 80px;
        margin-top: 20px;
    }

    /* Adjust status text size */
    #status-text {
        font-size: 1rem;
    }
    
    /* Adjust 'Next Word' and 'Play Again' buttons */
    #next-button, #play-again-button {
        font-size: 1rem;
        padding: 12px 24px;
    }

    /* Make the logo on the start screen a bit smaller */
    #start-screen img {
        max-width: 200px;
    }

    /* Make the final celebration text smaller */
    #final-celebration-screen h2 {
        font-size: 3rem;
    }

    #quote-display {
        font-size: 1rem;
    }
}