/* ============================================
   BIG TEN TOURNAMENT BRACKET
   Visual bracket for the 18-team tournament
   ============================================ */

/* Bracket Section */
.bracket-section {
    margin: 1.5rem 0;
    background: var(--bg-card, #1a1a1a);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 16px;
    padding: 1.25rem;
    max-width: 1100px;
    width: 100%;
}

.bracket-header {
    text-align: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.08));
}

.bracket-title {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary, #fff);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bracket-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted, #666);
    margin-top: 0.2rem;
}

.bracket-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.bracket-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.65rem;
    color: var(--text-muted, #666);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-dot.neb { background: var(--accent, #d00000); }
.legend-dot.neb-side { background: rgba(208, 0, 0, 0.35); }
.legend-dot.tbd { background: var(--border, rgba(255,255,255,0.15)); }

/* Bracket Container - Horizontal Scroll */
.bracket-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--accent, #d00000) transparent;
}

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

.bracket-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.bracket-wrapper::-webkit-scrollbar-thumb {
    background: var(--accent, #d00000);
    border-radius: 4px;
}

/* The Bracket Grid */
#bracket {
    display: flex;
    align-items: stretch;
    min-width: 1020px;
    gap: 0;
    position: relative;
}

/* Individual Round Column */
#bracket > .bracket-round {
    display: flex;
    flex-direction: column;
    min-width: 165px;
    flex: 1;
    padding: 0 3px;
    flex-shrink: 0;
}

.bracket-section .bracket-round-header {
    text-align: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--border, rgba(255,255,255,0.08));
    flex-shrink: 0;
}

.round-name {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.7rem;
    color: var(--text-primary, #fff);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.round-day {
    font-size: 0.6rem;
    color: var(--text-muted, #666);
    margin-top: 0.1rem;
}

/* Games container within a round */
.round-games {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex: 1;
    gap: 6px;
    padding: 4px 0;
}

/* Half separator */
.bracket-half-label {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.55rem;
    font-weight: 600;
    color: var(--accent, #d00000);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
    padding: 4px 0;
    opacity: 0.6;
}

/* Individual Game Card */
.bracket-game {
    background: var(--bg-card, #1a1a1a);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
}

[data-theme="light"] .bracket-game {
    background: #fff;
    border-color: rgba(0,0,0,0.1);
}

.bracket-game:hover {
    border-color: var(--text-muted, #666);
    transform: translateY(-1px);
}

/* Nebraska's game - highlighted */
.bracket-game.neb-game {
    border: 2px solid var(--accent, #d00000);
    box-shadow: 0 0 20px rgba(208, 0, 0, 0.2);
}

.bracket-game.neb-game:hover {
    box-shadow: 0 0 30px rgba(208, 0, 0, 0.3);
}

/* Games on Nebraska's side of the bracket */
.bracket-game.neb-side {
    border-color: rgba(208, 0, 0, 0.25);
}

/* Team Row within a Game */
.game-team {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.72rem;
    color: var(--text-primary, #fff);
    transition: background 0.2s;
    min-height: 26px;
}

.game-team:first-child {
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
}

/* Nebraska team row highlight */
.game-team.is-nebraska {
    background: rgba(208, 0, 0, 0.12);
    font-weight: 700;
}

[data-theme="light"] .game-team.is-nebraska {
    background: rgba(208, 0, 0, 0.08);
}

.game-team.is-winner {
    font-weight: 700;
}

.game-team.is-loser {
    opacity: 0.35;
}

/* TBD team styling */
.game-team.is-tbd {
    color: var(--text-muted, #666);
    font-style: italic;
}

.team-seed {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    color: var(--text-muted, #666);
    min-width: 16px;
    font-size: 0.65rem;
    text-align: right;
}

.game-team.is-nebraska .team-seed {
    color: var(--accent, #d00000);
}

.team-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-info {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
    margin-left: auto;
}

.team-ap-rank {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.5rem;
    color: var(--accent, #d00000);
    background: rgba(208, 0, 0, 0.12);
    padding: 0.05rem 0.25rem;
    border-radius: 3px;
    white-space: nowrap;
    letter-spacing: 0.02em;
}

[data-theme="light"] .team-ap-rank {
    background: rgba(208, 0, 0, 0.08);
}

.team-record {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    font-size: 0.55rem;
    color: var(--text-muted, #666);
    min-width: 18px;
    text-align: right;
}

.team-score {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 0.7rem;
    color: var(--text-muted, #666);
    min-width: 18px;
    text-align: right;
}

.game-team.is-winner .team-score {
    color: var(--success, #22c55e);
}

/* Game info bar */
.game-meta {
    padding: 0.2rem 0.5rem;
    font-size: 0.55rem;
    color: var(--text-muted, #666);
    background: var(--bg-secondary, #111);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

[data-theme="light"] .game-meta {
    background: #f5f5f5;
}

.game-tv {
    color: var(--accent, #d00000);
    font-weight: 700;
}

.game-number {
    font-weight: 700;
    opacity: 0.7;
    letter-spacing: 0.02em;
}

/* Championship game special styling */
.bracket-game.championship {
    border: 2px solid var(--gold, #FFD54F);
    background: linear-gradient(135deg, rgba(255, 213, 79, 0.08), rgba(255, 213, 79, 0.02));
}

[data-theme="light"] .bracket-game.championship {
    background: linear-gradient(135deg, rgba(255, 213, 79, 0.12), rgba(255, 213, 79, 0.04));
}

.bracket-game.championship .game-meta {
    background: rgba(255, 213, 79, 0.1);
}

/* Connector lines between rounds */
.bracket-game::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    width: 6px;
    height: 1px;
    background: var(--border, rgba(255,255,255,0.1));
    pointer-events: none;
}

.bracket-game.neb-game::after,
.bracket-game.neb-side::after {
    background: rgba(208, 0, 0, 0.3);
}

/* Last round (championship) doesn't need a connector */
.bracket-round:last-child .bracket-game::after {
    display: none;
}

/* Nebraska Path Highlight */
.neb-path-label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(208, 0, 0, 0.1);
    border: 1px solid rgba(208, 0, 0, 0.25);
    color: var(--accent, #d00000);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    margin: 2px auto;
}

/* Round Navigation Pills (mobile) */
.bracket-nav {
    display: none;
    justify-content: center;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.bracket-nav-pill {
    padding: 0.3rem 0.6rem;
    background: transparent;
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    border-radius: 100px;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-muted, #666);
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Space Grotesk', sans-serif;
}

.bracket-nav-pill:hover,
.bracket-nav-pill.active {
    background: var(--accent, #d00000);
    border-color: var(--accent, #d00000);
    color: white;
}

.bracket-nav-pill.neb-round {
    border-color: rgba(208, 0, 0, 0.4);
    color: var(--accent, #d00000);
}

/* Nebraska Countdown Card */
.neb-countdown-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    background: linear-gradient(135deg, rgba(208, 0, 0, 0.1), rgba(208, 0, 0, 0.03));
    border: 1px solid rgba(208, 0, 0, 0.25);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.neb-countdown-info {
    text-align: center;
}

.neb-countdown-label {
    font-size: 0.65rem;
    color: var(--text-muted, #666);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.neb-countdown-matchup {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text-primary, #fff);
}

.neb-countdown-matchup .accent {
    color: var(--accent, #d00000);
}

.neb-countdown-details {
    font-size: 0.75rem;
    color: var(--text-secondary, #a0a0a0);
    margin-top: 0.15rem;
}

.neb-countdown-timer {
    display: flex;
    gap: 0.75rem;
}

.neb-cd-unit {
    text-align: center;
}

.neb-cd-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent, #d00000);
    line-height: 1;
}

.neb-cd-label {
    font-size: 0.55rem;
    color: var(--text-muted, #666);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.15rem;
}

/* Scroll hint for mobile */
.bracket-scroll-hint {
    display: none;
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-muted, #666);
    margin-bottom: 0.5rem;
    animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    20%, 80% { opacity: 1; }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 1100px) {
    .bracket-scroll-hint {
        display: block;
    }

    .bracket-nav {
        display: flex;
    }
}

@media (max-width: 768px) {
    .bracket-section {
        padding: 1rem 0.75rem;
        border-radius: 12px;
        margin: 1rem -0.5rem;
        width: calc(100% + 1rem);
    }

    .bracket-title {
        font-size: 0.95rem;
    }

    .bracket {
        min-width: 900px;
    }

    .bracket-round {
        min-width: 140px;
    }

    .game-team {
        font-size: 0.68rem;
        padding: 0.3rem 0.4rem;
    }

    .neb-countdown-card {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem 1rem;
    }

    .neb-countdown-matchup {
        font-size: 0.95rem;
    }

    .neb-cd-value {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .bracket-section {
        padding: 0.75rem 0.5rem;
    }

    .bracket {
        min-width: 840px;
    }

    .bracket-round {
        min-width: 130px;
    }

    .round-name {
        font-size: 0.6rem;
    }

    .game-team {
        font-size: 0.62rem;
        padding: 0.25rem 0.35rem;
        min-height: 22px;
    }

    .team-seed {
        font-size: 0.58rem;
        min-width: 14px;
    }

    .game-meta {
        font-size: 0.5rem;
        padding: 0.15rem 0.35rem;
    }
}

/* =====================================================
   LIGHT MODE
   ===================================================== */
[data-theme="light"] .bracket-section {
    background: #fff;
    border-color: rgba(0,0,0,0.08);
}

[data-theme="light"] .bracket-header {
    border-color: rgba(0,0,0,0.08);
}

[data-theme="light"] .bracket-round-header {
    border-color: rgba(0,0,0,0.08);
}

[data-theme="light"] .bracket-game::after {
    background: rgba(0,0,0,0.1);
}

[data-theme="light"] .neb-countdown-card {
    background: linear-gradient(135deg, rgba(208, 0, 0, 0.06), rgba(208, 0, 0, 0.02));
}

[data-theme="light"] .bracket-nav-pill {
    border-color: rgba(0,0,0,0.1);
}
