:root {
    --primary: #2C3E50;
    --secondary: #3498DB;
    --correct: #27AE60;
    --incorrect: #E74C3C;
    --bg: #ECF0F1;
    --text: #333;
    --card-bg: #FFFFFF;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 800px;
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--secondary);
}

header h1 {
    color: var(--primary);
}

.screen {
    display: none;
    animation: fadeIn 0.4s ease;
}

.screen.active {
    display: block;
}

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

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-top: 20px;
    display: inline-block;
}

.btn.primary {
    background: var(--secondary);
    color: white;
    width: 100%;
}

.btn.primary:hover {
    background: #2980B9;
}

.btn.secondary {
    background: var(--primary);
    color: white;
    float: right;
}

.btn.secondary:hover {
    background: #1A252F;
}

.btn.tertiary {
    background: #E2E8F0;
    color: #334155;
    width: 100%;
    margin-top: 10px;
}

.btn.tertiary:hover {
    background: #CBD5E1;
    color: #0F172A;
}

.end-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 25px;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 25px;
}

.option-btn {
    background: #F8F9F9;
    border: 2px solid #BDC3C7;
    padding: 15px 20px;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--secondary);
    background: #EBF5FB;
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.option-btn.correct {
    background: #EAFAF1;
    border-color: var(--correct);
    color: #196F3D;
    font-weight: bold;
}

.option-btn.incorrect {
    background: #FDEDEC;
    border-color: var(--incorrect);
    color: #922B21;
}

.letra {
    font-weight: bold;
    margin-right: 15px;
    color: var(--secondary);
    font-size: 18px;
}

.badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: bold;
    color: white;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge.correct { background: var(--correct); }
.badge.incorrect { background: var(--incorrect); }
.badge.progress { background: var(--secondary); }
.badge.timer {
    background: #34495E;
    letter-spacing: 0.5px;
    font-family: monospace;
    font-size: 15px;
}
.badge.timer.warning {
    background: #E67E22;
    animation: pulseWarning 1.5s infinite;
}
.badge.timer.danger {
    background: #C0392B;
    animation: pulseDanger 0.8s infinite;
}

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

@keyframes pulseDanger {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.85; }
}

.timer-settings-card {
    background: #F8F9FA;
    border: 2px solid #E2E8F0;
    border-radius: 10px;
    padding: 20px;
    margin: 25px 0 10px 0;
    text-align: left;
}

.timer-settings-card h3 {
    color: var(--primary);
    font-size: 18px;
    margin-bottom: 15px;
}

.setting-row {
    margin-bottom: 12px;
}

.setting-row:last-child {
    margin-bottom: 0;
}

.setting-label {
    display: block;
    margin-bottom: 6px;
    color: var(--primary);
}

.setting-divider {
    height: 1px;
    background: #E2E8F0;
    margin: 15px 0;
}

.switch-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
}

.switch-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--secondary);
}

.timer-input-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
    padding-left: 30px;
}

.timer-input-group label {
    font-weight: 500;
    color: #555;
}

.input-with-unit {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.input-with-unit input[type="number"] {
    width: 80px;
    padding: 6px 10px;
    border: 2px solid #CBD5E1;
    border-radius: 6px;
    font-size: 16px;
    text-align: center;
    font-weight: bold;
    color: var(--primary);
}

.input-with-unit input[type="number"]:focus {
    outline: none;
    border-color: var(--secondary);
}

.alert-timeout {
    background: #FDEDEC;
    color: #922B21;
    border: 2px solid #E74C3C;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 16px;
    text-align: center;
}

.alert-timeout.hidden {
    display: none;
}

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

.question-container h3 {
    font-size: 20px;
    color: var(--primary);
    margin-bottom: 10px;
}

.feedback {
    margin-top: 30px;
    padding: 20px;
    border-radius: 8px;
    overflow: hidden;
}

.feedback.hidden {
    display: none;
}

.feedback.correct {
    background: #EAFAF1;
    border-left: 6px solid var(--correct);
}

.feedback.incorrect {
    background: #FDEDEC;
    border-left: 6px solid var(--incorrect);
}

.feedback h4 {
    margin-bottom: 12px;
    font-size: 18px;
    line-height: 1.4;
}

.correct h4 { color: var(--correct); }
.incorrect h4 { color: #C0392B; }

.final-scores {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 25px 0;
}

.score-card {
    background: #F8F9FA;
    border: 2px solid #E2E8F0;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-title {
    font-size: 15px;
    font-weight: 600;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-number {
    font-size: 36px;
    font-weight: bold;
    margin-top: 5px;
}

.correct-color { color: var(--correct); }
.incorrect-color { color: var(--incorrect); }

.time-metrics-card {
    background: #EFF6FF;
    border: 2px solid #BFDBFE;
    border-radius: 10px;
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

@media (max-width: 600px) {
    .time-metrics-card {
        grid-template-columns: 1fr;
    }
}

.metric-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.metric-icon {
    font-size: 32px;
}

.metric-content {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.metric-label {
    font-size: 13px;
    color: #475569;
    font-weight: 600;
}

.metric-value {
    font-size: 18px;
    font-weight: bold;
    color: var(--primary);
    margin-top: 2px;
}

.review-section {
    margin-top: 30px;
    text-align: left;
}

#review-list {
    list-style: none;
    margin-top: 20px;
}

#review-list li {
    background: #FEF9E7;
    padding: 20px;
    border-left: 5px solid #F39C12;
    margin-bottom: 15px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

#review-list li strong {
    color: var(--primary);
    display: block;
    margin-bottom: 10px;
    font-size: 16px;
}
