@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');

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

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

.space-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1" fill="white"/></svg>') repeat;
    background-size: 2px 2px;
    z-index: 1;
    pointer-events: none;
}

.twinkling {
    position: absolute;
    width: 100%;
    height: 100%;
    background: transparent url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1" fill="white" opacity="0.5"/></svg>') repeat;
    background-size: 2px 2px;
    animation: twinkle 4s infinite;
    z-index: 1;
    pointer-events: none;
}

.asteroid-belt {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    background-size: 4px 4px;
    z-index: 1;
    opacity: 0.3;
    pointer-events: none;
}

.gravitational-anomaly {
    position: absolute;
    width: 200px;
    height: 200px;
    left: 50%;
    top: 30%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle at center, rgba(255, 0, 0, 0.2), rgba(255, 0, 0, 0));
    border-radius: 50%;
    z-index: 1;
    animation: pulse 2s infinite;
    pointer-events: none;
}

.flight-path {
    position: absolute;
    width: 100%;
    height: 2px;
    top: 50%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.2), transparent);
    z-index: 1;
    pointer-events: none;
}

.asteroid-field {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.asteroid {
    position: absolute;
    width: 30px;
    height: 30px;
    background: radial-gradient(circle at 30% 30%, #8B4513, #4B2F0B);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(139, 69, 19, 0.5);
}

.asteroid1 {
    top: 20%;
    left: 30%;
    animation: float 8s infinite;
}

.asteroid2 {
    top: 40%;
    left: 60%;
    animation: float 12s infinite;
}

.asteroid3 {
    top: 60%;
    left: 20%;
    animation: float 10s infinite;
}

.asteroid4 {
    top: 30%;
    left: 80%;
    animation: float 9s infinite;
}

.asteroid5 {
    top: 70%;
    left: 50%;
    animation: float 11s infinite;
}

.mars {
    position: absolute;
    width: 100px;
    height: 100px;
    right: 10%;
    top: 20%;
    background: radial-gradient(circle at 30% 30%, #E27B58, #8B3E2F);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(226, 123, 88, 0.5);
    z-index: 1;
    animation: pulse 4s infinite;
    pointer-events: none;
}

.earth {
    position: absolute;
    width: 120px;
    height: 120px;
    left: 10%;
    top: 20%;
    background: radial-gradient(circle at 30% 30%, #1E88E5, #0D47A1);
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(30, 136, 229, 0.5);
    z-index: 1;
    animation: pulse 4s infinite;
    pointer-events: none;
}

.game-container {
    position: relative;
    width: 1024px;
    height: 768px;
    margin: 0 auto;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.95);
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    padding: 10px;
    aspect-ratio: 4/3;
}

.game-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-align: center;
    color: #fff;
    text-shadow: 0 0 10px #4CAF50;
    z-index: 3;
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 1024px;
    height: 768px;
    background-color: #000;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    z-index: 2;
    aspect-ratio: 4/3;
}

.hud {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-family: 'Arial', sans-serif;
    z-index: 3;
}

.score {
    font-size: 24px;
    margin-bottom: 10px;
}

.mission-info {
    font-size: 18px;
    margin-bottom: 10px;
}

.astronaut-stats {
    font-size: 18px;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px;
    border-radius: 5px;
}

.astronaut-stats div {
    margin: 5px 0;
}

#rescuedCount {
    color: #00ff00;
}

#killedCount {
    color: #ff0000;
}

.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.95);
    transition: opacity 0.5s ease;
}

.start-screen.hidden {
    display: none;
    opacity: 0;
}

.mission-briefing {
    background: rgba(0, 0, 0, 0.8);
    padding: 40px;
    border-radius: 10px;
    max-width: 600px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: scale(1);
    transition: transform 0.3s ease;
}

.start-screen.hidden .mission-briefing {
    transform: scale(0.9);
}

.story {
    margin: 20px 0;
    line-height: 1.6;
    text-align: left;
}

.controls {
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

.start-button, .restart-button {
    background: linear-gradient(to bottom, #4CAF50, #388E3C);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 18px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
    position: relative;
    z-index: 1002;
}

.start-button:hover, .restart-button:hover {
    background: linear-gradient(to bottom, #66BB6A, #43A047);
    transform: scale(1.05);
}

#gameOver {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.95);
}

.game-over-content {
    background: rgba(0, 0, 0, 0.8);
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transform: scale(1);
    transition: transform 0.3s ease;
}

.mission-status {
    color: #ff0000;
    font-size: 1.8em;
    margin: 20px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 15px rgba(255, 0, 0, 0.8);
    font-weight: bold;
    animation: pulse 2s infinite;
    line-height: 1.4;
}

#gameOver.hidden {
    display: none;
}

.hidden {
    display: none;
}

@keyframes twinkle {
    0% { opacity: 0.2; }
    50% { opacity: 0.8; }
    100% { opacity: 0.2; }
}

@keyframes pulse {
    0% { transform: scale(1); text-shadow: 0 0 15px rgba(255, 0, 0, 0.8); }
    50% { transform: scale(1.05); text-shadow: 0 0 25px rgba(255, 0, 0, 0.8); }
    100% { transform: scale(1); text-shadow: 0 0 15px rgba(255, 0, 0, 0.8); }
}

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

.skull-container {
    margin: 20px 0;
    animation: float 3s ease-in-out infinite;
    filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.7));
}

.skull-image {
    width: 100px;
    height: 100px;
    filter: drop-shadow(0 0 10px rgba(255, 0, 0, 0.5)) brightness(1.2);
} 