/* --- UI PANELS & ROSTER --- */
.panel { background: var(--c-parchment); padding: 20px; border: 1px solid var(--c-gold-dim); border-radius: 4px; margin-bottom: 20px; }
.player-search-results { max-height: 250px; overflow-y: auto; background: #fdf8e9; border: 1px solid #c4a962; display: none; border-radius: 0 0 4px 4px; }
.player-result-item { padding: 8px 12px; cursor: pointer; display: flex; justify-content: space-between; border-bottom: 1px dashed rgba(196, 169, 98, 0.4); }
.player-result-item:hover { background: rgba(196, 169, 98, 0.15); }
.tourney-card { background: #fffdf5; border: 1px solid #c4a962; padding: 10px; border-radius: 4px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }

/* --- BRACKET CANVAS --- */
.bracket-container { 
    display: flex; flex-direction: row; gap: 40px; 
    overflow: hidden; 
    padding: 20px 40px; 
    cursor: grab; 
    -ms-overflow-style: none; scrollbar-width: none; 
}
.bracket-container::-webkit-scrollbar { display: none; }
.bracket-container.grabbing { cursor: grabbing !important; user-select: none; }

/* --- CORE BRACKET LAYOUT (UNBREAKABLE WIDTHS) --- */
.bracket-round { display: flex; flex-direction: column; width: 220px !important; min-width: 220px !important; max-width: 220px !important; flex-shrink: 0 !important; }
.bracket-matches { display: flex; flex-direction: column; justify-content: space-around; flex: 1; gap: 15px; padding: 10px 0; width: 100% !important; }

.match-wrapper { display: flex; flex-direction: column; align-items: center; width: 220px !important; min-width: 220px !important; max-width: 220px !important; flex-shrink: 0 !important; }
.bracket-match { background: #fffdf5; border: 1px solid #c4a962; border-radius: 4px; display: flex; flex-direction: column; box-shadow: 0 4px 6px rgba(0,0,0,0.05); position: relative; width: 100% !important; box-sizing: border-box; flex-shrink: 0 !important; }

/* --- HEADERS & LABELS --- */
.round-header { text-align: center; margin-bottom: 10px; height: 45px; width: 100%; box-sizing: border-box; }
.round-title { font-weight: bold; color: var(--c-gold); font-size: 0.85rem; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 5px; }
.best-of-select { padding: 2px 5px; font-size: 0.75rem; background: transparent; border: 1px solid var(--c-gold-dim); color: var(--c-ink); border-radius: 3px; cursor: pointer; text-align: center; width: 100%; box-sizing: border-box; }

.match-label { text-align: center; font-size: 0.75rem; font-weight: bold; margin-bottom: 5px; }
.match-label.bronze { color: #b45f06; margin-top: 15px; }
.match-label.gold { color: var(--c-gold); }

/* --- CONNECTING LINES --- */
.bracket-match::before { content: ''; position: absolute; left: -20px; top: 50%; width: 20px; height: 2px; background: #c4a962; }
.bracket-match::after { content: ''; position: absolute; right: -20px; top: 50%; width: 20px; height: 2px; background: #c4a962; }

/* Left Side Hiding */
.bracket-round:not(.right-side).outer-edge .bracket-match::before { display: none; } 
.bracket-round:not(.right-side).inner-edge .bracket-match::after { display: none; }  

/* Right Side Hiding */
.bracket-round.right-side.outer-edge .bracket-match::after { display: none; } 
.bracket-round.right-side.inner-edge .bracket-match::before { display: none; }

/* --- PLAYER SLOTS --- */
.bracket-player { width: 100%; box-sizing: border-box; padding: 8px 12px; cursor: pointer; transition: background 0.2s; border-bottom: 1px dashed rgba(196, 169, 98, 0.4); display: flex; justify-content: space-between; align-items: center; }
.bracket-player:last-child { border-bottom: none; }
.bracket-player:hover { background: rgba(196, 169, 98, 0.15); }
.bracket-player.winner { background: rgba(30, 86, 49, 0.1); font-weight: bold; color: #1e5631; }
.bracket-player.loser { opacity: 0.5; text-decoration: line-through; }
.bracket-empty { color: #888; font-style: italic; }
.bracket-player[draggable="true"] { cursor: grab; }
.bracket-player[draggable="true"]:active { cursor: grabbing; }
.drag-over { background: rgba(22, 163, 74, 0.2) !important; border: 1px dashed var(--c-teal); }

/* --- CENTER COLUMN (GRAND FINALS) --- */
.bracket-center-column { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 0 40px; min-width: 250px; position: relative; z-index: 10; flex-shrink: 0 !important; }