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

body {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Arial Rounded MT Bold', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#app {
    width: 100%;
    max-width: 700px;
}

.screen {
    display: none;
    animation: fadeIn 0.5s ease;
}

.screen.active {
    display: block;
}

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

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

@keyframes starPop {
    0% { transform: scale(0) rotate(0deg); }
    50% { transform: scale(1.3) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Pantalla de inicio */
.inicio-container {
    background: white;
    border-radius: 30px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.titulo-principal h1 {
    font-size: 2rem;
    color: #6c3483;
    margin-bottom: 10px;
}

.subtitulo {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

.lila-img {
    font-size: 4rem;
    margin: 20px 0;
    animation: bounce 2s infinite;
}

.instrucciones {
    font-size: 1rem;
    color: #555;
    margin-bottom: 30px;
    line-height: 1.5;
}

.btn-principal {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 1.3rem;
    font-family: inherit;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 8px 25px rgba(240, 147, 251, 0.4);
}

.btn-principal:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(240, 147, 251, 0.6);
}

.btn-principal:active {
    transform: translateY(0);
}

/* Pantalla de nivel */
.nivel-header {
    background: white;
    border-radius: 20px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.estrellas-counter {
    font-size: 1.3rem;
    font-weight: bold;
    color: #f39c12;
}

.nivel-titulo {
    font-size: 1rem;
    color: #6c3483;
    font-weight: bold;
    flex: 1;
    text-align: center;
}

.progreso-bar {
    width: 100%;
    height: 12px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
}

.progreso-fill {
    height: 100%;
    background: linear-gradient(90deg, #f093fb, #f5576c);
    border-radius: 10px;
    transition: width 0.5s ease;
    width: 0%;
}

.pregunta-container {
    background: white;
    border-radius: 25px;
    padding: 30px 25px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.2);
    min-height: 300px;
}

.categoria-badge {
    display: inline-block;
    background: linear-gradient(135deg, #a18cd1, #fbc2eb);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 15px;
    font-weight: bold;
}

.pregunta-texto {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 25px;
    line-height: 1.6;
}

.opciones-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-opcion {
    background: #f8f9fa;
    border: 3px solid #e0e0e0;
    padding: 15px 20px;
    font-size: 1rem;
    font-family: inherit;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    line-height: 1.4;
}

.btn-opcion:hover {
    border-color: #a18cd1;
    background: #f5f0ff;
    transform: translateX(5px);
}

.btn-opcion.correcta {
    border-color: #27ae60;
    background: #d4efdf;
    animation: bounce 0.5s;
}

.btn-opcion.incorrecta {
    border-color: #e74c3c;
    background: #fadbd8;
    animation: shake 0.5s;
}

.btn-opcion:disabled {
    cursor: default;
    opacity: 0.7;
}

/* Preguntas abiertas */
.input-abierta {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    font-family: inherit;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.3s;
}

.input-abierta:focus {
    outline: none;
    border-color: #a18cd1;
}

.btn-enviar {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1.1rem;
    font-family: inherit;
    border-radius: 30px;
    cursor: pointer;
    margin-top: 15px;
    transition: transform 0.2s;
}

.btn-enviar:hover {
    transform: scale(1.05);
}

/* Ordenar secuencia */
.secuencia-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.item-secuencia {
    background: #f8f9fa;
    border: 3px solid #e0e0e0;
    padding: 12px 18px;
    border-radius: 12px;
    cursor: grab;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    user-select: none;
}

.item-secuencia:active {
    cursor: grabbing;
    background: #f5f0ff;
    border-color: #a18cd1;
}

.item-secuencia .numero {
    background: #a18cd1;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.item-secuencia.selected {
    border-color: #f093fb;
    background: #fdf0ff;
}

/* Feedback */
.feedback-container {
    background: white;
    border-radius: 25px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 15px 50px rgba(0,0,0,0.2);
}

.feedback-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.feedback-titulo {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 10px;
}

.feedback-mensaje {
    font-size: 1rem;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.btn-siguiente {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 14px 35px;
    font-size: 1.1rem;
    font-family: inherit;
    border-radius: 30px;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-siguiente:hover {
    transform: scale(1.05);
}

/* Pantalla final */
.final-container {
    background: white;
    border-radius: 30px;
    padding: 40px 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.final-container h1 {
    font-size: 2rem;
    color: #6c3483;
    margin-bottom: 20px;
}

.final-estrellas {
    font-size: 2.5rem;
    margin: 20px 0;
    animation: starPop 1s ease;
}

.final-container p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 500px) {
    .titulo-principal h1 {
        font-size: 1.5rem;
    }
    .pregunta-texto {
        font-size: 1.05rem;
    }
    .btn-opcion {
        font-size: 0.95rem;
        padding: 12px 15px;
    }
}
