.trivial-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.trivial-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 3px solid #e3f2fd;
    position: relative;
}

.trivial-header::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
}

.trivial-container h1 {
    text-align: center;
    color: #2c3e50;
    margin: 0 0 20px 0;
    font-size: 2.5em;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    background: linear-gradient(45deg, #3498db, #2ecc71);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.cronometro-container {
    padding: 15px;
}

.cronometro {
    font-size: 1.2em;
    font-weight: 600;
    position: relative;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: block !important; /* Asegurar que siempre sea visible */
    visibility: visible !important; /* Forzar visibilidad */
    opacity: 1 !important; /* Forzar opacidad completa */
}

.cronometro .milisegundos {
    font-size: 0.7em;
    color: #3498db;
    vertical-align: super;
}

.cronometro-label {
    font-size: 0.7em;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

.inicio-trivial {
    text-align: center;
    margin-bottom: 30px;
    animation: fadeInUp 0.8s ease-out;
}

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

.progreso-trivial {
    text-align: center;
    font-size: 0.9em;
    color: #2c3e50;
    margin: 15px auto;
    padding: 15px;
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    max-width: 400px;
}

.progreso-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 10px;
}

.barra-progreso {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    margin-top: 10px;
}

.barra-progreso-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.3);
}

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

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

.barra-progreso-fill.pulse-progress {
    animation: pulseProgress 0.5s ease;
}

@keyframes pulseProgress {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(1.3); }
}

/* Contador de racha */
.streak-counter {
    display: flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    padding: 5px 12px;
    border-radius: 20px;
    color: white;
    font-weight: 600;
    font-size: 0.85em;
    box-shadow: 0 3px 10px rgba(243, 156, 18, 0.3);
    animation: streakPulse 2s ease-in-out infinite;
}

.streak-counter.streak-high {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    box-shadow: 0 3px 15px rgba(231, 76, 60, 0.5);
    animation: streakHigh 1s ease-in-out infinite;
}

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

@keyframes streakHigh {
    0%, 100% { transform: scale(1); box-shadow: 0 3px 15px rgba(231, 76, 60, 0.5); }
    50% { transform: scale(1.1); box-shadow: 0 5px 20px rgba(231, 76, 60, 0.7); }
}

.streak-icon {
    font-size: 1.2em;
    animation: flame 1s ease-in-out infinite;
}

@keyframes flame {
    0%, 100% { transform: scale(1) rotate(0deg); }
    25% { transform: scale(1.1) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
}

/* Puntos en tiempo real */
.puntos-live {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
    z-index: 1000;
    text-align: center;
    color: white;
    min-width: 120px;
}

.puntos-icono {
    font-size: 1.5em;
    margin-bottom: 5px;
    animation: starRotate 3s linear infinite;
}

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

.puntos-valor {
    font-size: 2em;
    font-weight: 700;
    margin: 5px 0;
}

.puntos-valor.puntos-pop {
    animation: puntosPop 0.5s ease;
}

@keyframes puntosPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

.puntos-label {
    font-size: 0.8em;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Mensajes flotantes */
.mensaje-flotante {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 40px;
    border-radius: 15px;
    color: white;
    font-size: 1.5em;
    font-weight: 700;
    z-index: 10000;
    pointer-events: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    white-space: nowrap;
}

/* Efectos en opciones */
.opciones label.correct-answer {
    background: linear-gradient(135deg, #2ecc71, #27ae60) !important;
    color: white !important;
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(46, 204, 113, 0.4);
    animation: correctPulse 0.6s ease;
}

.opciones label.incorrect-answer {
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
    color: white !important;
    animation: incorrectShake 0.6s ease;
}

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

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

/* Mejoras en hover de opciones */
.opciones label:hover {
    transform: translateX(5px) scale(1.02);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
    transition: all 0.3s ease;
}

/* En móvil, usar touch-friendly */
@media (max-width: 768px) {
    .opciones label {
        -webkit-tap-highlight-color: rgba(52, 152, 219, 0.2);
        touch-action: manipulation;
    }
    
    .opciones label:active {
        transform: translateX(3px) scale(0.98);
    }
}

.opciones label.selected {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    transform: translateX(10px) scale(1.03);
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.4);
}

/* Efecto en botón comenzar */
.submit-btn.btn-pulse {
    animation: btnPulse 0.6s ease;
}

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

.progreso-trivial::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: calc((100% / 6) * var(--pregunta-actual, 1));
    height: 3px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progreso-trivial .numero {
    font-weight: 700;
    color: #3498db;
}

.cronometro.urgente {
    background: linear-gradient(145deg, #fff5f5, #ffe5e5);
    animation: pulseUrgente 1s infinite;
    box-shadow: 0 5px 15px rgba(255,0,0,0.2);
}

.cronometro.urgente::after {
    content: attr(data-tiempo);
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff4444;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.7em;
    animation: bounce 1s infinite;
}

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

.promocion {
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border-left: 5px solid #3498db;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transform: translateY(0);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.promocion:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.trivial-form {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.trivial-form.visible {
    opacity: 1;
}

/* Contenedor flex para preguntas y robot */
.preguntas-robot-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-top: 20px;
}

.preguntas-container {
    flex: 0 0 70%;
    width: 70%;
}

.robot-container {
    flex: 0 0 30%;
    width: 30%;
    position: sticky;
    top: 20px;
}

.robot-wrapper {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.robot-sprite {
    width: 100%;
    max-width: 300px;
    position: relative;
}

.robot-sprite-container {
    width: 100%;
    height: 0;
    padding-bottom: 100%; /* Mantener aspecto cuadrado 1:1 */
    position: relative;
    overflow: hidden;
}

.robot-sprite-frame {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 0.4s ease;
}

/* Frame idle - animación de sprite entre idle y thinking */
.robot-idle-frame {
    background-image: url('/wp-content/plugins/trivial-esterilizacion/assets/images/robot/robot_p1_idle.png');
}

/* Frame thinking */
.robot-thinking-frame {
    background-image: url('/wp-content/plugins/trivial-esterilizacion/assets/images/robot/robot_p1_thinking.png');
}

/* Animación de sprite - alterna entre idle y thinking */
@keyframes spriteIdle {
    0%, 45% {
        opacity: 1;
    }
    50%, 95% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

@keyframes spriteThinking {
    0%, 45% {
        opacity: 0;
    }
    50%, 95% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

/* Cuando está en estado idle, mostrar la animación de sprite alternando entre idle y thinking */
.robot-sprite[data-state="idle"] .robot-idle-frame {
    opacity: 1;
    animation: spriteIdle 2s ease-in-out infinite;
}

.robot-sprite[data-state="idle"] .robot-thinking-frame {
    opacity: 0;
    animation: spriteThinking 2s ease-in-out infinite;
}

/* Cuando está en estado thinking, mostrar solo thinking */
.robot-sprite[data-state="thinking"] .robot-idle-frame {
    opacity: 0;
    animation: none;
}

.robot-sprite[data-state="thinking"] .robot-thinking-frame {
    opacity: 1;
    animation: robotThinkingPulse 1s ease-in-out infinite;
}

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

/* Estados del robot - correct e incorrect */
.robot-sprite[data-state="correct"] .robot-idle-frame {
    opacity: 1;
    animation: robotCorrect 0.6s ease-in-out;
}

.robot-sprite[data-state="correct"] .robot-thinking-frame {
    opacity: 0;
}

.robot-sprite[data-state="incorrect"] .robot-idle-frame {
    opacity: 1;
    animation: robotIncorrect 0.6s ease-in-out;
}

.robot-sprite[data-state="incorrect"] .robot-thinking-frame {
    opacity: 0;
}

@keyframes robotCorrect {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

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

/* Responsive - Se consolidará al final del archivo */

.pregunta {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    display: none;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
    width: 100%;
}

.pregunta.active {
    display: block !important;
    opacity: 1 !important;
    transform: translateX(0) !important;
}

.pregunta h3 {
    color: #3498db;
    margin-bottom: 20px;
    font-size: 1.4em;
    display: flex;
    align-items: center;
}

.pregunta h3::before {
    content: '🔹';
    margin-right: 10px;
    font-size: 1.2em;
}

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

.opciones label {
    display: flex;
    align-items: center;
    padding: 20px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 2px solid transparent;
}

.opciones label:hover {
    transform: translateX(10px);
    border-color: #3498db;
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.15);
}

.opciones input[type="radio"] {
    margin-right: 15px;
    transform: scale(1.2);
}

.opciones input[type="radio"]:checked + span {
    color: #3498db;
    font-weight: bold;
}

.opciones label.selected {
    background: linear-gradient(145deg, #e3f2fd, #bbdefb);
    border-color: #3498db;
    transform: translateX(10px);
    box-shadow: 0 8px 20px rgba(52, 152, 219, 0.2);
}

.contacto-form {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    padding: 0;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    animation: slideInUp 0.6s ease-out;
    display: none;
    margin: 30px auto;
    max-width: 650px;
    overflow: hidden;
    position: relative;
}

.contacto-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #3498db, #2ecc71, #f39c12, #e74c3c, #9b59b6);
    background-size: 300% 100%;
    animation: gradientShift 3s ease infinite;
}

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

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Header del formulario */
.formulario-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 30px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.formulario-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.formulario-icono {
    font-size: 4em;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
    animation: bounceIn 0.8s ease-out;
    display: inline-block;
}

@keyframes bounceIn {
    0% { transform: scale(0) rotate(0deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); opacity: 1; }
}

.formulario-header h3 {
    color: white;
    margin: 0 0 10px 0;
    font-size: 2em;
    font-weight: 700;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.formulario-subtitulo {
    color: rgba(255,255,255,0.95);
    font-size: 1.1em;
    margin: 0;
    position: relative;
    z-index: 1;
    line-height: 1.5;
}

/* Body del formulario */
.formulario-body {
    padding: 40px 30px;
}

.form-group {
    position: relative;
    margin-bottom: 30px;
}

.form-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5em;
    z-index: 2;
    transition: all 0.3s ease;
    pointer-events: none;
}

.form-group input {
    width: 100%;
    padding: 18px 20px 18px 60px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-2px);
}

.form-group input:focus ~ .form-icon {
    transform: translateY(-50%) scale(1.2);
    filter: drop-shadow(0 0 5px rgba(102, 126, 234, 0.5));
}

.form-group input:focus ~ .form-label,
.form-group input:not(:placeholder-shown) ~ .form-label {
    top: -8px;
    left: 60px;
    font-size: 0.85em;
    color: #667eea;
    background: white;
    padding: 0 8px;
    z-index: 3;
}

.form-label {
    position: absolute;
    left: 60px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 16px;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1;
    background: transparent;
}

.form-group input.valid {
    border-color: #2ecc71;
    box-shadow: 0 0 0 4px rgba(46, 204, 113, 0.1);
}

.form-group input.valid ~ .form-icon {
    color: #2ecc71;
}

.form-group input.valid ~ .form-feedback::before {
    content: '✓';
    color: #2ecc71;
    font-weight: bold;
}

.form-group input.invalid {
    border-color: #e74c3c;
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
    animation: shake 0.5s ease;
}

.form-group input.invalid ~ .form-icon {
    color: #e74c3c;
    animation: shake 0.5s ease;
}

.form-group input.invalid ~ .form-feedback::before {
    content: '✕';
    color: #e74c3c;
    font-weight: bold;
}

.form-feedback {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2em;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.form-group input.valid ~ .form-feedback,
.form-group input.invalid ~ .form-feedback {
    opacity: 1;
}

.form-group input.pulse {
    animation: validPulse 0.5s ease-out;
}

@keyframes validPulse {
    0% { transform: translateY(-2px) scale(1); }
    50% { transform: translateY(-2px) scale(1.02); }
    100% { transform: translateY(-2px) scale(1); }
}

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

/* Footer del formulario */
.formulario-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.formulario-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #7f8c8d;
    font-size: 0.9em;
}

.info-icon {
    font-size: 1.2em;
}

/* Responsive - Se consolidará al final del archivo */

.botones-navegacion {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 25px;
}

.nav-btn, .submit-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-btn {
    background: linear-gradient(145deg, #95a5a6, #7f8c8d);
    color: white;
}

.nav-btn:hover {
    background: linear-gradient(145deg, #7f8c8d, #6c7a7d);
    transform: translateY(-2px);
}

.submit-btn {
    background: linear-gradient(145deg, #3498db, #2980b9);
    color: white;
}

.submit-btn:hover {
    background: linear-gradient(145deg, #2980b9, #2472a4);
    transform: translateY(-2px);
}

.submit-btn:disabled {
    background: linear-gradient(145deg, #95a5a6, #7f8c8d);
    cursor: not-allowed;
    transform: none;
}

.resultado {
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    margin-top: 30px;
    animation: slideUp 0.5s ease-out;
}

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

.resultado.success {
    background: linear-gradient(145deg, #d4edda, #c3e6cb);
    color: #155724;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.resultado.error {
    background: linear-gradient(145deg, #f8d7da, #f5c6cb);
    color: #721c24;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.ver-ranking-btn {
    display: inline-block;
    background: linear-gradient(145deg, #3498db, #2980b9);
    color: white;
    padding: 15px 30px;
    border-radius: 12px;
    text-decoration: none;
    margin-top: 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.2);
}

.ver-ranking-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(52, 152, 219, 0.3);
    background: linear-gradient(145deg, #2980b9, #2472a4);
    color: white;
    text-decoration: none;
}

/* Estilos para el ranking */
.ranking-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.ranking-container h2 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.ranking-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border-radius: 15px;
    overflow: hidden;
}

.ranking-table th,
.ranking-table td {
    padding: 20px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.ranking-table th {
    background: linear-gradient(145deg, #3498db, #2980b9);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ranking-table tr:nth-child(even) {
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
}

.ranking-table tr:hover {
    background: #f1f1f1;
    transform: scale(1.01);
    transition: all 0.3s ease;
}

.ranking-table tr:first-child {
    background: linear-gradient(145deg, #f1c40f, #f39c12);
    color: white;
    font-weight: bold;
}

.resultado-final {
    padding: 30px;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.resultado-final h3 {
    font-size: 1.8em;
    color: #2c3e50;
    margin-bottom: 20px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

.tiempo, .puntuacion {
    font-size: 1.2em;
    margin: 10px 0;
    padding: 10px;
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
    border-radius: 8px;
    display: inline-block;
    margin: 10px;
}

.mensaje-final {
    font-size: 1.2em;
    line-height: 1.6;
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(145deg, #f8f9fa, #ffffff);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.ranking-link {
    margin-top: 30px;
}

/* Responsive - Se consolidará al final del archivo */

/* Animaciones para las transiciones */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

/* Nuevas animaciones y efectos */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

@keyframes pop {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes slideRight {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideLeft {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Clases de animación */
.animate-pop { animation: pop 0.5s ease-out; }
.animate-slide-right { animation: slideRight 0.5s ease-out; }
.animate-slide-left { animation: slideLeft 0.5s ease-out; }
.animate-fade-in { animation: fadeIn 0.8s ease-out; }
.animate-bounce { animation: bounce 2s infinite; }

/* Mejoras en el cronómetro */
.cronometro {
    font-size: 1.2em;
    font-weight: 600;
    position: relative;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    padding: 20px 30px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: block !important; /* Asegurar que siempre sea visible */
    visibility: visible !important; /* Forzar visibilidad */
    opacity: 1 !important; /* Forzar opacidad completa */
}

.cronometro.urgente {
    background: linear-gradient(145deg, #fff5f5, #ffe5e5);
    animation: pulseUrgente 1s infinite;
    box-shadow: 0 5px 15px rgba(255,0,0,0.2);
}

.cronometro.urgente::after {
    content: attr(data-tiempo);
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #ff4444;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    animation: bounce 1s infinite;
}

@keyframes pulseUrgente {
    0% { transform: scale(1); box-shadow: 0 5px 15px rgba(255,0,0,0.2); }
    50% { transform: scale(1.05); box-shadow: 0 5px 25px rgba(255,0,0,0.4); }
    100% { transform: scale(1); box-shadow: 0 5px 15px rgba(255,0,0,0.2); }
}

/* Advertencia de tiempo */
.advertencia-tiempo {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(145deg, #ff4444, #cc0000);
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(255,0,0,0.3);
    z-index: 1000;
    font-weight: bold;
    text-align: center;
}

/* Mejoras en las estadísticas */
.estadisticas {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.estadisticas > div {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    text-align: center;
    transition: all 0.3s ease;
}

.estadisticas > div:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.estadisticas .icono {
    font-size: 2em;
    margin-bottom: 10px;
}

.estadisticas .valor {
    font-size: 1.8em;
    font-weight: bold;
    color: #2c3e50;
    margin: 10px 0;
}

.estadisticas .etiqueta {
    font-size: 0.9em;
    color: #7f8c8d;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Mejoras en los resultados */
.resultado-perfecto,
.resultado-bueno,
.resultado-regular {
    text-align: center;
    padding: 40px;
    border-radius: 20px;
    margin: 30px 0;
    transition: all 0.3s ease;
}

.resultado-perfecto {
    background: linear-gradient(145deg, #fff8e1, #fffde7);
    border: 2px solid #ffd700;
    box-shadow: 0 10px 30px rgba(255,215,0,0.2);
}

.resultado-bueno {
    background: linear-gradient(145deg, #e3f2fd, #bbdefb);
    border: 2px solid #2196f3;
    box-shadow: 0 10px 30px rgba(33,150,243,0.2);
}

.resultado-regular {
    background: linear-gradient(145deg, #f5f5f5, #eeeeee);
    border: 2px solid #9e9e9e;
    box-shadow: 0 10px 30px rgba(158,158,158,0.2);
}

.resultado-perfecto .titulo,
.resultado-bueno .titulo,
.resultado-regular .titulo {
    font-size: 1.8em;
    font-weight: bold;
    margin: 20px 0;
    color: #2c3e50;
}

.bonus {
    display: inline-block;
    background: linear-gradient(145deg, #4CAF50, #45a049);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    margin-top: 20px;
    font-weight: bold;
    animation: pulse 2s infinite;
}

/* Mejoras responsivas */
@media (max-width: 768px) {
    .estadisticas {
        grid-template-columns: 1fr;
    }
    
    .resultado-perfecto,
    .resultado-bueno,
    .resultado-regular {
        padding: 20px;
    }
    
    .advertencia-tiempo {
        width: 90%;
        font-size: 14px;
    }
    
    .cronometro.urgente::after {
        width: 80%;
        font-size: 12px;
    }
}

.resumen-respuestas {
    margin: 30px 0;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.resumen-respuestas h4 {
    color: #2c3e50;
    font-size: 1.3em;
    margin-bottom: 20px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #e3f2fd;
}

.lista-respuestas {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.respuesta-item {
    padding: 15px;
    border-radius: 10px;
    background: #f8f9fa;
    transition: all 0.3s ease;
    border-left: 4px solid;
}

.respuesta-item.correcta {
    border-color: #2ecc71;
    background: linear-gradient(145deg, #f0fff4, #ffffff);
}

.respuesta-item.incorrecta {
    border-color: #e74c3c;
    background: linear-gradient(145deg, #fff5f5, #ffffff);
}

.pregunta-numero {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.respuesta-status {
    font-size: 1.1em;
    margin: 5px 0;
}

.respuesta-correcta {
    margin-top: 8px;
    padding: 8px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 6px;
    font-size: 0.9em;
    color: #c0392b;
}

/* ============================================
   RESPONSIVE - DISEÑO MÓVIL
   ============================================ */

@media (max-width: 768px) {
    /* Contenedor principal */
    .trivial-container {
        padding: 15px;
        margin: 10px;
        border-radius: 15px;
    }

    .trivial-container h1 {
        font-size: 1.8em;
        margin-bottom: 15px;
    }

    .trivial-header {
        padding-bottom: 20px;
        margin-bottom: 20px;
    }

    /* Cronómetro */
    .cronometro-container {
        padding: 10px;
    }

    .cronometro {
        font-size: 1em;
        padding: 15px 20px;
    }

    .cronometro-label {
        font-size: 0.65em;
    }

    /* Progreso */
    .progreso-trivial {
        max-width: 100%;
        padding: 12px;
        margin: 10px auto;
    }

    .progreso-header {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    .barra-progreso {
        margin-top: 8px;
    }

    .streak-counter {
        font-size: 0.75em;
        padding: 4px 10px;
    }

    /* Layout preguntas y robot */
    .preguntas-robot-container {
        flex-direction: column;
        gap: 20px;
        margin-top: 15px;
    }
    
    .preguntas-container,
    .robot-container {
        flex: 0 0 100%;
        width: 100%;
    }
    
    .robot-container {
        position: relative;
        top: 0;
        margin-top: 20px;
    }

    .robot-wrapper {
        min-height: 300px;
        padding: 15px;
    }

    .robot-sprite {
        max-width: 250px;
        margin: 0 auto;
    }

    /* Preguntas */
    .pregunta {
        padding: 20px;
        margin-bottom: 15px;
    }

    .pregunta h3 {
        font-size: 1.2em;
        margin-bottom: 15px;
    }

    .pregunta p {
        font-size: 0.95em;
    }

    .opciones {
        gap: 12px;
    }

    .opciones label {
        padding: 12px 15px;
        font-size: 0.9em;
    }

    .opciones label:hover {
        transform: translateX(3px) scale(1.01);
    }

    /* Puntos en tiempo real */
    .puntos-live {
        position: fixed;
        top: 10px;
        right: 10px;
        padding: 10px 15px;
        min-width: 100px;
        font-size: 0.85em;
        z-index: 1001;
    }

    .puntos-icono {
        font-size: 1.2em;
        margin-bottom: 3px;
    }

    .puntos-valor {
        font-size: 1.5em;
        margin: 3px 0;
    }

    .puntos-label {
        font-size: 0.7em;
    }

    /* Mensajes flotantes */
    .mensaje-flotante {
        font-size: 1.2em;
        padding: 15px 30px;
        max-width: 90%;
        white-space: normal;
        word-wrap: break-word;
    }

    /* Formulario de contacto */
    .contacto-form {
        margin: 20px auto;
        max-width: 100%;
    }

    .formulario-header {
        padding: 30px 20px;
    }

    .formulario-icono {
        font-size: 3em;
        margin-bottom: 10px;
    }

    .formulario-header h3 {
        font-size: 1.5em;
        margin-bottom: 8px;
    }

    .formulario-subtitulo {
        font-size: 1em;
    }

    .formulario-body {
        padding: 25px 20px;
    }

    .form-group {
        margin-bottom: 20px;
    }

    .form-group input {
        padding: 15px 15px 15px 55px;
        font-size: 16px; /* Evitar zoom en iOS */
    }

    .form-icon {
        left: 15px;
        font-size: 1.3em;
    }

    .form-label {
        left: 55px;
        font-size: 15px;
    }

    .formulario-footer {
        padding: 15px 20px;
    }

    .formulario-info {
        font-size: 0.85em;
        flex-wrap: wrap;
        text-align: center;
    }

    /* Botones de navegación */
    .botones-navegacion {
        flex-direction: column;
        gap: 10px;
        margin-top: 20px;
    }

    .nav-btn, .submit-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
    }

    .submit-btn {
        margin-top: 10px;
    }

    /* Inicio del trivial */
    .inicio-trivial {
        padding: 20px 15px;
    }

    .inicio-trivial .intro {
        font-size: 1em;
        margin-bottom: 20px;
    }

    .promocion {
        padding: 15px;
        margin: 20px 0;
    }

    .promocion p {
        font-size: 0.9em;
        margin: 8px 0;
    }

    /* Resultados */
    .resultado-final {
        padding: 20px 15px;
    }

    .estadisticas {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 20px 0;
    }

    .tiempo, .puntuacion, .puntos {
        padding: 15px;
    }

    .resultado-perfecto,
    .resultado-bueno,
    .resultado-regular {
        padding: 20px 15px;
    }

    .resumen-respuestas {
        padding: 15px;
        margin: 20px 0;
    }

    .respuesta-item {
        padding: 12px;
        margin-bottom: 10px;
    }

    .respuesta-item .pregunta-numero {
        font-size: 0.9em;
    }

    /* Ranking */
    .ranking-container {
        padding: 15px;
    }

    .ranking-container h2 {
        font-size: 1.5em;
    }

    .ranking-table {
        font-size: 0.85em;
    }

    .ranking-table th,
    .ranking-table td {
        padding: 8px 5px;
    }
}

/* Tablets y pantallas medianas */
@media (max-width: 1024px) and (min-width: 769px) {
    .trivial-container {
        padding: 25px;
    }

    .preguntas-robot-container {
        gap: 25px;
    }

    .robot-sprite {
        max-width: 250px;
    }
}

/* Pantallas muy pequeñas (móviles pequeños) */
@media (max-width: 480px) {
    .trivial-container {
        padding: 10px;
        margin: 5px;
    }

    .trivial-container h1 {
        font-size: 1.5em;
    }

    .cronometro {
        font-size: 0.9em;
        padding: 12px 15px;
    }

    .pregunta {
        padding: 15px;
    }

    .pregunta h3 {
        font-size: 1.1em;
    }

    .opciones label {
        padding: 10px 12px;
        font-size: 0.85em;
    }

    .puntos-live {
        top: 5px;
        right: 5px;
        padding: 8px 12px;
        min-width: 80px;
    }

    .puntos-valor {
        font-size: 1.3em;
    }

    .formulario-header {
        padding: 20px 15px;
    }

    .formulario-icono {
        font-size: 2.5em;
    }

    .formulario-header h3 {
        font-size: 1.3em;
    }

    .formulario-body {
        padding: 20px 15px;
    }

    .mensaje-flotante {
        font-size: 1em;
        padding: 12px 20px;
    }

    .botones-navegacion {
        gap: 8px;
    }

    .nav-btn, .submit-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
}

/* Ajustes para orientación horizontal en móvil */
@media (max-width: 768px) and (orientation: landscape) {
    .robot-wrapper {
        min-height: 200px;
    }

    .robot-sprite {
        max-width: 200px;
    }

    .puntos-live {
        top: 5px;
        right: 5px;
        padding: 8px 12px;
    }
}