/* Подключаем локальный шрифт Nunito Black */
@font-face {
    font-family: 'Nunito-Black';
    src: url('./assets/Nunito-Black.woff2') format('woff2');    
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* Подключаем локальный шрифт Nunito Regular */
@font-face {
    font-family: 'Nunito-Regular';
    src: url('./assets/Nunito-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}



html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
     overflow: hidden; /*всё, что за пределами, обрезаем */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-family: 'Nunito-Black', Arial, sans-serif;  /* Применяем наш шрифт с резервными вариантами */
    background-color: #000000;
}






/* ================= ОСНОВНОЙ КОНТЕЙНЕР ИГРЫ ================= */
/* ================= ОСНОВНОЙ КОНТЕЙНЕР ИГРЫ ================= */
/* ================= ОСНОВНОЙ КОНТЕЙНЕР ИГРЫ ================= */


/* Контейнер для всей игры с фиксированными размерами и масштабированием */
#gameWrapper {
    width: 1080px; /* Было 1920px */
    height: 1920px; /* Было 1080px */
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    left: 50%;
    top: 50%;
    transform-origin: center center;
    transform: translate(-50%, -50%) scale(var(--scale-factor));
    overflow: hidden;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}



/* ================= ОБЩИЕ СТИЛИ ЭКРАНОВ ================= */
/* ================= ОБЩИЕ СТИЛИ ЭКРАНОВ ================= */
/* ================= ОБЩИЕ СТИЛИ ЭКРАНОВ ================= */

/* Базовые стили для всех экранов (старт, выбор уровня, игра) */
.screen {
    position: absolute;
    visibility: hidden;
    opacity: 0;
    width: 100%;
    height: 100%;
    padding: 20px;
    box-sizing: border-box;
    left: 0; /* Добавляем явное указание позиции */
    top: 0; /* Добавляем явное указание позиции */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Стили для активного экрана */
.screen.active {
    visibility: visible;
    opacity: 1;
    display: flex;
    flex-direction: column;
    justify-content: center; /* Центрирование по вертикали */
    align-items: center; /* Центрирование по горизонтали */
    padding-top: 0; /* Убираем верхний отступ */
}












/* ================= ШТОРКИ ШТОРКИ ШТОРКИ ================= */
/* ================= ШТОРКИ ШТОРКИ ШТОРКИ ================= */
/* ================= ШТОРКИ ШТОРКИ ШТОРКИ ================= */
/* ================= ШТОРКИ ШТОРКИ ШТОРКИ ================= */



.curtain-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999; /* Максимальный z-index */
}

.curtain {
    position: absolute;
    top: 0;
    height: 100%;
    width: 50%;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    transition: none;
    z-index: 3001; /* Должен быть выше container */
}

.curtain-left {
    left: 0;
    background-image: url('./assets/curtain.png');
    background-position: right;
    transform: translateX(-100%);
}

.curtain-right {
    right: 0;
    background-image: url('./assets/curtain.png');
    background-position: left;
    transform: translateX(100%);
}

.curtain-border {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('./assets/border.png') no-repeat center center;
    background-size: 100% 100%;
    pointer-events: none;
    z-index: 3002; /* Должен быть самым верхним */
}

.curtains-closing .curtain-left {
    transform: translateX(0);
}

.curtains-closing .curtain-right {
    transform: translateX(0);
}

@keyframes curtain-close-left {
    0% {
        transform: translateX(-540px);
        opacity: 0;
    }
    40% {
        transform: translateX(0);
        opacity: 1;
    }
    60% {
        transform: translateX(-50px);
    }
    80% {
        transform: translateX(10px);
    }
    100% {
        transform: translateX(0);
    }
}

@keyframes curtain-close-right {
    0% {
        transform: translateX(540px);
        opacity: 0;
    }
    40% {
        transform: translateX(0);
        opacity: 1;
    }
    60% {
        transform: translateX(50px);
    }
    80% {
        transform: translateX(-10px);
    }
    100% {
        transform: translateX(0);
    }
}

/* Анимация открытия */
@keyframes curtain-open-left {
    0% {
        transform: translateX(0);
    }
    80% {
        transform: translateX(-98%);
    }
    100% {
        transform: translateX(-100%);
    }
}

@keyframes curtain-open-right {
    0% {
        transform: translateX(0);
    }
    80% {
        transform: translateX(98%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Применяем стили анимации */
.curtains-closing .curtain-left {
    animation: curtain-close-left 0.6s ease-out both;
    will-change: transform;
}

.curtains-closing .curtain-right {
    animation: curtain-close-right 0.6s ease-out both;
    will-change: transform;
}

.curtains-opening .curtain-left {
    animation: curtain-open-left 0.6s cubic-bezier(0.85, 0, 0.15, 1) forwards;
    will-change: transform;
}

.curtains-opening .curtain-right {
    animation: curtain-open-right 0.6s cubic-bezier(0.85, 0, 0.15, 1) forwards;
    will-change: transform;
}






/* ================= СТАРТОВЫЙ ЭКРАН ================= */
/* ================= СТАРТОВЫЙ ЭКРАН ================= */
/* ================= СТАРТОВЫЙ ЭКРАН ================= */
/* ================= СТАРТОВЫЙ ЭКРАН ================= */



#start-menu {
    background-image: url('./assets/back_mainmenu.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    width: 100%;
    height: 100%;
}


/* НАЗВАНИЕ ИГРЫ */
#game-title {
    position: absolute;
    z-index: 2;
    top: 45px; /* Расположение в 45px от верхнего края */
    left: 50%;
    transform: translateX(-50%);
    width: 1000px; /* Размеры заданные в требованиях */
    height: 494px;
    animation: slide-in-blurred-top 0.6s cubic-bezier(0.230, 1.000, 0.320, 1.000) both;
    animation-delay: 0.5s; /* Задержка чтобы анимация началась после открытия шторок */
    opacity: 0; /* Изначально скрыто */
    pointer-events: none; /* Отключает взаимодействие с этим элементом */
}

/* Анимация появления названия сверху */
@keyframes slide-in-blurred-top {
    0% {
        transform: translate(-50%, -1000px) scaleY(2.5) scaleX(0.2);
        transform-origin: 50% 0%;
        filter: blur(40px);
        opacity: 0;
    }

    100% {
        transform: translate(-50%, 0) scaleY(1) scaleX(1);
        transform-origin: 50% 50%;
        filter: blur(0);
        opacity: 1;
    }
}


#master-hair {
    position: absolute;
    left: 375px;
    top: 436px;
    z-index: 3; /* Убедимся, что изображение находится над всеми другими элементами */
    pointer-events: none; /* Изображение не перехватывает клики мыши */
}


/* Стили для анимации глаз персонажа */
#master-eyes {
    position: absolute;
    left: 430px; /* Заданная координата X */
    top: 742px; /* Заданная координата Y */
    width: 220px; /* Ширина одного кадра */
    height: 90px; /* Высота одного кадра */
    background-image: url('./assets/ani_eyes.png');
    background-repeat: no-repeat;
    background-position: 0 0; /* Начальный кадр (закрытые глаза) */
    opacity: 0; /* Изначально невидимы */
    z-index: 4; /* Выше чем волосы персонажа */
    pointer-events: none; /* Не перехватывает клики */
}

/* Анимация моргания глаз персонажа */
@keyframes blink-animation {
    0%, 100% { background-position: 0 0; } /* Первый кадр */
    20% { background-position: 0 -90px; } /* Второй кадр */
    40% { background-position: 0 -180px; } /* Третий кадр */
    60% { background-position: 0 -270px; } /* Четвертый кадр */
    80% { background-position: 0 -360px; } /* Пятый кадр */
}

/* Класс для анимации моргания */
.blink {
    opacity: 1 !important;
    animation: blink-animation 0.5s steps(1) forwards;
}









/* КНОПКИ КНОПКИ КНОПКИ на стартовом экране */
.start-button {
    position: absolute;
    width: 350px;
    height: 160px;
    background: url('./assets/button.png') no-repeat center center;
    background-size: contain;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Nunito-Black', Arial, sans-serif;
    font-size: 54px;
    color: #020202;
    text-shadow: 0 3px 0 rgba(194, 97, 0, 0.5); 
    cursor: pointer;
    transition: background-image 0.2s ease;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Эффект при наведении для кнопок */
.start-button:hover {
    background-image: url('./assets/button_hover.png');
    text-shadow: 0 3px 0 rgba(255, 236, 209, 0.5); 
}

/* Позиционирование кнопок в первом ряду */
#easy-button {
    top: 1150px;
    left: 168px;
}

#medium-button {
    top: 1150px;
    right: 168px;
}

/* Позиционирование кнопок во втором ряду */
#hard-button {
    top: 1350px;
    left: 168px;
}

#master-button {
    top: 1350px;
    right: 168px;
    background-image: url('./assets/button_red.png');
}
#master-button:hover {
    background-image: url('./assets/button_hover.png');
}

/* Позиционирование кнопок в третьем ряду */
#help-button {
    top: 1550px;
    left: 168px;
    background-image: url('./assets/button_help.png');
    
}

#help-button:hover {
    background-image: url('./assets/button_help_hover.png');
}

#properties-button {
    top: 1550px;
    right: 168px;
    background-image: url('./assets/button_properties.png');
    
}

#properties-button:hover {
    background-image: url('./assets/button_properties_hover.png');
}


.start-button:active {
    transform: scale(0.95) translateY(3px); /* Немного уменьшаем и смещаем вниз */
    transition: transform 0.1s, filter 0.1s, box-shadow 0.1s; /* Быстрая анимация для эффекта */
}


/* Стили для кнопки Created By внизу экрана */
.created-by {
    position: absolute;
    bottom: 40px;
    right: 40px;
    /* transform: translateX(-50%);  */
    font-family: 'Nunito-Black', Arial, sans-serif; /* Меняем на Nunito-Black */
    font-size: 40px; /* Увеличиваем размер шрифта до 40px */
    text-align: center;
    cursor: pointer;
    white-space: nowrap; /* Предотвращает перенос текста */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Стили для обычного текста (Created by и & NF) */
.created-by .normal-text {
    color: #8f5714;
    transition: color 0.2s ease;
}

/* Стили для акцентированного текста (in8finity) */
.created-by .accent-text {
    color: #e37221;
    transition: color 0.2s ease;
}

/* Эффекты наведения */
.created-by:hover .normal-text {
    color: #e37221;
}

.created-by:hover .accent-text {
    color: #f2c235;
}

/* Эффект при нажатии для элемента Created By */
.created-by:active {
    transform: scale(0.95) translateY(3px); /* Уменьшаем и смещаем вниз */
    transition: transform 0.1s, filter 0.1s, box-shadow 0.1s; /* Быстрая анимация для эффекта */
}

/* Эффект при нажатии для текстовых элементов внутри */
.created-by:active .normal-text,
.created-by:active .accent-text {
    /* Убираем предыдущие стили, которые могут конфликтовать */
    transform: none;
    opacity: 1;
}












/* =================  ЭКРАН ВЫБОРА УРОВНЯ  ================= */
/* =================  ЭКРАН ВЫБОРА УРОВНЯ  ================= */
/* =================  ЭКРАН ВЫБОРА УРОВНЯ  ================= */
/* =================  ЭКРАН ВЫБОРА УРОВНЯ  ================= */


#difficulty-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background-image: url('./assets/back_selectlevel.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    width: 100%;
    height: 100%;
}

/* Стили для кнопки Back на экране выбора уровня */
#difficulty-menu .back-button {
    position: absolute;
    top: 48px;
    left: 65px;
    width: 155px;
    height: 160px;
    background: url('./assets/button_back.png') no-repeat center center;
    background-size: contain;
    border: none;
    z-index: 10;
    cursor: pointer;
    transition: background-image 0.2s ease;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Эффект при наведении для кнопки Back */
#difficulty-menu .back-button:hover {
    background-image: url('./assets/button_back_hover.png');
}

/* Эффект при нажатии для кнопки Back - такой же как у start-button */
#difficulty-menu .back-button:active {
    transform: scale(0.95) translateY(3px);
    transition: transform 0.1s, filter 0.1s, box-shadow 0.1s;
}



/* Обновленные стили для контейнера кнопок выбора уровней */
#level-buttons-container {
    width: 90%;
    height: 70%;
    position: relative;
    margin-top: 50px; /* Добавляем отступ сверху */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Добавляем обрезку содержимого */
    max-width: 980px; /* Ограничиваем ширину на 200px меньше (1080px - 200px) */
    margin-left: auto;
    margin-right: auto;
}

/* Обновленный стиль для кнопок выбора уровня */
.level-button {
    width: 180px;
    height: 185px;
    position: relative;
    background: url('./assets/button_selectlevel.png') no-repeat center center;
    background-size: contain;
    border: none;
    cursor: pointer;
    font-family: 'Nunito-Black', Arial, sans-serif;
    font-size: 66px; /* Увеличенный размер шрифта */
    color: #EB7900; /* Обновленный цвет */
    text-shadow: 0 4px 0 rgba(0, 0, 0);
    transition: transform 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 56px; /* Добавляем отступ снизу для времени */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Эффект при наведении для кнопок выбора уровня */
.level-button:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('./assets/button_selectlevel_hover.png') no-repeat center center;
    background-size: contain;
    z-index: 1;
    pointer-events: none;
}

/* Стиль для текущей кнопки уровня - скроем номер */
.level-button.current {
    background-image: url('./assets/button_selectlevel_current.png');
    color: transparent; /* Скрываем номер */
    text-shadow: none;
}

/* Стиль для заблокированной кнопки уровня - оставляем курсор pointer и добавляем эффект нажатия */
.level-button.locked {
    background-image: url('./assets/button_selectlevel_lock.png');
    color: transparent; /* Скрываем номер */
    text-shadow: none;
    cursor: pointer; /* Меняем с not-allowed на pointer */
}



/* Добавляем эффект нажатия для заблокированных кнопок */
.level-button.locked:active {
    transform: scale(0.95) translateY(3px); /* Добавляем такой же эффект, как у остальных кнопок */
    transition: transform 0.1s, filter 0.1s;
}



/* Эффект при нажатии на кнопку уровня */
.level-button:active {
    transform: scale(0.95) translateY(3px);
    transition: transform 0.1s, filter 0.1s;
}




/* Стиль для отображения рекордного времени под кнопкой уровня */
.level-time {
    position: absolute;
    bottom: -16px; /* Позиционируем под кнопкой */
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Nunito-Black', Arial, sans-serif;
    font-size: 48px;
    text-align: center;
    width: 100%;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Время для уровней, в которые еще не играли */
.level-time.not-played {
    color: #403228;
}

/* Время для уровней, которые пройдены хуже среднего */
.level-time.slower {
    color: #0F5896;
}

/* Время для уровней, которые пройдены лучше среднего */
.level-time.faster {
    color: #6CBAFF;
}












/* Контейнер для кнопок навигации по страницам с абсолютным позиционированием */
#pagination-container {
    position: absolute; /* Используем абсолютное позиционирование */
    bottom: 44px; /* Фиксируем положение от нижнего края экрана */
    left: 50%; /* Центрируем горизонтально */
    transform: translateX(-50%); /* Корректируем центрирование */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px; /* Увеличиваем основной промежуток между элементами */ 
    /* border: 2px solid rgba(255, 255, 255, 0.5); */
    padding: 15px 25px; /* Добавляем отступы внутри контейнера */
    /* Удаляем margin-top, так как теперь используем bottom */
}

/* Группа индикаторов страниц */
.page-indicators-group {
    display: flex;
    gap: 15px; /* Стандартный промежуток между индикаторами страниц */
}

/* Стиль для кнопок со стрелками */
.arrow-button {
    width: 126px;
    height: 130px;
    border: none;
    cursor: pointer;
    background-color: transparent;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: background-image 0.2s ease;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Кнопка "Предыдущая страница" */
#prev-page-button {
    background-image: url('./assets/button_arrow_left.png');
}

#prev-page-button:hover {
    background-image: url('./assets/button_arrow_left_hover.png');
}

/* Кнопка "Следующая страница" */
#next-page-button {
    background-image: url('./assets/button_arrow_right.png');
}

#next-page-button:hover {
    background-image: url('./assets/button_arrow_right_hover.png');
}

/* Стиль для кнопок отображения страниц */
.page-indicator {
    width: 60px;
    height: 64px;
    border: none;
    cursor: pointer;
    background-color: transparent;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-image: url('./assets/button_page0.png');
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Активная страница */
.page-indicator.active {
    background-image: url('./assets/button_page1.png');
    cursor: default;
}

/* Эффект нажатия для кнопок навигации */
.arrow-button:active,
.page-indicator:active:not(.active) {
    transform: scale(0.9);
    transition: transform 0.1s;
}

/* Стили для заголовка экрана выбора уровня */
#difficulty-title {
    position: absolute;
    top: 66px;
    left: 330px; /* Позиционируем справа, аналогично как кнопка Back слева */
    font-family: 'Nunito-Black', Arial, sans-serif;
    font-size: 46px; /* Размер шрифта как указано */
    color: #BA6300; /* Цвет как указано */
    text-align: left; /* Центрирование по левому краю */
    margin: 0; /* Убираем стандартные отступы */
    line-height: 1.2; /* Добавляем для лучшего отображения текста в две строки */
    max-width: 600px; /* Ограничиваем ширину для контроля переноса */
}

#avg-completion-time {
    position: absolute;
    top: 90px; /* Заданная координата Y */
    left: 790px; /* Заданная координата X */
    font-family: 'Nunito-Black', Arial, sans-serif;
    font-size: 72px; /* Размер шрифта как указано */
    color: #6CBAFF;
    text-align: left;
    margin: 0;
    line-height: 1;
    z-index: 3; /* Убедимся, что текст отображается над другими элементами */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); /* Добавляем легкую тень для лучшей читаемости */
}




/* Контейнер-обертка для анимации страниц */
.level-pages-wrapper {
    position: relative;
    width: 100%;
    height: 88%;
    margin-top: -20px;
    overflow: hidden;
    
}

/* Стили для страницы с кнопками уровней */
.level-page {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(4, 1fr);
    column-gap: 0px;
    row-gap: 0px;
    width: 100%;
    height: 100%;
    position: absolute; /* Меняем с relative на absolute */
    top: 0;           /* Фиксируем положение вверху */
    left: 0;
    right: 0;
    justify-items: center;
    align-items: center;
    opacity: 1;
    transform: translateX(0);
    transition: transform 0.5s ease, opacity 0.5s ease;
    /* Увеличиваем ширину страницы для эффекта */
    

}

/* Активная (текущая) страница */
.level-page.active {
    opacity: 1;
    transform: translateX(0);
    z-index: 1;
}

/* Анимация для страницы, которая уходит влево */
.level-page.slide-left {
    opacity: 0;
    transform: translateX(-120%); /* Увеличиваем смещение, чтобы страница ушла дальше */
    transform: translate3d(-100%, 0, 0) !important;
    -webkit-transform: translate3d(-100%, 0, 0) !important;
}

/* Анимация для страницы, которая уходит вправо */
.level-page.slide-right {
    opacity: 0;
    transform: translateX(120%); /* Увеличиваем смещение, чтобы страница ушла дальше */
    transform: translate3d(100%, 0, 0) !important;
    -webkit-transform: translate3d(100%, 0, 0) !important;
}

/* Вспомогательные классы для временных состояний во время анимации */
.level-page.incoming-right {
    position: absolute;
    top: 0;
    left: 0;
    transform: translateX(120%); /* Увеличиваем начальное положение */
    opacity: 0;
    transform: translate3d(100%, 0, 0);
    -webkit-transform: translate3d(100%, 0, 0);
}

.level-page.incoming-left {
    position: absolute;
    top: 0;
    left: 0;
    transform: translateX(-120%); /* Увеличиваем начальное положение */
    opacity: 0;
    transform: translate3d(-100%, 0, 0);
    -webkit-transform: translate3d(-100%, 0, 0);
}

/* Стили для контейнера кнопки на странице */
.button-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
}












/* ================= ЭКРАН ИГРЫ ================= */
/* ================= ЭКРАН ИГРЫ ================= */
/* ================= ЭКРАН ИГРЫ ================= */
/* ================= ЭКРАН ИГРЫ ================= */

/* Обновляем стили для экрана игры, добавляя фоновое изображение */
#game {
    background-image: url('./assets/back_game.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    width: 100%;
    height: 100%;
}

/* Стили для кнопки Back в верхнем левом углу */
#game .back-button {
    position: absolute;
    top: 48px;
    left: 45px;
    width: 155px;
    height: 160px;
    background: url('./assets/button_back.png') no-repeat center center;
    background-size: contain;
    border: none;
    z-index: 10;
    cursor: pointer;
    transition: background-image 0.2s ease;
    /* Удаляем ненужные стили */
    padding: 0;
    font-size: auto;
    background-color: transparent;
    color: transparent;
    border-radius: 0;
    margin: 0;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Эффект при наведении для кнопки Back на экране игры */
#game .back-button:hover {
    background-image: url('./assets/button_back_hover.png');
}

/* Эффект при нажатии для кнопки Back на экране игры */
#game .back-button:active {
    transform: scale(0.95) translateY(3px);
    transition: transform 0.1s, filter 0.1s, box-shadow 0.1s;
}



/* Стили для кнопки Properties на экране игры */
#game .properties-button {
    position: absolute;
    top: 48px;
    left: 220px;
    width: 155px;
    height: 160px;
    background: url('./assets/button_properties2.png') no-repeat center center;
    background-size: contain;
    border: none;
    z-index: 10;
    cursor: pointer;
    transition: background-image 0.2s ease;
    padding: 0;
    font-size: auto;
    background-color: transparent;
    color: transparent;
    border-radius: 0;
    margin: 0;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Эффект при наведении для кнопки Properties на экране игры */
#game .properties-button:hover {
    background-image: url('./assets/button_properties2_hover.png');
}

/* Эффект при нажатии для кнопки Properties на экране игры */
#game .properties-button:active {
    transform: scale(0.95) translateY(3px);
    transition: transform 0.1s, filter 0.1s, box-shadow 0.1s;
}






/* Стили для кнопки Pause на экране игры */
#game .pause-button {
    position: absolute;
    top: 48px;
    right: 45px;
    width: 155px;
    height: 160px;
    background: url('./assets/button_pause.png') no-repeat center center;
    background-size: contain;
    border: none;
    z-index: 10;
    cursor: pointer;
    transition: background-image 0.2s ease;
    padding: 0;
    background-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Эффект при наведении для кнопки Pause */
#game .pause-button:hover {
    background-image: url('./assets/button_pause_hover.png');
}

/* Эффект при нажатии для кнопки Pause */
#game .pause-button:active {
    transform: scale(0.95) translateY(3px);
    transition: transform 0.1s, filter 0.1s, box-shadow 0.1s;
}

























/* Контейнер для игрового поля и панели ввода */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px; /* Уменьшаем общий gap, так как у нас теперь будет 3 элемента вместо 2 */
    top: -150px;
    position: relative;
    padding: 10px;
    width: 100%;
    box-sizing: border-box;
    /* border: 2px solid yellow;  */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Обновляем стили для контейнера судоку-поля, поднимая его на 100 пикселей выше */
#sudoku-board {
    order: 1; /* Судоку сверху */
    display: grid;
    grid-template-columns: repeat(9, 110px);
    grid-template-rows: repeat(9, 110px);
    gap: 3px;
    background-color: #927654;
    padding: 7px;
    border-radius: 10px;
}

/* Обновляем стили для control-panel, чтобы он не сместился при перемещении судоку-поля */
#control-panel {
    /* Удаляем order: 2; поскольку панель больше не в flex-контейнере */
    position: absolute; /* Используем абсолютное позиционирование */
    bottom: 360px; /* Позиционируем относительно нижней части экрана */
    left: 50%;
    transform: translateX(-50%); /* Центрируем по горизонтали */
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    width: auto; /* Автоматическая ширина по содержимому */
    z-index: 10; /* Убедимся, что панель будет над другими элементами */
    /* border: 2px солидный синий;  */
}



/* Обновленные стили для кнопок управления с использованием изображений */
.control-button {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 240px;
    height: 160px;
    cursor: pointer;
    transition: transform 0.2s, background-image 0.2s ease;
    border: none;
    background-color: transparent;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Стили для каждой из кнопок и их hover-состояний */
#undo-button {
    background-image: url('./assets/button_undo.png');
}

#undo-button:hover {
    background-image: url('./assets/button_undo_hover.png');
}

#erase-button {
    background-image: url('./assets/button_erase.png');
}

#erase-button:hover {
    background-image: url('./assets/button_erase_hover.png');
}

#pencil-button {
    background-image: url('./assets/button_pencil.png');
}

#pencil-button:hover {
    background-image: url('./assets/button_pencil_hover.png');
}

/* Стиль для активной кнопки карандаша - используем специальное изображение */
#pencil-button.active {
    background-image: url('./assets/button_pencil_active.png');
    
}

/* Стиль для активной кнопки карандаша при наведении */
#pencil-button.active:hover {
    background-image: url('./assets/button_pencil_hover.png');
    
}



#hint-button {
    background-image: url('./assets/button_hint.png');
}

#hint-button:hover {
    background-image: url('./assets/button_hint_hover.png');
}




/* Эффект при нажатии */
.control-button:active {
    transform: scale(0.95) translateY(3px);
    transition: transform 0.1s, filter 0.1s, box-shadow 0.1s;
}

/* Более специфичный селектор для эффекта active, чтобы он имел приоритет */
.control-button:active,
#undo-button:active,
#erase-button:active, 
#pencil-button:active,
#hint-button:active {
    transform: scale(0.95) translateY(3px) !important;
    transition: transform 0.1s, filter 0.1s, box-shadow 0.1s;
}

/* Стили для счетчика подсказок */
.hint-counter {
    position: absolute;
    top: 26px;
    right: 26px;
    
    color: #020202;
    font-family: 'Nunito-Black', Arial, sans-serif;
    font-size: 32px;
    font-weight: bold;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}




/* Стиль для кнопки Erase - можно добавить цветовую индикацию */
#erase-button {
    position: relative;
}

/* Стиль для режима карандаша на панели ввода */
#input-panel.pencil-mode .input-cell {
    font-size: 30px; /* Маленький размер цифр в режиме карандаша */
}



/* Стили для заметок карандашом */
.pencil-notes {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    width: 100%;
    height: 100%;
    font-size: 25px;
    /* color: #D1D3D4; */
    /* color: #F99600; */
    color: #927654;
    font-family: 'Nunito-Black', Arial, sans-serif; 
    /* font-weight: bold; */
}

/* Стиль для заметок карандашом в выделенной ячейке */
.sudoku-cell.selected .pencil-notes,
.sudoku-cell.selected .pencil-note-slot {
    color: #21201D !important; /* Темный цвет для заметок в выделенной ячейке */
    font-weight: bold; /* Делаем шрифт жирным для лучшей видимости */
}

/* Стиль для слотов с заметками в выделенной ячейке */
.sudoku-cell.selected .pencil-note-slot.has-note {
    opacity: 1;
    color: #21201D !important; /* Убеждаемся, что цвет применяется к слотам с заметками */
}


.pencil-note-slot {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: inherit;
    font-weight: normal;
    opacity: 0.8;
}

/* Скрываем пустые слоты */
.pencil-note-slot:empty {
    opacity: 0;
}

/* Подсвечиваем слоты с заметками */
.pencil-note-slot.has-note {
    opacity: 1;
}

/* Стили для кнопок управления и счетчика подсказок */
.control-button {
    position: relative;
}



/* Стиль для кнопки без подсказок */
.control-button.no-hints {
    opacity: 0.5;
}

/* Стиль для подсказанных ячеек - с повышенным приоритетом */
.sudoku-cell.hinted {
    color: #00d85a !important; /* Зеленый цвет с высшим приоритетом */
    font-weight: bold !important;
    text-shadow: 0 0 3px rgba(46, 204, 113, 0.5) !important;
}

/* Стиль для ошибочных ячеек - используем один цвет независимо от других классов */
.sudoku-cell.incorrect {
    color: #ff3333 !important; /* Используем константный оттенок красного */
    border-color: #ff3333;
}
















/* Обновленные стили для панели ввода цифр - используем абсолютное позиционирование */
#input-panel {
    position: absolute; /* Изменяем с относительного на абсолютное позиционирование */
    bottom: -400px; /* Позиционируем внизу экрана с отступом 50px снизу */
    left: 50%;
    transform: translateX(-50%); /* Центрируем по горизонтали */
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 8px;
    width: auto; /* Меняем width: 100% на auto */
    margin: 0; /* Убираем margin, так как используем bottom */
    box-sizing: border-box;
    z-index: 10; /* Убедимся, что панель находится над другими элементами */
}

/* Стили для ячеек ввода с фоновым изображением */
.input-cell {
    display: flex;
    justify-content: center;
    align-items: center;
    background: url('./assets/button_numbers.png') no-repeat center center;
    background-size: contain;
    font-size: 60px;
    font-weight: normal;
    font-family: 'Nunito-Regular', Arial, sans-serif;
    font-weight: bold; 
    color: #000000;
    cursor: pointer;
    width: 106px;
    height: 111px;
    flex: 0 0 106px;
    position: relative;
    text-shadow: 0 3px 0 rgba(255, 236, 209, 0.2);
    border: none;
    background-color: transparent;
    transition: transform 0.2s, background-image 0.2s ease;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Стили для ячеек ввода при наведении */
.input-cell:hover {
    background-image: url('./assets/button_numbers_hover.png');
    text-shadow: 0 3px 0 rgba(255, 236, 209, 0.5); /* Увеличиваем прозрачность тени при наведении */
    
}

/* Стили для цифр на панели ввода, которые уже полностью использованы */
.input-cell.fully-used {
    opacity: 0.3;
    cursor: default;
}

.input-cell.fully-used:hover {
    background-image: url('./assets/button_numbers.png'); /* Используем обычное изображение */
    text-shadow: 0 3px 0 rgba(255, 236, 209, 0.2); /* Возвращаем исходную тень */
    
}

/* Эффект при нажатии для ячеек ввода цифр */
.input-cell:active {
    transform: scale(0.95) translateY(3px);
    transition: transform 0.1s, filter 0.1s, box-shadow 0.1s;
}

/* Эффект при нажатии для полностью использованных цифр (отключаем эффект) */
.input-cell.fully-used:active {
    transform: none;
}

/* Стили для ячеек судоку */
.sudoku-cell {
    display: flex;
    justify-content: center;
    align-items: center;
    /* background-color: rgb(43, 70, 63);  */
    font-size: 60px;
    font-weight: normal;
    font-family: 'Nunito-Regular', Arial, sans-serif; /* Применяем новый шрифт */
    border-radius: 5px;
    cursor: default;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.sudoku-cell.editable {
    cursor: pointer;
    /* background-color: #f9f9f9; */
    background-color: #21201D; 
    color: #D1D3D4;
}

/* Обновляем стиль для выделенной ячейки с бордюром */
.sudoku-cell.selected {
    background-color: #F99600 !important; /* Оранжевый фон */
    color: #21201D !important; /* Темный цвет текста */
    box-shadow: inset 0 0 0 5px #21201D !important; /* Внутренний бордюр вместо обычного */
    z-index: 2; /* Поднимаем выделенную ячейку над другими */
}

.sudoku-cell.prefilled {
    /* background-color: #f0f0f0; */
    background-color: #21201D; 
    color: #927654;
}

/* Добавляем стили для подсветки ячеек */
.sudoku-cell.highlight-row {
    background-color: #403C31;  /* Слегка подсвечиваем ячейки в том же ряду */
    box-shadow: inset 0 0 0 5px #21201D !important; /* Внутренний бордюр вместо обычного */
}

.sudoku-cell.highlight-col {
    background-color: #403C31; /* Слегка подсвечиваем ячейки в том же столбце */
    box-shadow: inset 0 0 0 5px #21201D !important; /* Внутренний бордюр вместо обычного */
}

.sudoku-cell.highlight-block {
    background-color: #403C31; /* Слегка подсвечиваем ячейки в том же блоке 3x3 */
    box-shadow: inset 0 0 0 5px #21201D !important; /* Внутренний бордюр вместо обычного */
}

.sudoku-cell.highlight-same-number {
    background-color: #502610; /* Подсвечиваем ячейки с тем же числом */
    box-shadow: inset 0 0 0 5px #21201D !important; /* Внутренний бордюр вместо обычного */
    color: #E37221 !important; /* Темный цвет текста */
}

/* Специальные отступы между блоками 3x3 */
.col-3-gap, .col-6-gap {
    margin-right: 5px;
}

.row-3-gap, .row-6-gap {
    margin-bottom: 5px;
}



/* Анимация встряски для неправильных значений */
.sudoku-cell.shake {
    animation: shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes shake {
    10%, 90% { transform: translate3d(-1px, 0, 0); }
    20%, 80% { transform: translate3d(2px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-2px, 0, 0); }
    40%, 60% { transform: translate3d(1px, 0, 0); }
}





/* Стили для таймера */
.timer-container {
    position: absolute;
    top: 60px;
    left: 470px; 
    font-family: 'Nunito-Black', Arial, sans-serif;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-size: 48px;
    display: flex; /* Добавляем flex-отображение */
    align-items: center; /* Центрируем элементы по вертикали */
}

.timer-label {
    color: #806B64;
    margin-right: 25px;
}

.timer {
    color: #6CBAFF;
}

/* Стили для счетчика ошибок */
.mistake-counter {
    position: absolute;
    top: 125px;
    left: 470px; 
    font-family: 'Nunito-Black', Arial, sans-serif;
    font-size: 48px;
    text-shadow: 0 3px 3px rgba(0, 0, 0, 0.5);
    z-index: 10;
    display: flex; /* Добавляем flex-отображение */
    align-items: center; /* Центрируем элементы по вертикали */
}

.mistake-label {
    color: #806B64;
    margin-right: 25px;
}

.mistake-count {
    color: #A1220C;
}












/* ================= ПАНЕЛЬ ПОБЕДЫ ================= */
/* ================= ПАНЕЛЬ ПОБЕДЫ ================= */
/* ================= ПАНЕЛЬ ПОБЕДЫ ================= */

/* Затемнение экрана */
.victory-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000; /* Оверлей должен быть под панелью */
    pointer-events: none;
}

.victory-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Обновленные стили для панели победы */
.victory-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 808px;
    height: 852px;
    background-image: url('./assets/panel.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    padding: 40px 30px;
    text-align: center;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Меняем с center на flex-start */
    align-items: center;
    padding-top: 60px; /* Добавляем отступ сверху */
}

.victory-panel.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.victory-title {
    font-size: 72px;
    color: #F99600; 
    margin-bottom: 20px; /* Добавляем отступ после заголовка */
}

.victory-message {
    font-size: 50px;
    color: #8A8167;
    /* margin-bottom: 40px; */
}

/* Стили для записи времени (специфично для Victory) */
.record-time {
    color: #6CBAFF; 
    font-weight: bold;
    font-size: 60px;
    margin-top: 20px;
    display: inline-block; /* Делаем блочным элементом */
    margin: 10px 0; /* Добавляем отступы сверху и снизу */
}

/* Стиль для текста "New record!" */
.new-record {
    color: #A1220C; /* Ярко-красный цвет как для счетчика ошибок */
    font-weight: bold;
    font-size: 55px;
    margin-top: 10px;
    font-family: 'Nunito-Black', Arial, sans-serif;
    text-shadow: 0 3px 3px rgba(0, 0, 0, 0.5);
    display: block; /* Делаем блочным элементом */
    margin-top: 15px;
    margin-bottom: 15px;
   
}





/* Стили для кнопок на панели Victory */
.victory-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px; /* Больше отступ между кнопками */
    margin-top: 140px;
    position: absolute;
    bottom: 130px; /* Фиксируем расстояние от низа панели */
    left: 0;
    right: 0;
}

/* Общие стили для кнопок на панели Victory */
.victory-button {
    width: 155px;
    height: 160px;
    border: none;
    cursor: pointer;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: background-image 0.2s ease, transform 0.1s;
    color: transparent; /* Скрываем текст */
    font-size: 0; /* Убираем текст */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Стили для кнопки Levels (как кнопка Back) */
#btn-levels {
    background-image: url('assets/button_back.png');
}

#btn-levels:hover {
    background-image: url('assets/button_back_hover.png');
}

/* Стили для кнопки Next Level */
#btn-next {
    width: 350px; /* Указанный размер */
    background-image: url('assets/button_nextlevel.png');
}

#btn-next:hover {
    background-image: url('assets/button_nextlevel_hover.png');
}

/* Эффект при нажатии для всех кнопок */
.victory-button:active {
    transform: scale(0.95) translateY(3px);
}

/* ================= GAME OVER ПАНЕЛЬ ================= */
/* ================= GAME OVER ПАНЕЛЬ ================= */
/* ================= GAME OVER ПАНЕЛЬ ================= */

/* Стили для Game Over панели */
.gameover-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1000; /* Оверлей должен быть под панелью */
    pointer-events: none;
}

.gameover-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.gameover-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 808px;
    height: 852px; /* Добавляем явную высоту, соответствующую изображению */
    background-image: url('./assets/panel.png');
    background-size: 100% 100%; /* Меняем на 100% 100% вместо contain */
    background-position: center;
    background-repeat: no-repeat;
    padding: 40px 30px;
    text-align: center;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    display: flex; /* Добавляем flex для лучшего расположения содержимого */
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.gameover-panel.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

.gameover-title {
    font-size: 72px;
    color: #F99600; /* Красный цвет для Game Over */
    /* margin-bottom: 30px; */
}

.gameover-message {
    font-size: 50px;
    color: #8A8167;
    /* margin-bottom: 40px; */
}



/* Стили для кнопок на панели Game Over */
.gameover-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px; /* Больше отступ между кнопками */
    margin-top: 160px;
}

/* Общие стили для кнопок на панели Game Over */
.gameover-button {
    width: 155px;
    height: 160px;
    border: none;
    cursor: pointer;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: background-image 0.2s ease, transform 0.1s;
    color: transparent; /* Скрываем текст */
    font-size: 0; /* Убираем текст */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Стили для кнопки Levels (как кнопка Back) */
#btn-levels-gameover {
    background-image: url('assets/button_back.png');
}

#btn-levels-gameover:hover {
    background-image: url('assets/button_back_hover.png');
}

/* Стили для кнопки Try Again */
#btn-retry {
    width: 350px; /* Указанный размер */
    background-image: url('assets/button_replay.png');
}

#btn-retry:hover {
    background-image: url('assets/button_replay_hover.png');
}

/* Эффект при нажатии для всех кнопок */
.gameover-button:active {
    transform: scale(0.95) translateY(3px);
}

/* Fix для мобильных устройств - отключаем hover-эффект */
@media (hover: none) {
    #btn-retry:hover {
        background-image: url('assets/button_replay.png');
    }
    
    /* Только при активном нажатии показываем hover-состояние
    #btn-retry:active {
        background-image: url('assets/button_replay_hover.png') !important;
    } */
}





/* ================================== CREATED BY ================================== */
/* ================================== CREATED BY ================================== */
/* ================================== CREATED BY ================================== */
/* ================================== CREATED BY ================================== */

/* Стили для экрана "Created By" */
#createdby {
    background-image: url('./assets/back_createdby.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Стили для кнопки Back на экране Created By (такие же, как на экране выбора уровня) */
#createdby .back-button {
    position: absolute;
    top: 48px;
    left: 65px;
    width: 155px;
    height: 160px;
    background: url('./assets/button_back.png') no-repeat center center;
    background-size: contain;
    border: none;
    z-index: 10;
    cursor: pointer;
    transition: background-image 0.2s ease;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}


/* Стиль для загадочной надписи - теперь сверху */
.creator-quote {
    position: absolute;
    top: 13%; /* Располагаем выше email */
    left: 37%;
    transform: translateX(-28%);
    font-family: 'Nunito-Black', Arial, sans-serif !important; /* Изменено на Black */
    font-size: 44px;
    font-weight: bold; /* Делаем текст жирным */
    color: #fff8e2;
    text-align: center;
    max-width: 80%;
    text-shadow: 0 3px 3px rgb(0, 0, 0);
    line-height: 1.4;
    margin: 0;
}

/* Стиль для email - теперь ниже цитаты */
.creator-email {
    position: absolute;
    top: 23%; /* Располагаем ниже цитаты */
    left: 51%;
    transform: translateX(-50%);
    font-family: 'Nunito-Black', Arial, sans-serif !important; /* Добавим !important */
    font-size: 46px;
    color: #e32121;
    text-align: center;
    text-shadow: 0 3px 3px rgb(0, 0, 0);
    margin: 0;
    -webkit-text-fill-color: #e32121; /* Для iOS */
    -webkit-text-size-adjust: none; /* Предотвращает масштабирование текста */
    pointer-events: none; /* Отключает взаимодействие */
}























/* ================================== PROPERTIES ================================== */
/* ================================== PROPERTIES ================================== */
/* ================================== PROPERTIES ================================== */
/* ================================== PROPERTIES ================================== */

/* Стили для экрана "Properties" */
#properties {
    background-image: url('./assets/back_properties.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    width: 100%;
    height: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Стили для кнопки Back на экране Properties (такие же, как на экране Created By) */
#properties .back-button {
    position: absolute;
    top: 48px;
    left: 65px;
    width: 155px;
    height: 160px;
    background: url('./assets/button_back.png') no-repeat center center;
    background-size: contain;
    border: none;
    z-index: 10;
    cursor: pointer;
    transition: background-image 0.2s ease;
}

/* Эффект при наведении для кнопки Back */
#properties .back-button:hover {
    background-image: url('./assets/button_back_hover.png');
}

/* Эффект при нажатии для кнопки Back */
#properties .back-button:active {
    transform: scale(0.95) translateY(3px);
    transition: transform 0.1s, filter 0.1s, box-shadow 0.1s;
}

/* Заголовок экрана Properties */
.properties-title {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: 'Nunito-Black', Arial, sans-serif;
    font-size: 72px;
    color: #FFFFFF;
    margin: 0;
    text-shadow: 0 3px 3px rgba(0, 0, 0, 0.5);
}

/* Описание под заголовком */
.properties-description {
    position: absolute;
    top: 300px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: 'Nunito-Black', Arial, sans-serif;
    font-size: 45px;
    color: #8A8167;
    line-height: 1.3;
    margin: 0;
}

/* Контейнер для свойств */
.properties-container {
    position: absolute;
    top: 500px;
    width: 90%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 50px;
}

/* Стили для отдельного элемента свойства */
.property-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

/* Стили для блока с информацией о свойстве */
.property-info {
    flex: 1;
    text-align: left;
    padding-right: 20px;
}

/* Стили для заголовка свойства */
.property-title {
    font-family: 'Nunito-Black', Arial, sans-serif;
    font-size: 45px;
    color: #E37221;
    margin: 0 0 5px 0;
}

/* Стили для описания свойства */
.property-description {
    /* font-family: 'Nunito-Regular', Arial, sans-serif; */
    font-family: 'Nunito-Black', Arial, sans-serif;
    font-size: 38px;
    color: #927654;
    margin: 0;
    line-height: 1.2;
}

/* Стили для переключателя */
.property-switch {
    width: 160px;
    height: 80px;
    flex-shrink: 0; /* Запрещаем сжиматься */
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

/* Стили для изображения переключателя */
.property-switch .switch-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s;
}

/* Эффект при нажатии на переключатель */
.property-switch:active .switch-img {
    transform: scale(0.95);
}





/* ================================== HELP ================================== */
/* ================================== HELP ================================== */
/* ================================== HELP ================================== */
/* ================================== HELP ================================== */


/* Стили для экрана "Help" */
#help {
    background-image: url('./assets/back_properties.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    width: 100%;
    height: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Стили для кнопки Back на экране Help (такие же, как на экране Properties) */
#help .back-button {
    position: absolute;
    top: 48px;
    left: 65px;
    width: 155px;
    height: 160px;
    background: url('./assets/button_back.png') no-repeat center center;
    background-size: contain;
    border: none;
    z-index: 10;
    cursor: pointer;
    transition: background-image 0.2s ease;
}

/* Эффект при наведении для кнопки Back */
#help .back-button:hover {
    background-image: url('./assets/button_back_hover.png');
}

/* Эффект при нажатии для кнопки Back */
#help .back-button:active {
    transform: scale(0.95) translateY(3px);
    transition: transform 0.1s, filter 0.1s, box-shadow 0.1s;
}

/* Заголовок экрана Help */
.help-title {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: 'Nunito-Black', Arial, sans-serif;
    font-size: 54px;
    color: #FFFFFF;
    margin: 0;
    text-shadow: 0 3px 3px rgba(0, 0, 0, 0.5);
}

/* Контейнер для содержимого Help */
.help-content {
    position: absolute;
    top: 300px;
    width: 85%;
    max-width: 850px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    padding: 0 20px;
}

/* Стили для основного описания */
.help-description {
    /* font-family: 'Nunito-Regular', Arial, sans-serif; */
    font-family: 'Nunito-Black', Arial, sans-serif;
    font-size: 46px;
    color: #8A8167;
    line-height: 1.4;
    margin: 20px 0 20px 30px;
    text-align: left;
}

/* Стили для подзаголовка "Basic Rules" */
.help-subtitle {
    font-family: 'Nunito-Black', Arial, sans-serif;
    font-size: 45px;
    color: #E37221;
    margin: 20px 0 10px 0;
    text-align: center;
}

/* Стили для списка правил */
.help-rules {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.help-rules li {
    /* font-family: 'Nunito-Regular', Arial, sans-serif; */
    font-family: 'Nunito-Black', Arial, sans-serif;
    font-size: 42px;
    color: #927654;
    margin-bottom: 15px;
    line-height: 1.4;
    position: relative;
    padding-left: 50px;
    text-align: left;
}

.help-rules li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #E37221;
}





/* ================================== PAUSE ================================== */
/* ================================== PAUSE ================================== */
/* ================================== PAUSE ================================== */
/* ================================== PAUSE ================================== */



/* Стили для панели паузы */
#pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}






#pause-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.pause-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 808px;
    height: 552px;
    background-image: url('assets/panel_pause.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 2001;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.pause-panel.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.pause-title {
    font-size: 72px;
    color: #F99600;
    margin-bottom: 40px;
}

/* Стили для кнопки закрытия */
.close-button {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 155px;
    height: 160px;
    background-image: url('assets/button_close.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-color: transparent;
    border: none;
    cursor: pointer;
    transition: background-image 0.2s ease;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.close-button:hover {
    background-image: url('assets/button_close_hover.png');
}

.close-button:active {
    transform: scale(0.95) translateY(3px);
}

/* Анимация для исчезновения панели */
.slide-out-bottom {
    animation: slide-out-bottom 0.3s cubic-bezier(0.550, 0.085, 0.680, 0.530) both;
}

@keyframes slide-out-bottom {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, 30%) scale(0.9);
        opacity: 0;
    }
}








/* Стили для выпадающего списка языков */
.language-selector {
    position: absolute;
    bottom: 40px;
    left: 40px;
    z-index: 100;
}

/* Стилизация кнопки выпадающего списка с фиксированной шириной и высотой */
.language-btn {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Распределяем содержимое по краям */
    width: 300px; /* Фиксированная ширина */
    height: 70px; /* Фиксированная высота */
    background-color: rgba(0, 0, 0, 0.5);
    border: 4px solid #9A7551;
    border-radius: 10px;
    color: #D2B999;
    font-family: var(--game-font);
    font-size: 35px;
    padding: 8px 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box; /* Учитываем padding в общей ширине */
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}

.language-btn:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.language-btn:after {
    content: '▼';
    font-size: 16px;
    margin-left: 5px;
}

/* Стили для выпадающего меню */
.language-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    background-color: rgba(0, 0, 0, 0.8);
    border: 4px solid #9A7551;
    border-radius: 10px;
    margin-bottom: -4px;
    width: 292px; /* Та же ширина, что и у кнопки */
    display: none;
    overflow: hidden;
}

/* Стили для пунктов меню - фиксированная ширина, высота и выравнивание */
.language-option {
    width: 100%;
    height: 70px; /* Фиксированная высота */
    color: #D2B999;
    font-family: var(--game-font);
    font-size: 35px;
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    align-items: center; /* Центрирование текста по вертикали */
    text-align: left;
    box-sizing: border-box;
}

.language-option:hover {
    background-color: rgba(154, 117, 81, 0.3);
}

/* Показываем меню при наведении/фокусе */
.language-selector:hover .language-dropdown,
.language-selector:focus-within .language-dropdown {
    display: block;
}

/* Улучшаем обработку касаний для всех кнопок */
.start-button, .back-button, .control-button, .input-cell, 
.level-button, .arrow-button, .page-indicator, 
.victory-button, .gameover-button, .property-switch, 
.close-button, .language-btn, .created-by {
    -webkit-tap-highlight-color: transparent; /* Убираем подсветку при касании на iOS */
    touch-action: manipulation; /* Улучшает обработку касаний */
}

/* Отключаем hover-эффекты на сенсорных устройствах */
@media (hover: none) {
  /* Кнопки на стартовом экране */
  .start-button:hover {
    background-image: url('./assets/button.png');
    text-shadow: 0 3px 0 rgba(194, 97, 0, 0.5);
  }
  
  /* Кнопка Master */
  #master-button:hover {
    background-image: url('./assets/button_red.png');
  }
  
  /* Кнопки помощи и настроек */
  #help-button:hover {
    background-image: url('./assets/button_help.png');
  }
  
  #properties-button:hover {
    background-image: url('./assets/button_properties.png');
  }
  
  /* Кнопки навигации */
  .back-button:hover {
    background-image: url('./assets/button_back.png');
  }
  
  /* Стрелки пагинации */
  #prev-page-button:hover {
    background-image: url('./assets/button_arrow_left.png');
  }
  
  #next-page-button:hover {
    background-image: url('./assets/button_arrow_right.png');
  }
  
  /* Кнопки управления в игре */
  #undo-button:hover { background-image: url('./assets/button_undo.png'); }
  #erase-button:hover { background-image: url('./assets/button_erase.png'); }
  #pencil-button:hover { background-image: url('./assets/button_pencil.png'); }
  #hint-button:hover { background-image: url('./assets/button_hint.png'); }
  
  /* Кнопки на экранах победы/поражения */
  #btn-levels:hover, #btn-levels-gameover:hover {
    background-image: url('assets/button_back.png');
  }
  
  #btn-next:hover {
    background-image: url('assets/button_nextlevel.png');
  }
  
  /* Кнопка закрытия */
  .close-button:hover {
    background-image: url('assets/button_close.png');
  }
  
  /* Входные ячейки */
  .input-cell:hover {
    background-image: url('./assets/button_numbers.png');
    text-shadow: 0 3px 0 rgba(255, 236, 209, 0.2);
  }

  /* Текст создателей */
  .created-by:hover .normal-text { color: #8f5714; }
  .created-by:hover .accent-text { color: #e37221; }
  
  
  
  
    /* Специальные правила для кнопки карандаша */
  #pencil-button:hover {
    background-image: url('./assets/button_pencil.png');
  }
  
  /* Важно! Когда кнопка активна, даже в hover она должна сохранять свой активный фон */
  #pencil-button.active:hover {
    background-image: url('./assets/button_pencil_active.png');
  }
  
  /* При нажатии на активную кнопку */
  #pencil-button.active:active {
    background-image: url('./assets/button_pencil_active.png') !important;
  }
  
      /* Более строгие правила для кнопки Back на экране выбора уровня */
    #difficulty-menu .back-button,
    #difficulty-menu .back-button:hover,
    #difficulty-menu .back-button:focus,
    #difficulty-menu .back-button:active:not(:active) {
        background-image: url('./assets/button_back.png') !important;
    }
    
    /* Только при активном нажатии показываем hover-состояние */
    #difficulty-menu .back-button:active {
        background-image: url('./assets/button_back_hover.png') !important;
    }
  
  
  
  
}














