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

    /* 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;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

header {
    background-color: var(--bg-primary);
    padding: 2rem 0 1.5rem 0;
}

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

.site-title {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    height: 65px;
    width: auto;
}

.header-text h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.01em;
}

.main-nav {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.5rem 1.25rem;
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

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

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

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

.stat-leaders {
    margin: 0 0 2rem 0;
}

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

.stat-leader-card {
    background-color: var(--bg-secondary);
    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);
}

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

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

.leader-name {
    flex: 1;
    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;
}

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

.standings-controls {
    display: flex;
    gap: 0.75rem;
    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;
}

.stats-table-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow-x: auto;
}

.player-photo-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 0.5rem;
    vertical-align: middle;
}

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

.view-btn {
    position: relative;
    padding: 0.65rem 1.5rem;
    background-color: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.01em;
    text-decoration: none;
    display: inline-block;
}

.view-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(2, 73, 48, 0.05), rgba(234, 170, 0, 0.05));
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-btn:hover {
    color: var(--text-primary);
    transform: translateY(-1px);
}

.view-btn:hover::before {
    opacity: 1;
}

.view-btn.active {
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(2, 73, 48, 0.15), rgba(234, 170, 0, 0.1));
    box-shadow: 0 0 0 1px rgba(2, 73, 48, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.view-btn.active::before {
    opacity: 0;
}

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

.standings-section {
    margin-bottom: 2rem;
}

.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: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
}

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;
}

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;
}

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;
}

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

.team-abbrev-text {
    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;
}

.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;
}

.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;
}

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;
}

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

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

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .main-nav {
        width: 100%;
    }

    .nav-link {
        flex: 1;
        text-align: center;
    }

    .header-logo {
        height: 50px;
    }

    .header-text h1 {
        font-size: 1.35rem;
    }

    .standings-controls {
        margin: 2rem 0;
        gap: 0.5rem;
    }

    .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;
    }

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

    .view-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    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 {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 1.15rem;
    }

    .standings-controls {
        flex-direction: column;
    }

    .view-btn {
        width: 100%;
        padding: 0.6rem 1rem;
    }

    table {
        font-size: 0.7rem;
    }

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

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

@media (max-width: 440px) {
    .team-logo {
        display: none;
    }

    .team-name {
        gap: 0.25rem;
    }

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

    table {
        font-size: 0.65rem;
    }
}

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

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

.view.active {
    display: block;
}
