/* 
 * Bracket Display Styles - Clean Light Theme
 */

/* === BRACKET HEADER === */
.bracket-header {
    margin-bottom: 24px;
}

.bracket-header h1 {
    font-size: 1.75rem;
    margin-bottom: 8px;
}

.bracket-description {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* === BRACKET CONTAINER === */
.bracket-wrapper {
    overflow-x: auto;
    padding: 24px 0;
    margin-bottom: 24px;
}

.bracket-wrapper::-webkit-scrollbar {
    height: 8px;
}

.bracket-wrapper::-webkit-scrollbar-track {
    background: var(--bg-light);
    border-radius: 4px;
}

.bracket-wrapper::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: 4px;
}

.bracket {
    display: flex;
    gap: 32px;
    min-width: max-content;
    padding: 16px;
    background: var(--bg-body);
    border-radius: var(--radius-lg);
}

/* === ROUNDS === */
.round {
    display: flex;
    flex-direction: column;
    min-width: 200px;
}

.round-header {
    font-weight: 600;
    text-align: center;
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 0.8rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* === MATCHUPS === */
.matchups {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex: 1;
    gap: 16px;
}

/* === MATCHUP === */
.matchup {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    transition: all 0.15s;
}

.matchup:hover {
    box-shadow: var(--shadow-md);
}

/* === TEAM === */
.team {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    gap: 10px;
    cursor: default;
    transition: all 0.15s;
    border-bottom: 1px solid var(--border);
}

.team:last-child {
    border-bottom: none;
}

.team .seed {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 28px;
    text-align: center;
    background: var(--bg-light);
    padding: 2px 6px;
    border-radius: 4px;
}

.team .name {
    flex: 1;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.team .score {
    font-weight: 700;
    color: var(--text-muted);
    min-width: 24px;
    text-align: right;
}

.team .pick-indicator {
    font-size: 1rem;
    margin-left: 4px;
}

/* === TEAM STATES === */

/* Winner */
.team.winner {
    background: var(--success-light);
}

.team.winner .name {
    color: #166534;
    font-weight: 600;
}

.team.winner .seed {
    background: #bbf7d0;
    color: #166534;
}

/* Loser */
.team.loser {
    opacity: 0.5;
}

.team.loser .name {
    text-decoration: line-through;
}

/* Picked */
.team.picked {
    border-left: 3px solid var(--primary);
    padding-left: 11px;
}

.team.picked.correct {
    border-left-color: var(--success);
    background: var(--success-light);
}

.team.picked.correct .pick-indicator {
    color: var(--success);
}

.team.picked.incorrect {
    border-left-color: var(--danger);
    background: var(--danger-light);
}

.team.picked.incorrect .pick-indicator {
    color: var(--danger);
}

/* Selected (currently selecting) */
.team.selected {
    background: var(--info-light);
    border-left: 3px solid var(--primary);
    padding-left: 11px;
}

/* Clickable */
.team[onclick] {
    cursor: pointer;
}

.team[onclick]:hover {
    background: var(--bg-light);
}

/* TBD */
.team .name.tbd {
    color: var(--text-muted);
    font-style: italic;
}

/* Winner badge */
.winner-badge {
    color: var(--success);
    font-weight: bold;
}

/* Pick percentage */
.pick-pct {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-light);
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}

/* === ADMIN MATCHUP === */
.admin-matchup .team[onclick]:hover {
    background: var(--info-light);
}

/* === ADMIN CONTAINER === */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* === ADMIN HEADER === */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.admin-header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.admin-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.admin-status {
    flex-shrink: 0;
}

/* === BADGES === */
.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-info {
    background: #dbeafe;
    color: #1e40af;
}

/* === ADMIN CARDS === */
.admin-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

.admin-card h3 {
    font-size: 1.15rem;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.admin-card .help-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* === SHARE LINKS === */
.share-links {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 16px;
}

.share-link-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.input-with-button {
    display: flex;
    gap: 8px;
}

.input-with-button input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-mono, monospace);
    font-size: 0.85rem;
    background: var(--bg-light);
    color: var(--text-primary);
}

.input-with-button input:focus {
    outline: none;
    border-color: var(--primary);
}

.input-with-button .btn {
    flex-shrink: 0;
}

/* === SETUP GRID === */
.setup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.setup-matchup {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
}

.setup-team {
    display: flex;
    gap: 8px;
    align-items: center;
}

.setup-matchup .vs {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 8px 0;
}

.setup-matchup .seed-input {
    width: 50px;
    padding: 10px 8px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: var(--bg-white);
}

.setup-matchup .team-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    background: var(--bg-white);
}

.setup-matchup .seed-input:focus,
.setup-matchup .team-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* === BYE MATCHUP STYLES === */
.bye-matchup {
    opacity: 0.6;
}

.bye-matchup .bye-team {
    background: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 4px,
        rgba(0,0,0,0.03) 4px,
        rgba(0,0,0,0.03) 8px
    );
}

.bye-matchup .bye-team .name {
    font-style: italic;
    color: var(--text-muted, #94a3b8);
}

/* === PLAYER LIST SETUP STYLES === */
.player-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

/* === LEADERBOARD TABLE === */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.leaderboard-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--bg-light);
}

.leaderboard-table tr:hover {
    background: var(--bg-light);
}

.leaderboard-table .btn-sm {
    padding: 4px 10px;
    font-size: 0.75rem;
}

.btn-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.btn-danger:hover {
    background: #fecaca;
}

/* === ROUND TITLE (in bracket) === */
.round-title {
    font-weight: 600;
    text-align: center;
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 0.8rem;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* === NOTICE === */
.notice {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.notice-danger {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.notice-success {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.notice-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* === RESPONSIVE ADMIN === */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 16px;
    }
    
    .admin-header h1 {
        font-size: 1.5rem;
    }
    
    .setup-grid {
        grid-template-columns: 1fr;
    }
    
    .input-with-button {
        flex-direction: column;
    }
    
    .input-with-button .btn {
        width: 100%;
    }
}

/* ============================================ */
/* UNIFIED BRACKET PAGE STYLES */
/* ============================================ */

.bracket-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 24px;
}

.bracket-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.bracket-header h1 {
    font-size: 1.75rem;
    margin-bottom: 4px;
}

.bracket-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.bracket-status {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge-admin {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #78350f;
}

.bracket-description {
    color: var(--text-secondary);
    margin-bottom: 24px;
    padding: 16px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
}

/* Admin Panel */
.admin-panel {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #fbbf24;
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 32px;
}

.admin-warning-banner {
    background: #fee2e2;
    border: 1px solid #fecaca;
    border-left: 4px solid #ef4444;
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.admin-warning-banner strong {
    color: #991b1b;
    display: block;
    margin-bottom: 8px;
}

.admin-warning-banner p {
    color: #7f1d1d;
    margin: 0;
}

.danger-zone {
    background: #fef2f2;
    border: 1px solid #fecaca;
}

.danger-zone h3 {
    color: #991b1b;
}

.btn-danger {
    background: #dc2626;
    color: white;
    border: none;
}

.btn-danger:hover {
    background: #b91c1c;
}

.admin-panel-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(251, 191, 36, 0.5);
}

.admin-panel-header h2 {
    font-size: 1.25rem;
    margin-bottom: 4px;
    color: #78350f;
}

.admin-panel-header p {
    color: #92400e;
    font-size: 0.9rem;
}

.admin-section {
    background: var(--bg-white);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
}

.admin-section:last-child {
    margin-bottom: 0;
}

.admin-section h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.admin-tip {
    background: #dbeafe;
    color: #1e40af;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.setup-match-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.admin-toggles {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-toggles .help-text {
    margin-left: 28px;
    margin-top: 4px;
}

/* Bracket Section */
.bracket-section {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

/* Participant Section */
.participant-section {
    margin-bottom: 24px;
}

.join-card, .participant-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.join-card h3 {
    margin-bottom: 8px;
}

.join-card p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.join-form {
    display: flex;
    gap: 12px;
}

.join-form input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
}

.participant-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.participant-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.participant-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.participant-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    width: 150px;
    height: 8px;
    background: var(--bg-light);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.3s;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Save Status Indicator */
.save-status {
    font-size: 0.8rem;
    padding: 2px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.save-status.pending {
    color: var(--warning);
}

.save-status.saving {
    color: var(--text-muted);
}

.save-status.saved {
    color: var(--success);
}

.save-status.error {
    color: var(--danger);
}

/* Leaderboard Section */
.leaderboard-section {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.leaderboard-section h3 {
    margin-bottom: 16px;
}

.leaderboard-table .current-user {
    background: #dbeafe;
}

/* Admin Login Section */
.admin-login-section {
    margin-bottom: 24px;
}

.admin-login-toggle {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.admin-login-toggle summary {
    padding: 16px 20px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
    user-select: none;
}

.admin-login-toggle summary:hover {
    background: var(--bg-light);
}

.admin-login-toggle[open] summary {
    border-bottom: 1px solid var(--border);
}

.admin-login-form {
    padding: 20px;
}

.admin-login-form p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    font-size: 0.9rem;
}

/* Team selection for participants */
.team.selected {
    background: var(--primary) !important;
    color: white !important;
}

.team.selected .seed {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .bracket-header {
        flex-direction: column;
    }
    
    .join-form {
        flex-direction: column;
    }
    
    .participant-card {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .progress-bar {
        width: 100%;
    }
}

/* === EDITABLE TEAMS === */
.team.editable {
    padding: 8px 10px;
    gap: 6px;
}

.team-input {
    flex: 1;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-primary);
    min-width: 0;
}

.team-input:focus {
    outline: none;
    border-color: var(--primary);
}

.seed-input {
    width: 44px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 6px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    text-align: center;
    color: var(--text-primary);
}

.seed-input:focus {
    outline: none;
    border-color: var(--primary);
}

/* === SIZE ADJUSTMENTS === */
.bracket[data-rounds="6"] .round {
    min-width: 160px;
}

.bracket[data-rounds="6"] .round-header {
    font-size: 0.7rem;
    padding: 8px 12px;
}

.bracket[data-rounds="6"] .team {
    padding: 8px 10px;
    font-size: 0.85rem;
}

.bracket[data-rounds="6"] .team .seed {
    font-size: 0.65rem;
    min-width: 24px;
}

/* === COMPARE PAGE === */
.compare-header {
    display: flex;
    gap: 20px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.compare-header .form-group {
    margin-bottom: 0;
    min-width: 200px;
}

.compare-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.compare-panel {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.compare-panel h3 {
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compare-panel .score {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.compare-matchup {
    display: flex;
    gap: 12px;
    padding: 10px;
    border-bottom: 1px solid var(--border);
    align-items: center;
}

.compare-matchup:last-child {
    border-bottom: none;
}

.matchup-info {
    flex: 1;
    font-size: 0.85rem;
}

.matchup-info .teams {
    color: var(--text-muted);
}

.pick-box {
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 80px;
    text-align: center;
}

.pick-box.correct {
    background: var(--success-light);
    color: #166534;
}

.pick-box.incorrect {
    background: var(--danger-light);
    color: #991b1b;
}

.pick-box.pending {
    background: var(--bg-light);
    color: var(--text-muted);
}

.pick-box.same {
    box-shadow: 0 0 0 2px var(--primary);
}

.pick-box.different {
    box-shadow: 0 0 0 2px var(--warning);
}

.round-section {
    margin-bottom: 20px;
}

.round-section h4 {
    background: var(--primary);
    color: white;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    margin-bottom: 10px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* === SUMMARY STATS === */
.summary-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
}

.stat-card .number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.stat-card .label {
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === LIVE INDICATOR === */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--danger);
    font-weight: 600;
}

.live-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

/* === CHAMPIONSHIP HIGHLIGHT === */
.round:last-child .round-header {
    background: linear-gradient(135deg, #ca8a04, #fbbf24);
    color: #1a1a1a;
}

/* === CHAMPION CELEBRATION BANNER === */
.champion-banner {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 30%, #d97706 70%, #b45309 100%);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(245, 158, 11, 0.25);
    animation: championReveal 0.6s ease-out;
}

@keyframes championReveal {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.champion-banner::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255,255,255,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 30%, rgba(255,255,255,0.1) 0%, transparent 40%);
    pointer-events: none;
}

.champion-trophy {
    font-size: 3.5rem;
    margin-bottom: 8px;
    display: block;
    animation: trophyBounce 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
}

@keyframes trophyBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-6px) rotate(-3deg); }
    75% { transform: translateY(-6px) rotate(3deg); }
}

.champion-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: rgba(120, 53, 0, 0.7);
    margin-bottom: 8px;
}

.champion-name {
    font-size: 2rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 4px;
    text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}

.champion-subtitle {
    font-size: 0.85rem;
    color: rgba(120, 53, 0, 0.6);
    font-weight: 500;
}

/* Confetti particles (CSS-only) */
.champion-confetti {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    opacity: 0;
    animation: confettiFall 3s ease-in-out forwards;
}

@keyframes confettiFall {
    0% {
        opacity: 1;
        transform: translateY(-20px) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(200px) rotate(720deg) scale(0.3);
    }
}

/* === UNDO WINNER BUTTON === */
.undo-winner-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border: none;
    background: rgba(0,0,0,0.08);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0;
    transition: all 0.2s;
    z-index: 2;
    line-height: 1;
    padding: 0;
}

.matchup:hover .undo-winner-btn {
    opacity: 0.6;
}

.undo-winner-btn:hover {
    opacity: 1 !important;
    background: var(--danger-light);
    color: var(--danger);
}

/* === VOTING BRACKET STYLES === */
.voting-matchup {
    position: relative;
}

.voting-matchup .team {
    transition: all 0.15s ease;
}

.voting-matchup .team[data-votable="true"] {
    cursor: pointer;
}

.voting-matchup .team[data-votable="true"]:hover {
    background: var(--info-light);
    transform: translateX(2px);
}

.voting-matchup .team.voted {
    background: var(--info-light);
    border-left: 3px solid var(--info);
    padding-left: 11px;
}

.vote-bar-container {
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--bg-light);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    overflow: hidden;
    display: flex;
}

.vote-bar-1 {
    background: var(--primary);
    height: 100%;
    transition: width 0.4s ease;
}

.vote-bar-2 {
    background: var(--accent);
    height: 100%;
    transition: width 0.4s ease;
}

.vote-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--bg-light);
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: auto;
    font-weight: 600;
    min-width: 28px;
    text-align: center;
}

.voting-badge {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--info);
    background: var(--info-light);
    padding: 2px 0;
    text-align: center;
    letter-spacing: 0.5px;
}

/* Voting admin controls */
.voting-controls {
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.voting-controls h4 {
    font-size: 0.9rem;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.voting-round-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.voting-round-controls select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.voting-round-controls .btn {
    font-size: 0.85rem;
    padding: 6px 14px;
}

/* Voting stats section */
.voting-stats {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
}

.voting-stats h3 {
    font-size: 1rem;
    margin-bottom: 12px;
}

.voting-stats .stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.voting-stats .stat-row:last-child {
    border-bottom: none;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .bracket {
        gap: 20px;
        padding: 12px;
    }
    
    .round {
        min-width: 150px;
    }
    
    .round-header {
        padding: 8px 12px;
        font-size: 0.7rem;
    }
    
    .team {
        padding: 10px 12px;
    }
    
    .team .name {
        font-size: 0.85rem;
    }
    
    .team .seed {
        font-size: 0.65rem;
        min-width: 24px;
    }
    
    .compare-container {
        grid-template-columns: 1fr;
    }
    
    .summary-stats {
        grid-template-columns: 1fr;
    }
    
    .champion-name {
        font-size: 1.5rem;
    }
    
    .champion-trophy {
        font-size: 2.5rem;
    }
    
    .champion-banner {
        padding: 24px 16px;
    }
}

/* === PRINT === */
@media print {
    .bracket-wrapper {
        overflow: visible;
    }
    
    .bracket {
        background: white;
    }
    
    .round-header {
        background: #333 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .matchup {
        border: 1px solid #ccc;
    }
    
    .team.winner {
        background: #e8f5e9 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ============================================ */
/* CONDENSED BRACKET — 64-team full bracket view */
/* ============================================ */
.bracket-condensed {
    gap: 4px;
    padding: 4px;
}

.bracket-condensed .round {
    min-width: 110px;
}

.bracket-condensed .round-header {
    padding: 3px 6px;
    font-size: 0.55rem;
    margin-bottom: 3px;
}

.bracket-condensed .matchups {
    gap: 2px;
}

.bracket-condensed .matchup {
    border-radius: 3px;
}

.bracket-condensed .team {
    padding: 2px 5px;
    gap: 3px;
}

.bracket-condensed .team .seed {
    font-size: 0.55rem;
    min-width: 14px;
    padding: 0 2px;
    border-radius: 2px;
}

.bracket-condensed .team .name {
    font-size: 0.6rem;
    font-weight: 500;
}

.bracket-condensed .team .score {
    font-size: 0.55rem;
    min-width: 14px;
}

.bracket-condensed .team .team-color {
    width: 2px;
}

.bracket-condensed .game-info {
    padding: 1px 5px;
    font-size: 0.45rem;
}

.bracket-condensed .matchup .live-indicator {
    font-size: 0.45rem;
    padding: 1px 3px;
}

.bracket-condensed .matchup .undo-winner-btn {
    width: 12px;
    height: 12px;
    font-size: 0.45rem;
}

.bracket-condensed .bye-matchup {
    opacity: 0.3;
}

.bracket-condensed .bye-matchup .team {
    padding: 1px 5px;
}

/* ============================================ */
/* FACING BRACKET — ESPN-style left/right layout */
/* ============================================ */
.facing-bracket {
    display: flex;
    gap: 0;
    min-width: 1100px;
    padding: 8px;
}

.facing-left,
.facing-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.facing-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
    padding: 0 4px;
    align-self: stretch;
}

.fc-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.fc-slot.fc-top {
    flex: 1;
    justify-content: flex-end;
    padding-bottom: 8px;
}

.fc-slot.fc-mid {
    padding: 8px 0;
}

.fc-slot.fc-bottom {
    flex: 1;
    justify-content: flex-start;
    padding-top: 8px;
}

.fc-label {
    font-size: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.facing-region {
    position: relative;
}

.facing-region-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-align: center;
    padding: 4px 0;
}

/* Right-side bracket (text right-aligned, flows inward) */
.bracket-right .team {
    flex-direction: row-reverse;
    text-align: right;
}

.bracket-right .team .team-color {
    left: auto;
    right: 0;
    border-radius: 0 2px 2px 0;
}

.bracket-right .team:first-child .team-color {
    border-radius: 0 2px 0 0;
}

.bracket-right .team:last-child .team-color {
    border-radius: 0 0 2px 0;
}

.bracket-right .game-info {
    flex-direction: row-reverse;
}

/* ============================================ */
/* FINAL FOUR — facing layout with region labels */
/* ============================================ */
.ff-facing {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    padding: 32px 16px;
    min-height: 280px;
}

.ff-side {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.ff-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.ff-region-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.ff-matchup {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    min-width: 160px;
}

.ff-matchup-label {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    text-align: center;
    padding: 4px;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-light);
}

.ff-matchup .ff-team {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.ff-matchup .ff-team:hover {
    background: var(--bg-light);
}

.ff-matchup .ff-team.winner {
    background: var(--success-light);
}

.ff-matchup .ff-team + .ff-team {
    border-top: 1px solid var(--border-light);
}

.ff-champ {
    background: var(--bg-white);
    border: 2px solid #ca8a04;
    border-radius: var(--radius-md);
    overflow: hidden;
    min-width: 160px;
}

.ff-champ-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #92400e;
    text-align: center;
    padding: 6px;
    background: #fef3c7;
    border-bottom: 1px solid #fde68a;
}

.ff-champ .ff-team {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    cursor: pointer;
}

.ff-champ .ff-team:hover {
    background: var(--bg-light);
}

.ff-champ .ff-team.winner {
    background: var(--success-light);
}

.ff-champ .ff-team + .ff-team {
    border-top: 1px solid var(--border-light);
}

@media (max-width: 600px) {
    .ff-facing {
        flex-direction: column;
        gap: 16px;
    }
}