.game {
    margin-top: 100px;
    margin-bottom: 100px;
}

.game__header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-direction: column;
    align-items: center;
}

.game__container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 800px;
    min-height: 500px;
    margin: 0 auto;
}

.game__title {
    text-align: center;
    margin-bottom: 20px;
    color: #383851;
}

.game__scrambled-word {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.game__letter {
    font-size: 32px;
    font-weight: 600;
    background: radial-gradient(circle, #383851, #20202f);
    color: var(--primary-text-color);
    margin: 0 2px;
    padding: 8px;
    border-radius: 5px;
    cursor: pointer;
    width: 48px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.game__letter:focus {
    outline: none;
    box-shadow: none;
}

.game__letter:active {
    outline: none;
    box-shadow: none;
}

/* .game__letter--used {
    background: transparent;
    color: transparent;
    pointer-events: none;
} */

.game__letter--used {
    background: transparent;
    color: transparent;
    pointer-events: none;
    /* нельзя кликать */
    user-select: none;
    /* нельзя выделять мышкой */
    visibility: hidden;
    /* скрывает текст, но сохраняет размер блока */
}


.game__answer-area {
    display: flex;
    justify-content: center;
}

.game__controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.game__button {
    background-color: #af74ca;
    color: var(--primary-text-color);
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    min-width: 140px;
}

.game__button:hover {
    background: #b77cd3;
}

.game__button--reset {
    background: #f44336;
}

.game__button--reset:hover {
    background: #d32f2f;
}

.game__feedback {
    margin-top: 15px;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

.game__answer-slot {
    width: 46px;
    height: 54px;
    margin: 0 2px;
    border: 1px solid #2a2a3d;
    border-radius: 5px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    font-size: 32px;
    font-weight: 600;
    transition:
        background-color 0.3s,
        color 0.3s;
}

.game__answer-slot.filled {
    background: radial-gradient(circle, #383851, #20202f);
    color: var(--primary-text-color);
    font-size: 32px;
    font-weight: 600;
    padding: 8px;
    border-radius: 5px;
    text-align: center;
    width: 46px;
    height: 54px;
}

.game__answer-slot.correct {
    background: radial-gradient(circle, #383851, #20202f);
    color: var(--primary-text-color);
}

.game__answer-slot.incorrect {
    background-color: #f8d7da;
    color: #ef747f;
}

.game__letter.incorrect {
    background: radial-gradient(circle, #f8d7da, #721c24);
    color: var(--primary-text-color);
}

.game__feedback.correct {
    font-size: 22px;
    font-weight: 600;
    margin-top: 10px;
    margin-bottom: 10px;
    color: rgb(17, 144, 123);
}

.game__feedback.incorrect {
    color: rgb(197, 47, 117);
}

/* ------------------- Подсказка ----------------- */
.game__hint {
    margin-bottom: 20px;
    font-size: 18px;
    color: #666;
    text-align: center;
}

.game__hint-button {
    background: #af74ca;
    color: var(--primary-text-color);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 15px;
}

.game__hint-sentence {
    font-weight: 600;
    color: #212121;
    margin-bottom: 20px;
}

.game__hint-text {
    display: none;
    margin-top: 20px;
    font-weight: 500;
    font-style: italic;
}

.game__hint-text.show {
    display: block;
    /* показываем при клике */
}


/* ------------------- Состояние: прыжок ----------------- */
@keyframes jump {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.jump {
    animation: jump 0.4s ease-out;
}

.game__button--restart {
    display: none;
    transition: opacity 0.3s ease;
}

.game__button--restart.inline-block {
    opacity: 1;
    visibility: visible;
}

/* ----------- Счетчик прогресса ----------- */
.game__progress {
    margin-top: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.game__progress-text {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.game__progress-bar {
    width: 100%;
    height: 6px;
    background-color: #eee;
    border-radius: 10px;
    overflow: hidden;
}

.game__progress-fill {
    width: 0%;
    height: 100%;
    background-color: var(--cerf-color-b);
    border-radius: 10px;
    transition: width 0.4s ease;
}

/* Перевод */
.game__translation {
    font-size: 22px;
    font-style: italic;
    text-align: center;
}

/* Кнопка сдаюсь */
.game__giveup {
    background-color: #af74ca;
    color: #fff;
    font-size: 15px;
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

.giveup {
    color: #202020;
    font-weight: bold;
}

/* ========= СЧЕТЧИК ОЧКОВ - УГАДАННЫХ СЛОВ ========== */
.game__score {
    padding: 8px 14px;
    background-color: var(--cerf-color-b);
    color: var(--primary-text-color);
    border-radius: 8px;
    text-align: center;
    margin: 0 auto;
    font-size: 15px;
}

/* ========== МЕНЮ НАСТРОЕК ИГРЫ - МОДАЛЬНОЕ ОКНО ========== */
.game__controls-header {
    margin-bottom: 10px;
}

.game__settings-button {
    font-size: 15px;
}

.game__settings-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.game__settings-content {
    position: relative;
    background: #fff;
    padding: 20px;
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    min-height: 240px;
    text-align: center;
    white-space: normal;
    /* важно, чтобы родитель позволял перенос */
}

.game__settings-title {
    margin-top: 20px;
    margin-bottom: 20px;
    font-size: 17px;
}

.hidden {
    display: none !important;
}

.game__settings-option {
    display: flex;
    align-items: flex-start;
    /* чтобы текст шёл сверху, не центрировался по высоте */
    gap: 10px;
    cursor: pointer;
    font-size: 16px;
    margin-bottom: 10px;
    width: 100%;
    /* важно для flex-переноса */
    white-space: normal;
    /* разрешает перенос текста */
    flex-wrap: wrap;
    /* ✅ разрешает перенос строк внутри flex-контейнера */
}

.game__settings-close {
    background: #4caf90;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

/* Кнопка закрытия */
.game__settings-close-icon {
    position: absolute;
    top: 12px;
    right: 18px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #313131;
    transition: color 0.2s ease;
}

/* ====== ЧЕКБОКСЫ КАСТОМНЫЕ - МЕНЮ НАСТРОЕК ИГРЫ ====== */
.game__settings-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    /* важно — чтобы flex мог переносить контент */
    cursor: pointer;
    font-size: 15px;
    margin-bottom: 20px;
    position: relative;
    white-space: normal;
    /* ✅ разрешает перенос текста внутри label */
    text-align: left;
}

/* Скрываем стандартный чекбокс */
.game__settings-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid #9e9e9e;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.checkbox-label {
    display: inline-block;
    flex: 1;
    min-width: 0;
    /* ✅ позволяет перенос внутри flex-элемента */
    white-space: normal;
    /* ✅ ключевое свойство для переноса */
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.4;
    font-size: 16px;
}

/* Галочка */
.game__settings-option input[type="checkbox"]::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 7px;
    height: 12px;
    border-right: 3px solid #3ea083;
    border-bottom: 3px solid #3ea083;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s;
}

/* Показываем галочку при активном */
.game__settings-option input[type="checkbox"]:checked::after {
    opacity: 1;
}