body {
    margin: 0;
    overflow: hidden;
    font-family: Arial, sans-serif;
    background-color: #000;
}

/* score displays */
#score {
    position: absolute;
    top: 50px;
    width: 100%;
    text-align: center;
    color: white;
    font-size: 24px;
    z-index: 100;
}

/* Start Screen - Space themed */
#startScreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
    overflow: hidden;
}

/* Main title styling */
#startScreen h1 {
    color: #00FFFF;
    font-size: 48px;
    margin-bottom: 30px;
    text-shadow: 0 0 10px #00FFFF, 0 0 20px #00FFFF;
    animation: glow 2s ease-in-out infinite alternate;
    position: relative;
}

/* Nebulosa 1 - Púrpura */
#startScreen h1::before {
    content: '';
    position: absolute;
    top: -100px;
    left: -150px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle at center, rgba(255,0,255,0.3), rgba(0,0,255,0.1), transparent 70%);
    border-radius: 50%;
    filter: blur(20px);
    animation: float 15s infinite alternate;
    z-index: -1;
}

/* Nebulosa 2 - Azul */
#startScreen h1::after {
    content: '';
    position: absolute;
    bottom: -80px;
    right: -120px;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle at center, rgba(0,255,255,0.3), rgba(0,128,255,0.1), transparent 70%);
    border-radius: 50%;
    filter: blur(20px);
    animation: float 12s infinite alternate-reverse;
    z-index: -1;
}

/* Estrellas estáticas */
#startScreen::before, #gameOver::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(1px 1px at 25% 5%, white, transparent),
        radial-gradient(1px 1px at 50% 15%, white, transparent),
        radial-gradient(1px 1px at 75% 25%, white, transparent),
        radial-gradient(1px 1px at 25% 35%, white, transparent),
        radial-gradient(1px 1px at 50% 45%, white, transparent),
        radial-gradient(1px 1px at 75% 65%, white, transparent),
        radial-gradient(1px 1px at 25% 75%, white, transparent),
        radial-gradient(1px 1px at 50% 85%, white, transparent),
        radial-gradient(1px 1px at 75% 95%, white, transparent);
    background-repeat: repeat;
    background-size: 250px 250px;
    animation: twinkling 8s linear infinite;
    z-index: -1;
}

/* Estrellas que brillan */
#startScreen::after, #gameOver::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 10% 20%, rgba(0, 255, 255, 0.8), transparent),
        radial-gradient(2px 2px at 30% 40%, rgba(0, 255, 255, 0.8), transparent),
        radial-gradient(2px 2px at 50% 60%, rgba(0, 255, 255, 0.8), transparent),
        radial-gradient(2px 2px at 70% 80%, rgba(0, 255, 255, 0.8), transparent),
        radial-gradient(2px 2px at 90% 10%, rgba(0, 255, 255, 0.8), transparent);
    background-repeat: repeat;
    background-size: 350px 350px;
    animation: twinkling 4s ease-in-out infinite;
    z-index: -1;
}

/* Player form styling */
#playerForm {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 10;
}

#playerForm label {
    color: white;
    font-size: 24px;
    margin-bottom: 10px;
}

#playerName {
    padding: 10px;
    font-size: 20px;
    border-radius: 5px;
    border: 2px solid #00FFFF;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    text-align: center;
    margin-bottom: 20px;
    width: 300px;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Start Button with space effect */
#startButton {
    position: relative;
    z-index: 10;
    font-size: 24px;
    padding: 12px 30px;
    background-color: transparent;
    color: #00FFFF;
    border: 2px solid #00FFFF;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 0 5px #00FFFF;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5), inset 0 0 10px rgba(0, 255, 255, 0.5);
    overflow: hidden;
}

#startButton:hover {
    background-color: rgba(0, 255, 255, 0.2);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.8), inset 0 0 20px rgba(0, 255, 255, 0.8);
}

#startButton::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 255, 0.4), transparent);
    transition: 0.5s;
    z-index: -1;
}

#startButton:hover::before {
    left: 100%;
}

/* Game Over Screen */
#gameOver {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 48px;
    z-index: 100;
    display: none;
    text-align: center;
    padding: 30px;
    border-radius: 10px;
    background: radial-gradient(ellipse at center, #1B2735 0%, #090A0F 100%);
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.5);
    border: 1px solid rgba(0, 255, 255, 0.2);
    overflow: hidden;
}

/* Game Over buttons */
#gameOver button {
    position: relative;
    z-index: 10;
    font-size: 24px;
    padding: 10px 20px;
    margin-top: 20px;
    background-color: transparent;
    color: #4CAF50;
    border: 2px solid #4CAF50;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    text-shadow: 0 0 5px #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5), inset 0 0 10px rgba(76, 175, 80, 0.5);
}

#gameOver button:hover {
    background-color: rgba(76, 175, 80, 0.2);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.8), inset 0 0 20px rgba(76, 175, 80, 0.8);
}

/* Top Scores */
#topScores {
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    color: white;
    width: 80%;
    max-width: 400px;
    border: 1px solid rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
    position: relative;
    z-index: 10;
}

#topScores h2 {
    color: #00FFFF;
    text-align: center;
    margin-top: 0;
    text-shadow: 0 0 10px #00FFFF;
}

#scoresList {
    list-style: none;
    padding: 0;
}

#scoresList li {
    display: flex;
    justify-content: space-between;
    padding: 8px;
    border-bottom: 1px solid #333;
}

#scoresList li:last-child {
    border-bottom: none;
}

.playerRank {
    color: #00FFFF;
    font-weight: bold;
}

.highScoreValue {
    color: #FFFF00;
}

.viewScoresButton {
    font-size: 16px;
    padding: 8px 15px;
    background-color: transparent;
    color: #4CAF50;
    border: 1px solid #4CAF50;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s;
    text-shadow: 0 0 3px #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

.viewScoresButton:hover {
    background-color: rgba(76, 175, 80, 0.2);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

/* Mobile Controls */
#mobileControls {
    position: fixed;
    bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    z-index: 100;
}

#joystick {
    position: relative;
    width: 120px;
    height: 120px;
    background-color: rgba(0, 255, 255, 0.1);
    border: 2px solid rgba(255, 0, 255, 0.658);
    border-radius: 50%;
    margin-left: 30px;
    touch-action: none;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

#joystickKnob {
    position: absolute;
    width: 50px;
    height: 50px;
    background-color: rgba(0, 255, 255, 0.3);
    border: 1px solid rgba(0, 255, 255, 0.5);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

#jumpButton {
    width: 90px;
    height: 90px;
    background-color: rgba(0, 255, 255, 0.1);
    border: 2px solid rgba(255, 0, 255, 0.658);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 30px;
    touch-action: manipulation;
    user-select: none;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

/* Social Link */
.social-link {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 16px;
    background-color: #be13b6;
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 16px;
    transition: all 0.3s ease;
    animation: moveLeftRight 2s infinite ease-in-out;
    position: relative;
    z-index: 10;
}

.social-link:hover {
    background-color: #be13b6;
    transform: scale(1.05);
    box-shadow: 0 0 20px #da14d0;
    animation-play-state: paused;
}

#gameOver .social-link {
    display: block;
    width: fit-content;
    margin: 15px auto;
}

/* Promo Title */
.promo-title {
    color: #00FFFF;
    margin: 10px 0;
    font-size: 18px;
    text-shadow: 0 0 10px #00FFFF, 0 0 20px #00FFFF;
    letter-spacing: 1px;
    font-weight: bold;
    text-align: center;
    animation: glow 2s ease-in-out infinite alternate;
    position: relative;
    z-index: 10;
}

/* Animations */
@keyframes twinkling {
    0% { opacity: 0.3; }
    50% { opacity: 0.8; }
    100% { opacity: 0.3; }
}

@keyframes float {
    0% {
        transform: translateY(0) translateX(0);
    }
    50% {
        transform: translateY(20px) translateX(15px);
    }
    100% {
        transform: translateY(-20px) translateX(-15px);
    }
}

@keyframes glow {
    0% {
        text-shadow: 0 0 10px #00FFFF, 0 0 20px #00FFFF;
        color: #00FFFF;
    }
    100% {
        text-shadow: 0 0 15px #00FFFF, 0 0 30px #00FFFF, 0 0 45px #00FFFF;
        color: #FFFFFF;
    }
}

@keyframes shootingStar {
    0% {
        transform: translateX(0) translateY(0) rotate(45deg);
        opacity: 1;
    }
    70% {
        opacity: 1;
    }
    100% {
        transform: translateX(500px) translateY(500px) rotate(45deg);
        opacity: 0;
    }
}

@keyframes moveLeftRight {
    0% { transform: translateX(0); }
    25% { transform: translateX(-50px); }
    50% { transform: translateX(0); }
    75% { transform: translateX(50px); }
    100% { transform: translateX(0); }
}

/* Estrellas fugaces for startScreen */
#startScreen .shooting-star {
    position: absolute;
    width: 200px;
    height: 2px;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.8) 50%, rgba(255, 255, 255, 0) 100%);
    animation: shootingStar 5s linear infinite;
    animation-delay: 2s;
    opacity: 0.7;
    z-index: 0;
    transform-origin: 0 0;
    pointer-events: none;
}

/* Responsive adjustments */
@media (orientation: landscape) {
    #joystick {
        margin-left: 40px;
    }
    #jumpButton {
        margin-right: 40px;
    }
}

/* Mobile-specific styles */
@media (max-width: 500px) {
    /* Game Over Screen mobile styles */
    #gameOver {
        font-size: 22px;
        padding: 15px 20px;
        max-width: 90%;
        max-height: 70vh;
    }
    
    #gameOver button {
        font-size: 18px;
        padding: 8px 16px;
        margin-top: 12px;
    }
    
    #gameOver .social-link {
        margin: 10px auto;
        font-size: 14px;
        padding: 6px 12px;
    }
}