* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.screen {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.hidden {
    display: none;
}

/* Pantalla de login */
#login-screen {
    text-align: center;
    padding: 40px 20px;
}

#login-screen h1 {
    color: #5d4037;
    margin-bottom: 20px;
    font-size: 28px;
}

#login-screen input {
    width: 100%;
    max-width: 300px;
    padding: 12px;
    margin: 15px 0;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

#login-screen input:focus {
    border-color: #6e8efb;
}

#login-screen button {
    background: #6e8efb;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s;
}

#login-screen button:hover {
    background: #5d4037;
}

/* Encabezado de la app - MEJORADO */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #4a148c, #7b1fa2);
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    color: white;
    position: relative;
    overflow: hidden;
}

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%);
    transform: rotate(30deg);
}

.student-info {
    display: flex;
    gap: 25px;
    font-weight: bold;
    align-items: center;
}

/* Nombre del estudiante - DISEÑO LLAMATIVO */
#currentStudent {
    background: linear-gradient(135deg, #ff9a9e, #fad0c4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 22px;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 8px 16px;
    border-radius: 12px;
    background-color: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
}

#currentStudent::before {
    content: '👤 ';
    font-size: 24px;
}

/* Puntaje - DISEÑO LLAMATIVO */
#score {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 24px;
    font-weight: 800;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 10px 20px;
    border-radius: 15px;
    background-color: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
    min-width: 140px;
    text-align: center;
    position: relative;
}

#score::before {
    content: '⭐ ';
    font-size: 26px;
}

/* Badge animado para el puntaje */
#score::after {
    content: '';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 15px;
    height: 15px;
    background: #ffeb3b;
    border-radius: 50%;
    box-shadow: 0 0 10px #ffeb3b;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 235, 59, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 235, 59, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 235, 59, 0); }
}

/* Contenedor del ejercicio */
#exercise-container {
    margin-bottom: 30px;
}

#data-description {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
    font-size: 18px;
    padding: 10px;
    background: #f8f9fa;
    border-left: 4px solid #6e8efb;
    border-radius: 8px;
}

#data-values {
    background: #f9f9f9;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-family: monospace;
    word-break: break-all;
    border: 1px solid #e9ecef;
}

/* Tabla de frecuencias */
#frequency-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

#frequency-table th, #frequency-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid #ddd;
}

#frequency-table th {
    background: #ffe082;
    font-weight: bold;
    font-size: 14px;
    color: #5d4037;
}

#frequency-table th[colspan] {
    background: #ffcc80;
    color: #5d4037;
}

#frequency-table td input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    text-align: center;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#frequency-table td input:focus {
    border-color: #6e8efb;
    outline: none;
    box-shadow: 0 0 0 2px rgba(110, 142, 251, 0.3);
}

/* Retroalimentación */
#feedback {
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    font-weight: bold;
    text-align: center;
    font-size: 18px;
}

#feedback.correct {
    background: #e8f5e9;
    color: #2e7d32;
    border: 2px solid #81c784;
    animation: bounce 0.6s ease;
}

#feedback.incorrect {
    background: #ffebee;
    color: #c62828;
    border: 2px solid #ef9a9a;
}

#feedback.blocked {
    background: #fff3e0;
    color: #e65100;
    border: 2px solid #ffb74d;
}

/* Botones */
.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.controls button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 150px;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.controls button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.controls button:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

#checkBtn {
    background: linear-gradient(135deg, #ff9800, #ff5722);
    color: white;
}

#checkBtn:hover:not(:disabled) {
    background: linear-gradient(135deg, #f57c00, #e64a19);
}

#nextBtn {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    color: white;
}

#nextBtn:hover:not(:disabled) {
    background: linear-gradient(135deg, #388e3c, #1b5e20);
}

/* Animación de rebote para feedback correcto */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}

/* Mensajes animados */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

#feedback.show {
    animation: fadeIn 0.5s ease-out;
}

/* Responsive */
@media (max-width: 768px) {
    .screen {
        padding: 20px 10px;
    }

    header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .student-info {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    #currentStudent, #score {
        font-size: 18px;
        padding: 8px 16px;
        min-width: auto;
    }

    #score::after {
        top: -3px;
        right: -3px;
        width: 12px;
        height: 12px;
    }

    .controls button {
        width: 100%;
        max-width: 300px;
    }

    #frequency-table th, #frequency-table td {
        padding: 8px;
        font-size: 12px;
    }

    #frequency-table td input {
        font-size: 12px;
        padding: 6px;
    }
}

@media (max-width: 480px) {
    #currentStudent, #score {
        font-size: 16px;
        padding: 6px 12px;
    }
    
    header {
        padding: 12px;
    }
}