/* Re-Evolution - Estilos CSS */
/* Configuración global */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background: #000;
    overflow: hidden;
    color: white;
}

/* Fondo espacial animado */
.space-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at center, 
            rgba(20, 0, 40, 0.8) 0%,
            rgba(5, 0, 15, 0.9) 30%,
            rgba(0, 0, 0, 1) 70%
        ),
        radial-gradient(circle at 20% 80%, rgba(120, 40, 200, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 100, 50, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(0, 100, 255, 0.05) 0%, transparent 50%);
    z-index: -1;
}

/* Capa de estrellas cercanas (grandes y rápidas) */
.stars::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background: 
        radial-gradient(1px 1px at 23px 47px, rgba(255,255,255,0.7), transparent),
        radial-gradient(1px 1px at 89px 134px, rgba(255,255,200,0.5), transparent),
        radial-gradient(0.5px 0.5px at 156px 78px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 201px 189px, rgba(255,200,255,0.3), transparent),
        radial-gradient(0.5px 0.5px at 67px 203px, rgba(200,255,255,0.4), transparent),
        radial-gradient(1px 1px at 278px 45px, rgba(255,255,255,0.6), transparent),
        radial-gradient(0.5px 0.5px at 134px 267px, rgba(255,255,200,0.3), transparent);
    background-repeat: repeat;
    background-size: 350px 300px;
    animation: rotateStars 300s linear infinite;
}

/* Capa de estrellas lejanas (pequeñas y lentas) */
.stars::before {
    content: '';
    position: absolute;
    width: 300%;
    height: 300%;
    top: -100%;
    left: -100%;
    background: 
        radial-gradient(0.5px 0.5px at 78px 123px, rgba(255,255,255,0.3), transparent),
        radial-gradient(0.5px 0.5px at 234px 289px, rgba(200,200,255,0.25), transparent),
        radial-gradient(0.5px 0.5px at 456px 167px, rgba(255,255,255,0.2), transparent),
        radial-gradient(0.5px 0.5px at 123px 378px, rgba(255,200,200,0.25), transparent),
        radial-gradient(0.5px 0.5px at 345px 234px, rgba(200,255,200,0.2), transparent),
        radial-gradient(0.5px 0.5px at 567px 456px, rgba(255,255,255,0.15), transparent),
        radial-gradient(0.5px 0.5px at 189px 567px, rgba(200,255,255,0.2), transparent);
    background-repeat: repeat;
    background-size: 600px 650px;
    animation: rotateStars 600s linear infinite reverse;
}

/* Nebulosas y efectos atmosféricos */
.nebula {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    animation: twinkle 8s ease-in-out infinite alternate;
}

.nebula1 {
    width: 200px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 100, 200, 0.4), transparent);
    top: 20%;
    right: 10%;
    animation-delay: 0s;
}

.nebula2 {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(100, 200, 255, 0.3), transparent);
    bottom: 30%;
    left: 15%;
    animation-delay: 2s;
}

.nebula3 {
    width: 100px;
    height: 200px;
    background: radial-gradient(ellipse, rgba(200, 255, 100, 0.2), transparent);
    top: 60%;
    right: 20%;
    animation-delay: 4s;
}

/* Estrellas individuales parpadeantes */
.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 2s ease-in-out infinite alternate;
}

.star1 {
    width: 2px;
    height: 2px;
    top: 10%;
    left: 20%;
    animation-delay: 0s;
    box-shadow: 0 0 4px rgba(255,255,255,0.8);
}

.star2 {
    width: 1px;
    height: 1px;
    top: 30%;
    right: 30%;
    animation-delay: 1s;
    box-shadow: 0 0 3px rgba(255,255,200,0.6);
}

.star3 {
    width: 2px;
    height: 2px;
    bottom: 40%;
    right: 15%;
    animation-delay: 2s;
    box-shadow: 0 0 5px rgba(200,200,255,0.7);
}

.star4 {
    width: 1px;
    height: 1px;
    bottom: 25%;
    left: 25%;
    animation-delay: 0.5s;
    box-shadow: 0 0 6px rgba(200,255,200,0.5);
}

.star5 {
    width: 3px;
    height: 3px;
    top: 15%;
    right: 50%;
    animation-delay: 1.5s;
    box-shadow: 0 0 10px rgba(255,255,200,0.8);
}

@keyframes rotateStars {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes twinkle {
    0% { 
        opacity: 0.1; 
        transform: scale(0.95);
    }
    100% { 
        opacity: 0.3; 
        transform: scale(1.05);
    }
}

@keyframes orbitGlow {
    0% { 
        opacity: 0.1; 
        transform: scale(0.95);
    }
    100% { 
        opacity: 0.3; 
        transform: scale(1.05);
    }
}

/* Sistema de avisos cósmicos */
.cosmic-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7); /* Más transparente */
    backdrop-filter: blur(15px);
    border: 2px solid;
    border-radius: 20px;
    padding: 30px 50px;
    text-align: center;
    max-width: 80vw;
    box-shadow: 
        0 0 30px rgba(255,255,255,0.2), /* Más sutil */
        inset 0 0 20px rgba(255,255,255,0.05); /* Más transparente */
    opacity: 0;
    pointer-events: none;
}

.cosmic-notification.show {
    opacity: 1;
    animation: notificationFadeIn 0.8s ease-out;
}

.cosmic-notification.hide {
    animation: notificationFadeOut 1.2s ease-in forwards;
}

.notification-title {
    font-family: 'Arial Black', Arial, sans-serif;
    font-size: 3.5vmin;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 15px;
    text-shadow: 
        0 0 10px currentColor,
        0 0 20px currentColor,
        2px 2px 4px rgba(0,0,0,0.8);
}

.notification-text {
    font-family: Arial, sans-serif;
    font-size: 2.2vmin;
    line-height: 1.4;
    color: rgba(255,255,255,0.95);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    font-weight: 500;
}

@keyframes notificationFadeIn {
    0% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0.9);
    }
    100% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes notificationFadeOut {
    0% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1);
    }
    100% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0.95);
    }
}

@keyframes notificationAppear {
    0% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0.7) rotateY(90deg);
    }
    100% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1) rotateY(0deg);
    }
}

@keyframes notificationPulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes notificationDisappear {
    0% { 
        opacity: 1; 
        transform: translate(-50%, -50%) scale(1);
    }
    100% { 
        opacity: 0; 
        transform: translate(-50%, -50%) scale(0.8) rotateY(-90deg);
    }
}

/* Media queries para móviles y tablets */
@media (max-width: 768px) {
    .solar-system {
        width: 90vmin;
        height: 90vmin;
    }
    
    #planeta {
        width: min(160px, 16vmin);
        height: min(160px, 16vmin);
    }
    
    /* Órbitas en tablets - ajustadas proporcionalmente */
    .orbit1 {
        width: 38vmin;
        height: 38vmin;
        max-width: 380px;
        max-height: 380px;
    }
    
    .orbit2 {
        width: 54vmin;
        height: 54vmin;
        max-width: 540px;
        max-height: 540px;
    }
    
    /* Controles dev en tablets */
    .dev-controls {
        padding: 10px;
        font-size: 12px;
    }
    
    .dev-controls input {
        width: 40px;
    }
    
    /* Modal en tablets */
    .modal-content {
        width: 85%;
        max-width: 450px;
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .solar-system {
        width: 85vmin;
        height: 85vmin;
    }
    
    #planeta {
        width: min(120px, 12vmin);
        height: min(120px, 12vmin);
    }
    
    /* Órbitas en móviles pequeños - ajustadas para no salirse */
    .orbit1 {
        width: 30vmin;
        height: 30vmin;
        max-width: 240px;
        max-height: 240px;
    }
    
    .orbit2 {
        width: 42vmin;
        height: 42vmin;
        max-width: 320px;
        max-height: 320px;
    }

    /* Notificaciones en móviles - textos más grandes */
    .cosmic-notification {
        max-width: 95vw;
        padding: 25px 35px;
    }

    .notification-title {
        font-size: 6vmin;
        letter-spacing: 2px;
    }

    .notification-text {
        font-size: 4.5vmin;
        line-height: 1.4;
    }
    
    /* Botones del modal en móviles - más grandes */
    .modal-button {
        padding: 16px 24px;
        font-size: 18px;
        max-width: 320px;
        min-height: 50px;
    }
    
    /* Modal específico para móviles - textos más grandes */
    .modal {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .modal-content {
        width: 95%;
        padding: 25px;
        margin: 0;
        border-radius: 15px;
        max-height: calc(100vh - 20px);
    }
    
    .modal h2 {
        font-size: 22px;
        margin-bottom: 20px;
        line-height: 1.3;
    }
    
    .modal p {
        font-size: 17px;
        line-height: 1.5;
        margin-bottom: 18px;
    }
    
    .modal ul {
        margin: 18px 0;
        text-align: left;
    }
    
    .modal li {
        font-size: 16px;
        margin: 8px 0;
        line-height: 1.4;
    }
}

/* Órbitas teóricas de los soles */
.orbit {
    position: absolute;
    border: 2px solid rgba(255, 200, 0, 0.3);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.orbit1 {
    /* Órbita del sol 1 - más grande pero responsiva */
    width: 42vmin;
    height: 42vmin;
    max-width: 420px;
    max-height: 420px;
    min-width: 240px;
    min-height: 240px;
    border-color: rgba(255, 200, 0, 0.4);
    box-shadow: 0 0 10px rgba(255, 200, 0, 0.2);
}

.orbit2 {
    /* Órbita del sol 2 - más grande pero responsiva */
    width: 60vmin;
    height: 60vmin;
    max-width: 600px;
    max-height: 600px;
    min-width: 360px;
    min-height: 360px;
    border-color: rgba(255, 100, 100, 0.4);
    box-shadow: 0 0 10px rgba(255, 100, 100, 0.2);
}

/* Sistema solar */
.solar-system {
    position: relative;
    width: 100vmin;
    height: 100vmin;
    max-width: 600px;
    max-height: 600px;
    min-width: 300px;
    min-height: 300px;
    margin: 0 auto;
    top: 50%;
    transform: translateY(-50%);
}

/* Planeta central */
#planeta {
    position: absolute;
    width: min(180px, 18vmin);
    height: min(180px, 18vmin);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 10;
    /* Efectos de imagen */
    object-fit: cover;
    border: none;
}

@keyframes atmosphereBreath {
    0% { 
        opacity: 0.3; 
        transform: scale(1);
    }
    100% { 
        opacity: 0.6; 
        transform: scale(1.1);
    }
}

/* Soles */
#img_sol, #img_sol2 {
    position: absolute;
    width: min(40px, 4vmin);
    height: min(40px, 4vmin);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    z-index: 5;
    transition: transform 2.01s ease-out;
}

#img_sol {
    background: 
        radial-gradient(circle at 35% 35%, 
            rgba(255, 255, 150, 1) 0%,
            rgba(255, 200, 50, 1) 30%,
            rgba(255, 150, 0, 1) 70%,
            rgba(200, 100, 0, 1) 100%
        );
    box-shadow: 
        inset -8px -8px 16px rgba(200, 100, 0, 0.8),
        inset 5px 5px 10px rgba(255, 255, 200, 0.6),
        0 0 20px rgba(255, 200, 50, 0.8),
        0 0 40px rgba(255, 200, 50, 0.4);
}

#img_sol2 {
    background: 
        radial-gradient(circle at 35% 35%, 
            rgba(255, 150, 150, 1) 0%,
            rgba(255, 100, 100, 1) 30%,
            rgba(200, 50, 50, 1) 70%,
            rgba(150, 20, 20, 1) 100%
        );
    box-shadow: 
        inset -8px -8px 16px rgba(150, 20, 20, 0.8),
        inset 5px 5px 10px rgba(255, 200, 200, 0.6),
        0 0 20px rgba(255, 100, 100, 0.8),
        0 0 40px rgba(255, 100, 100, 0.4);
}

/* Modales */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    /* Hacer el modal desplazable en móviles */
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    /* Mejorar el desplazamiento táctil */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.modal-content {
    background: linear-gradient(135deg, 
        rgba(20, 30, 60, 0.95) 0%,
        rgba(40, 20, 60, 0.95) 50%,
        rgba(20, 30, 60, 0.95) 100%);
    padding: 30px;
    border: 2px solid #00ffff;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    color: white;
    box-shadow: 
        0 0 30px rgba(0, 255, 255, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    animation: modalAppear 0.5s ease-out;
    /* Asegurar que el contenido sea accesible */
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    margin: auto;
}

.modal h2 {
    color: #00ffff;
    margin-bottom: 20px;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    font-size: 24px;
}

.modal p {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 15px;
}

.modal-button {
    background: linear-gradient(45deg, #0066cc, #00aaff);
    border: none;
    color: white;
    padding: 15px 30px;
    margin: 8px 0; /* Margen vertical en lugar de horizontal */
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 170, 255, 0.3);
    width: 100%; /* Ancho completo */
    max-width: 300px; /* Ancho máximo para evitar botones muy anchos */
    display: block; /* Para que respete el width 100% */
    text-align: center;
}

.modal-button:hover {
    background: linear-gradient(45deg, #0088ff, #00ccff);
    box-shadow: 0 6px 20px rgba(0, 170, 255, 0.5);
    transform: translateY(-2px);
}

.modal-button.danger {
    background: linear-gradient(45deg, #cc0066, #ff0088);
    box-shadow: 0 4px 15px rgba(255, 0, 136, 0.3);
}

.modal-button.danger:hover {
    background: linear-gradient(45deg, #ff0088, #ff00aa);
    box-shadow: 0 6px 20px rgba(255, 0, 136, 0.5);
}

.modal ul {
    margin: 20px 0;
}

.modal li {
    margin: 8px 0;
    list-style: none;
}

/* Contenedor de botones para alineación vertical */
.modal-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
}

@keyframes modalAppear {
    0% { 
        opacity: 0; 
        transform: scale(0.7) rotateY(90deg);
    }
    100% { 
        opacity: 1; 
        transform: scale(1) rotateY(0deg);
    }
}

/* Área de pausa */
#pauseArea {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 500;
    cursor: pointer;
}

.pause-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 500;
    cursor: pointer;
}

/* Controles de desarrollo */
.dev-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ffff;
    border-radius: 10px;
    padding: 15px;
    color: white;
    font-size: 12px;
    z-index: 1001;
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.dev-controls h3 {
    color: #00ffff;
    margin-top: 0;
    font-size: 14px;
}

.dev-controls input {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #00ffff;
    color: white;
    padding: 5px;
    margin: 2px;
    border-radius: 3px;
    width: 50px;
    text-align: center;
}

.dev-controls button {
    background: linear-gradient(45deg, #0066cc, #00aaff);
    border: none;
    color: white;
    padding: 8px 15px;
    margin: 5px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s ease;
}

.dev-controls button:hover {
    background: linear-gradient(45deg, #0088ff, #00ccff);
    box-shadow: 0 2px 8px rgba(0, 170, 255, 0.3);
}

/* Botón de Carta de Experiencia */
.carta-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 100px;
    height: 140px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 600;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 15px rgba(255, 200, 0, 0.6));
}

.carta-button:hover {
    transform: scale(1.1) translateY(-5px);
    filter: drop-shadow(0 8px 25px rgba(255, 200, 0, 0.9));
}

.carta-button:active {
    transform: scale(0.95);
}

.carta-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Modal de Carta */
.carta-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.carta-modal.show {
    opacity: 1;
}

.carta-modal.show .carta-contenido {
    transform: scale(1) rotateY(0deg);
    opacity: 1;
}

.carta-contenido {
    position: relative;
    width: 90vw;
    max-width: 600px;
    height: 85vh;
    max-height: 800px;
    background: #ffffff;
    border: 3px solid #000000;
    border-radius: 40px;
    padding: 50px 40px;
    box-shadow:
        0 0 50px rgba(255, 200, 0, 0.4),
        inset 0 0 30px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0.7) rotateY(90deg);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.carta-texto {
    font-size: clamp(16px, 3vw, 24px);
    line-height: 1.6;
    color: #000000;
    text-align: center;
    overflow-y: auto;
    max-height: 100%;
    padding: 20px;
    text-shadow: none;
}

.carta-texto::-webkit-scrollbar {
    width: 8px;
}

.carta-texto::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 10px;
}

.carta-texto::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.carta-texto::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

.carta-cerrar {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(255, 0, 0, 0.8);
    border: 2px solid #000000;
    border-radius: 50%;
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.carta-cerrar:hover {
    background: rgba(255, 0, 0, 1);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.8);
}

/* Responsividad para móviles */
@media (max-width: 768px) {
    .carta-button {
        width: 70px;
        height: 98px;
        bottom: 20px;
        right: 20px;
    }

    .carta-contenido {
        width: 95vw;
        height: 90vh;
        padding: 40px 25px;
        border-radius: 30px;
    }

    .carta-texto {
        font-size: clamp(14px, 4vw, 20px);
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .carta-button {
        width: 60px;
        height: 84px;
        bottom: 15px;
        right: 15px;
    }

    .carta-contenido {
        border-radius: 25px;
        padding: 35px 20px;
    }
}