
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    background-image: url(bg.png);
    background-repeat: no-repeat;
    background-size: cover;
    color: #333;
    display: flex;
    justify-content: center;
    padding: 28px 14px;
}

.description {
    max-width: 900px;
    margin: 0 auto 30px;
    font-size: 18px;
    line-height: 1.35;
}

.app {
    width: 80%;
    margin: 0 auto;
    padding: 38px 34px 28px;
    border-radius: 55px;
    position: relative;
    overflow: hidden;
}


.title {
    text-align: center;
    font-family: Arial, sans-serif;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 28px;
    position: relative;
    z-index: 1;
}

.groups {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    position: relative;
    z-index: 1;
}

.group {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    min-height: 245px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.group-header {
    width: 100%;
    background: #df4b82;
    color: #fff;
    text-align: center;
    font-family: Arial, sans-serif;
    font-weight: 700;
    font-size: 18px;
    padding: 15px 0;
}

.drop-zone {
    width: 78%;
    min-height: 48px;
    margin: 22px 0 18px;
    background: #eeeeee;
    border-radius: 18px;
    border: 2px dashed transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
}

.drop-zone.drag-over {
    border-color: #df4b82;
    background: #f9d7e4;
}

.drop-zone.correct {
    background: #e2f6e8;
    border-color: #36a85c;
}

.drop-zone.incorrect {
    background: #ffe0e0;
    border-color: #d63d3d;
}

.words {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 14px;
    line-height: 1.7;
}

.answers {
    margin: 28px auto 20px;
    min-height: 58px;
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 14px;
    position: relative;
    z-index: 1;
}

.pool {
    min-height: 56px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card {
    width: 100%;
    min-height: 42px;
    border: none;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 2px 7px rgba(0, 0, 0, 0.12);
    font-family: Arial, sans-serif;
    font-size: 13px;
    color: #333;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 7px 10px;
    user-select: none;
    transition: transform 0.15s, box-shadow 0.15s, outline 0.15s;
}

.card:active {
    cursor: grabbing;
}

.card.selected {
    outline: 3px solid #df4b82;
    transform: translateY(-2px);
}

.card.dragging {
    opacity: 0.55;
}

.controls {
    min-height: 46px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.btn {
    min-width: 140px;
    border: none;
    border-radius: 8px;
    background-image: linear-gradient(149deg, #c42059 -15%, #f14c86 137%);
    color: #fff;
    font-family: Arial, sans-serif;
    font-size: 14px;
    cursor: pointer;
    padding: 12px 22px;
    transition: 0.2s;
}

.btn:hover {
    background: #c93f72;
}

.result {
    font-family: Arial, sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #249344;
}

.hidden {
    display: none;
}

@media (max-width: 760px) {
    .description {
        font-size: 16px;
    }

    .app {
        padding: 28px 18px 24px;
        border-radius: 34px;
    }

    .groups {
        grid-template-columns: repeat(2, 1fr);
    }

    .answers {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 430px) {
    .groups,
    .answers {
        grid-template-columns: 1fr;
    }

    .group {
        min-height: 220px;
    }
}