/* ==========================================================================
   QUIZ IA - ESTILOS PRINCIPALES (SISTEMA DE DISEÑO RESPONSIVO COMPLETO)
   Adaptación fluida de 100% de pantalla para Computadora / Laptop / Tablet / Móvil
   ========================================================================== */

:root {
    --bg-dark: #121318;
    --bg-dark-card: #1C1E26;
    --bg-dark-surface: #242732;
    --bg-light: #F8FAFC;
    --card-light: #FFFFFF;
    
    --primary-yellow: #FFCE31;
    --primary-yellow-hover: #EAB308;
    --primary-yellow-subtle: #FFFBEB;
    
    --success-green: #22C55E;
    --success-bg: #EDFDF2;
    
    --danger-red: #EF4444;
    --danger-bg: #FEF2F2;
    --danger-border: #FCA5A5;
    
    --text-primary-dark: #FFFFFF;
    --text-secondary-dark: #94A3B8;
    --text-primary-light: #0F172A;
    --text-secondary-light: #64748B;
    
    --border-subtle: #E2E8F0;
    --border-dark: #2E3342;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.12);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    --font-heading: 'Poppins', -apple-system, sans-serif;
    --font-body: 'Inter', -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    color: var(--text-primary-light);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* ==========================================================================
   CONTENEDOR DE LA APLICACIÓN: 100% DE PANTALLA (COMPUTADORA Y MÓVIL)
   ========================================================================== */
#app-wrapper {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#app-container {
    width: 100%;
    min-height: 100vh;
    background-color: var(--bg-light);
    display: flex;
    flex-direction: column;
    position: relative;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border: none;
    border-radius: 0;
}

/* ==========================================================================
   HEADER GLOBAL (ANCHO COMPLETO)
   ========================================================================== */
.app-header {
    background-color: var(--bg-dark);
    color: var(--text-primary-dark);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-dark);
    z-index: 20;
    flex-shrink: 0;
    width: 100%;
}

@media (min-width: 900px) {
    .app-header {
        padding: 18px 48px;
    }
}

.header-brand { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}
.brand-icon { 
    width: 38px; 
    height: 38px; 
    background: linear-gradient(135deg, var(--primary-yellow), #F59E0B); 
    color: var(--bg-dark); 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 20px; 
    box-shadow: 0 2px 10px rgba(255, 206, 49, 0.35); 
}
.brand-title { 
    font-family: var(--font-heading); 
    font-weight: 800; 
    font-size: 20px; 
    letter-spacing: -0.5px; 
}
.brand-title .highlight { color: var(--primary-yellow); }
.header-actions { display: flex; align-items: center; gap: 14px; }

.user-badge {
    background: var(--bg-dark-surface);
    color: var(--text-primary-dark);
    padding: 6px 14px 6px 16px;
    border-radius: var(--radius-full);
    display: flex; 
    align-items: center; 
    gap: 10px;
    font-size: 14px; 
    font-weight: 600; 
    cursor: pointer;
    border: 1px solid var(--border-dark); 
    transition: var(--transition);
}
.user-badge:hover { 
    border-color: var(--primary-yellow); 
    background-color: #2e3240;
}
.avatar-circle { 
    width: 26px; 
    height: 26px; 
    background: var(--primary-yellow); 
    color: var(--bg-dark); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 12px; 
}

/* ==========================================================================
   SISTEMA DE PANTALLAS (TRANSICIONES Y CONTENEDORES RESPONSIVOS)
   ========================================================================== */
.screen {
    display: none; 
    flex: 1; 
    width: 100%;
    overflow-y: auto; 
    overflow-x: hidden;
    position: relative; 
    background: var(--bg-light); 
    opacity: 0;
    transform: translateY(6px); 
    transition: opacity 0.25s ease, transform 0.25s ease;
}
.screen.active { 
    display: flex; 
    flex-direction: column; 
    opacity: 1; 
    transform: translateY(0); 
}

.screen-content { 
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px; 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
}

@media (min-width: 900px) {
    .screen-content {
        padding: 36px 32px;
    }
}

.center-content { 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    text-align: center; 
}

/* Tipografía */
h1, h2, h3, h4 { font-family: var(--font-heading); color: var(--text-primary-light); }
.text-yellow { color: var(--primary-yellow) !important; }
.text-green { color: var(--success-green) !important; }
.text-red { color: var(--danger-red) !important; }
.hidden { display: none !important; }
.w-100 { width: 100%; } 
.mt-20 { margin-top: 20px; } 
.mt-25 { margin-top: 25px; } 
.mt-35 { margin-top: 35px; } 
.mb-10 { margin-bottom: 10px; }

/* Botones */
button { 
    font-family: var(--font-heading); 
    border: none; 
    border-radius: var(--radius-md); 
    padding: 13px 22px; 
    font-size: 15px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: var(--transition); 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 10px; 
}
.btn-primary { 
    background-color: var(--primary-yellow); 
    color: var(--bg-dark); 
    box-shadow: 0 4px 14px rgba(255, 206, 49, 0.35); 
}
.btn-primary:hover { 
    background-color: var(--primary-yellow-hover); 
    transform: translateY(-2px); 
    box-shadow: 0 6px 20px rgba(255, 206, 49, 0.45); 
}
.btn-large { 
    padding: 16px 28px; 
    font-size: 16px; 
    border-radius: var(--radius-md); 
}
.btn-secondary { 
    background-color: var(--card-light); 
    color: var(--text-primary-light); 
    border: 1.5px solid var(--border-subtle); 
    box-shadow: var(--shadow-soft); 
}
.btn-secondary:hover { 
    background-color: #F1F5F9; 
    border-color: #CBD5E1; 
}
.btn-back { 
    background: transparent; 
    color: var(--text-secondary-light); 
    padding: 8px 14px; 
    font-size: 14px; 
    font-weight: 600; 
    align-self: flex-start; 
}
.btn-back:hover { color: var(--text-primary-light); }
.btn-danger { background: #FEE2E2; color: var(--danger-red); border: 1px solid var(--danger-border); }
.btn-danger:hover { background: var(--danger-red); color: white; }

/* ==========================================================================
   PANTALLA 0: LOGIN / REGISTRO
   ========================================================================== */
#screen-login { 
    background-color: var(--bg-dark); 
    color: var(--text-primary-dark); 
    justify-content: center;
    align-items: center;
}
#screen-login .screen-content {
    max-width: 480px;
    justify-content: center;
    align-items: center;
}
.logo-hero-pulse { 
    width: 80px; 
    height: 80px; 
    background: linear-gradient(135deg, var(--primary-yellow), #D97706); 
    color: var(--bg-dark); 
    border-radius: 24px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 38px; 
    margin-bottom: 24px; 
    box-shadow: 0 0 40px rgba(255, 206, 49, 0.4); 
    animation: pulseGlow 2.5s infinite; 
}
@keyframes pulseGlow { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.welcome-title { font-size: 28px; font-weight: 800; color: var(--text-primary-dark); margin-bottom: 12px; }
.welcome-subtitle { color: var(--text-secondary-dark); font-size: 15px; line-height: 1.6; max-width: 400px; margin-bottom: 32px; }
.login-card { background: var(--bg-dark-card); border: 1px solid var(--border-dark); padding: 28px; border-radius: var(--radius-lg); width: 100%; text-align: left; box-shadow: var(--shadow-card); }
.input-label { font-size: 14px; font-weight: 600; color: var(--text-secondary-dark); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.custom-input-box { display: flex; flex-direction: column; gap: 14px; }
.custom-input-box input { background: var(--bg-dark-surface); border: 1px solid var(--border-dark); color: var(--text-primary-dark); padding: 15px 18px; border-radius: var(--radius-md); font-size: 15px; outline: none; font-family: inherit; transition: var(--transition); }
.custom-input-box input:focus { border-color: var(--primary-yellow); box-shadow: 0 0 0 3px rgba(255, 206, 49, 0.2); }

/* ==========================================================================
   PANTALLA 1: INICIO (HOME) - RESPONSIVO COMPUTADORA
   ========================================================================== */
#screen-start { 
    background: var(--bg-dark); 
    color: var(--text-primary-dark); 
    justify-content: center;
}
.start-screen-layout { 
    align-items: center; 
    text-align: center; 
    justify-content: center;
    gap: 20px;
}
.hero-headline { font-size: 28px; font-weight: 800; line-height: 1.25; color: var(--text-primary-dark); margin-bottom: 12px; }
.hero-subtext { font-size: 14px; color: var(--text-secondary-dark); line-height: 1.6; max-width: 450px; margin: 0 auto; }
.mascot-container { position: relative; width: 180px; height: 180px; margin: 15px auto; display: flex; align-items: center; justify-content: center; }
.robot-mascot-svg { width: 100%; height: 100%; z-index: 2; filter: drop-shadow(0 10px 20px rgba(0,0,0,0.35)); animation: floatRobot 4s ease-in-out infinite; }
@keyframes floatRobot { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.action-buttons-group { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 320px; margin-bottom: 20px; }
.features-badge-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; max-width: 500px; }
.feature-card { background: var(--bg-dark-card); border: 1px solid var(--border-dark); padding: 14px 12px; border-radius: var(--radius-md); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.feat-icon { width: 38px; height: 38px; background: var(--bg-dark-surface); color: var(--primary-yellow); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.feature-card span { font-size: 12px; font-weight: 600; color: var(--text-secondary-dark); }

/* Adaptación Home a Computadora */
@media (min-width: 900px) {
    .start-screen-layout {
        display: grid;
        grid-template-columns: 1.2fr 0.8fr;
        grid-template-rows: auto auto;
        gap: 40px 60px;
        align-items: center;
        text-align: left;
        max-width: 1100px;
        margin: auto;
        padding: 40px 32px;
    }
    .hero-text-block {
        grid-column: 1;
        grid-row: 1;
        text-align: left;
    }
    .hero-headline {
        font-size: 46px;
        line-height: 1.15;
    }
    .hero-subtext {
        font-size: 17px;
        max-width: 540px;
        margin: 0;
    }
    .mascot-container {
        grid-column: 2;
        grid-row: 1;
        width: 280px;
        height: 280px;
        margin: 0 auto;
    }
    .action-buttons-group {
        grid-column: 1;
        grid-row: 2;
        margin: 0;
        max-width: 340px;
    }
    .features-badge-grid {
        grid-column: 2;
        grid-row: 2;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
        max-width: 100%;
    }
    .feature-card {
        padding: 16px 14px;
    }
    .feature-card span {
        font-size: 13px;
    }
}

/* ==========================================================================
   PANTALLA 2: CONFIGURACIÓN - RESPONSIVO COMPUTADORA
   ========================================================================== */
#screen-config .screen-content {
    max-width: 980px;
}
.config-header { margin-bottom: 24px; }
.config-header h2 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.config-header p { font-size: 14px; color: var(--text-secondary-light); }
.form-section { margin-bottom: 26px; }
.section-label { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--text-primary-light); margin-bottom: 14px; text-transform: uppercase; letter-spacing: 0.5px; }

.topics-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 12px; 
    margin-bottom: 14px; 
}
@media (min-width: 600px) {
    .topics-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 900px) {
    .topics-grid { 
        grid-template-columns: repeat(6, 1fr); 
        gap: 16px; 
    }
}

.topic-card { 
    background: var(--card-light); 
    border: 1.5px solid var(--border-subtle); 
    padding: 18px 12px; 
    border-radius: var(--radius-md); 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    gap: 10px; 
    cursor: pointer; 
    transition: var(--transition); 
    text-align: center; 
    box-shadow: var(--shadow-soft); 
}
.topic-card i { font-size: 24px; color: var(--text-secondary-light); transition: var(--transition); }
.topic-card span { font-size: 12px; font-weight: 600; color: var(--text-primary-light); }
.topic-card:hover { border-color: #CBD5E1; transform: translateY(-2px); }
.topic-card.active { background: var(--primary-yellow); border-color: var(--primary-yellow); box-shadow: 0 4px 18px rgba(255, 206, 49, 0.4); }
.topic-card.active i, .topic-card.active span { color: var(--bg-dark); }

.btn-custom-topic { width: 100%; background: var(--card-light); border: 1.5px dashed var(--border-subtle); padding: 14px 18px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: space-between; font-size: 14px; color: var(--text-primary-light); cursor: pointer; }
.btn-custom-topic:hover { border-color: var(--primary-yellow); }
.custom-topic-input-container { margin-top: 12px; }
.custom-topic-input-container input { width: 100%; padding: 14px 16px; border-radius: var(--radius-sm); border: 1.5px solid var(--primary-yellow); outline: none; font-size: 15px; font-family: inherit; }

.difficulty-cards-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.diff-card { background: var(--card-light); border: 1.5px solid var(--border-subtle); padding: 16px 12px; border-radius: var(--radius-md); display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; transition: var(--transition); }
.diff-emoji { font-size: 24px; } 
.diff-title { font-size: 14px; font-weight: 700; }
.diff-easy.active { background: var(--success-bg); border-color: var(--success-green); color: var(--success-green); }
.diff-medium.active { background: var(--primary-yellow-subtle); border-color: var(--primary-yellow); color: #B45309; }
.diff-hard.active { background: var(--danger-bg); border-color: var(--danger-red); color: var(--danger-red); }

.chips-selector { display: flex; gap: 12px; }
.chip-btn { flex: 1; background: var(--card-light); border: 1.5px solid var(--border-subtle); padding: 12px; border-radius: var(--radius-md); font-size: 15px; font-weight: 700; color: var(--text-primary-light); cursor: pointer; }
.chip-btn.active { background: var(--primary-yellow); border-color: var(--primary-yellow); color: var(--bg-dark); }

/* ==========================================================================
   PANTALLA 3: QUIZ - RESPONSIVO COMPUTADORA
   ========================================================================== */
.quiz-hud-bar { 
    background: var(--bg-dark); 
    color: var(--text-primary-dark); 
    padding: 14px 24px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    font-size: 14px; 
    font-weight: 600; 
    width: 100%;
}
@media (min-width: 900px) {
    .quiz-hud-bar {
        padding: 16px 48px;
        font-size: 15px;
    }
}
.hud-item { display: flex; align-items: center; gap: 8px; }
.score-hud { font-weight: 700; font-size: 16px; }
.hearts-row { display: flex; gap: 6px; }
.heart-active { color: var(--danger-red); }
.heart-lost { color: #475569; opacity: 0.5; }
.timer-hud { background: var(--bg-dark-surface); padding: 5px 12px; border-radius: var(--radius-full); font-size: 13px; color: var(--primary-yellow); transition: color 0.3s ease; }
.timer-hud.time-warning { color: var(--danger-red); animation: pulseTimer 1s infinite; }
@keyframes pulseTimer { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.8; transform: scale(1.05); } }

.progress-track { height: 5px; background: var(--bg-dark-surface); width: 100%; }
.progress-fill { height: 100%; background: var(--primary-yellow); transition: width 0.3s ease; }

.quiz-content-layout { 
    flex: 1; 
    display: flex; 
    flex-direction: column;
    padding: 24px 20px; 
    gap: 24px; 
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

@media (min-width: 900px) {
    .quiz-content-layout {
        display: grid;
        grid-template-columns: 1fr 340px;
        gap: 40px;
        align-items: start;
        padding: 36px 32px;
    }
    .question-headline {
        font-size: 24px !important;
        margin-bottom: 28px !important;
    }
    .options-container {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 16px !important;
        margin-bottom: 30px !important;
    }
    .option-row-btn {
        padding: 18px 20px !important;
        font-size: 15px !important;
    }
    .lifelines-bar {
        max-width: 380px;
    }
}

.question-main-column { flex: 1; display: flex; flex-direction: column; }
.topic-badge { background: #E2E8F0; color: var(--text-secondary-light); font-size: 12px; font-weight: 700; padding: 5px 14px; border-radius: var(--radius-full); align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; text-transform: uppercase; }
.question-headline { font-size: 19px; font-weight: 700; line-height: 1.4; margin-bottom: 22px; }

.options-container { display: flex; flex-direction: column; gap: 12px; margin-bottom: 25px; flex: 1; }
.option-row-btn { background: var(--card-light); border: 1.5px solid var(--border-subtle); padding: 15px 18px; border-radius: var(--radius-md); display: flex; align-items: center; gap: 14px; font-size: 14px; font-weight: 500; color: var(--text-primary-light); cursor: pointer; text-align: left; box-shadow: var(--shadow-soft); transition: var(--transition); }
.option-letter { width: 32px; height: 32px; border-radius: 50%; background: #F1F5F9; color: var(--text-secondary-light); font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.option-row-btn:hover { border-color: #CBD5E1; background: #F8FAFC; transform: translateY(-1px); }
.option-row-btn.selected { background: var(--primary-yellow-subtle); border-color: var(--primary-yellow); font-weight: 600; }
.option-row-btn.selected .option-letter { background: var(--primary-yellow); color: var(--bg-dark); }

/* Comodines */
.lifelines-bar { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: auto; }
.lifeline-btn { position: relative; background: var(--card-light); border: 1.5px solid var(--border-subtle); padding: 12px; border-radius: var(--radius-md); display: flex; flex-direction: column; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; color: var(--text-primary-light); cursor: pointer; box-shadow: var(--shadow-soft); }
.lifeline-btn:disabled { opacity: 0.5; cursor: not-allowed; background: #F1F5F9; }
.lifeline-btn i { font-size: 18px; color: #D97706; }
.lifeline-badge { position: absolute; top: -6px; right: -6px; background: var(--bg-dark); color: white; border-radius: 50%; width: 22px; height: 22px; font-size: 11px; display: flex; align-items: center; justify-content: center; border: 2px solid white; }

/* Panel Lateral (Desktop) */
.horizontal-side-panel { 
    display: none; 
    width: 100%; 
    background: var(--card-light); 
    border: 1px solid var(--border-subtle); 
    border-radius: var(--radius-lg); 
    padding: 24px; 
    flex-direction: column; 
    gap: 18px; 
    box-shadow: var(--shadow-soft);
}
@media (min-width: 900px) {
    .horizontal-side-panel { display: flex; }
}
.side-panel-header { font-size: 14px; font-weight: 700; color: var(--text-secondary-light); display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--border-subtle); padding-bottom: 12px; }
.side-info-card { background: #F8FAFC; padding: 14px; border-radius: var(--radius-sm); display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.side-hint-box { background: #FFFBEB; border-left: 3px solid var(--primary-yellow); padding: 14px; border-radius: 4px; font-size: 13px; line-height: 1.5; color: #92400E; display: flex; gap: 10px; margin-top: auto; }

/* ==========================================================================
   PANTALLAS FEEDBACK, RESULTADOS, REVIEW Y RECOMENDACIONES (RESPONSIVOS)
   ========================================================================== */
.feedback-layout { max-width: 780px; margin: 0 auto; }
.minimal-hud { background: transparent; color: var(--text-primary-light); border-bottom: 1px solid var(--border-subtle); padding: 10px 0; }
.feedback-card { background: var(--card-light); border-radius: var(--radius-lg); padding: 32px 24px; text-align: center; box-shadow: var(--shadow-card); margin-top: 20px; display: flex; flex-direction: column; align-items: center; }
.feedback-badge-icon { width: 70px; height: 70px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 32px; margin-bottom: 18px; }
.feedback-card.is-correct .feedback-badge-icon { background: var(--success-bg); color: var(--success-green); border: 3px solid var(--success-green); }
.feedback-card.is-incorrect .feedback-badge-icon { background: var(--danger-bg); color: var(--danger-red); border: 3px solid var(--danger-red); }
.feedback-status-title { font-size: 24px; font-weight: 800; margin-bottom: 16px; }
.feedback-card.is-correct .feedback-status-title { color: var(--success-green); }
.feedback-card.is-incorrect .feedback-status-title { color: var(--danger-red); }
.feedback-explanation-box { background: #F8FAFC; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 18px; text-align: left; width: 100%; font-size: 14px; line-height: 1.6; margin-bottom: 14px; }
.exp-title { font-weight: 700; margin-bottom: 6px; color: var(--text-primary-light); display: flex; align-items: center; gap: 6px; }
.feedback-hint-box { background: #FFFBEB; border: 1px solid #FEF3C7; border-radius: var(--radius-md); padding: 16px; text-align: left; width: 100%; font-size: 13px; color: #92400E; line-height: 1.5; }
.hint-title { font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }

/* Level Up / Trophy */
.level-up-layout { background: var(--bg-dark); color: var(--text-primary-dark); }
.trophy-celebration { position: relative; width: 120px; height: 120px; margin-bottom: 25px; display: flex; align-items: center; justify-content: center; }
.trophy-glow { position: absolute; width: 140px; height: 140px; background: radial-gradient(circle, rgba(255, 206, 49, 0.3) 0%, transparent 70%); }
.trophy-icon { font-size: 72px; color: var(--primary-yellow); z-index: 2; filter: drop-shadow(0 6px 16px rgba(255, 206, 49, 0.5)); }
.level-up-title { font-size: 30px; font-weight: 800; margin-bottom: 10px; color: var(--text-primary-dark); }
.level-up-subtitle { color: var(--text-secondary-dark); font-size: 15px; margin-bottom: 40px; }
.level-stepper { display: flex; align-items: center; justify-content: center; gap: 0; width: 100%; max-width: 320px; }
.step-item { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; z-index: 2; }
.step-dot { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 15px; background: var(--bg-dark-surface); color: var(--text-secondary-dark); border: 2px solid var(--border-dark); }
.step-completed .step-dot { background: var(--success-green); color: white; border-color: var(--success-green); }
.step-current .step-dot { background: var(--primary-yellow); color: var(--bg-dark); border-color: var(--primary-yellow); box-shadow: 0 0 16px rgba(255, 206, 49, 0.5); }
.step-locked .step-dot { opacity: 0.6; }
.step-line { flex: 1; height: 3px; background: var(--border-dark); margin: 0 -5px 22px; z-index: 1; }

/* Resultados */
.results-layout { max-width: 880px; margin: 0 auto; }
.results-hero { text-align: center; margin-bottom: 28px; }
.trophy-mini-badge { width: 68px; height: 68px; background: linear-gradient(135deg, var(--primary-yellow), #D97706); color: var(--bg-dark); border-radius: 20px; display: inline-flex; align-items: center; justify-content: center; font-size: 32px; margin-bottom: 14px; box-shadow: 0 6px 20px rgba(255, 206, 49, 0.4); }
.results-hero h1 { font-size: 28px; font-weight: 800; }
.results-sub { font-size: 14px; color: var(--text-secondary-light); }

.results-stats-grid { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 14px; 
    margin-bottom: 24px; 
}
@media (min-width: 768px) {
    .results-stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-card { background: var(--card-light); border: 1px solid var(--border-subtle); padding: 18px 16px; border-radius: var(--radius-md); box-shadow: var(--shadow-soft); text-align: center; }
.stat-card-label { font-size: 12px; font-weight: 600; color: var(--text-secondary-light); display: block; margin-bottom: 8px; }
.stat-card-value { font-size: 24px; font-weight: 800; }

.performance-bar-box { background: var(--card-light); border: 1px solid var(--border-subtle); padding: 16px 20px; border-radius: var(--radius-md); margin-bottom: 28px; box-shadow: var(--shadow-soft); }
.perf-header { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.perf-track { height: 10px; background: #E2E8F0; border-radius: var(--radius-full); overflow: hidden; }
.perf-fill { height: 100%; background: linear-gradient(90deg, var(--primary-yellow), var(--success-green)); border-radius: var(--radius-full); }

.results-actions-list { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 768px) {
    .results-actions-list {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    .results-actions-list #btn-return-home {
        grid-column: 1 / -1;
    }
}
.arrow-end { margin-left: auto; font-size: 12px; color: var(--text-secondary-light); }

/* Review */
#screen-review .screen-content { max-width: 920px; }
.review-header { margin-bottom: 20px; }
.review-header h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.review-questions-list { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.review-item-card { background: var(--card-light); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 18px; box-shadow: var(--shadow-soft); }
.review-item-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.review-item-badge { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }
.review-item-badge.correct { background: var(--success-bg); color: var(--success-green); }
.review-item-badge.incorrect { background: var(--danger-bg); color: var(--danger-red); }
.review-item-question { font-size: 14px; font-weight: 600; line-height: 1.4; }
.review-details { font-size: 13px; padding-left: 40px; display: flex; flex-direction: column; gap: 6px; }
.user-ans-text { color: var(--text-secondary-light); }
.correct-ans-text { color: var(--success-green); font-weight: 600; }

/* Recomendaciones */
#screen-recommendations .screen-content { max-width: 920px; }
.ai-recommendations-banner { background: #ECFDF5; border: 1px solid #A7F3D0; border-radius: var(--radius-lg); padding: 20px; display: flex; gap: 16px; margin-bottom: 24px; }
.banner-icon-brain { width: 50px; height: 50px; background: var(--success-green); color: white; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; flex-shrink: 0; }
.banner-text h3 { font-size: 17px; font-weight: 700; color: #065F46; margin-bottom: 4px; }
.banner-text p { font-size: 13px; color: #047857; line-height: 1.5; }
.recommendations-container { display: flex; flex-direction: column; gap: 14px; }
.rec-card-row { background: var(--card-light); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; box-shadow: var(--shadow-soft); }
.rec-card-info { display: flex; flex-direction: column; gap: 4px; }
.rec-card-info h4 { font-size: 15px; font-weight: 700; }
.rec-card-info span { font-size: 12px; color: var(--text-secondary-light); }
.btn-practice { background: var(--bg-dark); color: var(--text-primary-dark); font-size: 13px; font-weight: 600; padding: 10px 18px; border-radius: var(--radius-sm); }
.btn-practice:hover { background: var(--primary-yellow); color: var(--bg-dark); }

/* Modales */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(18, 19, 24, 0.75); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 999; }
.modal-card { background: var(--card-light); border-radius: var(--radius-lg); width: 100%; max-width: 400px; padding: 26px; box-shadow: var(--shadow-card); }
.modal-danger { border-top: 5px solid var(--danger-red); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h3 { font-size: 18px; font-weight: 700; }
.btn-close-icon { background: transparent; border: none; font-size: 20px; color: var(--text-secondary-light); cursor: pointer; padding: 5px; }

/* Perfil Modal */
.profile-summary { display: flex; flex-direction: column; align-items: center; margin-bottom: 20px; }
.profile-big-avatar { width: 64px; height: 64px; background: var(--primary-yellow); color: var(--bg-dark); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 28px; margin-bottom: 10px; }
.profile-summary h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.profile-level-badge { background: #E2E8F0; font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: var(--radius-full); }
.profile-stats-list { background: #F8FAFC; border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 22px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.pstat-item { display: flex; justify-content: space-between; }

/* Loading Overlay */
.loading-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(18, 19, 24, 0.94); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; color: white; text-align: center; }
.loading-box { display: flex; flex-direction: column; align-items: center; max-width: 340px; }
.loading-box h3 { color: white; font-size: 20px; font-weight: 700; margin-top: 20px; margin-bottom: 8px; }
.loading-box p { color: var(--text-secondary-dark); font-size: 14px; line-height: 1.5; }
.ai-orbit-spinner { width: 64px; height: 64px; border: 3px solid rgba(255, 206, 49, 0.15); border-top: 3px solid var(--primary-yellow); border-radius: 50%; animation: spin 1s linear infinite; display: flex; align-items: center; justify-content: center; }
.inner-dot { width: 14px; height: 14px; background: var(--primary-yellow); border-radius: 50%; box-shadow: 0 0 12px var(--primary-yellow); }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Ecuaciones Matemáticas KaTeX */
.katex { font-size: 1.15em; color: #1e293b; }
.option-row-btn .katex { color: var(--text-primary-light); }
.katex-display { margin: 12px 0; overflow-x: auto; overflow-y: hidden; }
