body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    background-color: #0f0f1f;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

/* Common styles for screens */
.screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 20, 0.9);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
    max-width: 800px;
    width: 90%;
    z-index: 100;
    border: 2px solid #4d20be;
}

/* Start screen */
#startScreen h1 {
    font-size: 3rem;
    color: #4d20be;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(77, 32, 190, 0.5);
}

.instructions {
    background-color: rgba(30, 30, 60, 0.6);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: left;
}

.instructions h2 {
    color: #90ff30;
    border-bottom: 1px solid #4d20be;
    padding-bottom: 10px;
}

.instructions p {
    margin: 10px 0;
    line-height: 1.5;
}

.controls-info {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin-top: 15px;
}

.control {
    margin: 5px;
    display: flex;
    align-items: center;
}

.key {
    display: inline-block;
    background-color: #4d20be;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    margin-right: 10px;
    min-width: 40px;
    text-align: center;
}

.difficulty-selector {
    margin: 20px 0;
}

#difficultySelector {
    padding: 8px 15px;
    border-radius: 5px;
    background-color: #4d20be;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    margin-left: 10px;
}

/* Canvas and game area */
canvas {
    border: 2px solid #4d20be;
    border-radius: 10px;
    background-image: url(../../../img/games/spaceManguirryFuncional/background.svg);
    background-size: 106%;
    box-shadow: 0 0 20px rgba(77, 32, 190, 0.3);
    max-width: 100%;
    height: auto;
}

#gameUI {
    width: 100%;
    max-width: 800px;
    position: relative;
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 20, 0.7);
    padding: 10px 15px;
    border-radius: 10px 10px 0 0;
    margin-bottom: 5px;
    border-bottom: 2px solid #4d20be;
}

#scoreDisplay, #livesDisplay {
    font-size: 1.2rem;
    font-weight: bold;
}

#livesDisplay {
    color: #ff5050;
}

#pauseButton {
    background-color: #4d20be;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

#pauseButton:hover {
    background-color: #90ff30;
    color: #000;
}

/* Mobile controls */
#mobileControls {
    display: none;
    justify-content: space-between;
    margin-top: 15px;
}

.control-button {
    background-color: rgba(77, 32, 190, 0.7);
    color: white;
    border: 2px solid #4d20be;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.control-button:active {
    background-color: #90ff30;
    color: #000;
}

/* Game over screen */
#gameOver h1 {
    color: #ff5050;
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(255, 80, 80, 0.5);
}

#puntos {
    font-size: 1.5rem;
    margin: 20px 0;
}

.share-score {
    margin-top: 20px;
}

.social-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.social-button {
    background-color: #1da1f2;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.social-button:last-child {
    background-color: #4267B2;
}

/* Buttons */
.main-button {
    background-color: #4d20be;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.main-button:hover {
    background-color: #90ff30;
    color: #000;
    transform: translateY(-3px);
}

.main-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* Utility classes */
.hidden {
    display: none;
}

/* Visual effects */
.score-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    pointer-events: none;
    animation: float-up 1s ease-out, fade-out 1s ease-in;
}

.combo-effect {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: bold;
    color: gold;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
    pointer-events: none;
    animation: pulse 0.5s ease-in-out infinite, fade-out 1s ease-in;
}

/* Animations */
@keyframes float-up {
    0% { transform: translate(-50%, -50%); }
    100% { transform: translate(-50%, -150%); }
}

@keyframes fade-out {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

/* Responsive design */
@media (max-width: 768px) {
    .screen {
        padding: 20px;
    }
    
    #startScreen h1 {
        font-size: 2rem;
    }
    
    .instructions {
        padding: 10px;
    }
    
    .main-button {
        padding: 12px 24px;
        font-size: 1.2rem;
    }
    
    #mobileControls {
        display: flex;
    }
    
    .mobile-only {
        display: flex !important;
    }
}

/* Preload animations */
@keyframes shine {
    0% {
        background-position: -100px;
    }
    40%, 100% {
        background-position: 200px;
    }
}

.loading .main-button {
    background: linear-gradient(90deg, #4d20be 0%, #6940c9 40%, #4d20be 80%);
    background-size: 200px 100%;
    animation: shine 1.5s infinite linear;
}