:root {
    --primary: #4361ee;
    --secondary: #3f37c9;
    --accent: #4cc9f0;
    --success: #4caf50;
    --error: #f44336;
    --warning: #ff9800;
    --light: #f8f9fa;
    --dark: #212529;
    --text: #333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: var(--text);
    line-height: 1.6;
    padding: 20px;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 20px auto;
    background-color: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

h1 {
    color: var(--primary);
    text-align: center;
    margin-bottom: 20px;
    font-size: 2.5rem;
    background: linear-gradient(to right, #dee1ec, #b6c5ca);
    
    position: relative;
    padding-bottom: 10px;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(to right, #4361ee, #4cc9f0);
    border-radius: 2px;
}

h2 {
    color: var(--secondary);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

#studentSection {
    text-align: center;
    padding: 20px;
    background-color: rgba(67, 97, 238, 0.05);
    border-radius: 10px;
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--primary);
}

input[type="text"] {
    width: 100%;
    max-width: 400px;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    margin: 0 auto 15px;
    display: block;
}

input[type="text"]:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
}

button {
    padding: 12px 25px;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button:hover {
    background-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    background-color: #ccc;
}

.hidden {
    display: none;
}

#gameSection {
    padding: 20px;
}

#welcomeMsg {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 15px;
    font-weight: 600;
}

.instruction {
    font-style: italic;
    color: #666;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

#question {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 25px;
    padding: 15px;
    background-color: rgba(67, 97, 238, 0.05);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

#options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 25px;
}

#options button {
    width: 100%;
    padding: 15px;
    font-size: 1.1rem;
    text-align: center;
    background-color: white;
    color: var(--dark);
    border: 2px solid #ddd;
    transition: all 0.2s;
}

#options button:hover {
    background-color: #f8f9fa;
    border-color: var(--primary);
    color: var(--primary);
}

#options button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

#options button:disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

#feedback {
    font-size: 1.2rem;
    font-weight: 600;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

#summarySection {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    border-top: 5px solid var(--primary);
}

#summarySection p {
    font-size: 1.2rem;
    margin: 15px 0;
    padding: 10px;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

#studentSummary {
    font-size: 1.4rem !important;
    font-weight: 700;
    color: var(--primary);
    border-left: 4px solid var(--primary);
}

#correctSummary {
    color: var(--success);
    border-left: 4px solid var(--success);
}

#incorrectSummary {
    color: var(--error);
    border-left: 4px solid var(--error);
}

#finalScore {
    font-size: 1.5rem !important;
    font-weight: 700;
    color: var(--secondary);
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.1) 0%, rgba(76, 201, 240, 0.1) 100%) !important;
    padding: 15px !important;
}

#closingMessage {
    font-size: 1.3rem !important;
    font-style: italic;
    color: var(--dark);
    margin-top: 25px !important;
}

.progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.progress-bar {
    height: 20px;
    background-color: #e0e0e0;
    border-radius: 10px;
    flex-grow: 1;
    overflow: hidden;
    position: relative;
}

#progressBarFill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4361ee, #4cc9f0);
    border-radius: 10px;
    transition: width 0.3s ease;
}

#progressText {
    font-size: 0.9rem;
    color: var(--text);
    min-width: 50px;
    text-align: right;
}


/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Efectos especiales */
.correct-answer {
    background-color: rgba(76, 175, 80, 0.2) !important;
    border-color: var(--success) !important;
    color: var(--success) !important;
}

.wrong-answer {
    background-color: rgba(244, 67, 54, 0.1) !important;
    border-color: var(--error) !important;
    color: var(--error) !important;
}

.pulse {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px auto;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    #options {
        grid-template-columns: 1fr;
    }

    #question, #feedback {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    h1 {
        font-size: 1.8rem;
    }

    button {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    #summarySection {
        padding: 20px 15px;
    }

    #summarySection p {
        font-size: 1rem;
    }

     .progress-container {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .progress-bar {
        width: 100%;
    }
    
    #progressText {
        align-self: flex-end;
    }
}