* {
    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, #fbc2eb, #a6c1ee);
    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: 24px;
    margin-bottom: 20px;
    min-height: 30px;
}

.title b {
    color: #667eea;
}

/* Header with level and lives */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

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

.lives {
    font-size: 22px;
    letter-spacing: 3px;
}

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

/* Кнопка повтора озвучки */
.question {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 140px;
    margin-bottom: 25px;
}

.speak-btn {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    font-size: 50px;
    padding: 0;
    margin: 0;
    background: #ffe082;
}

.speak-btn:hover {
    background: #ffd54f;
}

/* Варианты ответа */
.options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 10px;
}

button.option {
    margin: 0;
    padding: 0;
    height: 120px;
    font-size: 72px;
    font-weight: bold;
    color: #333;
    background: #f3f4ff;
    border: 3px solid #d6daf7;
    border-radius: 18px;
}

button.option:hover {
    background: #e6e9ff;
}

button.option.correct {
    background: #c8e6c9;
    border-color: #2e7d32;
    color: #2e7d32;
}

button.option.wrong {
    background: #ffcdd2;
    border-color: #c62828;
    color: #c62828;
}

button.option.faded {
    opacity: 0.4;
}

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

button:hover {
    background: #5568d3;
}

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

.result {
    font-size: 22px;
    min-height: 30px;
    margin: 15px 0;
}

.correct-text {
    color: #2e7d32;
}

.wrong-text {
    color: #c62828;
}

.stats {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 14px;
}

.stats {
    display: flex;
    justify-content: space-between;
}

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

/* Выбор диапазона букв */
.range-picker {
    margin: 0 auto 25px;
    padding: 20px;
    max-width: 400px;
    background: #f3f4ff;
    border-radius: 16px;
}

.range-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 12px;
}

.range-picker label {
    display: inline-block;
    margin: 0 10px;
    font-size: 18px;
}

.range-picker select {
    font-size: 20px;
    padding: 6px 10px;
    border: 2px solid #d6daf7;
    border-radius: 10px;
    background: white;
}

.range-hint {
    margin-top: 12px;
    font-size: 14px;
    color: #666;
    min-height: 18px;
}

#screenBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Game Over / Level Complete screens */
.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: 40px;
    margin-bottom: 20px;
    font-weight: bold;
}

.screen-title.victory {
    color: #2e7d32;
}

.screen-title.defeat {
    color: #c62828;
}

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

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

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

.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: 20px;
    }

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

    button.option {
        height: 100px;
        font-size: 60px;
    }

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