/* NHL Playoff Stats CSS */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

header {
    background: white;
    padding: 25px 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.main-header {
    background: white;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.header-title {
    flex: 0 0 auto;
}

.site-brand {
    display: inline-block;
    font-size: 0.75em;
    font-weight: 700;
    color: #0066cc !important;
    text-decoration: none !important;
    letter-spacing: -0.02em;
    margin-bottom: 2px;
}

.site-brand:hover {
    color: #0052a3 !important;
}

/* When site-brand appears in nav (non-index pages) */
.main-nav .site-brand {
    font-size: 14px;
    font-weight: 700;
    padding-right: 16px;
    margin-right: 8px;
    border-right: 1px solid #dee2e6;
}

h1 {
    font-size: 1.8em;
    margin-bottom: 2px;
    color: #1a1a1a;
    font-weight: 700;
}

.subtitle {
    font-size: 0.9em;
    color: #666;
    margin: 0;
}

/* Navigation */
.main-nav {
    display: flex;
    gap: 0;
    align-items: center;
}

.main-nav a {
    padding: 8px 16px;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.2s;
}

.main-nav a:hover {
    background: #f8f9fa;
    color: #0066cc;
}

.controls {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.controls form {
    display: inline;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: #0066cc;
    color: white;
}

.btn-primary:hover {
    background: #0052a3;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.last-updated {
    font-size: 0.85em;
    color: #888;
    font-style: italic;
    margin: 0;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.conference-section {
    background: white;
    margin-bottom: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
}

.conference-section h2 {
    padding: 20px 30px;
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-size: 1.5em;
    color: #1a1a1a;
}

.conference-section h3 {
    font-size: 1.1em;
    font-weight: 700;
    color: #1a1a1a;
    padding: 10px 0 6px 0;
    margin: 20px 0 8px 0;
    border-bottom: 2px solid #dee2e6;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.standings-table thead {
    background: #495057;
    color: white;
}

.standings-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.standings-table th.prob-col {
    background: #343a40;
}

.standings-table tbody tr {
    border-bottom: 1px solid #e9ecef;
    transition: background 0.2s;
}

.standings-table tbody tr:hover {
    background: #f8f9fa;
}

.standings-table td {
    padding: 12px 8px;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-name {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
}

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

.team-name a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
}

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

.division-tag {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    background: #e9ecef;
    border-radius: 3px;
    color: #666;
    text-transform: uppercase;
}

.position-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    background: #0066cc;
    color: white;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
}

.points {
    font-weight: bold;
    color: #1a1a1a;
}

.positive {
    color: #28a745;
}

.negative {
    color: #dc3545;
}

.prob-cell {
    text-align: center;
    font-weight: 600;
}

.pos-cell {
    text-align: center;
    font-size: 13px;
}

.section-header-row td {
    padding: 10px 12px;
    font-weight: 700;
    font-size: 13px;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-bottom: 2px solid #dee2e6;
    background: #f8f9fa;
}

.section-header-row:hover {
    background: #f8f9fa !important;
}

.cutoff-row {
    border-top: 3px solid #dc3545 !important;
    border-bottom: none !important;
    height: 3px;
}

.cutoff-row td {
    padding: 0;
}

.no-data {
    text-align: center;
    color: #999;
    font-style: italic;
}

/* Last 10 Games Visualization */
.last-ten-games {
    padding: 8px;
}

.game-streak {
    display: flex;
    gap: 2px;
    justify-content: center;
    align-items: center;
}

.game-result {
    width: 8px;
    height: 20px;
    display: inline-block;
    border-radius: 2px;
    transition: transform 0.2s;
}

.game-result:hover {
    transform: scaleY(1.2);
}

/* Win: Green (50% less saturated) */
.game-result.win {
    background: #60d394;
}

/* Regulation/OT Loss: Red (50% less saturated) */
.game-result.loss {
    background: #ee6055;
}

/* OT/SO Loss: Orange (50% less saturated - gets a point) */
.game-result.ot-loss {
    background: #ffd97d;
}

/* Sortable table headers */
.standings-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.standings-table th.sortable:hover {
    background: #5a6268;
}

.standings-table th.sortable::after {
    content: ' ↕';
    opacity: 0.5;
}

.standings-table th.sorted-asc::after {
    content: ' ↑';
    opacity: 1;
}

.standings-table th.sorted-desc::after {
    content: ' ↓';
    opacity: 1;
}

footer {
    text-align: center;
    padding: 30px;
    color: #666;
    font-size: 0.9em;
}

footer a {
    color: #0066cc;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Player Table */
.player-table th {
    font-size: 11px;
}

.player-table td {
    font-size: 13px;
}

/* Trade Badges */
.trade-badge {
    display: inline-block;
    font-size: 9px;
    padding: 2px 5px;
    margin-left: 5px;
    border-radius: 3px;
    font-weight: 600;
    cursor: help;
}

.trade-badge.acquired {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.trade-badge.traded {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Sparkline */
.sparkline-cell {
    padding: 8px 12px;
}

.sparkline-container {
    width: 150px;
    height: 40px;
    position: relative;
}

.sparkline-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.sparkline-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 11px;
    pointer-events: none;
    z-index: 1000;
    white-space: nowrap;
    line-height: 1.4;
}

.sparkline-zero-line {
    stroke: #ccc;
    stroke-width: 1;
    /*stroke-dasharray: 2,2;*/
}

.sparkline-plusminus-line {
    fill: none;
    stroke-width: 1.5;
    stroke: #777;
}

.sparkline-inactive-region {
    fill: rgba(128, 128, 128, 0.25);
}

.sparkline-point-marker.goal {
    fill: #0066cc;
}

.sparkline-point-marker.assist {
    fill: #28a745;
}

/* Playoff Probability Breakdown */
.breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.breakdown-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.breakdown-card h3 {
    font-size: 1.1em;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 10px;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

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

.metric-label {
    font-weight: 500;
    color: #666;
    font-size: 0.9em;
    flex: 0 0 45%;
}

.metric-value {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 0.95em;
    text-align: right;
    flex: 1;
}

/* Schedule Balance Indicators */
.metric-value.schedule-roadheavy {
    color: #dc3545;
}

.metric-value.schedule-homeheavy {
    color: #28a745;
}

.metric-value.schedule-balanced {
    color: #6c757d;
}

/* Difficulty Indicators */
.metric-value.difficulty-easy {
    color: #28a745;
}

.metric-value.difficulty-average {
    color: #6c757d;
}

.metric-value.difficulty-difficult {
    color: #dc3545;
}

/* Contextual Messages */
.contextual-messages {
    margin-bottom: 30px;
}

.contextual-messages h3 {
    font-size: 1em;
    margin-bottom: 10px;
    color: #555;
}

.contextual-message {
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border-left: 4px solid;
    font-size: 0.95em;
    line-height: 1.5;
}

.contextual-message.warning {
    background: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

.contextual-message.success {
    background: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.contextual-message.info {
    background: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* Team Detail Page Overrides */
.conference-section.team-detail h2 {
    background: none;
    border-bottom: 2px solid #e9ecef;
    padding: 0 0 10px 0;
    margin: 40px 0 16px 0;
    font-size: 1.25em;
}

.team-detail .breakdown-card h3 {
    text-transform: none;
    letter-spacing: normal;
    padding: 0 0 8px 0;
    margin: 0 0 12px 0;
    font-weight: 600;
    font-size: 1em;
    color: #444;
    border-bottom: 1px solid #dee2e6;
}

.team-detail .metric-row {
    flex-direction: column;
    gap: 2px;
    align-items: stretch;
}

.team-detail .metric-label {
    flex: none;
    font-size: 0.78em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.team-detail .metric-value {
    flex: none;
    text-align: left;
    font-size: 0.95em;
}

.team-detail .contextual-messages h3 {
    text-transform: none;
    letter-spacing: normal;
    border-bottom: 1px solid #e9ecef;
    padding: 0 0 8px 0;
    margin: 0 0 12px 0;
    font-size: 1em;
    font-weight: 600;
    color: #555;
}

/* Upcoming Games Table Enhancements */
.upcoming-games-table .location-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.upcoming-games-table .location-badge.home {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.upcoming-games-table .location-badge.away {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.upcoming-games-table .difficulty-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.upcoming-games-table .difficulty-badge.difficulty-easy {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.upcoming-games-table .difficulty-badge.difficulty-medium {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.upcoming-games-table .difficulty-badge.difficulty-hard {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.upcoming-games-table .opponent-strength {
    text-align: center;
}

.upcoming-games-table .expected-points {
    text-align: center;
    font-size: 1.05em;
}

.upcoming-games-table .summary-row {
    background: #f8f9fa;
    border-top: 2px solid #495057;
    font-weight: bold;
}

.upcoming-games-table .summary-row td {
    padding: 12px 8px;
}

/* Responsive design */
@media (max-width: 1200px) {
    .standings-table {
        font-size: 12px;
    }

    .standings-table th,
    .standings-table td {
        padding: 8px 4px;
    }

    .sparkline-container {
        width: 120px;
        height: 35px;
    }

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

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 1.4em;
    }

    .subtitle {
        font-size: 0.85em;
    }

    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header-title {
        width: 100%;
    }

    /* Mobile Navigation */
    .main-nav {
        width: 100%;
        flex-wrap: wrap;
        gap: 8px;
        justify-content: flex-start;
    }

    .main-nav a {
        padding: 8px 12px;
        font-size: 13px;
        background: #f8f9fa;
        border: 1px solid #dee2e6;
    }

    header {
        padding: 15px;
        margin-bottom: 15px;
    }

    .conference-section h2 {
        padding: 12px 15px;
        font-size: 1.2em;
    }

    /* Hide less critical columns on mobile */
    .standings-table th:nth-child(3),  /* W */
    .standings-table td:nth-child(3),
    .standings-table th:nth-child(4),  /* L */
    .standings-table td:nth-child(4),
    .standings-table th:nth-child(5),  /* OTL */
    .standings-table td:nth-child(5),
    .standings-table th:nth-child(7),  /* GF */
    .standings-table td:nth-child(7),
    .standings-table th:nth-child(8),  /* GA */
    .standings-table td:nth-child(8),
    .standings-table th:nth-child(9),  /* DIFF */
    .standings-table td:nth-child(9),
    .standings-table th:nth-child(11), /* PTS OUT */
    .standings-table td:nth-child(11),
    .standings-table th:nth-child(14), /* Div % */
    .standings-table td:nth-child(14),
    .standings-table th:nth-child(15), /* Conf % */
    .standings-table td:nth-child(15),
    .standings-table th:nth-child(16), /* Cup % */
    .standings-table td:nth-child(16),
    .standings-table th:nth-child(18), /* Next */
    .standings-table td:nth-child(18) {
        display: none;
    }

    .standings-table {
        font-size: 11px;
    }

    .standings-table th,
    .standings-table td {
        padding: 8px 4px;
    }

    .team-name {
        min-width: 120px;
        gap: 6px;
    }

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

    .division-tag {
        display: none; /* Hide division tags on mobile to save space */
    }

    .position-badge {
        font-size: 9px;
        padding: 2px 4px;
    }

    .controls {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .sparkline-cell {
        display: none; /* Hide sparklines on mobile */
    }

    .game-streak {
        gap: 1px;
    }

    .game-result {
        width: 6px;
        height: 18px;
    }

    /* Big Games section on mobile */
    .conference-section > div {
        padding: 15px;
    }

    .conference-section h3 {
        font-size: 0.95em;
        margin: 16px 0 6px 0;
        padding: 8px 0 4px 0;
    }

    /* Make breakdown cards stack nicely */
    .breakdown-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .breakdown-card {
        padding: 15px;
    }

    .breakdown-card h3 {
        font-size: 1em;
    }

    .metric-row {
        flex-direction: column;
        gap: 4px;
    }

    .metric-label {
        flex: 1 1 auto;
    }

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

/* Small mobile devices */
@media (max-width: 480px) {
    .container {
        padding: 5px;
    }

    h1 {
        font-size: 1.2em;
    }

    header {
        padding: 10px;
        border-radius: 4px;
    }

    .main-nav a {
        padding: 6px 10px;
        font-size: 12px;
    }

    .conference-section {
        border-radius: 4px;
        margin-bottom: 15px;
    }

    .conference-section h2 {
        font-size: 1.1em;
        padding: 10px 12px;
    }

    /* Additional columns to hide on very small screens */
    .standings-table th:nth-child(2),  /* GP */
    .standings-table td:nth-child(2),
    .standings-table th:nth-child(10), /* POS */
    .standings-table td:nth-child(10),
    .standings-table th:nth-child(17), /* Win% Req */
    .standings-table td:nth-child(17) {
        display: none;
    }

    .standings-table {
        font-size: 10px;
    }

    .standings-table th,
    .standings-table td {
        padding: 6px 3px;
    }

    .team-name {
        min-width: 100px;
        gap: 4px;
        flex-wrap: wrap;
    }

    .team-name a {
        font-size: 11px;
    }

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

    .prob-cell {
        font-size: 10px;
        padding: 6px 2px !important;
    }

    /* Horizontal scroll wrapper for tables */
    .standings-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Make last 10 games more compact */
    .game-result {
        width: 5px;
        height: 16px;
    }

    footer {
        padding: 20px 10px;
        font-size: 0.8em;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    h1 {
        font-size: 1.3em;
    }

    .header-top {
        flex-direction: row;
        align-items: center;
    }

    .main-nav {
        width: auto;
    }
}

/* ========================================
   Big Games - Expandable Impact View
   ======================================== */

.big-game-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 16px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.big-game-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.game-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.game-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.game-time {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
    min-width: 100px;
}

.game-matchup {
    font-size: 1rem;
    font-weight: 500;
}

.game-matchup a {
    color: #007bff;
    text-decoration: none;
}

.game-matchup a:hover {
    text-decoration: underline;
}

.game-swing {
    font-size: 0.85rem;
    color: #666;
    padding: 4px 8px;
    background: #e9ecef;
    border-radius: 4px;
}

.game-summary {
    padding: 12px 18px;
    font-size: 0.9rem;
    color: #666;
}

.expand-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
    white-space: nowrap;
}

.expand-btn:hover {
    background: #0056b3;
}

.expand-btn:active {
    transform: scale(0.98);
}

/* Affected Teams Section */
.affected-teams-section {
    padding: 20px 18px;
    background: #fafafa;
    border-top: 1px solid #e0e0e0;
}

.impact-explanation {
    margin-bottom: 16px;
    color: #555;
    font-size: 0.95rem;
}

.impact-grid {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    background: white;
}

.impact-grid-header {
    display: grid;
    grid-template-columns: 120px 90px 1fr 1fr;
    gap: 12px;
    padding: 12px 16px;
    background: #f0f0f0;
    font-weight: 600;
    font-size: 0.85rem;
    color: #444;
    border-bottom: 2px solid #d0d0d0;
}

.impact-grid-header > div {
    display: flex;
    align-items: center;
}

.affected-team-row {
    display: grid;
    grid-template-columns: 120px 90px 1fr 1fr;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    align-items: center;
    transition: background 0.15s;
}

.affected-team-row:hover {
    background: #f9f9f9;
}

.affected-team-row:last-child {
    border-bottom: none;
}

.team-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-cell a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.team-cell a:hover {
    color: #007bff;
}

.mini-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.current-cell {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

.outcome-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.delta-value {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 50px;
    text-align: right;
}

.delta-value.positive {
    color: #28a745;
}

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

.bar-container {
    flex: 1;
    height: 22px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.impact-bar {
    height: 100%;
    transition: width 0.4s ease-out;
    border-radius: 4px;
}

.impact-bar.bar-positive {
    background: linear-gradient(90deg, #d4edda 0%, #28a745 100%);
}

.impact-bar.bar-negative {
    background: linear-gradient(90deg, #f8d7da 0%, #dc3545 100%);
}

.methodology-note {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    color: #777;
    font-size: 0.85rem;
}

.methodology-note a {
    color: #007bff;
    text-decoration: none;
}

.methodology-note a:hover {
    text-decoration: underline;
}

/* Mobile Responsive - Big Games */
@media (max-width: 768px) {
    .game-header-row {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }

    .game-info {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }

    .game-time {
        min-width: auto;
        font-size: 0.85rem;
    }

    .game-matchup {
        font-size: 0.95rem;
    }

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

    .expand-btn {
        width: 100%;
        font-size: 0.85rem;
        padding: 10px;
    }

    .impact-grid-header {
        grid-template-columns: 80px 70px 1fr 1fr;
        gap: 8px;
        padding: 10px 12px;
        font-size: 0.75rem;
    }

    .affected-team-row {
        grid-template-columns: 80px 70px 1fr 1fr;
        gap: 8px;
        padding: 8px 12px;
    }

    .team-cell {
        gap: 4px;
    }

    .team-cell a {
        font-size: 0.85rem;
    }

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

    .current-cell {
        font-size: 0.8rem;
    }

    .delta-value {
        font-size: 0.8rem;
        min-width: 40px;
    }

    .bar-container {
        height: 18px;
    }

    .impact-explanation {
        font-size: 0.85rem;
    }

    .methodology-note {
        font-size: 0.75rem;
    }

    .affected-teams-section {
        padding: 16px 12px;
    }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .impact-grid-header {
        grid-template-columns: 100px 80px 1fr 1fr;
        gap: 10px;
    }

    .affected-team-row {
        grid-template-columns: 100px 80px 1fr 1fr;
        gap: 10px;
    }
}

/* ========================================
   Big Games - Compact Always-Visible Layout
   ======================================== */

.big-game-compact {
    background: white;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    margin-bottom: 20px;
    overflow: hidden;
}

.game-header-compact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: linear-gradient(to bottom, #f8f9fa 0%, #f0f1f2 100%);
    border-bottom: 1px solid #d0d0d0;
    font-size: 0.9rem;
}

.game-time-compact {
    font-weight: 600;
    color: #555;
    min-width: 90px;
    font-size: 0.85rem;
}

.game-teams-compact {
    font-weight: 600;
    font-size: 1rem;
    flex: 1;
}

.game-teams-compact a {
    color: #0066cc;
    text-decoration: none;
}

.game-teams-compact a:hover {
    text-decoration: underline;
}

.vs-text {
    color: #999;
    font-weight: normal;
    padding: 0 6px;
}

.game-swing-compact {
    font-size: 0.85rem;
    color: #666;
    background: rgba(0, 0, 0, 0.04);
    padding: 4px 10px;
    border-radius: 4px;
    font-weight: 500;
}

/* Result Header Styles — same grey as upcoming games */
.result-header {
    background: linear-gradient(to bottom, #f8f9fa 0%, #f0f1f2 100%);
}

.game-result-compact {
    font-weight: 600;
    font-size: 1rem;
    flex: 1;
}

.game-result-compact a {
    text-decoration: none;
    transition: color 0.2s;
}

.game-result-compact a.winner {
    color: #0066cc;
    font-weight: 700;
}

.game-result-compact a.loser {
    color: #999;
    font-weight: 400;
}

.game-result-compact a:hover {
    text-decoration: underline;
}

.game-result-compact .score {
    padding: 0 4px;
    font-weight: 600;
}

.game-result-compact .score.winner {
    color: #333;
}

.game-result-compact .score.loser {
    color: #999;
}

.game-result-compact .score-separator {
    color: #ccc;
    padding: 0 6px;
}

.game-result-compact .ot-indicator {
    color: #999;
    font-size: 0.85rem;
    font-weight: normal;
    margin-left: 4px;
}

/* Today's Impact - Conditional Outcomes */
.today-impact-conditional {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.conditional-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.conditional-label {
    color: #888;
    font-size: 0.85em;
    min-width: 55px;
    text-align: right;
}

.live-indicator {
    display: inline-block;
    background: #dc3545;
    color: white;
    font-size: 0.7em;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
}

/* Compact Impact Table */
.impact-table-wrapper {
    padding: 0;
}

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

.impact-table thead {
    background: #fafafa;
    border-bottom: 2px solid #e0e0e0;
}

.impact-table th {
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: #555;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.th-team {
    width: 90px;
    white-space: nowrap;
}

.th-current {
    width: 70px;
    text-align: center;
}

.th-outcome {
    text-align: left;
}

.th-outcome-group {
    text-align: center;
    border-left: 1px solid #e0e0e0;
    padding: 8px 6px;
}

.subheader th {
    padding: 4px 6px;
    font-size: 0.7rem;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.th-sub {
    color: #777;
    font-weight: 500;
}

.impact-table tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.1s;
}

.impact-table tbody tr:hover {
    background: #f9fafb;
}

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

.td-team {
    padding: 6px 12px;
    font-weight: 500;
    white-space: nowrap;
}

.td-team a {
    color: #333;
    text-decoration: none;
}

.td-team a:hover {
    color: #0066cc;
}

.team-logo-tiny {
    width: 18px;
    height: 18px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 6px;
}

.td-current {
    padding: 6px 12px;
    text-align: center;
    color: #666;
    font-weight: 500;
}

.td-outcome {
    padding: 6px 12px;
}

.td-outcome-sub {
    padding: 6px 8px;
    border-left: 1px solid #f5f5f5;
}

.outcome-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.outcome-content-sub {
    display: flex;
    align-items: center;
    gap: 6px;
}

.delta-compact {
    font-weight: 600;
    min-width: 42px;
    text-align: right;
    font-size: 0.85rem;
}

.delta-compact.positive {
    color: #28a745;
}

.delta-compact.negative {
    color: #dc3545;
}

.bar-inline {
    height: 16px;
    border-radius: 3px;
    transition: width 0.3s;
}

.bar-inline.bar-positive {
    background: linear-gradient(90deg, rgba(40, 167, 69, 0.15) 0%, rgba(40, 167, 69, 0.5) 100%);
    border-left: 2px solid #28a745;
}

.bar-inline.bar-negative {
    background: linear-gradient(90deg, rgba(220, 53, 69, 0.15) 0%, rgba(220, 53, 69, 0.5) 100%);
    border-left: 2px solid #dc3545;
}

/* Mobile Responsive - Compact Layout */
@media (max-width: 768px) {
    .game-header-compact {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 0.8rem;
    }

    .game-time-compact {
        min-width: auto;
        font-size: 0.75rem;
    }

    .game-teams-compact {
        font-size: 0.9rem;
        flex-basis: 100%;
        order: -1;
    }

    .game-swing-compact {
        font-size: 0.75rem;
        padding: 3px 8px;
    }

    .impact-table {
        font-size: 0.75rem;
    }

    .impact-table th {
        padding: 6px 8px;
        font-size: 0.7rem;
    }

    .th-team {
        width: 60px;
    }

    .th-current {
        width: 50px;
    }

    .th-outcome-group {
        padding: 6px 3px;
        font-size: 0.65rem;
    }

    .subheader th {
        padding: 3px 2px;
        font-size: 0.6rem;
    }

    .td-team, .td-current, .td-outcome, .td-outcome-sub {
        padding: 5px 4px;
    }

    .team-logo-tiny {
        width: 14px;
        height: 14px;
        margin-right: 4px;
    }

    .delta-compact {
        min-width: 30px;
        font-size: 0.7rem;
    }

    .bar-inline {
        height: 10px;
        max-width: 30px;
    }

    .outcome-content {
        gap: 3px;
    }

    .outcome-content-sub {
        gap: 3px;
    }
}

/* Tablet Responsive - Compact Layout */
@media (min-width: 769px) and (max-width: 1024px) {
    .impact-table {
        font-size: 0.8rem;
    }

    .th-team {
        width: 75px;
    }

    .th-current {
        width: 65px;
    }
}

/* ========================================
   Points Distribution Histogram
   ======================================== */

.points-histogram-container {
    margin-bottom: 20px;
}

.points-histogram {
    display: flex;
    align-items: flex-end;
    height: 120px;
    gap: 1px;
    position: relative;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 8px 4px 0 4px;
    border: 1px solid #e9ecef;
}

.histogram-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    position: relative;
    cursor: help;
    min-width: 0;
}

.histogram-bar-group:hover {
    opacity: 0.8;
}

.histogram-bar-group:hover .histogram-bar {
    outline: 1px solid rgba(0, 0, 0, 0.3);
}

.histogram-bar {
    width: 100%;
    min-height: 0;
    border-radius: 1px 1px 0 0;
    position: absolute;
    bottom: 0;
}

.histogram-bar.team-bar {
    background: rgba(0, 102, 204, 0.6);
    z-index: 2;
}

.histogram-bar.cutline-bar {
    background: rgba(220, 53, 69, 0.35);
    z-index: 1;
}

.cutline-overlay {
    position: absolute;
    bottom: 0;
    height: 100%;
    background: rgba(220, 53, 69, 0.08);
    border-left: 2px dashed rgba(220, 53, 69, 0.5);
    border-right: 2px dashed rgba(220, 53, 69, 0.5);
    z-index: 0;
    pointer-events: none;
}

.histogram-x-axis {
    display: flex;
    justify-content: space-between;
    padding: 4px 4px 0 4px;
    font-size: 0.8em;
    color: #999;
}

.histogram-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 8px;
    font-size: 0.85em;
    color: #666;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 2px;
}

.legend-swatch.team-swatch {
    background: rgba(0, 102, 204, 0.6);
}

.legend-swatch.cutline-swatch {
    background: rgba(220, 53, 69, 0.35);
    border-left: 2px dashed rgba(220, 53, 69, 0.5);
}

/* Mobile responsive - histogram */
@media (max-width: 768px) {
    .points-histogram {
        height: 80px;
    }

    .histogram-legend {
        flex-direction: column;
        gap: 4px;
        align-items: center;
    }
}

/* ========================================
   LLM Explanation Card
   ======================================== */

.llm-explanation {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-left: 4px solid #0066cc;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 30px;
}

.llm-explanation h2 {
    font-size: 1.2em;
    margin-bottom: 16px;
    color: #333;
}

.llm-section-header {
    font-size: 1em;
    font-weight: 600;
    color: #333;
    margin: 20px 0 8px 0;
    padding-bottom: 6px;
    border-bottom: 1px solid #dee2e6;
}

.llm-section-header:first-child {
    margin-top: 0;
}

.llm-explanation-content p {
    line-height: 1.7;
    color: #444;
    margin-bottom: 12px;
}

.llm-explanation-content p:last-child {
    margin-bottom: 0;
}

.llm-explanation-meta {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #dee2e6;
    color: #999;
    font-size: 0.8em;
    font-style: italic;
}

@media (max-width: 768px) {
    .llm-explanation {
        padding: 16px;
    }

    .llm-explanation-content p {
        font-size: 0.95em;
        line-height: 1.6;
    }
}
