:root {
    --color-bg: #f4f6f8;
    --color-bg-surface: #ffffff;
    --color-bg-surface-hover: #eef3f8;
    --color-primary: #b45309;
    --color-primary-hover: #92400e;
    --color-primary-rgb: 180, 83, 9;
    --color-text: #1e293b;
    --color-text-muted: #64748b;
    --color-text-inverse: #ffffff;
    --color-border: #dce3ea;
    --color-success: #16a34a;
    --color-danger: #dc2626;

    --color-nav-bg: #1e3a5f;
    --color-nav-text: #93b4d8;
    --color-nav-text-active: #ffffff;
    --color-nav-border: #2d5188;

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Barlow Condensed', sans-serif;
    --radius: 8px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ── Admin dark theme override ── */
[data-theme="dark"] {
    --color-bg: #1a1a2e;
    --color-bg-surface: #16213e;
    --color-bg-surface-hover: #1f3056;
    --color-primary: #d4920e;
    --color-primary-hover: #f0a820;
    --color-primary-rgb: 212, 146, 14;
    --color-text: #e0e0e0;
    --color-text-muted: #a0a0b0;
    --color-text-inverse: #1a1a2e;
    --color-border: #2a2a4a;
    --color-success: #2ecc71;
    --color-danger: #e74c3c;

    --color-nav-bg: #16213e;
    --color-nav-text: #a0a0b0;
    --color-nav-text-active: #9393a3;
    --color-nav-border: #2a2a4a;

    --shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ── Reset ── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ── Base ── */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    color: var(--color-primary-hover);
}

/* ── Layout ── */
.site-header {
    background: var(--color-nav-bg);
    border-bottom: 1px solid var(--color-nav-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

/* ── Quote Banner ── */
.quote-banner {
    background: var(--color-nav-bg);
    border-top: 1px solid var(--color-primary);
    border-bottom: 1px solid var(--color-nav-border);
    padding: 0.4rem 1.5rem;
    text-align: center;
    font-size: 0.875rem;
}

.quote-banner__text {
    font-style: italic;
    color: var(--color-nav-text);
}

.quote-banner__text::before {
    content: '\201C';
    color: var(--color-primary);
    font-size: 1.15em;
    margin-right: 0.15em;
    font-style: normal;
}

.quote-banner__text::after {
    content: '\201D';
    color: var(--color-primary);
    font-size: 1.15em;
    margin-left: 0.15em;
    font-style: normal;
}

.quote-banner__attribution {
    color: var(--color-nav-text);
    margin-left: 0.75rem;
    font-size: 0.8rem;
}

.nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    height: 3.5rem;
}

.nav__brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-nav-text-active);
    margin-right: 2.5rem;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-transform: uppercase;
}

.nav__logo {
    height: 28px;
    width: 28px;
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
    padding: 2px;
}

.nav__links {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 0.25rem;
    flex: 1;
}

.nav__link {
    color: var(--color-nav-text);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: color 0.15s, background 0.15s;
}

.nav__link:hover {
    color: var(--color-nav-text-active);
    background: rgba(255, 255, 255, 0.1);
}

.nav__link--active {
    color: var(--color-nav-text-active);
}

/* Pushes the auth items (Admin + user menu, or Sign in) to the far right */
.nav__spacer {
    margin-left: auto;
}

/* Buttons that must look like nav links (dropdown toggle) */
.nav__link--button {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    line-height: inherit;
}

/* User menu: username tab opening Profile / Sign out */
.nav__dropdown {
    position: relative;
}

.nav__dropdown-caret {
    font-size: 0.7em;
    margin-left: 0.35rem;
}

.nav__dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 0.25rem);
    min-width: 9rem;
    background: var(--color-nav-bg);
    border: 1px solid var(--color-nav-border);
    border-radius: var(--radius);
    padding: 0.25rem;
    list-style: none;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.nav__dropdown--open .nav__dropdown-menu {
    display: block;
}

.nav__dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.75rem;
    color: var(--color-nav-text);
    border-radius: var(--radius);
    font-size: 0.9rem;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.nav__dropdown-item:hover {
    color: var(--color-nav-text-active);
    background: rgba(255, 255, 255, 0.1);
}

.nav__toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-nav-text-active);
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: auto;
    padding: 0.25rem;
}

main {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 1.25rem 1.5rem;
}

/* ── Home page hero ── */
.home-hero {
    position: relative;
    width: 100vw;
    left: 50%;
    transform: translateX(-50%);
    margin-top: -1.25rem;
    margin-bottom: 2.5rem;
    background: var(--color-nav-bg);
    border-bottom: 3px solid var(--color-primary);
}

.home-hero__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3.5rem 1.5rem 3rem;
}

.home-hero__eyebrow {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.home-hero__title {
    font-family: var(--font-display);
    font-size: clamp(3.5rem, 8vw, 6rem);
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    letter-spacing: 0.02em;
    margin-bottom: 0.6rem;
}

.home-hero__tagline {
    font-size: 1rem;
    color: var(--color-nav-text);
    letter-spacing: 0.04em;
    margin-bottom: 2.5rem;
}

.home-hero__stats {
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.home-hero__stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.home-hero__stat-num {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.home-hero__stat-label {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-nav-text);
}

/* ── Home page nav grid ── */
.home-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-bg-surface);
}

.home-nav__item {
    display: block;
    padding: 1.25rem 1.5rem;
    text-decoration: none;
    color: inherit;
    border-right: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    border-left: 3px solid transparent;
    transition: border-left-color 0.15s, background 0.15s;
}

.home-nav__item:hover {
    background: var(--color-bg-surface-hover);
    border-left-color: var(--color-primary);
}

/* remove right border on last column, bottom border on last row */
.home-nav__item:nth-child(3n) { border-right: none; }
.home-nav__item:nth-last-child(-n+3) { border-bottom: none; }

.home-nav__title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.35rem;
    letter-spacing: 0.02em;
    transition: color 0.15s;
}

.home-nav__item:hover .home-nav__title {
    color: var(--color-primary);
}

.home-nav__desc {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

@media (max-width: 768px) {
    .home-hero__stats {
        gap: 1.5rem;
    }

    .home-hero__inner {
        padding: 2.5rem 1rem 2rem;
    }

    .home-nav {
        grid-template-columns: 1fr 1fr;
    }

    .home-nav__item:nth-child(3n) { border-right: 1px solid var(--color-border); }
    .home-nav__item:nth-last-child(-n+3) { border-bottom: 1px solid var(--color-border); }
    .home-nav__item:nth-child(2n) { border-right: none; }
    .home-nav__item:nth-last-child(-n+2) { border-bottom: none; }
}

@media (max-width: 480px) {
    .home-nav {
        grid-template-columns: 1fr;
    }

    .home-nav__item:nth-child(2n) { border-right: none; }
    .home-nav__item:nth-last-child(-n+2) { border-bottom: 1px solid var(--color-border); }
    .home-nav__item:last-child { border-bottom: none; }
}

.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 1.5rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* ── Page title ── */
.page-title {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1.25rem;
    letter-spacing: 0.01em;
    line-height: 1.1;
}

/* ── Cards ── */
.card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.875rem 1rem;
    box-shadow: var(--shadow);
}

.card:hover {
    border-color: var(--color-bg-surface-hover);
}

/* ── Tables ── */
table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    text-align: left;
    color: var(--color-text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

tbody td {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.875rem;
}

tbody tr:hover {
    background: var(--color-bg-surface-hover);
}

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: var(--font-family);
    cursor: pointer;
    transition: background 0.15s;
}

.btn--primary {
    background: var(--color-primary);
    color: var(--color-text-inverse);
}

.btn--primary:hover {
    background: var(--color-primary-hover);
}

.btn--outline {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn--outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

/* ── Forms ── */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-input {
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-family: var(--font-family);
    font-size: 0.95rem;
    transition: border-color 0.15s;
}

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

.form-input--sm {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
}

.btn--full {
    width: 100%;
    justify-content: center;
}

.btn--sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

.btn--danger {
    background: var(--color-danger);
    color: var(--color-text-inverse);
}

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

.btn--success {
    background: var(--color-success);
    color: var(--color-text-inverse);
}

.btn--success:hover {
    background: #15803d;
}

/* ── Alerts ── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.alert--danger {
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid var(--color-danger);
    color: var(--color-danger);
}

.alert--success {
    background: rgba(22, 163, 74, 0.08);
    border: 1px solid var(--color-success);
    color: var(--color-success);
}

.alert--warning {
    background: rgba(217, 119, 6, 0.08);
    border: 1px solid #d97706;
    color: #d97706;
}

/* ── Auth pages ── */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 3rem;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.auth-card__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
}

/* ── Admin Dashboard ── */
.admin-section {
    margin-bottom: 2.5rem;
}

.admin-section__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.admin-section__title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.02em;
}

.admin-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.status-badge--running {
    background: rgba(180, 83, 9, 0.12);
    color: #b45309;
}

.status-badge--completed {
    background: rgba(22, 163, 74, 0.12);
    color: var(--color-success);
}

.status-badge--failed {
    background: rgba(220, 38, 38, 0.12);
    color: var(--color-danger);
}

.status-badge--partial {
    background: rgba(217, 119, 6, 0.12);
    color: #d97706;
}

.inline-form {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
}

/* ── HTMX indicator ── */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    display: inline-block;
}

/* ── Teams page ── */
.teams-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.teams-header .page-title {
    margin-bottom: 0;
}

.teams-header__meta {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.teams-search {
    position: relative;
    margin-bottom: 2rem;
}

.teams-search__input {
    padding-left: 1rem;
    padding-right: 6rem;
    font-size: 1rem;
    height: 3rem;
}

.teams-search__count {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.teams-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

.conference-group {
    margin-bottom: 2rem;
}

.conference-group__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.6rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid var(--color-border);
    letter-spacing: 0.02em;
}

.conference-group__logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.6rem;
}

.team-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, background 0.15s;
}

.team-card:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-surface-hover);
    color: inherit;
}

.team-card__logo-wrap {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
}

.team-card__logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.team-card__logo-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
}

.team-card__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.team-card__name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-card__mascot {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-card__records {
    flex-shrink: 0;
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
}

.team-card__record {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.team-card__conf-record {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

/* ── Team detail page ── */
.team-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.team-hero__logo-wrap {
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0.5rem;
}

.team-hero__logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.team-hero__name {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.1;
    letter-spacing: 0.01em;
}

.team-hero__mascot {
    font-size: 1.1rem;
    color: var(--color-text-muted);
    margin-top: 0.15rem;
}

.team-hero__meta {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.team-hero__conference {
    color: var(--color-primary);
    font-weight: 600;
}

a.team-hero__conference:hover {
    text-decoration: underline;
}

.team-hero__espn-link {
    color: var(--color-text-muted);
    font-size: 0.82rem;
    text-decoration: none;
    border: 1px solid var(--color-border);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius);
    transition: color 0.15s, border-color 0.15s;
}

.team-hero__espn-link:hover {
    color: var(--color-primary);
    border-color: var(--color-primary);
}

/* Schedule section */
.schedule-section {
    margin-bottom: 2rem;
}

/* Season tabs */
.season-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;
}

.season-tabs__tab {
    padding: 0.5rem 1rem;
    border: none;
    background: none;
    color: var(--color-text-muted);
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.season-tabs__tab:hover {
    color: var(--color-text);
}

.season-tabs__tab--active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Season summary */
.season-summary {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.season-summary__record strong {
    color: var(--color-text);
}

.season-summary {
    flex-wrap: wrap;
    row-gap: 0.4rem;
}

.season-summary__round {
    color: var(--color-text-muted);
    font-size: 0.82rem;
    margin-left: 2px;
}

/* Schedule table */
.schedule-table-wrap {
    overflow-x: auto;
}

.schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.schedule-table thead th {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
}

.schedule-table tbody td {
    padding: 0.5rem 0.75rem;
}

.schedule-table__date {
    white-space: nowrap;
    color: var(--color-text-muted);
    width: 5rem;
}

.schedule-table__loc {
    width: 2rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

.schedule-table__opponent {
    white-space: nowrap;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.schedule-table__opp-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-text);
    text-decoration: none;
}

.schedule-table__opp-link:hover {
    color: var(--color-primary);
}

.schedule-table__opp-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.schedule-table__conf-marker {
    color: var(--color-primary);
    font-weight: 700;
    margin-left: 0.2rem;
}

.schedule-table__result {
    white-space: nowrap;
}

.schedule-table__result-badge {
    display: inline-block;
    width: 1.4rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.8rem;
    margin-right: 0.3rem;
}

.schedule-table__result-badge--win {
    color: var(--color-success);
}

.schedule-table__result-badge--loss {
    color: var(--color-danger);
}

.schedule-table__score {
    font-variant-numeric: tabular-nums;
}

.schedule-table__ot {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    font-weight: 600;
    margin-left: 0.2rem;
    vertical-align: middle;
}

.schedule-table__time {
    color: var(--color-text-muted);
    font-size: 0.82rem;
}

.schedule-table__odds {
    font-variant-numeric: tabular-nums;
    color: var(--color-text-muted);
    font-size: 0.82rem;
}

.schedule-table__venue {
    color: var(--color-text-muted);
    font-size: 0.82rem;
    max-width: 14rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schedule-row-win {
    border-left: 2px solid var(--color-success);
}

.schedule-row-loss {
    border-left: 2px solid var(--color-danger);
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .nav__toggle {
        display: block;
    }

    .nav__links {
        display: none;
        position: absolute;
        top: 3.5rem;
        left: 0;
        right: 0;
        flex-direction: column;
        background: var(--color-nav-bg);
        border-bottom: 1px solid var(--color-nav-border);
        padding: 0.5rem;
    }

    .nav__links--open {
        display: flex;
    }

    .nav__link {
        padding: 0.75rem 1rem;
    }

    /* In the dropdown column the spacer has no job, and the user menu
       expands in place instead of floating */
    .nav__spacer {
        display: none;
    }

    .nav__link--button {
        width: 100%;
        text-align: left;
    }

    .nav__dropdown-menu {
        position: static;
        border: none;
        box-shadow: none;
        padding-left: 1rem;
    }

    main {
        padding: 1rem;
    }

    .team-grid {
        grid-template-columns: 1fr;
    }

    .teams-header {
        flex-direction: column;
        gap: 0.25rem;
    }

    .team-hero__logo-wrap {
        width: 60px;
        height: 60px;
    }

    .team-hero__logo {
        width: 48px;
        height: 48px;
    }

    .team-hero__name {
        font-size: 1.35rem;
    }

    .schedule-table__hide-mobile {
        display: none;
    }
}

/* ── QA Page ── */
.qa-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
}

.qa-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
}

.qa-badge--ok {
    background: rgba(22, 163, 74, 0.08);
    color: var(--color-success);
    border: 1px solid rgba(22, 163, 74, 0.3);
}

.qa-badge--warn {
    background: rgba(217, 119, 6, 0.08);
    color: #d97706;
    border: 1px solid rgba(217, 119, 6, 0.3);
}

.qa-delta--mismatch {
    color: var(--color-danger);
    font-weight: 600;
}

.qa-delta--match {
    color: var(--color-text-muted);
}

.qa-team-section {
    padding: 0.75rem 1rem;
}

.qa-team-section summary {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    list-style: none;
    user-select: none;
}

.qa-team-section summary::-webkit-details-marker {
    display: none;
}

.qa-team-section summary::before {
    content: "▶";
    font-size: 0.7rem;
    color: var(--color-text-muted);
    transition: transform 0.15s;
}

.qa-team-section[open] summary::before {
    transform: rotate(90deg);
}

/* ── Analytics / Statistics ── */

.analytics-section {
    margin-top: 3rem;
}

.analytics-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.analytics-season-tabs {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.analytics-tab {
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--color-border);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    user-select: none;
    transition: background 0.15s, color 0.15s;
}

.analytics-tab:hover {
    background: var(--color-bg-surface-hover);
    color: var(--color-text);
}

.analytics-tab--active {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    border-color: var(--color-primary);
}

.analytics-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
    .analytics-charts {
        grid-template-columns: 1fr;
    }
}

.analytics-chart-card {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1rem;
}

.analytics-chart-card__title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.analytics-chart-wrap {
    position: relative;
}

/* Fixed height only on team detail charts (time-series lines) */
.analytics-section .analytics-chart-wrap {
    height: 220px;
}

.analytics-section .analytics-chart-wrap canvas {
    max-height: 220px;
}

.analytics-stats-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.stat-pill {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.6rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    min-width: 6rem;
}

.stat-pill__label {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-pill__value {
    font-size: 1.15rem;
    font-weight: 700;
}

.analytics-link {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
}

    /* Team page top-level tabs (Schedule | Team Profile) */

.team-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.team-tabs__tab {
    padding: 0.6rem 1.1rem;
    border: none;
    background: none;
    color: var(--color-text-muted);
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}

.team-tabs__tab:hover {
    color: var(--color-text);
}

.team-tabs__tab--active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.team-tab-panel[hidden] {
    display: none;
}

/* Team Profile (box-score stat panel) */

.team-stats {
    margin-top: 0;
}

.team-stats__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.team-stats__asof {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 1.25rem;
}

.stat-groups {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 2.5rem;
    align-items: start;
}

@media (max-width: 768px) {
    .stat-groups {
        grid-template-columns: 1fr;
    }
}

.stat-group {
    margin-bottom: 1.5rem;
}

.stat-group__header {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 0.4rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.stat-grid {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.stat-grid__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 4.5rem 6rem minmax(6rem, 9rem);
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.25rem;
    border-radius: var(--radius);
}

.stat-grid__row:hover {
    background: var(--color-bg-surface-hover);
}

.stat-grid__label {
    font-size: 0.9rem;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-grid__value {
    font-size: 0.95rem;
    font-weight: 700;
    text-align: right;
}

.stat-grid__rank {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    text-align: right;
}

.stat-bar {
    height: 6px;
    border-radius: 3px;
    background: var(--color-border);
    overflow: hidden;
}

.stat-bar--empty {
    background: transparent;
}

.stat-bar__fill {
    height: 100%;
    border-radius: 3px;
}

.stat-bar__fill--good {
    background: #22c55e;
}

.stat-bar__fill--bad {
    background: #ef4444;
}

@media (max-width: 640px) {
    .stat-grid__row {
        grid-template-columns: minmax(0, 1fr) 4rem;
        grid-template-areas:
            "label value"
            "bar   rank";
        gap: 0.2rem 0.75rem;
    }
    .stat-grid__label { grid-area: label; }
    .stat-grid__value { grid-area: value; }
    .stat-grid__rank  { grid-area: rank; text-align: left; }
    .stat-bar { grid-area: bar; align-self: center; }
}

/* Season stats page */

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.page-header__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.analytics-date-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.pop-summary {
    padding: 0.6rem 0.75rem;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}

.pop-summary__label {
    font-weight: 600;
    margin-right: 0.5rem;
}

/* ── Phase 3: Predictions ── */

/* Win probability bar */
.prob-bar {
    display: flex;
    border-radius: 4px;
    overflow: hidden;
    height: 24px;
}
.prob-bar--lg { height: 32px; }
.prob-bar--empty {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    align-items: center;
    justify-content: center;
}
.prob-bar__home {
    background: var(--team-color-home, var(--color-primary));
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 6px;
    font-size: 0.75rem;
    color: #fff;
    font-weight: 600;
    min-width: 2rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.prob-bar__away {
    background: var(--team-color-away, #6b7280);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 6px;
    font-size: 0.75rem;
    color: #fff;
    font-weight: 600;
    min-width: 2rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Edge indicator chips */
.edge-chip {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 4px;
}
.edge-chip--high { background: #d1fae5; color: #065f46; }
.edge-chip--low  { color: var(--color-text-muted); }

/* ML badge */
.ml-badge {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 3px;
    background: #ede9fe;
    color: #6d28d9;
    font-size: 0.65rem;
    font-weight: 700;
    vertical-align: middle;
    margin-left: 3px;
}

/* Confidence dim */
.prediction-row--low-confidence { opacity: 0.6; }

/* Predictions page */
.predictions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.predictions-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.predictions-disclaimer {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}
.predictions-date-group {
    margin-bottom: 2rem;
}
.predictions-date-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--color-border);
}
.predictions-games {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}
@media (min-width: 768px) {
    .predictions-games {
        grid-template-columns: 1fr 1fr;
    }
}

/* Prediction card */
.prediction-card {
    padding: 1rem;
}
.prediction-card__teams {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
/* Stacked team layout */
.prediction-card__team-stack {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.prediction-card__team-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--color-text);
}
.prediction-card__team-row:hover .prediction-card__team-name {
    color: var(--color-primary-hover);
}
.prediction-card__team-name {
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.prediction-card__vs {
    font-size: 0.68rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-left: calc(24px + 0.5rem);
}
.prediction-card__prob-pct {
    margin-left: auto;
    font-weight: 700;
    font-size: 1rem;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    color: #ffffff !important;
}
.prediction-card__logo {
    border-radius: 2px;
    object-fit: contain;
    flex-shrink: 0;
}
/* Donut win-prob chart */
.prob-donut {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.prob-donut--empty {
    border: 1px dashed var(--color-border);
    border-radius: 50%;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}
.prob-donut__svg {
    position: absolute;
    top: 0; left: 0;
    width: 72px;
    height: 72px;
    transform: rotate(-90deg);
}
.prob-donut__track {
    fill: none;
    stroke: var(--da, #6b7280);
    stroke-width: 4;
    opacity: 0.5;
}
.prob-donut__arc {
    fill: none;
    stroke: var(--dh, var(--color-primary));
    stroke-width: 4;
}
.prob-donut__logo {
    position: relative;
    z-index: 1;
    width: 26px;
    height: 26px;
    object-fit: contain;
    border-radius: 2px;
}
.prediction-card__stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}
.prediction-card__stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.prediction-card__stat-label {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.prediction-card__stat-value {
    font-size: 0.9rem;
    font-weight: 600;
}
.prediction-card__stat-value--empty {
    color: var(--color-text-muted);
}
.prediction-card__detail-btn {
    margin-left: auto;
}
.prediction-card__book-odds {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}
.prediction-card__notice {
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

/* Matchup predictor page */
.matchup-form-card {
    margin-bottom: 0;
}
.matchup-form__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: end;
}
@media (min-width: 900px) {
    .matchup-form__row {
        grid-template-columns: 2fr 2fr 1.2fr auto auto;
    }
}
.matchup-form__neutral {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.matchup-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-text);
    cursor: pointer;
    padding: 0.6rem 0;
}
.matchup-checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
    cursor: pointer;
}
.matchup-form__submit {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* Matchup result card */
.matchup-result-card {
    padding: 1.25rem;
}
.matchup-result__meta {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.matchup-neutral-badge {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    background: rgba(147, 147, 163, 0.15);
    border: 1px solid var(--color-border);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}
.matchup-no-data {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    padding: 1rem 0;
}
.matchup-models {
    margin-top: 0.5rem;
    overflow-x: auto;
}
.matchup-models table {
    min-width: 420px;
}
.matchup-models thead th {
    font-size: 0.72rem;
    padding: 0.5rem 0.75rem;
}
.matchup-models tbody td {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    font-variant-numeric: tabular-nums;
}
.matchup-model-name {
    font-weight: 600;
    color: var(--color-text-muted);
    white-space: nowrap;
}
.matchup-cell--muted {
    color: var(--color-border);
}

/* Schedule table date link */
.schedule-table__date-link {
    color: var(--color-text);
    text-decoration: none;
}
.schedule-table__date-link:hover {
    color: var(--color-primary-hover);
}

/* Game detail page */
.game-detail-header {
    margin-bottom: 1.5rem;
}
.game-detail-matchup {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
    flex-wrap: wrap;
}
.game-detail-team {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--color-text);
    flex: 1;
    min-width: 140px;
}
.game-detail-team--away {
    flex-direction: row-reverse;
    text-align: right;
}
.game-detail-team__logo-wrap {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.game-detail-team__logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
}
.game-detail-team__name {
    display: block;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
}
.game-detail-team__mascot {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}
.game-detail-score {
    text-align: center;
    flex-shrink: 0;
}
.game-detail-score__final {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 0.4rem;
}
.game-detail-score__number {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.game-detail-score__sep {
    font-size: 1.25rem;
    color: var(--color-text-muted);
}
.game-detail-score__ot {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    align-self: flex-start;
    margin-top: 0.25rem;
}
.game-detail-score__time {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    display: block;
    margin-bottom: 0.4rem;
}
.game-detail-score__badges {
    display: flex;
    gap: 0.4rem;
    justify-content: center;
    flex-wrap: wrap;
}
.game-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--color-bg-surface);
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.game-status-badge--final { background: #dcfce7; color: #15803d; border-color: #16a34a; }
.game-status-badge--scheduled { background: #fef3c7; color: #92400e; border-color: #b45309; }
.game-detail-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

/* Tournament chip — used on schedule rows and on the game detail header. */
.tournament-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    background: transparent;
    white-space: nowrap;
    vertical-align: middle;
}
.tournament-badge--ncaa       { color: #b45309; border-color: #f59e0b; background: #fef3c7; }
.tournament-badge--conf       { color: #047857; border-color: #34d399; background: #d1fae5; }
.tournament-badge--postseason { color: #1d4ed8; border-color: #60a5fa; background: #dbeafe; }
.tournament-badge--in-season {
    color: var(--color-text-muted);
}

.schedule-table__seed {
    color: var(--color-text-muted);
    font-size: 0.78rem;
    margin-right: 3px;
}
.game-detail-team__seed {
    color: var(--color-text-muted);
    font-size: 0.78rem;
    margin-right: 4px;
    font-weight: 500;
}
.game-detail-meta {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-align: center;
}
.game-detail-section {
    margin-bottom: 1.5rem;
}
.game-detail-section__title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.game-detail-predictions {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
.game-detail-prob-section {}
.game-detail-prob-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
    font-weight: 600;
}
.game-detail-model-grid {}
.game-detail-model-table {
    width: 100%;
}
.game-detail-actual {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}
.game-detail-outcome {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
}
.game-detail-outcome--win { background: #dcfce7; color: #15803d; }
.game-detail-outcome--loss { background: #fee2e2; color: #b91c1c; }

/* ── End Phase 3 ── */

.stats-table .stats-table__rank {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    width: 2rem;
    text-align: right;
}

/* ── Rankings page ── */

.rankings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 900px) {
    .rankings-grid {
        grid-template-columns: 1fr;
    }
}

.rankings-panel {
    padding: 0;
    overflow: visible;
}

.rankings-table-wrap,
.rankings-empty {
    overflow: hidden;
    border-radius: 0 0 var(--radius) var(--radius);
}

.rankings-panel__header {
    padding: 1rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.rankings-panel__title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.02em;
}

.rankings-panel__subtitle {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.rankings-panel__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 50%;
    background: var(--color-text-muted);
    color: var(--color-bg, #fff);
    cursor: default;
    position: relative;
    vertical-align: middle;
    margin-left: 0.25rem;
}

.rankings-panel__badge::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    padding: 0.5rem 0.625rem;
    background: var(--color-surface-alt, #222);
    color: var(--color-text, #eee);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.4;
    border-radius: 4px;
    text-transform: none;
    letter-spacing: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 10;
    white-space: normal;
}

.rankings-panel__badge:hover::after {
    opacity: 1;
}

.rankings-empty {
    padding: 2rem 1.25rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.rankings-table-wrap {
    overflow-y: auto;
    max-height: 72vh;
}

.rankings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.rankings-table thead th {
    font-size: 0.72rem;
    padding: 0.5rem 0.75rem;
    position: sticky;
    top: 0;
    background: var(--color-bg-surface);
    z-index: 1;
}

.rankings-table tbody td {
    padding: 0.45rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.rankings-table tbody tr:hover {
    background: var(--color-bg-surface-hover);
}

.rankings-table__rank-col {
    width: 2.5rem;
    text-align: right;
    padding-right: 0.5rem !important;
}

.rankings-table__num-col {
    width: 5rem;
    text-align: right;
}

.rankings-table__hide-mobile {
    /* hidden below */
}

.rankings-table__team-cell {
    min-width: 0;
}

.rankings-rank {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

.rankings-team-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text);
    text-decoration: none;
    min-width: 0;
}

.rankings-team-link:hover .rankings-team-name {
    color: var(--color-primary-hover);
}

.rankings-team-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
}

.rankings-team-logo-placeholder {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.rankings-team-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rankings-rating {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    font-size: 0.875rem;
}

.rankings-rating--pos { color: var(--color-success); }
.rankings-rating--neg { color: var(--color-danger); }

.rankings-gp {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.rankings-row--low-gp {
    opacity: 0.65;
}

@media (max-width: 600px) {
    .rankings-table__hide-mobile {
        display: none;
    }
}

/* ═══════════════════════════════════════════════════════════════
   Comprehensive Rankings page
   ═══════════════════════════════════════════════════════════════ */

.comp-rankings-filters {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.comp-rankings-count {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-left: auto;
}

.comp-rankings-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.comp-rankings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.81rem;
    line-height: 1.2;
    white-space: nowrap;
}

/* ── Sticky identity columns (rank + team) ── */
.comp-rankings-table th:nth-child(1),
.comp-rankings-table td:nth-child(1) {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--color-bg, #f4f6f8);
}
.comp-rankings-table th:nth-child(2),
.comp-rankings-table td:nth-child(2) {
    position: sticky;
    left: 32px;
    z-index: 2;
    background: var(--color-bg, #f4f6f8);
}
.comp-rankings-table tbody tr:hover td:nth-child(1),
.comp-rankings-table tbody tr:hover td:nth-child(2) {
    background: var(--color-bg-surface-hover, #eef3f8);
}

/* ── Group label row ── */
.comp-rankings-group-row th {
    padding: 4px 7px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    text-align: center;
    border-bottom: 2px solid;
}
.comp-rankings__g-identity {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #3730a3;
    text-align: left;
}
.comp-rankings__g-record {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1;
}
.comp-rankings__g-scoring {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #15803d;
}
.comp-rankings__g-ratings {
    background: #faf5ff;
    border-color: #e9d5ff;
    color: #7c3aed;
}

/* ── Sortable column row ── */
.comp-rankings-col-row th {
    padding: 4px 7px;
    font-size: 0.64rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-align: right;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    user-select: none;
    color: #64748b;
}
.comp-rankings-col-row th:hover { color: #334155; }
.comp-rankings__col--sort-active { color: #b45309 !important; }
.comp-rankings__g-identity-col { text-align: left; }
.comp-rankings__g-record-col   { background: rgba(186, 230, 253, 0.3); }
.comp-rankings__g-scoring-col  { background: rgba(187, 247, 208, 0.3); }
.comp-rankings__g-ratings-col  { background: rgba(233, 213, 255, 0.3); }

/* ── Rank column ── */
.comp-rankings__col--rank { width: 32px; color: #94a3b8; }
.comp-rankings__cell--rank { color: #94a3b8; text-align: right; }

/* ── Team column ── */
.comp-rankings__col--team { min-width: 140px; }
.comp-rankings-table .comp-rankings__cell--team { text-align: left; }

/* ── Conf column ── */
.comp-rankings__col--conf { width: 60px; }
.comp-rankings__cell--conf { text-align: left; color: #64748b; }

/* ── Body rows ── */
.comp-rankings-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
}
.comp-rankings-table tbody tr:hover { background: var(--color-bg-surface-hover, #eef3f8); }
.comp-rankings-table tbody td {
    padding: 5px 7px;
    text-align: right;
    color: #334155;
    font-variant-numeric: tabular-nums;
}

/* ── Group cell tints ── */
.comp-rankings__g-record-td   { background: rgba(186, 230, 253, 0.2); }
.comp-rankings__g-scoring-td  { background: rgba(187, 247, 208, 0.2); }
.comp-rankings__g-ratings-td  { background: rgba(233, 213, 255, 0.2); }

/* ── Mobile scroll hint ── */
.comp-rankings-scroll-hint {
    font-size: 0.65rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 0.4rem;
    display: none;
}
@media (max-width: 900px) {
    .comp-rankings-scroll-hint { display: block; }
}

/* -- Comp. Rankings Tab Strip ---------------------------------------------- */
.comp-tab-strip {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--color-border);
    margin-bottom: 1rem;
}
.comp-tab {
    padding: 8px 20px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.15s;
}
.comp-tab:hover { color: var(--color-text); }
.comp-tab--active {
    color: var(--color-text);
    border-bottom-color: var(--color-primary-hover);
    font-weight: 600;
}

/* -- Scatter Matrix --------------------------------------------------------- */
.scatter-matrix-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 760px;
    margin-bottom: 1rem;
}
.scatter-matrix-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(90px, 1fr));
    gap: 2px;
    background: var(--color-bg);
}
.scatter-cell {
    aspect-ratio: 1;
    min-width: 90px;
    background: var(--color-bg-surface);
    position: relative;
    overflow: hidden;
}
.scatter-cell--diag {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
}
.scatter-diag-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text);
}
.scatter-diag-range {
    font-size: 0.62rem;
    color: var(--color-text-muted);
    margin-top: 3px;
    text-align: center;
    padding: 0 6px;
    line-height: 1.3;
}
.scatter-cell--corr {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.scatter-corr-val {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}
.scatter-corr--pos-light  { background: rgba(46, 204, 113, 0.12); }
.scatter-corr--pos-medium { background: rgba(46, 204, 113, 0.28); }
.scatter-corr--pos-strong { background: rgba(46, 204, 113, 0.50); }
.scatter-corr--neg-light  { background: rgba(231,  76,  60, 0.12); }
.scatter-corr--neg-medium { background: rgba(231,  76,  60, 0.28); }
.scatter-corr--neg-strong { background: rgba(231,  76,  60, 0.50); }
.scatter-dot { cursor: pointer; }
.scatter-dot--selected { stroke: #f5c030; stroke-width: 1.5px; }
.scatter-dot--dimmed   { opacity: 0.12; }
.scatter-selected-label {
    font-size: 0.82rem;
    color: #f5c030;
    margin-bottom: 0.5rem;
    font-weight: 600;
}
.scatter-selected-label::before {
    content: 'Selected: ';
    color: var(--color-text-muted);
    font-weight: normal;
}
.scatter-tooltip {
    position: fixed;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.78rem;
    line-height: 1.6;
    pointer-events: none;
    z-index: 600;
    max-width: 190px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    color: var(--color-text);
}
.scatter-tooltip-conf { color: var(--color-text-muted); }
.scatter-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 1rem;
    font-size: 0.75rem;
}
.scatter-legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--color-text-muted);
}
.scatter-legend-swatch {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.scatter-matrix-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.75rem;
}
.scatter-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.72);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}
.scatter-modal {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 20px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
}
.scatter-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 16px;
}
.scatter-modal-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}
.scatter-modal-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 8px;
    flex-shrink: 0;
}
.scatter-modal-close:hover { color: var(--color-text); }

/* ── Game Detail Page Layout ──────────────────────────────────────────── */

/* Two-column rows (Betting+Predictions, H2H+Meetings) */
.game-detail-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 1023px) {
    .game-detail-row {
        grid-template-columns: 1fr;
    }
}

.game-detail-col {
    /* card styling already applied via .card class */
}

/* Game detail section (full-width) */
.game-detail-section {
    margin-bottom: 1rem;
}

/* Meta line */
.game-detail-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 0.75rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}
.game-detail-meta__sep { color: var(--color-border); }
.game-detail-meta__conf { font-weight: 600; }

/* H2H summary */
.game-detail-h2h__summary {
    font-size: 1.1rem;
    text-align: center;
    padding: 1rem 0;
    color: var(--color-text);
}

/* Odds table */
.game-detail-odds-table {
    width: 100%;
    border-collapse: collapse;
}
.game-detail-odds-table tr + tr td {
    border-top: 1px solid var(--color-border);
    padding-top: 0.5rem;
}
.game-detail-odds-table td {
    padding: 0.4rem 0.25rem;
}
.game-detail-odds-table__label {
    color: var(--color-text-muted);
    width: 80px;
    font-size: 0.85rem;
}

/* Last meetings table */
.game-detail-meetings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.game-detail-meetings-table td {
    padding: 0.45rem 0.5rem;
}
.game-detail-meetings-table__row--alt td {
    background: var(--color-bg-surface);
}
.game-detail-meetings-table__date {
    color: var(--color-text-muted);
    white-space: nowrap;
    width: 110px;
}
.game-detail-meetings-table__link {
    color: var(--color-text);
    display: block;
}
.game-detail-meetings-table__link:hover {
    color: var(--color-primary-hover);
}

/* Model table delta highlight */
.game-detail-model-table__delta--alert {
    color: #d97706;
    font-weight: 600;
}

/* ── Team Comparison Table ──────────────────────────────────────────────── */
.game-detail-comparison-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem 2rem;
}
@media (min-width: 768px) {
    .game-detail-comparison-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.game-detail-comparison-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.game-detail-comparison-table__group td {
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    background: var(--color-bg-subtle, rgba(0, 0, 0, 0.03));
    padding-top: 0.6rem;
}
.game-detail-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.game-detail-comparison-table th {
    text-align: center;
    padding: 0.5rem;
    color: var(--color-text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--color-border);
}
.game-detail-comparison-table th:first-child { text-align: left; }
.game-detail-comparison-table td {
    padding: 0.4rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid var(--color-border);
}
.game-detail-comparison-table__label {
    text-align: left !important;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    padding-left: 0.75rem !important;
}
.game-detail-comparison-table__streak--win { color: var(--color-success); font-weight: 600; }
.game-detail-comparison-table__streak--loss { color: var(--color-danger); font-weight: 600; }

/* ── Game Analysis Chart ────────────────────────────────────────────────── */
.game-detail-chart-wrap {
    position: relative;
}
.game-detail-chart-loading {
    text-align: center;
    color: var(--color-text-muted);
    padding: 3rem;
}
.game-detail-chart-container {
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}
.game-detail-chart-container svg {
    width: 100%;
    height: auto;
}
.game-detail-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    justify-content: center;
    padding: 1rem 0;
    font-size: 0.85rem;
}

/* Desktop: place the legend as a column beside the chart to shorten the block */
@media (min-width: 1024px) {
    .game-detail-chart-wrap {
        display: flex;
        align-items: flex-start;
        justify-content: center;
        gap: 1.5rem;
    }
    .game-detail-chart-container {
        margin: 0;
        flex: 0 1 700px;
    }
    .game-detail-chart-legend {
        flex: 0 0 auto;
        flex-direction: column;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: flex-start;
        padding: 0;
        align-self: center;
    }
}
.game-detail-chart-legend__item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    user-select: none;
    color: var(--color-text);
    transition: opacity 0.2s;
}
.game-detail-chart-legend__item--hidden {
    opacity: 0.4;
}
.game-detail-chart-legend__swatch {
    width: 16px;
    height: 3px;
    border-radius: 2px;
}
.game-detail-chart-legend__swatch--rect {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    border: 2px solid currentColor;
    background: transparent;
}

@media (max-width: 767px) {
    .game-detail-comparison-wrap {
        overflow-x: scroll;
    }
}
.scatter-modal-body svg { display: block; }

/* ── Implied moneyline label in predictions table ───────────────────────── */
.game-detail-implied-ml {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

/* ── Accordion: Betting / Predictions cards ─────────────────────────────── */
/* Desktop (≥768px): force all content visible, hide the <summary> toggle   */
@media (min-width: 768px) {
    details.game-detail-accordion > summary {
        list-style: none;
        pointer-events: none;
        cursor: default;
    }
    details.game-detail-accordion > summary::-webkit-details-marker { display: none; }
    /* Override UA stylesheet that hides non-summary children when not [open] */
    details.game-detail-accordion > :not(summary) {
        display: block !important;
    }
}

/* Mobile (<768px): native accordion with visual affordance */
@media (max-width: 767px) {
    details.game-detail-accordion {
        cursor: pointer;
    }
    details.game-detail-accordion > summary {
        list-style: none;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding-bottom: 0;
        margin-bottom: 0;
    }
    details.game-detail-accordion > summary::-webkit-details-marker { display: none; }
    details.game-detail-accordion > summary::after {
        content: '▾';
        font-size: 0.9rem;
        color: var(--color-text-muted);
        transition: transform 0.2s;
    }
    details.game-detail-accordion[open] > summary::after {
        transform: rotate(180deg);
    }
    details.game-detail-accordion > :not(summary) {
        margin-top: 0.75rem;
    }
}

/* ── Chart: mobile ──────────────────────────────────────────────────────── */
/* The SVG is square (viewBox 800×800) and scales responsively via its
   viewBox, so it simply fills the available width on small screens. We do not
   force a 4:3 aspect ratio with overflow:hidden here — that would crop the
   bottom marginal distribution and the X-axis team label. */

/* ── Chart: color override toggle button ────────────────────────────────── */
.game-detail-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.game-detail-chart-color-toggle {
    font-size: 0.78rem;
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-bg-surface);
    color: var(--color-text-muted);
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.game-detail-chart-color-toggle:hover {
    border-color: var(--color-primary);
    color: var(--color-text);
}
.game-detail-chart-color-toggle.active {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(var(--color-primary-rgb, 100, 130, 255), 0.08);
}

/* ── Chart: error state ─────────────────────────────────────────────────── */
.game-detail-chart-error {
    text-align: center;
    color: var(--color-danger, #e74c3c);
    padding: 2rem;
    display: none;
}
.game-detail-chart-error p { margin-bottom: 0.75rem; }
.game-detail-chart-retry {
    font-size: 0.85rem;
    padding: 0.3rem 0.8rem;
    border: 1px solid var(--color-danger, #e74c3c);
    border-radius: var(--radius);
    background: transparent;
    color: var(--color-danger, #e74c3c);
    cursor: pointer;
}
.game-detail-chart-retry:hover { opacity: 0.8; }

/* ── Chart: legend warning icon ─────────────────────────────────────────── */
.game-detail-chart-legend__warning {
    font-size: 0.75rem;
    color: #f59e0b;
    margin-left: 2px;
    cursor: help;
}

/* ═══════════════════════════════════════════════════════════════════════════
   NCAA Tournament Bracket
   Desktop (>=1024px): classic two-sided bracket — two regions left-to-right,
   two regions mirrored right-to-left, Final Four / Championship in the center.
   Mobile (<1024px): segmented region tabs showing one region bracket at a time,
   driven purely by CSS (:has + radio inputs).
   ═══════════════════════════════════════════════════════════════════════════ */

.main--wide {
    max-width: 1440px;
}

/* ── Tabs (mobile only) ─────────────────────────────────────────────────── */
.bracket__tabs { display: none; }
.bracket__tab-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* ── Board layout ───────────────────────────────────────────────────────── */
.bracket-board {
    display: flex;
    align-items: stretch;
    gap: 0.25rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}
.bracket-board__side {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}
.bracket-center {
    flex: 0 0 188px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2.5rem;
    padding: 0 0.25rem;
}

/* ── Region ─────────────────────────────────────────────────────────────── */
.bracket-region__name {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-primary);
    margin-bottom: 0.15rem;
}
.bracket-region__round-labels,
.bracket-region__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(112px, 1fr));
}
.bracket-region__round-labels span {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    padding-bottom: 0.25rem;
}
.bracket-region__grid {
    grid-template-rows: repeat(16, auto);
    --bgap: 18px;
}

/* Slot placement: column = round, row span = 2^(round+1) of 16 row units */
.bracket-slot {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: 3px 0;
    padding-inline-end: var(--bgap);
}
.bracket-slot--r0 { grid-column: 1; }
.bracket-slot--r1 { grid-column: 2; }
.bracket-slot--r2 { grid-column: 3; }
.bracket-slot--r3 { grid-column: 4; }
.bracket-slot--r0.bracket-slot--i0 { grid-row: 1 / 3; }
.bracket-slot--r0.bracket-slot--i1 { grid-row: 3 / 5; }
.bracket-slot--r0.bracket-slot--i2 { grid-row: 5 / 7; }
.bracket-slot--r0.bracket-slot--i3 { grid-row: 7 / 9; }
.bracket-slot--r0.bracket-slot--i4 { grid-row: 9 / 11; }
.bracket-slot--r0.bracket-slot--i5 { grid-row: 11 / 13; }
.bracket-slot--r0.bracket-slot--i6 { grid-row: 13 / 15; }
.bracket-slot--r0.bracket-slot--i7 { grid-row: 15 / 17; }
.bracket-slot--r1.bracket-slot--i0 { grid-row: 1 / 5; }
.bracket-slot--r1.bracket-slot--i1 { grid-row: 5 / 9; }
.bracket-slot--r1.bracket-slot--i2 { grid-row: 9 / 13; }
.bracket-slot--r1.bracket-slot--i3 { grid-row: 13 / 17; }
.bracket-slot--r2.bracket-slot--i0 { grid-row: 1 / 9; }
.bracket-slot--r2.bracket-slot--i1 { grid-row: 9 / 17; }
.bracket-slot--r3.bracket-slot--i0 { grid-row: 1 / 17; }

/* Connectors: drawn on the receiving slot. ::before is the ⊐ bracket joining the
   two feeder cards, ::after is the stub into this slot's card. Logical properties
   make these flip automatically when the right side is mirrored with direction:rtl. */
.bracket-slot--r1::before,
.bracket-slot--r2::before,
.bracket-slot--r3::before {
    content: "";
    position: absolute;
    inset-inline-start: calc(-1 * var(--bgap));
    width: calc(var(--bgap) / 2);
    top: 25%;
    bottom: 25%;
    border-block-start: 2px solid var(--color-border);
    border-block-end: 2px solid var(--color-border);
    border-inline-end: 2px solid var(--color-border);
}
.bracket-slot--r1::after,
.bracket-slot--r2::after,
.bracket-slot--r3::after {
    content: "";
    position: absolute;
    inset-inline-start: calc(-0.5 * var(--bgap));
    width: calc(0.5 * var(--bgap));
    top: 50%;
    border-block-start: 2px solid var(--color-border);
}

/* ── Matchup card ───────────────────────────────────────────────────────── */
.bracket-game {
    position: relative;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 0.76rem;
    line-height: 1.3;
    direction: ltr;
}
.bracket-game:hover { background: var(--color-bg-surface-hover); }
.bracket-game--tbd {
    border-style: dashed;
    background: transparent;
}
.bracket-game--tbd:hover { background: transparent; }
.bracket-game__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
}

.bracket-team {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
}
.bracket-team__seed {
    flex: 0 0 14px;
    font-size: 0.65rem;
    color: var(--color-text-muted);
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.bracket-team__name {
    position: relative;
    z-index: 2;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--color-text);
    text-decoration: none;
}
a.bracket-team__name:hover { color: var(--color-primary); text-decoration: underline; }
.bracket-team__logo {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    object-fit: contain;
}
.bracket-team__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.bracket-team__score {
    flex: 0 0 auto;
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    color: var(--color-text-muted);
}
.bracket-team--winner .bracket-team__label,
.bracket-team--winner .bracket-team__score {
    font-weight: 700;
    color: var(--color-text);
}
.bracket-team--winner .bracket-team__seed { color: var(--color-text); }
.bracket-game--final .bracket-team:not(.bracket-team--winner) .bracket-team__label {
    color: var(--color-text-muted);
}
.bracket-team--tbd .bracket-team__name--tbd {
    color: var(--color-text-muted);
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bracket-game__meta {
    display: flex;
    gap: 6px;
    font-size: 0.65rem;
    color: var(--color-text-muted);
    padding-left: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bracket-game__live {
    color: var(--color-danger);
    font-weight: 700;
    letter-spacing: 0.05em;
}
.bracket-game__ff {
    font-size: 0.62rem;
    color: var(--color-text-muted);
    padding-left: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: help;
}

/* ── Center column: Final Four + Championship ───────────────────────────── */
.bracket-center__title {
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin-bottom: 0.3rem;
    text-align: center;
}
.bracket-game--center {
    font-size: 0.84rem;
    padding: 6px 8px;
    box-shadow: var(--shadow);
}
.bracket-center__block--champ .bracket-game--center {
    border-color: var(--color-primary);
}
.bracket-champion {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 0.6rem;
    padding: 8px 10px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.bracket-champion__logo { flex: 0 0 44px; object-fit: contain; }
.bracket-champion__text { display: flex; flex-direction: column; min-width: 0; }
.bracket-champion__label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}
.bracket-champion__name {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
}
.bracket-champion__name:hover { text-decoration: underline; }

/* ── Empty state ────────────────────────────────────────────────────────── */
.bracket-empty {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 3rem 1.5rem;
    text-align: center;
}
.bracket-empty__title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}
.bracket-empty__text { color: var(--color-text-muted); }

/* ── Desktop: mirror the right side toward the center ───────────────────── */
@media (min-width: 1024px) {
    .bracket-board__side--right .bracket-region__round-labels,
    .bracket-board__side--right .bracket-region__grid {
        direction: rtl;
    }
    .bracket-board__side--right .bracket-region__round-labels span { direction: ltr; }
    .bracket-board__side--right .bracket-region__name { text-align: right; }
}

/* ── Mobile: region tabs, one bracket at a time ─────────────────────────── */
@media (max-width: 1023px) {
    .bracket__tabs {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 0.85rem;
    }
    .bracket__tab {
        padding: 5px 14px;
        border: 1px solid var(--color-border);
        border-radius: 999px;
        background: var(--color-bg-surface);
        font-family: var(--font-display);
        font-size: 0.95rem;
        font-weight: 600;
        cursor: pointer;
        user-select: none;
    }
    .bracket__tab-radio:focus-visible + .bracket__tab {
        outline: 2px solid var(--color-primary);
        outline-offset: 2px;
    }
    .bracket:has(#bracket-tab-0:checked) .bracket__tab[for="bracket-tab-0"],
    .bracket:has(#bracket-tab-1:checked) .bracket__tab[for="bracket-tab-1"],
    .bracket:has(#bracket-tab-2:checked) .bracket__tab[for="bracket-tab-2"],
    .bracket:has(#bracket-tab-3:checked) .bracket__tab[for="bracket-tab-3"],
    .bracket:has(#bracket-tab-ff:checked) .bracket__tab[for="bracket-tab-ff"] {
        background: var(--color-primary);
        border-color: var(--color-primary);
        color: var(--color-text-inverse);
    }

    .bracket-board {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        padding-bottom: 0.5rem;
    }
    .bracket-board__side { display: contents; }
    .bracket-region, .bracket-center { display: none; }
    .bracket:has(#bracket-tab-0:checked) #bracket-region-0,
    .bracket:has(#bracket-tab-1:checked) #bracket-region-1,
    .bracket:has(#bracket-tab-2:checked) #bracket-region-2,
    .bracket:has(#bracket-tab-3:checked) #bracket-region-3 {
        display: block;
    }
    .bracket:has(#bracket-tab-ff:checked) #bracket-center {
        display: flex;
        max-width: 420px;
        margin: 0 auto;
    }
    .bracket-region__round-labels,
    .bracket-region__grid {
        grid-template-columns: repeat(4, minmax(148px, 1fr));
        min-width: 640px;
    }
    .bracket-slot { scroll-snap-align: start; }
    .bracket-game { font-size: 0.8rem; }
}

/* ── Conferences ───────────────────────────────────────────────────────── */

/* Conference index + standings tables */
.conf-table-wrap {
    overflow-x: auto;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.conf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.conf-table thead th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    white-space: nowrap;
}

.conf-table tbody td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.conf-table tbody tr:last-child td {
    border-bottom: none;
}

.conf-table tbody tr:hover {
    background: var(--color-bg-surface-hover);
}

.conf-table__rank {
    font-variant-numeric: tabular-nums;
    color: var(--color-text-muted);
    font-weight: 600;
    width: 3.5rem;
}

.conf-table__num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.conf-table__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
}

.conf-table__link:hover {
    color: var(--color-primary);
}

.conf-table__logo {
    object-fit: contain;
    flex-shrink: 0;
}

/* Conference hero */
.conf-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.conf-hero__logo-wrap {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.conf-hero__logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.conf-hero__name {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
}

.conf-hero__abbr {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-top: 0.15rem;
}

/* Summary stat strip */
.conf-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.conf-summary__stat {
    flex: 1 1 140px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.conf-summary__value {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.conf-summary__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

/* Section tabs */
.conf-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    overflow-x: auto;
}

.conf-tabs__tab {
    padding: 0.6rem 1.1rem;
    border: none;
    background: none;
    color: var(--color-text-muted);
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
}

.conf-tabs__tab:hover {
    color: var(--color-text);
}

.conf-tabs__tab--active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.conf-tab-panel[hidden] {
    display: none;
}

/* Champion banner */
.conf-champion {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.6rem 1rem;
    background: rgba(var(--color-primary-rgb), 0.08);
    border: 1px solid rgba(var(--color-primary-rgb), 0.25);
    border-radius: var(--radius);
}

.conf-champion__label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-primary);
    font-weight: 700;
}

.conf-champion__team {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 700;
}

.conf-champion__team:hover { color: var(--color-primary); }

.conf-champion__logo { object-fit: contain; }

/* Tournament rounds */
.conf-round {
    margin-bottom: 1.25rem;
}

.conf-round__title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.conf-round__games {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.75rem;
}

.conf-game {
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
}

.conf-game__row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0;
    color: var(--color-text-muted);
}

.conf-game__row--win {
    color: var(--color-text);
    font-weight: 700;
}

.conf-game__seed {
    font-size: 0.7rem;
    color: var(--color-text-muted);
    width: 1.25rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.conf-game__team {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.conf-game__team span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conf-game__logo { object-fit: contain; flex-shrink: 0; }

.conf-game__score {
    font-variant-numeric: tabular-nums;
    width: 2rem;
    text-align: right;
}

.conf-game__meta {
    margin-top: 0.3rem;
    padding-top: 0.3rem;
    border-top: 1px solid var(--color-border);
    text-align: right;
}

.conf-game__date {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    text-decoration: none;
}

.conf-game__date:hover { color: var(--color-primary); }

/* NCAA summary */
.conf-ncaa-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.conf-ncaa-summary__champ { color: var(--color-primary); }

.conf-ncaa-row--champ {
    background: rgba(var(--color-primary-rgb), 0.06);
}

@media (max-width: 640px) {
    .conf-table__hide-mobile { display: none; }
}

/* ── Games scoreboard ──────────────────────────────────────────────────── */

.games-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.games-nav__center {
    flex: 1;
    text-align: center;
}

.games-nav__date {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.1;
}

.games-nav__meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.games-nav__picker {
    width: auto;
}

.games-nav__today {
    font-weight: 600;
}

.games-nav__btn {
    flex-shrink: 0;
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-primary);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}

.games-nav__btn:hover {
    background: var(--color-bg-surface-hover);
    border-color: var(--color-primary);
}

.games-nav__btn--disabled {
    color: var(--color-text-muted);
    opacity: 0.45;
    cursor: default;
}

/* Scoreboard rows (reuse .schedule-table base; whole row clickable) */
.games-row {
    cursor: pointer;
}

.games-row__status {
    white-space: nowrap;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.games-row__final {
    font-weight: 600;
    color: var(--color-text);
}

.games-row__live {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    border-radius: var(--radius);
    background: var(--color-danger);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.games-row__ppd {
    font-size: 0.8rem;
    font-style: italic;
}

.games-row__team {
    white-space: nowrap;
}

.games-row__team--win {
    font-weight: 700;
}

.games-row__name {
    margin-left: 0.1rem;
}

.games-row__score {
    margin-left: 0.5rem;
    font-variant-numeric: tabular-nums;
}

.games-row__at {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.games-row__line,
.games-row__ou {
    font-variant-numeric: tabular-nums;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

@media (max-width: 640px) {
    .games-nav__date { font-size: 1.2rem; }
    .games-nav__btn { padding: 0.4rem 0.6rem; }
}

/* ── Per-statistic pages ───────────────────────────────────────────────────── */
.stat-detail__crumb {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    text-decoration: none;
    margin-bottom: 0.25rem;
}
.stat-detail__crumb:hover { color: var(--color-primary); }
.stat-detail__desc {
    max-width: 60ch;
    color: var(--color-text);
    margin: 0.25rem 0 0.5rem;
}
.stat-detail__mechanics {
    max-width: 72ch;
    color: var(--color-text-muted);
    font-size: 0.88rem;
    margin: 0 0 0.5rem;
}
.stat-detail__context { color: var(--color-text-muted); font-size: 0.9rem; margin: 0; }

.stat-detail__charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin: 1.25rem 0;
}
.stat-detail__card { padding: 1rem 1.1rem; display: flex; flex-direction: column; }
.stat-detail__card-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    margin: 0 0 0.15rem;
}
.stat-detail__card-sub { color: var(--color-text-muted); font-size: 0.82rem; margin: 0 0 0.6rem; }
.stat-detail__chart { width: 100%; }
.stat-detail__chart-empty {
    color: var(--color-text-muted);
    font-style: italic;
    padding: 2rem 0;
    text-align: center;
}
.stat-detail__metric { margin: 0.6rem 0 0; }
.stat-detail__metric strong { color: var(--color-text); }
.stat-detail__caveat { font-size: 0.8rem; margin: 0.3rem 0 0; }
.stat-detail__pop {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    margin: 0.7rem 0 0;
    font-size: 0.88rem;
    color: var(--color-text-muted);
}
.stat-detail__pop strong { color: var(--color-text); }

.stat-detail__rankings { margin-top: 1.5rem; }
.stat-detail__rankings .analytics-date-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.stat-detail__rankings .analytics-date-row .form-input { width: auto; }
.stat-detail__find { margin-left: auto; flex: 0 1 220px; min-width: 150px; }

/* The rankings scroll on their own so the charts stay put. The existing
 * .schedule-table-wrap is already the horizontal scroller; making it the
 * vertical one too keeps the sticky header inside a single scrollport. */
.stat-detail__rankings .schedule-table-wrap {
    max-height: 65vh;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    transition: opacity 0.15s;
}

/* Date-change loading state: spinner in the header row (house .htmx-indicator
 * pattern) while the stale table dims. The container is listed as a second
 * hx-indicator target so it gains .htmx-request during the swap. */
.stat-detail__loading { color: var(--color-text-muted); font-size: 0.85rem; white-space: nowrap; }
.stat-detail__loading-spin {
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    border: 2px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    vertical-align: -0.15em;
    animation: stat-spin 0.7s linear infinite;
}
@keyframes stat-spin { to { transform: rotate(360deg); } }
#stat-rank-container.htmx-request .schedule-table-wrap {
    opacity: 0.45;
    pointer-events: none;
}
.stat-detail__rankings .schedule-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: var(--color-bg-surface);
}
.stat-detail__rankings tr.stat-row--hit td { background: var(--color-bg-surface-hover); }
.stat-detail__rankings tr.stat-row--hit td:first-child { box-shadow: inset 3px 0 var(--color-primary); }

.stat-legend { margin-left: 0.6rem; font-size: 0.8rem; color: var(--color-text-muted); }
.stat-legend__dot {
    display: inline-block;
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 50%;
    margin-right: 0.2rem;
    vertical-align: middle;
}
.stat-legend__dot--win { background: var(--color-success); }
.stat-legend__dot--loss { background: var(--color-danger); }

.stat-tooltip {
    position: absolute;
    pointer-events: none;
    background: var(--color-nav-bg);
    color: var(--color-text-inverse);
    padding: 0.35rem 0.5rem;
    border-radius: 6px;
    font-size: 0.78rem;
    line-height: 1.3;
    box-shadow: var(--shadow);
    z-index: 50;
}

/* Glossary index */
.stat-index__group { margin-bottom: 1.5rem; }
.stat-index__category {
    font-family: var(--font-display);
    font-size: 1.25rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.3rem;
    margin: 0 0 0.75rem;
}
.stat-index__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.8rem;
}
.stat-index__item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.8rem 0.9rem;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s, transform 0.15s;
}
.stat-index__item:hover { background: var(--color-bg-surface-hover); transform: translateY(-1px); }
.stat-index__title { font-weight: 600; color: var(--color-text); }
.stat-index__blurb { font-size: 0.82rem; color: var(--color-text-muted); }
.stat-index__mechanics { font-size: 0.76rem; color: var(--color-text-muted); opacity: 0.85; }
.stat-index__dir { font-size: 0.72rem; color: var(--color-primary); margin-top: 0.1rem; }

@media (max-width: 768px) {
    .stat-detail__charts { grid-template-columns: 1fr; }
    /* Find box gets its own full-width line under the title/date */
    .stat-detail__find { flex: 1 1 100%; margin-left: 0; }
    .stat-detail__rankings .schedule-table-wrap { max-height: 60vh; }
}
