body
{
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    overflow-x: hidden;
}

/* Экран выбора изображения */
#selection-screen
{
    text-align: center;
    margin: 5px;
}

#selection-screen h2
{
    margin: 4px 0 0 0;
    font-size: 13pt;
}

#pictureOptions button
{
    font-size: 16px;
    padding: 10px;
    margin: 10px;
    cursor: pointer;
    display: inline-block;
    vertical-align: top;
}

#pictureOptions img
{
    display: block;
    margin: 0 auto 5px auto;
}

/* Игровой экран с flex-версткой */
#game-screen
{
    display: flex;
    flex-direction: column;
    height: calc(100vh - 20px - 20px);
    margin: 0;
    background-color: white;
}

/* Палитра */
#palette
{
    flex: 0 0 auto;
    margin: 3px 3px 7px 3px;
}

.palette-item
{
    display: inline-block;
    width: 8vw;
    height: 8vw;
    border-radius: 50%;
    text-align: center;
    color: white;
    font-weight: bold;
    margin: 1vw;
    cursor: pointer;
    border: 2px solid transparent;
    user-select: none;
    font-size: clamp(12pt, 4vw, 25pt);
    line-height: clamp(16pt, 8vw, 40pt);
    max-width: 40pt;
    max-height: 40pt;
}

.palette-item.selected {
    border: 1px solid white;
    outline: 3px solid black;
    outline-offset: 2px;
}

/* Кнопки/режим переключения */
#controls
{
    flex: 0 0 auto;
    text-align: center;
    margin-bottom: 10px;
}

#mode-switch
{
    font-size: 16px;
    padding: 5px 10px;
}

/* Область для раскраски */

#grid-canvas
{
    border: 1px solid #000000;
    display: block;
    margin-left: auto;
    margin-right: auto;
    touch-action: none;
}

/* Сообщение о победе */
#message
{
    margin-top: -35px;
    font-size: 14px;
    color: green;
    text-align: center;
    position: absolute;
    background: #f0f0f0;
    border: 1px solid #808080;
    padding: 3px;
    width: calc(100% - 45px);
}

/* Кнопка нового раунда */
#new-round-container
{
    width: 100%;
    text-align: center;
}

#new-round
{
    flex: 0 0 auto;
    margin-top: 10px;
    font-size: 16px;
    padding: 5px 10px;
}

/* Горизонтальный скролл для разделов */
#selection-section
{
    display: flex;
    overflow-x: auto;
    white-space: nowrap; /* Предотвращаем перенос на новую строку */
    margin-bottom: 10px; /* Отступ от заголовка */
}

#selection-section button
{
    margin: 5px;
    flex-shrink: 0; /* Не сжимаем кнопки */
}

/* Контейнер для картинок */
#picture-options
{
    display: flex; /* Используем flexbox для удобства */
    flex-wrap: wrap; /* Разрешаем перенос на новую строку */
    justify-content: center; /* Центрируем элементы */
    margin-top: 155px;
}

#picture-options button
{
    margin: 5px;
}

/* Горизонтальная линия */
.separator
{
    margin: 30px 0 10px 0;
    clear: both;
}

#top-select-section
{
    position: fixed;
    background: #eeeeee;
    width: 100%;
    top: 0;
    border-bottom: 2pt solid #808080;
    z-index: 10000;
}

div.counter-style
{
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    border: 1px solid red;
    color: red;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

#button-container
{
    max-width: 500px;
    margin: 0 auto;
}

#bottom-panel
{
    position: absolute;
    bottom: 0;
    width: calc(100% - 20px);
    background-color: #eeeeee;
    padding: 10px;
}

#zoom-hint-panel
{
    display: none;
    position: absolute;
    width: 100%;
    background-color: white;
    opacity: 0.9;
    pointer-events: none;
}

#zoom-hint-panel table
{
    width: 100%;
}

#zoom-hint-panel img
{
    width: 25px;
    aspect-ratio: 412 / 512;
}

#zoom-hint-panel td.zoom-hint-divider
{
    width: 50%
}

#zoom-hint-panel td
{
    font-size: 13px;
    text-align: center;
}