:root {
    --wild-green: #069234;
    --wild-red: #A6192E;
    --wild-gold: #EAAA00;
    --wild-wheat: #C5B783;

    /* Sampled from the home jersey graphic (images/jersey-back.png) */
    --jersey-wheat: #F8F1DF;
    --jersey-red: #BA161C;

    /* Modern neutral palette */
    --bg-primary: #0a0a0a;
    --bg-secondary: #141414;
    --bg-tertiary: #1a1a1a;
    --border-subtle: #2a2a2a;
    --border-medium: #3a3a3a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #707070;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Skip link for keyboard navigation */
.skip-link {
    position: absolute;
    top: -3rem;
    left: 1rem;
    background: var(--wild-gold);
    color: var(--bg-primary);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    z-index: 10000;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 1rem;
}

/* Focus styles for interactive elements */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex="0"]:focus-visible {
    outline: 2px solid var(--wild-gold);
    outline-offset: 2px;
}

/* Remove default focus outline when not using keyboard */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
select:focus:not(:focus-visible),
[tabindex="0"]:focus:not(:focus-visible) {
    outline: none;
}

html {
    overflow-x: clip; /* Prevent horizontal page scroll at the document level */
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
    background-color: var(--bg-primary);
    background-position: top center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 0.875rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: clip; /* Prevent any element from causing horizontal page scroll */
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

header {
    padding: 2rem 0 2.5rem 0;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.site-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.site-title:hover {
    opacity: 0.85;
}

.header-logo {
    height: 90px;
    width: 135px;
    object-fit: contain;
    object-position: center;
}

.header-wordmark {
    height: 48px;
    width: auto;
    display: block;
}

.header-text {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: inherit;
    font-weight: inherit;
}

.header-divider {
    width: 100%;
    height: 2px;
    background-color: var(--wild-red);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 8px;
}

/* Hamburger button — mobile only */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px 4px;
    flex-shrink: 0;
}

.hamburger-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
}

/* Nav close button — mobile only, inside slide panel */
.nav-close-btn {
    display: none;
}

/* Nav overlay — mobile only */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 400;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.nav-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

/* Desktop nav — inline in header (original styles) */
.main-nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    padding: 0;
    background-color: transparent;
    color: var(--text-primary);
    border: none;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.nav-link:hover {
    color: var(--wild-gold);
}

.nav-link.active {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--wild-gold);
    text-underline-offset: 6px;
    text-decoration-thickness: 1px;
}

.nav-link.active:hover {
    color: var(--wild-gold);
}

/* Mobile nav — slide panel */
@media (max-width: 1024px) {
    .hamburger-btn {
        display: flex;
    }

    .nav-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 10px;
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
        flex-shrink: 0;
    }

    .nav-close-btn span {
        display: block;
        width: 22px;
        height: 2px;
        background: var(--text-primary);
        position: absolute;
    }

    .nav-close-btn span:nth-child(1) {
        transform: rotate(45deg);
    }

    .nav-close-btn span:nth-child(2) {
        transform: rotate(-45deg);
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(calc(100vw - 56px), 400px);
        background: var(--bg-secondary);
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        flex-direction: column;
        gap: 0;
        padding: 7rem 2rem 2rem;
        z-index: 401;
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.5);
        overflow-y: auto;
    }

    .main-nav.open {
        transform: translateX(0);
    }

    .nav-link {
        padding: 1.1rem 0;
        border-bottom: 1px solid var(--border-subtle);
        font-size: 1.0625rem;
    }

    .nav-link:first-of-type {
        border-top: 1px solid var(--border-subtle);
    }
}

main {
    padding: 0;
    min-height: calc(100vh - 200px);
}

/* ─── Dashboard: stat leader board ───────────────────────────────────────── */

.stat-leaders {
    margin: 0;
}

.stat-leaders-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-leader-card {
    background-color: rgba(20, 20, 20, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.stat-leader-card:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--border-medium);
}

.stat-category {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-align: center;
}

.leader-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.leader-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.5rem;
    border-radius: 4px;
    background-color: var(--bg-tertiary);
    cursor: pointer;
}

.leader-row:hover {
    background-color: var(--border-subtle);
}

.leader-row--former {
    cursor: default;
}

.leader-row--former:hover {
    background-color: var(--bg-tertiary);
}

.leader-row--former .leader-stat,
.leader-row--former .leader-name {
    color: var(--text-secondary);
}

.leader-rank {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 1.2rem;
    text-align: center;
}

.leader-player {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.leader-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leader-stat {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--wild-green);
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    white-space: nowrap;
    text-align: right;
    min-width: fit-content;
}

/* ─── Team Records: layout ────────────────────────────────────────────────── */

.records-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.records-selectors {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    flex-shrink: 0;
    width: 160px;
}

.records-selector-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.records-selector-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    font-weight: 600;
}

.records-selector-btns {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.records-selector-btns .division-toggle {
    width: 100%;
    text-align: left;
    padding: 0.45rem 0.85rem;
}

/* Stat button groups: invisible in the vertical sidebar, separate wrapping rows once buttons go horizontal */
.records-btn-row {
    display: contents;
}

.records-btn-row[hidden] {
    display: none;
}

/* Mobile-only selector pieces (trigger, menu title, backdrop) */
.records-mobile-trigger,
.records-drawer-title,
.records-drawer-backdrop {
    display: none;
}

.records-table-wrap {
    flex: 1;
    min-width: 0;
}

.records-table-header {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

/* ─── Team Records: big table rows ───────────────────────────────────────── */

.records-big-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.records-big-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    background-color: rgba(30, 30, 30, 0.55);
    cursor: pointer;
    transition: background-color 0.15s;
}

.records-big-row:hover {
    background-color: rgba(45, 45, 45, 0.75);
}

.records-big-row--former {
    cursor: default;
}

.records-big-row--former:hover {
    background-color: rgba(30, 30, 30, 0.55);
}

.records-big-rank {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 1.6rem;
    text-align: center;
    flex-shrink: 0;
}

.records-big-player {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1;
    min-width: 0;
}

.records-big-photo {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.records-big-photo--former {
    opacity: 0.45;
    filter: grayscale(1);
}

.records-big-photo--placeholder {
    background: var(--border-subtle);
    display: inline-block;
}

.records-big-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.records-big-name--former {
    color: var(--text-secondary);
}

.records-big-row--former .records-big-stat {
    color: var(--text-secondary);
}

.records-big-stat {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--wild-green);
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
    white-space: nowrap;
    text-align: right;
    flex-shrink: 0;
    min-width: 2.5rem;
}

.records-reset-btn {
    background: none;
    border: none;
    padding: 0;
    margin-top: 0.25rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s;
}

.records-reset-btn:hover {
    color: var(--text-primary);
}

.records-empty {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 1.5rem 0;
    text-align: center;
}

/* ─── Season badge (reused from old cards) ───────────────────────────────── */

.records-season {
    display: inline-block;
    margin-left: 0.45rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 500;
    vertical-align: middle;
}

.records-season--current {
    color: var(--wild-green);
}

/* ─── Kept for any remaining usages elsewhere ────────────────────────────── */

.player-photo-greyed {
    opacity: 0.4;
    filter: grayscale(1);
}

.league-rank-inline {
    font-size: 0.65rem;
    color: var(--wild-gold);
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.standings-controls,
.stats-page-controls {
    display: flex;
    flex-wrap: wrap;
    column-gap: 30px;
    row-gap: 10px;
    margin: 0 0 2rem 0;
    padding: 0;
}

.stats-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.sort-btn {
    padding: 0.5rem 1rem;
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-btn:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--wild-green);
}

.sort-btn.active {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--wild-green);
}

.stats-section {
    margin-bottom: 2rem;
    overflow: visible;
}

/* Visually hidden but accessible to screen readers */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Head-to-Head team picker */
.h2h-picker {
    position: relative;
    display: inline-block;
    margin-bottom: 2rem;
}

.h2h-picker-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s ease;
    min-width: 240px;
}

.h2h-picker-trigger:hover {
    border-color: var(--wild-green);
}

.h2h-picker-arrow {
    margin-left: auto;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.h2h-picker-trigger[aria-expanded="true"] .h2h-picker-arrow {
    transform: rotate(180deg);
}

.h2h-picker-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
}

.h2h-picker-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 200;
    list-style: none;
    padding: 0.25rem 0;
    max-height: 360px;
    overflow-y: auto;
}

.h2h-picker-dropdown.open {
    display: block;
}

.h2h-team-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.h2h-team-option:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.h2h-team-option.selected {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

/* ─── H2H Matchup Layout ──────────────────────────────────────────────────── */

.h2h-matchup-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    padding: 0 0 2.5rem;
    margin-bottom: 0.5rem;
}

.h2h-matchup-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
}

.h2h-matchup-logo {
    width: 200px;
    height: 200px;
    object-fit: contain;
}

.h2h-matchup-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

.h2h-matchup-vs {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.15em;
    text-align: center;
    padding: 0 1.5rem;
}

/* ─── H2H Stat Tables ─────────────────────────────────────────────────────── */

.h2h-section {
    margin-bottom: 3rem;
}

.h2h-section-title {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-align: center;
}

.h2h-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.h2h-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.h2h-table td {
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
    vertical-align: middle;
}

.h2h-opp-val {
    text-align: right;
    color: var(--text-secondary);
    width: 38%;
}

.h2h-cat {
    text-align: center;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: var(--text-primary);
    text-transform: uppercase;
    width: 24%;
    white-space: nowrap;
}

.h2h-min-val {
    text-align: left;
    color: var(--text-secondary);
    width: 38%;
}


.h2h-sub {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-left: 0.25rem;
}

.h2h-cat-abbr { display: none; }

.h2h-since-select,
.schedule-season-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: var(--bg-secondary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0.3rem 1.75rem 0.3rem 0.65rem;
    outline: none;
    margin-left: 0.5rem;
    transition: border-color 0.2s ease;
    vertical-align: middle;
}

.h2h-since-select:hover,
.schedule-season-select:hover {
    border-color: var(--wild-green);
}

.h2h-val-better {
    color: var(--text-primary);
    font-weight: 600;
}

.h2h-no-stats-note {
    text-align: center;
    padding: 0.5rem 1rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-style: italic;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 480px) {
    .h2h-matchup-logo {
        width: 90px;
        height: 90px;
    }

    .h2h-matchup-name {
        font-size: 0.9375rem;
    }

    .h2h-matchup-vs {
        font-size: 1.5rem;
        padding: 0 0.5rem;
    }

    .h2h-cat-full { display: none; }
    .h2h-cat-abbr { display: inline; }

    .h2h-table td {
        padding: 0.5rem 0.5rem;
        font-size: 0.8125rem;
    }

    .h2h-cat {
        font-size: 0.625rem;
    }

    .h2h-section-header {
        padding: 0.5rem 0.5rem;
    }
}

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

.stats-section h2 {
    color: var(--text-primary);
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.text-link {
    color: var(--wild-gold);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: opacity 0.2s ease;
    white-space: nowrap;
}

.text-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.section-footer {
    text-align: right;
    margin-top: 1rem;
}

.stats-table-container {
    background-color: rgba(20, 20, 20, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: visible; /* Keeps header tooltips visible on desktop */
}

.player-photo-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 0.5rem;
    vertical-align: middle;
    background-color: rgba(1, 1, 1, 0.5);
}

.player-abbrev-text {
    display: none;
}

.view-btn {
    padding: 0;
    background-color: transparent;
    color: var(--text-primary);
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.2s ease;
    text-decoration: none;
    display: inline-block;
    white-space: nowrap;
}

.view-btn[hidden] {
    display: none;
}

.view-btn:hover {
    color: var(--wild-gold);
}

.view-btn.active {
    color: var(--text-primary);
    text-decoration: underline;
    text-decoration-color: var(--wild-gold);
    text-underline-offset: 6px;
    text-decoration-thickness: 1px;
}

.view-btn.active:hover {
    color: var(--wild-gold);
}

.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.not-found {
    text-align: center;
    padding: 4rem 1rem;
}

.not-found h1 {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.not-found p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.not-found a {
    color: var(--wild-gold);
}

.standings-section {
    margin-bottom: 1rem;
    overflow: visible;
}

.standings-section h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.standings-table {
    width: 100%;
    background-color: rgba(20, 20, 20, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: visible;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-medium);
}

th {
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    position: relative;
    cursor: default;
}

/* Tooltip styles */

th[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background-color: #2a2a2a;
    color: #ffffff;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10000;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    opacity: 0;
    animation: tooltipFadeIn 0.2s ease-in-out 0.5s forwards;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.95;
    }
}

th.sortable {
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    position: relative;
}

th.sortable:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.03);
}

th.sortable.sorted {
    color: var(--wild-gold);
    font-weight: 600;
}

.sort-arrow {
    display: inline-block;
    width: 0.8em;
    text-align: center;
}

th.center, td.center {
    text-align: center;
}

tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: background-color 0.15s ease;
    cursor: default;
}

tbody tr:last-child {
    border-bottom: none;
}

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

tbody tr.wild-highlight {
    background-color: rgba(2, 73, 48, 0.1);
    border-left: 2px solid var(--wild-green);
}

tbody tr.wild-highlight:hover {
    background-color: rgba(2, 73, 48, 0.15);
}

td {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.team-name {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Fix team column width for consistent alignment across standings tables */
#standings-view .standings-table table {
    table-layout: fixed;
}

#standings-view th.team-col {
    width: 24%;
}

@media (max-width: 1400px) {
    #standings-view .standings-table table {
        table-layout: auto;
    }

    #standings-view th.team-col {
        width: auto;
    }

    #standings-view .team-full-name {
        display: none;
    }

    #standings-view .team-abbrev-text {
        display: inline;
        font-weight: 600;
        font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
        font-size: 0.8rem;
    }
}

.team-link {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    flex: 1;
    min-width: 0;
}

.team-link:hover {
    color: var(--wild-gold);
}

.external-link-icon {
    opacity: 0;
    font-size: 0.75rem;
    color: var(--wild-gold);
    margin-left: 0.25rem;
    transition: opacity 0.2s ease;
}

.team-link:hover .external-link-icon {
    opacity: 1;
}

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

.team-abbrev-text {
    display: none;
}

/* P% format toggling for mobile */
.p-pct-full {
    display: inline;
}

.p-pct-mobile {
    display: none;
}

.team-full-name {
    display: inline;
}

.rank {
    font-weight: 600;
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.streak-W {
    color: #10b981;
    font-weight: 500;
}

.streak-L {
    color: #ef4444;
    font-weight: 500;
}

.diff-positive {
    color: #10b981;
    font-weight: 500;
}

.diff-negative {
    color: #ef4444;
    font-weight: 500;
}

.stat-best {
    color: var(--wild-green);
    font-weight: 600;
}

.magic-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #059669;
    color: #ffffff;
    width: 2rem;
    height: 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
}

.tragic-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #dc2626;
    color: #ffffff;
    width: 2rem;
    height: 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.75rem;
}

.playoff-indicator {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.playoff-indicator.division {
    background-color: rgba(2, 73, 48, 0.2);
    color: var(--wild-green);
    border: 1px solid rgba(2, 73, 48, 0.3);
}

.playoff-indicator.wildcard {
    background-color: rgba(234, 170, 0, 0.15);
    color: var(--wild-gold);
    border: 1px solid rgba(234, 170, 0, 0.3);
}

.playoff-cutoff {
    background: transparent;
    border: none;
}

.playoff-cutoff td {
    padding: 0;
    border-top: 2px solid var(--border-medium);
}

.non-playoff-team {
    opacity: 0.4;
}

.clinch-mobile {
    display: none;
}

.clinch-mid {
    display: none;
}

.clinch-abbrev {
    display: none;
}

@media (max-width: 1400px) and (min-width: 769px) {
    .clinch-mid {
        display: inline;
    }
}

@media (max-width: 768px) {
    .clinch-mobile {
        display: inline;
    }

    .clinch-abbrev {
        display: inline;
    }
}

.clinch-key {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    padding: 0.75rem 1rem;
    background-color: var(--bg-secondary);
    border-radius: 6px;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.division-header {
    background-color: var(--bg-tertiary);
}

.division-header td {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ─── Playoff Bracket ──────────────────────────────────────────────────────── */

.playoff-bracket-wrapper {
    width: 100%;
}

.playoff-bracket-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.playoff-bracket-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.playoff-bracket-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.375rem;
}

/* Desktop bracket scroll container */
.bracket-desktop {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 1rem;
}

.playoff-bracket {
    min-width: 1280px;
    padding: 0 1rem;
}

/* CSS Grid layout for bracket body — labels + content aligned */
.bracket-body {
    display: grid;
    grid-template-columns: 1fr 20px 1fr 20px 1fr 20px 1fr 20px 1fr 20px 1fr 20px 1fr;
    grid-template-rows: auto auto 1fr;
    min-height: 560px;
}

/* Round labels — row 1 */
.bracket-label {
    grid-row: 1;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-tertiary);
    padding-bottom: 4px;
    align-self: end;
}

.bracket-label-wr1 { grid-column: 1; }
.bracket-label-wr2 { grid-column: 3; }
.bracket-label-wcf { grid-column: 5; }
.bracket-label-scf-text { grid-column: 7; line-height: 1.3; }
.bracket-label-ecf { grid-column: 9; }
.bracket-label-er2 { grid-column: 11; }
.bracket-label-er1 { grid-column: 13; }

/* Conference labels — row 2 */
.bracket-conf-label {
    grid-row: 2;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--wild-gold);
    padding-bottom: 8px;
}

.bracket-conf-west { grid-column: 1 / 7; }
.bracket-conf-east { grid-column: 8 / 14; text-align: right; }

/* Round columns — row 3 */
.bracket-body > .bracket-round,
.bracket-body > .bracket-connector {
    grid-row: 3;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    position: relative;
    z-index: 1;
}

/* Explicit grid column placement for rounds and connectors */
.bracket-r1.bracket-west { grid-column: 1; }
.bracket-connector.west-r1-r2 { grid-column: 2; }
.bracket-r2.bracket-west { grid-column: 3; }
.bracket-connector.west-r2-cf { grid-column: 4; }
.bracket-cf.bracket-west { grid-column: 5; }
.bracket-connector.west-cf-scf { grid-column: 6; }
.bracket-scf { grid-column: 7; }
.bracket-connector.east-cf-scf { grid-column: 8; }
.bracket-cf.bracket-east { grid-column: 9; }
.bracket-connector.east-r2-cf { grid-column: 10; }
.bracket-r2.bracket-east { grid-column: 11; }
.bracket-connector.east-r1-r2 { grid-column: 12; }
.bracket-r1.bracket-east { grid-column: 13; }

/* Pairs group two matchups that feed into one next-round matchup */
.bracket-pair {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
    flex: 1;
    position: relative;
}

/* Matchup card */
.bracket-matchup {
    background: rgba(20, 20, 20, 0.85);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.bracket-matchup-active {
    border-color: var(--wild-gold);
}

.bracket-matchup-empty {
    opacity: 0.4;
}

/* Team row within matchup */
.bracket-team {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    gap: 6px;
    min-height: 36px;
}

.bracket-team + .bracket-team {
    border-top: 1px solid var(--border-subtle);
}

.bracket-team-winner {
    background: rgba(6, 146, 52, 0.15);
}

.bracket-team-eliminated {
    opacity: 0.45;
}

.bracket-team-wild {
    background: rgba(6, 146, 52, 0.08);
}

.bracket-team-wild.bracket-team-winner {
    background: rgba(6, 146, 52, 0.25);
}

.bracket-team-seed {
    font-size: 0.6rem;
    color: var(--text-tertiary);
    min-width: 22px;
    text-align: center;
    font-weight: 600;
}

.bracket-team-link {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
    text-decoration: none;
    color: var(--text-primary);
    min-width: 0;
}

.bracket-team-link:hover {
    color: var(--wild-gold);
}

.bracket-team-logo {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.bracket-team-name {
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bracket-team-abbrev {
    display: none;
}

.bracket-team-wins {
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
}

.bracket-team-wins.wins-highlight {
    color: var(--wild-green);
}

.bracket-team-wins.wins-empty {
    color: var(--text-tertiary);
    font-size: 0.8rem;
}

.bracket-team-tbd {
    justify-content: center;
}

.bracket-team-tbd .bracket-team-name {
    color: var(--text-tertiary);
    font-style: italic;
    font-size: 0.7rem;
}

/* Series status labels */
.bracket-series-status {
    text-align: center;
    font-size: 0.6rem;
    color: var(--text-secondary);
    padding: 2px 0;
    background: var(--bg-tertiary);
}

.bracket-series-won {
    text-align: center;
    font-size: 0.6rem;
    color: var(--wild-green);
    font-weight: 600;
    padding: 2px 0;
    background: var(--bg-tertiary);
}

/* ─── Bracket Connector Lines ─────────────────────────────────────────────── */

.bracket-connector {
    position: relative;
}

/* West side connectors (left → right) */

.bracket-connector.west-r1-r2::before,
.bracket-connector.west-r1-r2::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    border-right: 2px solid var(--border-medium);
}

.bracket-connector.west-r1-r2::before {
    top: 12.5%;
    height: 25%;
    border-top: 2px solid var(--border-medium);
    border-bottom: 2px solid var(--border-medium);
}

.bracket-connector.west-r1-r2::after {
    top: 62.5%;
    height: 25%;
    border-top: 2px solid var(--border-medium);
    border-bottom: 2px solid var(--border-medium);
}

.bracket-connector.west-r2-cf::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    height: 50%;
    width: 100%;
    border-top: 2px solid var(--border-medium);
    border-bottom: 2px solid var(--border-medium);
    border-right: 2px solid var(--border-medium);
}

.bracket-connector.west-cf-scf::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    border-top: 2px solid var(--border-medium);
}

/* East side connectors (right → left, mirrored) */

.bracket-connector.east-r1-r2::before,
.bracket-connector.east-r1-r2::after {
    content: '';
    position: absolute;
    right: 0;
    width: 100%;
    border-left: 2px solid var(--border-medium);
}

.bracket-connector.east-r1-r2::before {
    top: 12.5%;
    height: 25%;
    border-top: 2px solid var(--border-medium);
    border-bottom: 2px solid var(--border-medium);
}

.bracket-connector.east-r1-r2::after {
    top: 62.5%;
    height: 25%;
    border-top: 2px solid var(--border-medium);
    border-bottom: 2px solid var(--border-medium);
}

.bracket-connector.east-r2-cf::before {
    content: '';
    position: absolute;
    right: 0;
    top: 25%;
    height: 50%;
    width: 100%;
    border-top: 2px solid var(--border-medium);
    border-bottom: 2px solid var(--border-medium);
    border-left: 2px solid var(--border-medium);
}

.bracket-connector.east-cf-scf::before {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    width: 100%;
    border-top: 2px solid var(--border-medium);
}

/* ─── Mobile Bracket Layout ───────────────────────────────────────────────── */

.bracket-mobile {
    display: none;
}

@media (max-width: 1360px) {
    .bracket-desktop {
        display: none;
    }

    .bracket-mobile {
        display: block;
    }

    .bracket-mobile-conf {
        margin-bottom: 1.5rem;
    }

    .bracket-mobile-conf-label {
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: var(--wild-gold);
        text-align: center;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid var(--border-subtle);
        margin-bottom: 0.75rem;
    }

    .bracket-mobile-round {
        margin-bottom: 0.75rem;
    }

    .bracket-mobile-round-label {
        font-size: 0.65rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.08em;
        color: var(--text-tertiary);
        text-align: center;
        margin-bottom: 0.5rem;
    }

    .bracket-mobile-matchups {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    /* Single matchup rounds (CF, SCF) center the card */
    .bracket-mobile-matchups:has(> :only-child) {
        grid-template-columns: 1fr;
        max-width: 360px;
        margin: 0 auto;
    }

    .bracket-mobile-scf {
        margin-bottom: 1.5rem;
        padding: 1rem 0;
        border-top: 1px solid var(--border-subtle);
        border-bottom: 1px solid var(--border-subtle);
    }

    .bracket-mobile .bracket-team {
        padding: 8px 8px;
        gap: 5px;
        min-height: 34px;
    }

    .bracket-mobile .bracket-team-logo {
        width: 22px;
        height: 22px;
    }

    .bracket-mobile .bracket-team-seed {
        font-size: 0.55rem;
        min-width: 20px;
    }

    .bracket-mobile .bracket-team-wins {
        font-size: 0.85rem;
        min-width: 16px;
    }
}

@media (max-width: 768px) {
    /* Switch to abbreviations on small screens */
    .bracket-mobile .bracket-team-name {
        display: none;
    }

    .bracket-mobile .bracket-team-abbrev {
        display: inline;
        font-size: 0.75rem;
        font-weight: 600;
    }
}

/* Dashboard Games Section */
.games-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.game-card {
    background-color: rgba(20, 20, 20, 0.75);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.game-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    text-align: center;
}

.game-label-part {
    white-space: nowrap;
}

/* Upcoming games list card */
.upcoming-games-card {
    align-items: stretch;
    gap: 0.75rem;
}

.upcoming-games-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.upcoming-game {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 3.5rem;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.8125rem;
}

.upcoming-game:last-child {
    border-bottom: none;
}

.upcoming-when {
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upcoming-date {
    font-weight: 600;
    color: var(--text-primary);
}

.upcoming-matchup {
    display: grid;
    grid-template-columns: 1.25rem 20px 2.25rem;
    align-items: center;
    gap: 4px;
}

.upcoming-team {
    font-weight: 500;
    color: var(--text-primary);
}

.upcoming-at {
    color: var(--text-secondary);
    text-align: right;
}

.upcoming-tv {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

/* Narrow cards (three side by side, or small phones): stack the time under the date so it fits */
@media (min-width: 1025px) and (max-width: 1279px), (max-width: 440px) {
    .upcoming-when {
        display: flex;
        flex-direction: column;
        gap: 0.125rem;
    }

    .upcoming-sep {
        display: none;
    }

    .upcoming-time {
        font-size: 0.75rem;
    }
}

.game-matchup {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    justify-content: center;
}

.team-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.game-team-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.team-abbrev {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.game-card.game-win .wild-team .team-abbrev {
    color: var(--wild-green);
}

.game-card.game-loss .wild-team .team-abbrev {
    color: var(--wild-red);
}

.game-at {
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--text-secondary);
    margin: 0 0.5rem;
}

/* Scoreboard layout (Next/Current card, and the Last card above phone width):
   away team | label, date, time or score, details | home team */
.game-card--matchup {
    gap: 0.75rem;
}

.game-full {
    display: contents;
}

/* Auto margins center the scoreboard in the space above the bottom link */
.matchup-layout {
    margin-block: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.matchup-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.matchup-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    margin-bottom: 0.25rem;
}

.matchup-record {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.matchup-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-align: center;
}

.matchup-center .game-label {
    margin-bottom: 0.125rem;
}

.matchup-date {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.matchup-main {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.matchup-detail {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.matchup-detail.live-game-info {
    margin-top: 0;
    gap: 0.75rem;
    justify-content: center;
}

/* Live link sits in the period/clock line instead of the card corner */
.matchup-detail .game-link.live-link {
    position: static;
}

.game-card--matchup .game-card-h2h-link {
    margin-top: 0;
}

@media (max-width: 440px) {
    .matchup-logo {
        width: 44px;
        height: 44px;
    }

    .matchup-main {
        font-size: 1.25rem;
    }
}

.game-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.score-line {
    font-size: 1.5rem;
    font-weight: 700;
}

.game-result {
    font-size: 0.875rem;
    font-weight: 600;
}

.game-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.live-game-info {
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.live-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.period-badge {
    background-color: #ffffff;
    color: #000000;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

.time-remaining {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    margin-top: 3rem;
}

.footer-credit {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-credit:hover {
    color: var(--text-secondary);
}

.footer-social-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: 0.6rem;
}

.footer-top {
    display: flex;
    align-items: center;
    justify-content: center;
}

.footer-social-link {
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
    line-height: 1;
}

.footer-social-link:hover {
    color: var(--text-secondary);
}

.footer-disclaimer {
    margin-top: 0.5rem;
    font-size: 0.65rem;
    color: var(--text-tertiary);
}

@media (max-width: 1024px) {
    .container {
        padding: 0 1rem;
    }

    header {
        padding: 1.5rem 0 1rem 0;
    }

    /* Stack games and news on medium screens */
    .games-grid,
    .news-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .game-card {
        padding: 1rem;
    }

    .game-team-logo {
        width: 64px;
        height: 64px;
    }

    .team-abbrev {
        font-size: 0.9rem;
    }

    .score-line {
        font-size: 1.25rem;
    }

    .game-at {
        font-size: 1rem;
    }

    .header-logo {
        height: 60px;
        width: 90px;
    }

    .subtitle {
        letter-spacing: 5px;
    }

    .header-wordmark {
        height: 32px;
    }

    .standings-controls {
        margin: 0 0 1.5rem 0;
        gap: 24px;
    }

    .view-btn {
        font-size: 0.8125rem;
    }

    /* Records layout: stack selectors above table */
    .records-layout {
        flex-direction: column;
        gap: 1.25rem;
    }

    .records-table-wrap {
        width: 100%;
    }

    .league-rank-inline {
        font-size: 0.6rem;
    }

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

    .stat-leaders-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .stat-leader-card {
        padding: 0.65rem;
    }

    .stat-category {
        font-size: 0.65rem;
        margin-bottom: 0.4rem;
    }

    .leader-list {
        gap: 0.35rem;
    }

    .leader-row {
        padding: 0.35rem 0.4rem;
        gap: 0.5rem;
    }

    .leader-rank {
        font-size: 0.75rem;
        min-width: 1rem;
    }

    .leader-name {
        font-size: 0.8rem;
    }

    .leader-stat {
        font-size: 0.8rem;
    }

    table {
        font-size: 0.75rem;
    }

    th, td {
        padding: 0.5rem 0.5rem;
    }

    .team-logo {
        width: 20px;
        height: 20px;
    }

    .team-name {
        gap: 0.5rem;
    }

    /* Hide full team name on mobile, show abbreviation instead */
    .team-name .team-full-name {
        display: none;
    }

    .team-name .team-abbrev-text {
        display: inline;
        font-weight: 600;
        font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
        font-size: 0.8rem;
    }

    /* Hide less critical columns on mobile */
    th.hide-mobile,
    td.hide-mobile {
        display: none;
    }

    .playoff-indicator {
        font-size: 0.6rem;
        padding: 0.1rem 0.3rem;
        margin-left: 0.25rem;
    }

    .standings-section h2,
    .stats-section h2 {
        font-size: 0.85rem;
    }

    .text-link,
    .game-card-h2h-link {
        font-size: 0.75rem;
    }

    /* On mobile, allow player stats table to scroll horizontally instead of
       overflowing the page (desktop keeps overflow:visible so header tooltips work) */
    .stats-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 768px) {
    .header-logo {
        height: 50px;
        width: 75px;
    }

    .subtitle {
        letter-spacing: 3px;
    }

    .header-wordmark {
        height: 26px;
    }

    .standings-controls {
        display: flex;
        margin: 0 0 1.25rem 0;
        gap: 20px;
    }

    .view-btn {
        font-size: 0.75rem;
    }

    table {
        font-size: 0.7rem;
    }

    th, td {
        padding: 0.4rem 0.35rem;
    }

    .team-logo {
        display: none;
    }

    /* Further reduce game card sizes */
    .game-card {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .game-team-logo {
        width: 52px;
        height: 52px;
    }

    .team-abbrev {
        font-size: 0.85rem;
    }

    .score-line {
        font-size: 1.1rem;
    }

    .game-label {
        font-size: 0.7rem;
    }

    .game-date {
        font-size: 0.8rem;
    }

    .game-at {
        font-size: 0.9rem;
        margin: 0 0.25rem;
    }

    .records-big-photo {
        width: 36px;
        height: 36px;
    }

    .records-big-name {
        font-size: 0.85rem;
    }

    .records-big-stat {
        font-size: 1rem;
        min-width: 2rem;
    }

    .records-big-rank {
        font-size: 0.85rem;
        min-width: 1.25rem;
    }
}

/* Team records selectors below desktop: each collapses to "LABEL / current choice ▾",
   and tapping it opens a slide-out menu from the left */
@media (max-width: 1024px) {
    .records-selectors {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(5, auto);
        justify-content: space-between;
        align-items: start;
        gap: 0.5rem 0.75rem;
    }

    .records-selector-group {
        flex: unset;
        min-width: 0;
        width: auto;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .records-reset-btn {
        grid-column: 1 / -1;
        justify-self: center;
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .records-mobile-trigger {
        display: inline-flex;
        align-items: center;
        gap: 0.4rem;
        min-height: 44px;
        padding: 0;
        background: none;
        border: none;
        color: var(--wild-gold);
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        line-height: 1.25;
        white-space: nowrap;
        text-align: left;
        cursor: pointer;
    }

    .records-mobile-trigger::after {
        content: '';
        flex-shrink: 0;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 6px solid var(--wild-gold);
    }

    /* Options list becomes a menu that slides in from the left */
    .records-selector-btns {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 10051;
        width: min(80vw, 320px);
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 0.75rem;
        padding: 1.5rem 1.25rem;
        background: var(--bg-secondary);
        border-right: 1px solid var(--border-medium);
        box-shadow: 8px 0 24px rgba(0, 0, 0, 0.6);
        overflow-y: auto;
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform 0.25s ease, visibility 0s linear 0.25s;
    }

    .records-selector-group.drawer-open .records-selector-btns {
        transform: translateX(0);
        visibility: visible;
        transition: transform 0.25s ease, visibility 0s;
    }

    .records-selector-btns .records-btn-row:not([hidden]) {
        display: contents;
    }

    .records-drawer-title {
        display: block;
        margin-bottom: 0.5rem;
        color: var(--text-secondary);
        font-size: 1rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.12em;
    }

    .records-selector-btns .division-toggle {
        width: 100%;
        min-height: 48px;
        padding: 0.75rem 1.25rem;
        border-color: var(--border-medium);
        font-size: 0.9rem;
        text-align: left;
    }

    .records-drawer-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 10050;
        background: rgba(0, 0, 0, 0.55);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }

    .records-drawer-backdrop.visible {
        opacity: 1;
        pointer-events: auto;
    }

    body.records-drawer-locked {
        overflow: hidden;
    }
}

/* Team records selectors: fewer columns when all five don't fit in a row */
@media (max-width: 699px) {
    .records-selectors {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 479px) {
    .records-selectors {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 440px) {
    .header-logo {
        height: 40px;
        width: 60px;
    }

    .subtitle {
        letter-spacing: 2px;
    }

    .header-wordmark {
        height: 20px;
    }

    .standings-controls {
        margin: 0 0 1rem 0;
        gap: 16px;
    }

    .view-btn {
        font-size: 0.6875rem;
    }

    /* Very small game cards for tiny screens */
    .game-card {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .game-team-logo {
        width: 44px;
        height: 44px;
    }

    .team-abbrev {
        font-size: 0.75rem;
    }

    .score-line {
        font-size: 1rem;
    }

    .game-result {
        font-size: 0.75rem;
    }

    .game-label {
        font-size: 0.65rem;
    }

    .game-date {
        font-size: 0.75rem;
    }

    .game-at {
        font-size: 0.85rem;
    }

    .team-name {
        gap: 0.25rem;
    }

    th, td {
        padding: 0.35rem 0.25rem;
    }

    table {
        font-size: 0.65rem;
    }

    /* Hide player photos in stats tables on very small screens */
    #stats-view .player-photo-small {
        display: none;
    }

    /* Show short P% format without leading zero and 2 decimals */
    .p-pct-full {
        display: none;
    }

    .p-pct-mobile {
        display: inline;
    }

    /* Hide rank column on small screens in standings tables only */
    #dashboard-view th.rank,
    #dashboard-view td.rank,
    #standings-view th.rank,
    #standings-view td.rank {
        display: none;
    }

    .schedule-table td:nth-child(1),
    .schedule-table td:nth-child(2) {
        font-size: 0.6rem;
    }

    .schedule-table th:nth-child(1),
    .schedule-table td:nth-child(1) {
        width: 65px; /* Date */
    }

    .schedule-table th:nth-child(2),
    .schedule-table td:nth-child(2) {
        width: 68px; /* Time */
    }
}

/* Mobile: the Last card swaps its scoreboard for a one-line version so the Next card stands out —
   "LAST • OCT 3 • W   Recap ↗" on top, then [logo] AWAY 3 @ HOME 4 [logo] */
.game-compact {
    display: none;
}

@media (max-width: 768px) {
    .game-card--last {
        padding: 0.625rem 0.75rem;
    }

    .game-card--last .game-full {
        display: none;
    }

    .game-compact {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 0.5rem 1.25rem;
        width: 100%;
    }

    .game-compact .game-label {
        order: 1;
    }

    .game-compact .game-card-h2h-link {
        order: 2;
    }

    .game-compact .game-matchup {
        order: 3;
        gap: 0.5rem;
    }

    .game-compact .series-record {
        order: 4;
        width: 100%;
        margin: 0;
    }

    .game-compact .team-display {
        flex-direction: row;
        gap: 0.375rem;
    }

    /* Home team reads "4 MIN [logo]", mirroring the schedule rows */
    .game-compact .game-matchup .team-display:last-child {
        flex-direction: row-reverse;
    }

    .game-compact .game-team-logo {
        width: 24px;
        height: 24px;
    }

    .game-compact .team-abbrev {
        font-size: 0.875rem;
        white-space: nowrap;
    }

    .game-compact .game-at {
        font-size: 0.8125rem;
        margin: 0;
    }

    /* Same size as the label it sits beside */
    .game-compact .game-card-h2h-link {
        margin: 0;
        font-size: 0.7rem;
    }

    /* Just "Recap ↗" on mobile */
    .game-compact .recap-link-prefix {
        display: none;
    }
}

@media (max-width: 440px) {
    .game-compact .game-card-h2h-link {
        font-size: 0.65rem;
    }
}

/* Stats page specific mobile styles */
@media (max-width: 1024px) {
    .player-photo-small {
        width: 24px;
        height: 24px;
        margin-right: 0.35rem;
    }

    /* Show abbreviated player names on mobile */
    .player-name .player-full-name {
        display: none;
    }

    .player-name .player-abbrev-text {
        display: inline;
        font-weight: 500;
    }
}

/* SPA View Management */
.view {
    display: none;
}

.view.active {
    display: block;
}

/* Player Card Popup */
.player-card-popup {
    position: fixed;
    width: 320px;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    z-index: 10001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
    overflow: hidden;
}

.player-card-popup.visible {
    opacity: 1;
    pointer-events: auto;
}

.player-card-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
    padding: 0;
}

.player-card-close:hover {
    background: rgba(0, 0, 0, 0.6);
    color: var(--text-primary);
    border-color: var(--wild-gold);
}

.player-card-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 2.75rem 1.5rem 1rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.player-card-spinner {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-medium);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: playerCardSpin 0.8s linear infinite;
}

@keyframes playerCardSpin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .records-selector-btns,
    .records-drawer-backdrop {
        transition: none !important;
    }

    .player-card-spinner {
        animation-duration: 2.4s;
    }
}

.player-card-header {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    padding-right: 2.5rem;
    background-size: cover, 140%;
    background-position: center, right -10px center;
    background-repeat: no-repeat;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
}

.player-card-photo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-medium);
    background-color: rgba(1, 1, 1, 0.5);
}

.player-card-title {
    flex: 1;
}

.player-card-name-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.player-card-name-row h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
}

.player-card-number {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Monaco', monospace;
}

.player-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.player-card-flag {
    width: 16px;
    height: 12px;
}

.player-card-stats {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
}

.stat-row:last-child {
    margin-bottom: 0;
}

.stat-row.highlight {
    color: var(--wild-gold);
}

.stat-label {
    color: var(--text-secondary);
}

.stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

.stat-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.stat-table td {
    padding: 0.25rem 0.15rem;
}

.stat-table .stat-label {
    color: var(--text-secondary);
    text-align: left;
    padding-right: 0.5rem;
}

.stat-table .stat-number {
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    width: 2ch;
}

.stat-table .stat-separator {
    color: var(--text-secondary);
    opacity: 0.5;
    text-align: center;
    padding: 0 0.15rem;
}

.stat-table .stat-streak {
    color: var(--wild-gold);
}

.stat-table .stat-streak-value {
    text-align: right;
    font-weight: 600;
}

.stat-ppg {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-left: 0.5rem;
    white-space: nowrap;
    text-align: right;
}

.ppg-up {
    color: #10b981;
}

.ppg-down {
    color: #ef4444;
}

.ppg-neutral {
    color: var(--text-secondary);
}

.player-card-rankings {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-subtle);
}

.rankings-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ranking-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: rgba(234, 170, 0, 0.15);
    color: var(--wild-gold);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
}

.player-card-link {
    display: block;
    padding: 0.75rem 1rem;
    text-align: center;
    color: var(--wild-gold);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    background-color: var(--bg-tertiary);
    transition: opacity 0.2s ease;
}

.player-card-link:hover {
    opacity: 0.8;
}

.player-hoverable {
    cursor: pointer;
}

/* Show player cards on all screen sizes since we're using click */
@media (max-width: 768px) {
    .player-card-popup {
        /* Allow on mobile since click is better than hover */
        max-width: calc(100vw - 2rem);
    }
}

/* Schedule-specific styles */
#schedule-container {
    position: relative;
}

/* Past Seasons: season dropdown, top right like the Hide Past Games toggle */
.schedule-season-picker {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.schedule-season-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.schedule-season-select {
    min-height: 40px;
    min-width: 7.5rem;
    font-size: 0.9rem;
}

.schedule-header {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
}

.schedule-header + #schedule-tables {
    padding-top: 2.5rem;
}

.schedule-month {
    margin-bottom: 2.5rem;
}

.schedule-table table {
    table-layout: fixed;
    width: 100%;
}

.schedule-table th:nth-child(1),
.schedule-table td:nth-child(1) {
    width: 120px; /* Date */
}

.schedule-table th:nth-child(2),
.schedule-table td:nth-child(2) {
    width: 130px; /* Time */
}

.schedule-table th:nth-child(3),
.schedule-table td:nth-child(3) {
    width: 340px; /* Matchup - includes scores and result */
}

.schedule-table th:nth-child(4),
.schedule-table td:nth-child(4) {
    width: 110px; /* TV */
}

.schedule-table th:nth-child(5),
.schedule-table td:nth-child(5) {
    width: 95px; /* Links */
}

.schedule-month:first-child h2 {
    display: inline-block;
}

.schedule-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.schedule-toggle .toggle-label {
    font-weight: 500;
}

.schedule-toggle:hover .toggle-label {
    color: var(--text-primary);
}

/* Hide default checkbox visually but keep it focusable */
.schedule-toggle input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Toggle slider (pill background) */
.toggle-slider {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 24px;
    transition: background-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-medium);
}

/* Toggle slider circle */
.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 2px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Checked state - green background */
.schedule-toggle input[type="checkbox"]:checked + .toggle-slider {
    background-color: var(--wild-green);
    border-color: var(--wild-green);
}

/* Checked state - slide circle to the right */
.schedule-toggle input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(24px);
}

/* Hover effect */
.schedule-toggle:hover .toggle-slider {
    opacity: 0.9;
}

/* Focus style for keyboard navigation */
.schedule-toggle input[type="checkbox"]:focus-visible + .toggle-slider {
    outline: 2px solid var(--wild-gold);
    outline-offset: 2px;
}

.matchup-cell {
    display: grid;
    grid-template-columns: 28px 42px 28px 24px 28px 42px 28px 1fr;
    align-items: center;
    gap: 4px;
}

.matchup-cell.future-game {
    grid-template-columns: 28px 42px 24px 42px 28px;
}

.matchup-away-logo,
.matchup-home-logo {
    display: flex;
    justify-content: center;
}

.matchup-away-team,
.matchup-home-team {
    font-weight: 500;
    text-align: center;
}

.matchup-away-score,
.matchup-home-score {
    text-align: center;
    font-weight: 600;
}

.matchup-at {
    text-align: center;
    color: var(--text-secondary);
}

.matchup-result {
    font-weight: 600;
    padding-left: 8px;
}

.matchup-tv-mobile {
    display: none;
}

.matchup-cell .team-logo {
    width: 24px;
    height: 24px;
}

.game-win {
    color: var(--wild-green);
}

.game-loss {
    color: var(--wild-red);
}

/* Dashboard News Section */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.news-card {
    background-color: rgba(20, 20, 20, 0.75);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: border-color 0.2s ease;
}

.news-card:hover {
    border-color: var(--wild-green);
}

.news-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.news-card:hover .news-card-image {
    transform: scale(1.05);
}

.news-card-title {
    padding: 0.75rem 0.75rem 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.news-card-source {
    padding: 0 0.75rem 0.75rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-align: right;
    margin-top: auto;
}

.news-more-container {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.news-more-btn {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    padding: 0.75rem 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.news-more-btn:hover:not(:disabled) {
    background-color: var(--bg-tertiary);
    border-color: var(--wild-green);
}

.news-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.opp-in-playoffs {
    text-decoration: underline;
    text-decoration-color: var(--wild-green);
    text-underline-offset: 3px;
}

.opp-out-playoffs {
    text-decoration: underline;
    text-decoration-color: var(--wild-red);
    text-underline-offset: 3px;
}

.game-home {
    background-color: rgba(255, 255, 255, 0.02);
}

.game-away {
    background-color: rgba(0, 0, 0, 0.15);
}

.game-link {
    color: var(--wild-gold);
    font-size: 0.8rem;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.game-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.game-link.live-link {
    color: var(--wild-green);
    font-weight: 600;
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
}

.series-record {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
}

.game-card-h2h-link {
    display: block;
    margin-top: 0.75rem;
    color: var(--wild-gold);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.2s ease;
}

.game-card-h2h-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Playoff badge on dashboard game cards */
.playoff-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 1px 6px;
    background-color: #fff;
    color: #000;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border-radius: 3px;
    text-transform: uppercase;
    vertical-align: middle;
}

/* Playoff section on schedule page */
.schedule-playoffs {
    margin-top: 2rem;
    border-top: 2px solid var(--text-primary);
    padding-top: 0.5rem;
}

.schedule-playoffs h2 {
    color: var(--text-primary);
    display: flex;
    align-items: center;
}

.stanley-cup-icon {
    height: 1.2em;
    width: auto;
    vertical-align: middle;
    margin-right: 0.4em;
}

/* Playoff bracket placeholder (outside playoff mode) */
.playoff-paused {
    text-align: center;
    padding: 3rem 1rem;
    max-width: 420px;
    margin: 0 auto;
}

.playoff-paused-icon {
    height: 56px;
    width: auto;
    margin-bottom: 1rem;
    opacity: 0.85;
}

.playoff-paused h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.playoff-paused p {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    margin-bottom: 1.25rem;
}

/* Playoff position key */
.schedule-playoff-key {
    display: flex;
    gap: 1.5rem;
    padding: 0.75rem 1rem;
    background-color: var(--bg-secondary);
    border-radius: 6px;
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.schedule-playoff-key .key-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Mobile adjustments for schedule */
@media (max-width: 1024px) {
    .matchup-cell {
        font-size: 0.8rem;
        grid-template-columns: 24px 38px 24px 20px 24px 38px 24px 1fr;
        gap: 3px;
    }

    .matchup-cell.future-game {
        grid-template-columns: 24px 38px 20px 38px 24px 1fr;
    }

    .matchup-cell.future-game .matchup-tv-mobile {
        display: block;
        color: var(--text-secondary);
        font-size: 0.7rem;
        padding-left: 6px;
    }

    .matchup-cell .team-logo {
        width: 20px;
        height: 20px;
    }

    /* Adjust schedule table column widths for tablets */
    .schedule-table th:nth-child(1),
    .schedule-table td:nth-child(1) {
        width: 110px; /* Date */
    }

    .schedule-table th:nth-child(2),
    .schedule-table td:nth-child(2) {
        width: 120px; /* Time */
    }

    .schedule-table th:nth-child(3),
    .schedule-table td:nth-child(3) {
        width: 310px; /* Matchup - includes scores and result */
    }

    .schedule-table th:nth-child(4),
    .schedule-table td:nth-child(4) {
        width: 100px; /* TV */
    }

    .schedule-table th:nth-child(5),
    .schedule-table td:nth-child(5) {
        width: 90px; /* Links */
    }
}

@media (max-width: 768px) {
    .schedule-month h2 {
        font-size: 0.9rem;
    }

    .schedule-toggle {
        font-size: 0.75rem;
        gap: 0.5rem;
    }

    .toggle-slider {
        width: 42px;
        height: 22px;
    }

    .toggle-slider::before {
        height: 16px;
        width: 16px;
        top: 2px;
    }

    .schedule-toggle input[type="checkbox"]:checked + .toggle-slider::before {
        transform: translateX(20px);
    }

    .matchup-away-logo,
    .matchup-home-logo {
        display: none;
    }

    .matchup-cell {
        font-size: 0.7rem;
        grid-template-columns: 32px 22px 18px 22px 32px 1fr;
        gap: 2px;
    }

    .matchup-cell.future-game {
        grid-template-columns: 32px 18px 32px 1fr;
    }

    .matchup-cell.future-game .matchup-tv-mobile {
        font-size: 0.6rem;
    }

    /* Adjust schedule table column widths for mobile */
    .schedule-table th:nth-child(1),
    .schedule-table td:nth-child(1) {
        width: 50px; /* Date */
    }

    .schedule-table th:nth-child(2),
    .schedule-table td:nth-child(2) {
        width: 110px; /* Time */
    }

    .schedule-table th:nth-child(3),
    .schedule-table td:nth-child(3) {
        width: auto; /* Matchup - takes remaining space */
    }

    .schedule-table td:nth-child(1),
    .schedule-table td:nth-child(2) {
        font-size: 0.65rem;
    }
}

/* Dashboard Highlights Section */
.highlights-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.highlight-card {
    background-color: rgba(20, 20, 20, 0.75);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.highlight-card:hover {
    border-color: var(--wild-green);
}

.highlight-thumbnail-container {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.highlight-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.highlight-card:hover .highlight-thumbnail {
    transform: scale(1.05);
}

.highlight-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.highlight-card:hover .highlight-play-overlay {
    opacity: 1;
}

.highlight-play-overlay .play-icon {
    width: 48px;
    height: 48px;
    color: white;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.highlight-title {
    padding: 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 1024px) {
    .highlights-grid {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .highlight-play-overlay .play-icon {
        width: 40px;
        height: 40px;
    }
}

/* Media and Schedule Pages - Controls */
.media-controls,
.schedule-controls {
    display: flex;
    gap: 30px;
    margin: 0 0 2rem 0;
    padding: 0;
}

@media (max-width: 1024px) {
    .media-controls,
    .schedule-controls {
        margin: 0 0 1.5rem 0;
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .media-controls,
    .schedule-controls {
        margin: 0 0 1.25rem 0;
        gap: 20px;
    }
}

@media (max-width: 440px) {
    .media-controls,
    .schedule-controls {
        margin: 0 0 1rem 0;
        gap: 16px;
    }
}

/* Media Page - Video Grid */
.video-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.video-card {
    background-color: rgba(20, 20, 20, 0.75);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.video-card:hover {
    border-color: var(--wild-green);
    transform: translateY(-2px);
}

.video-thumbnail-container {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.video-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.video-card:hover .video-thumbnail {
    transform: scale(1.05);
}

.video-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.video-card:hover .video-play-overlay {
    opacity: 1;
}

.play-icon {
    width: 64px;
    height: 64px;
    color: white;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.video-info {
    padding: 0.75rem;
}

.video-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0 0 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-date {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.video-more-container {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.video-more-btn {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    padding: 0.75rem 2rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.video-more-btn:hover:not(:disabled) {
    background-color: var(--bg-tertiary);
    border-color: var(--wild-green);
}

.video-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Video Modal */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.video-modal.visible {
    opacity: 1;
}

.video-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
}

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    max-height: calc(100vh - 100px);
    aspect-ratio: 16 / 9;
    z-index: 1;
}

.video-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-medium);
    border-radius: 4px;
    color: white;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.video-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--wild-gold);
}

.video-player-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: black;
    border-radius: 8px;
    overflow: hidden;
}

.video-player-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Media page responsive styles */
@media (max-width: 1200px) {
    .video-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .play-icon {
        width: 48px;
        height: 48px;
    }

    .video-modal-content {
        width: 95%;
        max-height: calc(100vh - 80px);
    }

    .video-modal-close {
        top: -36px;
        width: 32px;
        height: 32px;
        font-size: 1.25rem;
    }
}

/* Landscape mode with limited height - overlay close button on video */
@media (max-height: 500px) {
    .video-modal-content {
        max-height: calc(100vh - 20px);
    }

    .video-modal-close {
        top: 8px;
        right: 8px;
        background: rgba(0, 0, 0, 0.7);
        border-color: rgba(255, 255, 255, 0.3);
        z-index: 10;
    }

    .video-modal-close:hover {
        background: rgba(0, 0, 0, 0.9);
    }
}

/* About Modal */
.about-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.about-modal.visible {
    opacity: 1;
    pointer-events: auto;
}

.about-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
}

.about-modal-content {
    position: relative;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    border-radius: 12px;
    padding: 2.5rem;
    max-width: 420px;
    width: 90%;
    text-align: center;
    z-index: 1;
}

.about-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease, color 0.2s ease;
}

.about-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.about-modal-site-name {
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.about-modal-title {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.about-modal-title a {
    color: var(--wild-gold);
    text-decoration: none;
}

.about-modal-title a:hover {
    text-decoration: underline;
}

.about-modal-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.about-modal-links {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
}

.about-modal-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: background 0.2s ease;
}

.about-modal-links a:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ─── Milestones page ──────────────────────────────────────────────────────── */

.milestones-section {
    margin-bottom: 2.5rem;
}

.milestones-section-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.milestones-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.milestone-card {
    background-color: rgba(20, 20, 20, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 1.25rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    transition: border-color 0.2s ease;
    cursor: pointer;
}

.milestone-card:hover {
    border-color: var(--border-medium);
}

.milestone-card--achieved {
    border-color: rgba(6, 146, 52, 0.35);
    background-color: rgba(6, 146, 52, 0.06);
}

.milestone-card--achieved:hover {
    border-color: rgba(6, 146, 52, 0.55);
}

.milestone-photo-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-medium);
    flex-shrink: 0;
    background-color: var(--bg-tertiary);
}

.milestone-card--achieved .milestone-photo-wrap {
    border-color: var(--wild-green);
}

.milestone-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.milestone-photo--placeholder {
    width: 100%;
    height: 100%;
    background-color: var(--bg-tertiary);
}

.milestone-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    width: 100%;
}

.milestone-player-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.milestone-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
}

.milestone-number {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--wild-gold);
    line-height: 1;
    margin: 0.25rem 0;
}

.milestone-number--achieved {
    color: var(--wild-green);
}

.milestone-achieved-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--wild-green);
    background-color: rgba(6, 146, 52, 0.15);
    border: 1px solid rgba(6, 146, 52, 0.3);
    border-radius: 3px;
    padding: 0.2rem 0.5rem;
    margin-top: 0.1rem;
}

.milestone-progress-wrap {
    width: 100%;
    margin-top: 0.25rem;
}

.milestone-progress-track {
    width: 100%;
    height: 6px;
    background-color: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.milestone-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--wild-green), #0ab840);
    border-radius: 3px;
    transition: width 0.6s ease;
}

.milestone-progress-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-tertiary);
    margin-top: 0.35rem;
}

.milestones-empty {
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 1.5rem 0;
}

@media (max-width: 900px) {
    .milestones-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

    .milestone-number {
        font-size: 2.25rem;
    }
}

/* ─── Current Season page ──────────────────────────────────────────────────── */

.season-section {
    margin-bottom: 2.5rem;
}

.season-section-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #e0e0e0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.points-chart-wrap {
    background-color: rgba(20, 20, 20, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 1rem 0.5rem 0.5rem;
    overflow: hidden;
}

.points-chart {
    width: 100%;
    height: auto;
    display: block;
}

.team-group {
    transition: filter 0.15s ease, opacity 0.15s ease;
    cursor: pointer;
}

/* Team logos under the chart: hover, focus or tap one to highlight that team */
.chart-team-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 0.5rem;
    padding: 0.5rem 0.5rem 0.25rem;
}

.chart-legend-team {
    display: flex;
    padding: 0.25rem;
    background: none;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: filter 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}

.chart-legend-team img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.chart-legend-team:hover,
.chart-legend-team:focus-visible,
.chart-legend-team.active {
    border-color: var(--border-medium);
    outline: none;
}

.chart-legend-team.dimmed {
    filter: grayscale(1);
    opacity: 0.35;
}

@media (max-width: 440px) {
    .chart-team-legend {
        gap: 0.125rem 0.25rem;
    }

    .chart-legend-team img {
        width: 24px;
        height: 24px;
    }
}

.chart-grid {
    stroke: rgba(255, 255, 255, 0.06);
    stroke-width: 1;
}

.chart-axis {
    stroke: rgba(255, 255, 255, 0.15);
    stroke-width: 1;
}

.chart-label {
    font-size: 11px;
    fill: var(--text-secondary);
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.chart-axis-title {
    font-size: 11px;
    fill: var(--text-tertiary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: inherit;
}

.chart-tooltip-bg {
    fill: rgba(30, 30, 35, 0.92);
    stroke: rgba(255, 255, 255, 0.15);
    stroke-width: 1;
}

.chart-tooltip-text {
    font-size: 9.5px;
    fill: var(--text-primary);
    font-family: 'SF Mono', 'Monaco', 'Courier New', monospace;
}

.chart-loading {
    padding: 4rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.chart-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.875rem;
}

@media (max-width: 600px) {
    .chart-controls {
        row-gap: 1.5rem;
    }
}

.chart-mode-toggles {
    display: flex;
    gap: 0.5rem;
}

.division-toggles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chart-midline {
    stroke: rgba(255, 255, 255, 0.30);
    stroke-width: 1;
    stroke-dasharray: 4 4;
}

.division-toggle {
    padding: 0.35rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.division-toggle:hover {
    border-color: var(--border-medium);
    color: var(--text-primary);
}

.division-toggle.active {
    background: rgba(28, 140, 71, 0.15);
    border-color: var(--wild-green);
    color: var(--text-primary);
}

.division-toggle:disabled {
    opacity: 0.28;
    cursor: not-allowed;
    border-color: var(--border-subtle);
    color: var(--text-secondary);
    background: transparent;
}

.division-toggle:disabled:hover {
    border-color: var(--border-subtle);
    color: var(--text-secondary);
}

/* ─── Season stats loading placeholder ────────────────────────────────────── */

.season-stats-loading {
    padding: 2.5rem;
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.season-section-note {
    font-size: 0.78rem;
    color: #909090;
    margin-bottom: 0.875rem;
    margin-top: -0.5rem;
}

.season-no-data {
    color: #909090;
    font-size: 0.85rem;
    padding: 1rem 0;
}

.season-subsection-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #d0d0d0;
    margin: 1.25rem 0 0.625rem;
}

/* ─── Season At a Glance grid ─────────────────────────────────────────────── */

.season-glance-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.season-glance-card {
    flex: 1 1 110px;
    background: rgba(20, 20, 20, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    text-align: center;
    min-width: 100px;
}

.glance-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #909090;
    margin-bottom: 0.25rem;
}

.glance-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.15;
    letter-spacing: -0.01em;
}

.glance-value.glance-positive { color: #3cb96a; }
.glance-value.glance-negative { color: var(--wild-red); }

.glance-sub {
    font-size: 0.68rem;
    color: #909090;
    margin-top: 0.2rem;
}

/* ─── Season data tables ──────────────────────────────────────────────────── */

.season-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%; /* Explicit width ensures scroll containment on iOS Safari */
    background: rgba(15, 15, 15, 0.7);
    border-radius: 8px;
    padding: 0;
    border: 1px solid var(--border-subtle);
}

.season-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    min-width: 420px;
}

.season-table th {
    text-align: left;
    padding: 0.45rem 0.75rem;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #a0a0a0;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.season-table td {
    padding: 0.45rem 0.75rem;
    color: #d0d0d0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    white-space: nowrap;
}

.season-table tbody tr:nth-child(even) td {
    background: rgba(255,255,255,0.025);
}

.season-table th:first-child,
.season-table td:first-child {
    padding-left: 0.75rem;
}

.season-table th:last-child,
.season-table td:last-child {
    padding-right: 0.75rem;
}

.season-table thead tr:first-child th:first-child {
    border-top-left-radius: 7px;
}

.season-table thead tr:first-child th:last-child {
    border-top-right-radius: 7px;
}

.season-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 7px;
}

.season-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 7px;
}

.season-table tbody tr:hover td {
    background: rgba(255,255,255,0.025);
    color: var(--text-primary);
}

.season-table .stat-highlight {
    color: var(--text-primary);
    font-weight: 600;
}

.season-table .period-label {
    font-weight: 600;
    color: var(--text-primary);
}

.season-table .period-total td {
    border-top: 1px solid var(--border-subtle);
    border-bottom: none;
    font-weight: 700;
    color: var(--text-primary);
}

.period-pos { color: #3cb96a; font-weight: 600; }
.period-neg { color: var(--wild-red); font-weight: 600; }

/* ─── Situational records table ──────────────────────────────────────────── */

.situation-table .sit-label {
    font-weight: 600;
    color: var(--text-primary);
}

.situation-table .sit-label-leading { color: #3cb96a; }
.situation-table .sit-label-trailing { color: var(--wild-red); }
.situation-table .sit-label-tied { color: #c0c0c0; }

.sit-record {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
}

.sit-pct {
    display: block;
    font-size: 0.72rem;
    color: #909090;
    margin-top: 0.1rem;
}

/* ─── Division table rows ─────────────────────────────────────────────────── */

.div-section-row td {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    padding-top: 0.875rem !important;
    padding-bottom: 0.3rem !important;
    border-bottom: none;
}

/* ─── Playoff opponent rows ───────────────────────────────────────────────── */

.playoff-opp-row td {
    font-size: 0.79rem;
}

.playoff-opp-logo {
    vertical-align: middle;
    flex-shrink: 0;
}

.team-name-full {
    color: var(--text-secondary);
}

.no-data-cell {
    color: var(--text-tertiary);
    font-style: italic;
}

/* ─── OT / Shootout section ───────────────────────────────────────────────── */

.ot-summary-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
}

.ot-summary-card {
    flex: 1 1 140px;
    background: rgba(20, 20, 20, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    text-align: center;
}

.ot-tables-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.ot-tables-grid > div {
    min-width: 0; /* Allow grid cells to shrink below content min-width so overflow-x:auto works */
}

@media (max-width: 640px) {
    .ot-tables-grid {
        grid-template-columns: 1fr;
    }

    .season-glance-card {
        flex: 1 1 calc(33% - 0.625rem);
        min-width: 80px;
    }

    .glance-value {
        font-size: 1.1rem;
    }
}

/* ─── Sweater numbers ─────────────────────────────────────────────────────── */

.numbers-header {
    margin-bottom: 1.25rem;
}

/* Jersey Stats: cards of number trivia under the jersey grid */
.jersey-stats {
    margin-top: 2.5rem;
    scroll-margin-top: 1rem;
}

.jersey-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    align-items: start;
}

.jersey-stat-card {
    padding: 1rem;
    background-color: rgba(20, 20, 20, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
}

.jersey-stat-title {
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.jersey-stat-note {
    margin: -0.25rem 0 0.75rem;
    color: var(--text-secondary);
    font-size: 0.8125rem;
}

.jersey-never-worn {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(2.25rem, 1fr));
    gap: 0.375rem 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
}

.jersey-stat-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.jersey-stat-row {
    display: grid;
    grid-template-columns: 1.75rem 2.75rem minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.875rem;
}

/* Rows behind "Show all" (the grid display above would otherwise override [hidden]) */
.jersey-stat-row[hidden] {
    display: none;
}

/* One and Done rows have no rank column */
.jersey-stat-row--unranked {
    grid-template-columns: 2.75rem minmax(0, 1fr) auto;
}

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

.jersey-stat-rank {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.jersey-stat-number {
    font-size: 1.125rem;
    font-weight: 700;
}

.jersey-stat-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jersey-stat-value {
    font-weight: 600;
    white-space: nowrap;
}

.jersey-stat-unit {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 400;
}

/* Server-rendered list for search engines; the page script replaces it with the full layout */
.numbers-prerender h2 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
}

.numbers-prerender h3 {
    margin-top: 1rem;
    font-size: 0.9rem;
}

.numbers-prerender p,
.numbers-prerender li {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.numbers-prerender ul {
    padding-left: 1.25rem;
}

/* Matches the section headings on Milestones and Team Records */
.numbers-section-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.numbers-intro {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.numbers-grid {
    /* At most three columns; cards stay at least 380px wide, dropping to two then one column */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(max(380px, calc((100% - 2rem) / 3)), 1fr));
    gap: 1rem;
}

.number-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
    background-color: rgba(20, 20, 20, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    scroll-margin-top: 1rem;
}

.number-jersey {
    position: relative;
    flex-shrink: 0;
    width: 100px;
    height: 100px;
}

.number-jersey-img,
.number-jersey-num {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.number-jersey-num text {
    font-family: 'Saira Condensed', 'Roboto', sans-serif;
    font-weight: 800;
    font-size: 45px;
    fill: var(--jersey-wheat);
    stroke: var(--jersey-red);
    stroke-width: 1.6px;
    stroke-linejoin: round;
    paint-order: stroke;
}

.number-wearers {
    flex: 1;
    min-width: 0;
}

.number-wearers-count {
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.number-retired {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.1rem 0.5rem;
    border: 1px solid var(--text-secondary);
    border-radius: 999px;
    color: var(--text-primary);
    font-size: 0.65rem;
    letter-spacing: 0.08em;
    vertical-align: middle;
}

.number-card--retired {
    border-color: var(--border-medium);
}

.number-wearer-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.number-wearer {
    min-height: 40px;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border-subtle);
}

.number-wearer:last-child {
    border-bottom: none;
}

.number-wearer[hidden] {
    display: none;
}

/* Name + total GP, then one "seasons · games" line per stint */
.number-wearer-main,
.number-wearer-stint {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    min-width: 0;
}

.number-wearer-gp,
.number-wearer-split {
    flex-shrink: 0;
}

.number-wearer-name {
    color: var(--text-secondary);
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.number-wearer--current .number-wearer-name {
    color: var(--text-primary);
    font-weight: 600;
}

.number-wearer--current {
    cursor: pointer;
}

.number-wearer-seasons,
.number-wearer-split {
    color: var(--text-tertiary);
    font-size: 0.72rem;
    white-space: nowrap;
}

.number-wearer-gp {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

.number-wearer-gp-label {
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 500;
}

.number-show-all {
    margin-top: 0.5rem;
    min-height: 32px;
    padding: 0;
    background: none;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
}

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

    .number-card {
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .number-jersey {
        width: 84px;
        height: 84px;
    }
}
