:root {
    --bg-color: #fcfdfe;
    --text-color: #1a1c1e;
    --card-bg: #ffffff;
    --primary-color: #1a73e8;
    --header-text: #1a1c1e;
    --secondary-text: #5f6368;
    --accent-color: #1967d2;
    --border-color: #e0e4e8;
    --shadow-subtle: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-strong: 0 12px 24px rgba(0, 0, 0, 0.12);
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    font-family: var(--font-family);
    margin: 0;
    padding: 20px;
    background-color: var(--bg-color);
    color: var(--text-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

/* Global Card Styling */
.glass-card {
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-medium);
    padding: 30px;
    margin-bottom: 30px;
}

/* Navigation */
nav {
    margin-bottom: 40px;
    text-align: center;
    padding: 15px 0;
    display: flex;
    justify-content: center;
    gap: 10px;
}

nav a {
    text-decoration: none;
    color: var(--secondary-text);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 20px;
    border-radius: 12px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

nav a:hover,
nav a.active-link {
    background-color: #e8f0fe;
    color: var(--accent-color);
}

h1,
h2,
h3 {
    color: var(--header-text);
    letter-spacing: -0.5px;
}

h1 {
    font-size: 3rem;
    font-weight: 900;
    text-align: center;
    margin-bottom: 40px;
}

h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 24px;
}

/* Modern Scoreboard Design */
.scoreboard {
    display: grid;
    grid-template-columns: 1fr 180px 1fr;
    align-items: center;
    background: var(--card-bg);
    padding: 40px;
    border-radius: 32px;
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-strong);
    position: relative;
    overflow: hidden;
}

.scoreboard::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--away-color, #ccc), var(--home-color, #ccc));
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.team.away-team {
    align-items: flex-start;
    text-align: left;
}

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

.team-badge {
    width: 80px;
    height: 80px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 900;
    font-size: 2rem;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.team-name {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.team-score {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -2px;
}

.game-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    height: 100%;
}

.game-status {
    background: #f1f3f4;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.game-status.live {
    background: #fce8e6;
    color: #d93025;
}

.winner-indicator {
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 10px;
    text-align: center;
    padding: 8px 16px;
    border-radius: 12px;
}

/* Prediction Cards */
.prediction-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px;
    flex: 1;
    min-width: 180px;
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.prediction-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
}

.prediction-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--secondary-text);
    text-transform: uppercase;
    margin-bottom: 12px;
    display: block;
}

.prediction-value {
    font-size: 2rem;
    font-weight: 900;
    display: block;
    margin-bottom: 12px;
}

.prediction-progress-bg {
    height: 6px;
    background: #f1f3f4;
    border-radius: 3px;
    width: 100%;
    margin-top: 10px;
}

.prediction-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Graph & Chart Containers */
.graph-container {
    background: var(--card-bg);
    border-radius: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-medium);
    padding: 30px;
    margin-bottom: 40px;
    height: 500px;
    position: relative;
}

/* Evaluation Heatmap Styles */
.evaluation-table-container {
    background: var(--card-bg);
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-medium);
    overflow: hidden;
    margin-bottom: 40px;
}

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

th {
    background: #f8f9fa;
    color: var(--secondary-text);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 16px;
    text-align: left;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.heatmap-cell {
    font-weight: 700;
    transition: background 0.3s ease;
}

/* Dashboard & Live Indicator refinements */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fce8e6;
    color: #d93025;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.live-indicator::before {
    content: "";
    width: 8px;
    height: 8px;
    background: #d93025;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(217, 48, 37, 0.4);
}

.live-indicator.blinking::before {
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(217, 48, 37, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(217, 48, 37, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(217, 48, 37, 0);
    }
}

.chart-legend ul {
    list-style: none;
    text-align: center;
    padding: 0;
}

.chart-legend li {
    display: inline-block;
    margin: 0 10px;
    font-size: 0.9em;
}

.legend-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 5px;
}
/* Prose / Markdown content */
.prose {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.75;
    color: var(--text-color);
}
.prose h1, .prose h2, .prose h3, .prose h4 {
    margin-top: 2em;
    margin-bottom: 0.5em;
    font-weight: 700;
    color: var(--text-color);
}
.prose h1 { font-size: 2rem; }
.prose h2 { font-size: 1.5rem; }
.prose h3 { font-size: 1.2rem; }
.prose p { margin-bottom: 1.2em; }
.prose ul, .prose ol { padding-left: 1.5em; margin-bottom: 1.2em; }
.prose li { margin-bottom: 0.4em; }
.prose pre { background: #f6f8fa; border-radius: 8px; padding: 16px; overflow-x: auto; margin-bottom: 1.2em; }
.prose code { font-family: monospace; font-size: 0.9em; background: #f6f8fa; padding: 2px 5px; border-radius: 4px; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { border-left: 4px solid var(--border-color); margin: 0; padding-left: 1em; color: var(--secondary-text); }
.prose a { color: #1a73e8; text-decoration: none; }
.prose a:hover { text-decoration: underline; }
.prose section { margin-bottom: 2em; }

/* Footnotes */
a.footref, a.footnote-ref {
    font-size: 0.75em;
    vertical-align: super;
    text-decoration: none;
    color: #1a73e8;
    margin-left: 1px;
}
.footnotes, #footnotes {
    margin-top: 3em;
    padding-top: 1em;
    border-top: 1px solid var(--border-color);
    font-size: 0.9em;
    color: var(--secondary-text);
}
.fn-label { font-weight: 700; margin-right: 4px; }

/* Scoregami heatmap */
.sg-grid {
    display: grid;
    grid-template-columns: repeat(62, minmax(0, 1fr));
    gap: 1px;
    font-size: 0;
    overflow-x: auto;
}
.sg-header {
    font-size: 8px;
    text-align: center;
    color: var(--secondary-text);
    line-height: 14px;
}
.sg-cell {
    width: 100%;
    aspect-ratio: 1;
    background: #e9ecef;
    position: relative;
    cursor: default;
}
.sg-cell:hover .sg-tooltip { display: block; }
.sg-tooltip {
    display: none;
    position: absolute;
    z-index: 10;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.85);
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
}

/* ============================================================
   Game cards (dashboard + historical browser)
   ============================================================ */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.game-card {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-subtle);
    padding: 24px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.2s ease;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-medium);
    border-color: #d2dae4;
}

/* Header: opponents on the left, week/date (or live status) on the top right */
.game-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.game-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--header-text);
    letter-spacing: -0.3px;
    line-height: 1.3;
    margin: 0;
}

.game-date-box,
.status-box {
    flex-shrink: 0;
    text-align: right;
}

.week-text {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--secondary-text);
    margin-top: 2px;
}

.time-text {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--secondary-text);
    background: #f1f3f4;
    padding: 4px 12px;
    border-radius: 20px;
}

/* Final score, pinned to the bottom of the card */
.game-score-row {
    margin-top: auto;
    display: flex;
    justify-content: center;
}

.game-score-box {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -1px;
    color: var(--text-color);
}

/* Live-dashboard win-probability footer */
.game-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-text);
}

/* ============ Historical browser controls ============ */
.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.btn-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 18px;
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-filter-toggle:hover {
    background: #f1f3f4;
}

.btn-filter-toggle svg {
    color: var(--secondary-text);
}

.filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

.filter-bar {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 20;
    display: flex;
    gap: 16px;
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-medium);
    padding: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--secondary-text);
}

.filter-group select {
    font-family: var(--font-family);
    font-size: 0.9rem;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #fff;
    color: var(--text-color);
    cursor: pointer;
}

.active-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e8f0fe;
    color: var(--accent-color);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
}

.chip-remove {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 700;
    line-height: 1;
    opacity: 0.7;
}

.chip-remove:hover {
    opacity: 1;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--secondary-text);
}

.load-more-container {
    justify-content: center;
    margin-top: 32px;
}

.btn-load-more {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 28px;
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-load-more:hover {
    background: var(--accent-color);
}

/* WP variance plots */
.vp-row {
    margin-bottom: 1.5rem;
}
.vp-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-color);
}
.vp-track {
    position: relative;
    height: 60px;
    background: #f6f8fa;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    overflow: visible;
}
.vp-tick {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border-color);
    opacity: 0.5;
}
.vp-dot {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #3b82f6;
    opacity: 0.5;
    transform: translateX(-50%);
}
.vp-median-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #ef4444;
    transform: translateX(-50%);
}
.vp-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--secondary-text);
    margin-top: 2px;
}
