* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    background: radial-gradient(ellipse at center, #5a3d7a 0%, #3d2463 50%, #1a0b2e 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.space-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%);
    overflow: hidden;
}

.stars-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.layer-1 {
    background-image:
        radial-gradient(1px 1px at 25px 5px, white, transparent),
        radial-gradient(1px 1px at 50px 25px, white, transparent),
        radial-gradient(1px 1px at 125px 20px, white, transparent),
        radial-gradient(1.5px 1.5px at 200px 50px, white, transparent),
        radial-gradient(1px 1px at 100px 80px, white, transparent),
        radial-gradient(1px 1px at 250px 10px, white, transparent);
    background-size: 350px 350px;
    opacity: 0.6;
    animation: moveStars1 35s linear infinite;
}

.layer-2 {
    background-image:
        radial-gradient(2px 2px at 15px 15px, white, transparent),
        radial-gradient(2px 2px at 150px 55px, white, transparent),
        radial-gradient(2px 2px at 80px 120px, white, transparent),
        radial-gradient(2px 2px at 220px 180px, white, transparent);
    background-size: 450px 450px;
    opacity: 0.8;
    animation: moveStars2 27s linear infinite;
}

.layer-3 {
    background-image:
        radial-gradient(3px 3px at 40px 40px, white, transparent),
        radial-gradient(3px 3px at 180px 90px, white, transparent),
        radial-gradient(3px 3px at 300px 200px, white, transparent);
    background-size: 550px 550px;
    animation: moveStars3 22s linear infinite;
}

.nebula-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 50% 50%, rgba(76, 29, 149, 0.2), transparent 40%),
        radial-gradient(circle at 20% 80%, rgba(15, 118, 110, 0.2), transparent 30%);
    filter: blur(20px);
    animation: pulseNebula 10s ease-in-out infinite alternate;
}

@keyframes moveStars1 {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 350px 0;
    }
}

@keyframes moveStars2 {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 450px 0;
    }
}

@keyframes moveStars3 {
    from {
        background-position: 0 0;
    }

    to {
        background-position: 550px 0;
    }
}

@keyframes pulseNebula {
    0% {
        opacity: 0.5;
        transform: scale(1);
    }

    100% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* Stars Progress Bar */
/* Centered UI Wrapper */
.ui-center-group {
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 60px;
    width: 100%;
    z-index: 150;
}

/* Stars Progress Bar */
.stars-container {
    display: flex;
    gap: 15px;
}

.star {
    width: 50px;
    height: 50px;
    object-fit: contain;
    opacity: 0.3;
    filter: grayscale(100%);
    transition: all 0.3s ease;
}

.star.filled {
    opacity: 1;
    filter: grayscale(0%) drop-shadow(0 0 10px #FFD700);
    animation: starPulse 0.5s ease;
}

.wrong.filled {
    opacity: 0.6;
    filter: grayscale(50%);
    transform: scale(1.1);
}

.star.half-filled {
    opacity: 0.6;

    transform: scale(1.1);
}

@keyframes starPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }
}

/* Question Box */
/* Question Box */
.question-box {
    position: relative;
    width: 70%;
    background: linear-gradient(135deg, #7B3FF2 0%, #9D5FFF 100%);
    border: 8px solid white;
    border-radius: 25px;
    padding: 30px 70px;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.question-text {
    font-size: 45px;
    font-weight: bold;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.ufo-left,
.ufo-right {
    position: absolute;
    font-size: 80px;
    top: 50%;
    transform: translateY(-50%);
    animation: ufoFloat 2s ease-in-out infinite;
}

.ufo-left {
    left: -30px;
}

.ufo-right {
    right: -30px;
}

@keyframes ufoFloat {

    0%,
    100% {
        transform: translateY(-50%) rotate(-5deg);
    }

    50% {
        transform: translateY(-60%) rotate(5deg);
    }
}

/* Game Screen */
.game-screen {
    width: 100%;
    height: 100%;
    position: relative;
    /* background removed to show space-background */
}

/* Planets */
/* Background Planets */

.bg-planet {
    position: absolute;
    width: 120px;
    height: 120px;
    opacity: 0.8;
}

.bg-planet {
    position: absolute;
    border-radius: 50%;
    z-index: 1;
    opacity: 0.8;

}

.planet-1 {
    width: 220px;
    height: 220px;

    top: 35%;
    left: -200px;
    animation: planetFloat1 60s linear infinite;
    animation-delay: -20s;
}

.planet-2 {
    width: 300px;
    height: 300px;

    top: 50%;
    left: -100px;
    animation: planetFloat2 60s linear infinite;
    animation-delay: -40s;
}

.planet-3 {
    width: 150px;
    height: 150px;

    top: 5%;
    left: -250px;
    animation: planetFloat3 60s linear infinite;
    animation-delay: 0s;
    opacity: 0.6;
}

@keyframes planetFloat1 {
    0% {
        transform: translateX(0) rotate(0deg);
    }

    100% {
        transform: translateX(calc(100vw + 300px)) rotate(120deg);
    }
}

@keyframes planetFloat2 {
    0% {
        transform: translateX(0) rotate(0deg);
    }

    100% {
        transform: translateX(calc(100vw + 200px)) rotate(-180deg);
    }
}

@keyframes planetFloat3 {
    0% {
        transform: translateX(0) rotate(0deg);
    }

    100% {
        transform: translateX(calc(100vw + 400px)) rotate(60deg);
    }
}

.planet-main {
    position: absolute;
    width: 150vw;
    height: 100vw;
    /* Use the user's texture only, blended with nothing */
    background: url("images/planet_texture.jpg") no-repeat center bottom;
    background-size: 100% 100%;
    border-radius: 50% 50% 0 0;
    bottom: -85vw;
    left: 50%;
    transform: translateX(-50%);
    box-shadow:
        inset 0 20px 50px rgba(255, 255, 255, 0.2),
        inset 0 -50px 100px rgba(0, 0, 0, 0.7),
        0 -10px 50px rgba(0, 0, 0, 0.5);
    z-index: 10;
    transition: bottom 0.4s ease-in-out, background 0.4s ease-in-out, left 0.4s ease-in-out, transform 0.4s ease-in-out;
}

/* Transition States */
.planet-hidden {
    bottom: -200vw !important;
}

/* Horizontal: Exit Right (shrink), Enter Left (grow) */
.planet-exit-horizontal {
    left: 150% !important;
    transform: translateX(-50%) scale(0) !important;
    bottom: -85vw !important;
}

.planet-enter-horizontal {
    left: -50% !important;
    transform: translateX(-50%) scale(0) !important;
    bottom: -85vw !important;
}

/* Diagonal: Exit Top-Left, Enter Top-Right */
.planet-exit-diagonal {
    left: -50% !important;
    bottom: 50vh !important;
    transform: translateX(-50%) scale(0.5) !important;
}

.planet-enter-diagonal {
    left: 150% !important;
    bottom: 50vh !important;
    transform: translateX(-50%) scale(0.5) !important;
}

.planet-main::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50% 50% 0 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.4) 100%);
    /* Shadow overlay */
    pointer-events: none;
}

/* Planet Color Variations (Using 8 different textures) */
.planet-color-1 {
    background: url("images/planet_texture1.jpg") no-repeat center bottom;
    background-size: 100% 100%;
    /* Fit entire image */
    background-blend-mode: normal;
}

.planet-color-2 {
    background: url("images/planet_texture2.jpg") no-repeat center bottom;
    background-size: 100% 100%;
    background-blend-mode: normal;
}

.planet-color-3 {
    background: url("images/planet_texture3.jpg") no-repeat center bottom;
    background-size: 100% 100%;
    background-blend-mode: normal;
}

.planet-color-4 {
    background: url("images/planet_texture4.jpg") no-repeat center bottom;
    background-size: 100% 100%;
    background-blend-mode: normal;
}

.planet-color-5 {
    background: url("images/planet_texture5.jpg") no-repeat center bottom;
    background-size: 100% 100%;
    background-blend-mode: normal;
}

.planet-color-6 {
    background: url("images/planet_texture6.jpg") no-repeat center bottom;
    background-size: 100% 100%;
    background-blend-mode: normal;
}

.planet-color-7 {
    background: url("images/planet_texture7.jpg") no-repeat center bottom;
    background-size: 100% 100%;
    background-blend-mode: normal;
}

.planet-color-8 {
    background: url("images/planet_texture8.jpg") no-repeat center bottom;
    background-size: 100% 100%;
    background-blend-mode: normal;
}

/* Options Container */
/* Options Container */
.options-container {
    margin-top: 10px;
    position: relative;
    display: flex;
    gap: 500px;
}

.option-card {
    width: 320px;
    height: 220px;
    background: white;
    border: 10px solid #FF8C42;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
}

.option-card::before {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: #FFD700;
    border-radius: 50%;
    top: -15px;
    left: 20px;
}

.option-card::after {
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    background: #FFD700;
    border-radius: 50%;
    top: -15px;
    right: 20px;
}

.option-card:hover {
    transform: scale(1.05);
    border-color: #FFD700;
}

.option-card.correct {
    border-color: #4CAF50;
    animation: correctPulse 0.5s ease;
}

.option-card.wrong {
    border-color: #F44336;
    animation: wrongShake 0.5s ease;
}

.option-card.disabled {
    pointer-events: none;
    opacity: 1;
}

.option-card img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

@keyframes correctPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes wrongShake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-10px);
    }

    75% {
        transform: translateX(10px);
    }
}

/* Cat Character */
.cat-container {
    position: absolute;
    bottom: 7vw;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
}

.cat-character {
    width: 300px;
    height: 300px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
    animation: catBounce 2s ease-in-out infinite;
}

.cat-character.animate-cat-hit {
    animation: catHitShake 0.5s ease-in-out;
}

@keyframes catBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes catHitShake {

    0%,
    100% {
        transform: translateX(0) rotate(0deg);
    }

    10%,
    90% {
        transform: translateX(-5px) rotate(-5deg);
    }

    20%,
    80% {
        transform: translateX(5px) rotate(5deg);
    }

    30%,
    50%,
    70% {
        transform: translateX(-5px) rotate(-5deg);
    }

    40%,
    60% {
        transform: translateX(5px) rotate(5deg);
    }
}

/* Hammer Animation */
.hammer {
    position: absolute;
    width: 180px;
    /* Increased size from 120px */
    height: auto;
    top: -70px;
    /* Adjusted position for larger size */
    right: -40px;
    /* Adjusted position for larger size */
    transform-origin: bottom right;
    transform: rotate(45deg);
    opacity: 0;
    z-index: 20;
    pointer-events: none;
}

.hammer.animate-hammer {
    opacity: 1;
    animation: hammerStrike 0.8s ease-in-out forwards;
}

@keyframes hammerStrike {
    0% {
        transform: rotate(45deg);
    }

    10% {
        transform: rotate(45deg);
    }

    30% {
        transform: rotate(-20deg) translate(-20px, 40px);
        /* Strike */
    }

    50% {
        transform: rotate(-20deg) translate(-20px, 40px);
        /* Hold */
    }

    100% {
        transform: rotate(45deg);
        opacity: 0;
    }
}

/* Feedback Overlay */
/* Feedback Overlay */
.feedback-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 3000;
}

.feedback-overlay.show {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.feedback-content {
    text-align: center;
    animation: feedbackPop 0.5s ease;
}

.ufo-feedback {
    font-size: 100px;
    margin-bottom: 20px;
    animation: ufoSpin 1s ease-in-out;
}

@keyframes ufoSpin {
    0% {
        transform: rotate(0deg) scale(0);
    }

    50% {
        transform: rotate(180deg) scale(1.2);
    }

    100% {
        transform: rotate(360deg) scale(1);
    }
}

.feedback-text {
    animation: gradientShift 2s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes feedbackPop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Game Over Screen */
.game-over-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Transparent background to show sky/stars */
    background: transparent;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
    gap: 20px;
    /* Space between elements */
}

.game-over-screen.show {
    display: flex;
    animation: fadeIn 0.5s ease;
}

.stars-final-container {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    animation: starsArc 1s ease;
}

@keyframes starsArc {
    0% {
        transform: translateY(-100px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.star-final {
    width: 60px;
    height: 60px;
    object-fit: contain;
    opacity: 0.3;
    filter: grayscale(100%);
    transition: all 0.3s ease;
}

.star-final.filled {
    opacity: 1;
    filter: grayscale(0%) drop-shadow(0 0 20px #FFD700);
}

.cat-final {
    display: block;
    width: 150px;
    height: 150px;
    margin: 20px 0;
    animation: catFinalBounce 1s ease infinite;
}



@keyframes catFinalBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.score-box {
    background: white;
    border: 5px solid #7B3FF2;
    border-radius: 20px;
    padding: 15px 40px;
    margin-bottom: 10px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    /* Single line */
    align-items: center;
    gap: 15px;
}

.score-label {
    font-size: 28px;
    font-weight: bold;
    color: #7B3FF2;
    text-transform: capitalize;
}

.score-label::after {
    content: ":";
}

.score-value {
    font-size: 40px;
    /* Slightly smaller to fit line */
    font-weight: bold;
    color: #7B3FF2;
    line-height: 1;
}

.buttons-container {
    display: flex;
    gap: 40px;
    margin-top: 10px;
}

.game-button {
    width: 100px;
    /* Slightly smaller */
    height: 100px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;

}

.game-button:hover {
    transform: scale(1.1);
}

.button-icon {
    font-size: 50px;
}



/* Responsive adjustments */
/* Tablet & Large Phone (up to 1024px) */
@media (max-width: 1024px) {
    .question-box {
        width: 85%;
        padding: 25px;
    }

    .question-text {
        font-size: 30px;
        /* Reduced from 45px */
    }

    .ufo-left,
    .ufo-right {
        font-size: 50px;
        /* Reduced from 80px */
    }

    .options-container {
        gap: 20px;
        flex-direction: row;
        flex-wrap: wrap;
        margin-top: 30px;
        justify-content: center;
        width: 100%;
        padding: 0;
    }

    .option-card {
        width: 40%;
        /* Side-by-side */
        max-width: 300px;
        height: 200px;
        flex: initial;
        /* Reset flex if set */
    }

    .cat-character {
        width: 220px;
        height: 220px;
    }

    .cat-container {
        bottom: 10vw;
    }

    .planet-main {
        width: 140vw;
        height: 100vw;
        bottom: -80vw;
    }

    .score-value {
        font-size: 50px;
    }

    .game-button {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .ui-center-group {
        gap: 20px;
        /* Reduced gap significantly */
    }

    .stars-container .star {
        width: 30px;
        height: 30px;
    }

    .question-base {
        padding: 15px;
    }

    .question-text {
        font-size: 16px;
        /* Smaller font */
    }

    .ufo-left,
    .ufo-right {
        font-size: 25px;
        /* Smaller UFOs */
        left: -15px;
        /* Adjust position */
    }

    .ufo-right {
        right: -15px;
        left: auto;
    }

    .question-box {
        padding: 10px 20px;
        border-width: 4px;
    }

    .options-container {
        gap: 10px;
        margin-top: 10px;
    }

    .option-card {
        width: 130px;
        height: 100px;
        border-width: 4px;
        border-radius: 10px;
    }

    .option-card::before,
    .option-card::after {
        width: 15px;
        height: 15px;
        top: -8px;
        left: 8px;
    }

    .option-card::after {
        left: auto;
        right: 8px;
    }

    .cat-character {
        width: 140px;
        height: 140px;
    }

    .hammer {
        width: 80px;
        top: -30px;
        right: -10px;
    }

    .cat-final {
        width: 120px;
        height: 120px;
    }

    .score-value {
        font-size: 35px;
    }

    .game-button {
        width: 60px;
        height: 60px;
    }
}

/* Warp Speed Effect - handled via JS playbackRate */
.space-background.warp-speed .bg-planet,
.space-background.warp-speed .stars-layer {
    filter: blur(2px);
    /* Slight blur for speed feel */
    transition: filter 0.2s ease;
}