/* ═══════════════════════════════════════════════════════════════
   bracket.css — Bracket Visualization (bv-*) styles
   Extracted from tournament_live.html inline <style> block.
   These are the "live scoreboard" bracket overrides that apply
   alongside (or instead of) the bracket_component.html inline
   styles when viewed on the standalone live page.
   ═══════════════════════════════════════════════════════════════ */

.bv-bracket-section { margin-bottom: 2rem; }
.bv-bracket-label {
    font-size: 1rem;
    font-weight: 700;
    color: var(--t-heading);
    margin-bottom: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(59,130,246,0.1);
    border: 1px solid rgba(59,130,246,0.2);
    border-radius: 8px;
    display: inline-block;
}
.bv-scroll-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 0 1.5rem 0;
    position: relative;
}
.bv-bracket-tree {
    display: flex;
    align-items: stretch;
    min-width: min-content;
}
.bv-round-col {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    min-width: 230px;
}
.bv-round-header {
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--t-text-muted);
    padding: 0.5rem 0.75rem;
    margin: 0 0 0.75rem 0;
    background: var(--t-border-strong);
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.bv-round-header.bv-finals-header {
    background: linear-gradient(135deg, rgba(245,158,11,0.2) 0%, rgba(217,119,6,0.15) 100%);
    color: #fbbf24;
    border: 1px solid rgba(245,158,11,0.3);
}
.bv-round-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    position: relative;
}
.bv-match-slot {
    display: flex;
    align-items: center;
    position: relative;
    flex: 1;
    padding: 4px 0;
}
.bv-match {
    background: var(--t-surface);
    border: 2px solid var(--t-border-strong);
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    max-width: 220px;
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
    z-index: 2;
}
.bv-match:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.3); z-index: 3; }
.bv-match-completed { border-color: rgba(16,185,129,0.4); }
.bv-match-active {
    border-color: #3b82f6;
    animation: bv-pulse-dark 2s ease-in-out infinite;
}
@keyframes bv-pulse-dark {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59,130,246,0.3); }
    50% { box-shadow: 0 0 0 6px rgba(59,130,246,0.1); }
}
.bv-match-pending { border-color: var(--t-border-strong); }
.bv-participant {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.55rem 0.7rem;
    font-size: 0.8rem;
    min-height: 34px;
    background: var(--t-surface);
    transition: background 0.15s;
}
.bv-divider { height: 1px; background: var(--t-border-strong); }
.bv-winner {
    background: rgba(16,185,129,0.1) !important;
    font-weight: 700;
    border-left: 3px solid #34d399;
}
.bv-winner .bv-name { color: #34d399; }
.bv-tbd .bv-name { color: var(--t-text-secondary); font-style: italic; }
.bv-participant-info {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.bv-seed { color: var(--t-text-muted); font-size: 0.7rem; font-weight: 600; flex-shrink: 0; }
.bv-winner .bv-seed { color: #6ee7b7; }
.bv-name {
    color: var(--t-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bv-score-area {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
    margin-left: 0.4rem;
}
.bv-score {
    background: var(--t-border-strong);
    color: var(--t-heading);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
    min-width: 22px;
    text-align: center;
}
.bv-winner .bv-score { background: #065f46; color: #a7f3d0; }
.bv-check { color: #34d399; font-weight: 700; font-size: 0.8rem; }
.bv-connector-col {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-shrink: 0;
    width: 24px;
    position: relative;
}
.bv-conn-pair {
    display: flex;
    flex-direction: column;
    flex: 2;
    position: relative;
}
.bv-conn-spacer { flex: 1; }
.bv-conn-pair::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    bottom: 25%;
    width: 2px;
    background: var(--t-border-strong);
}
.bv-conn-pair::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 2px;
    background: var(--t-border-strong);
    transform: translateY(-1px);
}
.bv-conn-top, .bv-conn-bottom { flex: 1; position: relative; }
.bv-conn-top::after {
    content: '';
    position: absolute;
    right: 0;
    bottom: 50%;
    width: 100%;
    height: 2px;
    background: var(--t-border-strong);
}
.bv-conn-bottom::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    width: 100%;
    height: 2px;
    background: var(--t-border-strong);
}
.bv-de-separator {
    margin: 2rem 0;
    padding: 0.75rem 1.25rem;
    background: rgba(245,158,11,0.1);
    border: 1px solid rgba(245,158,11,0.3);
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
    color: #fbbf24;
    font-size: 0.95rem;
}

/* ═══ LIVE PAGE: BRACKET RESPONSIVE ═══ */
@media (max-width: 768px) {
    .bv-round-col { min-width: 190px; }
    .bv-match { max-width: 180px; }
    .bv-participant { padding: 0.45rem 0.55rem; font-size: 0.75rem; }
    /* Scroll fade hint on right edge */
    .bv-bracket-section { position: relative; }
    .bv-bracket-section::after {
        content: '';
        position: absolute;
        top: 0; right: 0; bottom: 0;
        width: 32px;
        background: linear-gradient(to right, transparent, var(--t-bg, #111));
        pointer-events: none;
        z-index: 5;
    }
}
@media (max-width: 480px) {
    .bv-round-col { min-width: 140px; }
    .bv-match { max-width: 135px; }
    .bv-round-header { font-size: 0.65rem; padding: 0.35rem 0.5rem; }
    .bv-participant { padding: 0.35rem 0.4rem; font-size: 0.68rem; min-height: 28px; }
    .bv-seed { font-size: 0.55rem; min-width: 18px; }
}

/* ═══ BRACKET MOBILE OVERRIDES ═══ */
@media (max-width: 768px) {
    .bv-scroll-container {
        scroll-snap-type: x proximity;
        padding-bottom: 2rem;
        position: relative;
    }
    .bv-scroll-container::after {
        content: 'Swipe to see more rounds \2192';
        position: sticky;
        right: 0;
        bottom: 0;
        display: block;
        text-align: center;
        font-size: var(--text-xs);
        color: var(--t-text-muted);
        padding: var(--space-2);
        pointer-events: none;
    }
    .bv-scroll-container.has-scrolled::after { display: none; }
    .bv-round-col { min-width: 200px; scroll-snap-align: start; }
    .bv-match { max-width: 190px; }
    .bv-participant { padding: 0.5rem 0.6rem; min-height: 44px; font-size: var(--text-sm); }
    .bv-name { font-size: var(--text-sm); }
    .bv-round-header { font-size: var(--text-xs); padding: 0.4rem 0.5rem; }
    .bv-score-input, .bv-series-grid input[type="number"] {
        min-height: 44px; min-width: 44px; font-size: 1rem; padding: var(--space-2);
    }
}
@media (max-width: 480px) {
    .bv-round-col { min-width: 170px; }
    .bv-match { max-width: 160px; }
    .bv-participant { padding: 0.4rem 0.5rem; font-size: var(--text-xs); min-height: 40px; }
    .bv-scroll-container::after { content: '\2190 Swipe \2192'; }
}
