﻿#bracket-basic-styles {
    display: none;
}

/* root: dışa taşmayı (page scrollbar) engelle */
.bracket-root {
    position: relative;
    overflow: hidden;
}

/* wrap: iç kaydırma burada gerçekleşecek */
.bracket-wrap {
    overflow: auto;
    max-width: 100%;
    max-height: 100%;
    position: relative;
    box-sizing: border-box;
}

/* content: sabit viewport boyutu (unscaled) - içinde .bracket-scale var */
.bracket-content {
    position: relative;
    width: 100%; /* gerçek boyut JS ile ayarlanacak */
    height: 100%; /* gerçek boyut JS ile ayarlanacak */
    box-sizing: border-box;
    overflow: visible; /* scroll wrap üzerinde */
}

/* scale: gerçek elemanlar (maçlar, connector) burada durur; buna zoom/transform uygulanır */
.bracket-scale {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
}

/* connector / headers / zoom controls */
.connector {
    background: transparent;
    position: absolute;
    pointer-events: none;
}

    .connector.horizontal {
        height: 2px;
        background-color: rgba(0,0,0,0.25);
    }

    .connector.vertical {
        width: 2px;
        background-color: rgba(0,0,0,0.25);
    }

.round-header {
    position: absolute;
    top: 18px;
    height: 22px;
    line-height: 22px;
    font-size: .8rem;
    font-weight: bold;
    text-align: center;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid rgba(0,0,0,0.08);
    white-space: nowrap;
    /* yatay ve dikey ortalama: left değeri ortadaki noktaya atanıyor, sonra -50% ile ortalanıyor */
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Zoom kontrolleri: root içinde, sağ-alt (content dışında) */
.bracket-zoom-controls {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: flex;
    gap: 6px;
    align-items: center;
    z-index: 2000;
    user-select: none;
}

    .bracket-zoom-controls .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 6px;
        border: 1px solid rgba(0,0,0,0.08);
        background: white;
        cursor: pointer;
        font-weight: 600;
    }

    .bracket-zoom-controls .zoom-label {
        min-width: 56px;
        height: 36px;
        display: inline-flex;
        padding: 0 8px;
        align-items: center;
        justify-content: center;
        border-radius: 6px;
        border: 1px solid rgba(0,0,0,0.06);
        background: #fafafa;
        font-size: 13px;
    }

/* Pan cursor: dört yönlü ok (move). match vb. öğeler üzerine gelince bozma */
.bracket-root .bracket-scale {
    cursor: move;
    touch-action: none;
}

.bracket-root .match {
    cursor: default;
}


.bracket-wrap {
    position: relative;
    overflow: auto;
    padding: 0;
    border-radius: .5rem;
}

.bracket {
    position: relative;
    width: 100%;
    min-height: 160px;
    box-sizing: border-box;
    align-items:start;
}

.match {
    box-sizing: border-box;
    width: 180px; 
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    background: #fff;
    padding: 3px;
    display: flex;
    flex-direction: column !important;
    justify-content: center; /* Dikey ortalama */
}

    .match .match-badge {
        position: absolute;
        background: white;
        top: -15px;
        left: 50px;
        padding: 0px 6px;
        font-size: .75rem;
        font-weight: bold;
        color: #6c757d;
        border: 1px solid #f0f0f0;
        border-radius: 12px;
    }

    .match .team-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: linear-gradient(90deg,#fafafb,#fff);
        border-radius: 8px;
    }

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 12px;
}

.team-name {
    font-weight: bold;
    font-size: .8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; 
}

.team-score { 
    padding: 4px 6px;
    text-align: center; 
    font-weight: bold;
}

.match-meta {
    font-size: .8rem;
    height:16px;
    text-align: center;
    padding: 4px;
    color: #6c757d;
    font-weight: normal;
}

.connector {
    position: absolute;
    background: #4caf50;
    z-index: 0;
    pointer-events: none;
}

    .connector.horizontal {
        height: 2px;
    }

    .connector.vertical {
        width: 2px;
    }

.team-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    overflow: hidden;
}
