/* General Setup */
html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background-color: #000010;
    font-family: 'Press+Start+2P', cursive;
    color: white;
}

#game-world {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Dynamic Parallax Background */
#stars1, #stars2 {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('https://www.transparenttextures.com/patterns/stardust.png');
}
#stars1 { animation: moveStars 20s linear infinite; } /* Slower stars */
#stars2 { animation: moveStars 10s linear infinite; opacity: 0.5; } /* Faster stars */
@keyframes moveStars { from { background-position-x: 0; } to { background-position-x: -1000px; } }

/* Title and Footer */
#title {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: #FEFF86;
    text-shadow: 3px 3px #FF0000;
    font-size: 2.5em;
    z-index: 10;
}
footer {
    position: absolute;
    bottom: 10px;
    width: 100%;
    text-align: center;
    font-size: 0.8em;
    color: #888;
}

/* HUD (Level and Jumps) */
#hud {
    position: absolute;
    top: 30px;
    left: 30px;
    right: 30px;
    display: flex;
    justify-content: space-between;
    font-size: 1.5em;
    z-index: 10;
    color: #fff;
    text-shadow: 2px 2px #000;
}

/* Player (Rocket) */
#player {
    position: absolute;
    bottom: 5vh; /* Position based on screen height */
    left: 10vw; /* Position based on screen width */
    width: 60px;
    height: 80px;
    background-color: #42EADD;
    box-shadow: 0 0 20px #42EADD;
    border-radius: 50% 50% 0 0;
}
.flame {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 30px;
    background: linear-gradient(#f0a500, #e74c3c);
    border-radius: 0 0 50% 50%;
    animation: flicker 0.1s linear infinite;
}
@keyframes flicker {
    0%, 100% { height: 30px; opacity: 1; }
    50% { height: 25px; opacity: 0.8; }
}

.animateJump { animation: jump 0.6s ease-out; }
@keyframes jump {
    0% { transform: translateY(0); }
    50% { transform: translateY(-25vh); } /* Jump height relative to screen */
    100% { transform: translateY(0); }
}


/* Obstacles */
.obstacle {
    position: absolute;
    bottom: 5vh;
    animation-name: moveObstacle;
    animation-timing-function: linear;
    animation-iteration-count: 1;
}
@keyframes moveObstacle { from { left: 100vw; } to { left: -100px; } }

.obstacle-asteroid { width: 50px; height: 80px; background-color: #FF6666; border-radius: 30% 70% 40% 60%; }
.obstacle-satellite { width: 80px; height: 40px; background-color: #cccccc; }
.obstacle-alien { width: 60px; height: 60px; background-color: #90EE90; border-radius: 50% 50% 10px 10px; }

/* Popups and Instructions */
#instructions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.2em;
    color: #aaa;
    transition: opacity 1s;
}
.popup {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9); padding: 40px 60px;
    border-radius: 10px; border: 3px solid white; z-index: 100;
    font-size: 1.2em;
}
.popup button {
    padding: 15px 30px; font-size: 1.2em; cursor: pointer; border: none;
    background: #FEFF86; color: black; font-family: 'Press Start 2P', cursive; margin-top: 20px;
}
.hidden { display: none; }