body {
    margin: 0;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background-color: #0d0d2a; /* Dark space background */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

#game-container {
    width: 90vw;
    max-width: 1200px;
    height: 70vh;
    max-height: 800px;
    background-image: url('background.png');
    background-size: cover;
    background-position: center;
    border-radius: 20px;
    box-shadow: 0 0 50px rgba(0, 200, 255, 0.5);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

#stars-display {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #fff;
    font-size: 1.8em;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    z-index: 10;
}

#professor-bubbles {
    position: absolute;
    top: 50px;
    right: 30px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    z-index: 5;
}

#professor-bubbles img {
    width: 100px;
    height: auto;
    animation: float 3s ease-in-out infinite;
}

#speech-bubble {
    background-color: #fff;
    border-radius: 20px;
    padding: 10px 15px;
    margin-top: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 250px;
    text-align: right;
    position: relative;
    font-size: 1.1em;
    color: #333;
}

#speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid #fff;
}

#rocket-area {
    position: absolute;
    bottom: 50px;
    left: 0;
    width: 100%;
    height: 150px; /* Adjust based on rocket image size */
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 5%; /* Starting position */
    box-sizing: border-box;
}

#rocket {
    width: 150px;
    height: auto;
    position: relative;
    transition: transform 1s ease-out; /* Smooth rocket movement */
    z-index: 3;
    left: var(--rocket-progress, 0%); /* Custom property for movement */
}

#sparkles-container {
    position: absolute;
    left: var(--rocket-progress, 0%);
    width: 100px; /* Size of sparkle area */
    height: 100px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    overflow: hidden;
    z-index: 4;
}

.sparkle {
    position: absolute;
    background-color: yellow;
    border-radius: 50%;
    opacity: 0;
    animation: sparkle-grow-fade 1s forwards;
}

@keyframes sparkle-grow-fade {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}


#quiz-area {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 25px 35px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 700px;
    width: 80%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
}

#question-text {
    color: #333;
    font-size: 1.8em;
    margin-bottom: 20px;
}

#options-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.option-button {
    background-color: #4CAF50; /* Green */
    color: white;
    padding: 15px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.option-button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

.option-button:active {
    transform: translateY(0);
}

.option-button.correct {
    background-color: #28a745; /* Darker green for correct */
    box-shadow: 0 0 15px rgba(40, 167, 69, 0.7);
}

.option-button.wrong {
    background-color: #dc3545; /* Red for wrong */
    animation: shake 0.3s forwards;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

#game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    z-index: 100;
}

#game-over-screen h2 {
    font-size: 3em;
    margin-bottom: 20px;
    color: #ffd700; /* Gold color */
}

#game-over-screen p {
    font-size: 1.5em;
    margin-bottom: 30px;
}

#target-planet {
    width: 250px;
    height: auto;
    margin-bottom: 20px;
    animation: rotate 10s linear infinite;
}

#aliens {
    width: 180px;
    height: auto;
    margin-top: -50px; /* Overlap with planet */
    animation: bounce 1s ease-in-out infinite alternate;
}

#restart-button {
    background-color: #007bff; /* Blue */
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.5em;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#restart-button:hover {
    background-color: #0056b3;
}

.hidden {
    display: none !important;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #game-container {
        width: 95vw;
        height: 85vh;
        padding: 10px;
    }

    #stars-display {
        font-size: 1.5em;
        top: 10px;
        left: 10px;
    }

    #professor-bubbles {
        top: 20px;
        right: 10px;
    }

    #professor-bubbles img {
        width: 80px;
    }

    #speech-bubble {
        max-width: 200px;
        font-size: 1em;
        padding: 8px 12px;
    }

    #rocket {
        width: 120px;
    }

    #quiz-area {
        width: 90%;
        padding: 20px;
    }

    #question-text {
        font-size: 1.5em;
    }

    .option-button {
        padding: 12px 20px;
        font-size: 1em;
    }

    #game-over-screen h2 {
        font-size: 2em;
    }

    #game-over-screen p {
        font-size: 1.2em;
    }

    #target-planet {
        width: 180px;
    }

    #aliens {
        width: 120px;
    }

    #restart-button {
        font-size: 1.2em;
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    #quiz-area {
        width: 95%;
        padding: 15px;
    }

    #question-text {
        font-size: 1.3em;
    }

    .option-button {
        font-size: 0.9em;
        padding: 10px 15px;
    }

    #game-over-screen h2 {
        font-size: 1.5em;
    }

    #game-over-screen p {
        font-size: 1em;
    }
}

