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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0a0a2e, #16213e, #1a1a3a);
    color: #ffffff;
    overflow: hidden;
    height: 100vh;
}

#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#gameCanvas {
    background: radial-gradient(ellipse at center, #1a1a3a 0%, #0a0a2e 100%);
    border: 2px solid #4a4a8a;
    box-shadow: 0 0 30px rgba(74, 74, 138, 0.5);
    max-width: 100%;
    max-height: 100%;
}

/* Pantallas del juego */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 46, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.screen.hidden {
    display: none;
}

.screen-content {
    text-align: center;
    padding: 2rem;
    background: rgba(26, 26, 58, 0.8);
    border-radius: 20px;
    border: 2px solid #4a4a8a;
    box-shadow: 0 0 40px rgba(74, 74, 138, 0.3);
    max-width: 90%;
}

.game-title {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease-in-out infinite;
    margin-bottom: 1rem;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

.game-subtitle {
    font-size: 1.2rem;
    color: #b8b8d4;
    margin-bottom: 2rem;
    opacity: 0.8;
}

.game-button {
    background: linear-gradient(45deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    margin: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.game-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    background: linear-gradient(45deg, #764ba2 0%, #667eea 100%);
}

.game-button:active {
    transform: translateY(0);
}

.instructions {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* HUD del juego */
#gameHUD {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    pointer-events: none;
}

.hud-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(180deg, rgba(10, 10, 46, 0.8) 0%, transparent 100%);
}

.score, .lives {
    font-size: 1.2rem;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 15px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pause-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    pointer-events: all;
}

.pause-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Controles móviles */
#mobileControls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    z-index: 60;
    pointer-events: none;
}

.joystick {
    position: absolute;
    bottom: 120px;
    left: 30px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    pointer-events: all;
}

.joystick-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.1s ease;
}

.fire-button {
    position: absolute;
    bottom: 120px;
    right: 30px;
    width: 80px;
    height: 80px;
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: all;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
}

.fire-button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 10px rgba(255, 107, 107, 0.6);
}

/* Animaciones */
@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .game-title {
        font-size: 2rem;
    }
    
    .game-button {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    .score, .lives {
        font-size: 1rem;
        padding: 8px 12px;
    }
    
    #mobileControls {
        display: block;
    }
    
    /* Aumentar área de juego en móvil */
    #gameContainer {
        height: 100vh;
        padding: 0;
    }
    
    #gameCanvas {
        width: 100vw !important;
        height: 85vh !important;
        max-width: 100vw;
        max-height: 85vh;
        border: none;
    }
    
    /* Ajustar HUD para móvil */
    .score, .lives {
        position: fixed;
        top: 10px;
        z-index: 50;
        font-size: 0.9rem;
        padding: 6px 10px;
    }
    
    .score {
        left: 10px;
    }
    
    .lives {
        right: 10px;
    }
    
    .pause-btn {
        position: fixed;
        top: 10px;
        right: 50%;
        transform: translateX(50%);
        z-index: 50;
        padding: 8px 12px;
        font-size: 1rem;
    }
}

@media (min-width: 769px) {
    #mobileControls {
        display: none;
    }
}

/* Efectos de partículas */
.particle {
    position: absolute;
    pointer-events: none;
    border-radius: 50%;
    animation: particleFloat 2s ease-out forwards;
}

@keyframes particleFloat {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0) translateY(-100px);
    }
}
/* Mantener proporción del canvas en móviles */
@media (max-width: 768px) {
  #gameCanvas {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 85vh;
    object-fit: contain;
    display: block;
  }
}


