body {
    background-color: #000000;
    position: relative;
    height: 100%; /* Высота на весь экран */
    margin: 0; /* Убираем отступы */
    max-width: 100%;
    overflow: hidden;   
    background-repeat: no-repeat;
    background-size: cover;
    background-attachment: fixed;
}

body.bg-dark {
    background-color: #000000;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

/* Заголовок и форма */
#nameSection {
    background-color:rgba(0, 0, 0, 0.5);
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(220, 20, 60, 0.3);
}

/* Названия полей */
.nameTitle {
    color: #ff2a6d;
    font-weight: bold;
    font-size: 18px;
}

.nameTitle {
    color:#ff2a6d;
}

.title-PP{
    color:#ff2a6d;
}

/* Поле ввода имени */
#name {
    width: 70%;               /* в два раза меньше */
    max-width: 400px;         /* ограничение на больших экранах */
    min-width: 300px;         /* чтобы не был слишком маленьким */
    margin: 0 auto;           /* центрирование по горизонтали */
    background-color: #1a1a1a;
    border: 1px solid #ff2a6d;
    color: #f2f2f2;
    padding: 6px 10px;
    font-size: 16px;          /* чуть меньше шрифт */
    text-align: center;
    border-radius: 5px;
    transition: 0.3s;
}


#name:focus {
    border-color: #ff4d80;
    box-shadow: 0 0 10px rgba(255, 42, 109, 0.4);
    outline: none;
}

/* Поле выбора цвета */
#color {
    background-color: #1a1a1a;
    border: 1px solid #ff2a6d;
    max-width: 400px;         /* ограничение на больших экранах */
    min-width: 300px;         /* чтобы не был слишком маленьким */
    border-radius: 5px;
    width: 40%;
    height: 45px;
    margin: 0 auto;           /* центрирование по горизонтали */
    padding: 2px;
    cursor: pointer;
    transition: border 0.3s ease;
}

#color:hover {
    border-color: #ff4d80;
}


#game-container {
    width: 1920px;
    height: 1080px;
    position: fixed;
    left: 50%;
    bottom: 0;
    transform-origin: bottom left;
    z-index: -1;
    background: none;
}


#historyOverlay {
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0, 0, 0, 0.8); 
    z-index: 1000;
}

#historyContainer {
    position: absolute; 
    top: 10%; 
    left: 50%; 
    transform: translateX(-50%); 
    width: 80%; 
    height: 80%; 
    overflow-y: auto; 
    background: black; 
    padding: 20px; 
    color: white; 
    border-radius: 10px;
}

.close {
    position: absolute; 
    top: 5%; 
    right: 5%;
}

.hidden {
    display: none;
}

.nameCheck {
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Стандартный синтаксис */
}

.container {
    max-width: 100vh;
    margin: 0 auto;
}

.py-5 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
}

.text-center {
    text-align: center;
}

.lead {
    font-size: 1.25rem;
}

.form-control { /* текстбокс для ввода ника*/
    display: block;
    width: 100%;
    padding: .375rem .75rem;
    font-size: 1rem;
    line-height: 1.25;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: .25rem;
}

.form-message { /* текстбокс для ввода сообщений */
    position: fixed;
    bottom: 0;
    left: 0;
    scrollbar-width: none;
    width: 100%;
    height: 50px; /* Настройте по необходимости */
    background-color: #2c2c2c; /* Темный фон */
    color: white; /* Белый текст */
    border: none; /* Без границ */
    padding: 10px; /* Внутренние отступы */
    font-size: 16px; /* Размер шрифта */
    box-sizing: border-box; /* Учитывать padding в ширине */
    opacity: .8; /* прозрачность */
}

.btn {
    display: inline-block;
    font-weight: 400;
    color: #fff;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: #dc3545; /* Цвет кнопки "danger" */
    border: 1px solid transparent;
    padding: .375rem .75rem;
    font-size: 1rem;
    line-height: 1.25;
    border-radius: .25rem;
}

.alert {
    display: block;
    font-size: 1.3em;
    color: #ffdd7d;
    text-shadow: 1px 1px 0 #000;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.4), transparent);
    padding: 0.4em 0.8em;
    margin-bottom: 0px;
    border-radius: 4px;
    width: fit-content;
    max-width: 100%;
    word-break: break-word;
    backdrop-filter: blur(0.3px);
    box-shadow: none;
    border: none;
}

#all_mess > *:last-child {
    margin-bottom: 0px;
}

.system-message {
    font-weight: bold;
    color: #FFD700; /* Золотой цвет */
}

.alert-warning {
    background-color: #ff9800; /* Оранжевый для предупреждений */
}

.alert-danger {
    background-color: #d32f2f; /* Тёмно-красный для ошибок */
}

.row {
    display: flex;
    margin-right: -15px; /* Убираем отступы справа */
    margin-left: -15px; /* Убираем отступы слева */
}

.col-6 {
    flex: 0 0 50%;
    padding-right: 15px; /* Отступ справа */
    padding-left: 15px; /* Отступ слева */
}

/* Добавляем отступ между колонками */
.col-6:not(:last-child) {
    margin-bottom: 20px; /* Отступ между колонками */
}

#all_mess { 
position: fixed;
bottom: 50px; /*ТУт движение вниз */
left: 0; /* Движение влево */
width: 100%; /* Ширина на весь экран */
max-height: 400px; /* Макс высота области сообщений */
overflow-y: auto; /* Прокрутка */
scrollbar-width: none; /* Firefox */
overflow-wrap: break-word; /* Включить перенос строк */
padding: 10px;
    gap: 0px; /* если был flex */
}

#historyContainer {
    overflow-y: scroll; /* Прокрутка по вертикали остаётся */
    scrollbar-width: none; /* Убирает скроллбар в Firefox */
    -ms-overflow-style: none; /* Убирает скроллбар в Internet Explorer */
}

#historyContainer::-webkit-scrollbar {
    display: none; /* Убирает скроллбар в Chrome, Safari */
}

button[onclick="hideChatHistory()"] {
    position: absolute;
    top: 5%;
    right: 5%;
    padding: 10px 20px;
    font-size: 16px;
    background-color: rgba(0, 0, 0, 0.8); /* Полупрозрачный черный фон */
    color: #DC143C; /* Алый цвет текста */
    border: 2px solid #DC143C; /* Алый цвет границы */
    border-radius: 5px; /* Скругленные углы */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.7); /* Тень для объёмности */
    cursor: pointer; /* Указатель при наведении */
    transition: background-color 0.3s ease; /* Плавный переход для фона */
}

button[onclick="hideChatHistory()"]:hover {
    background-color: rgba(220, 20, 60, 0.9); /* Более яркий алый фон при наведении */
}

button[onclick="hideChatHistory()"]:active {
    background-color: #DC143C; /* Алый фон при клике */
}


#historyButton {
    position: fixed;
    top: 10px; /* Расстояние от верхнего края */
    left: 50%; /* Центрирование кнопки по горизонтали */
    transform: translateX(-50%); /* Сдвиг для центрирования */
    padding: 10px 20px; /* Внутренние отступы */
    font-size: 16px; /* Размер шрифта */
    background-color: rgba(0, 0, 0, 0.8); /* Полупрозрачный черный фон */
    color: #DC143C; /* Алый цвет текста */
    border: 2px solid #DC143C; /* Алый цвет границы */
    border-radius: 5px; /* Скругленные углы */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.7); /* Тень для объёмности */
    cursor: pointer; /* Указатель при наведении */
    transition: transform 0.3s ease, background-color 0.3s ease; /* Плавные анимации */
}

#historyButton:hover {
    background-color: rgba(220, 20, 60, 0.9); /* Более яркий алый фон при наведении */
    box-shadow: 0 0 15px rgba(220, 20, 60, 0.8); /* Более выраженная тень при наведении */
}

#historyButton:active {
    background-color: #DC143C; /* Установленный алый фон при клике */
}

#messForm {
    position: absolute;
    bottom: -480px; /* Ванька наворотил */
    left: -60px; /* движение влево можно, но оно толком и не нужно */
    width: 200%; /* Ширина */
    padding: 10px; /* Отступы для формы */
}

#avatar-selection { /* Для выбора аватара */
    display: flex;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 10px;
    max-height: 650px; /* Устанавливаем максимальную высоту */
    scrollbar-width: none; /* Firefox */
    overflow-y: auto; /* Прокрутка по вертикали */
}

#avatar { /* Спрайтик */
    position: absolute;
    bottom: 0;
    display: none;
    width: 45%;
    object-fit: contain;
    z-index: -100;
}

.avatar {
    border: none;
    background: none;
    padding: 0;
    width: 250px; /* Ширина кнопки */
    height: 250px; /* Высота кнопки */
    overflow: hidden; /* Обрезка содержимого, выходящего за пределы */
    border-radius: 80%; /* Круглая форма кнопки */
    position: relative; /* Для абсолютного позиционирования изображения */
}

.avatar img {
    width: 100%; /* Изображение занимает 100% ширины кнопки */
    height: auto; /* Высота автоматически подстраивается */
    position: absolute; /* Позволяет изображению быть позиционированным внутри кнопки */
    top: 50%; /* Центрируем изображение по вертикали */
    left: 50%; /* Центрируем изображение по горизонтали */
    transform: translate(-50%, -50%); /* Перемещаем изображение на половину его ширины и высоты */
}

#sprites {
  position: absolute;
  top: 0;
  left: 0;
  width: 1920px;
  height: 1080px;
}

.spritesDiv img {
    position: absolute; /* Добавлено свойство position */
    bottom: 0;
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Стандартный синтаксис */
}

.arrow {
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.5); /* Полупрозрачный фон */
    color: #DC143C;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Стандартный синтаксис */
}

.arrow:hover {
    background-color: rgba(0, 0, 0, 0.8); /* Более темный фон при наведении */
    transform: scale(1.1); /* Легкое увеличение при наведении */
}

.arrow-left {
    top: 10px;
    left: 10px;
    z-index: 1000;
}

#historyButton {
    position: fixed;
    top: 10px; /* Расстояние от верхнего края */
    left: 50%; /* Центрируем кнопку по горизонтали */
    transform: translateX(-50%); /* Сдвигаем кнопку влево на половину её ширины */
    padding: 10px 20px;
    font-size: 16px;
    z-index: 1000;
}


.arrow-right {
    top: 10px;
    right: 10px;
    z-index: 1000;
}

.arrow-up {
    position: absolute;
    right: 5vw;
    bottom: 20vh;
    z-index: 1001;
}

.arrow-down {
    position: absolute;
    right: 5vw;
    bottom: 10vh;
    z-index: 1001;
}

.sprite-container {
    width: 900px; /* Установите нужную ширину */
    height: 1080px; /* Установите нужную высоту */
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    transition: left 0.3s ease-in-out;
    bottom: 0; /* Фиксация понизу */
}

.sprite-container img {
    transition: left 0.3s ease-in-out;
    width: 100%;
    height: 100%;
}

.clothes {
    transition: left 0.5s ease-in-out;
    position: absolute;
    object-fit: contain;
    z-index: -1;
}

.emotion {
    transition: left 0.5s ease-in-out;
    position: absolute;
    object-fit: contain;
    z-index: -1;
}

.sprite {
    transition: left 0.5s ease-in-out;
    position: absolute;
    object-fit: contain;
    z-index: -1;
}

/*-------------------------------- КОНТЕКСТНОЕ МЕНЮ ---------------------------------------------------------*/

#overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
}

#contextMenu {
    display: none;
    position: absolute;
    background-color: rgba(0, 0, 0, 0.8); /* Полупрозрачный черный фон */
    color: #fff; /* Белый цвет текста */
    border-radius: 5px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.5); /* Легкая тень */
    z-index: 1001;
    padding: 10px;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
    flex-direction: column; /* Ссылки будут располагаться в столбик */
    flex-wrap: wrap; /* Включить перенос строк */
    max-height: 100vh; /* Максимальная высота контейнера, чтобы ссылки не выходили за пределы экрана */
    overflow-y: auto; /* Включить прокрутку, если ссылки не помещаются */
}

#contextMenu.show {
    opacity: 1;
    transform: scale(1);
}

#contextMenu.hide {
    opacity: 0;
    transform: scale(0.8);
}

#contextMenu a {
    display: inline-block; /* Изменено на inline-block для горизонтального расположения */
    padding: 10px;
    text-decoration: none;
    color: #DC143C; /* Алый цвет для ссылок */
}

#contextMenu a:hover {
    background-color: rgba(220, 20, 60, 0.2); /* Алый фон при наведении */
    transform: scale(1.05); /* Легкое увеличение при наведении */
}

.button-toggle {
    background-color: rgba(0, 0, 0, 0.8); /* Полупрозрачный черный фон */
    color: #DC143C; /* Алый цвет текста */
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    font-size: 16px;
}

.button-toggle:hover {
    background-color: rgba(220, 20, 60, 0.8); /* Более темный алый фон при наведении */
    transform: scale(1.05); /* Легкое увеличение при наведении */
}


/*СМЕНА ЭМОЦИЙ И ОДЕЖДЫ */
#changeOptions {
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #ccc;
    margin-top: 10px;
}

#changeOptions h4 {
    margin-bottom: 10px;
}

#clothesOptions button, #emotionsOptions button {
    display: block;
    margin-bottom: 5px;
    width: 100%;
}

#selectorBlock {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(30, 30, 30, 0.9); /* Полупрозрачный темный фон */
    color: #fff; /* Белый цвет текста */
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.7); /* Легкая тень */
    z-index: 1000;
    display: none; /* Скрыто по умолчанию */
    -webkit-user-select: none; /* Safari */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Стандартный синтаксис */
}

#selectorBlock label {
    display: block;
    margin-top: 10px;
    color: #DC143C; /* Алый цвет для текста метки */
}

#selectorBlock select {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    background-color: rgba(50, 50, 50, 0.7); /* Полупрозрачный темный фон для выпадающего меню */
    color: #fff; /* Белый цвет текста */
    border: 1px solid #DC143C; /* Алый цвет границы */
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
}

#selectorBlock select:hover {
    background-color: rgba(220, 20, 60, 0.4); /* Легкий алый фон при наведении */
    border-color: #fff; /* Белая граница при наведении */
}

.hideGovno {
    display: none;
}

.welcome-image {
    position: fixed; /* Меняем absolute на fixed для фиксации относительно окна браузера */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); /* Центрирование элемента */
    max-width: 90%; /* Чтобы картинка не выходила за края экрана */
    max-height: 90%; /* Ограничение высоты относительно высоты окна */
    width: auto; /* Автоматическая ширина для сохранения пропорций */
    height: auto; /* Автоматическая высота для сохранения пропорций */
    object-fit: contain; /* Сохранение пропорций изображения */
    z-index: 10;
}

.hidden-image {
    display: none;
}