:root {
    --background-start: #eef7ff;
    --background-end: #f8f4ff;
    --card-background: #ffffff;

    --primary: #6254e7;
    --primary-dark: #493ac7;
    --primary-light: #eeeaff;

    --secondary: #18a999;
    --accent: #ffb703;

    --text-dark: #263238;
    --text-medium: #60707a;
    --border: #dce4eb;

    --error: #c62828;
    --success: #16866f;

    --shadow: 0 14px 40px rgba(46, 57, 89, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 24px;

    display: flex;
    justify-content: center;
    align-items: flex-start;

    font-family: Arial, Helvetica, sans-serif;
    color: var(--text-dark);

    background:
        radial-gradient(
            circle at top left,
            rgba(98, 84, 231, 0.13),
            transparent 35%
        ),
        linear-gradient(
            145deg,
            var(--background-start),
            var(--background-end)
        );
}

button,
input,
select {
    font: inherit;
}

.app-container {
    width: 100%;
    max-width: 760px;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 18px;

    margin-bottom: 24px;
}

.logo {
    width: 72px;
    height: 72px;

    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;

    border-radius: 22px;

    color: white;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);

    font-size: 46px;
    font-weight: 800;

    box-shadow: 0 10px 24px rgba(98, 84, 231, 0.28);
}

.app-header h1 {
    margin: 0 0 5px;

    font-size: clamp(30px, 6vw, 44px);
    line-height: 1;
}

.app-header p {
    margin: 0;

    color: var(--text-medium);
    font-size: 17px;
    line-height: 1.5;
}

.welcome-card {
    padding: 30px;

    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 28px;

    background: var(--card-background);
    box-shadow: var(--shadow);
}

.daily-goal {
    display: flex;
    align-items: center;
    gap: 14px;

    margin-bottom: 28px;
    padding: 16px 18px;

    border-radius: 18px;

    background: linear-gradient(135deg, #fff8df, #fff3c5);
}

.goal-icon {
    font-size: 34px;
}

.daily-goal div {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.daily-goal strong {
    font-size: 18px;
}

.daily-goal span:last-child {
    color: var(--text-medium);
}

.form-group {
    margin-bottom: 23px;
}

.form-group label,
.practice-selector legend {
    display: block;

    margin-bottom: 9px;

    font-size: 17px;
    font-weight: 700;
}

input[type="text"],
select {
    width: 100%;
    min-height: 54px;

    padding: 12px 15px;

    border: 2px solid var(--border);
    border-radius: 14px;

    color: var(--text-dark);
    background: white;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

input[type="text"]:focus,
select:focus {
    border-color: var(--primary);

    box-shadow: 0 0 0 4px rgba(98, 84, 231, 0.13);
}

.help-text {
    margin: 7px 2px 0;

    color: var(--text-medium);
    font-size: 13px;
}

.practice-selector {
    margin: 0;
    padding: 0;

    border: 0;
}

.practice-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 13px;
}

.practice-card {
    position: relative;

    min-height: 145px;

    cursor: pointer;
}

.practice-card input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
}

.practice-content {
    height: 100%;
    padding: 17px 12px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;

    border: 2px solid var(--border);
    border-radius: 18px;

    text-align: center;
    background: white;

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.practice-card:hover .practice-content {
    transform: translateY(-3px);

    border-color: #aaa1f3;

    box-shadow: 0 9px 22px rgba(98, 84, 231, 0.12);
}

.practice-card input:checked + .practice-content {
    border-color: var(--primary);

    background: var(--primary-light);

    box-shadow: 0 0 0 3px rgba(98, 84, 231, 0.1);
}

.practice-card input:focus-visible + .practice-content {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.practice-icon {
    min-width: 48px;
    height: 48px;
    padding: 0 7px;

    display: flex;
    justify-content: center;
    align-items: center;

    border-radius: 14px;

    color: white;

    font-size: 29px;
    font-weight: 800;
}

.multiplication-icon {
    background: var(--primary);
}

.division-icon {
    background: var(--secondary);
}

.mixed-icon {
    background: #f29e30;

    font-size: 21px;
}

.practice-content strong {
    font-size: 17px;
}

.practice-content small {
    color: var(--text-medium);

    font-size: 13px;
    line-height: 1.3;
}

.error-message {
    min-height: 22px;
    margin: 17px 0 5px;

    color: var(--error);

    font-weight: 700;
    text-align: center;
}

.start-button {
    width: 100%;
    min-height: 60px;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 11px;

    border: 0;
    border-radius: 17px;

    color: white;
    background: linear-gradient(
        135deg,
        var(--primary),
        var(--primary-dark)
    );

    font-size: 19px;
    font-weight: 800;

    cursor: pointer;

    box-shadow: 0 9px 20px rgba(98, 84, 231, 0.27);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.start-button:hover {
    transform: translateY(-2px);

    box-shadow: 0 12px 25px rgba(98, 84, 231, 0.33);
}

.start-button:active {
    transform: translateY(0);
}

.start-button span {
    font-size: 25px;
}

.progress-card {
    margin-top: 18px;
    padding: 19px;

    display: flex;
    justify-content: center;
    align-items: center;
    gap: 28px;

    border-radius: 22px;

    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 9px 24px rgba(46, 57, 89, 0.08);
}

.progress-item {
    flex: 1;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;

    color: var(--text-medium);
    text-align: center;
}

.progress-number {
    color: var(--primary);

    font-size: 27px;
    font-weight: 800;
}

.progress-divider {
    width: 1px;
    height: 45px;

    background: var(--border);
}

.next-step-message {
    margin-top: 18px;
    padding: 24px;

    border: 2px solid #9edacb;
    border-radius: 22px;

    text-align: center;
    background: #ebfff9;
}

.next-step-message h2 {
    margin: 10px 0 8px;
}

.next-step-message p {
    max-width: 580px;
    margin: 0 auto;

    color: var(--text-medium);
    line-height: 1.55;
}

.success-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto;

    display: flex;
    justify-content: center;
    align-items: center;

    border-radius: 50%;

    color: white;
    background: var(--success);

    font-size: 26px;
    font-weight: 800;
}

.hidden {
    display: none;
}

.app-footer {
    padding: 22px 10px 5px;

    color: var(--text-medium);
    text-align: center;
    font-size: 14px;
}

@media (max-width: 620px) {
    body {
        padding: 17px;
    }

    .app-header {
        align-items: flex-start;
    }

    .logo {
        width: 59px;
        height: 59px;

        border-radius: 18px;

        font-size: 38px;
    }

    .app-header p {
        font-size: 15px;
    }

    .welcome-card {
        padding: 22px 18px;
        border-radius: 23px;
    }

    .practice-options {
        grid-template-columns: 1fr;
    }

    .practice-card {
        min-height: 96px;
    }

    .practice-content {
        display: grid;
        grid-template-columns: 58px 1fr;
        grid-template-rows: auto auto;
        column-gap: 10px;

        text-align: left;
    }

    .practice-icon {
        grid-row: 1 / 3;
    }

    .practice-content strong,
    .practice-content small {
        width: 100%;
    }

    .progress-card {
        gap: 16px;
    }
}

/* GYAKORLÓKÉPERNYŐ */

.practice-screen {
    padding: 28px;

    border-radius: 28px;

    background: var(--card-background);
    box-shadow: var(--shadow);
}

.practice-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;

    margin-bottom: 24px;
}

.practice-top-row > span {
    color: var(--primary);
    font-size: 18px;
    font-weight: 800;
}

.secondary-button {
    min-height: 44px;
    padding: 10px 18px;

    border: 2px solid var(--border);
    border-radius: 13px;

    color: var(--text-dark);
    background: white;

    font-weight: 700;
    cursor: pointer;

    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        transform 0.2s ease;
}

.secondary-button:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    transform: translateY(-1px);
}

.practice-progress {
    margin-bottom: 25px;
}

.progress-information {
    display: flex;
    justify-content: space-between;
    gap: 16px;

    margin-bottom: 9px;

    color: var(--text-medium);
}

.progress-information strong {
    color: var(--primary);
}

.progress-bar-background {
    width: 100%;
    height: 14px;

    overflow: hidden;

    border-radius: 999px;

    background: #e8eaf0;
}

.progress-bar {
    width: 5%;
    height: 100%;

    border-radius: 999px;

    background: linear-gradient(
        90deg,
        var(--primary),
        #8b5cf6
    );

    transition: width 0.35s ease;
}

.question-card {
    padding: 32px 24px;

    border: 2px solid var(--primary-light);
    border-radius: 23px;

    text-align: center;

    background: linear-gradient(
        145deg,
        #ffffff,
        #faf9ff
    );
}

.question-instruction {
    margin: 0 0 16px;

    color: var(--text-medium);

    font-size: 17px;
    font-weight: 700;
}

.question-text {
    margin-bottom: 28px;

    color: var(--text-dark);

    font-size: clamp(44px, 11vw, 72px);
    font-weight: 800;
    line-height: 1.1;
}

.answer-label {
    display: block;

    margin-bottom: 9px;

    color: var(--text-medium);

    font-size: 16px;
    font-weight: 700;
}

.answer-input {
    width: min(100%, 240px);
    min-height: 70px;
    padding: 10px 15px;

    border: 3px solid var(--border);
    border-radius: 17px;

    color: var(--text-dark);
    background: white;

    font-size: 34px;
    font-weight: 800;
    text-align: center;

    outline: none;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.answer-input:focus {
    border-color: var(--primary);

    box-shadow: 0 0 0 5px rgba(98, 84, 231, 0.13);
}

.answer-input:disabled {
    color: var(--text-medium);
    background: #f1f3f5;
}

.feedback-message {
    min-height: 34px;
    margin: 17px 0;

    font-size: 20px;
    font-weight: 800;
}

.feedback-message.correct {
    color: var(--success);
}

.feedback-message.wrong {
    color: var(--error);
}

.question-card .start-button {
    max-width: 360px;
    margin-right: auto;
    margin-left: auto;
}


/* EREDMÉNYKÉPERNYŐ */

.result-screen {
    padding: 38px 28px;

    border-radius: 28px;

    text-align: center;

    background: var(--card-background);
    box-shadow: var(--shadow);
}

.result-icon {
    width: 86px;
    height: 86px;
    margin: 0 auto 18px;

    display: flex;
    justify-content: center;
    align-items: center;

    border-radius: 50%;

    background: linear-gradient(
        135deg,
        #fff4bd,
        #ffe071
    );

    font-size: 48px;
}

.result-screen h2 {
    margin: 0 0 10px;

    font-size: 32px;
}

.result-screen > p {
    color: var(--text-medium);

    font-size: 17px;
}

.result-score {
    margin: 28px auto 5px;

    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 10px;
}

.result-number {
    color: var(--primary);

    font-size: 70px;
    font-weight: 800;
}

.result-divider,
.result-total {
    color: var(--text-medium);

    font-size: 39px;
    font-weight: 800;
}

.result-percentage {
    margin: 0 0 28px !important;

    color: var(--success) !important;

    font-size: 27px !important;
    font-weight: 800;
}

.result-actions {
    max-width: 400px;
    margin: 0 auto;

    display: flex;
    flex-direction: column;
    gap: 12px;
}

.large-secondary-button {
    width: 100%;
    min-height: 54px;

    font-size: 17px;
}


/* KISEBB KÉPERNYŐK */

@media (max-width: 620px) {
    .practice-screen,
    .result-screen {
        padding: 21px 17px;

        border-radius: 23px;
    }

    .practice-top-row {
        align-items: flex-start;
    }

    .progress-information {
        font-size: 14px;
    }

    .question-card {
        padding: 27px 15px;
    }

    .question-text {
        margin-bottom: 23px;
    }

    .answer-input {
        width: 180px;
    }

    .result-number {
        font-size: 60px;
    }
}

.feedback-message.hint {
    color: #a85f00;
}

/* GYAKORLÁSI TARTOMÁNY KIVÁLASZTÁSA */

.range-selector {
    margin: 25px 0 0;
    padding: 0;

    border: 0;
}

.range-selector legend {
    display: block;

    margin-bottom: 10px;

    font-size: 17px;
    font-weight: 700;
}

.range-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 13px;
}

.range-card {
    position: relative;

    min-height: 100px;

    cursor: pointer;
}

.range-card input {
    position: absolute;

    width: 1px;
    height: 1px;

    opacity: 0;
}

.range-content {
    height: 100%;
    padding: 15px 10px;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;

    border: 2px solid var(--border);
    border-radius: 17px;

    text-align: center;
    background: white;

    transition:
        transform 0.2s ease,
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.range-card:hover .range-content {
    transform: translateY(-2px);

    border-color: #aaa1f3;

    box-shadow: 0 8px 18px rgba(98, 84, 231, 0.11);
}

.range-card input:checked + .range-content {
    border-color: var(--primary);

    background: var(--primary-light);

    box-shadow: 0 0 0 3px rgba(98, 84, 231, 0.1);
}

.range-card input:focus-visible + .range-content {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.range-content strong {
    color: var(--primary);

    font-size: 25px;
    font-weight: 800;
}

.range-content small {
    color: var(--text-medium);

    font-size: 13px;
}

.range-help {
    margin: 9px 2px 0;

    color: var(--text-medium);

    font-size: 13px;
    line-height: 1.4;
}

@media (max-width: 620px) {
    .range-options {
        grid-template-columns: 1fr;
    }

    .range-card {
        min-height: 72px;
    }

    .range-content {
        padding: 12px;

        flex-direction: row;
        justify-content: flex-start;
        gap: 15px;

        text-align: left;
    }

    .range-content strong {
        min-width: 65px;

        text-align: center;
    }

    .range-content small {
        font-size: 14px;
    }
}

/* ADAPTÍV ISMÉTLÉS */

.question-instruction.review-question {
    display: inline-block;

    padding: 7px 14px;

    border-radius: 999px;

    color: #7a4a00;
    background: #fff1c7;
}

.result-details {
    max-width: 420px;
    margin: 0 auto 28px;
    padding: 18px 20px;

    border: 2px solid var(--border);
    border-radius: 18px;

    background: #fafbff;
}

.result-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;

    padding: 10px 0;

    color: var(--text-medium);
    text-align: left;
}

.result-detail-row + .result-detail-row {
    border-top: 1px solid var(--border);
}

.result-detail-row strong {
    min-width: 36px;

    color: var(--primary);

    font-size: 20px;
    text-align: right;
}

@media (max-width: 620px) {
    .result-details {
        padding: 14px 16px;
    }

    .result-detail-row {
        font-size: 14px;
    }
}
