* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Arial, Helvetica, sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;

}

.container {
    background: white;
    width: 95%;
    max-width: 1200px;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

h1 {
   color: #555;
   font-size: 2.2rem;
   margin-bottom: 30px;
   padding-bottom: 15px;
   border-bottom: 2px solid #667eea;
   text-align: center;
}

.section {
    margin-bottom: 30px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.text-box {
    background: #f4f6ff;
    padding: 25px;
    border-radius: 15px;
    line-height: 1.8;
    color: #444;
    font-size: 1.1em;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
    width: 100%;
}

.column {
    flex: 1;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.column h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #555;
    font-size: 1.8em;
    border-bottom: 2px solid #667eea;
    padding-bottom: 15px;
    width: 100%;
}

.card {
    background: #ffffff;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 220px;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    margin-left: auto;
    margin-right: auto;
}

.card img {
    width: 100%;
    height: 80%;
    object-fit: cover;
    display: block;
}

.card p {
    text-align: center;
    padding: 8px;
    font-weight: bold;
    color: #333;
    background: #f8f9fa;
    margin: 0;
    height: 20%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.card:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 20px rgba(0,0,0,0.2);
}

.card:hover img {
    transform: scale(1.05);
}

.card.selected {
    border: 3px solid #667eea;
    transform: scale(1.02);
}

.card.matched {
    border: 3px solid #2ecc71;
    opacity: 0.9;
    cursor: default;
    transform: scale(0.98);
}

.card.matched:hover {
    transform: scale(0.98);
}

.card.wrong {
    border: 3px solid #e74c3c;
    animation: shake 0.5s ease;
}

#message {
    text-align: center;
    font-size: 1.2em;
    font-weight: bold;
    margin: 30px 0 20px;
    padding: 15px;
    min-height: 60px;
    
    border-radius: 10px;
    color: #333;
   
}

#finalExplanation {
    text-align: center;
    padding: 20px;
    background: #3498db;
    color: white;
    border-radius: 15px;
    margin-top: 20px;
    font-size: 1.2em;
    font-weight: bold;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* За по-големи екрани */
@media (min-width: 1200px) {
    .card {
        max-width: 250px;
    }
    
    .card p {
        font-size: 16px;
    }
}

/* За мобилни устройства */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .column h2 {
        font-size: 1.5em;
    }
    
    .card {
        max-width: 180px;
    }
    
    .card p {
        font-size: 12px;
    }
    
    #message {
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.6em;
    }
    
    .text-box {
        padding: 15px;
        font-size: 1em;
    }
}





