/* --- ОБЩИЕ СТИЛИ --- */
.game-section {
    padding: 40px 0;
    color: #ffffff;
    text-align: center;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

.lobby-title {
    margin-bottom: 50px;
}

/* --- ЛОББИ --- */
.game-lobby-container {
    display: block;
    transition: all 0.5s ease;
}
/* Добавьте это в секцию ЛОББИ или в конец файла */
.game-selection-wrapper {
    display: flex;          /* Включает режим гибкого контейнера */
    flex-direction: row;    /* Выстраивает элементы в горизонтальную линию */
    justify-content: center;/* Центрирует карточки по середине экрана */
    gap: 30px;              /* Создает расстояние между карточками */
    flex-wrap: wrap;        /* Позволяет карточкам переноситься на новую строку на очень узких экранах */
    margin-top: 20px;
}

/* Настройка ссылок-оберток, чтобы они не сужали карточки */
.game-selection-wrapper a {
    display: flex;
    text-decoration: none;
    color: inherit;
}

.ui-game-card {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 25px;
    padding: 40px;
    width: 280px;
    margin: 0 auto;
    transition: 0.3s;
    cursor: pointer;
}

.ui-game-card:hover {
    transform: translateY(-10px);
    border-color: #ffcc00;
    background: rgba(255, 255, 255, 0.12);
}

/* --- ИГРОВОЙ ЭКРАН --- */
#sorting-game-engine {
    display: none;
    opacity: 0;
    transition: opacity 0.6s ease;
}

/* Сейф с карточками */
.item-source-vault {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 30px 0;
    flex-wrap: wrap;
    min-height: 120px;
    padding: 25px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
}

/* Карточки */
.drag-item {
    padding: 12px 20px;
    background: linear-gradient(145deg, #ffcc00, #e6b800);
    color: #1a1a1a;
    border-radius: 10px;
    cursor: grab;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    touch-action: none;
}

/* --- КОРЗИНЫ (СТРОГО В РЯД) --- */
.target-drop-zones {
    display: flex;
    flex-direction: row;      /* Только в ряд */
    flex-wrap: nowrap;        /* Запрет переноса */
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    width: 100%;
}

.culture-bin {
    flex: 1;                  /* Равномерная ширина */
    min-width: 300px;         /* Минимальная ширина, чтобы не сжимались в ноль */
    max-width: 500px;         /* Чтобы не были слишком огромными */
    min-height: 350px;
    border: 4px dashed #555555;
    border-radius: 25px;
    display: flex;
    flex-wrap: wrap;          /* Карточки внутри пусть переносятся */
    align-content: flex-start;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    transition: 0.3s;
}

.culture-bin.drag-over-active {
    border-color: #ffcc00;
    background: rgba(255, 255, 255, 0.08);
}

.culture-bin h3 {
    width: 100%;
    margin-bottom: 15px;
    pointer-events: none;
}

/* --- КНОПКИ И УПРАВЛЕНИЕ --- */
.game-controls {
    margin-top: 40px;
}

.action-button {
    padding: 14px 30px;
    font-size: 1rem;
    font-weight: bold;
    color: #ffffff;
    background-color: #007bff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
    margin: 10px;
}

.btn-reset { background-color: #6c757d; }
.btn-check { background-color: #28a745; }

/* Эффекты проверки */
.status-correct { 
    background: #28a745 !important; 
    color: white !important; 
    border: 2px solid white; 
}

.status-wrong { 
    background: #dc3545 !important; 
    color: white !important; 
    border: 2px solid white; 
}

.result-score-display {
    margin-top: 30px;
    font-size: 2rem;
    color: #ffcc00;
    font-weight: bold;
}

/* Мобильная адаптация */
@media (max-width: 700px) {
    .target-drop-zones {
        flex-direction: column;
        align-items: center;
    }
    .culture-bin {
        width: 90%;
        min-width: auto;
    }
}
/* --- MEMORY GAME STYLES --- */

/* Верхняя панель */
.game-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 800px;
    margin: 0 auto 30px;
    padding: 0 20px;
}

.stats-container {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 30px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.1);
}

.stat-divider {
    width: 1px;
    height: 30px;
    background: rgba(255,255,255,0.2);
}

.stat-group {
    display: flex;
    flex-direction: column;
}

.stat-label { font-size: 0.7rem; color: #aaa; text-transform: uppercase; }
.stat-value { font-size: 1.4rem; color: #ffcc00; font-weight: bold; }

/* Сетка игры */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 120px);
    gap: 15px;
    justify-content: center;
    perspective: 1000px;
    margin-bottom: 50px;
}

/* Карточка и анимация */
.memory-card {
    width: 120px;
    height: 120px;
    cursor: pointer;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.memory-card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.card-front {
    background: #2c3e50;
    color: #ffcc00;
    border: 2px solid #3e5871;
}

.card-back {
    background: #ffcc00;
    transform: rotateY(180deg);
}

.memory-card.matched {
    cursor: default;
    opacity: 0.7;
}

/* Адаптивность */
@media (max-width: 600px) {
    .memory-grid {
        grid-template-columns: repeat(4, 80px);
        gap: 10px;
    }
    .memory-card { width: 80px; height: 80px; }
    .card-front, .card-back { font-size: 1.5rem; }
    .game-top-bar { flex-direction: column; gap: 15px; }
}
/* Центрирование всей игровой секции */
    .game-section {
        display: flex;
        flex-direction: column;
        align-items: center; /* Центровка по горизонтали */
        justify-content: center;
        text-align: center;
        width: 100%;
        min-height: 80vh; /* Занимает почти всю высоту экрана */
    }

    /* Центрирование контейнера со статистикой (PAIRS / MOVES) */
    .game-top-bar {
        display: flex;
        justify-content: center;
        width: 100%;
        margin-bottom: 20px;
    }

    /* Настройка сетки игры, чтобы она не растягивалась и была по центру */
    .memory-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr); /* 4 колонки */
        gap: 10px;
        margin: 0 auto; /* Центровка самого блока сетки */
        max-width: fit-content;
    }

    /* Центрирование кнопок управления */
    .game-controls {
        margin-top: 30px;
        display: flex;
        gap: 15px;
        justify-content: center;
        }

     /* --- СТИЛИ ДЛЯ WORD SCRAMBLE --- */

/* Контейнер игры */
.game-container {
    background: rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-radius: 30px;
    border: 1px solid rgba(52, 152, 219, 0.3);
    backdrop-filter: blur(10px);
    max-width: 600px;
    width: 100%;
    margin: 20px auto;
}

/* Отображение перемешанного слова */
.word-display {
    font-size: clamp(2rem, 8vw, 3.5rem);
    letter-spacing: 12px;
    color: #00ed9a; /* Твой новый мятный цвет */
    margin: 30px 0;
    text-transform: uppercase;
    font-weight: 700;
    /* Тень теперь тоже зеленая, с мягким свечением */
    text-shadow: 0 0 20px rgba(0, 237, 154, 0.5); 
    word-break: break-all;
}

/* Поле ввода */
.word-input {
    padding: 15px 20px;
    font-size: 1.2rem;
    border-radius: 12px;
    border: 2px solid rgba(52, 152, 219, 0.5);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    width: 100%;
    max-width: 300px;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.word-input:focus {
    border-color: #3498db;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.4);
    background: rgba(0, 0, 0, 0.5);
}

/* Подсказка */
.hint-text {
    color: #bdc3c7;
    font-style: italic;
    font-size: 1rem;
    margin-bottom: 25px;
}

/* Статистика (номер слова) */
.stats-info {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #ffcc00;
    margin-bottom: 10px;
    font-weight: bold;
}

/* Финальный экран (Результаты) */
.final-results {
    animation: fadeIn 0.8s ease forwards;
    text-align: center;
}

.score-big {
    font-size: 5rem;
    font-weight: 800;
    background: linear-gradient(to bottom, #ffcc00, #f39c12);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 20px 0;
}

#rank-message {
    font-size: 1.4rem;
    margin-bottom: 30px;
    color: #fff;
}

/* Анимация появления */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Адаптивность для мобилок */
@media (max-width: 480px) {
    .word-display {
        letter-spacing: 5px;
        font-size: 2.2rem;
    }
    .game-container {
        padding: 20px;
    }
}
/* Стиль для секретной карточки в меню */
.secret-game {
    border: 1px dashed #555 !important;
    background: rgba(0, 0, 0, 0.4) !important;
    filter: grayscale(1);
    transition: 0.5s;
}

.secret-game:hover {
    filter: grayscale(0);
    border: 1px solid #ffcc00 !important;
    box-shadow: 0 0 20px rgba(255, 204, 0, 0.2);
}

.secret-game h3 {
    letter-spacing: 5px;
    color: #888;
}

.secret-game:hover h3 {
    color: #ffcc00;
}
/* Добавь это в конец games.css, если хочешь "живые" карточки */
.fact-card {
    background: linear-gradient(145deg, #1e1e2e, #252538);
    border: 2px solid rgba(52, 152, 219, 0.3);
    backdrop-filter: blur(10px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fact-card:hover {
    border-color: #3498db;
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
}
.fact-card {
    /* ... твои старые стили ... */
    line-height: 1.4;
    word-wrap: break-word;
    font-size: 1.3rem; /* Чуть меньше шрифт, если текст длинный */
}
