:root {
    --primary: #6C63FF; /* Violeta Tecno */
    --secondary: #FF6584; /* Rosa/Rojo suave */
    --accent: #43D9AD; /* Verde menta */
    --dark: #2D3436;
    --light: #F9F9F9;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--dark);
    overflow-x: hidden;
}

/* Contenedor Principal tipo Tarjeta */
.container {
    background: rgba(255, 255, 255, 0.95);
    width: 90%;
    max-width: 600px;
    padding: 2rem;
    border-radius: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
    position: relative;
    z-index: 10;
    backdrop-filter: blur(10px);
}

/* Tipografía */
h1 {
    font-family: 'Fredoka', cursive;
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 2.2rem;
}

h2 {
    font-family: 'Fredoka', cursive;
    color: var(--dark);
    margin-bottom: 1.5rem;
}

.subtitle {
    color: #666;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

/* Pantallas y Visibilidad */
.screen {
    animation: fadeIn 0.5s ease-in-out;
}

.hidden {
    display: none !important;
}

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

/* Botones Generales */
.btn-grid {
    display: grid;
    gap: 15px;
    margin-top: 1rem;
}

.btn-grid.schools { grid-template-columns: 1fr; }
.btn-grid.grades { grid-template-columns: repeat(2, 1fr); }
.btn-grid.options { grid-template-columns: 1fr; }

button {
    cursor: pointer;
    font-family: 'Fredoka', sans-serif;
    border: none;
    outline: none;
    transition: all 0.2s ease;
}

/* Botones de Acción (Escuela y Grado) */
.action-btn {
    background: white;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 15px;
    border-radius: 15px;
    font-size: 1.2rem;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.action-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(108, 99, 255, 0.3);
}

/* Botones de Opciones (Quiz) */
#options-container button {
    background: #f0f0f5;
    padding: 18px;
    border-radius: 12px;
    font-size: 1.1rem;
    text-align: left;
    color: var(--dark);
    font-weight: 600;
    border: 2px solid transparent;
}

#options-container button:hover:not(:disabled) {
    background: #e0e0e8;
    transform: scale(1.02);
}

/* Estados de Respuesta */
#options-container button.correct {
    background-color: var(--accent) !important;
    color: white !important;
    border-color: #2ecc71;
}

#options-container button.wrong {
    background-color: var(--secondary) !important;
    color: white !important;
    border-color: #e74c3c;
    opacity: 0.8;
}

/* Barra de Progreso */
.progress-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: 10px;
    height: 10px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.4s ease;
    border-radius: 10px;
}

/* Pantalla de Resultados */
.trophy-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

.score-display {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary);
    margin: 1rem 0;
}

.final-feedback-text {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.restart-btn {
    background: var(--secondary);
    color: white;
    padding: 15px 40px;
    font-size: 1.2rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(255, 101, 132, 0.4);
}

.restart-btn:hover {
    background: #ff4b6e;
    transform: scale(1.05);
}

/* Decoración de fondo */
.background-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.6;
}
.shape-1 {
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    top: -50px;
    left: -50px;
}
.shape-2 {
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.15);
    bottom: 50px;
    right: -50px;
}

/* Footer */
footer {
    position: absolute;
    bottom: 10px;
    color: rgba(255,255,255,0.7);
    font-size: 0.8rem;
    width: 100%;
    text-align: center;
}
.hidden {
    display: none !important;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-20px);}
    60% {transform: translateY(-10px);}
}

/* Media Queries para Celulares */
@media (max-width: 480px) {
    .container {
        padding: 1.5rem;
        width: 95%;
    }
    h1 { font-size: 1.8rem; }
    .btn-grid.grades { grid-template-columns: 1fr; }
}
/* Botón Volver */
.back-btn {
    background: transparent;
    border: none;
    color: #888;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px; /* Espacio entre flecha y texto */
    margin-bottom: 10px;
    padding: 5px 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-family: 'Fredoka', sans-serif;
}

.back-btn:hover {
    background-color: #f0f0f0;
    color: var(--primary); /* Se pone violeta al pasar el mouse */
    transform: translateX(-3px); /* Se mueve un poquito a la izquierda */
}