:root {
    --bg: #f3f4f6;
    --panel: #ffffff;
    --panel-dark: #f8fafc;
    --border: #d1d5db;
    --text: #111827;
    --muted: #64748b;
    --blue: #0f4c81;
    --navy: #07111f;
}

body {
    margin: 0;
    font-family: Inter, Segoe UI, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
}

header {
    background: #ffffff;
    color: #111827;
    padding: 14px 22px;
    border-bottom: 1px solid #d1d5db;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
}

header h1 {
    margin: 0;
    font-size: 24px;
}

header p {
    margin: 2px 0 0;
    color: #64748b;
    font-size: 13px;
}

nav {
    display: flex;
    gap: 8px;
}

nav a {
    color: #0f172a;
    text-decoration: none;
    background: #f8fafc;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 7px 12px;
    font-weight: 700;
    font-size: 13px;
}

main {
    padding: 18px;
}

.card,
.scoreboard-shell {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 18px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}

.nested {
    background: #ffffff;
}

.muted {
    color: var(--muted);
}

.warning {
    background: #fff7ed;
    border: 1px solid #fb923c;
    color: #7c2d12;
    border-radius: 10px;
    padding: 12px;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: end;
    margin-bottom: 12px;
}

.section-title-row h2 {
    margin: 0;
}

.scoreboard-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 16px;
}

.score-card {
    min-width: 158px;
    background: #ffffff;
    color: #111827;
    text-decoration: none;
    border: 1px solid #d1d5db;
    border-radius: 9px;
    padding: 8px 9px;
    box-shadow: 0 2px 6px rgba(15, 23, 42, .06);
}

.score-card:hover {
    border-color: #2563eb;
}

.game-time {
    font-size: 12px;
    font-weight: 800;
    color: #334155;
    margin-bottom: 6px;
}

.team-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 5px 0;
}

.team-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.record {
    color: #64748b;
    font-size: 12px;
}

.game-footer {
    margin-top: 7px;
    color: #64748b;
    font-size: 11px;
    border-top: 1px solid #e5e7eb;
    padding-top: 5px;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
    gap: 14px;
}

.game-card {
    display: block;
    background: #ffffff;
    color: #111827;
    text-decoration: none;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    overflow: hidden;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.game-card:hover {
    transform: translateY(-2px);
    border-color: #2563eb;
    box-shadow: 0 12px 24px rgba(15, 23, 42, .12);
}

.brand-bar {
    height: 6px;
}

.game-card-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px 0;
    font-size: 12px;
}

.status {
    color: #0f4c81;
    font-weight: 800;
}

.venue {
    color: #64748b;
    text-align: right;
}

.matchup-teams {
    display: grid;
    grid-template-columns: 1fr 34px 1fr;
    gap: 8px;
    align-items: center;
    padding: 14px;
}

.team-block {
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-block.right {
    justify-content: flex-end;
    text-align: right;
}

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

.team-block h3 {
    margin: 0;
    font-size: 24px;
}

.team-block p {
    margin: 2px 0;
    font-weight: 700;
}

.team-block span {
    color: #64748b;
    font-size: 12px;
}

.at-symbol {
    text-align: center;
    color: #64748b;
    font-weight: 900;
    font-size: 20px;
}

.pitcher-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid #e5e7eb;
    background: #f8fafc;
}

.pitcher-preview div {
    padding: 10px 14px;
    border-right: 1px solid #e5e7eb;
}

.pitcher-preview div:last-child {
    border-right: none;
}

.pitcher-preview span {
    display: block;
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 800;
}

.pitcher-preview strong {
    display: block;
    margin-top: 3px;
}

.hero-matchup {
    background:
        linear-gradient(120deg, var(--away-color), rgba(15, 23, 42, .96) 42%, rgba(15, 23, 42, .96) 58%, var(--home-color));
    color: white;
    border-radius: 16px;
    padding: 24px;
    display: grid;
    grid-template-columns: 1fr 180px 1fr;
    align-items: center;
    gap: 18px;
}

.hero-team {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hero-team.right {
    justify-content: flex-end;
    text-align: right;
}

.hero-team img {
    width: 88px;
    height: 88px;
    object-fit: contain;
    filter: drop-shadow(0 8px 12px rgba(0,0,0,.35));
}

.hero-team span {
    color: rgba(255,255,255,.8);
    font-size: 13px;
    font-weight: 700;
}

.hero-team h2 {
    margin: 0;
    font-size: 44px;
}

.hero-team p {
    margin: 0;
    font-weight: 800;
}

.hero-center {
    text-align: center;
}

.game-state {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #dbeafe;
    font-weight: 900;
}

.versus {
    font-size: 36px;
    font-weight: 900;
    margin: 8px 0;
}

.venue-line {
    color: #cbd5e1;
    font-size: 13px;
}

.advantage-ribbon {
    margin: 14px 0;
    background: #0f172a;
    color: white;
    border-left: 5px solid #60a5fa;
    border-radius: 12px;
    padding: 12px 16px;
}

.advantage-ribbon span {
    display: block;
    color: #93c5fd;
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 900;
}

.advantage-ribbon strong {
    font-size: 22px;
    display: block;
}

.advantage-ribbon em {
    display: block;
    color: #cbd5e1;
    font-style: normal;
    margin-top: 3px;
}

.two-column {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.pitcher-card {
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 16px;
}

.pitcher-card.branded {
    border-top: 6px solid #2563eb;
}

.pitcher-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.pitcher-heading img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.player-heading {
    align-items: center;
}

.player-headshot {
    width: 86px !important;
    height: 86px !important;
    border-radius: 999px;
    object-fit: cover;
    background: #e5e7eb;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .18);
}

.pitcher-heading h3 {
    margin: 0;
}

.pitcher-name {
    font-size: 1.25rem;
    font-weight: 900;
    margin: 3px 0 0;
}

.data-quality {
    display: inline-block;
    color: #64748b;
    font-size: 11px;
    margin-top: 4px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.metric-grid.main-metrics {
    grid-template-columns: repeat(3, 1fr);
}

.metric-grid div {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 11px;
}

.metric-grid span,
.mini-stat-row span {
    display: block;
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 900;
}

.metric-grid strong {
    display: block;
    margin-top: 4px;
    font-size: 20px;
}

.savant-card {
    padding: 0;
    overflow: hidden;
}

.savant-card .pitcher-heading,
.savant-card .metric-grid,
.savant-card .savant-section {
    padding-left: 16px;
    padding-right: 16px;
}

.savant-card .pitcher-heading {
    padding-top: 16px;
}

.savant-section {
    margin-top: 14px;
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
    padding-bottom: 4px;
}

.savant-section h4 {
    margin: 0 0 8px;
    background: #e8f3f6;
    padding: 7px 9px;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
}

.mini-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
    gap: 6px;
}

.mini-stat-row div {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
}

.mini-stat-row strong {
    display: block;
    margin-top: 3px;
    font-size: 16px;
}

.arsenal-list {
    display: grid;
    gap: 8px;
    padding-bottom: 8px;
}

.arsenal-row {
    display: grid;
    grid-template-columns: 78px minmax(90px, 1fr) 170px;
    gap: 8px;
    align-items: center;
    font-size: 13px;
}

.arsenal-name {
    font-weight: 900;
}

.arsenal-bar {
    height: 9px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}

.arsenal-bar span {
    display: block;
    height: 100%;
    border-radius: 999px;
}

.arsenal-meta {
    color: #475569;
    font-size: 12px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 10px;
    overflow: hidden;
}

th, td {
    border-bottom: 1px solid #e5e7eb;
    padding: 9px 10px;
    text-align: left;
}

th {
    background: #f8fafc;
    color: #334155;
    text-transform: uppercase;
    font-size: .78rem;
    letter-spacing: .04em;
}

/* Baseball Savant-style heat coloring */
.heat {
    position: relative;
    overflow: hidden;
}

.heat::after {
    content: attr(data-percentile);
    position: absolute;
    top: 6px;
    right: 7px;
    font-size: 10px;
    font-weight: 900;
    opacity: .55;
}

.heat-elite {
    background: #e85d75 !important;
    border-color: #d63354 !important;
    color: #0f172a;
}

.heat-great {
    background: #f2a0aa !important;
    border-color: #ea7180 !important;
    color: #0f172a;
}

.heat-good {
    background: #f8d7dc !important;
    border-color: #efb6bf !important;
    color: #0f172a;
}

.heat-neutral {
    background: #f8fafc !important;
    border-color: #e5e7eb !important;
    color: #0f172a;
}

.heat-cold {
    background: #dbeafe !important;
    border-color: #bfdbfe !important;
    color: #0f172a;
}

.heat-poor {
    background: #b6c9ea !important;
    border-color: #93b4e4 !important;
    color: #0f172a;
}

.savant-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    font-size: 12px;
    color: #64748b;
    margin: 6px 0 10px;
}

.legend-chip {
    width: 28px;
    height: 12px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, .12);
}

.legend-poor { background: #b6c9ea; }
.legend-neutral { background: #f8fafc; }
.legend-elite { background: #e85d75; }

.mini-stat-row div.heat strong {
    font-size: 17px;
}

.metric-grid div.heat strong {
    font-size: 21px;
}

@media (max-width: 900px) {
    .two-column {
        grid-template-columns: 1fr;
    }

    .hero-matchup {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-team,
    .hero-team.right {
        justify-content: center;
        text-align: center;
    }

    .metric-grid.main-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .arsenal-row {
        grid-template-columns: 1fr;
    }
}
footer {
    margin: 24px 18px 18px;
    padding: 16px 18px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    color: #334155;
    font-size: 13px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
}

footer strong {
    color: #0f172a;
    margin-right: 6px;
}

footer span {
    display: block;
    margin-top: 4px;
    color: #64748b;
}


/* ===== League benchmark heat scale ===== */

.heat-super-elite {
    background: #e85d75 !important;
    border-color: #cf2f4b !important;
    color: #0f172a;
}

.heat-elite {
    background: #ef8797 !important;
    border-color: #e85d75 !important;
    color: #0f172a;
}

.heat-great {
    background: #f5b9c2 !important;
    border-color: #ee94a3 !important;
    color: #0f172a;
}

.heat-good {
    background: #f8d7dc !important;
    border-color: #efb6bf !important;
    color: #0f172a;
}

.heat-neutral {
    background: #f8fafc !important;
    border-color: #e5e7eb !important;
    color: #0f172a;
}

.heat-cold {
    background: #dbeafe !important;
    border-color: #bfdbfe !important;
    color: #0f172a;
}

.heat-poor {
    background: #b6c9ea !important;
    border-color: #93b4e4 !important;
    color: #0f172a;
}

.heat-super-poor {
    background: #93b4e4 !important;
    border-color: #6f97d7 !important;
    color: #0f172a;
}

