/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Courier New', monospace;
    overflow: hidden;
    background: #000;
    color: white;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Game Area */
#gameArea {
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    height: calc(100% - 60px);
    overflow: hidden;
}

/* UI Styles */
#gameUI {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
}

#topUI {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: rgba(0, 0, 0, 0.8);
    border-bottom: 2px solid #333;
    font-size: 18px;
    font-weight: bold;
}

/* Level Themes */
/* Level 1: Deep Space Theme */
.level-1 {
    background: radial-gradient(ellipse at center, #1a1a3e 0%, #0a0a2e 50%, #000 100%);
}

.level-1::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, white, transparent),
        radial-gradient(2px 2px at 40px 70px, white, transparent),
        radial-gradient(1px 1px at 90px 40px, white, transparent),
        radial-gradient(1px 1px at 130px 80px, white, transparent),
        radial-gradient(2px 2px at 160px 30px, white, transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: stars-move 20s linear infinite;
    opacity: 0.8;
}

@keyframes stars-move {
    0% { transform: translateY(0); }
    100% { transform: translateY(100px); }
}

/* Level 2: Cyberpunk Neon Theme */
.level-2 {
    background: linear-gradient(45deg, #1a0033 0%, #000 50%, #001a33 100%);
}

.level-2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(90deg, transparent 98%, #ff0080 100%),
        linear-gradient(180deg, transparent 98%, #00ff80 100%);
    background-size: 50px 50px;
    animation: neon-grid 3s ease-in-out infinite alternate;
    opacity: 0.3;
}

@keyframes neon-grid {
    0% { opacity: 0.2; }
    100% { opacity: 0.5; }
}

/* Level 3: Volcanic Fire Theme */
.level-3 {
    background: radial-gradient(ellipse at center, #331100 0%, #1a0800 50%, #000 100%);
}

.level-3::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(3px 3px at 30px 40px, #ff4500, transparent),
        radial-gradient(2px 2px at 80px 20px, #ff6b35, transparent),
        radial-gradient(1px 1px at 120px 60px, #f7931e, transparent);
    background-repeat: repeat;
    background-size: 150px 80px;
    animation: embers-float 8s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes embers-float {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-10px) translateX(5px); }
    50% { transform: translateY(-5px) translateX(-3px); }
    75% { transform: translateY(-8px) translateX(8px); }
}

/* Game Objects */
#player {
    position: absolute;
    width: 40px;
    height: 50px;
    background: linear-gradient(180deg, #00aaff 0%, #0066cc 50%, #003d7a 100%);
    clip-path: polygon(50% 0%, 35% 25%, 20% 60%, 20% 85%, 35% 100%, 65% 100%, 80% 85%, 80% 60%, 65% 25%);
    transition: all 0.1s ease;
    z-index: 100;
    border-radius: 3px;
    box-shadow: 
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        0 0 10px rgba(0, 170, 255, 0.5);
}

#player::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 12px;
    background: linear-gradient(180deg, #00ffff, #0088ff);
    border-radius: 50%;
    box-shadow: 0 0 8px #00ffff;
}

#player::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 4px;
    background: linear-gradient(90deg, #ff6600, #ff0000);
    border-radius: 2px;
    box-shadow: 0 0 6px #ff6600;
}

.enemy {
    position: absolute;
    width: 28px;
    height: 32px;
    background: linear-gradient(180deg, #ff0000 0%, #cc0000 50%, #990000 100%);
    clip-path: polygon(50% 100%, 20% 75%, 0% 40%, 15% 15%, 50% 0%, 85% 15%, 100% 40%, 80% 75%);
    z-index: 50;
    border-radius: 2px;
    box-shadow: 
        inset 0 -2px 4px rgba(255, 100, 100, 0.3),
        0 0 8px rgba(255, 0, 0, 0.4);
}

.enemy::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 8px;
    background: linear-gradient(180deg, #ffaa00, #ff6600);
    border-radius: 50%;
    box-shadow: 0 0 6px #ffaa00;
}

.enemy-type-2 {
    width: 35px;
    height: 38px;
    background: linear-gradient(180deg, #ff6600 0%, #cc3300 50%, #993300 100%);
    clip-path: polygon(50% 100%, 25% 80%, 5% 50%, 10% 20%, 50% 0%, 90% 20%, 95% 50%, 75% 80%);
    box-shadow: 
        inset 0 -2px 4px rgba(255, 150, 100, 0.4),
        0 0 12px rgba(255, 102, 0, 0.5);
}

.enemy-type-2::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 10px;
    background: linear-gradient(180deg, #ffcc00, #ff8800);
    border-radius: 50%;
    box-shadow: 0 0 8px #ffcc00;
}

.enemy-type-3 {
    width: 45px;
    height: 48px;
    background: linear-gradient(180deg, #8800ff 0%, #4400aa 50%, #330077 100%);
    clip-path: polygon(50% 100%, 15% 85%, 0% 60%, 5% 35%, 25% 10%, 50% 0%, 75% 10%, 95% 35%, 100% 60%, 85% 85%);
    box-shadow: 
        inset 0 -3px 6px rgba(200, 100, 255, 0.4),
        0 0 15px rgba(136, 0, 255, 0.6);
}

.enemy-type-3::before {
    content: '';
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 12px;
    background: linear-gradient(180deg, #ff00ff, #aa00ff);
    border-radius: 50%;
    box-shadow: 0 0 10px #ff00ff;
}

.enemy-type-3::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 20%;
    width: 4px;
    height: 6px;
    background: linear-gradient(180deg, #00ffff, #0088ff);
    border-radius: 50%;
    box-shadow: 
        0 0 6px #00ffff,
        30px 0 0 0 #00ffff,
        30px 0 6px 0 #00ffff;
}

.bullet {
    position: absolute;
    width: 4px;
    height: 12px;
    background: #ffff00;
    border-radius: 2px;
    box-shadow: 0 0 10px #ffff00;
    z-index: 75;
}

.enemy-bullet {
    background: #ff0044;
    box-shadow: 0 0 8px #ff0044;
}

.powerup {
    position: absolute;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    z-index: 60;
    animation: powerup-pulse 1s ease-in-out infinite alternate;
}

.powerup-rapid {
    background: radial-gradient(circle, #ffff00, #ffaa00);
    box-shadow: 0 0 15px #ffff00;
}

.powerup-shield {
    background: radial-gradient(circle, #00ffff, #0088ff);
    box-shadow: 0 0 15px #00ffff;
}

.powerup-multishot {
    background: radial-gradient(circle, #ff00ff, #aa00ff);
    box-shadow: 0 0 15px #ff00ff;
}

/* Life Platform */
.life-platform {
    position: absolute;
    width: 60px;
    height: 15px;
    background: linear-gradient(90deg, #00ff00, #00aa00, #00ff00);
    border: 2px solid #00ffaa;
    border-radius: 8px;
    z-index: 60;
    animation: platform-glow 2s ease-in-out infinite alternate;
    box-shadow: 
        0 0 15px #00ff00,
        inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.life-platform::before {
    content: '+1';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    color: #00ff00;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 0 8px #00ff00;
}

@keyframes platform-glow {
    0% { 
        box-shadow: 0 0 15px #00ff00, inset 0 2px 4px rgba(255, 255, 255, 0.3);
        transform: scale(1);
    }
    100% { 
        box-shadow: 0 0 25px #00ff00, 0 0 35px #00aa00, inset 0 2px 4px rgba(255, 255, 255, 0.3);
        transform: scale(1.05);
    }
}

/* Special Weapon Blocks */
.weapon-block {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    z-index: 60;
    animation: weapon-block-spin 3s linear infinite;
    border: 2px solid;
}

.weapon-block-rocket {
    background: linear-gradient(45deg, #ff4400, #ff8800, #ff4400);
    border-color: #ffaa00;
    box-shadow: 
        0 0 15px #ff6600,
        inset 0 2px 4px rgba(255, 200, 100, 0.4);
}

.weapon-block-rocket::before {
    content: 'R';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 6px #ff4400;
}

.weapon-block-triple {
    background: linear-gradient(45deg, #8800ff, #aa44ff, #8800ff);
    border-color: #cc66ff;
    box-shadow: 
        0 0 15px #aa00ff,
        inset 0 2px 4px rgba(200, 150, 255, 0.4);
}

.weapon-block-triple::before {
    content: '3';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 6px #8800ff;
}

.weapon-block-laser {
    background: linear-gradient(45deg, #00ffff, #0088ff, #00ffff);
    border-color: #44ccff;
    box-shadow: 
        0 0 15px #00aaff,
        inset 0 2px 4px rgba(150, 200, 255, 0.4);
}

.weapon-block-laser::before {
    content: 'L';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 6px #00ffff;
}

@keyframes weapon-block-spin {
    0% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(90deg) scale(1.1); }
    50% { transform: rotate(180deg) scale(1); }
    75% { transform: rotate(270deg) scale(1.1); }
    100% { transform: rotate(360deg) scale(1); }
}

/* Special Bullet Types */
.bullet-rocket {
    width: 6px;
    height: 16px;
    background: linear-gradient(180deg, #ff6600, #ff0000);
    border-radius: 3px;
    box-shadow: 0 0 12px #ff4400;
}

.bullet-laser {
    width: 2px;
    height: 20px;
    background: linear-gradient(180deg, #00ffff, #0088ff);
    border-radius: 1px;
    box-shadow: 0 0 15px #00ffff;
}

@keyframes powerup-pulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.2); }
}

/* Screen Overlays */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    text-align: center;
}

.screen.hidden {
    display: none;
}

.screen h1 {
    font-size: 4em;
    margin-bottom: 20px;
    text-shadow: 0 0 20px #00ffff;
    animation: title-glow 2s ease-in-out infinite alternate;
}

.screen h2 {
    font-size: 3em;
    margin-bottom: 20px;
    text-shadow: 0 0 15px #ff0080;
}

@keyframes title-glow {
    0% { text-shadow: 0 0 20px #00ffff; }
    100% { text-shadow: 0 0 30px #00ffff, 0 0 40px #00aaff; }
}

.controls {
    margin: 20px 0;
    font-size: 1.2em;
    line-height: 1.6;
}

.game-button {
    padding: 15px 30px;
    font-size: 1.5em;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    background: linear-gradient(45deg, #00ff00, #00aa00);
    color: black;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.game-button:hover {
    background: linear-gradient(45deg, #00ffaa, #00ff00);
    transform: scale(1.05);
    box-shadow: 0 0 20px #00ff00;
}

.game-button:active {
    transform: scale(0.95);
}

/* Particle Effects */
.explosion {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffff00, #ff4400, transparent);
    animation: explosion-anim 0.5s ease-out forwards;
    z-index: 200;
}

@keyframes explosion-anim {
    0% {
        transform: scale(0.1);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

/* Player Effects */
.player-shield {
    box-shadow: 0 0 20px #00ffff !important;
    animation: shield-pulse 0.5s ease-in-out infinite alternate;
}

@keyframes shield-pulse {
    0% { box-shadow: 0 0 20px #00ffff; }
    100% { box-shadow: 0 0 30px #00ffff, 0 0 40px #00aaff; }
}

/* Responsive Design */
@media (max-width: 768px) {
    #topUI {
        font-size: 14px;
        padding: 10px 15px;
    }
    
    .screen h1 {
        font-size: 2.5em;
    }
    
    .screen h2 {
        font-size: 2em;
    }
    
    .game-button {
        padding: 12px 24px;
        font-size: 1.2em;
    }
    
    .controls {
        font-size: 1em;
    }
}
