/* Importing Childlike Font */
@import url('https://fonts.googleapis.com/css2?family=Comic+Neue:wght@400;700&display=swap');

/* General Styling */
body, html {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ff8a80, #ffeb3b);
}

/* Particle Background */
#particles-js {
    position: fixed;
    width: 100%;
    height: 100%;
    z-index: -3;
    top: 0;
    left: 0;
}

/* Vignette Overlay */
#vignette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.1) 60%, rgba(0, 0, 0, 0.6) 100%);
    z-index: -2;
}

/* Static Background with Glassy Effect */
#parallax-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://via.placeholder.com/1920x1080.webp?text=Number_Safari') center/cover no-repeat;
    z-index: -1;
    filter: blur(10px) brightness(0.7);
}

/* Game Container */
#game-container {
    width: 95%;
    max-width: 1200px;
    height: 90%;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* Top Bar (Glass Bar) */
#glass-bar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(15px);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    font-size: 1.5rem;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#glass-bar #player-stats span {
    margin-right: 15px;
    font-size: 1.8rem;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

#glass-bar #controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Controls Styling */
#controls button {
    font-size: 1.5rem;
    padding: 10px 15px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.6);
    color: #333; /* Ensure emoji color contrasts with background */
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

#controls button:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.9);
}

#controls input[type="range"] {
    width: 150px;
    cursor: pointer;
    -webkit-appearance: none;
    background: #ccc;
    height: 5px;
    border-radius: 5px;
    outline: none;
    transition: background 0.3s;
}

#controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff5722;
    cursor: pointer;
    transition: background 0.3s;
}

#controls input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff5722;
    cursor: pointer;
    transition: background 0.3s;
}

/* Header */
header {
    padding: 20px;
    text-align: center;
    background: linear-gradient(90deg, #ff5722, #4caf50);
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
    font-size: 2.5rem;
    border-radius: 20px 20px 0 0;
    position: relative;
    z-index: 1;
}

header p {
    margin: 10px 0 0 0;
    font-size: 1.5rem;
    color: #ffeb3b;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* Game Area */
#game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Scene Area */
#scene {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: white;
    text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5);
    border-radius: 20px;
    margin: 20px;
    background: linear-gradient(135deg, #4caf50, #ffeb3b);
    width: 100%;
    max-height: 300px;
    overflow: auto;
    position: relative;
}

/* Animal Emoji Styling */
.animal {
    font-size: 3rem;
    margin: 10px;
    transition: transform 0.3s;
    cursor: pointer;
}

.animal:hover {
    transform: scale(1.2);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

/* Question Area */
#question-area {
    text-align: center;
    padding: 20px;
    font-size: 2.5rem;
    color: #ff5722;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
}

/* Answers Area */
#answers {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
}

#answers button {
    padding: 20px 40px;
    font-size: 2rem;
    border: none;
    border-radius: 15px;
    background: linear-gradient(135deg, #ff8a80, #80d8ff);
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, background 0.3s, box-shadow 0.3s;
    min-width: 120px;
    max-width: 200px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#answers button:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #ff5252, #40c4ff);
    box-shadow: 0 6px 10px rgba(0,0,0,0.3);
}

/* Footer */
footer {
    padding: 10px;
    font-size: 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    color: white;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.3);
    border-radius: 0 0 20px 20px;
    text-align: center;
}

/* End Screen */
#end-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    border-radius: 20px;
    z-index: 2;
    transition: opacity 0.5s ease;
    opacity: 0;
    pointer-events: none;
}

#end-screen.visible {
    opacity: 1;
    pointer-events: all;
}

#end-screen h2 {
    font-size: 3rem;
    margin-bottom: 20px;
}

#end-screen p {
    font-size: 2rem;
    margin-bottom: 30px;
}

#end-screen button {
    font-size: 2rem;
    padding: 15px 40px;
    background: linear-gradient(135deg, #76ff03, #00e5ff);
    border: none;
    border-radius: 10px;
    color: white;
    cursor: pointer;
    transition: transform 0.3s, background 0.3s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

#end-screen button:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #00e5ff, #76ff03);
    box-shadow: 0 6px 10px rgba(0,0,0,0.4);
}

/* Confetti Celebration */
.celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 9999;
}

.celebration div {
    position: absolute;
    width: 15px;
    height: 15px;
    background: linear-gradient(45deg, #ffeb3b, #ff5722);
    border-radius: 50%;
    animation: confetti 2s ease-in-out infinite;
}

@keyframes confetti {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Help Button Styling */
#help-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
    transition: transform 0.2s, background 0.2s;
    z-index: 1001;
}

#help-button:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.9);
}

#help-button i {
    font-size: 1.5rem;
    color: #333; /* Ensure emoji color contrasts with background */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    #glass-bar {
        flex-direction: column;
        align-items: flex-start;
        height: auto;
    }

    #glass-bar #player-stats span {
        margin-right: 0;
        margin-bottom: 10px;
        font-size: 1.5rem;
    }

    #controls button {
        font-size: 1.2rem;
        padding: 8px 12px;
    }

    #controls input[type="range"] {
        width: 100px;
    }

    header {
        font-size: 2rem;
    }

    header p {
        font-size: 1.2rem;
    }

    #game-area {
        padding: 10px;
    }

    #scene {
        max-height: 200px;
        font-size: 3rem;
    }

    #question-area {
        font-size: 2rem;
    }

    #answers button {
        padding: 20px 30px;
        font-size: 2rem;
        min-width: 100px;
        max-width: 150px;
        height: 80px;
    }

    footer {
        font-size: 1.2rem;
    }

    #end-screen h2 {
        font-size: 2.5rem;
    }

    #end-screen p {
        font-size: 1.8rem;
    }

    #end-screen button {
        font-size: 1.8rem;
        padding: 10px 30px;
    }
}

/* Additional Media Query for Smaller Screens */
@media (max-width: 480px) {
    header {
        font-size: 1.8rem;
    }

    header p {
        font-size: 1rem;
    }

    #glass-bar {
        padding: 10px;
    }

    #glass-bar #player-stats span {
        font-size: 1.3rem;
    }

    #controls button {
        font-size: 1rem;
        padding: 6px 10px;
    }

    #controls input[type="range"] {
        width: 80px;
    }

    #scene {
        font-size: 2.5rem;
    }

    #question-area {
        font-size: 1.8rem;
    }

    #answers button {
        padding: 15px 25px;
        font-size: 1.8rem;
        min-width: 80px;
        max-width: 120px;
        height: 60px;
    }

    #help-button {
        padding: 10px;
    }

    #help-button i {
        font-size: 1.2rem;
    }
}

/* Optional: Enhance Emoji Appearance */
button {
    font-size: 1.5rem; /* Adjust as needed */
}
