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

body {
    overflow: hidden;
    background: #1a1a2e;
    font-family: 'Arial', sans-serif;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

#gameCanvas {
    display: block;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(to bottom, #87CEEB 0%, #E0E0E0 80%, #D3D3D3 100%);
}

.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(26, 26, 46, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 1000;
    overflow: auto; /* Permitir scroll si es necesario */
}

#levelUpScreen {
    background: transparent;
    pointer-events: none;
    justify-content: flex-start;
    padding-top: 100px;
}

#lifeLostScreen {
    background: rgba(139, 0, 0, 0.9);
    pointer-events: none;
}

#lifeLostScreen h2 {
    font-size: 5rem;
    margin: 20px 0;
    animation: countdownPulse 1s ease-in-out infinite;
}

@keyframes countdownPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

#levelUpScreen h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    background: rgba(76, 175, 80, 0.9);
    padding: 15px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    animation: levelUpPulse 0.5s ease-out;
}

#levelUpScreen p {
    font-size: 1rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 5px;
}

@keyframes levelUpPulse {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.screen.hidden {
    display: none;
}

.game-logo {
    width: 200px;
    height: auto;
    object-fit: contain; /* Mantener proporción completa sin cortar */
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
    display: block;
}

.screen h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.5);
}

.screen p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
}

.screen button {
    padding: 15px 40px;
    font-size: 1.5rem;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.screen button:hover {
    background: #45a049;
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

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

#scoreDisplay {
    position: fixed;
    top: 20px;
    left: 20px;
    font-size: 1.5rem;
    color: white;
    z-index: 100;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: bold;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#scoreDisplay > div {
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 5px;
}

.health-container {
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 15px;
    border-radius: 5px;
    min-width: 200px;
}

.health-label {
    font-size: 1rem;
    margin-bottom: 5px;
}

.health-bar {
    width: 200px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.health-bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(to right, #4CAF50, #8BC34A);
    transition: width 0.3s ease;
    border-radius: 10px;
}

#scoreDisplay.hidden {
    display: none;
}

/* Controles táctiles */
.touch-controls {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 30px;
    z-index: 100;
}

.touch-controls.hidden {
    display: none;
}

.control-button {
    width: 80px;
    height: 80px;
    font-size: 2.5rem;
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: 3px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: all 0.1s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.control-button:active {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0.9);
}

/* Instrucciones responsive */
.desktop-instructions {
    display: block;
}

.mobile-instructions {
    display: none;
}

/* Media queries para móvil */
@media (max-width: 768px) {
    .game-logo {
        width: 150px;
        height: auto;
        object-fit: contain; /* Mantener proporción completa sin cortar */
        margin-bottom: 15px;
        display: block;
    }
    
    .screen h1 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .screen p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        padding: 0 20px;
    }
    
    .screen button {
        padding: 12px 30px;
        font-size: 1.2rem;
    }
    
    #scoreDisplay {
        font-size: 1.5rem;
        top: 10px;
        left: 10px;
    }
    
    .control-button {
        width: 70px;
        height: 70px;
        font-size: 2rem;
    }
    
    .touch-controls {
        gap: 25px;
        bottom: 20px;
    }
}

@media (max-width: 480px) {
    .screen h1 {
        font-size: 1.5rem;
    }
    
    .screen p {
        font-size: 0.9rem;
    }
    
    .screen button {
        padding: 10px 25px;
        font-size: 1rem;
    }
    
    #scoreDisplay {
        font-size: 1.2rem;
    }
    
    .control-button {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }
    
    .touch-controls {
        gap: 20px;
    }
}

/* Pantalla de personalización */
.character-preview {
    margin: 20px 0;
    display: flex;
    justify-content: center;
}

.character-preview canvas {
    border: 3px solid white;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
}

.character-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
    min-width: 300px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-group label {
    font-size: 1.2rem;
    color: white;
}

.option-group select {
    padding: 10px;
    font-size: 1rem;
    border-radius: 5px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
}

.option-group select option {
    background: #1a1a2e;
    color: white;
}

