/* matching-game.css */

body {
    margin: 0;
    font-family: system-ui, sans-serif;
    background: #f1f5f1;
    color: #20362b;
}

.matching-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

.matching-shell {
    background: white;
    border-radius: 24px;
    padding: 32px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
}

.back-link {
    display: inline-block;
    margin-bottom: 18px;
    color: #1f7a45;
    text-decoration: none;
    font-weight: 700;
}

.matching-header h1 {
    margin: 0 0 10px 0;
    font-size: 40px;
}

.matching-header p {
    margin: 0 0 28px 0;
    font-size: 18px;
    color: #526b5e;
}

.matching-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 30px;
    align-items: start;
}

.term-panel,
.match-panel {
    background: #eaf6ef;
    border: 1px solid #c8ded0;
    border-radius: 22px;
    padding: 22px;
}

.term-panel h2,
.match-panel h2 {
    margin: 0 0 18px 0;
    font-size: 24px;
}

.term-bank {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.term-card {
    background: white;
    border: 2px solid #b9d2c1;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 800;
    text-align: center;
    cursor: grab;
    user-select: none;
}

.term-card:active {
    cursor: grabbing;
}

.match-board {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.match-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 18px;
    align-items: stretch;
}

.description-card {
    background: white;
    border: 1px solid #c8ded0;
    border-radius: 16px;
    padding: 18px;
    font-size: 16px;
    line-height: 1.5;
    color: #20362b;
}

.match-drop-zone {
    min-height: 58px;
    border: 2px dashed #83aa91;
    border-radius: 16px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    text-align: center;
    padding: 12px;
    box-sizing: border-box;
}

.match-drop-zone.filled {
    border-style: solid;
}

.match-drop-zone.correct {
    border-color: #1f7a45;
    background: #eaf6ef;
}

.match-drop-zone.incorrect {
    border-color: #e53935;
    background: #fdecec;
}

.matching-actions {
    display: flex;
    gap: 14px;
    margin-top: 28px;
    flex-wrap: wrap;
}

.primary-btn,
.secondary-btn {
    border-radius: 12px;
    padding: 14px 22px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

.primary-btn {
    background: #1f7a45;
    color: white;
    border: none;
}

.secondary-btn {
    background: white;
    color: #1f7a45;
    border: 2px solid #1f7a45;
}

.game-status {
    margin-top: 18px;
    min-height: 24px;
    font-weight: 700;
}

@media (max-width: 850px) {
    .matching-layout {
        grid-template-columns: 1fr;
    }

    .term-bank {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .term-card {
        flex: 1 1 160px;
    }

    .match-row {
        grid-template-columns: 1fr;
    }
}
.back-link:hover { color: #155b33; text-decoration: underline; }
.primary-btn:hover { background: #155b33; }
.secondary-btn:hover { background: #eaf6ef; }
.term-card:hover { border-color: #1f7a45; }
.primary-btn:focus-visible, .secondary-btn:focus-visible, .back-link:focus-visible { outline: 3px solid #1f7a45; outline-offset: 3px; }
