/* ============================================
   TEMA ESPACIAL OSCURO Y GAMIFICADO
   ============================================ */

/* Fuentes espaciales */
p, span, h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
}

.be-vietnam-pro-bold {
    font-family: "Fredoka", sans-serif;
    font-weight: 700;
    font-style: normal;
  }
  


.space-font-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.space-font-body {
    font-family: 'Poppins', sans-serif;
    font-weight: 400;
}





/* ============================================
   FONDO Y EFECTOS ESPACIALES
   ============================================ */

.space-bg {
    background: black;
    animation: spaceGradient 15s ease infinite;
    position: relative;
    overflow: hidden;
}

@keyframes spaceGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Contenedor de estrellas */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.stars-container::before,
.stars-container::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

.stars-container::before {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
    box-shadow: 
        15% 25% 0 0 white,
        35% 45% 0 0 white,
        55% 15% 0 0 white,
        75% 35% 0 0 white,
        85% 60% 0 0 white,
        25% 75% 0 0 white,
        45% 85% 0 0 white,
        65% 95% 0 0 white,
        5% 50% 0 0 white,
        95% 20% 0 0 white,
        10% 80% 0 0 white,
        90% 40% 0 0 white,
        30% 10% 0 0 white,
        70% 70% 0 0 white,
        50% 30% 0 0 white;
}

.stars-container::after {
    top: 40%;
    left: 30%;
    animation-delay: 1.5s;
    box-shadow: 
        20% 30% 0 0 rgba(255, 255, 255, 0.8),
        40% 50% 0 0 rgba(255, 255, 255, 0.8),
        60% 20% 0 0 rgba(255, 255, 255, 0.8),
        80% 40% 0 0 rgba(255, 255, 255, 0.8),
        10% 70% 0 0 rgba(255, 255, 255, 0.8),
        50% 90% 0 0 rgba(255, 255, 255, 0.8),
        70% 10% 0 0 rgba(255, 255, 255, 0.8),
        30% 60% 0 0 rgba(255, 255, 255, 0.8),
        90% 80% 0 0 rgba(255, 255, 255, 0.8),
        15% 15% 0 0 rgba(255, 255, 255, 0.8);
}

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

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

/* Canvas de partículas */
.particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

/* ============================================
   PANTALLAS Y TRANSICIONES
   ============================================ */

.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    opacity: 0;
    transform: scale(0.98);
    pointer-events: none;
    overflow-y: auto;
    overflow-x: hidden;
}

.screen.is-active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.hidden {
    display: none;
}

/* ============================================
   TARJETAS Y CONTENEDORES
   ============================================ */

.glass-card {
    background: #e84422;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(232, 68, 34, 0.3);
    box-shadow: 
        0 8px 32px 0 rgba(0, 0, 0, 0.37),
        inset 0 0 20px rgba(232, 68, 34, 0.1);
}

.space-card-pregunta {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 2px solid rgba(57, 254, 144, 0.4);
    box-shadow: 
        0 8px 32px 0 rgba(0, 0, 0, 0.5),
        0 0 40px rgba(232, 68, 34, 0.2),
        inset 0 0 30px rgba(232, 68, 34, 0.1);
}

.space-card {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 2px solid rgba(232, 68, 34, 0.4);
    box-shadow: 
        0 8px 32px 0 rgba(0, 0, 0, 0.5),
        0 0 40px rgba(232, 68, 34, 0.2),
        inset 0 0 30px rgba(232, 68, 34, 0.1);
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(232, 68, 34, 0.3) 0%, transparent 70%);
    animation: rotateGlow 8s linear infinite;
    pointer-events: none;
}

@keyframes rotateGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   BOTONES
   ============================================ */

.space-btn {
    background: linear-gradient(135deg, #e84422 0%, #ff6b3d 50%, #ff9a72 100%);
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
    border: 2px solid rgba(232, 68, 34, 0.5);
    box-shadow: 
        0 0 20px rgba(232, 68, 34, 0.5),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.space-btn:hover {
    box-shadow: 
        0 0 30px rgba(232, 68, 34, 0.8),
        inset 0 0 30px rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.glow-btn {
    position: relative;
    overflow: hidden;
}

.glow-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.glow-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* ============================================
   INPUTS
   ============================================ */

.space-input {
    background: rgb(20 9 8 / 80%);
    border: 2px solid rgba(232, 68, 34, 0.3);
    color: #e0e7ff;
    font-size: 1rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.space-input:focus {
    border-color: #e84422;
    box-shadow: 0 0 20px rgba(232, 68, 34, 0.5);
    background: rgba(42, 31, 15, 0.9);
}

.space-input::placeholder {
    color: rgba(224, 231, 255, 0.5);
}

/* ============================================
   LOGO Y EFECTOS VISUALES
   ============================================ */

.space-logo-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-space-logo {
    animation: floatSpace 4s ease-in-out infinite;
    filter: drop-shadow(0 0 30px rgba(232, 68, 34, 0.6));
}

@keyframes floatSpace {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
    }
    25% { 
        transform: translateY(-20px) rotate(2deg);
    }
    75% { 
        transform: translateY(-10px) rotate(-2deg);
    }
}

.glow-effect {
    filter: drop-shadow(0 0 20px rgba(232, 68, 34, 0.8)) 
            drop-shadow(0 0 40px rgba(232, 68, 34, 0.4));
}

.pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 3px solid rgba(57, 254, 144, 0.5);
    border-radius: 50%;
    opacity: 0.5;
    animation: pulseRing 2s ease-out infinite;
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.space-title {
    text-shadow: 
        0 0 10px rgba(232, 68, 34, 0.8),
        0 0 20px rgba(232, 68, 34, 0.6),
        0 0 30px rgba(232, 68, 34, 0.4);
}

.space-subtitle {
    text-shadow: 0 0 10px rgba(6, 182, 212, 0.6);
}

/* ============================================
   OPCIONES DE RESPUESTA
   ============================================ */

.option-btn {
    color: #ffffff;
    padding: 2rem;
    border-radius: 1rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(232, 68, 34, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.option-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(232, 68, 34, 0.3), transparent);
    transition: left 0.5s;
}

.option-btn:hover::before {
    left: 100%;
}

.option-btn:hover {
    border-color: #e84422;
    background: rgba(232, 68, 34, 0.75);
    color: #ffffff;
    transform: translateY(-5px) scale(1.02);
    box-shadow: 
        0 10px 30px rgba(232, 68, 34, 0.5),
        0 0 20px rgba(232, 68, 34, 0.4);
}

.option-btn.selected {
    border-color: #e84422;
    background: linear-gradient(135deg, rgba(232, 68, 34, 0.4), rgba(255, 107, 61, 0.4));
    color: #ffffff;
    box-shadow: 
        0 0 30px rgba(232, 68, 34, 0.7),
        inset 0 0 20px rgba(232, 68, 34, 0.3);
    transform: scale(1.05);
}

.space-option-card {
    border: 2px solid rgba(232, 68, 34, 0.4);
    min-height: 200px;
}

.space-option-card span {
    color: #ffffff !important;
}

/* ============================================
   BARRAS DE PROGRESO Y GAMIFICACIÓN
   ============================================ */

.progress-bar-container {
    width: 100%;
    height: 12px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(232, 68, 34, 0.3);
    position: relative;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #e84422 0%, #ff6b3d 50%, #ff9a72 100%);
    background-size: 200% 100%;
    animation: progressGlow 2s ease infinite;
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 0 10px rgba(232, 68, 34, 0.6),
        inset 0 0 10px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes progressGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.score-display {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(232, 68, 34, 0.4);
    box-shadow: 0 0 20px rgba(232, 68, 34, 0.3);
}

.level-badge {
    background: #00FAFD;
    backdrop-filter: blur(15px);
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.3);
}

.final-score-display {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(20px);
    border: 3px solid rgba(232, 68, 34, 0.6);
    box-shadow: 
        0 0 40px rgba(232, 68, 34, 0.5),
        inset 0 0 30px rgba(232, 68, 34, 0.2);
}

.points-earned {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(250, 204, 21, 0.5);
    box-shadow: 0 0 25px rgba(250, 204, 21, 0.4);
    animation: pulsePoints 1s ease infinite;
}

@keyframes pulsePoints {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ============================================
   PANTALLA DE FEEDBACK
   ============================================ */

#feedback-screen {
    background: rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.feedback-container {
    position: relative;
    background: rgba(15, 23, 42, 0.9);
    border: 3px solid rgba(232, 68, 34, 0.5);
    box-shadow: 
        0 0 50px rgba(232, 68, 34, 0.6),
        inset 0 0 40px rgba(232, 68, 34, 0.2);
}

.feedback-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(232, 68, 34, 0.4) 0%, transparent 70%);
    animation: rotateGlow 6s linear infinite;
    pointer-events: none;
}

.success-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 1;
}

@keyframes particleExplode {
    to {
        transform: translate(calc(-50% + var(--end-x, 0)), calc(-50% + var(--end-y, 0)));
        opacity: 0;
        scale: 0;
    }
}

/* ============================================
   LOGROS Y BADGES
   ============================================ */

.achievement-badge {
    position: relative;
    display: inline-block;
}

.achievement-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    border: 3px solid rgba(250, 204, 21, 0.6);
    border-radius: 50%;
    animation: achievementPulse 2s ease-out infinite;
}

@keyframes achievementPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.3);
        opacity: 0;
    }
}

/* ============================================
   ANIMACIONES
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.6s ease-out;
}

@keyframes slide-in-left {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.animate-slide-in-left {
    animation: slide-in-left 0.7s forwards;
}


/* ============================================
   COLORES PERSONALIZADOS
   ============================================ */

.bg-custom-orange {
    background-color: #e84422;
}

.hover\:bg-custom-orange-dark:hover {
    background-color: #d03d1e;
}

.text-custom-orange {
    color: #e84422;
}

/* ============================================
   ELEMENTOS VARIOS
   ============================================ */

i {
    display: inline;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {

    

    .space-title {
        font-size: 2.5rem;
    }
    
    .floating-space-logo {
        width: 300px !important;
    }
    
    .space-card {
        padding: 1.5rem;
    }
    
    /* Asegurar scroll en móvil */
    .screen {
        display: flex;           /* Necesario para flexbox */
        flex-direction: column;  /* Apilar elementos verticalmente */
        justify-content: center; /* Centrar verticalmente */
        align-items: center;     /* Centrar horizontalmente si quieres */
        padding-top: 2rem;
        padding-bottom: 2rem;
        min-height: 100vh;       /* Asegura que ocupe toda la altura de la pantalla */
    }

    #question-screen,
    #intro-question-screen,
    #extra-question-screen {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding-top: 3rem;
        padding-bottom: 3rem;
        min-height: 100vh;
    }
}