* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f7fc;
    color: #172033;
}

.app {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 22px 50px;
}

h1 {
    text-align: center;
    font-size: 42px;
    margin: 10px 0 30px;
    font-weight: 800;
}

h1 span {
    color: #2563eb;
}

.top-menu {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: -10px 0 24px;
}

.top-menu a {
    padding: 12px 22px;
    border-radius: 999px;
    background: #ffffff;
    color: #2563eb;
    text-decoration: none;
    font-weight: 800;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
}

.top-menu a.active,
.top-menu a:hover {
    background: #2563eb;
    color: #ffffff;
}

.filters-panel,
.stats-panel,
.card {
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 16px 45px rgba(15, 23, 42, .08);
}

.filters-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 26px 30px;
    margin-bottom: 22px;
}

.filter-item {
    padding: 0 26px;
    border-right: 1px solid #e5eaf2;
}

.filter-item:first-child {
    padding-left: 0;
}

.filter-item:last-child {
    border-right: 0;
    padding-right: 0;
}

.filter-item label {
    display: block;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.filter-item select {
    width: 100%;
    height: 54px;
    padding: 0 18px;
    border-radius: 13px;
    border: 1px solid #d8dee9;
    background: #ffffff;
    color: #111827;
    font-size: 18px;
    outline: none;
    cursor: pointer;
}

.stats-panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 22px 30px;
    margin-bottom: 22px;
}

.stat {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 22px;
    border-right: 1px solid #e5eaf2;
}

.stat:last-child {
    border-right: 0;
}

.stat-icon {
    width: 54px;
    height: 54px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 28px;
    font-weight: 800;
    background: #ffffff;
}

.stat-icon.blue {
    color: #2563eb;
    border: 3px solid #2563eb;
}

.stat-icon.orange {
    color: #f59e0b;
    border: 3px solid #f59e0b;
}

.stat-icon.green {
    color: #16a34a;
    border: 3px solid #16a34a;
}

.stat small {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.stat b {
    font-size: 28px;
    color: #2563eb;
}

.stat:last-child b {
    color: #16a34a;
}

.card {
    padding: 34px 30px 40px;
    text-align: center;
}

#meta {
    display: inline-block;
    color: #2563eb;
    background: #eaf2ff;
    border-radius: 9px;
    padding: 7px 14px;
    font-size: 16px;
    margin-bottom: 18px;
}

#direction {
    color: #2563eb;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 12px;
}

#question,
#ukSentence {
    font-size: 42px;
    line-height: 1.2;
    margin: 0 0 30px;
    font-weight: 800;
}

.answers {
    display: grid;
    gap: 14px;
}

.answers button {
    width: 100%;
    min-height: 70px;
    padding: 18px 22px;
    border-radius: 12px;
    border: 1px solid #dbe2ea;
    background: #ffffff;
    color: #111827;
    font-size: 24px;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
    transition: .15s;
}

.answers button:not(:disabled):hover {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
}

.answers button:disabled {
    cursor: not-allowed;
    opacity: .9;
}

.answers button.correct {
    border-color: #22c55e;
    background: #ecfdf3;
    color: #15803d;
    font-weight: 700;
}

.answers button.wrong {
    border-color: #ef4444;
    background: #fef2f2;
    color: #b91c1c;
    font-weight: 700;
}

.answers button span {
    float: right;
    font-weight: 900;
}

.sentence-label {
    text-align: left;
    color: #64748b;
    font-size: 15px;
    font-weight: 800;
    text-transform: uppercase;
    margin: 18px 0 10px;
}

.drop-zone,
.words-zone {
    min-height: 82px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
    border-radius: 16px;
}

.drop-zone {
    background: #eff6ff;
    border: 2px dashed #2563eb;
}

.words-zone {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.word-card {
    padding: 14px 20px;
    border-radius: 12px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    font-size: 26px;
    line-height: 1.3;
    font-weight: 700;
    cursor: grab;
    user-select: none;
    box-shadow: 0 6px 14px rgba(15, 23, 42, .08);
    touch-action: none;
}

.word-card:hover {
    border-color: #2563eb;
    color: #2563eb;
}

.word-card.dragging {
    opacity: .5;
}

.main-btn,
.secondary-btn {
    margin-top: 22px;
    padding: 15px 24px;
    border-radius: 13px;
    border: 0;
    font-size: 18px;
    font-weight: 800;
    cursor: pointer;
}

.main-btn {
    background: #2563eb;
    color: white;
}

.secondary-btn {
    background: #e2e8f0;
    color: #172033;
    margin-left: 10px;
}

.result-text {
    margin-top: 22px;
    font-size: 20px;
    font-weight: 800;
}

.result-text.success {
    color: #16a34a;
}

.result-text.error {
    color: #dc2626;
}

.popup {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(20px);
    background: #172033;
    color: #ffffff;
    padding: 18px 28px;
    border-radius: 12px;
    opacity: 0;
    transition: .25s;
    pointer-events: none;
    font-size: 20px;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .35);
    z-index: 9999;
}

.popup.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 700px) {
    .app {
        padding: 16px 10px 32px;
    }

    h1 {
        font-size: 27px;
        line-height: 1.15;
        margin: 0 0 14px;
    }

    .top-menu {
        gap: 8px;
        margin: 0 0 14px;
    }

    .top-menu a {
        padding: 9px 14px;
        font-size: 13px;
    }

    .filters-panel {
        display: flex;
        flex-direction: column;
        padding: 14px;
        border-radius: 16px;
        margin-bottom: 12px;
    }

    .filter-item {
        padding: 0 0 12px;
        margin-bottom: 12px;
        border-right: 0;
        border-bottom: 1px solid #e5eaf2;
    }

    .filter-item:last-child {
        padding-bottom: 0;
        margin-bottom: 0;
        border-bottom: 0;
    }

    .filter-item label {
        font-size: 11px;
        margin-bottom: 6px;
    }

    .filter-item select {
        height: 44px;
        font-size: 14px;
        padding: 0 12px;
    }

    .stats-panel {
        display: flex;
        padding: 12px 8px;
        border-radius: 16px;
        margin-bottom: 12px;
    }

    .stat {
        flex: 1;
        gap: 6px;
        border-right: 1px solid #e5eaf2;
        padding: 0 4px;
        justify-content: center;
    }

    .stat:last-child {
        border-right: 0;
    }

    .stat-icon {
        width: 34px;
        height: 34px;
        font-size: 18px;
        border-width: 2px;
    }

    .stat small {
        font-size: 11px;
    }

    .stat b {
        font-size: 20px;
    }

    .card {
        padding: 20px 12px 22px;
        border-radius: 18px;
    }

    #meta {
        font-size: 12px;
        padding: 5px 10px;
        margin-bottom: 12px;
    }

    #direction {
        font-size: 17px;
        margin-bottom: 10px;
    }

    #question,
    #ukSentence {
        font-size: 31px;
        line-height: 1.25;
        margin-bottom: 22px;
    }

    .answers {
        gap: 10px;
    }

    .answers button {
        min-height: 62px;
        padding: 14px;
        font-size: 22px;
        line-height: 1.3;
        border-radius: 10px;
    }

    .sentence-label {
        font-size: 12px;
        margin: 14px 0 8px;
    }

    .drop-zone,
    .words-zone {
        min-height: 64px;
        padding: 10px;
        gap: 8px;
        border-radius: 12px;
    }

    .word-card {
        font-size: 22px;
        padding: 10px 12px;
        border-radius: 10px;
    }

    .main-btn,
    .secondary-btn {
        width: 100%;
        margin: 14px 0 0;
        padding: 13px 16px;
        font-size: 16px;
    }

    .popup {
        width: calc(100% - 24px);
        bottom: 16px;
        font-size: 16px;
        padding: 14px 18px;
    }
}