body {
    font-family: sans-serif;
    padding: 0;
    margin: 0;
    background-color: #000;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

#background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at bottom, #0a192f 0%, #021e3d 100%);
    z-index: -1;
}

.star {
    position: absolute;
    width: 1px;
    height: 1px;
    background: white;
    border-radius: 50%;
    animation: twinkle 2s infinite alternate;
}

@keyframes twinkle {
    from {
        opacity: 0.6;
    }
    to {
        opacity: 1;
    }
}

.spaceship-container {
    width: 200px;
    height: 200px;
    position: relative;
    transform-style: preserve-3d;
}

.spaceship {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    animation: rotateSpaceship 20s linear infinite;
    transform-origin: center center;
}

.spaceship-body {
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #555, #888);
    border-radius: 50% / 10%;
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.2),
                inset 0 -1px 2px rgba(0, 0, 0, 0.3),
                0 0 20px rgba(255, 255, 255, 0.1);
    position: relative;
    clip-path: polygon(0% 0%, 100% 0%, 85% 100%, 15% 100%);
    overflow: hidden; /* To contain panels within the body */
}

.spaceship-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent 40%, rgba(0,0,0,0.1) 60%, transparent 80%);
    pointer-events: none; /* Make sure it doesn't interfere with clicks */
}

.spaceship-panel {
    position: absolute;
    background: rgba(30, 30, 30, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3) inset;
}

.spaceship-panel-1 {
    top: 15%;
    left: 10%;
    width: 80%;
    height: 15%;
    border-radius: 3px;
}

.spaceship-panel-2 {
    top: 40%;
    left: 5%;
    width: 40%;
    height: 10%;
    border-radius: 2px;
}

.spaceship-panel-3 {
    top: 40%;
    right: 5%;
    width: 40%;
    height: 10%;
    border-radius: 2px;
}

.spaceship-panel-4 {
    bottom: 15%;
    left: 20%;
    width: 15%;
    height: 10%;
    border-radius: 50%;
}

.spaceship-panel-5 {
    bottom: 15%;
    right: 20%;
    width: 15%;
    height: 10%;
    border-radius: 50%;
}


.cockpit {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 30%;
    height: 12%;
    background: linear-gradient(to bottom, #77b1be, #2a7faf);
    border-radius: 50% / 15%;
    box-shadow: 0 0 10px rgba(0, 150, 200, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.cockpit::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 80%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50% / 15%;
}

.engine-container {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%; /* Wider engine container */
    height: 35%; /* Slightly taller engine container */
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.engine-nozzle {
    width: 45%;
    height: 70%; /* Taller nozzles */
    background: linear-gradient(to bottom, #333, #111);
    border-radius: 5px 5px 0 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.8) inset;
}

.engine-nozzle::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 10%;
    width: 80%;
    height: 60%;
    background: radial-gradient(circle at center, #ffaa00, #ff4400, transparent);
    filter: blur(7px); /* Increased blur for more glow */
    opacity: 0.9; /* Increased opacity for brighter glow */
}

.engine-nozzle::after {
    content: '';
    position: absolute;
    bottom: 5%;
    left: 20%;
    width: 60%;
    height: 20%;
    background: rgba(255, 255, 255, 0.15); /* Slightly brighter highlight */
    border-radius: 50%;
    filter: blur(2px); /* Increased blur for softer highlight */
}

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

/* Controls Styling */
.controls-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.rotation-button {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    background-color: #555;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.rotation-button:hover {
    background-color: #777;
}

.rotation-button:active {
    background-color: #444;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .spaceship-container {
        width: 150px;
        height: 150px;
    }

    .controls-container {
        bottom: 10px;
    }

    .rotation-button {
        padding: 8px 12px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .spaceship-container {
        width: 120px;
        height: 120px;
    }
    .controls-container {
        flex-direction: column;
        align-items: center;
        gap: 5px;
    }
}