* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #a1ffce, #faffd1);
    padding: 20px;
}

.card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    width: 700px;
    max-width: 100%;
    text-align: center;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.title {
    font-size: 22px;
    margin-bottom: 20px;
}

/* Шапка: тема, раунд, ошибки */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.level-badge {
    font-weight: bold;
    font-size: 14px;
    padding: 6px 12px;
    background: #26a69a;
    color: white;
    border-radius: 20px;
}

.progress-counter {
    font-size: 14px;
    color: #666;
}

button {
    padding: 10px 18px;
    margin: 8px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    background: #26a69a;
    color: white;
    transition: 0.2s;
}

button:hover {
    background: #1e8e83;
}

button:active {
    transform: scale(0.98);
}

/* Два столбца слов */
.columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

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

button.word {
    margin: 0;
    padding: 16px 10px;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    background: #f1f8f7;
    border: 3px solid #cfe8e5;
    border-radius: 14px;
    overflow-wrap: anywhere;
}

#enColumn button.word::before {
    content: '🔊 ';
    font-size: 18px;
}

button.word:hover {
    background: #e0f2f1;
}

button.word.selected {
    background: #fff3c4;
    border-color: #f9a825;
}

button.word.matched {
    background: #c8e6c9;
    border-color: #2e7d32;
    color: #2e7d32;
    opacity: 0.6;
    cursor: default;
}

button.word.wrong {
    background: #ffcdd2;
    border-color: #c62828;
    color: #c62828;
    animation: shake 0.3s;
}

@keyframes shake {
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.stats {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 14px;
}

.stats a {
    color: #666;
    text-decoration: none;
}

/* Выбор темы и конец темы */
.screen {
    display: none;
    text-align: center;
    animation: fadeIn 0.3s;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.screen-title {
    font-size: 34px;
    margin-bottom: 20px;
    font-weight: bold;
    color: #2e7d32;
}

.screen-subtitle {
    font-size: 18px;
    color: #666;
    margin-bottom: 15px;
}

.screen-stats {
    font-size: 16px;
    color: #444;
    margin-bottom: 15px;
}

#screenBtn {
    font-size: 20px;
    padding: 14px 32px;
    margin-bottom: 20px;
}

.topics-hint {
    font-size: 18px;
    font-weight: bold;
    margin: 10px 0 15px;
}

.topics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

button.topic {
    margin: 0;
    padding: 16px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    background: #f1f8f7;
    border: 3px solid #cfe8e5;
    border-radius: 14px;
}

button.topic:hover {
    background: #e0f2f1;
}

button.topic.done {
    border-color: #81c784;
}

.game-screen {
    display: block;
}

.hidden {
    display: none !important;
}

/* Мобильные устройства */
@media (max-width: 600px) {
    .card {
        padding: 20px 15px;
    }

    .header {
        flex-wrap: wrap;
        justify-content: center;
    }

    .title {
        font-size: 18px;
    }

    .columns {
        gap: 12px;
    }

    .column {
        gap: 10px;
    }

    button.word {
        padding: 14px 6px;
        font-size: 18px;
    }

    #enColumn button.word::before {
        font-size: 14px;
    }

    .screen-title {
        font-size: 26px;
    }

    .topics {
        grid-template-columns: 1fr;
    }
}
