/* ==========================================================================
   Math Quiz - Styles
   ========================================================================== */

/* --- Screens --- */
.mq-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 320px;
    padding: 24px 16px;
}

.math-quiz-center {
    position: relative;
}

.mq-screen.hidden {
    display: none;
}

/* --- Setup Screen --- */
.mq-setup-icon {
    color: var(--text-tertiary, #6b7280);
    margin-bottom: 16px;
    opacity: 0.5;
}

.mq-setup-text {
    font-size: 15px;
    color: var(--text-secondary, #9ca3af);
    text-align: center;
    max-width: 280px;
    line-height: 1.5;
}

/* --- Quiz Screen --- */
.mq-quiz-screen {
    justify-content: flex-start;
    gap: 20px;
}

/* Progress Bar */
.mq-progress {
    width: 100%;
    height: 6px;
    background: var(--surface-secondary, rgba(255, 255, 255, 0.06));
    border-radius: 3px;
    overflow: hidden;
}

.mq-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #f59e0b, #ffbe4d);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* Meta row */
.mq-quiz-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.mq-question-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #9ca3af);
}

.mq-timer {
    font-size: 13px;
    font-weight: 700;
    color: #ffbe4d;
    font-variant-numeric: tabular-nums;
    background: var(--surface-secondary, rgba(255, 255, 255, 0.06));
    padding: 4px 10px;
    border-radius: 6px;
}

/* Question display */
.mq-question {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 20px 0;
}

.mq-operand {
    font-size: 42px;
    font-weight: 700;
    color: var(--text-primary, #f3f4f6);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.mq-operator {
    font-size: 32px;
    font-weight: 600;
    color: #ffbe4d;
    line-height: 1;
}

.mq-equals {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-tertiary, #6b7280);
    line-height: 1;
}

.mq-answer-slot {
    font-size: 42px;
    font-weight: 700;
    color: #ffbe4d;
    min-width: 80px;
    text-align: center;
    padding: 8px 16px;
    background: var(--surface-secondary, rgba(255, 255, 255, 0.06));
    border-radius: 12px;
    border: 2px dashed var(--border-primary, rgba(255, 255, 255, 0.08));
    line-height: 1;
    transition: all 0.3s ease;
}

.mq-answer-slot.correct {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.mq-answer-slot.incorrect {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Choices */
.mq-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    max-width: 360px;
}

.mq-choice-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 12px;
    font-size: 20px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary, #f3f4f6);
    background: var(--surface-secondary, rgba(255, 255, 255, 0.06));
    border: 2px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
}

.mq-choice-btn:hover:not(:disabled) {
    border-color: #ffbe4d;
    background: rgba(255, 190, 77, 0.08);
    transform: translateY(-1px);
}

.mq-choice-btn:active:not(:disabled) {
    transform: translateY(0);
}

.mq-choice-btn:disabled {
    cursor: default;
    opacity: 0.6;
}

.mq-choice-btn.correct {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.mq-choice-btn.incorrect {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Feedback */
.mq-feedback {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    transition: opacity 0.3s ease;
}

.mq-feedback.hidden {
    display: none;
}

.mq-feedback.correct {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.mq-feedback.incorrect {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.mq-feedback-icon {
    font-size: 18px;
}

/* --- Results Screen --- */
.mq-results-screen {
    gap: 16px;
}

.mq-results-badge {
    color: #ffbe4d;
    margin-bottom: 4px;
}

.mq-results-badge.gold { color: #facc15; }
.mq-results-badge.silver { color: #94a3b8; }
.mq-results-badge.bronze { color: #f97316; }

.mq-results-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary, #f3f4f6);
    margin: 0;
}

.mq-results-score {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.mq-score-value {
    font-size: 56px;
    font-weight: 800;
    color: #ffbe4d;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.mq-score-divider {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-tertiary, #6b7280);
}

.mq-score-total {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-tertiary, #6b7280);
    font-variant-numeric: tabular-nums;
}

.mq-results-details {
    display: flex;
    gap: 24px;
    margin-top: 8px;
}

.mq-result-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.mq-detail-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mq-detail-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #f3f4f6);
    font-variant-numeric: tabular-nums;
}

/* --- Shared Buttons --- */
.mq-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mq-btn-primary {
    background: linear-gradient(135deg, #f59e0b, #ffbe4d);
    color: #040405;
    box-shadow: 0 2px 8px rgba(255, 190, 77, 0.3);
}

.mq-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255, 190, 77, 0.4);
}

.mq-btn-primary:active {
    transform: translateY(0);
}

/* Start button */
.mq-start-btn {
    width: 100%;
    margin-top: 8px;
    padding: 14px 24px;
    font-size: 15px;
}

/* --- Operation Buttons --- */
.math-quiz-app .category-emoji {
    color: #fff;
    font-weight: 700;
}

.math-quiz-app .category-btn.active .category-emoji {
    color: #040405;
}

/* --- Settings Controls --- */
.mq-setting-group {
    margin-bottom: 16px;
}

.mq-setting-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary, #9ca3af);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.mq-difficulty-options,
.mq-question-options {
    display: flex;
    gap: 6px;
}

.mq-difficulty-btn,
.mq-question-btn {
    flex: 1;
    padding: 8px 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #9ca3af);
    background: var(--surface-secondary, rgba(255, 255, 255, 0.06));
    border: 1.5px solid var(--border-primary, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.mq-difficulty-btn:hover,
.mq-question-btn:hover {
    border-color: #ffbe4d;
    color: var(--text-primary, #f3f4f6);
}

.mq-difficulty-btn.active,
.mq-question-btn.active {
    background: rgba(255, 190, 77, 0.15);
    border-color: #ffbe4d;
    color: #ffbe4d;
}

/* --- Controls Row (reuses .wheel-controls / .control-btn from spinner-wheel.css) --- */
.mq-controls {
    margin-top: 16px;
}

.mq-controls .hidden {
    display: none;
}

/* --- Fullscreen Mode --- */
.math-quiz-app.is-fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    background: var(--bg-main, #040405);
    display: flex;
    align-items: center;
    justify-content: center;
}

.math-quiz-app.is-fullscreen .sidebar,
.math-quiz-app.is-fullscreen .ad-hor,
.math-quiz-app.is-fullscreen .ad-ver,
.math-quiz-app.is-fullscreen .wheel-title {
    display: none !important;
}

.math-quiz-app.is-fullscreen .content {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.math-quiz-app.is-fullscreen .wheel {
    display: flex;
    align-items: center;
    justify-content: center;
}

.math-quiz-app.is-fullscreen .math-quiz-center {
    width: 100%;
    padding: 40px 24px;
}

.math-quiz-app.is-fullscreen .mq-operand {
    font-size: 56px;
}

.math-quiz-app.is-fullscreen .mq-operator,
.math-quiz-app.is-fullscreen .mq-equals {
    font-size: 42px;
}

.math-quiz-app.is-fullscreen .mq-answer-slot {
    font-size: 56px;
    min-width: 100px;
}

.math-quiz-app.is-fullscreen .mq-choice-btn {
    padding: 18px 16px;
    font-size: 24px;
}

.math-quiz-app.is-fullscreen .mq-choices {
    max-width: 440px;
}

.math-quiz-app.is-fullscreen .mq-score-value {
    font-size: 72px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .mq-question {
        gap: 8px;
    }

    .mq-operand {
        font-size: 32px;
    }

    .mq-operator,
    .mq-equals {
        font-size: 24px;
    }

    .mq-answer-slot {
        font-size: 32px;
        min-width: 64px;
        padding: 6px 12px;
    }

    .mq-choices {
        max-width: 100%;
    }

    .mq-choice-btn {
        padding: 12px 10px;
        font-size: 18px;
    }

    .mq-score-value {
        font-size: 44px;
    }

    .mq-results-details {
        gap: 16px;
    }
}
