/* =============================================================================
   Стартовый экран «маяк»
   Подключается только когда ANON_START_THEME = 'beacon'.
   Ничего из общего style.css не переопределяет глобально — все правила
   живут внутри .beacon, поэтому чат и админка выглядят как раньше.

   Палитра: #020611 фон, #ff7b00 / #ffb347 / #ffcf8b свет, #56bcf9 холодный блик.

   Заголовок объявлен через #startView: в style.css есть правила «#startView h1»
   и «#startView h1 span», у них специфичность по id, и без префикса они
   перебивали размер и красили вторую строку в синий.
   ============================================================================= */

.beacon {
    --beam: #ff7b00;
    --beam-soft: #ffb347;
    --beam-pale: #ffcf8b;
    --cold: #56bcf9;
    --night: #020611;

    /* Отпечаток из style.css прижат к левому краю и уходит за экран
       (left: -425px, ширина 1615px). Его плотная часть — первые ~300px,
       поэтому текст начинается правее этой полосы. */
    --gutter: clamp(36px, 19vw, 300px);

    position: relative;
    isolation: isolate;
    overflow: hidden;
    /* svh — короткая мера: при видимых панелях браузера экран получался ниже
       окна, и под снимком оставалась полоса фона другого цвета. Похоже на два
       разных оформления на одной странице. dvh закрывает окно целиком. */
    min-height: 100svh;
    min-height: 100dvh;
    display: grid;
    align-items: center;
    background: var(--night);
    font-family: 'Montserrat', 'Segoe UI', Roboto, Arial, sans-serif;
}

/* --------------------------------------------------- экран во всю ширину
   Стартовый экран лежит внутри .shell.site-container, у которого ширина
   ограничена 1170px и есть вертикальные отступы. Атрибут на <body> ставится
   в index.php только когда открыт именно стартовый экран, поэтому чат,
   экран ника и админка сохраняют обычный контейнер.
   -------------------------------------------------------------------- */

body[data-start-theme="beacon"] {
    position: relative;
}

body[data-start-theme="beacon"] .shell {
    min-height: 0;
    padding: 0;
    width: 100%;
    max-width: none;
    margin: 0;
}

/* Шапка с названием ложится поверх фотографии, без своей плашки. */
body[data-start-theme="beacon"] .site-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 3;
    background: transparent;
    border-bottom: 0;
    box-shadow: none;
}

body[data-start-theme="beacon"] .site-top .brand strong {
    color: #fff;
    letter-spacing: .16em;
    font-size: 15px;
    font-weight: 700;
    text-shadow: 0 6px 24px rgba(0, 0, 0, .7);
}

body[data-start-theme="beacon"] .site-top .site-link {
    border-color: rgba(255, 255, 255, .26);
    color: rgba(255, 255, 255, .82);
    font-size: 11px;
    letter-spacing: .16em;
    text-transform: uppercase;
}

body[data-start-theme="beacon"] .site-top .site-link:hover {
    border-color: rgba(255, 179, 71, .7);
    background: rgba(255, 123, 0, .14);
    color: #fff;
}

#startView.beacon {
    border-radius: 0;
}

/* --------------------------------------------------------------- логотип */

.beacon__brand {
    position: absolute;
    left: clamp(16px, 3vw, 34px);
    top: clamp(14px, 2.4vw, 26px);
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: opacity .15s;
}

.beacon__brand:hover { opacity: .82; }

/* Знак прозрачный и светящийся: ни рамки, ни подложки — они бы обрезали ореол.
   Размер вдвое больше прежнего, чтобы он читался как знак, а не как иконка. */
.beacon__brand img {
    width: clamp(64px, 6.4vw, 92px);
    height: auto;
    border-radius: 0;
    box-shadow: none;
    display: block;
}

.beacon__brand span {
    color: rgba(255, 255, 255, .92);
    font-size: calc(12px * var(--ui));
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    text-shadow: 0 2px 12px rgba(0, 0, 0, .6);
}

@media (max-width: 520px) {
    .beacon__brand span { display: none; }
    .beacon__brand img { width: 58px; }
}

/* ------------------------------------------------ сохранить и поделиться
   Короткая строка поверх снимка: текст, знак закладки и действие «Поделиться». */

.beacon-spread {
    position: absolute;
    top: 22px;
    right: 112px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 8px;
}

.beacon-spread__button {
    min-height: 26px;
    padding: 4px 0;
    border: 0;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: rgba(255, 255, 255, .86);
    box-shadow: none;
    font: inherit;
    font-size: calc(11px * var(--ui));
    font-weight: 650;
    white-space: nowrap;
    text-underline-offset: 3px;
    cursor: pointer;
    transition: color .16s ease;
}

.beacon-spread__button:hover {
    background: transparent;
    color: #fff;
    text-decoration: underline;
}

.beacon-spread__button--bookmark {
    width: 26px;
    flex: 0 0 26px;
    padding: 4px;
    color: var(--beam-pale);
}

.beacon-spread__button--bookmark svg {
    width: 17px;
    height: 17px;
    display: block;
}

.beacon-spread__button--bookmark:hover { text-decoration: none; }

.beacon-spread__button--share {
    background: transparent;
    color: var(--beam-pale);
}

.beacon-spread__button--share:hover {
    background: transparent;
    color: #fff;
}

.beacon-spread__button:focus-visible {
    outline: 0;
    box-shadow: none;
    text-decoration: underline;
}

.beacon-spread__button--bookmark:focus-visible { text-decoration: none; color: #fff; }

.beacon-spread__separator {
    color: rgba(255, 255, 255, .38);
    font-size: 12px;
    line-height: 1;
}

@media (max-width: 520px) {
    .beacon-spread {
        top: 24px;
        right: 108px;
        gap: 6px;
    }

    .beacon-spread__button { font-size: 11px; }
}

@media (max-width: 340px) {
    .beacon-spread {
        right: 108px;
        gap: 6px;
    }
}

/* ------------------------------------------- модалки «О проекте» и «Поделиться» */

.about-modal {
    display: grid;
    gap: 20px;
}

.about-modal__lead {
    margin: 0;
    color: rgba(255, 255, 255, .9);
    font-size: calc(15px * var(--ui));
    line-height: 1.58;
}

.about-modal__benefits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.about-modal__benefits > div {
    min-width: 0;
    padding: 13px 12px;
    border: 1px solid rgba(255, 207, 139, .14);
    border-radius: 11px;
    background: rgba(255, 179, 71, .055);
}

.about-modal__benefits strong,
.about-modal__benefits span {
    display: block;
}

.about-modal__benefits strong {
    margin-bottom: 5px;
    color: #fff;
    font-size: calc(12px * var(--ui));
    line-height: 1.3;
}

.about-modal__benefits span {
    color: rgba(255, 255, 255, .62);
    font-size: calc(10.5px * var(--ui));
    line-height: 1.45;
}

.about-modal__section {
    display: grid;
    gap: 9px;
}

.about-modal__section h3 {
    margin: 0;
    color: var(--text, #fff);
    font-size: calc(16px * var(--ui));
    line-height: 1.3;
}

.about-modal__section p,
.about-modal__closing p {
    margin: 0;
    color: rgba(255, 255, 255, .68);
    font-size: calc(14px * var(--ui));
    line-height: 1.62;
}

.about-modal strong { color: var(--text, #fff); }

.about-link {
    color: var(--beam-pale, #ffcf8b);
    text-decoration: none;
    text-underline-offset: 3px;
}

.about-link:hover,
.about-link:focus-visible {
    outline: 0;
    color: #fff;
    text-decoration: underline;
}

.about-modal__closing {
    display: grid;
    gap: 13px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, .12);
}

.about-modal__actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.about-modal__action {
    min-height: 46px;
    padding: 9px 14px;
    border-radius: 10px;
    font: inherit;
    font-size: calc(12px * var(--ui));
    font-weight: 750;
    line-height: 1.25;
    cursor: pointer;
    transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease;
}

.about-modal__action--primary {
    border: 1px solid #ffb347;
    background: #ffb347;
    color: #241100;
}

.about-modal__action--secondary {
    border: 1px solid rgba(255, 255, 255, .24);
    background: rgba(255, 255, 255, .075);
    color: #fff;
}

.about-modal__action:hover,
.about-modal__action:focus-visible {
    outline: 0;
    transform: translateY(-1px);
}

.about-modal__action--primary:hover,
.about-modal__action--primary:focus-visible {
    border-color: #ffd08a;
    background: #ffd08a;
    color: #241100;
}

.about-modal__action--secondary:hover,
.about-modal__action--secondary:focus-visible {
    border-color: rgba(255, 207, 139, .55);
    background: rgba(255, 179, 71, .13);
}

.rules-modal {
    display: grid;
    gap: 22px;
}

.rules-modal__intro,
.rules-modal__contact {
    margin: 0;
}

.rules-modal__intro {
    color: rgba(255, 255, 255, .86);
    font-size: calc(14px * var(--ui));
    line-height: 1.6;
}

.rules-modal__section {
    display: grid;
    gap: 9px;
}

.rules-modal__section h3 {
    margin: 0;
    color: #fff;
    font-size: calc(15px * var(--ui));
    line-height: 1.35;
}

.rules-modal__section ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rules-modal__section li {
    position: relative;
    padding: 9px 0 9px 18px;
    border-top: 1px solid rgba(255, 255, 255, .075);
    color: rgba(255, 255, 255, .7);
    line-height: 1.58;
}

.rules-modal__section li::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 1px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #ffb347;
}

.rules-modal__section li:first-child {
    padding-top: 2px;
    border-top: 0;
}

.rules-modal__section li:first-child::before { top: 11px; }

.rules-modal__contact {
    padding: 13px 14px;
    border: 1px solid rgba(255, 179, 71, .18);
    border-radius: 10px;
    background: rgba(255, 179, 71, .07);
    color: rgba(255, 255, 255, .75);
    line-height: 1.55;
}

.rules-modal__contact a {
    color: #ffcf8b;
    text-underline-offset: 3px;
}

.about-telegram {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #ffcf8b;
    font-weight: 650;
    text-decoration: none;
    vertical-align: -3px;
}

.about-telegram svg {
    width: 18px;
    height: 18px;
    padding: 3px;
    border: 1px solid rgba(255, 207, 139, .24);
    border-radius: 6px;
    background: rgba(255, 179, 71, .08);
    fill: currentColor;
}

.about-telegram:hover { color: #fff; }

@media (min-width: 680px) {
    .modal--wide .rules-modal {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 28px;
    }

    .modal--wide .rules-modal__intro,
    .modal--wide .rules-modal__contact {
        grid-column: 1 / -1;
    }

    .modal--wide .rules-modal__section { gap: 7px; }
    .modal--wide .rules-modal__section li {
        padding-top: 6px;
        padding-bottom: 6px;
        line-height: 1.5;
    }
    .modal--wide .rules-modal__section li::before { top: 15px; }
    .modal--wide .rules-modal__section li:first-child::before { top: 11px; }
}


@media (max-width: 520px) {
    .about-modal { gap: 18px; }
    .about-modal__benefits { grid-template-columns: 1fr; gap: 6px; }
    .about-modal__benefits > div { padding: 10px 12px; }
    .about-modal__benefits strong { margin-bottom: 2px; }
    .about-modal__section p,
    .about-modal__closing p { font-size: 13px; line-height: 1.65; }
    .about-modal__actions { grid-template-columns: 1fr; }
    .rules-modal { gap: 19px; }
    .rules-modal__section li { font-size: 13px; }
}

/* ------------------------------------------------------------------ сцена */

.beacon__scene {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: var(--night);
}

/* Фотография маяка. Кадр держим по правому краю: маяк и луч справа,
   слева остаётся тёмная часть под текст. */
.beacon__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 50%;
}

/* Цифровой отпечаток из app.js своих стилей здесь не получает: геометрию,
   маску и свечение задаёт .digital-print в style.css, и он должен выглядеть
   ровно так, как задумано. Слой лежит внутри .beacon__scene с z-index 0,
   поэтому остаётся под текстом и не мешает читать заголовок. */

/* Затемнение только под текстом и гаснет, не доходя до маяка: раньше плотная
   пелена накрывала кадр целиком, включая башню и луч. Правая часть снимка теперь
   чистая, тёмный угол справа снизу убран. */
.beacon__vignette {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(2, 6, 17, .94) 0%, rgba(2, 6, 17, .72) 18%, rgba(2, 6, 17, .3) 34%, rgba(2, 6, 17, .08) 46%, transparent 56%),
        linear-gradient(0deg, rgba(2, 6, 17, .5) 0%, rgba(2, 6, 17, .12) 22%, transparent 34%);
}

/* Вернуть рисованную сцену вместо фото (маяк из SVG, луч и свечение
   градиентами) — в inc/start_beacon.php закомментирован соответствующий блок
   разметки в истории git: коммит «Add a switchable 'beacon' theme». */

/* --------------------------------------------------------------- контент */

/* Мягкое затемнение под текстом: отпечаток остаётся в полную силу, но
   заголовок и подписи читаются. Без рамок и краёв — размытое пятно. */
.beacon__content::before {
    content: "";
    position: absolute;
    left: calc(var(--gutter) * -.35);
    top: 4%;
    width: 78%;
    height: 92%;
    z-index: -1;
    background:
        radial-gradient(58% 46% at 26% 34%, rgba(2, 6, 17, .88) 0%, rgba(2, 6, 17, .52) 52%, transparent 78%),
        radial-gradient(52% 40% at 22% 74%, rgba(2, 6, 17, .8) 0%, rgba(2, 6, 17, .4) 54%, transparent 80%);
    filter: blur(6px);
    pointer-events: none;
}

.beacon__content {
    position: relative;
    z-index: 1;
    width: 100%;
    margin: 0;
    padding: clamp(60px, 7vh, 92px) clamp(28px, 5vw, 72px) clamp(46px, 6vh, 68px) var(--gutter);
    display: grid;
    grid-template-columns: minmax(0, 620px);
    align-items: center;
}

.beacon__eyebrow {
    margin: 0 0 18px;
    color: var(--beam-pale);
    font-size: calc(11px * var(--ui));
    font-weight: 500;
    letter-spacing: .38em;
    text-transform: uppercase;
}

#startView .beacon__title {
    margin: 0;
    display: grid;
    color: #fff;
    font-size: calc(clamp(40px, 6.4vw, 88px) * var(--ui));
    font-weight: 900;
    line-height: .92;
    letter-spacing: -.02em;
    text-transform: uppercase;
    text-wrap: balance;
}

#startView .beacon__title span {
    display: block;
    /* В style.css «h1 span» заливает текст синим градиентом через
       background-clip:text + text-fill-color:transparent. Одного color мало —
       глушим и заливку, и фон. */
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    -webkit-text-fill-color: #fff;
    color: #fff;
    filter: none;
    text-shadow: 0 18px 60px rgba(0, 0, 0, .6);
}

.beacon__lead {
    max-width: 44ch;
    margin: 18px 0 0;
    color: rgba(255, 255, 255, .64);
    font-size: calc(clamp(14px, 1.1vw, 16px) * var(--ui));
    font-weight: 300;
    line-height: 1.6;
}

.beacon__actions {
    margin-top: 26px;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
}

.beacon-btn {
    min-height: calc(52px * var(--ui));
    padding: 0 30px;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(100deg, var(--beam) 0%, var(--beam-soft) 100%);
    /* Без оранжевого ореола под кнопкой: он читался как свечение. */
    box-shadow: none;
    color: #241000;
    font-family: inherit;
    font-size: calc(12px * var(--ui));
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.beacon-btn svg {
    width: 17px;
    height: 17px;
}

.beacon-btn:hover {
    transform: translateY(-2px);
    box-shadow: none;
    filter: saturate(1.08);
}

.beacon-btn:disabled {
    opacity: .55;
    cursor: default;
    transform: none;
    box-shadow: none;
}

.beacon-link {
    min-height: 52px;
    padding: 0 22px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    color: rgba(255, 255, 255, .74);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .2em;
    text-transform: uppercase;
    text-decoration: none;
    transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.beacon-link:hover {
    border-color: rgba(255, 179, 71, .6);
    background: rgba(255, 123, 0, .1);
    color: #fff;
}

.beacon__facts {
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 34px;
}

.beacon__facts li {
    display: grid;
    gap: 3px;
    padding-left: 14px;
    border-left: 1px solid rgba(255, 179, 71, .34);
}

.beacon__facts strong {
    color: #fff;
    font-size: calc(14px * var(--ui));
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.beacon__facts span {
    color: rgba(255, 255, 255, .48);
    font-size: calc(11px * var(--ui));
    font-weight: 300;
    letter-spacing: .1em;
    text-transform: uppercase;
}

/* --------------------------------------------------------------- панель */

/* ------------------------------------------------- управление под фактами

   Никакой карточки: поле ника и переключатели просто проявляются под строкой
   «3 часа / по ссылке / пароль». Высота зарезервирована с самого начала —
   когда блок проявляется, ничего выше не сдвигается ни на пиксель.
   -------------------------------------------------------------------- */

.beacon__reveal {
    min-height: 122px;
    margin-top: 26px;
    display: grid;
    gap: 14px;
    align-content: start;
    justify-items: start;
}

.beacon__reveal > * {
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
    transition:
        opacity .42s ease,
        transform .58s cubic-bezier(.16, 1, .3, 1);
}

.beacon__reveal.is-open > * {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

/* Проявляются по очереди, сверху вниз. */
.beacon__reveal.is-open > *:nth-child(1) { transition-delay: .04s; }
.beacon__reveal.is-open > *:nth-child(2) { transition-delay: .14s; }
.beacon__reveal.is-open > *:nth-child(3) { transition-delay: .24s; }
.beacon__reveal.is-open > *:nth-child(4) { transition-delay: .32s; }

/* Кнопка остаётся на месте: меняется только подпись. */
.beacon-btn__label {
    display: inline-block;
}

/* ---- ник: строка, а не коробка ----
   В style.css есть «textarea, input» и «input» с рамкой, радиусом 10px и
   высотой 46px. Поэтому здесь сбрасываются именно длинные свойства и селектор
   усилен через #startView — иначе поле снова становится прямоугольником.
   -------------------------------------------------------------------- */

#startView .beacon-name {
    display: block;
    width: min(440px, 100%);
}

#startView .beacon-name input {
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    width: 100%;
    min-height: 0;
    height: auto;
    margin: 0;
    padding: 4px 0 10px;
    border-width: 0 0 1px;
    border-style: solid;
    border-color: transparent transparent rgba(255, 255, 255, .24);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #fff;
    font-family: inherit;
    font-size: calc(clamp(20px, 1.8vw, 26px) * var(--ui));
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -.01em;
    transition: border-bottom-color .25s ease;
}

#startView .beacon-name input::placeholder {
    color: rgba(255, 255, 255, .3);
    font-weight: 300;
    letter-spacing: 0;
}

#startView .beacon-name input:focus,
#startView .beacon-name input:focus-visible {
    outline: none;
    box-shadow: none;
    border-bottom-color: var(--beam-soft);
}

/* Подпись над строкой — маленькая, спокойная. */
#startView .beacon-name::before {
    content: "Ник";
    display: block;
    margin-bottom: 2px;
    color: rgba(255, 255, 255, .5);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .24em;
    text-transform: uppercase;
}

/* ---- переключатели: пилюли, без панели ---- */

.beacon-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.beacon-chip {
    position: relative;
    min-height: 40px;
    padding: 0 16px 0 14px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: rgba(255, 255, 255, .74);
    font-size: calc(11px * var(--ui));
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .2s ease, color .2s ease, background .2s ease;
}

.beacon-chip input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* Точка слева: гаснет и загорается вместе с состоянием. */
.beacon-chip span::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .26);
    vertical-align: middle;
    transition: background .2s ease, box-shadow .2s ease;
}

.beacon-chip:hover {
    border-color: rgba(255, 255, 255, .38);
    color: #fff;
}

.beacon-chip:has(input:checked) {
    border-color: rgba(255, 179, 71, .68);
    background: rgba(255, 123, 0, .12);
    color: #fff;
}

.beacon-chip:has(input:checked) span::before {
    background: var(--beam);
    box-shadow: 0 0 10px rgba(255, 123, 0, .9);
}

.beacon-chip:has(input:focus-visible) {
    box-shadow: 0 0 0 3px rgba(255, 179, 71, .3);
}

/* ---- пароль: появляется рядом с пилюлями ---- */

/* Поле пароля и две кнопки-иконки: обновить и скопировать. Колонки описаны
   явно, иначе на узком экране вторая кнопка переносилась под поле. */
.beacon-pass {
    display: inline-grid;
    grid-template-columns: minmax(0, 1fr) 40px 40px;
    align-items: center;
    gap: 8px;
    width: min(310px, 100%);
    animation: beacon-slide-in .42s cubic-bezier(.16, 1, .3, 1);
}

@keyframes beacon-slide-in {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: none; }
}

.beacon-pass input {
    min-width: 0;
    min-height: calc(40px * var(--ui));
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    background: rgba(2, 6, 17, .72);
    color: #fff;
    font-family: Consolas, "Courier New", monospace;
    font-size: calc(13px * var(--ui));
    letter-spacing: .02em;
    text-overflow: ellipsis;
}

.beacon-pass input:focus {
    outline: none;
    border-color: rgba(255, 179, 71, .66);
}

.beacon-mini {
    width: 40px;
    min-height: calc(40px * var(--ui));
    padding: 0;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--beam-pale);
    cursor: pointer;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.beacon-mini svg {
    width: 17px;
    height: 17px;
}

.beacon-mini:hover {
    background: transparent;
    color: #fff;
    transform: rotate(-90deg);
}

.beacon__turnstile {
    margin: 0;
}

.beacon__notice {
    margin: 0;
    padding: 10px 14px;
    border: 1px solid rgba(255, 179, 71, .3);
    border-radius: 999px;
    background: rgba(255, 123, 0, .1);
    color: var(--beam-pale);
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.4;
}

/* Настоящая кнопка создания: нужна app.js, но не видна. */
.beacon-hidden-trigger {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* --------------------------------------------------------------- статус */

.beacon__status {
    position: absolute;
    left: var(--gutter);
    bottom: clamp(18px, 2.4vw, 30px);
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: rgba(255, 255, 255, .62);
    font-size: calc(10px * var(--ui));
    font-weight: 500;
    letter-spacing: .22em;
    text-transform: uppercase;
}

/* Зелёная точка «на связи»: мигает прозрачностью, без ореола вокруг — свечение
   тут читалось как лишний акцент, а мигание само по себе говорит о живости. */
.beacon__status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2ee6a6;
    box-shadow: none;
    animation: beacon-alive 1.9s ease-in-out infinite;
}

@keyframes beacon-alive {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .35; transform: scale(.82); }
}

/* ------------------------------------------------------------- анимации */

@keyframes beacon-pulse {
    0%, 100% { opacity: .55; }
    50%      { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .beacon__status-dot,
    .beacon-pass {
        animation: none;
    }

    .beacon__panel,
    .beacon__panel > *,
    .beacon__panel::before {
        transition: none;
    }
}

/* -------------------------------------------------------------- мобилка */

@media (max-width: 900px) {
    /* Высота по содержимому: на узком экране растягивать до окна нечем.
       Но экран всё равно не короче окна — иначе под снимком остаётся полоса
       фона, и страница выглядит собранной из двух разных оформлений.

       overflow: visible обязателен. При hidden на узком окне форма создания
       комнаты уезжала за нижнюю границу вместе с кнопкой копирования пароля, и
       докрутить до неё было нельзя — экран не прокручивался. */
    .beacon {
        min-height: 100svh;
        min-height: 100dvh;
        overflow: visible;
        border-radius: 14px;
    }

    .beacon {
        --gutter: 20px;
    }

    .beacon__content {
        grid-template-columns: minmax(0, 1fr);
        padding: 84px 20px 74px var(--gutter);
    }

    .beacon__photo {
        object-position: 64% 38%;
    }

    .beacon__vignette {
        background:
            linear-gradient(180deg, rgba(2, 6, 17, .58) 0%, rgba(2, 6, 17, .86) 46%, rgba(2, 6, 17, .96) 100%);
    }

    .beacon__facts {
        margin-top: 28px;
        gap: 10px 22px;
    }

    .beacon__status {
        left: 20px;
        bottom: 20px;
    }
}

@media (max-width: 520px) {
    #startView .beacon__title {
        font-size: clamp(34px, 12vw, 52px);
    }

    .beacon__eyebrow {
        letter-spacing: .28em;
    }

    .beacon-btn,
    .beacon-link {
        width: 100%;
        justify-content: center;
    }
}

/* Шапка без названия: ссылку прижимаем к правому краю. */
.site-top__inner--bare {
    justify-content: flex-end;
}

/* =============================================================================
   ШАГ «ВВЕДИТЕ НИК»
   Отдельной страницы нет: тот же снимок, та же карточка на том же месте —
   меняется только её содержимое.
   ============================================================================= */

/**
 * Снимок за экраном ника и за чатом.
 *
 * z-index отрицательный намеренно. Этот слой лежит в документе ПОСЛЕ стартовой
 * секции, и при z-index: 0 он рисовался поверх неё: после удаления комнаты
 * клиент возвращал стартовый экран без перезагрузки, а человек видел одну
 * фотографию — ни заголовка, ни кнопки, ни строки о том, что комната удалена.
 * Отрицательный z-index держит слой под содержимым при любом порядке разметки.
 */
.beacon__scene--fixed {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: var(--night, #020611);
}

/* На стартовом экране своя сцена внутри .beacon — эта лишняя. */
body[data-page="start"] .beacon__scene--fixed {
    display: none;
}

/* Ограничение доступа — не техническая заглушка, а понятный экран помощи. */
body[data-page="blocked"] .shell {
    position: relative;
    z-index: 1;
    min-height: 100svh;
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 72px 20px 44px;
}

.blocked-view {
    width: min(620px, 100%);
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(14, 25, 34, .9), rgba(11, 18, 28, .86));
    box-shadow: 0 26px 70px rgba(0, 0, 0, .42);
    backdrop-filter: blur(8px);
}

.blocked-view__card { padding: clamp(28px, 5vw, 48px); }

.blocked-view .eyebrow {
    margin: 0 0 12px;
    color: #ffcf8b;
    font-size: 11px;
    font-weight: 650;
    letter-spacing: .24em;
    text-transform: uppercase;
}

.blocked-view h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(30px, 5vw, 44px);
    font-weight: 850;
    line-height: 1.08;
    letter-spacing: -.025em;
}

.blocked-view .lead {
    margin: 18px 0 0;
    max-width: 52ch;
    color: rgba(255, 255, 255, .8);
    font-size: 15px;
    line-height: 1.65;
}

.blocked-view__button {
    min-height: 46px;
    margin-top: 24px;
    padding: 0 22px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(100deg, #ff8a1f, #ffc067);
    color: #281400;
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
    box-shadow: 0 12px 30px rgba(255, 123, 0, .24);
}

.blocked-view__button:hover {
    background: linear-gradient(100deg, #ff9b3d, #ffd08a);
    color: #201000;
}

.blocked-view__hint {
    margin: 12px 0 0;
    color: rgba(255, 255, 255, .55);
    font-size: 12px;
    line-height: 1.5;
}

body[data-page="identity"] .shell {
    position: relative;
    z-index: 1;
    display: grid;
    align-items: center;
    min-height: 100svh;
}

body[data-page="identity"] #identityView {
    /* По центру, а не у правого края. Раньше карточка была прижата вправо, и
       переход выглядел рывком: на старте текст слева, тут карточка в углу, а
       следом чат снова по центру. Теперь ник и чат стоят на одном месте. */
    justify-self: center;
    width: min(440px, 100%);
    margin: 0;
    min-height: 0;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(9, 14, 28, .93), rgba(3, 6, 16, .96));
    box-shadow: 0 26px 70px rgba(0, 0, 0, .5);
    backdrop-filter: blur(10px);
    font-family: 'Montserrat', 'Segoe UI', Roboto, Arial, sans-serif;
}

body[data-page="identity"] #identityView::before {
    display: none;
}

body[data-page="identity"] .identity__content {
    width: 100%;
    padding: clamp(20px, 2vw, 26px);
}

body[data-page="identity"] .identity__content .eyebrow {
    margin: 0 0 10px;
    color: #ffcf8b;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .26em;
    text-transform: uppercase;
}

body[data-page="identity"] .identity__content h1 {
    margin: 0;
    color: #fff;
    font-size: 26px;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -.01em;
    text-transform: uppercase;
    white-space: normal;
}

body[data-page="identity"] .identity__content .lead {
    margin: 10px 0 0;
    max-width: none;
    color: rgba(255, 255, 255, .74);
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
}

body[data-page="identity"] .identity__form {
    margin-top: 18px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

body[data-page="identity"] .identity__form input {
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 10px;
    background: rgba(2, 6, 17, .86);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
}

body[data-page="identity"] .identity__form input:focus {
    outline: none;
    border-color: rgba(255, 179, 71, .66);
    box-shadow: 0 0 0 3px rgba(255, 123, 0, .16);
}

body[data-page="identity"] .identity__form .button {
    min-height: 48px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(100deg, #ff7b00 0%, #ffb347 100%);
    box-shadow: 0 14px 38px rgba(255, 123, 0, .28);
    color: #241000;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
}

body[data-page="identity"] .password-copy-card {
    margin-top: 14px;
    border-color: rgba(255, 179, 71, .34);
    background: rgba(255, 123, 0, .08);
}

@media (max-width: 900px) {
    body[data-page="identity"] #identityView {
        justify-self: center;
        margin: 0 20px;
    }
}

/* Автовход: карточку ника не показываем, вместо неё короткое «подключение». */
html.is-autojoin #identityView {
    visibility: hidden;
}

html.is-autojoin body[data-page="identity"] .shell::after,
html.is-autojoin .shell::after {
    content: "Подключаем к комнате…";
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    color: rgba(255, 255, 255, .78);
    font-family: 'Montserrat', 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .24em;
    text-transform: uppercase;
}

/* Поле ника в панели параметров. */
.beacon-field {
    display: grid;
    gap: 6px;
}

.beacon-field > span {
    color: rgba(255, 255, 255, .62);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: .2em;
    text-transform: uppercase;
}

.beacon-field input {
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 10px;
    background: rgba(2, 6, 17, .86);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
}

.beacon-field input::placeholder {
    color: rgba(255, 255, 255, .34);
}

.beacon-field input:focus {
    outline: none;
    border-color: rgba(255, 179, 71, .66);
    box-shadow: 0 0 0 3px rgba(255, 123, 0, .16);
}

/* Настоящая кнопка создания: нужна разметке и app.js, но не видна. */
.beacon-hidden-trigger {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    border: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

/* =============================================================================
   ЧАТ В ТОМ ЖЕ ШАБЛОНЕ
   Раньше чат жил в холодной синей палитре, а стартовый экран и шаг ника — в
   тёплой, поверх снимка. Разница бросалась в глаза при переходе.

   Ничего не переписываю в style.css: сперва переопределяю токены (их использует
   почти вся разметка чата), потом — те поверхности, где цвет задан прямо в
   правиле. Так холодная тема остаётся рабочей, если ANON_START_THEME сменить.
   ============================================================================= */

body[data-page="chat"] {
    /* тёплая палитра «маяка» вместо циана */
    --accent: #ff9636;
    --accent-strong: #ff7b00;
    --accent-soft: rgba(255, 150, 54, .16);
    --accent-glow: rgba(255, 150, 54, .5);
    --neon-purple: #ffb347;
    --neon-pink: #ffcf8b;

    /* поверхности — стекло над фотографией, а не глухие плашки */
    --bg: #020611;
    --bg-deep: #01040b;
    --panel: rgba(9, 14, 28, .82);
    --panel-solid: #060c1a;
    --panel-soft: rgba(12, 19, 35, .74);
    --field: rgba(2, 6, 17, .72);
    --line: rgba(255, 255, 255, .13);
    --line-soft: rgba(255, 255, 255, .07);
    --line-glow: rgba(255, 179, 71, .38);

    --bubble-in: rgba(10, 17, 32, .82);
    --bubble-out: linear-gradient(100deg, #ff7b00 0%, #ffb347 100%);

    --glow-sm: 0 0 0 1px rgba(255, 179, 71, .22), 0 0 18px rgba(255, 123, 0, .12);
    --glow-md: 0 0 24px rgba(255, 123, 0, .22);
    --focus-ring: 0 0 0 3px rgba(255, 123, 0, .28), 0 0 18px rgba(255, 123, 0, .18);

    font-family: 'Montserrat', 'Segoe UI', Roboto, Arial, sans-serif;

    /* Высота: колонка на весь экран. Раньше .chat висел на
       height: calc(100vh - 150px) с ограничением max-height: 880px, и на
       высоком экране под панелью оставалась пустота, а на низком — обрезка.
       dvh считает видимую часть окна, поэтому адресная строка мобильного
       браузера больше не отрезает низ. */
    display: flex;
    flex-direction: column;

    /* Высота именно height, а не min-height: у flex-контейнера без
       определённой высоты нет причины сжимать содержимое, поэтому длинная
       история растягивала страницу (1100 px при окне 792) и появлялся
       внешний скролл вместо прокрутки внутри переписки. */
    height: 100dvh;
    overflow: hidden;
}

/* Геометрия одна для обеих тем. Пока зазор вокруг панели был прописан только в
   светлой, окно при переключении темы прыгало по размеру. */
body[data-page="chat"] .shell {
    flex: 1 1 auto;
    min-height: 0;
    width: min(1120px, calc(100% - 56px));
    padding: clamp(14px, 2.6vh, 26px) 0;
    display: grid;
    align-items: stretch;
    position: relative;
    z-index: 1;
}

/* Панель занимает всю доступную высоту: сколько дал .shell, столько и берёт. */
body[data-page="chat"] .chat {
    height: 100%;
    min-height: 0;
    max-height: none;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(9, 14, 28, .90), rgba(3, 6, 16, .95));
    box-shadow: 0 26px 70px rgba(0, 0, 0, .5);
    backdrop-filter: blur(10px);
}

/* Дополнительная линия поверх панели не нужна: форму держат фон и тень. */
body[data-page="chat"] .chat::after {
    box-shadow: none;
}

/* Полосы внутри панели: разной плотности, чтобы читалась структура. */
body[data-page="chat"] .chat__header {
    background: rgba(2, 6, 17, .5);
    border-bottom-color: transparent;
}

body[data-page="chat"] .roombar,
body[data-page="chat"] .participants-line {
    background: rgba(2, 6, 17, .34);
    border-bottom-color: transparent;
}

body[data-page="chat"] .composer {
    background: rgba(2, 6, 17, .5);
    border-top: 0;
}

body[data-page="chat"] .composer__field {
    background: rgba(2, 6, 17, .74);
    border-color: rgba(255, 255, 255, .16);
}

body[data-page="chat"] .composer__field:focus-within {
    border-color: rgba(255, 179, 71, .6);
    box-shadow: 0 0 0 3px rgba(255, 123, 0, .16);
}

/* Замок комнаты и аватары: тёплый градиент вместо циан-фиолетового. */
body[data-page="chat"] .chat__avatar {
    box-shadow: none;
    color: #2a1200;
}

/* :not(--spacer) обязателен. Под сгруппированные сообщения ставится пустышка
   вместо аватара, и без исключения обводка рисовала пустые кружки. */
body[data-page="chat"] .message__avatar:not(.message__avatar--spacer) {
    box-shadow: none;
}

/* Своё сообщение — тёплая плашка, поэтому текст на ней тёмный. */
body[data-page="chat"] .message--mine .message__text {
    border: 0;
    color: #2a1200;
    box-shadow: none;
}

body[data-page="chat"] .message--mine .message__meta,
body[data-page="chat"] .message--mine .message__meta time {
    color: rgba(255, 255, 255, .6);
}

body[data-page="chat"] .message__name {
    color: #ffcf8b;
}

body[data-page="chat"] .message__text {
    border-color: rgba(255, 255, 255, .08);
}

/* Системные сообщения и подсказки — тёплый нейтральный тон. */
body[data-page="chat"] .participant-chip {
    background: rgba(2, 6, 17, .5);
}

body[data-page="chat"] .participant-chip:hover {
    border-color: rgba(255, 179, 71, .45);
}

/* Таймер жизни комнаты: цвет остаётся смысловым (зелёный → жёлтый → красный),
   меняется только оправа. */
body[data-page="chat"] .chat__timer {
    background: rgba(2, 6, 17, .55);
    border-color: rgba(255, 255, 255, .12);
}

body[data-page="chat"] .chat__timer:hover {
    border-color: rgba(255, 179, 71, .4);
}

/* Кнопка «удалить» остаётся красной: это единственное необратимое действие. */
body[data-page="chat"] .icon-btn:hover {
    color: #ffcf8b;
}

body[data-page="chat"] .icon-btn--language,
body[data-page="chat"] .icon-btn--language:hover,
body[data-page="chat"] .icon-btn--language:focus-visible {
    border: 0;
    background: transparent;
    color: #ffcf8b;
}

/* Экран ожидания собеседника — та же карточка-стекло. */
body[data-page="chat"] .chat-wait__panel {
    background: rgba(2, 6, 17, .82);
    border-color: rgba(255, 255, 255, .12);
}

@media (max-width: 720px) {
    body[data-page="chat"] .shell {
        width: calc(100% - 16px);
        padding: 8px 0;
    }

    body[data-page="chat"] .chat {
        border-radius: 14px;
    }

    /* На телефоне шапка, строка комнаты и участники съедали половину экрана.
       Отступы режем, структура остаётся — переписке достаётся больше места. */
    body[data-page="chat"] .chat__header { padding: 10px 12px; }
    body[data-page="chat"] .roombar { padding: 8px 12px; gap: 4px 16px; }
    body[data-page="chat"] .participants-line { padding: 7px 12px; }
    body[data-page="chat"] .messages { padding: 12px 12px; }
    body[data-page="chat"] .composer { padding: 10px 12px; }
}

/* Затемнение под чат: на стартовом экране вигнетка гасит левый край под текст,
   здесь панель по центру, поэтому свет убираем ровно, а по краям снимок
   остаётся видимым. */
body[data-page="chat"] .beacon__vignette {
    background:
        linear-gradient(180deg, rgba(2, 6, 17, .68) 0%, rgba(2, 6, 17, .82) 100%),
        radial-gradient(100% 80% at 50% 30%, transparent 0%, rgba(2, 6, 17, .45) 72%);
}

/* Остатки холодной палитры: цвет задан прямо в правиле, токены их не достают. */
body[data-page="chat"] .chat-wait__icon {
    background: rgba(255, 150, 54, .14);
    color: #ffcf8b;
    border-color: rgba(255, 179, 71, .4);
}

body[data-page="chat"] .ghost-btn {
    background: rgba(2, 6, 17, .6);
    border-color: rgba(255, 179, 71, .34);
    color: #ffe7c4;
}

body[data-page="chat"] .ghost-btn:hover {
    border-color: rgba(255, 179, 71, .6);
    color: #fff;
}

/* Системная строка — нейтральное тёплое стекло вместо зеленоватого. */
body[data-page="chat"] .message--system .message__text {
    background: rgba(255, 255, 255, .05);
    border-color: rgba(255, 255, 255, .09);
    color: rgba(255, 255, 255, .62);
}

body[data-page="chat"] .participant-chip {
    border-color: rgba(255, 179, 71, .26);
}

/* «Скопировать ссылку» — тёплая кнопка, как на стартовом экране. */
body[data-page="chat"] .icon-btn--share {
    background: rgba(255, 150, 54, .16);
    color: #ffcf8b;
}

body[data-page="chat"] .icon-btn--share:hover {
    background: rgba(255, 123, 0, .34);
    color: #fff;
}

/* Красной остаётся только корзина: удаление комнаты необратимо, и цвет об этом
   предупреждает. Полоса времени жизни тоже сохраняет смысловые цвета
   (зелёный → жёлтый → красный). */
