* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 99%, #FECFEF 100%);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    padding: 2rem 0;
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.app-container {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    width: 90%;
    max-width: 800px;
    text-align: center;
}

header h1 {
    font-size: 2.4rem;
    font-weight: 800;
    color: #2d3748;
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 3px rgba(255,255,255,0.7);
}

header p {
    font-size: 1.1rem;
    color: #4a5568;
    margin-bottom: 2rem;
    font-weight: 600;
}

.game-board {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
}

.column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 1.2rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    user-select: none;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
}

.card:hover:not(.matched):not(.selected) {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.card.selected {
    border-color: #667eea;
    background: #ebf4ff;
    color: #4c51bf;
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.25);
}

.card.matched {
    background: #c6f6d5;
    color: #276749;
    border-color: #9ae6b4;
    cursor: default;
    transform: scale(0.95);
    opacity: 0.6;
    text-decoration: line-through;
    box-shadow: none;
}

.card.wrong {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    background: #fed7d7;
    color: #9b2c2c;
    border-color: #feb2b2;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
    40%, 60% { transform: translate3d(4px, 0, 0); }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    z-index: 1000;
}

.modal.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #fff;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.4s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.modal-content h2 {
    font-size: 2.5rem;
    color: #2d3748;
    margin-bottom: 1rem;
}

.modal-content p {
    font-size: 1.2rem;
    color: #718096;
    margin-bottom: 2rem;
}

#restart-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#restart-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.card.img-card {
    font-size: 3.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5rem;
}

.card.en-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.card.en-card::before {
    content: "🔊";
    font-size: 1.5rem;
}

@media (max-width: 650px) {
    .app-container {
        width: 100%; height: 100vh; max-width: none; max-height: none; border-radius: 0; padding: 1.2rem; padding-top: 60px; overflow-y: hidden; border: none;
        display: flex; flex-direction: column; justify-content: space-evenly;
    }
    .game-board { flex-direction: column; gap: 1rem; justify-content: center; flex: 1; margin: auto; width: 100%;}
    header h1 { font-size: 1.8rem; margin-bottom: 0.2rem; }
    header p { font-size: 1rem; margin-bottom: 0; }
    .card { padding: 0.8rem; font-size: 1rem; min-height: 55px; border-radius: 12px; }
    .card.img-card { font-size: 2.2rem; padding: 0.4rem; }
}
