/**
 * Snooker Championship — bracket visualization (pan/zoom via JS)
 */

.snooker-bv {
    --snooker-bv-bg: linear-gradient(145deg, #0f1419 0%, #1a2332 48%, #121820 100%);
    --snooker-bv-card: rgba(255, 255, 255, 0.06);
    --snooker-bv-card-border: rgba(255, 255, 255, 0.12);
    --snooker-bv-text: rgba(255, 255, 255, 0.92);
    --snooker-bv-muted: rgba(255, 255, 255, 0.45);
    --snooker-bv-accent: #3dd6c6;
    --snooker-bv-accent-dim: rgba(61, 214, 198, 0.35);
    --snooker-bv-win: rgba(61, 214, 198, 0.18);
    --snooker-bv-loss: rgba(239, 91, 91, 0.12);
    --snooker-bv-line: rgba(61, 214, 198, 0.45);

    margin: 1.5rem 0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    background: var(--snooker-bv-bg);
    color: var(--snooker-bv-text);
}

.snooker-bv__toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.25);
    border-bottom: 1px solid var(--snooker-bv-card-border);
}

.snooker-bv__title {
    font-weight: 600;
    letter-spacing: 0.02em;
    font-size: 15px;
}

.snooker-bv__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
}

.snooker-bv__connector-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-weight: 500;
}

.snooker-bv__connector-select {
    width: auto !important;
    min-width: 118px;
    height: 30px;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    /* color: var(--snooker-bv-text); */
}

.snooker-bv__controls .btn {
    min-width: 34px;
    border-radius: 8px;
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    color: var(--snooker-bv-text);
}

.snooker-bv__controls .btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--snooker-bv-accent-dim);
}

.snooker-bv__hint {
    font-size: 12px;
    margin-left: auto;
    opacity: 0.75;
    color: var(--snooker-bv-muted) !important;
}

.snooker-bv__viewport {
    position: relative;
    height: min(72vh, 820px);
    cursor: grab;
    overflow: hidden;
    user-select: none;
    background:
        radial-gradient(ellipse 80% 60% at 50% 0%, rgba(61, 214, 198, 0.08), transparent 55%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 40px,
            rgba(255, 255, 255, 0.02) 40px,
            rgba(255, 255, 255, 0.02) 41px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 40px,
            rgba(255, 255, 255, 0.02) 40px,
            rgba(255, 255, 255, 0.02) 41px
        );
}

.snooker-bv__viewport.is-dragging {
    cursor: grabbing;
}

.snooker-bv__sheet {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
    will-change: transform;
}

.snooker-bv__tree {
    position: relative;
    padding: 28px 36px 40px;
    min-width: max-content;
}

.snooker-bv__svg {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 0;
}

.snooker-bv__path {
    fill: none;
    stroke: var(--snooker-bv-line);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 6px rgba(61, 214, 198, 0.25));
    transition:
        stroke 0.15s ease,
        stroke-width 0.15s ease,
        filter 0.15s ease;
}

.snooker-bv__path.is-path-hover {
    stroke: #ffd166;
    stroke-width: 3.25;
    filter: drop-shadow(0 0 10px rgba(255, 209, 102, 0.45));
}

.snooker-bv__branch {
    position: relative;
    z-index: 1;
    margin-bottom: 36px;
}

.snooker-bv__branch:last-child {
    margin-bottom: 0;
}

.snooker-bv__branch-head {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--snooker-bv-accent);
    margin-bottom: 18px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--snooker-bv-accent-dim);
}

.snooker-bv__columns {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 56px;
}

.snooker-bv__column {
    display: flex;
    flex-direction: column;
    min-width: 248px;
}

.snooker-bv__column-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--snooker-bv-muted);
    margin-bottom: 14px;
    font-weight: 600;
}

.snooker-bv__column-matches {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex: 1;
    gap: 28px;
}

.snooker-bv__match {
    position: relative;
    z-index: 2;
    border-radius: 12px;
    background: var(--snooker-bv-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--snooker-bv-card-border);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    overflow: hidden;
    min-width: 236px;
    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.snooker-bv__match:hover {
    border-color: var(--snooker-bv-accent-dim);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(61, 214, 198, 0.15);
}

.snooker-bv__match-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.22);
    border-bottom: 1px solid var(--snooker-bv-card-border);
}

.snooker-bv__match-meta {
    font-size: 11px;
    color: var(--snooker-bv-muted);
    font-weight: 600;
}

.snooker-bv__badge {
    font-size: 10px !important;
    padding: 2px 6px !important;
    border-radius: 6px !important;
    max-width: 70%;
    white-space: normal;
    text-align: right;
    line-height: 1.25;
    font-weight: 500;
}

.snooker-bv__slot {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    font-size: 13px;
    line-height: 1.35;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition:
        background 0.15s ease,
        box-shadow 0.15s ease;
}

.snooker-bv__avatar-img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.snooker-bv__avatar-placeholder {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: rgba(255, 255, 255, 0.1);
}

.snooker-bv__slot-score {
    margin-left: auto;
    flex-shrink: 0;
    min-width: 1.5rem;
    font-weight: 800;
    font-size: 14px;
    letter-spacing: 0.04em;
    color: var(--snooker-bv-accent);
    text-align: right;
}

.snooker-bv__slot-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.snooker-bv__slot.is-participant-hover {
    box-shadow: inset 0 0 0 2px rgba(255, 209, 102, 0.55);
    background: rgba(255, 209, 102, 0.08) !important;
}

.snooker-bv__match.is-participant-hover {
    border-color: rgba(255, 209, 102, 0.55);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.28),
        0 0 0 1px rgba(255, 209, 102, 0.35);
}

.snooker-bv__slot:last-of-type {
    border-bottom: none;
}

.snooker-bv__slot.is-winner {
    background: var(--snooker-bv-win);
    box-shadow: inset 3px 0 0 var(--snooker-bv-accent);
}

.snooker-bv__slot.is-loser {
    background: var(--snooker-bv-loss);
    opacity: 0.85;
}

.snooker-bv__subgames {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.18);
}

.snooker-bv__subgames-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--snooker-bv-text);
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.snooker-bv__subgames-toggle:hover {
    background: rgba(255, 255, 255, 0.04);
}

.snooker-bv__subgames-progress {
    margin-left: auto;
    color: var(--snooker-bv-muted);
    font-weight: 500;
}

.snooker-bv__subgames-chevron {
    transition: transform 0.15s ease;
    color: var(--snooker-bv-muted);
}

.snooker-bv__subgames.is-open .snooker-bv__subgames-chevron {
    transform: rotate(180deg);
}

.snooker-bv__subgames-panel {
    padding: 0 8px 8px;
}

.snooker-bv__subgames-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.snooker-bv__subgame {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 6px;
    align-items: center;
    padding: 5px 6px;
    border-radius: 6px;
    font-size: 11px;
}

.snooker-bv__subgame + .snooker-bv__subgame {
    margin-top: 2px;
}

.snooker-bv__subgame.is-done {
    background: rgba(61, 214, 198, 0.08);
}

.snooker-bv__subgame-idx {
    color: var(--snooker-bv-muted);
    font-weight: 700;
}

.snooker-bv__subgame-players {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.snooker-bv__subgame-players .is-winner {
    color: var(--snooker-bv-accent);
    font-weight: 700;
}

.snooker-bv__subgame-vs {
    opacity: 0.45;
    margin: 0 3px;
}

.snooker-bv__subgame-score {
    font-variant-numeric: tabular-nums;
    color: var(--snooker-bv-muted);
}

