﻿/* ── Team knockout bracket (TeamBracketPanel) ──
   Linked from App.razor. Class prefix: tb-  (event bracket uses ko-*)
   Palette aligned to the Event chrome recipe (indigo / green / amber). */

.tb-wrap {
    font-family: 'DM Sans', sans-serif;
    margin-top: 8px;
}

.tb-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.tb-head-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.tb-head-titles {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.tb-head-ico {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}

.tb-head-kicker {
    font-family: 'DM Mono', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    line-height: 1.3;
}

.tb-title {
    font-family: 'Sora', sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--mud-palette-text-primary);
}

.tb-sub {
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary);
    margin-top: 2px;
}

.tb-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.tb-note {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    color: var(--mud-palette-text-secondary);
    font-size: 0.9rem;
}

.tb-empty {
    background: var(--mud-palette-background-grey);
    border: 1px dashed var(--mud-palette-lines-default);
    border-radius: 12px;
}

.tb-scroller {
    overflow-x: auto;
    padding: 4px 4px 12px;
}

.tb-rounds {
    display: flex;
    gap: 30px;
    align-items: stretch;
    min-width: min-content;
}

.tb-col {
    display: flex;
    flex-direction: column;
    flex: 0 0 190px;
    width: 190px;
}

.tb-col-head {
    font-family: 'Sora', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--mud-palette-text-secondary);
    margin-bottom: 10px;
    text-align: center;
}

.tb-col-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Pairs & slots split each column evenly so matches self-align across rounds. */
.tb-pair {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}

.tb-slot {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    padding: 9px 0;
}

/* Connector lines, drawn by the left column and extending into the 30px gap:
   node → gap-midpoint (horizontal), the two joined (vertical), then out to the
   next round's match (horizontal). */
.tb-col:not(:last-child) .tb-slot::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -15px;
    width: 15px;
    height: 2px;
    background: var(--mud-palette-lines-default);
}

.tb-col:not(:last-child) .tb-pair::after {
    content: '';
    position: absolute;
    top: 25%;
    bottom: 25%;
    right: -15px;
    width: 2px;
    background: var(--mud-palette-lines-default);
}

.tb-col:not(:last-child) .tb-pair::before {
    content: '';
    position: absolute;
    top: 50%;
    right: -30px;
    width: 15px;
    height: 2px;
    background: var(--mud-palette-lines-default);
}

.tb-node {
    width: 100%;
    box-sizing: border-box;
    background: var(--mud-palette-surface);
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 10px;
    overflow: hidden;
}

.tb-node--third {
    border-style: dashed;
}

.tb-side {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    font-size: 0.85rem;
}

.tb-side--win {
    background: rgba(99,102,241,0.12);
    font-weight: 700;
}

.tb-side--pick {
    cursor: pointer;
}

    .tb-side--pick:hover {
        background: rgba(99,102,241,0.10);
    }

.tb-side--sel {
    background: rgba(99,102,241,0.20);
    box-shadow: inset 0 0 0 2px #6366F1;
}

.tb-rearrange-hint {
    font-size: 0.78rem;
    color: var(--mud-palette-primary);
    font-weight: 600;
    margin: 0 0 10px;
}

.tb-seed-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    background: rgba(99,102,241,0.08);
    border: 1px solid rgba(99,102,241,0.30);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.85rem;
}

.tb-seed {
    font-family: 'DM Mono', monospace;
    font-size: 0.62rem;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
    min-width: 22px;
}

.tb-team {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tb-team--tbd {
    color: var(--mud-palette-text-disabled);
    font-style: italic;
}

.tb-node-mid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 11px;
    border-top: 1px solid var(--mud-palette-lines-default);
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-background-grey);
}

.tb-status {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.tb-status--ready {
    color: #0F6E56;
}

.tb-status--completed {
    color: var(--mud-palette-primary);
}

.tb-status--scheduled {
    color: #2F6FEB;
}

.tb-status--tbd {
    color: var(--mud-palette-text-secondary);
}

.tb-bye {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #854F0B;
}

.tb-third {
    margin-top: 18px;
    max-width: 220px;
}
