/* Minimal teletext-inspired styling */
:root {
    --bg: #000;
    --fg: #ddd;
    --accent: #00ff00;
    /* green */
    --warn: #ffff00;
    /* yellow */
    --error: #ff0000;
    /* red */
    --info: #00aaff;
    /* blue */
    --border: #222;
}

html,
body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.ttx-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 12px;
}

.ttx-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 8px 12px;
    background: #111;
    border: 2px solid #222;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ttx-brand {
    font-weight: 600;
    font-size: 18px;
}

.ttx-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex: 1;
}

.ttx-season-line {
    display: flex;
    gap: 6px;
    font-size: 14px;
    color: #888;
    order: 0;
}

.ttx-week-nav {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    font-size: 14px;
    order: 1;
}

.ttx-week-label {
    color: var(--warn);
}

.ttx-sep {
    color: #444;
}

@media (min-width: 600px) {
    .ttx-header {
        align-items: center;
        justify-content: space-between;
    }

    /* Center the season line when enough width (three columns layout) */
    .ttx-season-line {
        font-size: 15px;
        flex: 1 1 auto;
        justify-content: center;
        display: flex;
    }

    .ttx-week-nav {
        font-size: 15px;
    }

    .ttx-brand {
        font-size: 20px;
    }
}

/* Allow header children to sit on one line when space; fallback wraps naturally */
.ttx-header>.ttx-season-line {
    order: 1;
}

.ttx-header>.ttx-week-nav {
    order: 2;
}

@media (max-width: 599px) {

    /* On narrow screens stack: brand, season line, then week nav */
    .ttx-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ttx-header>.ttx-season-line {
        justify-content: flex-start;
    }

    .ttx-header>.ttx-week-nav {
        justify-content: flex-start;
    }
}

.ttx-sep-dot {
    color: #555;
}

.ttx-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 12px;
}

/* Always single column layout enforced; historical two-column option removed. */

.ttx-panel {
    border: 2px solid #222;
    background: #0a0a0a;
}

.ttx-panel-spaced {
    margin-top: 12px;
}

.ttx-panel h2 {
    margin: 0;
    padding: 6px 10px;
    background: #111;
    color: var(--info);
    font-size: 14px;
}

.ttx-subtitle {
    margin: 6px 10px 0 10px;
    font-size: 12px;
    color: var(--accent);
    text-transform: uppercase;
}

.ttx-list {
    list-style: none;
    margin: 0;
    padding: 8px 10px;
}

.ttx-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px dotted #222;
}

.ttx-item:last-child {
    border-bottom: none;
}

.ttx-team {
    color: var(--fg);
    display: inline-flex;
    align-items: center;
}

.ttx-record {
    display: inline-flex;
    align-items: center;
    gap: 0;
    font-variant-numeric: tabular-nums;
}

.ttx-record-wins,
.ttx-record-losses,
.ttx-record-ties {
    min-width: 12px;
    text-align: center;
}

.ttx-record-wins {
    color: var(--accent);
    font-weight: 700;
}

.ttx-record-losses {
    color: var(--error);
    font-weight: 700;
}

.ttx-record-ties {
    color: var(--warn);
    font-weight: 600;
}

.ttx-record-sep {
    padding: 0 2px;
    color: var(--fg);
}

/* Two-line team block */
.ttx-teams {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.1;
}

@media (max-width: 420px) {
    .ttx-teams {
        font-size: 13px;
    }

    /* Align live meta to top when teams are stacked */
    .ttx-item {
        align-items: start;
    }

    /* Keep two-column layout on narrow screens but reduce font size */
    .ttx-live-meta {
        white-space: normal;
        flex-wrap: wrap;
        font-size: 12px;
        gap: 4px 8px;
    }

    .ttx-live-meta .ttx-score,
    .ttx-live-meta .ttx-status-live {
        display: inline-block;
    }
}

.ttx-score {
    color: var(--accent);
}

.ttx-status-live {
    color: var(--warn);
}

.ttx-status-final {
    color: var(--error);
}

.ttx-status-upcoming {
    color: var(--info);
}

/* Winner / tie highlighting in final games */
.ttx-winner {
    color: var(--accent);
    font-weight: 700;
}

.ttx-tie {
    color: var(--warn);
    font-weight: 600;
}

/* Live meta (score + clock) container */
.ttx-live-meta {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

/* Slightly larger text on wider screens */
@media (min-width: 600px) {
    .ttx-live-meta {
        font-size: 14px;
    }
}

.muted {
    color: #888;
}

.ttx-link {
    color: var(--info);
    text-decoration: none;
}

.ttx-link:hover {
    text-decoration: underline;
}

/* Playoff Bracket Styles */
.ttx-bracket-panel {
    overflow-x: auto;
}

.ttx-bracket-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 8px 10px;
}

@media (min-width: 768px) {
    .ttx-bracket-container {
        flex-direction: row;
        justify-content: space-between;
    }
}

.ttx-bracket-conference {
    flex: 1;
    min-width: 200px;
}

.ttx-bracket-superbowl {
    flex: 0 0 auto;
    min-width: 180px;
    text-align: center;
    padding: 0 12px;
    border-left: 1px solid #333;
    border-right: 1px solid #333;
}

@media (max-width: 767px) {
    .ttx-bracket-superbowl {
        border-left: none;
        border-right: none;
        border-top: 1px solid #333;
        border-bottom: 1px solid #333;
        padding: 12px 0;
    }
}

.ttx-seeds {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    margin-bottom: 12px;
    font-size: 11px;
}

.ttx-seed {
    display: flex;
    align-items: center;
    gap: 2px;
}

.ttx-seed-num {
    color: var(--warn);
    font-size: 10px;
}

.ttx-seed-team {
    color: var(--fg);
}

.ttx-seed.ttx-eliminated {
    text-decoration: line-through;
    opacity: 0.5;
}

.ttx-bracket-games {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ttx-bracket-game {
    border: 1px solid #333;
    padding: 6px 8px;
    background: #111;
}

.ttx-bracket-round {
    font-size: 10px;
    color: var(--info);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.ttx-bracket-matchup {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ttx-bracket-team {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.ttx-bracket-team .ttx-seed-num {
    min-width: 20px;
}

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

.ttx-bracket-team .ttx-game-score {
    min-width: 20px;
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.ttx-bracket-team.ttx-winner {
    color: var(--accent);
    font-weight: 700;
}

.ttx-bracket-team.ttx-winner .ttx-game-score {
    color: var(--accent);
}

.ttx-bracket-status {
    font-size: 10px;
    text-transform: uppercase;
    margin-top: 4px;
}

.ttx-bracket-status.ttx-status-final {
    color: var(--error);
}

.ttx-bracket-status.ttx-status-live {
    color: var(--warn);
}

.ttx-bracket-status.ttx-status-upcoming {
    color: var(--info);
}

.ttx-superbowl-game {
    border: 2px solid var(--warn);
    background: #1a1a00;
}

.ttx-superbowl-game .ttx-bracket-matchup {
    align-items: center;
}

.ttx-vs {
    color: #666;
    font-size: 10px;
    padding: 2px 0;
}

.ttx-logo {
    display: inline-block;
    width: 24px;
    height: 16px;
    vertical-align: middle;
    margin-right: 8px;
    flex-shrink: 0;
}
