/* Обновленные стили для меню выбора количества стран */
#countryCountMenu {
    text-align: center;
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.count-buttons-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
    width: 100%;
    max-width: 500px;
}

.count-btn,
.back-to-region-btn {
    position: relative;
    padding: 15px 10px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    overflow: hidden;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 70px;
    text-align: center;
    word-break: break-word;
    line-height: 1.3;
    width: 100%;
}

.back-to-region-btn {
    background: linear-gradient(135deg, #6c7a89, #556270);
    max-width: 500px;
    margin-top: 0;
    grid-column: 1 / -1;
}

.count-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.count-number {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 5px;
}

.count-label {
    font-size: 0.9em;
}

/* Голубой ледник */
.count-btn-10 {
    background: linear-gradient(135deg, #5d9cec, #48cfad);
}

/* Зеленый лес */
.count-btn-20 {
    background: linear-gradient(135deg, #a0d468, #8cc152);
}

/* Золотая пустыня */
.count-btn-50 {
    background: linear-gradient(135deg, #ffce54, #fcbb42);
}

/* Серые горы */
.count-btn-100 {
    background: linear-gradient(135deg, #ccd1d9, #aab2bd);
}

/* Глубокий океан */
.count-btn-all {
    background: linear-gradient(135deg, #4fc1e9, #3bafda);
    grid-column: 1 / -1;
}

.back-to-region-btn:hover {
    background: linear-gradient(135deg, #556270, #3d4a5a);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.back-to-region-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Стили для тестового контейнера */
.quiz-container {
    margin: 0;
    padding: 16px;
    width: 100%;
    height: calc(100vh - 50px);
    box-sizing: border-box;
    overflow: auto;
}

.progress {
    height: 8px;
    background-color: #ecf0f1;
    border-radius: 4px;
    margin-bottom: 15px;
    width: 100%;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 4px;
    width: 0%;
    transition: width 0.3s ease, display 0.3s ease;
}

.question-container {
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.question {
    font-size: clamp(1.1rem, 4vw, 1.3rem);
    margin-bottom: 15px;
    color: #2c3e50;
    word-break: break-word;
}

/* Стили для кнопки подтверждения */
.submit-btn {
    background-color: #4CAF50;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    width: 100%;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: #45a049;
}

.submit-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

/* Стили для обратной связи */
.feedback {
    margin-top: 15px;
    padding: 12px;
    border-radius: 4px;
    font-weight: bold;
    text-align: center;
}

.feedback-correct {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.feedback-incorrect {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Стили для навигации в тесте */
.quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    gap: 15px;
    width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
}

.back-btn,
.next-btn,
.retry-btn {
    padding: 10px 15px;
    background: #f8f9fa;
    color: #e74c3c;
    border: 2px solid #e74c3c;
    border-radius: 6px;
    cursor: pointer;
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    transition: all 0.3s;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 200px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    word-break: break-word;
}

.next-btn {
    background: linear-gradient(90deg, #3498db, #2ecc71);
    color: white;
    border: none;
}

.result {
    text-align: center;
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    margin-top: 25px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
    word-break: break-word;
}

/* Адаптивность для навигации в тесте */
@media (max-width: 768px) {
    .quiz-navigation {
        gap: 12px;
    }

    .back-btn,
    .next-btn {
        max-width: 48%;
    }

    .count-buttons-grid {
        grid-template-columns: 1fr;
    }

    .count-btn-all {
        grid-column: 1;
    }
}

@media (max-width: 480px) {
    .quiz-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .back-btn,
    .next-btn,
    .retry-btn {
        max-width: 100%;
        width: 100%;
    }
}

/* Стили для флага */
.flag-image {
    max-width: 100%;
    max-height: 150px;
    margin: 0 auto 15px;
    display: block;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    user-select: none;
    pointer-events: none
}

.flag-question-text {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #2c3e50;
    font-weight: bold;
}

@media (max-width: 768px) {
    .flag-image {
        max-height: 120px;
    }
}

@media (max-width: 480px) {
    .flag-image {
        max-height: 100px;
    }
}

.country-description {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 5px;
    border-left: 4px solid #007bff;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.country-question-text {
    text-align: center;
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: #2c3e50;
    font-weight: bold;
}

.capital-question-text {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #2c3e50;
    font-weight: bold;
}

/* Фиолетовый градиент для бесконечного режима */
.count-btn-infinite {
    background: linear-gradient(135deg, #ac92ec, #967adc);
    grid-column: 1 / -1;
}

.count-btn-infinite:hover {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translateY(-5px) scale(1);
        box-shadow: 0 8px 20px rgba(172, 146, 236, 0.4);
    }

    50% {
        transform: translateY(-5px) scale(1.02);
        box-shadow: 0 8px 25px rgba(172, 146, 236, 0.6);
    }

    100% {
        transform: translateY(-5px) scale(1);
        box-shadow: 0 8px 20px rgba(172, 146, 236, 0.4);
    }
}

/* Стили для контейнера с вариантами ответов */
.options-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 20px;
    width: 100%;
}

/* Стили для кнопок вариантов ответов */
.option-btn {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f5f5f5;
    color: #333;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.option-btn:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.option-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Стили для правильного ответа */
.option-btn.correct {
    background-color: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

/* Стили для неправильного ответа */
.option-btn.incorrect {
    background-color: #f44336;
    color: white;
    border-color: #f44336;
}

/* Стили для отключенных кнопок после ответа */
.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .options-container {
        grid-template-columns: 1fr;
    }
    
    .option-btn {
        padding: 14px 15px;
        font-size: 15px;
    }
}