/*
 * Traditional tournament bracket renderer: rounds laid out left to
 * right, matches as plain boxes positioned absolutely within their
 * round column, and connector lines drawn with an SVG overlay computed
 * from the real rendered position of each match box (see bracket.js).
 *
 * Deliberately a fixed light "paper sheet" look (not theme-aware) --
 * the bracket is meant to read like a printed tournament bracket sheet
 * regardless of whether the surrounding admin/public UI is in dark mode.
 */

.bracket-sheet {
    background: #ffffff;
    border: 1px solid #e3e6ec;
    border-radius: 8px;
    padding: 8px;
}

.bracket-viewport {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
}

.bracket-canvas {
    position: relative;
    display: flex;
    align-items: flex-start;
    width: max-content;
    min-height: 100%;
    padding: 28px 64px 48px 28px;
}

.bracket-round-column {
    position: relative;
    display: flex;
    flex-direction: column;
    width: var(--bracket-col-width, 230px);
    flex-shrink: 0;
    margin-right: var(--bracket-col-gap, 72px);
}

.bracket-round-column:last-child {
    margin-right: 0;
}

.bracket-round-title {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 1.25rem;
}

.bracket-round-body {
    position: relative;
}

.bracket-match {
    position: absolute;
    left: 0;
    right: 0;
    box-sizing: border-box;
    background: #ffffff;
    border: 1px solid #cdd3dc;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.bracket-match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    font-size: 0.65rem;
    color: #6b7280;
    border-bottom: 1px solid #e3e6ec;
    background: #f8f9fc;
    white-space: nowrap;
}

.bracket-match-header .match-format {
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-estimate {
    padding: 4px 8px;
    border-bottom: 1px solid #eceff3;
    background: #fbfbfd;
    font-size: 0.7rem;
    color: #4b5563;
    line-height: 1.3;
}

.match-estimate .estimate-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
}

.match-estimate .estimate-window {
    font-weight: 600;
    color: #1f2937;
}

.match-estimate .estimate-station {
    color: #6b7280;
}

.match-countdown {
    display: none;
    margin-top: 2px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #b45309;
}

.match-countdown.is-visible {
    display: block;
}

.bracket-match--green {
    border-left: 4px solid #16a34a;
}

.bracket-match--yellow {
    border-left: 4px solid #d97706;
}

.bracket-match--gray {
    border-left: 4px solid #6b7280;
}

.bracket-match--red {
    border-left: 4px solid #dc2626;
}

.bracket-match--blue {
    border-left: 4px solid #2563eb;
}

.bracket-slot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    font-size: 0.85rem;
    color: #1f2937;
    border-bottom: 1px solid #eceff3;
    white-space: nowrap;
    overflow: hidden;
}

.bracket-slot:last-child {
    border-bottom: none;
}

.bracket-slot.is-winner {
    font-weight: 700;
    background: rgba(99, 102, 241, 0.06);
}

.bracket-slot.is-eliminated {
    color: #9ca3af;
    text-decoration: line-through;
}

.bracket-slot.is-bye {
    color: #9ca3af;
    font-style: italic;
}

.bracket-slot .slot-name {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.bracket-slot .slot-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.bracket-slot .slot-controls select {
    font-size: 0.7rem;
    padding: 1px 4px;
    max-width: 100px;
    background-color: #ffffff;
    color: #1f2937;
    border: 1px solid #cdd3dc;
}

.bracket-winner-btn {
    border: 1px solid #6366f1;
    background: #ffffff;
    color: #6366f1;
    border-radius: 3px;
    font-size: 0.65rem;
    line-height: 1;
    padding: 2px 5px;
    cursor: pointer;
}

.bracket-winner-btn:hover {
    background: #6366f1;
    color: #ffffff;
}

.bracket-connectors {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.bracket-connectors path {
    fill: none;
    stroke: var(--bracket-line-color, #7c6cf0);
    stroke-width: 2;
    shape-rendering: crispEdges;
}

.bracket-champion-label {
    position: absolute;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6366f1;
    white-space: nowrap;
}

.bracket-third-place {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px dashed #e3e6ec;
}

.bracket-empty-state {
    padding: 3rem 1rem;
    text-align: center;
    color: #6b7280;
}
