:root {
    --bg-color: #f5f5f5;
    --header-bg: #fff;
    --notebook-bg: #ffffff;
    /*--chalkboard-bg: #3d5849; Самый первый вариант */
    --chalkboard-bg: #486b58;
    --chalkboard-frame: #b58255;
    --primary-font: 'Short Stack', cursive;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    /* clamp(Минимум, Желаемое значение, Максимум) */
    /*font-size: clamp(14px, 0.25vw + 13.2px, 18px); Если нужен более крупный шрифт.  */
    font-size: clamp(14px, 0.3vw + 10px, 18px);
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

body {
    font-family: var(--primary-font);
    background-image: url('/image/bgschool.webp');
    background-size: auto;
    background-repeat: repeat;
    background-attachment: scroll;
    min-width: 320px;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

header {
    background: rgba(255, 255, 255, 0.9);
    padding: 0.625rem 1.25rem;
    /* было 10px 20px */
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 0.125rem 0.3125rem rgba(0, 0, 0, 0.1);
    /* было 0 2px 5px */
    position: relative;
    z-index: 100;
}

.logo h1 {
    font-size: 1.5rem;
    /* Размер как у тебя был в span */
    font-family: var(--primary-font);
    font-weight: normal;
    /* Убираем жирность, если она не нужна */
    margin: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    /* было 10px */
    font-size: 1.5rem;
    font-weight: bold;
}

.logo-icon {
    width: 2rem;
    /* было 32px */
    height: 2rem;
}

/*nav {
    display: flex;
    gap: 15px;
}

.nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--primary-font);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-btn:hover {
    color: #007bff;
}*/



main {
    padding: 2vw 0;
    /* Отступы сверху/снизу относительно ширины окна */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
    width: 90%;
    /* Строго 90% экрана */
    max-width: 4500px;
}

.content-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    /* Центрируем по вертикали, если один блок чуть ниже другого */
    gap: 7vw;
    width: 100%;
    /*flex-grow: 1;*/
}

/* Группируем общие правила для обоих квадратов */
.wheel-area {
    width: min(45vw, 80vh);
    aspect-ratio: 1 / 1;
    display: flex;
}

/* Блокнот делаем уже */
.entries-section {
    /* 35vw вместо 45vw делает его заметно уже колеса */
    /* 60vh — это расчет ширины (80vh * 0.75), чтобы при сжатии высоты пропорции сохранялись */
    width: min(25vw, 45vh);
    aspect-ratio: 2 / 3.2;
    /* Пропорция «портретного» листа (высота больше ширины) */
    display: flex;
}

.wheel-area,
.wheel-section,
.wheel-wrapper,
#wheel-container {
    min-width: 0;
    min-height: 0;
}

.wheel-section {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    width: 100%;
    height: 100%;
}

.wheel-wrapper {
    position: relative;
    width: 80%;
    aspect-ratio: 1 / 1;
    /* КЛЮЧЕВОЕ: заставляет блок всегда быть квадратом */
    z-index: 2;
    margin: 0 auto;
    /* Центрируем блок */
}

#wheel-container {
    width: 100%;
    height: 100%;
    transform: translateZ(0);
    will-change: transform;
}

.wheel-pointer {
    position: absolute;
    top: -3%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
    width: 10%;
}

.wheel-pointer img {
    position: absolute;
    width: 100%;
    height: auto;
}



/* Обновленные стили для подставки */
.wheel-stand {
    position: absolute;
    top: 99%;
    left: 50%;
    transform: translateX(-50%);
    width: 55%;
    z-index: -1;
}

.wheel-stand img {
    position: absolute;
    width: 100%;
}

.notebook-page {
    width: 100%;
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    background: var(--notebook-bg);
    border: 0.6rem solid #fae171;
    border-radius: 0.3rem;
    padding: 5%;
    box-shadow: 0 0 0 0.14rem #46370a, inset 0 0 0 0.14rem #46370a, 0.3rem 0.3rem 1.5rem rgba(59, 41, 0, 0.3);
}

.entries-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.625rem;
    /* было 1vh (~10px) */
}

.entries-separator {
    border: none;
    border-top: 0.1rem solid #ccc;
    margin: 0.625rem 0 0.9375rem 0;
    /* было 1vh 0 1.5vh 0 (~10px 0 15px 0) */
}

#entries-count {
    background: #eee;
    padding: 0.125rem 0.5rem;
    /* было 2px 8px */
    border-radius: 0.625rem;
    /* было 10px */
    font-size: 1.2rem;
}

.entries-actions {
    display: flex;
    gap: 5%;
    margin: 0 auto 0.9375rem;
    /* было 1.5vh (~15px) */
    max-width: 95%;
    align-self: center;
    width: 100%;
}

.entries-actions button {
    flex: 1;
    min-height: 2.5rem;
    /* вместо 40px */
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: var(--primary-font);
    font-weight: bold;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    /* вместо 5px */
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.2s ease, filter 0.2s ease;
    color: #333;
    -webkit-appearance: none;
    appearance: none;
}

/* Эффект при наведении курсора */
.entries-actions button:hover {
    transform: scale(1.01);
    /* Легкое увеличение на 5% */
    filter: brightness(1.07);
    /* Осветление на 10% */
}

/* Эффект при нажатии (клике) для лучшего UX */
.entries-actions button:active {
    transform: scale(1);
    /* Кнопка слегка "продавливается" */
    filter: brightness(1);
    /* И чуть-чуть темнеет */
}

.btn-icon {
    width: 1.2rem;
    /* вместо 20px */
    height: 1.2rem;
    object-fit: contain;
}

#shuffle-btn {
    background-image: url('image/shuffleButton.svg');
}

#sort-btn {
    background-image: url('image/sortButton.svg');
}

#select-mode-btn {
    background-image: url('image/selectButton.svg');
}

.entries-list {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 0.625rem;
    /* было 1vh (~10px) */
    background-image: linear-gradient(#eee 0.1rem, transparent 0.1rem);
    background-size: 100% 2.5rem;
    padding-top: 0.3125rem;
    /* было 0.5vh (~5px) */
}

.entry-item {
    display: flex;
    align-items: center;
    height: 2.5rem;
    /* Строго совпадает с background-size (вместо 38px) */
    padding: 0;
    border-bottom: none;
    /* Добавляем магию оптимизации: */
    content-visibility: auto;
    contain-intrinsic-size: 50px;
    /* Здесь укажи ПРИМЕРНУЮ высоту одной твоей строки в пикселях */
}

.entry-item input[type="text"] {
    flex-grow: 1;
    background: none;
    border: none;
    font-family: var(--primary-font);
    font-size: 1rem;
    padding: 0 0.3rem;
    /* вместо 5px */
}

.entry-item input:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.05);
}

.entry-item .delete-btn {
    cursor: pointer;
    color: #ccc;
    font-size: 0.8rem;
    padding: 0 0.3rem;
}

.entry-item .delete-btn:hover {
    color: #ff0000;
}

@keyframes pop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    70% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

#winner-name {
    display: inline-block;
}

.add-entry {
    border-top: 0.1rem solid #ddd;
    padding-top: 0.625rem;
    /* было 1vh (~10px) */
}

.add-entry input {
    width: 100%;
    padding: 0.6rem;
    /* вместо 8px */
    border: 0.1rem solid #ddd;
    border-radius: 0.3rem;
    /* вместо 5px */
    font-family: var(--primary-font);
}

.winner-section {
    margin-top: 3vh;
    text-align: center;
    width: 100%;
    background: #fdf1e5;
    padding: 4% 7% 5%;
    border-radius: 1rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
}

.winner-section h3 {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 0.3125rem;
    /* было 0.5vh (~5px) */
    letter-spacing: 0px;
}

.recent-winners {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-bottom: 2.1875rem;
    /* было 3.5vh (~35px) */
}

.chalkboard-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1.875rem auto;
    /* было 3vh (~30px) */
    width: 100%;
    max-width: 75%;
    transition: max-width 0.3s ease;
}

.chalkboard {
    position: relative;
    background-color: var(--chalkboard-bg);
    border: 0.1875rem solid #1a1a1a;
    /* было 3px */
    border-radius: 0.1875rem;
    /* 3px для гармонии с рамкой */
    width: 100%;
    aspect-ratio: 2 / 1;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: clamp(2rem, 5vw, 5rem);
    box-shadow:
        0 0 0 0.75rem var(--chalkboard-frame),
        /* было 12px */
        0 0 0 0.9375rem #1a1a1a,
        /* было 15px */
        inset 0 0 3.125rem rgba(0, 0, 0, 0.5);
    /* было 50px */
    z-index: 2;
}

.chalkboard::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    /* НОВЫЙ ВАРИАНТ: Текстура + Режим наложения + Прозрачность */
    background-image: url('/image/bgboard512.webp');
    background-size: cover;
    background-position: center;

    /* Режим смешивания с зеленым фоном доски */
    mix-blend-mode: soft-light;
    /* Попробуй также overlay или soft-light */

    /* ИМЕННО ЗДЕСЬ ТЫ МЕНЯЕШЬ ПРОЗРАЧНОСТЬ (от 0.1 до 1) */
    opacity: 1;

    /* Технические настройки (оставляем твои) */
    pointer-events: none;
    border-radius: 0.1875rem;
    z-index: 0;
}

.star-svg {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    height: 70%;
    max-height: 450px;
    width: auto;
    z-index: 1;
    display: block;
}

.star-left-svg {
    right: 105%;
    /* Делаем левую часть звезды прозрачной на 50% (0.5), а правую оставляем яркой (1) */
    -webkit-mask-image: linear-gradient(to right, rgba(0, 0, 0, 0.25) 20%, rgba(0, 0, 0, 1) 70%);
    mask-image: linear-gradient(to right, rgba(0, 0, 0, 0.25) 20%, rgba(0, 0, 0, 1) 70%);
}

.star-right-svg {
    left: 105%;
    /* Делаем правую часть звезды прозрачной на 50% (0.5), а левую оставляем яркой (1) */
    -webkit-mask-image: linear-gradient(to left, rgba(0, 0, 0, 0.25) 20%, rgba(0, 0, 0, 1) 70%);
    mask-image: linear-gradient(to left, rgba(0, 0, 0, 0.25) 20%, rgba(0, 0, 0, 1) 70%);
}

.decorations div {
    position: absolute;
    font-size: 2rem;
}

.books-decoration {
    position: absolute;
    bottom: -12%;
    left: -12%;
    width: 19%;
    z-index: 10;
}

.pencil-decoration {
    position: absolute;
    bottom: -11%;
    right: -8%;
    width: 23%;
    z-index: 10;
    transform: rotate(3deg);
}

.stars-left {
    top: 20px;
    left: 20px;
}

.stars-right {
    top: 20px;
    right: 20px;
}

.books-stack {
    bottom: 20px;
    left: 40px;
    font-size: 3rem !important;
}

.pencil {
    bottom: 20px;
    right: 40px;
    transform: rotate(-45deg);
    font-size: 3rem !important;
}

.wheel-asset {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    /* Жесткий якорь ровно по центру колеса */
    width: 40%;
    /* Размер всегда строго пропорционален колесу */
    height: auto;
    z-index: -1;
    pointer-events: none;
    /* Защита: чтобы декорации не перекрывали клики по самому колесу */
}

/*Совет по тонкой настройке: Если из-за пустот внутри самих SVG-файлов кажется, что одна декорация стоит чуть выше или ниже другой, не трогай transform. Вместо этого просто добавь к нужной картинке margin-top: 1% (или -1%).*/

.asset-left {
    left: -23%;
}

.asset-right {
    right: -23%;
}

/* Стили для кругового текста поверх колеса */
.wheel-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Пропускаем клики сквозь текст, чтобы колесо реагировало */
    z-index: 10;
    transition: opacity 0.3s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
}

.wheel-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    /* <-- Добавлено */
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    /* <-- Изменено */
}

.overlay-text {
    font-family: var(--primary-font), sans-serif;
    fill: #ffffff;
    /* Тройная защита текста: белая заливка, черная внешняя обводка и жесткая тень */
    paint-order: stroke fill;
    stroke: #000000;
    /* ЛОГИКА:
        Минимум: 2px (чтобы не пропадала) Цель: 0.25rem (твои пропорции) Максимум: 6px (потолок для 4K, чтобы не было слишком жирно) */
    stroke-width: clamp(2px, 0.25rem, 6px);
    stroke-linecap: round;
    stroke-linejoin: round;
    /* Аналогично ограничиваем тень, чтобы она не превращалась в огромное пятно */
    filter: drop-shadow(0 clamp(2px, 0.3rem, 8px) clamp(5px, 0.8rem, 15px) rgba(0, 0, 0, 0.8));
}

#wheel-overlay svg {
    max-width: 100%;
    max-height: 100%;
}

@media (width < 56.25em) {
    .content-wrapper {
        flex-direction: column;
        align-items: center;
        gap: 2.5rem;
        /* микро-дизайн: было 40px */
    }

    .wheel-area {
        width: 100%;
        /* Макро-каркас: не трогаем */
        max-width: min(90vw, 90vh);
        margin: 0 auto;
        flex: none;
    }

    .entries-section {
        /* Макро-каркас: не трогаем max-width по правилам */
        max-width: 500px;
        /* Альтернатива: если очень хочется перевести и этот лимит в rem, 
           то это будет max-width: 31.25rem; */
        width: 100%;
        flex: none;
    }

    .winner-section {
        margin-top: 3.375rem;
        /* микро-дизайн: было -10px */
    }
}

/* Мобильные телефоны (600px и меньше) */
/* 600 / 16 = 37.5em */
@media (width <=37.5em) {
    header {
        flex-direction: column;
        padding: 0.625rem;
        /* было 10px */
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.3125rem;
        /* было 5px */
    }

    .nav-btn {
        font-size: 0.8rem;
        padding: 0.3125rem;
        /* было 5px */
    }

    .logo {
        margin-bottom: 0.625rem;
        /* было 10px */
    }

    .chalkboard {
        box-shadow:
            0 0 0 0.5rem var(--chalkboard-frame),
            /* было 8px */
            0 0 0 0.625rem #1a1a1a,
            /* было 10px */
            inset 0 0 1.875rem rgba(0, 0, 0, 0.5);
        /* было 30px */
    }

    .winner-modal-text {
        min-width: 37%;
    }

}

/*@media (max-width: 400px) {


    .wheel-wrapper {
        width: 90%;
    }

    .pencil-decoration {
        bottom: -15%;
        right: -14%;
        width: 31%;
    }

    .books-decoration {
        bottom: -14%;
        left: -15%;
        width: 23%;
    }
}*/

#center-image-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) translateZ(0);
    width: 4%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: #fdf6ec;
    border: 0;
    z-index: 20;
    box-shadow: 0 0 0.0525rem 0.15rem rgba(0, 0, 0, 0.2);
    /* было 0 0px 17px 12px */
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#center-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 80%;
    height: 100%;
}

#center-placeholder img {
    width: 100%;
    /* Если хотите, чтобы wheelCenter.svg была чуть меньше рамки, поставьте тут, например, 80% */
    height: 100%;
    object-fit: contain;
}

/* НОВЫЙ КЛАСС: Срабатывает, когда пользователь загружает свою картинку */
#center-image-wrapper.user-loaded {
    width: 33.33%;
    /* Треть колеса */
}

#center-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    /* Скрыто до момента загрузки картинки */
}

.upload-label {
    cursor: pointer;
    background: #fff;
    border: 0.125rem dashed #b58255;
    /* было 2px */
    padding: 0.5rem 0.9375rem;
    /* было 8px 15px */
    border-radius: 0.3125rem;
    /* было 5px */
    font-size: 0.9rem;
    display: inline-block;
    width: 100%;
    text-align: center;
    transition: background 0.2s, border-color 0.2s;
    font-family: var(--primary-font);
    color: #333;
}

.upload-label:hover {
    background: #fdf1e5;
    border-color: #8c603b;
}

/* =========================================
   СТИЛИ ДЛЯ МОДАЛЬНОГО ОКНА ПОБЕДИТЕЛЯ
   ========================================= */

.winner-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.winner-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.winner-modal-content {
    position: relative;
    width: min(90vw, 70vh * (1296 / 716), 1500px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1296 / 716;

    /*Обычное появление окна с победителем.
    transform: scale(0.7);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);*/

    transform: scale(0.5) rotate(-15deg);
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 1. Слой свечения (Самый нижний) */
.winner-modal-content::before {
    content: "";
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 70%;
    background: radial-gradient(ellipse at center, rgba(255, 215, 0, 0.7) 20%, rgba(255, 215, 0, 0) 100%);
    z-index: 0;
    filter: blur(40px);
    pointer-events: none;
}

/* 2. Слой картинки (Поверх свечения) */
.winner-modal-content::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('/image/winnerWindow.webp');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1;
    pointer-events: none;
}

.winner-modal-overlay.active .winner-modal-content {
    /*Обычное появление окна с победителем
    transform: scale(1);*/

    transform: scale(1) rotate(0deg);
}

.winner-modal-bg {
    width: 100%;
    height: auto;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 0 0.9375rem rgba(255, 223, 0, 0.3));
    /* было 15px */
}

.winner-modal-text {
    position: absolute;
    z-index: 2;
    text-align: center;
    top: 39%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.3125rem;
    /* было 5px */
}

.winner-subtitle {
    font-family: var(--primary-font);
    /* Размер всегда равен ровно 3.5% от ширины контейнера картинки */
    font-size: calc(min(90vw, 800px) * 0.03);
    color: #1a1a1a;
    margin: 0;
    /* Используем em, чтобы отступ тоже масштабировался вместе со шрифтом */
    letter-spacing: 0.03em;
}

.winner-name {
    font-family: var(--primary-font);
    color: #e67373;
    text-transform: uppercase;

    /* Заменяем жесткие пиксели на 'em', чтобы обводка и тень 
       идеально уменьшались вместе с буквами на телефонах */
    -webkit-text-stroke: 0.01em #3d2b1f;
    text-shadow: 0.05em 0.05em 0px #3d2b1f;
    letter-spacing: 0.0em;
    margin: 0;
    overflow-wrap: break-word;
    word-break: break-word;
    overflow: hidden;
    font-size: 3rem;
}

/* Стили кнопок */
.modal-buttons {
    position: absolute;
    bottom: -1.25rem;
    /*margin-top: -1.25rem;
     было -20px */
    display: flex;
    gap: 1.25rem;
    /* было 20px */
    z-index: 5;
}

.modal-btn {
    font-family: var(--primary-font);
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    padding: 0.625rem 1.875rem;
    /* было 10px 30px */
    border: 0.1875rem solid #3d2b1f;
    /* было 3px */
    border-radius: 0.9375rem;
    /* было 15px */
    background-color: #fdf6ec;
    color: #3d2b1f;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: bold;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
    box-shadow: 0.25rem 0.25rem 0px #3d2b1f;
    /* было 4px 4px */
}

.modal-btn:hover {
    transform: translateY(-0.125rem);
    /* было -2px */
    box-shadow: 0.375rem 0.375rem 0px #3d2b1f;
    /* было 6px 6px */
}

.modal-btn:active {
    transform: translateY(0.125rem);
    /* было 2px */
    box-shadow: 0.125rem 0.125rem 0px #3d2b1f;
    /* было 2px 2px */
}

.modal-btn.remove {
    background-color: #e67373;
    color: #fff;
}

/* Контейнер для губки и текста в нижнем правом углу */
.clear-board-action {
    position: absolute;
    bottom: 0.9375rem;
    /* вместо 15px (заменили 5%) */
    right: 0.9375rem;
    /* вместо 15px (заменили 3%) */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3125rem;
    /* было 0.5vh (~5px) */
    pointer-events: auto;
}

.clear-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 2rem;
    /* Сделаем губку покрупнее */
    padding: 0;
    transition: transform 0.2s ease;
}

.clear-btn:hover {
    transform: scale(1.2) rotate(-15deg);
}

/* Текст под губкой */
.clear-text {
    color: white;
    font-family: var(--primary-font);
    font-size: 0.6rem;
    letter-spacing: 0.1em;
    opacity: 0.5;
    /* Сделаем текст полупрозрачным, чтобы не сильно отвлекал */
    text-transform: uppercase;
}

/* Обновляем стили списка, чтобы он занимал всю высоту */
#winner-history-list {
    position: absolute;
    top: 1.25rem;
    /* вместо 20px */
    bottom: 1.25rem;
    left: 2.5rem;
    /* вместо 40px */
    right: 7.5rem;
    /* вместо 120px */
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* было 1vh (~8px) */
}

.history-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    /* вместо 12px */
    font-size: 1.2rem;
    color: white;
    transition: opacity 0.3s ease;
    font-family: var(--primary-font);
}

/* Стили для статусов и скроллбара остаются прежними */
.history-item.finished {
    opacity: 0.4;
}

.status-icon {
    font-size: 1.2rem;
}

.about-site {
    margin-top: 3.125rem;
    /* вместо 50px (заменили 5vh) */
    padding: 2.5rem 5%;
    /* вместо 40px (заменили 4vh) */
    background: rgba(255, 255, 255, 0.8);
    border-top: 0.125rem dashed #b58255;
    /* было 2px */
    color: #333;
    line-height: 1.6;
}

.about-container {
    width: 100%;
    max-width: 80%;
    /* вместо жестких 800px */
    margin: 0 auto;
    text-align: center;
}

.about-container h2 {
    font-family: var(--primary-font);
    font-size: 1.8rem;
    margin-bottom: 1.25rem;
    /* вместо 20px (заменили 2vh) */
    color: #3d5849;
}

.about-container p {
    margin-bottom: 0.9375rem;
    /* вместо 15px (заменили 1.5vh) */
    font-size: 1.1rem;
}

.about-container strong {
    color: #b58255;
    /* Коричневый акцент */
}

#winner-history-list::-webkit-scrollbar,
#entries-list::-webkit-scrollbar {
    width: 0.4rem;
    /* вместо 6px */
}

#winner-history-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    /* вместо 10px */
}

#winner-history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 1rem;
    /* вместо 10px */
}

/* Жестко заставляем Safari рендерить Canvas на видеокарте */
#wheel-container canvas {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    /* Убираем сглаживание краев холста, которое сильно грузит Safari */
    image-rendering: -webkit-optimize-contrast;
    max-width: 100%;
    max-height: 100%;
    width: 100% !important;
    height: 100% !important;
}

/* --- Стилизация скроллбара для списка участников (тетрадь) --- */

#entries-list::-webkit-scrollbar-track {
    background: transparent;
    /* Прозрачный фон, чтобы не перекрывать линии тетради */
}

#entries-list::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    /* Полупрозрачный серый цвет */
    border-radius: 1rem;
    /* вместо 10px */
}

#entries-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.4);
    /* Чуть темнее при наведении */
}

/* Утилита для скрытия панелей */
.hidden {
    display: none !important;
}

/* Стили для чекбокса */
/* Стили для чекбокса */
.entry-checkbox {
    display: none;
    flex-shrink: 0;
    margin-left: 0.3rem;
    margin-right: 0.5rem;
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;

    /* Отключаем стандартный квадратный системный чекбокс */
    -webkit-appearance: none;
    appearance: none;

    /* Делаем его круглым и задаем стиль пустой рамки */
    border-radius: 50%;
    border: 0.125rem solid #b58255;
    /* Под цвет рамки блокнота */
    background-color: transparent;
    transition: all 0.2s ease-in-out;
}

/* Стили для ВКЛЮЧЕННОГО чекбокса */
.entry-checkbox:checked {
    background-color: #b58255;
    /* Заливаем цветом */
    border-color: #b58255;

    /* Добавляем белую галочку по центру через SVG (Data URI) */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 70%;
    /* Размер галочки внутри кружка */
    background-position: center;
    background-repeat: no-repeat;
}

/* --- МАГИЯ РЕЖИМА ВЫБОРА --- */
.entries-list.edit-mode .entry-checkbox {
    display: block;
    /* Показываем галочки */
}

.entries-list.edit-mode .delete-btn {
    display: none;
    /* Прячем крестики */
}

.entries-list.edit-mode input[type="text"] {
    pointer-events: none;
    /* Блокируем вызов клавиатуры на телефоне */
    user-select: none;
}

.entries-list.edit-mode .entry-item {
    cursor: pointer;
    /* Показываем, что строка кликабельна */
    transition: background-color 0.2s ease;
}

/* Подсветка выделенной строки */
.entry-item.selected-row {
    background-color: rgba(181, 130, 85, 0.2);
}

/* Убираем пустое пространство (gap) только для панели массовых действий, 
   чтобы кнопки распределились равномерно и разделители стояли точно посередине */
#bulk-actions {
    gap: 0;
}

/* Включаем относительное позиционирование для кнопок, 
   чтобы привязать к ним наши нарисованные линии */
#bulk-actions button {
    position: relative;
}

/* Рисуем вертикальную линию слева от каждой кнопки, КРОМЕ первой (ALL) */
#bulk-actions button:not(:first-child)::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    /* Опускаем линию немного вниз, чтобы центрировать */
    height: 50%;
    /* Линия будет занимать ровно половину высоты кнопки */
    width: 0.1rem;
    /* Толщина разделителя */
    background-color: #ccc;
    /* Цвет линии (можно поменять на #b58255, если хочешь в цвет рамки) */
}

#wheel-texture {
    position: absolute;
    /* top: 0;
    left: 0;
    width: 100%;
    height: 100%;  Если нужно, чтобы текстура была и на бордере */

    /* Центрируем уменьшенный слой: 15 единиц от 500 — это ровно 3% */
    top: 3%;
    left: 3%;
    /* Уменьшаем размер слоя до внутренней границы рамки */
    width: 94%;
    height: 94%;
    border-radius: 50%;
    /* Делаем текстуру круглой */
    background-color: rgba(255, 255, 255, 0.09);
    /*Цвет самой текстуры */
    /* Используем SVG как маску прозрачности */
    -webkit-mask-image: url('/image/Sectorbg.svg');
    mask-image: url('/image/Sectorbg.svg');
    -webkit-mask-size: cover;
    mask-size: cover;

    pointer-events: none;
    z-index: 5;
}