* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Orbitron', sans-serif;
    background-color: #000;
    color: #0ff;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: #000;
    overflow: hidden;
}

#starfield {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 20px;
    z-index: 100;
    text-shadow: 0 0 10px #0ff;
    font-size: 1.2rem;
}

#game-area {
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 2;
}

#spacecraft {
    position: absolute;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 100px;
    background: url('space-craft.png') center/contain no-repeat;
    z-index: 10;
    transition: transform 0.3s ease;
    transform-origin: center center;
}

.asteroid {
    position: absolute;
    width: 80px;
    height: 80px;
    background: url('astroid.png') center/contain no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    animation: rotate 10s infinite linear;
}

.asteroid-text {
    color: white;
    font-weight: bold;
    text-shadow: 0 0 5px #0ff, 0 0 10px #0ff;
    font-size: 1.2rem;
    position: absolute;
    top: -30px;
    width: 100%;
    text-align: center;
    /* Remove rotation from text */
    animation: none !important;
    transform: none !important;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 5px;
    border-radius: 5px;
    box-shadow: 0 0 10px #0ff;
}

.attack {
    position: absolute;
    width: 30px;
    height: 30px;
    background: url('attack.png') center/contain no-repeat;
    z-index: 8;
}

.explosion {
    position: absolute;
    width: 100px;
    height: 100px;
    background: url('Explosion.png') center/contain no-repeat;
    z-index: 9;
    animation: explode 0.5s forwards;
    /* Center the explosion */
    transform: translate(-50%, -50%);
}

@keyframes explode {
    0% {
        opacity: 1;
        transform: scale(0.5);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

#current-word {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.5rem;
    color: #fff;
    text-shadow: 0 0 10px #0ff;
    letter-spacing: 3px;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid #0ff;
    box-shadow: 0 0 15px #0ff;
}

.active-letter {
    color: #0f0;
    text-shadow: 0 0 10px #0f0;
    font-weight: bold;
}

.error {
    animation: shake 0.5s;
    color: #f00 !important;
    text-shadow: 0 0 10px #f00 !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(-50%); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-55%); }
    20%, 40%, 60%, 80% { transform: translateX(-45%); }
}

.hidden {
    display: none !important;
}

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

#start-screen h1 {
    font-size: 4rem;
    margin-bottom: 2rem;
    text-shadow: 0 0 20px #0ff;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        text-shadow: 0 0 10px #0ff;
    }
    50% {
        text-shadow: 0 0 30px #0ff, 0 0 40px #0ff;
    }
    100% {
        text-shadow: 0 0 10px #0ff;
    }
}

button {
    background-color: transparent;
    border: 2px solid #0ff;
    color: #0ff;
    padding: 15px 30px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
    text-shadow: 0 0 10px #0ff;
    box-shadow: 0 0 10px #0ff;
}

button:hover {
    background-color: rgba(0, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 0 20px #0ff;
}

/* Removed duplicate asteroid rotation as it's now defined directly in the .asteroid class */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.glow {
    animation: glow 1.5s infinite alternate;
}

@keyframes glow {
    from {
        text-shadow: 0 0 5px #0ff, 0 0 10px #0ff;
    }
    to {
        text-shadow: 0 0 10px #0ff, 0 0 20px #0ff, 0 0 30px #0ff;
    }
}
.star {
    position: absolute;
    background-color: #fff;
    border-radius: 50%;
    box-shadow: 0 0 3px #fff, 0 0 5px #fff;
    opacity: 0.8;
    animation: twinkle 5s infinite alternate, move 30s linear infinite;
}

@keyframes twinkle {
    0% { opacity: 0.3; }
    50% { opacity: 1; }
    100% { opacity: 0.3; }
}

@keyframes move {
    from { transform: translateY(-10px); }
    to { transform: translateY(110vh); }
}
/* Nebula effect */
@keyframes nebula {
    0% { background-position: 0% 0%; }
    100% { background-position: 100% 100%; }
}

#game-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(29, 39, 107, 0.2) 0%, rgba(0, 0, 0, 0) 70%),
                radial-gradient(ellipse at center, rgba(77, 5, 232, 0.1) 0%, rgba(0, 0, 0, 0) 70%),
                radial-gradient(ellipse at center, rgba(0, 159, 255, 0.1) 0%, rgba(0, 0, 0, 0) 70%);
    background-size: 200% 200%;
    z-index: 1;
    opacity: 0.7;
    animation: nebula 30s ease infinite alternate;
    pointer-events: none;
}
.spacecraft-engine {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 30px;
    background: radial-gradient(circle, rgba(0,255,255,0.8) 0%, rgba(0,255,255,0.4) 50%, rgba(0,0,0,0) 100%);
    border-radius: 50%;
    animation: pulse-engine 1s infinite alternate;
    z-index: 9;
}

@keyframes pulse-engine {
    0% { opacity: 0.5; height: 20px; }
    100% { opacity: 1; height: 30px; }
}
.attack {
    transform-origin: center center;
}