* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    min-height: 100vh;
    padding: 30px 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.header p {
    font-size: 16px;
    opacity: 0.9;
}

.instructions {
    background: #f8f9fa;
    padding: 20px 30px;
    border-bottom: 3px solid #1e3c72;
}

.instructions h2 {
    color: #1e3c72;
    font-size: 20px;
    margin-bottom: 10px;
}

.instructions p {
    color: #555;
    font-size: 15px;
}

.content {
    padding: 40px;
}

.score-panel {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 30px;
}

.score-panel h3 {
    color: #1e3c72;
    font-size: 20px;
    margin-bottom: 15px;
}

.score-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #1e3c72;
}

.stat-label {
    color: #6c757d;
    font-size: 14px;
    margin-top: 5px;
}

.matching-container {
    display: flex;
    gap: 40px;
    margin-bottom: 30px;
}

.terms-column, .definitions-column {
    flex: 1;
}

.column-header {
    background: #1e3c72;
    color: white;
    padding: 15px;
    font-weight: bold;
    text-align: center;
    font-size: 18px;
    border-radius: 10px 10px 0 0;
}

.items-list {
    border: 2px solid #1e3c72;
    border-top: none;
    border-radius: 0 0 10px 10px;
    overflow: hidden;
}

.item-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid #dee2e6;
}

.item-row:last-child {
    border-bottom: none;
}

.item-number {
    background: #e9ecef;
    padding: 20px;
    text-align: center;
    font-weight: bold;
    color: #1e3c72;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 2px solid #dee2e6;
}

.item-content {
    background: white;
    padding: 20px;
    flex: 1;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.item-content:hover:not(.matched) {
    background: #f0f4ff;
    transform: translateX(5px);
}

.item-content.selected {
    background: #1e3c72;
    color: white;
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(30, 60, 114, 0.4);
}

.item-content.matched {
    background: #28a745;
    color: white;
    cursor: default;
    text-decoration: line-through;
}

.item-content.wrong {
    animation: shake 0.5s;
    background: #dc3545;
    color: white;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

.controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 35px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #1e3c72;
    color: white;
}

.btn-primary:hover {
    background: #2a5298;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 60, 114, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.results {
    display: none;
    text-align: center;
    padding: 40px;
}

.results.active {
    display: block;
}

.results h2 {
    font-size: 36px;
    color: #1e3c72;
    margin-bottom: 20px;
}

.final-score {
    font-size: 64px;
    font-weight: bold;
    color: #28a745;
    margin: 30px 0;
}

.results-details {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 10px;
    max-width: 500px;
    margin: 30px auto;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 15px 0;
    border-bottom: 1px solid #dee2e6;
    font-size: 18px;
}

.result-row:last-child {
    border-bottom: none;
}

@media (max-width: 1200px) {
    .matching-container {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 20px;
    }
    .item-content {
        padding: 15px;
        font-size: 14px;
    }
    .header h1 {
        font-size: 24px;
    }
}
