.menu-hidden #side-menuhtml, body {
    background: url('assets/images/bb_bg.png') no-repeat center center fixed;
    background-size: cover;
    margin: 0;
    font-family: Arial, sans-serif;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.8);
    height: 70px;
    border: 1px solid #4682B4;
    border-radius: 10px;
    padding: 5px 10px;
    position: relative;
}

.header-logo {
    height: 60px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

header button {
    padding: 2px 6px;
    font-size: 10px;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 80px;
    margin-top: 5px;
    margin-bottom: 5px;
    text-decoration: none;
    border: 1px solid #87CEEB;
    color: #87CEEB;
    background: rgb(225, 243, 255, 0);;
}

header button:hover {
    background: #4682B4;
}

button {
    width: 120px;
    padding: 10px;
    margin: 10px 1%;
    border: none;
    border-radius: 5px;
    border: 1px solid #87CEEB;
    color: #87CEEB;
    font-size: 15px;
    font-weight: bold;
    text-decoration: none;
    background: rgb(225, 243, 255, 0);;
    transition: .4s;
    cursor: pointer;
}

button:hover {
    background: #4682B4;
    color: #FFF;
}

/* Оставляем место для auth-buttons, даже когда он скрыт */
.auth-buttons-wrapper {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    min-width: 150px;
}

/* auth-buttons теперь внутри wrapper и всегда справа */
.auth-buttons {
    display: flex;
    flex-direction: column; /* Ставим кнопки вертикально */
    align-items: flex-end;
    margin: 5px 0 5px 0;
}

.auth-buttons button {
    position: relative;
    width: 80px;
    display: inline-block;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 10px 4px 10px;
    text-decoration: none;
    border: 1px solid #87CEEB;
    color: #87CEEB;
    background: rgb(225, 243, 255, 0);;
    transition: .4s;
}

.auth-buttons button:hover {
    background: #4682B4;
    color: #FFF;
}

.auth-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    padding-bottom: 10px;
    border-radius: 10px;
    border: 1px solid white;
    width: 370px;
    text-align: center;
    color: white;
    z-index: 9999;
}

.auth-modal-content {
    border-radius: 10px;
    text-align: center;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    display: flex;
    align-items: center;
    text-align: center;
    justify-content: center;
    padding: 2vh;
    box-sizing: border-box;
}

.modal-content {
    background: #111;
    border: 1px solid #87CEEB;
    border-radius: 10px;
    padding: 3vh 3vw;
    color: #87CEEB;
    text-align: center;
    max-width: 90vw;
    width: clamp(260px, 60vw, 420px);
    box-sizing: border-box;
}

.modal-content h2 {
    font-size: clamp(18px, 2.5vh, 28px);
    margin-bottom: 1vh;
}

.modal-content p {
    font-size: clamp(14px, 2vh, 20px);
    margin: 1.5vh 0;
}

.modal-content img {
    max-width: 100%;
    max-height: 35vh;
    margin: 1vh 0;
    object-fit: contain;
}

.modal-content button {
    padding: 5px;
    font-size: clamp(14px, 1.8vh, 18px);
    border: 1px solid #87CEEB;
    background: transparent;
    color: #87CEEB;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.modal-content button:hover {
    background: #4682B4;
    color: #fff;
}

.form-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
}

.form-group label {
    color: white;
    font-size: 16px;
    flex: 1.3;
    text-align: left;
    margin-right: 10px;
}

.form-group input {
    flex: 2;
    padding: 2px 1px 2px 1px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    width: 100%;
}

.form-group input::placeholder {
    color: #DCDCDC;
}

.form-links {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.form-links a {
    text-decoration: none;
    color: #87CEEB;
    font-size: 13px;
    transition: .3s;
    flex-basis: 48%;
    padding: 0 35px 0 35px;
}

.form-links a:hover {
    text-decoration: underline;
}

.form-buttons {
    display: flex;
    justify-content: space-around;
    gap: 15px;
    width: 100%;
}

.error-message {
    color: red;
    font-size: 0.8em;
    height: 20px;
    margin-top: 5px;
    margin-bottom: 5px;
    text-align: center;
    width: 100%;
    display: block;
}

footer {
    align-items: center;
    background-color: rgba(0, 0, 0, 0.8); /* Цвет фона */
    border: 1px solid #87CEEB;
    border-radius: 10px;
    color: #87CEEB; /* Цвет текста */
    padding: 0; /* Внутренний отступ */
    position: fixed; /* Фиксированное положение внизу */
    left: 0;
    right: 0;
    bottom: 0;
    height: 20px;
    text-align: center; /* Выравнивание текста по центру */
}

.footer-statistics {
    display: inline-block; /* Отображение в одну строку */
    padding: 5px; /* Внутренний отступ */
}

/* Блок пользователя */
.user-info {
    flex-direction: column;
    align-items: center;
    color: white;
}

.user-block {
    display: flex;
    align-items: center;
    gap: 5px; /* Отступ между аватаром и логином */
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid green;
    margin-bottom: 5px;
}

#user-login {
    color: #87CEEB;
}

#logout-btn {
    font-size: 12px;
    margin-bottom: 0;
}

/* Панель онлайн-игроков */
#online-players-panel {
    width: 200px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #87CEEB;
    border-radius: 10px;    
    position: fixed;
    right: 0;
    top: 81px;
    bottom: 21px;
    padding: 0;
    color: white;
    text-align: center;
}

/* Игровое поле */
#game-interface {
    position: fixed;
    top: 81px;
    bottom: 21px;
    left: 201px;
    right: 201px; /* Оставляем место для панели игроков */
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #87CEEB;
    border-radius: 10px;
    padding: 0;
    color: white;
    z-index: 1000;
    transition: transform 0.3s ease;
}

/* Футер со статистикой */
#user-stats-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 15px;
    background: rgba(0, 0, 0, 0);
    color: white;
    display: flex;
    justify-content: space-evenly; /* ✅ Теперь стат-блоки распределяются равномерно */
    align-items: center;
    font-size: 12px;
    padding: 2px;
    margin: 0 70px 0 70px;
}

.stat-item {
    display: flex;
    gap: 5px; /* ✅ Добавляет небольшой отступ между "WIN:" и числом */
}

#players-list-container {
    display: flex;
    flex-direction: column;
}

.player-container {
    display: flex;
    justify-content: space-between;
    padding: 5px 0px;
    margin: 2px 2px 0 2px;
    border: 1px solid #87CEEB;
    background: rgb(225, 243, 255, 0);
    cursor: pointer;
    transition: .4s;
}

.player-container:hover {
    background: #4682B4;
    color: #FFF;
}

.player-login, .player-rating, .status-label {
    font-size: 12px;
    display: inline-block;
    text-align: left;
}

/* Применяем процентные ширины для элементов внутри контейнера */
.player-login { width: 70%; padding-left: 2px;}
.player-rating { width: 20%; }
.status-label { width: 10%; }

.player-container.in-game {
    background: rgba(255, 0, 0, 0.2); /* Красный оттенок */
    color: white;
    font-weight: bold;
    opacity: 0.5;
}

.player-container.you {
    background: #158945; /* нежно-голубой фон */
    border: 1px solid #87CEEB;
    font-weight: bold;
    position: relative;
}

.player-container.you::after {
    content: "вы";
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 10px;
    color: #87CEEB;
    font-style: italic;
}

.countdown {
    font-size: 4rem;
    transition: color 0.5s ease, transform 0.5s ease;
}

.countdown-animate {
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

#game-field {
    border: 2px solid #4682B4;
    background-color: #f9f9f9;
}

.cell {
    width: 20px;
    height: 20px;
    border: 1px solid #87CEEB;
    box-sizing: border-box;
}

canvas {
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}

.margin-top {
    margin-top: 20px; /* Задайте нужное значение */
}

/* Вертикальное меню */
#main-container {
    display: flex;
    height: 100%;
}
  
#side-menu {
    width: 200px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #87CEEB;
    border-radius: 10px;
    position: fixed;
    left: 0;
    top: 81px;
    bottom: 21px;
    color: #87CEEB; /* Цвет текста кнопок */
    text-align: center;
    overflow: hidden;
    opacity: 1;
    transform: translateX(0);
    transition: transform 0.3s ease;
    will-change: transform;
    z-index: 1100;
}
  
#side-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
  
#side-menu li {
    padding: 10px;
    border-bottom: 1px solid #87CEEB;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s, color 0.3s;
}
  
#side-menu li:hover {
    background: #4682B4;
    color: #FFF;
}
  
/* Значок (стрелка/меню) */
#menu-toggle {
    margin: 0;
    position: fixed;
    top: 50%;
    left: 185px;
    width: 30px;
    height: 80px;
    background: #111;
    color: #87CEEB;
    display: flex;
    align-content: center;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transform: translateY(-50%);
    border-radius: 5px;
    border: 1px solid #87CEEB;
    font-size: 18px;
    font-weight: bold;
    z-index: 1200;
    transition: left 0.3s ease;
    user-select: none;
    padding: 0;
}

#menu-toggle span {
    display: block;
    width: 100%;
    height: 100%;
    align-content: center;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: none; /* важно: кликается родитель */
    white-space: nowrap; /* Не переносить текст */
    padding: 0;
}

/* Когда меню скрыто — сдвигаем влево */
.menu-hidden #side-menu {
    transform: translateX(-100%);
    pointer-events: none;
}

.menu-hidden #game-interface {
    left: 0; /* Убираем отступ, когда меню скрыто */
}

.menu-hidden #menu-toggle {
    left: 0;
}

@media (max-width: 768px) {
    #side-menu {
        position: absolute;
        z-index: 1000;
        height: 100%;
        transform: translateX(-100%);
    }
    #menu-toggle {
        display: block;
    }
}

#side-menu ul li.active {
    background: #4682B4;
    color: #FFF;
}

.side-menu-footer {
    position: absolute;
    bottom: 10px;
    width: 100%;
    color: #87CEEB;
    border-top: 1px solid #87CEEB;
    font-size: 12px;
    text-align: center;
}

.menu-content {
    color: #87CEEB;
    padding: 20px;
    line-height: 1.5;
    font-size: 16px;
}

#section-container {
    max-height: 100vh;
    overflow-y: auto;
    padding: 0 20px 20px 20px;
    scroll-behavior: smooth;
    transition: transform 0.3s ease;
    transform-origin: top center;
}

.menu-section {
    max-width: 750px;
    margin-left: auto;
    margin-right: auto;
    color: #87CEEB;
    font-size: clamp(14px, 1.9vh, 18px);
    line-height: 1.6;
    padding: 2vh;
    box-sizing: border-box;
    max-height: 100%;
}

.menu-section h2 {
    font-size: 2.5vh;
    margin-bottom: 2vh;
    text-align: center;
    color: #87CEEB;
}

.menu-section p,
.menu-section ul {
    font-size: inherit;
    line-height: inherit;
    margin-bottom: 1.5vh;
}

.menu-section img {
    max-width: clamp(180px, 40vh, 300px);
    max-height: clamp(120px, 30vh, 260px);
    height: auto;
    margin: 1.5vh;
}

.menu-section img.left {
    float: left;
    margin-right: 2vh;
}

.menu-section img.right {
    float: right;
    margin-left: 2vh;
}

.menu-section img.center {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.menu-section::after {
    content: "";
    display: block;
    clear: both;
}

#welcome-banner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 620px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #87CEEB;
    border-radius: 10px;
    color: #87CEEB;
    text-align: center;
    z-index: 100;
    display: none; /* по умолчанию скрыт */
}

#welcome-banner img {
    max-width: 100%;
    border-radius: 8px;
    margin-bottom: 10px;
}

#welcome-banner p {
    font-size: 20px;
    line-height: 1.5;
}
  