/* =====================================================================
   Playoff Bracket — çift taraflı eleme ağacı (overflow yok)
   ===================================================================== */

.po-bracket-wrap {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding: 0.75rem 0 1.75rem;
}

.po-bracket {
    --po-tree-h: clamp(380px, 48vh, 480px);
    --po-gap-col: clamp(4px, 0.9vw, 12px);
    --po-slot-max-w: clamp(108px, 9.5vw, 142px);
    --po-slot-max-w-center: clamp(118px, 10.5vw, 158px);
    --po-line: rgba(0, 230, 135, 0.28);
    --po-line-strong: rgba(0, 230, 135, 0.42);

    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: var(--po-gap-col);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: var(--po-tree-h);
    margin: 0 auto;
}

/* Sol / sağ gruplar — desktop'ta yan yana 3 sütun */
.po-bracket-side {
    display: flex;
    flex: 3 1 0;
    min-width: 0;
    gap: var(--po-gap-col);
    align-items: stretch;
}

.po-bracket-side--left { justify-content: flex-end; }
.po-bracket-side--right { justify-content: flex-start; }

/* ── Sütunlar ── */
.po-col {
    flex: 1 1 0;
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.po-col-label {
    text-align: center;
    font-size: clamp(0.5rem, 0.55vw, 0.62rem);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(0, 230, 135, 0.6);
    margin-bottom: 0.45rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.po-col-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    min-height: calc(var(--po-tree-h) - 1.5rem);
}

.po-pair {
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
}

/* Bağlantı çizgileri — kısa tutulur taşmayı önlemek için */
.po-col--left .po-pair::before {
    content: '';
    position: absolute;
    right: calc(var(--po-gap-col) * -0.5);
    top: 14%;
    bottom: 14%;
    width: 1px;
    background: var(--po-line);
}
.po-col--left .po-pair::after {
    content: '';
    position: absolute;
    right: calc(var(--po-gap-col) * -0.5);
    top: 50%;
    width: calc(var(--po-gap-col) * 0.55);
    max-width: 8px;
    height: 1px;
    background: var(--po-line);
    transform: translateY(-50%);
}

.po-col--right .po-pair::before {
    content: '';
    position: absolute;
    left: calc(var(--po-gap-col) * -0.5);
    top: 14%;
    bottom: 14%;
    width: 1px;
    background: var(--po-line);
}
.po-col--right .po-pair::after {
    content: '';
    position: absolute;
    left: calc(var(--po-gap-col) * -0.5);
    top: 50%;
    width: calc(var(--po-gap-col) * 0.55);
    max-width: 8px;
    height: 1px;
    background: var(--po-line);
    transform: translateY(-50%);
}

.po-col--t2 .po-slot::after,
.po-col--t3 .po-slot::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(var(--po-gap-col) * 0.55);
    max-width: 8px;
    height: 1px;
    background: var(--po-line-strong);
    transform: translateY(-50%);
}
.po-col--left.po-col--t2 .po-slot::after,
.po-col--left.po-col--t3 .po-slot::after { right: calc(var(--po-gap-col) * -0.5); }
.po-col--right.po-col--t2 .po-slot::after,
.po-col--right.po-col--t3 .po-slot::after { left: calc(var(--po-gap-col) * -0.5); }

/* ── Maç slotu ── */
.po-slot {
    position: relative;
    width: 100%;
    max-width: var(--po-slot-max-w);
    background: linear-gradient(145deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 7px;
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    animation: poSlotIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.po-col--left .po-slot { margin-left: auto; }
.po-col--right .po-slot { margin-right: auto; }

.po-slot--center {
    max-width: var(--po-slot-max-w-center);
    margin-left: auto;
    margin-right: auto;
}

.po-slot--tbd {
    opacity: 0.7;
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.06);
}

.po-slot--live {
    border-color: rgba(239, 68, 68, 0.55);
    box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.15);
}

.po-slot--done {
    border-color: rgba(0, 230, 135, 0.2);
}

.po-slot-badge {
    position: absolute;
    top: 0;
    right: 0;
    padding: 1px 5px;
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.35);
    border-bottom-left-radius: 6px;
    z-index: 2;
}

.po-slot-badge--live {
    color: #fca5a5;
    display: flex;
    align-items: center;
    gap: 3px;
}

.po-slot-badge--done {
    color: rgba(0, 230, 135, 0.85);
}

.po-pulse {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #ef4444;
    animation: poPulse 1.2s ease-in-out infinite;
}

/* ── Takım satırı ── */
.po-team {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 6px;
    min-height: 30px;
    min-width: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.po-team:last-child { border-bottom: none; }
.po-team--win { background: rgba(0, 230, 135, 0.1); }
.po-team--lose { opacity: 0.55; }

.po-team-logo-wrap {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.po-team-logo {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.po-team-logo--ph {
    font-size: 0.55rem;
    line-height: 20px;
    text-align: center;
    width: 100%;
}

.po-team-body {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
}

.po-team-name {
    display: block;
    width: 100%;
    max-width: 100%;
    font-size: clamp(0.74rem, 0.88vw, 0.84rem);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.92);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.po-team-name:hover { color: #00e687; }
.po-team-name--win {
    color: #00e687;
    font-weight: 700;
}
.po-team-name--win:hover { color: #34d399; }
.po-team-name--tbd {
    color: rgba(255, 255, 255, 0.28);
    font-style: italic;
    font-weight: 500;
}

.po-team-score {
    flex-shrink: 0;
    font-family: 'Outfit', sans-serif;
    font-size: clamp(0.78rem, 0.92vw, 0.88rem);
    font-weight: 800;
    color: rgba(255, 255, 255, 0.5);
    min-width: 1em;
    text-align: center;
}

.po-team-score--win { color: #00e687; font-weight: 900; }

/* ── Final şampiyon logosu ── */
.po-slot--final-winner {
    border-color: rgba(245, 166, 35, 0.45);
    box-shadow: 0 0 24px rgba(245, 166, 35, 0.12);
}

.po-final-winner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px 8px;
    border-bottom: 1px solid rgba(245, 166, 35, 0.22);
    background: linear-gradient(180deg, rgba(245, 166, 35, 0.14) 0%, transparent 100%);
    animation: poFinalWinnerIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.po-final-winner-logo-wrap {
    width: clamp(52px, 5vw, 72px);
    height: clamp(52px, 5vw, 72px);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), 0 0 0 2px rgba(245, 166, 35, 0.35);
}

.po-final-winner-logo {
    width: 85%;
    height: 85%;
    object-fit: contain;
}

.po-final-winner-logo--ph {
    font-size: 1.8rem;
    line-height: 1;
}

.po-final-winner-label {
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(245, 166, 35, 0.85);
}

@keyframes poFinalWinnerIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.92); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.po-col--center .po-slot--final-winner {
    max-width: var(--po-slot-max-w-center);
}

/* ── Merkez (Final) ── */
.po-bracket__center {
    flex: 1.15 1 0;
    min-width: 0;
    max-width: 15%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
}

.po-trophy {
    font-size: clamp(1.6rem, 2.2vw, 2.2rem);
    line-height: 1;
    filter: drop-shadow(0 4px 12px rgba(245, 166, 35, 0.3));
    animation: poTrophyIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}

.po-trophy-label {
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(245, 166, 35, 0.7);
    margin-top: -0.2rem;
}

.po-col--center {
    width: 100%;
    max-width: 100%;
}

.po-col--center .po-col-body {
    min-height: auto;
    justify-content: center;
}

.po-col--center .po-slot {
    width: 100%;
    border-color: rgba(245, 166, 35, 0.32);
}

.po-col--center .po-slot::before,
.po-col--center .po-slot::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(var(--po-gap-col) * 0.6);
    max-width: 10px;
    height: 1px;
    background: var(--po-line-strong);
    transform: translateY(-50%);
}

.po-col--center .po-slot::before { left: calc(var(--po-gap-col) * -0.6); }
.po-col--center .po-slot::after  { right: calc(var(--po-gap-col) * -0.6); }

.po-third {
    width: 100%;
    margin-top: 0.35rem;
}

.po-third-label {
    text-align: center;
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.32);
    margin-bottom: 0.35rem;
}

/* ── Şampiyon ── */
.po-champion {
    margin-top: 2rem;
    text-align: center;
    animation: poSlotIn 0.65s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.po-champion-card {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    padding: 1.25rem 1.75rem;
    border-radius: 1rem;
    background: linear-gradient(145deg, rgba(245, 166, 35, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
    border: 1px solid rgba(245, 166, 35, 0.28);
}

.po-champion-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
    padding: 6px;
}

.po-champion-title {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(245, 166, 35, 0.8);
}

.po-champion-name {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    font-weight: 800;
    color: #fbbf24;
}

/* ── Mobil sekmeler (kaldırıldı — tam ağaç gösterilir) ── */
.po-mobile-tabs {
    display: none !important;
}

/* ── Animasyon ── */
@keyframes poSlotIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes poTrophyIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.9); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes poPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

/* ── Tablet sıkıştırma ── */
@media (max-width: 1100px) {
    .po-bracket {
        --po-tree-h: clamp(340px, 44vh, 420px);
    }

    .po-team {
        min-height: 26px;
        padding: 3px 5px;
    }

    .po-team-logo-wrap {
        width: 18px;
        height: 18px;
    }

    .po-team-logo {
        width: 14px;
        height: 14px;
    }
}

.po-col-label-short {
    display: none;
}

.po-col-label-long {
    display: block;
}

/* ── Mobil: tam genişlik ağaç, tarih + skor + kısa isim ── */
@media (max-width: 768px) {
    .po-playoff-hero {
        padding-top: 5.5rem !important;
        padding-bottom: 0.35rem !important;
    }

    .po-playoff-hero .po-hero-badge,
    .po-playoff-hero .po-hero-desc,
    .po-playoff-hero .po-hero-breadcrumb,
    .po-playoff-hero .po-hero-sezon-tabs {
        display: none !important;
    }

    .po-playoff-hero h1 {
        font-size: 1.35rem !important;
        margin-bottom: 0.25rem !important;
    }

    .po-playoff-sections {
        padding-top: 0.25rem !important;
        padding-bottom: 0.75rem !important;
        overflow-x: hidden;
        padding-left: 0.25rem;
        padding-rights: 0.25rem;
    }

    .po-playoff-section > .max-w-7xl {
        padding-left: 0.2rem !important;
        padding-right: 0.2rem !important;
        max-width: 100% !important;
    }

    .po-playoff-section .po-playoff-footer {
        display: none;
    }

    .po-champion {
        display: none;
    }

    .po-col-label-long {
        display: none;
    }

    .po-col-label-short {
        display: block;
    }

    .po-bracket-wrap {
        overflow: hidden;
        padding: 0.15rem 0 0.35rem;
        margin: 0;
        width: 100%;
    }

    .po-bracket {
        --po-tree-h: clamp(420px, 68dvh, 620px);
        --po-gap-col: clamp(2px, 0.65vw, 4px);
        --po-slot-max-w: 100%;
        --po-slot-max-w-center: 100%;

        flex-direction: row;
        flex-wrap: nowrap;
        align-items: stretch;
        justify-content: space-between;
        gap: var(--po-gap-col);
        width: 100% !important;
        max-width: 100%;
        min-height: var(--po-tree-h);
        margin: 0;
        transform: none !important;
    }

    .po-bracket-side {
        display: flex !important;
        flex: 1 1 0;
        min-width: 0;
        gap: var(--po-gap-col);
    }

    .po-bracket-side--left {
        justify-content: flex-end;
    }

    .po-bracket-side--right {
        justify-content: flex-start;
    }

    .po-bracket__center {
        display: flex !important;
        flex: 0.72 1 0;
        min-width: 0;
        max-width: none;
        gap: 0.2rem;
        padding: 0 1px;
    }

    .po-col {
        flex: 1 1 0;
        min-width: 0;
        max-width: 100%;
    }

    .po-col-label {
        display: block;
        font-size: clamp(0.34rem, 1.55vw, 0.44rem);
        margin-bottom: 0.15rem;
        letter-spacing: 0.03em;
        line-height: 1.1;
    }

    .po-col-body {
        min-height: calc(var(--po-tree-h) - 0.75rem);
        justify-content: space-around;
        gap: 0;
    }

    .po-pair {
        gap: clamp(2px, 0.45vw, 3px);
    }

    /* İnce bağlantı çizgileri */
    .po-col--left .po-pair::before,
    .po-col--right .po-pair::before {
        display: block;
        top: 12%;
        bottom: 12%;
    }

    .po-col--left .po-pair::after,
    .po-col--right .po-pair::after {
        display: block;
        max-width: 4px;
    }

    .po-col--t2 .po-slot::after,
    .po-col--t3 .po-slot::after {
        display: block;
        max-width: 4px;
    }

    .po-col--center .po-slot::before,
    .po-col--center .po-slot::after {
        display: block;
        max-width: 4px;
    }

    .po-slot,
    .po-slot--center {
        width: 100%;
        max-width: 100%;
        border-radius: 4px;
    }

    .po-col--left .po-slot {
        margin-left: auto;
        margin-right: 0;
    }

    .po-col--right .po-slot {
        margin-right: auto;
        margin-left: 0;
    }

    .po-col--center .po-slot {
        margin-left: auto;
        margin-right: auto;
    }

    .po-slot-badge {
        display: block;
        position: static;
        width: 100%;
        text-align: center;
        padding: 1px 2px;
        font-size: clamp(0.34rem, 1.5vw, 0.42rem);
        line-height: 1.15;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        border-bottom-left-radius: 0;
        background: rgba(0, 0, 0, 0.28);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .po-slot-badge--live {
        justify-content: center;
    }

    .po-final-winner {
        display: none !important;
    }

    .po-trophy {
        font-size: clamp(0.85rem, 3.8vw, 1.15rem);
        line-height: 1;
    }

    .po-trophy-label {
        display: block;
        font-size: clamp(0.28rem, 1.2vw, 0.34rem);
        margin-top: 0;
        letter-spacing: 0.06em;
    }

    .po-third {
        display: block;
        margin-top: 0.15rem;
    }

    .po-third-label {
        font-size: clamp(0.3rem, 1.3vw, 0.36rem);
        margin-bottom: 0.12rem;
    }

    .po-team {
        gap: clamp(2px, 0.5vw, 3px);
        padding: clamp(2px, 0.45vw, 3px) clamp(2px, 0.55vw, 4px);
        min-height: clamp(18px, 4.8vw, 24px);
    }

    .po-team-body {
        display: flex !important;
        min-width: 0;
    }

    .po-team-name {
        font-size: clamp(0.44rem, 2vw, 0.54rem);
        line-height: 1.15;
    }

    .po-team-logo-wrap {
        width: clamp(12px, 3.4vw, 16px);
        height: clamp(12px, 3.4vw, 16px);
        border-radius: 2px;
    }

    .po-team-logo {
        width: clamp(10px, 2.8vw, 13px);
        height: clamp(10px, 2.8vw, 13px);
    }

    .po-team-logo--ph {
        font-size: clamp(0.4rem, 1.8vw, 0.48rem);
        line-height: 1;
    }

    .po-team-score {
        font-size: clamp(0.46rem, 2.1vw, 0.56rem);
        min-width: 0.75em;
    }

    .po-team--lose {
        opacity: 0.5;
    }
}

@media (prefers-reduced-motion: reduce) {
    .po-slot,
    .po-trophy,
    .po-champion {
        animation: none !important;
    }
}

/* Tıklanabilir maç kartı → detay sayfası */
a.po-slot-link {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: inherit;
}

.po-slot--clickable {
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

a.po-slot-link:hover .po-slot--clickable,
a.po-slot-link:focus-visible .po-slot--clickable {
    border-color: rgba(0, 230, 135, 0.55);
    box-shadow: 0 0 0 1px rgba(0, 230, 135, 0.2);
    transform: translateY(-1px);
}

a.po-slot-link:focus-visible {
    outline: 2px solid rgba(0, 230, 135, 0.5);
    outline-offset: 2px;
}
