.team-header {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.team-header-top {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.team-logo-container {
    flex-shrink: 0;
}

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

.team-logo.nhl-logo {
    width: 100px;
    height: 100px;
}

.team-header-top h1 {
    font-size: 2.5rem;
    margin-bottom: 0;
    color: var(--text-primary);
    transition: color 0.3s ease;
    flex: 1;
    min-width: 200px;
}

.recent-games-section {
    margin-bottom: 2rem;
}

.recent-games-section h2 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.recent-games-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    max-width: 100%;
}

/* Responsive adjustments for recent games */
@media (max-width: 768px) {
    .recent-games-container {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
    }
    
    .recent-game-card:nth-child(n+3) {
        display: none; /* Show only 2 games on mobile */
    }
}
@media (min-width: 769px) and (max-width: 1200px) {
    .recent-games-container {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on tablet */
    }
    
    .recent-game-card:nth-child(n+4) {
        display: none; /* Show 3 games on tablets */
    }
}
@media (min-width: 1201px) {
    .recent-games-container {
        grid-template-columns: repeat(5, 1fr); /* 5 columns on desktop - single row */
    }
    
    .recent-game-card:nth-child(n+6) {
        display: none; /* Show 5 games on desktop */
    }
}

.recent-game-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 4px var(--shadow);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.recent-game-card .game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.recent-game-card .game-date {
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.game-date-mobile {
    display: none;
}

@media (max-width: 768px) {
    .game-date-desktop {
        display: none;
    }
    
    .game-date-mobile {
        display: inline;
    }
}

.game-type-badge {
    background-color: #495057; /* Darker gray for better contrast: #6c757d -> #495057 */
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

.recent-game-card .game-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.recent-game-card .team-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.recent-game-card .team-name {
    font-weight: 600;
    font-size: 1.1em;
    color: var(--text-primary);
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.recent-game-card .opponent-name {
    font-weight: 500;
    font-size: 1em;
    color: var(--text-secondary);
    margin-bottom: 4px;
    transition: color 0.3s ease;
}

.recent-game-card .score {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.recent-game-card .vs-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 10px;
}

.recent-game-card .vs {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.recent-game-card .vs-container .game-type-badge {
    margin-top: 4px;
    font-size: 0.75em;
    padding: 2px 7px;
}

.recent-game-card .playoff-change {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
    transition: color 0.3s ease, border-color 0.3s ease;
}

.recent-game-card .playoff-change.positive {
    color: #155724; /* Darker green for WCAG AA contrast in light mode */
    font-weight: 600;
}

.recent-game-card .playoff-change.positive::before {
    content: none;
}

.recent-game-card .playoff-change.negative {
    color: #dc3545;
    font-weight: 600;
}

/* Dark mode colors for playoff change */
[data-theme="dark"] .recent-game-card .playoff-change.positive {
    color: #4ade80; /* Lighter green for dark mode */
}

[data-theme="dark"] .recent-game-card .playoff-change.negative {
    color: #f87171; /* Lighter red for dark mode */
}

.team-stats {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.points {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
    transition: color 0.3s ease;
}

.record {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
    transition: color 0.3s ease;
}

.playoff-odds {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
    transition: color 0.3s ease;
}

.current-streak {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary); /* Use default text color in light mode */
    transition: color 0.3s ease;
}

.current-streak .positive {
    color: #155724 !important; /* Darker green for WCAG AA contrast in light mode (3:1 for large text on white) */
}

.current-streak .negative {
    color: #dc3545;
}

/* Dark mode colors for current streak */
[data-theme="dark"] .current-streak {
    color: #ffffff; /* White text in dark mode */
}

[data-theme="dark"] .current-streak .positive {
    color: #22c55e !important; /* Darker green (#22c55e) for better contrast on dark backgrounds - 3.5:1 on #1a1a1a */
}

[data-theme="dark"] .current-streak .negative {
    color: #f87171; /* Lighter red for dark mode */
}

.big-games-section, .what-if-section {
    margin-bottom: 2rem;
}

.big-games-section h2, .what-if-section h2, .recent-form-section h2 {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.big-games-section p, .recent-form-section p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.what-if-section p {
    color: #ffffff;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.recent-form-section {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.trends-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.trend-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1rem;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.trend-card h3 {
    color: var(--text-primary);
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    text-align: center;
    transition: color 0.3s ease;
}

.trend-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-separator {
    border: none;
    border-top: 1px solid var(--border-color);
    border-bottom: none;
    margin: 0;
    padding: 0;
    width: 100%;
    display: block;
    flex-shrink: 0;
    height: 0;
    background: none;
    box-shadow: none;
}

.magic-tragic-scope {
    margin: 0.5rem 0 0.35rem;
    font-size: 0.95rem;
    color: var(--text-secondary, #aaa);
    font-weight: 600;
    align-self: flex-start;
}

.trend-stats > .magic-tragic-scope:first-child {
    margin-top: 0;
}

.stat-row, .split-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
}

.split-row .split-value-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: right;
}

.stat-label, .split-label {
    color: var(--text-secondary);
    font-weight: 500;
    text-align: left;
    transition: color 0.3s ease;
}

.stat-value, .split-value {
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
    transition: color 0.3s ease;
}

/* Expected vs Actual layout */
.stat-row.expected-vs-actual {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.5rem;
    align-items: center;
}

.expected-value, .actual-value {
    font-weight: 600;
    text-align: center;
    transition: color 0.3s ease;
}

.actual-value {
    text-align: right;
}

.expected-value {
    text-align: left;
}

.stat-row.expected-vs-actual .stat-label {
    text-align: center;
    font-weight: 500;
}

.expected-value.positive, .actual-value.positive {
    color: #155724; /* Darker green for WCAG AA contrast in light mode */
}

.expected-value.negative, .actual-value.negative {
    color: #dc3545; /* Red for underperforming */
}

/* Dark mode colors for expected vs actual */
[data-theme="dark"] .expected-value.positive,
[data-theme="dark"] .actual-value.positive {
    color: #4ade80; /* Lighter green for dark mode */
}

[data-theme="dark"] .expected-value.negative,
[data-theme="dark"] .actual-value.negative {
    color: #f87171; /* Lighter red for dark mode */
}

.split-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.split-row .split-item:last-child {
    align-items: flex-end;
    text-align: right;
}

.split-value {
    font-size: 1.1em;
}

.split-percentage {
    color: var(--text-secondary);
    font-size: 0.9em;
    text-align: right;
    transition: color 0.3s ease;
}

.split-comparison {
    color: var(--text-secondary);
    font-size: 0.8em;
    margin-top: 0.125rem;
    transition: color 0.3s ease;
}

.stat-value.positive {
    color: #155724; /* Darker green for WCAG AA contrast in light mode */
}

.stat-value.negative {
    color: #dc3545;
}

/* Dark mode colors for stat values */
[data-theme="dark"] .stat-value.positive {
    color: #4ade80; /* Lighter green for dark mode */
}

[data-theme="dark"] .stat-value.negative {
    color: #f87171; /* Lighter red for dark mode */
}


.monthly-splits .trend-stats {
    max-height: 300px;
    overflow-y: auto;
}

.sparkline-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.sparkline-container > .stat-label {
    margin-bottom: 0.25rem;
}

.sparkline {
    flex: 1;
    height: 20px;
    width: 100%;
}

.sparkline-legend {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.sparkline-label {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.big-games-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
    max-width: 100%;
}

/* Responsive adjustments for team pages */
@media (max-width: 768px) {
    .big-games-container {
        grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
    }
}
@media (min-width: 769px) and (max-width: 1200px) {
    .big-games-container {
        grid-template-columns: repeat(3, 1fr); /* 3 columns on tablet */
    }
}
@media (min-width: 1201px) {
    .big-games-container {
        grid-template-columns: repeat(5, 1fr); /* 5 columns on desktop - single row */
    }
}

.big-game-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 4px var(--shadow);
    transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.game-date {
    font-weight: 600;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.importance-badge {
    background-color: #155724; /* Darker green for WCAG AA: #28a745 -> #155724 (4.5:1 with white text) */
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

.game-matchup {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.team.home-team {
    align-items: flex-end;
    text-align: right;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.team.home-team {
    align-items: flex-end;
    text-align: right;
}

.team-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary) !important;
    transition: color 0.3s ease;
}

.team-logo-small {
    width: 60px;
    height: 60px;
    object-fit: contain;
    display: block;
    margin-bottom: 0.5rem;
}

.team-link:hover {
    color: var(--hover-bg) !important;
}

[data-theme="dark"] .team-link:hover {
    color: #5dade2 !important; /* Lighter blue for better contrast on dark background */
}

.team-name {
    font-weight: 600;
    font-size: 1.1em;
    color: inherit;
    margin-bottom: 4px;
}

.team-stats {
    font-size: 0.9em;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.vs {
    font-weight: bold;
    color: var(--text-secondary);
    margin: 0 10px;
    font-size: 1.2em;
    transition: color 0.3s ease;
}

.game-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.reason-tag {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.what-if-table {
    overflow-x: auto;
}

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

.what-if-table th, .what-if-table td {
    padding: 0.5rem;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.what-if-table th {
    background: var(--bg-secondary);
    font-weight: bold;
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

.what-if-table td {
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background 0.3s ease, color 0.3s ease;
}

.scenario-points {
    font-weight: bold;
    background: var(--bg-secondary);
    transition: background 0.3s ease;
}

.scenario-record {
    font-family: monospace;
}

.playoff-chance {
    font-weight: bold;
}

.championship-chance {
    font-weight: bold;
    color: #1f77b4;
}

.seed-header {
    display: inline-block;
    width: 2rem;
    text-align: center;
    font-size: 0.8rem;
}

.playoff-separator {
    border-left: 2px dashed #dc3545;
    padding-left: 0.25rem;
}

.seed-chance {
    display: inline-block;
    width: 2rem;
    text-align: center;
    font-size: 0.8rem;
}

.simulation-count {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

/* Question mark links in section headings - ensure proper contrast in both modes */
.big-games-section h2 a,
.recent-form-section h2 a,
.what-if-section h2 a {
    color: #495057 !important; /* Dark gray for light mode (7.0:1 on white) */
}

[data-theme="dark"] .big-games-section h2 a,
[data-theme="dark"] .recent-form-section h2 a,
[data-theme="dark"] .what-if-section h2 a {
    color: #b0b0b0 !important; /* Light gray for dark mode (4.5:1+ on #1a1a1a) */
}

/* Compare button contrast fix */
.compare-section button {
    background-color: #1a5f8f; /* Darker blue for WCAG AA contrast with white text */
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.compare-section button:hover {
    background-color: #155080; /* Slightly darker on hover */
}

[data-theme="dark"] .compare-section button {
    background-color: #1a5f8f; /* Same darker blue in dark mode */
    color: #ffffff;
}

[data-theme="dark"] .compare-section button:hover {
    background-color: #155080; /* Slightly darker on hover */
}


/* Responsive Big Games - hide some games on smaller screens */
@media (max-width: 768px) {
    .big-game-card:nth-child(n+3) {
        display: none; /* Show only 2 games on mobile */
    }
}
@media (min-width: 769px) and (max-width: 1200px) {
    .big-game-card:nth-child(n+4) {
        display: none; /* Show 3 games on tablets */
    }
}
@media (min-width: 1201px) {
    .big-game-card:nth-child(n+6) {
        display: none; /* Show 5 games on desktop */
    }
}
/* playoff-series.css loaded separately */

