/* ========================================
   BATTLE CARDS (bc- prefix)
   Compact cards with inline voting
   Light frosted overlay, dark text
   Homepage + Tournaments Overview
   ======================================== */

/* ---- Container ---- */
.bc-section {
    padding: var(--section-y) var(--gutter);
    max-width: var(--container-max);
    margin: 0 auto;
    background: var(--bg-secondary, var(--neutral-900));
    border-top: var(--bw-hair) solid var(--border-subtle, var(--alpha-white-08));
}

/* ---- Grid ----
   Верхняя граница у колонки обязательна: при одном баттле карточка
   растягивалась на всю ширину страницы, и афиша превращалась в узкую
   полосу в полторы тысячи пикселей. Когда карточек мало, ряд выравнивается
   по центру, а не липнет к левому краю */
.bc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 460px));
    justify-content: center;
    gap: var(--space-lg, 1.5rem);
}

/* ---- Card ---- */
/* ═══ СЛОЙ-ССЫЛКА КАРТОЧКИ БАТТЛА ═══════════════════════════════════════
   13.10. Переход делал обработчик на `div[data-battle]`: ни новой вкладки,
   ни клавиатуры, ни диктора. Порядок слоёв — общий для сайта: содержимое 1,
   слой 2, своё действие 3 (js/kslt-sloy.js). */
.bc-card > .bc-card-inner,
.bc-card > .bc-banner {
    position: relative;
    z-index: 1;
}

.bc-card > .bc-card-cover {
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    text-decoration: none;
}

.bc-card > .bc-card-cover:focus-visible {
    outline: var(--bw-thick) solid var(--accent);
    outline-offset: -4px;
}

.bc-card .bc-vote-btn,
.bc-card .bc-vote-buttons,
.bc-card .bc-meta-venue {
    position: relative;
    z-index: 3;
}

.bc-card {
    position: relative;
    width: 100%;
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    border: var(--bw-hair) solid var(--alpha-white-08);
    transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
    background: linear-gradient(145deg, var(--neutral-800) 0%, #222 50%, var(--neutral-800) 100%);
    /* Карточка ведёт на баттл целиком, а не только надписью «Подробнее» */
    cursor: pointer;
}
.bc-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px var(--alpha-lime-06);
}

/* Афиша — по пропорции, а не фиксированной высотой: при широкой карточке
   120 пикселей превращали постер в полоску, где не разобрать ни лиц, ни
   надписей */
.bc-banner {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
    border-bottom: var(--bw-hair) solid var(--alpha-white-08);
}

.bc-card-inner {
    position: relative;
    padding: 18px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ---- Header: badge + date/time ---- */
.bc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.bc-badge {
    display: inline-block;
    background: var(--accent);
    color: var(--neutral-black);
    font-size: var(--fs-2xs);
    font-weight: 800;
    letter-spacing: 1.5px;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    flex-shrink: 0;
}
.bc-datetime {
    display: inline-flex;
    align-items: center;
    gap: 0;
    background: rgba(220, 40, 40, 0.15);
    border: var(--bw-hair) solid rgba(220, 40, 40, 0.35);
    border-radius: 8px;
    padding: 4px 4px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.bc-dt-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--danger);
    white-space: nowrap;
}
.bc-dt-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}
.bc-dt-sep {
    width: 1px;
    height: 14px;
    background: rgba(220, 40, 40, 0.35);
    flex-shrink: 0;
}

/* ---- Title ---- */
.bc-title {
    font-size: var(--fs-base);
    font-weight: 700;
    color: var(--neutral-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- VS row ---- */
.bc-vs-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 4px 0;
}
.bc-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex: 1;
    min-width: 0;
}
/* Фото ИЛИ инициалы: размер и рамка объявлены один раз на оба. */
.bc-player img,
.bc-player .avatar-initials {
    width: 52px;
    height: 52px;
    font-size: var(--fs-lg);
    border-radius: 50%;
    object-fit: cover;
    border: var(--bw-thick) solid var(--alpha-white-12);
    box-shadow: 0 2px 8px var(--alpha-black-30);
}

/* Пара: места на строку не больше, чем у одиночного баттла, поэтому
   фотографии наезжают друг на друга, а имена идут в две строки */
.bc-player-photos { display: flex; justify-content: center; }
.bc-player-photos.bc-pair img,
.bc-player-photos.bc-pair .avatar-initials { width: 46px; height: 46px; font-size: var(--fs-base); }
.bc-player-photos.bc-pair img + img,
.bc-player-photos.bc-pair > * + * { margin-left: -14px; }
.bc-player-name.bc-pair-names {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.3;
}
.bc-player-name.bc-pair-names span { font-size: var(--fs-xs); }
.bc-player-name {
    font-size: var(--fs-sm);
    font-weight: 600;
    text-align: center;
    color: var(--alpha-white-72);
    max-width: 160px;
    word-wrap: break-word;
    line-height: 1.1;
}
.bc-vs {
    font-size: var(--fs-base);
    font-weight: 800;
    color: var(--accent);
    flex-shrink: 0;
}

/* ---- Vote buttons ---- */
.bc-vote-buttons {
    display: flex;
    gap: 10px;
}
.bc-vote-btn {
    flex: 1;
    padding: 9px 12px;
    border-radius: 10px;
    border: var(--bw-thick) solid var(--alpha-white-12);
    background: var(--alpha-white-08);
    color: var(--alpha-white-72);
    font-size: var(--fs-xs);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* При наведении сторона подсвечивается своим цветом — тем же, каким она
   идёт в полосе голосования и на странице баттлов. Раньше обе кнопки
   светлели одинаково, и было не видно, за кого голосуешь */
.bc-vote-btn-p1:hover:not(.bc-vote-closed):not(.bc-vote-locked) {
    border-color: var(--player-1);
    background: rgba(79, 195, 247, 0.12);
}

.bc-vote-btn-p2:hover:not(.bc-vote-closed):not(.bc-vote-locked) {
    border-color: var(--player-2);
    background: rgba(208, 80, 247, 0.12);
}
.bc-vote-btn-p1.bc-vote-selected {
    background: rgba(79, 195, 247, 0.12);
    border-color: var(--player-1);
    color: var(--player-1);
    font-weight: 700;
}
.bc-vote-btn-p2.bc-vote-selected {
    background: rgba(208, 80, 247, 0.12);
    border-color: var(--player-2);
    color: var(--player-2);
    font-weight: 700;
}
.bc-vote-btn.bc-vote-closed,
.bc-vote-btn.bc-vote-locked {
    opacity: 0.6;
    pointer-events: none;
    cursor: default;
}
.bc-vote-btn.bc-vote-locked.bc-vote-selected {
    opacity: 1;
}

/* Your vote label */
.bc-vote-voted {
    text-align: center;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--alpha-white-50);
    margin-bottom: 2px;
}

/* Login to vote / Voting closed */
.bc-vote-login,
.bc-vote-closed-msg {
    text-align: center;
    font-size: var(--fs-xs);
    color: var(--text-muted);
    padding: 6px 0;
}

/* ---- Vote bar ---- */
.bc-vote-bar {
    display: flex;
    height: 7px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--alpha-white-08);
}
.bc-bar-p1 {
    height: 100%;
    background: var(--player-1);
    border-radius: 4px 0 0 4px;
    transition: width 0.5s ease;
}
.bc-bar-p2 {
    height: 100%;
    background: var(--player-2);
    border-radius: 0 4px 4px 0;
    transition: width 0.5s ease;
}

/* ---- Vote stats ---- */
.bc-vote-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--fs-xs);
}
.bc-pct {
    font-weight: 700;
}
.bc-pct-p1 { color: var(--player-1); }
.bc-pct-p2 { color: var(--player-2); }
.bc-total {
    color: var(--text-muted);
    font-size: var(--fs-2xs);
}

/* ---- Meta: venue at bottom ---- */
.bc-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: var(--fs-xs);
    color: var(--alpha-white-50);
}
.bc-meta-item {
    white-space: nowrap;
    /* Длинное название площадки на телефоне вылезало за край карточки.
       Пусть лучше обрежется многоточием */
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bc-meta-venue {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
    transition: color 0.2s;
}
.bc-meta-venue:hover {
    color: var(--alpha-white-72);
}

/* ---- Details link ---- */
.bc-details-link {
    display: block;
    text-align: center;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--alpha-white-50);
    text-decoration: none;
    padding: 6px 0 2px;
    transition: color 0.2s;
}
.bc-details-link:hover {
    color: var(--accent);
}

/* ---- Map modal ---- */
.bc-map-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--modal-bg-heavy);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bcFadeIn 0.2s ease;
}
@keyframes bcFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.bc-map-modal {
    background: var(--neutral-800);
    border: var(--bw-hair) solid var(--alpha-white-12);
    border-radius: 16px;
    padding: 24px;
    min-width: 260px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.bc-map-title {
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--neutral-white);
    margin-bottom: 4px;
}
.bc-map-btn {
    display: block;
    padding: 12px;
    border-radius: 10px;
    font-size: var(--fs-base);
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}
.bc-map-btn:hover { opacity: 0.85; }
.bc-map-2gis { background: #3DB83A; color: var(--neutral-white); }
.bc-map-google { background: #4285F4; color: var(--neutral-white); }
.bc-map-cancel { background: var(--alpha-white-08); color: var(--alpha-white-50); }

/* ---- Responsive ---- */
/* ПЛАНШЕТ И УЖЕ — 16.10, кусок 75: поля секции ужимаются уже на планшете,
   как у всех прочих секций продукта. */
@media (max-width: 992px) {
    .bc-section {
        padding: var(--space-lg, 2rem) var(--pad-x);
    }
}
@media (max-width: 640px) {
    .bc-grid {
        grid-template-columns: 1fr;
    }
    .bc-player img {
        width: 44px;
        height: 44px;
    }
    .bc-player-name {
        font-size: var(--fs-xs);
        max-width: 120px;
    }
    .bc-title {
        font-size: var(--fs-sm);
    }
    .bc-card-inner {
        padding: 14px 16px;
        gap: 10px;
    }
    .bc-vote-btn {
        padding: 7px 8px;
        font-size: var(--fs-xs);
    }
    .bc-dt-item {
        font-size: var(--fs-2xs);
        padding: 2px 6px;
        gap: 3px;
    }
    .bc-dt-item svg {
        width: 10px;
        height: 10px;
    }
}
