/* === Стили экрана трансляции (резиновый интерфейс) === */

.display-body {
    color: #f8fafc;
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
}
.display-body.display-vote-page {
    padding-top: 52px; /* место под фиксированный header */
    scroll-padding-top: 60px; /* при скролле контент не уходит под header */
}

/* Обёртка масштабирования (масштаб задаётся в админке) */
.display-scale-wrapper {
    position: relative;
    transform-origin: 0 0;
    transform: scale(var(--display-scale, 1));
    width: calc(100% / var(--display-scale, 1));
    height: calc(100vh / var(--display-scale, 1));
    min-height: calc(100vh / var(--display-scale, 1));
    box-sizing: border-box;
}

.display-body a {
    text-decoration: none;
}

/* Страницы vote и suggest: прокрутка на ПК без полосы прокрутки */
@media (min-width: 769px) {
    .display-body.display-vote-page,
    .display-body.page-suggest {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .display-body.display-vote-page::-webkit-scrollbar,
    .display-body.page-suggest::-webkit-scrollbar {
        display: none;
    }
    .display-body.display-vote-page .display-scale-wrapper,
    .display-body.page-suggest .display-scale-wrapper {
        height: auto;
        min-height: auto;
    }
    .display-body.display-vote-page .display-vote-form .display-screen,
    .display-body.page-suggest .display-vote-form .display-screen {
        height: auto;
        min-height: auto;
        padding-bottom: 2rem;
    }
    .display-body.display-vote-page .display-vote-form .display-content,
    .display-body.page-suggest .display-vote-form .display-content {
        min-height: auto;
    }
}

.display-screen {
    max-width: 1920px;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0 auto;
    padding: 2rem clamp(1rem, 3vw, 3rem);
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.display-title {
    font-size: clamp(1.5rem, 4vw, 2.8rem);
    font-weight: 800;
    color: #fff;
    margin: 0;
    text-align: center;
}
/* Хедер — адаптивный */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.97);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    height: 52px;
}
.header__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.header__brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
}
.header__brand:hover {
    color: #fff !important;
    opacity: 0.9;
}
.header__nav {
    display: flex;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
}
.header__links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}
.header__link {
    display: inline-block;
    padding: 0.35rem 0.6rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 6px;
    white-space: nowrap;
    transition: color 0.2s, background 0.2s;
}
.header__link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}
.header__link--active {
    color: #fff;
    background: rgba(129, 140, 248, 0.25);
}
.header__link--active:hover {
    background: rgba(129, 140, 248, 0.35);
}
.header__user-wrap {
    position: relative;
    margin-left: 0.5rem;
}
.header__user-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.6rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #94a3b8;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.2s, background 0.2s;
}
.header__user-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}
.header__dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    min-width: 200px;
    padding: 0.25rem 0;
    list-style: none;
    background: #1e293b;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    z-index: 200;
}
.header__user-wrap:hover .header__dropdown,
.header__user-wrap.is-open .header__dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.header__dropdown a {
    display: block;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    color: #e2e8f0;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.2s;
}
.header__dropdown a:hover {
    background: rgba(129, 140, 248, 0.2);
    color: #fff;
}
.header__burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 8px;
    flex-shrink: 0;
}
.header__burger:hover {
    background: rgba(255, 255, 255, 0.1);
}
.header__burger-line {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.25s, opacity 0.25s;
}
.header.is-open .header__burger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.header.is-open .header__burger-line:nth-child(2) {
    opacity: 0;
}
.header.is-open .header__burger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}
.header__mobile-menu {
    display: none;
}
.display-scale-wrapper.display-vote-page {
    padding-top: 0; /* отступ уже на body */
    display: flex;
    flex-direction: column;
}
.display-footer {
    flex-shrink: 0;
    margin-top: auto;
    padding: 0.5rem clamp(1rem, 4vw, 1.5rem);
    background: transparent;
    border-top: none;
}
.display-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: nowrap;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem 1rem;
}
.display-footer-left {
    font-size: 0.75rem;
    color: #64748b;
    display: inline-flex;
    align-items: center;
}
.display-footer-right {
    display: inline-flex;
    align-items: center;
    opacity: 0.7;
}
.display-footer-right a {
    font-size: 0.75rem;
    color: #64748b;
    text-decoration: none;
    transition: color 0.2s;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}
.display-footer-right a:hover {
    color: #94a3b8;
}
.display-btn-home {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    background: #f8fafc;
    border-radius: 10px;
    transition: background 0.2s, color 0.2s;
}
.display-btn-home:hover {
    background: #e2e8f0;
    color: #0f172a;
}

/* Контент: левая фиксирована, правая прокручивается */
.display-content {
    display: flex;
    gap: 0;
    flex: 1;
    align-items: stretch;
    min-width: 0;
    min-height: 0;
    height: 100%;
}

.display-left {
    flex: 0 0 auto;
    width: 100%;
    max-width: 35%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(0.5rem, 1.5vw, 1rem);
    padding-right: clamp(1.25rem, 2.5vw, 3rem);
    box-sizing: border-box;
}

.display-right {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.display-right-scroll {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}
.display-right-scroll::-webkit-scrollbar {
    display: none;
}

/* Вопрос опроса — в правой части */
.display-question {
    font-size: clamp(1.25rem, 2.5vw, 2rem);
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.3;
}
.display-question-num {
    color: #94a3b8;
    font-weight: 600;
    margin-right: 0.35em;
}

/* QR-блок — минимальная высота, ссылка прижата к низу на всю ширину */
.qr-block {
    display: flex;
    flex-direction: column;
    background: #fff;
    padding: 0;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    border-radius: 16px;
}
.qr-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    margin: 0 auto 0;
}
.qr-hint {
    font-size: clamp(0.6rem, 1.2vw, 0.75rem);
    color: #0f172a;
    margin: 0.15rem 0 0;
    padding: 0 0.5rem 0.35rem;
    line-height: 1.2;
}
.qr-vote-link {
    display: block;
    width: 100%;
    min-width: 0;
    margin: 0;
    margin-top: auto;
    box-sizing: border-box;
    font-size: clamp(0.55rem, 1.2vw, 0.7rem);
    color: #6366f1;
    word-break: break-all;
    overflow-wrap: anywhere;
    font-weight: 600;
    text-decoration: none;
    background: #eef2ff;
    border-radius: 8px;
    padding: 0.35rem 0.5rem;
}
.qr-vote-link:hover {
    text-decoration: none;
    color: #818cf8;
}

/* Блок статистики — карточка: голоса слева, время справа (всегда в таком виде) */
.display-stats-block {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: stretch;
    gap: 1.5rem;
    padding: 1.25rem 1.75rem;
    background: #1f2937;
    width: 100%;
    box-sizing: border-box;
    border-radius: 16px;
    box-shadow: 0 0px 10px rgba(0, 0, 0, 0.1);
}

/* Счётчик голосов — левая секция */
.vote-counter-display {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex: 1;
    min-width: 0;
}
.counter-value {
    display: block;
    font-size: clamp(1.25rem, 3.5vw, 3.2rem);
    font-weight: 900;
    color: #93c5fd;
    line-height: 1;
    transition: all 0.3s ease;
}
.counter-label {
    display: block;
    margin-top: 0.25em;
    font-size: clamp(0.6rem, 1.2vw, 0.9rem);
    color: #e5e7eb;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Таймер голосования — правая секция */
.timer-display {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    flex: 1;
    min-width: 0;
}
.timer-label {
    display: block;
    font-size: clamp(0.6rem, 1.2vw, 0.9rem);
    color: #e5e7eb;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.timer-value {
    display: block;
    margin-top: 0.25em;
    font-size: clamp(1.1rem, 2.8vw, 2.5rem);
    font-weight: 700;
    color: #34d399;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* Таблица результатов — умещается в половину области голосования */
.results-table {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
    align-items: flex-start;
}
.result-row {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    min-width: 0;
    border-radius: 12px;
    padding: 1rem clamp(0.75rem, 2vw, 1.5rem);
    flex-wrap: wrap;
    gap: 0.5rem;
    overflow: hidden;
    --row-bg: rgba(129, 140, 248, 0.35);
    background: var(--row-bg);
    border: 2px solid var(--row-bg);
    transition: width 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}
.result-row.result-row-animate {
    animation: result-row-in 0.4s ease-out forwards;
}
@keyframes result-row-in {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}
/* Заливка слева направо в процентах (--width-pct) — плавная анимация */
.result-row::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--width-pct, 5%);
    background: rgba(129, 140, 248, 0.28);
    z-index: 0;
    transition: width 0.5s ease-out;
}
.result-row:hover::before {
    background: rgba(129, 140, 248, 0.38);
}
.result-row > * {
    position: relative;
    z-index: 1;
}
.result-row .result-count {
    color: #818cf8;
}
.result-text {
    flex: 1 1 120px;
    min-width: 0;
    font-size: clamp(1.15rem, 2.2vw, 1.5rem);
    font-weight: 500;
    word-break: break-word;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
.result-count {
    font-size: 1.6rem;
    margin: 0 1.5rem;
    color: #818cf8;
    min-width: 60px;
    text-align: right;
}
.result-percent {
    font-size: 1.1rem;
    color: #94a3b8;
    min-width: 60px;
    text-align: right;
}

/* Активный опрос: показываем только варианты ответов, без количества и процентов (счётчик в display-stats-block всегда виден) */
.display-screen[data-poll-status="active"] .result-row::before {
    width: 0 !important;
}
.display-screen[data-poll-status="active"] .result-count,
.display-screen[data-poll-status="active"] .result-percent {
    display: none;
}

/* Активный опрос: не выделять лидирующий ответ до завершения опроса */
.display-screen[data-poll-status="active"] .result-row.result-row-winner::before {
    background: rgba(129, 140, 248, 0.28) !important;
}
.display-screen[data-poll-status="active"] .result-row.result-row-winner {
    border: 2px solid rgba(129, 140, 248, 0.35);
    background: rgba(129, 140, 248, 0.35);
}

/* Строка с макс. голосами — выделение зелёным (лидер / победитель) — только после завершения опроса */
.result-row.result-row-winner::before {
    background: rgba(52, 211, 153, 0.5);
}
.result-row.result-row-winner {
    --winner-bg: rgba(52, 211, 153, 0.5);
    border: 2px solid var(--winner-bg);
    background: var(--winner-bg);
}
.result-row.result-row-winner .result-count,
.result-row.result-row-winner .result-percent {
    color: #fff;
}

/* Список сообщений (режим «только свой ответ») */
.display-messages-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
}
.display-message-item {
    padding: 1rem 1.25rem;
    border-radius: 12px;
    background: var(--display-message-bg, rgba(129, 140, 248, 0.15));
    border: var(--display-message-border, none);
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.display-message-item.display-message-item-new {
    animation: display-message-slide-in 0.6s ease-out forwards;
}
@keyframes display-message-slide-in {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.display-message-text {
    flex: 1;
    font-size: clamp(1.15rem, 2.2vw, 1.5rem);
    line-height: 1.5;
    color: #e2e8f0;
    word-break: break-word;
}
.display-messages-empty {
    color: #64748b;
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    padding: 2rem;
    text-align: center;
    margin: 0;
}

/* Кликабельная строка «Свой ответ» */
.result-row-custom-clickable {
    cursor: pointer;
}
.result-row-custom-clickable:hover::before {
    background: rgba(129, 140, 248, 0.5) !important;
}

/* Оверлей со списком ответов пользователей */
.display-custom-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 1.5rem;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.9);
}
.display-custom-modal {
    margin: auto;
    background: #1e293b;
    border-radius: 16px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}
.display-custom-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.display-custom-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
}
.display-custom-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}
.display-custom-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}
.display-custom-body {
    padding: 1.5rem 2rem;
    overflow-y: auto;
}
.display-custom-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.display-custom-list li {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #e2e8f0;
    font-size: 3rem;
    line-height: 1.5;
}
.display-custom-list li:last-child {
    border-bottom: none;
}
.display-custom-num {
    display: inline-block;
    min-width: 5rem;
    color: #818cf8;
    font-weight: 600;
    font-size: 3rem;
}
.display-custom-empty {
    color: #94a3b8;
    margin: 0;
    font-size: 3rem;
}

/* Оверлей «Свой ответ» — адаптив для мобильных */
@media (max-width: 768px) {
    .display-custom-overlay {
        align-items: center;
        padding: 1rem;
    }
    .display-custom-modal {
        margin: auto;
        max-height: 85vh;
        max-height: 85dvh;
        border-radius: 16px;
    }
    .display-custom-header {
        padding: 1rem 1.25rem;
    }
    .display-custom-header h3 {
        font-size: 1.2rem;
    }
    .display-custom-close {
        font-size: 1.75rem;
        padding: 0.5rem;
        min-width: 44px;
        min-height: 44px;
    }
    .display-custom-body {
        padding: 1rem 1.25rem;
    }
    .display-custom-list li {
        font-size: 1.25rem;
        padding: 0.75rem 0;
    }
    .display-custom-num {
        min-width: 2.5rem;
        font-size: 1.25rem;
    }
    .display-custom-empty {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .display-custom-modal {
        max-height: 90vh;
        max-height: 90dvh;
    }
    .display-custom-list li {
        font-size: 1.1rem;
    }
    .display-custom-num {
        min-width: 2rem;
        font-size: 1.1rem;
    }
}

/* Скрытие блока по статусу (переключение через SSE) */
.display-block-hidden {
    display: none !important;
}

/* Завершено — блок того же размера, что и QR-код */
.display-finished,
#display-finished-block {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    aspect-ratio: 1;
    min-height: 250px;
    box-sizing: border-box;
    border: 3px solid #f59e0b;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.02) 100%);
}
.display-finished h2 {
    font-size: clamp(1rem, 2.2vw, 2.35rem);
    color: #f59e0b;
    margin: 0;
    font-weight: 600;
    text-transform: uppercase;
}

/* Анимация обновления счётчика */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}
.counter-pulse {
    animation: pulse 0.3s ease;
}

/* Анимация при новом голосе: "+1 голос" по центру блока, вылетает снизу */
@keyframes vote-plus-one {
    0% {
        opacity: 0;
        transform: translate(-50%, 80px);
    }
    12% {
        opacity: 1;
        transform: translate(-50%, 0);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -60px);
    }
    85% {
        opacity: 1;
        transform: translate(-50%, -80px);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -100px);
    }
}
@keyframes vote-confetti-fly {
    0% {
        opacity: 0;
        transform: translate(0, 0) rotate(0deg);
    }
    20% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(var(--dx, 0), var(--dy, 0)) rotate(720deg);
    }
}

/* Список опросов для выбора экрана — всё по центру */
.display-polls-list {
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
}
.display-polls-ul {
    list-style: none;
    margin: 0;
    margin-top: 1.5rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
}
.display-polls-ul li {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.display-poll-num {
    flex-shrink: 0;
    min-width: 3rem;
    color: #94a3b8;
    font-weight: 600;
    margin: 0;
}
.display-poll-link .display-poll-num {
    color: #e2e8f0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: auto;
    padding: 0.2rem 0.55rem;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.12);
}
.display-poll-link:hover .display-poll-num {
    color: #fff;
    background: rgba(255, 255, 255, 0.18);
}
.display-poll-link {
    color: #c7d2fe;
    text-decoration: none;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    transition: background 0.2s, color 0.2s;
}
.display-poll-link:hover {
    background: rgba(129, 140, 248, 0.25);
    color: #fff;
}
.display-poll-status {
    color: #64748b;
    font-size: 1rem;
}
/* Пустое состояние — по центру экрана по вертикали и горизонтали */
.display-empty-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    text-align: center;
}
.display-empty-icon {
    display: block;
    color: rgba(148, 163, 184, 0.5);
    line-height: 0;
}
.display-empty {
    color: #94a3b8;
    font-size: 1.25rem;
    margin: 0;
}

/* Экран «Голосований нет» (closed) — занимает весь viewport */
.display-body:has(.display-screen-closed) {
    overflow: hidden !important;
    height: 100vh;
    height: 100dvh;
}
.display-screen-closed {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 2rem;
    box-sizing: border-box;
}
.display-screen-closed .display-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.display-closed-block {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    text-align: center;
}
.display-closed-block .display-empty-icon {
    color: rgba(148, 163, 184, 0.5);
}
.display-closed-logo {
    display: block;
    width: 200px;
    height: 200px;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.6));
}
.display-closed-title {
    display: inline-block;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    padding: 0.35em 0.6em;
    background: rgba(248, 250, 252, 0.9);
    border-radius: 8px;
}
.display-closed-text {
    color: #64748b;
    font-size: 1rem;
    margin: 0;
}

/* Страница «Опрос не найден» */
.display-not-found-title {
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    font-weight: 700;
    color: #f87171;
    margin: 0;
}
.display-back-link {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(129, 140, 248, 0.25);
    color: #c7d2fe;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s, color 0.2s;
}
.display-back-link:hover {
    background: rgba(129, 140, 248, 0.4);
    color: #fff;
}

/* Адаптив: планшеты */
@media (max-width: 1024px) {
    .display-left {
        padding: clamp(0.5rem, 2vw, 1rem);
        padding-right: clamp(1rem, 3vw, 2rem);
    }
    .qr-block,
    .display-finished {
        max-width: 100%;
    }
    .qr-image {
        max-width: 100%;
        max-height: 100%;
    }
}

/* Адаптив: узкие экраны */
@media (max-width: 768px) {
    .display-body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    .display-body::-webkit-scrollbar {
        display: none;
    }
    .display-scale-wrapper {
        height: auto;
        min-height: 100vh;
    }
    /* Форма голосования: без scale, контент сверху */
    .display-scale-wrapper.display-vote-page {
        transform: none !important;
        width: 100% !important;
        height: auto !important;
        min-height: 100vh;
    }
    .display-vote-page .display-vote-form .display-content {
        justify-content: flex-start;
        align-items: stretch;
        min-height: auto;
    }
    .display-vote-page .display-vote-form .display-screen {
        min-height: auto;
        padding: max(1rem, env(safe-area-inset-top)) clamp(1rem, 4vw, 1.5rem) max(1.5rem, env(safe-area-inset-bottom));
    }
    .display-screen {
        height: auto;
        min-height: 100vh;
        padding: clamp(1rem, 4vw, 1.5rem);
        padding-bottom: 0;
    }
    .display-content {
        flex-direction: column;
        align-items: stretch;
        height: auto;
    }
    .display-screen-closed {
        height: 100vh;
        height: 100dvh;
        padding: 1.5rem;
    }
    .display-screen-closed .display-content {
        align-items: center;
        justify-content: center;
    }
    .display-right {
        flex: none;
        padding-left: 0;
        padding-top: clamp(1rem, 4vw, 1.5rem);
    }
    .display-right-scroll {
        overflow: visible;
        flex: none;
    }
    .display-left {
        width: 100%;
        max-width: none;
        padding: 0 0 clamp(1rem, 4vw, 1.5rem);
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        gap: 0.75rem;
    }
    /* .qr-block, .display-finished { max-width: min(100%, 280px); } */
    .qr-block {
        padding: 0;
    }
    .qr-image {
        max-width: 100%;
        max-height: 100%;
    }
    .display-stats-block {
        padding: 1rem 1.25rem;
        gap: 1.25rem;
    }
    .display-polls-ul {
        font-size: 1.2rem;
    }
    .display-footer-inner {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        text-align: center;
    }
    /* Хедер: бургер на мобильном */
    .header__burger {
        display: flex;
    }
    .header__nav--desktop {
        display: none !important;
    }
    .header__mobile-menu {
        display: flex;
        position: fixed;
        top: 52px;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        flex-direction: column;
        background: #0f172a;
        padding: 1.5rem 0;
        margin: 0;
        overflow-y: auto;
        z-index: 9998;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .header.is-open ~ .header__mobile-menu {
        transform: translateX(0);
    }
    .header__mobile-links {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
    }
    .header__mobile-links li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    .header__mobile-link {
        display: block;
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        font-weight: 500;
        color: #e2e8f0;
        text-decoration: none;
        text-transform: uppercase;
        transition: background 0.2s, color 0.2s;
    }
    .header__mobile-link:hover,
    .header__mobile-link--active {
        background: rgba(129, 140, 248, 0.2);
        color: #fff;
    }
}

/* === Форма голосования в дизайне дисплея === */
.display-vote-form .display-content {
    justify-content: center;
    align-items: center;
}
.display-vote-form .display-screen {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
}
.display-vote-main {
    width: 100%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
}
.display-vote-form .display-question {
    font-size: clamp(1.5rem, 3.5vw, 2.5rem);
    text-align: center;
    margin-bottom: 0;
    scroll-margin-top: 70px;
}
.display-vote-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.display-vote-option {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border: 2px solid rgba(129, 140, 248, 0.5);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    background: rgba(129, 140, 248, 0.08);
}
.display-vote-option:hover {
    border-color: rgba(129, 140, 248, 0.8);
    background: rgba(129, 140, 248, 0.15);
}
.display-vote-option input[type="radio"] {
    width: 28px;
    height: 28px;
    margin-right: 1rem;
    accent-color: #818cf8;
    flex-shrink: 0;
}
.display-vote-option input[type="radio"]:checked + .option-text {
    font-weight: 700;
}
.display-vote-option .option-text {
    font-size: clamp(1.15rem, 2.2vw, 1.5rem);
    color: #e2e8f0;
    line-height: 1.4;
}
.display-vote-custom-wrap {
    margin-top: 0.5rem;
}
.display-vote-custom-inner {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.display-vote-custom-input {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: clamp(1rem, 1.8vw, 1.25rem);
    color: #e2e8f0;
    background: rgba(30, 41, 59, 0.8);
    border: 2px solid rgba(129, 140, 248, 0.5);
    border-radius: 12px;
    resize: vertical;
    min-height: 100px;
}
.display-vote-custom-input::placeholder {
    color: #64748b;
}
.display-vote-char-count {
    font-size: 0.9rem;
    color: #94a3b8;
}
.display-vote-submit {
    display: block;
    margin: 1.5rem auto 0;
    padding: 1rem 2rem;
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: 700;
    color: #0f172a;
    background: #818cf8;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    min-width: 200px;
}
.display-vote-submit:hover:not(:disabled) {
    background: #6366f1;
}
.display-vote-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.display-vote-submit.loading {
    opacity: 0.8;
    cursor: wait;
}
.display-vote-result {
    text-align: center;
    padding: 2rem;
}
.display-vote-result-icon {
    font-size: 4rem;
    color: #34d399;
    margin-bottom: 0.5rem;
}
.display-vote-result h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: #fff;
    margin: 0;
}
.display-vote-error {
    padding: 1rem 1.25rem;
    background: rgba(248, 113, 113, 0.2);
    border: 2px solid #f87171;
    border-radius: 12px;
    color: #fca5a5;
    font-size: 1.1rem;
}
.display-vote-message {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: #94a3b8;
    margin: 0;
}
.display-vote-results {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}
.display-vote-result-row,
.display-vote-results-bars .display-vote-result-bar {
    --row-bg: rgba(129, 140, 248, 0.35);
    background: var(--row-bg);
    border: 2px solid var(--row-bg);
}
.display-vote-result-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-radius: 12px;
}
.display-vote-result-row .result-text {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    color: #e2e8f0;
}
.display-vote-result-row .result-count {
    font-size: 1.2rem;
    color: #818cf8;
    font-weight: 600;
}

/* Бейдж «Голосование завершено» — как на дисплее: жёлтая подложка, белый текст */
.display-vote-badge {
    display: block;
    width: fit-content;
    margin: 0 auto 1.5rem;
    padding: 0.5rem 1.25rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.35) 0%, rgba(245, 158, 11, 0.2) 100%);
    border: none;
    border-radius: 10px;
    font-size: clamp(1.15rem, 2.2vw, 1.5rem);
    font-weight: 600;
    color: #fff;
    text-align: center;
}

/* Варианты с прогресс-барами — цвета как на дисплее */
.display-vote-results-bars .display-vote-result-bar {
    padding: 0;
    overflow: hidden;
}
.display-vote-results-bars .result-bar-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}
.display-vote-results-bars .result-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: rgba(129, 140, 248, 0.28);
    border-radius: 10px 0 0 10px;
    transition: width 0.3s ease;
}
.display-vote-results-bars .result-row-winner .result-bar-fill {
    background: rgba(52, 211, 153, 0.5);
}
.display-vote-results-bars .result-row-winner {
    border-color: rgba(52, 211, 153, 0.5);
    background: rgba(52, 211, 153, 0.5);
}
.display-vote-results-bars .result-row-winner .result-count {
    color: #fff;
}
.display-vote-results-bars .result-text {
    position: relative;
    z-index: 1;
    padding: 1rem 1.25rem;
    display: block;
}
.display-vote-results-bars .result-count {
    flex-shrink: 0;
    margin-left: 1rem;
    padding-right: 1.25rem;
    color: #818cf8;
}

/* Flash сообщения */
.display-flash {
    margin: 1rem clamp(1rem, 4vw, 2rem);
    padding: 1rem 1.25rem;
    border-radius: 12px;
    font-size: clamp(1rem, 1.5vw, 1.15rem);
}
.display-flash-success {
    background: rgba(52, 211, 153, 0.2);
    border: 2px solid #34d399;
    color: #a7f3d0;
}
.display-flash-error {
    background: rgba(248, 113, 113, 0.2);
    border: 2px solid #f87171;
    color: #fca5a5;
}

/* Главная — список опросов */
.display-home-logo-wrap {
    text-align: center;
    margin-bottom: 1.5rem;
}
.display-home-logo {
    display: block;
    height: 120px;
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.6));
}
/* Пустое состояние: логотип и текст по центру по вертикали */
.display-vote-form .display-screen:has(.display-home-no-polls) {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.display-vote-form .display-screen:has(.display-home-no-polls) .display-content {
    flex: 1;
    flex-direction: column;
    min-height: 0;
}
.display-vote-main.display-home-no-polls {
    flex: 1;
    justify-content: center;
    align-items: center;
    display: flex;
    flex-direction: column;
}
.display-vote-main.display-home-no-polls .display-nav-links {
    margin-top: auto;
}
.display-home-empty {
    text-align: center;
    padding: 2rem;
}
.display-home-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.display-home-link {
    display: block;
    padding: 1.25rem 1.5rem;
    background: rgba(129, 140, 248, 0.12);
    border: 2px solid rgba(129, 140, 248, 0.5);
    border-radius: 12px;
    color: #c7d2fe;
    text-decoration: none;
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    transition: all 0.2s;
}
.display-home-link:hover {
    background: rgba(129, 140, 248, 0.25);
    border-color: rgba(129, 140, 248, 0.8);
    color: #fff;
}

/* Навигационные ссылки */
.display-nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
/* Большие экраны: отступ снизу после «Задать вопрос» */
@media (min-width: 769px) {
    .display-vote-form .display-nav-links {
        padding-bottom: clamp(3rem, 8vh, 6rem);
    }
    .display-vote-form .display-vote-main {
        max-width: 900px;
        margin: 0 auto;
    }
}
.display-nav-link {
    padding: 0.6rem 1.25rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.2s, color 0.2s;
}
.display-nav-link:hover {
    background: rgba(129, 140, 248, 0.25);
    color: #fff;
}

/* Форма «Задать вопрос» */
.display-suggest-intro {
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    color: #94a3b8;
    margin: 0 0 1.5rem;
    line-height: 1.5;
}
.display-form-group {
    margin-bottom: 1.5rem;
}
.display-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    color: #e2e8f0;
}
.display-input {
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    color: #e2e8f0;
    background: rgba(30, 41, 59, 0.8);
    border: 2px solid rgba(129, 140, 248, 0.5);
    border-radius: 12px;
}
.display-input::placeholder {
    color: #64748b;
}
.display-input:focus {
    outline: none;
    border-color: #818cf8;
}
.display-char-count {
    font-size: 0.9rem;
    color: #64748b;
}
.display-option-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.display-option-row .display-input {
    flex: 1;
}
.display-btn-remove {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: rgba(248, 113, 113, 0.2);
    border: 2px solid #f87171;
    border-radius: 10px;
    color: #fca5a5;
    font-size: 1.5rem;
    cursor: pointer;
    transition: background 0.2s;
}
.display-btn-remove:hover {
    background: rgba(248, 113, 113, 0.4);
}
.display-btn-add {
    margin-top: 0.5rem;
    padding: 0.6rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 2px dashed rgba(129, 140, 248, 0.5);
    border-radius: 10px;
    color: #94a3b8;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}
.display-btn-add:hover {
    background: rgba(129, 140, 248, 0.2);
    color: #fff;
}
.display-checkbox-label {
    display: inline-flex;
    align-items: center;
    flex-direction: row;
    gap: 0.6rem;
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    color: #e2e8f0;
    cursor: pointer;
    user-select: none;
}
.display-checkbox-label input {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    margin: 0;
    vertical-align: middle;
    accent-color: #818cf8;
    cursor: pointer;
}
.display-form-hint {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.9rem;
    color: #64748b;
}
.display-form-actions {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 319px) {
    .display-left {
        padding-bottom: 1rem;
    }
    .qr-block,
    .display-finished {
        max-width: 100%;
    }
    .qr-image {
        max-width: 100%;
        max-height: 100%;
    }
    /* Карточка статистики: на экране <320px секции в колонку; при 320px и выше — как на больших экранах */
    .display-stats-block {
        flex-wrap: wrap;
        flex-direction: row;
        justify-content: space-around;
        padding: 1rem 1.25rem;
        gap: 1rem;
    }
    .vote-counter-display,
    .timer-display {
        min-width: 120px;
    }
}
