/* ===== ОСНОВНЫЕ СТИЛИ ИГРЫ ===== */

.game-progress {
    margin: 30px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 15px;
}

.progress-bar {
    flex-grow: 1;
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    max-width: 400px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #509e9c, #6bc2c0);
    transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-radius: 6px;
}

@keyframes progress-complete {
    0% { width: 75%; }
    100% { width: 100%; }
}

.result-success .progress-fill {
    animation: progress-complete 0.5s ease forwards;
}

.progress-text {
    font-weight: 700;
    color: #333;
    font-size: 16px;
    white-space: nowrap;
}

/* ===== КНОПКИ ===== */

.btn-game {
    position: relative;
    display: inline-block;
    background-color: #509e9c;
    color: #ffffff;
    text-transform: uppercase;
    cursor: pointer;
    font-size: 15px;
    line-height: 15px;
    overflow: hidden;
    margin: 8px 4px auto;
    padding: 12px 15px;
    border: 1px solid #509e9c;
    border-radius: 9px;
    transition: all 0.3s ease;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.btn-game:hover {
    background-color: #3d8c8a;
    border-color: #3d8c8a;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(80, 158, 156, 0.3);
}

.btn-game:active {
    transform: translateY(0);
}

.reset-game-btn {
    background-color: #333 !important;
    border-color: #333 !important;
}

.reset-game-btn:hover {
    background-color: #444 !important;
    border-color: #444 !important;
    box-shadow: 0 6px 12px rgba(51, 51, 51, 0.3);
}


/* ===== КАРТОЧКИ ===== */

.game-card {
    border: 8px solid transparent;
    border-radius: 16px;
    padding: 25px 20px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    background: #333;
    color: white;
    height: 100%;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.game-card:hover:not(.answered) {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    border-color: #509e9c;
}

/* Иконка карточки */
.game-card-icon {
    font-size: 36px;
    margin-bottom: 20px;
    text-align: center;
    transition: transform 0.3s ease;
}

.game-card:hover:not(.answered) .game-card-icon {
    transform: scale(1.1);
}

/* Текст карточки */
.game-card-text h4 {
    margin: 0 0 15px 0;
    color: white;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 400;
    min-height: 50px;
}

.game-card-text p {
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    font-weight: 300;
}

/* Футер с ответом */
.game-card-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.answer-placeholder {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    transition: all 0.3s ease;
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

/* ===== СОСТОЯНИЯ ОТВЕТОВ ===== */

.answer-shown {
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 700;
    text-align: center;
    display: inline-block;
    margin: 0 auto;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.answer-shown.transformation {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
    animation: celebrate 0.8s ease;
}

.answer-shown.optimization {
    background: linear-gradient(135deg, #f44336, #c62828);
    color: white;
    animation: shake 0.5s ease;
}

.explanation {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 8px;
    font-style: italic;
    text-align: center;
    animation: fadeIn 0.5s ease;
}

/* Трансформация - зеленый фон карточки */
.game-card.correct {
    background: linear-gradient(135deg, #2E7D32, #4CAF50);
    animation: correct-glow 0.6s ease;
}

/* Оптимизация - красный фон карточки */
.game-card.incorrect {
    background: linear-gradient(135deg, #c62828, #f44336);
    animation: incorrect-shake 0.5s ease;
}

/* Заблокированная карточка */
.game-card.answered {
    cursor: default;
    transform: scale(0.98);
}

/* ===== АНИМАЦИИ ===== */

@keyframes pop-in {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes correct-glow {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

@keyframes incorrect-shake {
    0%, 100% { transform: translateX(0) rotate(0); }
    25% { transform: translateX(-5px) rotate(-1deg); }
    75% { transform: translateX(5px) rotate(1deg); }
}

@keyframes celebrate {
    0% { transform: scale(1) rotate(0); }
    25% { transform: scale(1.1) rotate(5deg); }
    50% { transform: scale(1.1) rotate(-5deg); }
    75% { transform: scale(1.1) rotate(5deg); }
    100% { transform: scale(1) rotate(0); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* ===== РЕЗУЛЬТАТ ИГРЫ ===== */

.game-result {
    text-align: center;
    padding: 50px 30px;
    background: linear-gradient(135deg, #509e9c, #3d8c8a);
    border-radius: 20px;
    margin: 40px 0;
    animation: slideUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 15px 35px rgba(80, 158, 156, 0.3);
    color: white;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-success h3 {
    color: white;
    margin-bottom: 20px;
    font-size: 28px;
    font-weight: 700;
}

.result-success p {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Стили для кнопок в результате игры */
.result-success {
    text-align: center;
}

.result-success .btn-game {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 25px;
    margin: 5px 8px;
    vertical-align: middle;
    text-decoration: none;
}
.result-success .btn-game:hover {
    background: #f8f9fa;
    color: #3d8c8a;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(255, 255, 255, 0.3);
}


/* Контейнер для кнопок если их несколько */
.result-success .btn-game + .btn-game {
    margin-left: 15px;
}

/* Кнопка сброса */
.result-success .reset-game-btn {
    background: #333;
    border-color: #333;
}

.result-success .reset-game-btn:hover {
    background: #444;
    border-color: #444;
}

/* На мобильных делаем кнопки блочными */
@media (max-width: 575px) {
    .result-success .btn-game {
        display: block;
        width: 100%;
        max-width: 300px;
        margin: 10px auto;
    }
    
    .result-success .btn-game + .btn-game {
        margin-left: auto;
        margin-right: auto;
    }
}
.result-success .button-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* ===== АДАПТИВНОСТЬ ===== */

@media (max-width: 767px) {
    .game-card {
        padding: 20px 15px;
        min-height: 200px;
        margin-bottom: 15px;
    }
    
    .game-card-text h4 {
        font-size: 16px;
        min-height: 40px;
    }
    
    .game-card-text p {
        font-size: 14px;
    }
    
    .game-card-icon {
        font-size: 32px;
    }
    
    .answer-shown {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .result-success h3 {
        font-size: 24px;
    }
    
    .result-success p {
        font-size: 16px;
    }
}

@media (max-width: 575px) {
    .game-card {
        min-height: 180px;
    }
    
    .game-progress {
        flex-direction: column;
        align-items: stretch;
    }
    
    .progress-bar {
        max-width: 100%;
    }
    
    .reset-game-btn {
        margin: 10px 0 0 0 !important;
        align-self: center;
    }
}

/* ===== АДАПТИВНАЯ СЕТКА ДЛЯ ОДНОГО КОНТЕЙНЕРА ===== */

.game-container-adaptive {     display: grid;     gap: 20px;     margin: 30px 0; }

/* Десктопы ≥992px - 4 карточки в ряд */
@media (min-width: 992px) {
    .game-container-adaptive {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Планшеты 768px-991px - 2 карточки в ряд */
@media (min-width: 768px) and (max-width: 991px) {
    .game-container-adaptive {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Большие мобильные 576px-767px - 2 карточки в ряд */
@media (min-width: 576px) and (max-width: 767px) {
    .game-container-adaptive {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        margin: 20px 0;
    }
}

/* Маленькие мобильные ≤575px - 1 карточка в ряд */
@media (max-width: 575px) {
    .game-container-adaptive {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 20px 0;
    }
}
/* Цвета для cultural трансформаций */
[data-game-type="cultural"] .progress-fill {
    background: linear-gradient(90deg, #9C27B0, #7B1FA2);
}

[data-game-type="cultural"] .game-result {
    background: linear-gradient(135deg, #9C27B0, #7B1FA2);
}

/* Специфичные цвета для digital трансформации */
[data-game-type="digital"] .progress-fill {
    background: linear-gradient(90deg, #FF9800, #F57C00);
}

[data-game-type="digital"] .game-result {
    background: linear-gradient(135deg, #FF9800, #F57C00);
}