/* ===== БЛОК MATH ===== */
.math {
    max-width: 800px;
    margin: 0 auto;
}

.math__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color01);
    margin-bottom: 20px;
}

/* ===== ФОРМА ===== */
.math__form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.math__select {
    padding: 8px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
    min-width: 160px;
}

.math__select:focus {
    outline: none;
    border-color: var(--color01);
}

/* ===== КНОПКИ ===== */
.math__btn {
    padding: 10px 32px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.math__btn--start {
    background: var(--color07);
    color: #fff;
}

.math__btn--start:hover {
    background: #388E3C;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.math__btn--check {
    background: #2196F3;
    color: #fff;
}

.math__btn--check:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.math__btn--next {
    background: var(--color07);
    color: #fff;
}

.math__btn--next:hover {
    background: #388E3C;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.math__btn--restart {
    background: var(--color10);
    color: #fff;
}

.math__btn--restart:hover {
    background: #d32f2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

/* ===== УРОВЕНЬ ===== */
.math__level-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 16px;
}

.math__level-label {
    font-weight: 600;
    color: #333;
}

.math__level-value {
    color: var(--color01);
    font-weight: 700;
}

/* ===== ЗАДАНИЯ ===== */
.math__tasks {
    background: url(/img/tetrad.jpg) 100% 100%;
    margin-top: 10px;
    padding: 20px 24px 24px 24px;
    border-radius: 12px;
    min-height: 200px;
}

/* ===== ОДНО ЗАДАНИЕ (генерируется через JS) ===== */
.math-task__title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color06);
    margin-bottom: 16px;
}

.math-task__list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.math-task__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    padding: 4px 0;
    font-size: 18px;
    font-style: italic;
}

.math-task__expression {
    text-align: right;
    min-width: 120px;
    color: #333;
}

.math-task__input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.math-task__input {
    padding: 6px 10px;
    font-size: 18px;
    border: 2px solid #ccc;
    border-radius: 6px;
    transition: border-color 0.2s;
    background: #fff;
    min-width: 50px;
}

.math-task__input:focus {
    outline: none;
    border-color: var(--color01);
    box-shadow: 0 0 0 3px rgba(75, 118, 171, 0.15);
}

.math-task__answer {
    font-size: 14px;
    color: #666;
    padding: 4px 8px;
}

.math-task__answer-correct {
    color: var(--color07);
    font-weight: 600;
}

.math-task__answer-wrong {
    color: var(--color10);
    font-weight: 600;
}

/* ===== УПРАВЛЕНИЕ ===== */
.math-task__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.math-task__next-wrapper {
    display: inline-flex;
}

/* ===== АЛЕРТ ===== */
.math-task__alert {
    font-size: 14px;
    margin-top: 8px;
    min-height: 24px;
}

/* ===== РЕЙТИНГ ===== */
.math-task__rating {
    font-style: italic;
    color: var(--color10);
    font-size: 80px;
    font-family: Andantino script, cursive;
    margin-top: 8px;
    margin-bottom: 8px;
    text-align: right;
}

.math-task__rating-value {
    font-size: 60px;
}

/* ===== КНОПКА ПРОВЕРИТЬ ===== */
.math-task__btn--check {
    padding: 10px 28px;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    background: var(--color01);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: inherit;
    white-space: nowrap;
}

.math-task__btn--check:hover {
    background: #739BF2;
    transform: translateY(-1px);
}

.math-task__btn--check:active {
    transform: translateY(0px);
}

.math-task__btn--check.active {
    background: #739BF2;
    color: #fff;
}

/* ===== КНОПКА ПРОДОЛЖИТЬ ===== */
.math-task__btn--next {
    padding: 10px 28px;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    background: var(--color07);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: inherit;
    white-space: nowrap;
}

.math-task__btn--next:hover {
    background: #7BC53E;
    transform: translateY(-1px);
}

.math-task__btn--next:active {
    transform: translateY(0px);
}

.math-task__btn--next.active {
    background: #7BC53E;
    color: #fff;
}

/* ===== КНОПКА НАЧАТЬ ЗАНОВО ===== */
.math-task__btn--restart {
    padding: 10px 28px;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    background: var(--color12);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: inherit;
    white-space: nowrap;
}

.math-task__btn--restart:hover {
    background: #D54A54;
    transform: translateY(-1px);
}

.math-task__btn--restart:active {
    transform: translateY(0px);
}

.math-task__btn--restart.active {
    background: #D54A54;
    color: #fff;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 576px) {
    .math__form {
        flex-direction: column;
        align-items: stretch;
    }

    .math__select {
        width: 100%;
    }

    .math__btn {
        width: 100%;
        justify-content: center;
    }

    .math-task__item {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 8px 0;
        border-bottom: 1px solid #eee;
    }

    .math-task__expression {
        text-align: left;
        min-width: auto;
    }

    .math-task__input-wrapper {
        width: 100%;
    }

    .math-task__input {
        flex: 1;
        min-width: 40px;
    }

    .math-task__controls {
        flex-direction: column;
        width: 100%;
    }

    .math-task__controls .math__btn {
        width: 100%;
        justify-content: center;
    }

    .math-task__rating {
        font-size: 48px;
        text-align: center;
    }

    .math-task__rating-value {
        font-size: 36px;
    }
}