/* ================= ТРАНСЛЯЦИЯ ГОНКИ (broadcast.html) =================
   Отдельная страница под горизонтальный экран. Палитра — копия значений
   из :root в styles.css (styles.css сюда не подключаем: его правила для
   body/html рассчитаны на основное приложение). */
:root {
    --bc-green-50: #EDF8EF;
    --bc-green-100: #C2E2CC;
    --bc-green-300: #65E080;
    --bc-green-500: #00C12B;
    --bc-green-700: #007D1C;
    --bc-green-900: #0B3D17;
    --bc-pink: #CB0077;
    --bc-orange: #E88A00;
    --bc-text: #10261A;
    --bc-muted: #5B6B61;
    --bc-surface: #ffffff;
    --bc-bg: #F3F8F4;
    --bc-header-h: 52px;
    --bc-feed-w: 30%;
}

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

html,
body {
    height: 100%;
    overflow: hidden;
    background: var(--bc-bg);
    color: var(--bc-text);
    font-family: "Rubik", sans-serif;
}

/* ---------- Шапка ---------- */
/* Три колонки, средняя (часы) — строго по центру: раньше при flex +
   space-between часы сдвигались, когда меняли ширину счётчики справа */
.bc-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    height: var(--bc-header-h);
    padding: 0 16px;
    background: var(--bc-green-700);
    color: #fff;
}

.bc-header__title {
    font-size: 20px;
    font-weight: 900;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bc-header__clock {
    display: flex;
    align-items: baseline;
    gap: 10px;
    direction: ltr;
}

.bc-header__elapsed {
    font-size: 28px;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.bc-header__wall {
    font-size: 15px;
    opacity: 0.8;
    font-variant-numeric: tabular-nums;
}

.bc-header__counters {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    font-size: 15px;
    white-space: nowrap;
}

/* Цифры одинаковой ширины и место под 3 знака — счётчики не прыгают */
.bc-header__counters b {
    display: inline-block;
    min-width: 3ch;
    font-size: 20px;
    font-variant-numeric: tabular-nums;
    text-align: end;
}

/* ---------- Основная область: экран + лента событий ---------- */
.bc-main {
    display: flex;
    height: calc(100% - var(--bc-header-h));
    overflow: hidden;
}

.bc-stage {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.bc-screen {
    position: absolute;
    inset: 0;
    padding: 14px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s, visibility 0.6s;
    overflow: hidden;
}

.bc-screen.is-active {
    opacity: 1;
    visibility: visible;
}

/* Сверху место под плашку с названием экрана (.bc-screen-name) */
#bc-screen-standings,
#bc-screen-kp,
#bc-screen-leaders,
#bc-screen-final {
    padding-top: 46px;
}

.bc-screen--map {
    padding: 0;
}

#bc-map {
    width: 100%;
    height: 100%;
}

.bc-screen-name {
    position: absolute;
    top: 10px;
    inset-inline-start: 10px;
    z-index: 900;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(0, 125, 28, 0.88);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    pointer-events: none;
}

/* ---------- Лента событий ---------- */
/* Лента выезжает/уезжает целиком: ширина не меняется (текст не
   переносится на ходу), а отрицательный отступ уводит её за край экрана —
   основная область при этом плавно расширяется. */
.bc-feed {
    flex: 0 0 var(--bc-feed-w);
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-inline-start: 1px solid var(--bc-green-100);
    background: var(--bc-surface);
    transition: margin 0.45s ease-in-out;
}

.bc-feed__title {
    padding: 10px 14px;
    font-weight: 900;
    color: var(--bc-green-700);
    border-bottom: 1px solid var(--bc-green-100);
}

.bc-feed__list {
    list-style: none;
    overflow: hidden;
    flex: 1 1 auto;
}

.bc-feed__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--bc-green-50);
    animation: bc-feed-in 0.5s ease-out;
}

.bc-feed__item--high {
    background: var(--bc-green-50);
}

.bc-feed__body {
    min-width: 0;
    flex: 1 1 auto;
}

.bc-feed__time {
    font-size: 12px;
    color: var(--bc-muted);
    font-variant-numeric: tabular-nums;
}

.bc-feed__text {
    font-size: 14px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

@keyframes bc-feed-in {
    from {
        transform: translateY(-12px);
        opacity: 0;
        background: var(--bc-green-100);
    }
}

/* ---------- Аватар участника (фото или номер) ---------- */
.bc-avatar {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bc-green-700);
    color: #fff;
    font-weight: 900;
    font-size: 14px;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.bc-avatar--light {
    background: var(--bc-orange);
}

.bc-avatar--f {
    border-color: var(--bc-pink);
}

.bc-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bc-avatar--big {
    width: 110px;
    height: 110px;
    font-size: 38px;
    border-width: 4px;
}

/* ---------- Большая карточка события ---------- */
.bc-card {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1000;
    width: min(86%, 620px);
    padding: 26px 30px;
    border-radius: 24px;
    /* Полупрозрачная: сквозь карточку видна карта / таблица */
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(4px);
    box-shadow: 0 12px 40px rgba(0, 40, 10, 0.35);
    border: 4px solid var(--bc-green-500);
    text-align: center;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(.2, 1.4, .4, 1), opacity 0.3s, visibility 0.3s;
}

.bc-card.is-open {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
}

.bc-card--gold {
    border-color: #E6B800;
}

/* Призёры: золотая рамка мигает */
.bc-card--blink {
    animation: bc-gold-blink 0.7s ease-in-out infinite alternate;
}

@keyframes bc-gold-blink {
    from {
        border-color: #E6B800;
        box-shadow: 0 12px 40px rgba(0, 40, 10, 0.35), 0 0 0 0 rgba(230, 184, 0, 0.0);
    }

    to {
        border-color: #FFE066;
        box-shadow: 0 12px 40px rgba(0, 40, 10, 0.35), 0 0 0 12px rgba(230, 184, 0, 0.45);
    }
}

/* Плашки показателей: у каждого вида свой цвет */
.bc-card__chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.bc-card__chips:empty {
    display: none;
}

.bc-chip {
    padding: 4px 12px;
    border-radius: 999px;
    border: 2px solid transparent;
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    direction: ltr;
    unicode-bidi: isolate;
}

.bc-chip--kp {
    border-color: var(--bc-green-700);
    color: var(--bc-green-700);
    background: #fff;
}

.bc-chip--plus {
    background: var(--bc-green-500);
    color: #fff;
}

.bc-chip--total {
    background: var(--bc-green-900);
    color: #fff;
}

.bc-chip--place {
    background: #E6B800;
    color: var(--bc-text);
}

.bc-chip--time {
    background: #2D6CDF;
    color: #fff;
}

.bc-chip--zachet {
    background: #E7ECE9;
    color: var(--bc-text);
}

.bc-chip--muted {
    background: #F1E3EA;
    color: var(--bc-pink);
}

/* Салют для победителя и подиума: частицы разлетаются из точки и падают */
.bc-fireworks {
    position: absolute;
    inset: 0;
    z-index: 1150;
    overflow: hidden;
    pointer-events: none;
}

.bc-firework {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 2px;
    opacity: 0;
    animation: bc-firework 2.6s cubic-bezier(.15, .7, .3, 1) forwards;
}

@keyframes bc-firework {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0) scale(0.6);
    }

    35% {
        opacity: 1;
        transform: translate(var(--dx), var(--dy)) rotate(calc(var(--rot) / 2)) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(var(--dx), calc(var(--dy) + 260px)) rotate(var(--rot)) scale(0.8);
    }
}

.bc-card--timer {
    border-color: var(--bc-green-700);
}

.bc-card__avatars {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 14px;
}

.bc-card__avatars:empty {
    display: none;
}

.bc-card__title {
    font-size: 30px;
    font-weight: 900;
    color: var(--bc-green-700);
    line-height: 1.15;
}

.bc-card__text {
    margin-top: 10px;
    font-size: 21px;
    line-height: 1.35;
    white-space: pre-line;
}

.bc-message {
    position: absolute;
    inset: 0;
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: var(--bc-bg);
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    color: var(--bc-green-700);
    white-space: pre-line;
}

.bc-message.is-open {
    display: flex;
}

/* ---------- Значок паузы/воспроизведения посередине ---------- */
.bc-flash {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.bc-flash svg {
    width: 60px;
    height: 60px;
    fill: #fff;
}

.bc-flash.is-shown {
    animation: bc-flash 0.9s ease-out;
}

@keyframes bc-flash {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.8);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.3);
    }
}

/* ---------- Карта: КП и участники ---------- */
.bc-kp {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    /* КП — квадрат, участники — круги: различаются формой даже без фото */
    border-radius: 6px;
    border: 3px solid var(--bc-green-700);
    background: #fff;
    color: var(--bc-green-700);
    font-weight: 900;
    font-size: 13px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

/* Взятое КП — бледная заливка, а не яркая, как у кружков участников */
.bc-kp--taken {
    background: var(--bc-green-100);
}

/* Старт/финиш — полупрозрачная выноска другого цвета, чтобы не сливалась
   с КП. Остриё (::after) указывает ровно на точку старта: выноска поднята
   над точкой на высоту острия (10px). */
.bc-start {
    --bc-start-bg: rgba(203, 0, 119, 0.72);
    position: absolute;
    transform: translate(-50%, calc(-100% - 10px));
    padding: 3px 8px;
    border-radius: 7px;
    background: var(--bc-start-bg);
    color: #fff;
    font-weight: 900;
    font-size: 11px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.bc-start::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 7px solid transparent;
    border-top: 10px solid var(--bc-start-bg);
    border-bottom: 0;
}

.bc-kp.is-pulse,
.bc-avatar.is-pulse {
    animation: bc-pulse 1s ease-out 6;
}

@keyframes bc-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(203, 0, 119, 0.8);
    }

    100% {
        box-shadow: 0 0 0 22px rgba(203, 0, 119, 0);
    }
}

.bc-marker-wrap {
    transition: transform 0.6s;
}

/* ---------- Таблица по зачётам ---------- */
.bc-standings {
    display: grid;
    grid-template-columns: repeat(var(--bc-cols, 4), minmax(0, 1fr));
    gap: 12px;
    height: 100%;
}

.bc-zachet {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-radius: 14px;
    background: var(--bc-surface);
    box-shadow: 0 1px 4px rgba(0, 40, 10, 0.12);
    overflow: hidden;
}

.bc-zachet__title {
    padding: 8px 12px;
    background: var(--bc-green-700);
    color: #fff;
    font-weight: 900;
    font-size: 16px;
}

.bc-zachet__title--light {
    background: var(--bc-orange);
}

.bc-zachet__rows {
    overflow: hidden;
}

.bc-row {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-bottom: 1px solid var(--bc-green-50);
    font-size: 14px;
}

.bc-row.is-highlight {
    background: #FCE4F1;
    animation: bc-row-flash 0.8s ease-in-out 3;
}

@keyframes bc-row-flash {
    50% {
        background: #F7B5D8;
    }
}

.bc-row__place {
    font-weight: 900;
    color: var(--bc-green-700);
    text-align: center;
}

.bc-row__name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bc-row__name small {
    color: var(--bc-muted);
}

.bc-row__value {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    text-align: end;
    direction: ltr;
}

.bc-row__bar {
    grid-column: 2 / 4;
    height: 4px;
    border-radius: 2px;
    background: var(--bc-green-50);
    overflow: hidden;
}

.bc-row__bar span {
    display: block;
    height: 100%;
    background: var(--bc-green-500);
}

.bc-row--done .bc-row__bar span {
    background: var(--bc-green-700);
}

/* ---------- Экран КП ---------- */
.bc-kpgrid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    gap: 10px;
    height: 100%;
}

.bc-kpcard {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    padding: 10px 12px;
    border-radius: 14px;
    background: var(--bc-surface);
    box-shadow: 0 1px 4px rgba(0, 40, 10, 0.12);
}

.bc-kpcard.is-highlight {
    outline: 4px solid var(--bc-pink);
}

.bc-kpcard__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-weight: 900;
}

.bc-kpcard__number {
    font-size: 24px;
    color: var(--bc-green-700);
}

.bc-kpcard__weight {
    font-size: 14px;
    color: var(--bc-muted);
}

.bc-kpcard__count {
    font-size: 15px;
}

.bc-kpcard__bar {
    height: 6px;
    border-radius: 3px;
    background: var(--bc-green-50);
    overflow: hidden;
}

.bc-kpcard__bar span {
    display: block;
    height: 100%;
    background: var(--bc-green-500);
    transition: width 0.6s;
}

.bc-kpcard__first {
    font-size: 12px;
    color: var(--bc-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Лидеры / итоги ---------- */
.bc-leaders {
    display: grid;
    grid-template-columns: repeat(var(--bc-cols, 4), minmax(0, 1fr));
    gap: 14px;
    height: 100%;
}

.bc-leader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    padding: 14px;
    border-radius: 18px;
    background: var(--bc-surface);
    box-shadow: 0 1px 4px rgba(0, 40, 10, 0.12);
    text-align: center;
}

.bc-leader__zachet {
    font-weight: 900;
    color: var(--bc-green-700);
    font-size: 17px;
}

.bc-leader__state {
    font-size: 14px;
    color: var(--bc-muted);
}

.bc-leader__name {
    font-size: 19px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.bc-leader__value {
    font-size: 17px;
    direction: ltr;
}

.bc-leader__rest {
    width: 100%;
    font-size: 14px;
    color: var(--bc-muted);
}

.bc-leader__rest div {
    margin-top: 4px;
    line-height: 1.3;
}

.bc-final-title {
    margin-bottom: 12px;
    font-size: 26px;
    font-weight: 900;
    color: var(--bc-green-700);
    text-align: center;
}

#bc-screen-final .bc-leaders {
    height: calc(100% - 50px);
}

@media (max-height: 500px) {
    #bc-screen-standings,
    #bc-screen-kp,
    #bc-screen-leaders,
    #bc-screen-final {
        padding-top: 40px;
    }

    .bc-leader {
        gap: 4px;
        padding: 8px;
    }

    .bc-leader__name {
        font-size: 14px;
    }

    .bc-leader__zachet,
    .bc-leader__value {
        font-size: 13px;
    }

    .bc-leader__rest {
        font-size: 11px;
    }
}

/* ---------- Управление ---------- */
.bc-controls {
    position: fixed;
    bottom: 14px;
    left: 50%;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(11, 61, 23, 0.9);
    color: #fff;
    transform: translateX(-50%);
    transition: opacity 0.4s;
    direction: ltr;
}

.bc-controls.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.bc-controls button {
    min-width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 18px;
    cursor: pointer;
}

.bc-controls span {
    min-width: 44px;
    text-align: center;
    font-weight: 700;
}

/* ---------- Подсказка "поверните экран" ---------- */
.bc-rotate {
    display: none;
}

@media (orientation: portrait) and (max-width: 820px) {
    .bc-rotate {
        position: fixed;
        inset: 0;
        z-index: 3000;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 30px;
        background: var(--bc-green-700);
        color: #fff;
        font-size: 24px;
        font-weight: 700;
        text-align: center;
    }
}

/* ---------- Телефон горизонтально: лента событий не помещается рядом с
   таблицей на 4 зачёта — прячем её, события и так видны карточками ---------- */
@media (max-width: 900px) and (max-height: 500px) {
    .bc-feed {
        display: none;
    }
}

/* ---------- Невысокий экран (телефон горизонтально) ---------- */
@media (max-height: 500px) {
    :root {
        --bc-header-h: 40px;
        --bc-feed-w: 32%;
    }

    .bc-header__title {
        font-size: 15px;
    }

    .bc-header__elapsed {
        font-size: 20px;
    }

    .bc-header__wall,
    .bc-header__counters {
        font-size: 12px;
    }

    .bc-header__counters b {
        font-size: 15px;
    }

    .bc-feed__item {
        padding: 5px 10px;
        gap: 8px;
    }

    .bc-feed__text {
        font-size: 12px;
    }

    .bc-feed .bc-avatar {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    .bc-card {
        padding: 14px 18px;
    }

    .bc-card__title {
        font-size: 22px;
    }

    .bc-card__text {
        font-size: 16px;
    }

    .bc-card__chips {
        gap: 5px;
        margin-top: 8px;
    }

    .bc-chip {
        padding: 2px 8px;
        font-size: 13px;
    }

    .bc-avatar--big {
        width: 70px;
        height: 70px;
        font-size: 24px;
    }

    .bc-row {
        padding: 3px 8px;
        font-size: 12px;
    }

    .bc-zachet__title {
        padding: 5px 10px;
        font-size: 13px;
    }

    .bc-kpcard {
        padding: 6px 8px;
    }

    .bc-kpcard__number {
        font-size: 18px;
    }

    .bc-kpcard__count,
    .bc-kpcard__first {
        font-size: 11px;
    }
}

/* ---------- Статус: окончательный результат или временный ---------- */
.bc-chip--final {
    background: var(--bc-green-700);
    color: #fff;
}

.bc-chip--live {
    background: var(--bc-orange);
    color: #fff;
}

.bc-chip--small {
    padding: 1px 8px;
    font-size: 12px;
}

.bc-leader .bc-chip {
    font-size: 15px;
}

.bc-leader__rest .bc-chip {
    vertical-align: middle;
}

/* ---------- Строки людей в карточке (сводка, призовые места, подиум) ---------- */
.bc-card__rows {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
    text-align: start;
}

.bc-card__rows:empty {
    display: none;
}

.bc-person {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(237, 248, 239, 0.75);
}

.bc-person .bc-avatar {
    width: 44px;
    height: 44px;
    font-size: 16px;
}

.bc-person__body {
    flex: 1 1 auto;
    min-width: 0;
}

.bc-person__caption {
    font-size: 13px;
    font-weight: 700;
    color: var(--bc-muted);
}

.bc-person__name {
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bc-person .bc-chip {
    flex: 0 0 auto;
    font-size: 15px;
}

@media (max-height: 500px) {
    .bc-card__rows {
        gap: 3px;
        margin-top: 6px;
    }

    .bc-person {
        padding: 2px 6px;
    }

    .bc-person .bc-avatar {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .bc-person__caption {
        font-size: 10px;
    }

    .bc-person__name,
    .bc-person .bc-chip {
        font-size: 12px;
    }
}

/* ---------- Выноска над КП при каждом взятии: "№15 +3" ----------
   Остриё указывает на КП (квадрат 30px: верхний край на 15px выше точки).
   Несколько взятий подряд на одном КП — выноски друг над другом (--slot). */
.bc-scan-bubble {
    position: absolute;
    transform: translate(-50%, calc(-100% - 24px - var(--slot, 0) * 26px));
    padding: 2px 8px;
    border-radius: 7px;
    background: rgba(0, 125, 28, 0.9);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    animation: bc-bubble-in 0.35s ease-out;
}

.bc-scan-bubble b {
    color: #B8FFC6;
}

.bc-scan-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top: 7px solid rgba(0, 125, 28, 0.9);
    border-bottom: 0;
}

@keyframes bc-bubble-in {
    from {
        opacity: 0;
        margin-top: 8px;
    }
}

/* ---------- Режим "только карта": плашки событий в углу ---------- */
.bc-toasts {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    z-index: 1050;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(46%, 380px);
    pointer-events: none;
}

.bc-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 14px;
    border: 3px solid var(--bc-green-500);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(3px);
    box-shadow: 0 4px 14px rgba(0, 40, 10, 0.25);
    animation: bc-toast-in 0.4s ease-out;
}

.bc-toast--gold {
    border-color: #E6B800;
    animation: bc-toast-in 0.4s ease-out, bc-gold-blink 0.7s ease-in-out infinite alternate;
}

.bc-toast__body {
    min-width: 0;
}

.bc-toast__title {
    font-weight: 900;
    color: var(--bc-green-700);
    font-size: 15px;
}

.bc-toast__text {
    font-size: 13px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@keyframes bc-toast-in {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
}

/* Кнопка-переключатель на панели управления */
.bc-controls .bc-controls__text {
    width: auto;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
}

.bc-controls .bc-controls__text.is-active {
    background: var(--bc-green-500);
}

/* Лента событий спрятана — экран занимает всю ширину */
body.bc-no-feed .bc-feed {
    margin-inline-end: calc(-1 * var(--bc-feed-w));
}

/* Кнопок на панели управления много — на узком экране переносятся.
   width: max-content — иначе при left: 50% панели доступна только
   половина ширины экрана, и кнопки переносились без нужды. */
.bc-controls {
    width: max-content;
    flex-wrap: wrap;
    justify-content: center;
    max-width: calc(100vw - 20px);
    border-radius: 22px;
}

body.bc-instant .bc-feed {
    transition: none;
}
