/* GoPhils.net. 1970s Phillies: powder-blue road uniform, maroon piping,
   cream scorecard paper. Brand hexes are fixed; everything else derives. */
:root {
    --royal: #04529c;
    --red: #d41244;
    --maroon: #6f263d;
    --powder: #6bace4;
    --powder-pale: #d9e8f4;
    --paper: #f5f0e1;
    --paper-up: #fbf8ee;
    --paper-dim: #ece5d2;
    --ink: #0a2a4d;
    --ink-2: #43536b;
    --rule: #d6ceb9;
    --display: 'Big Shoulders Display', 'Oswald', 'Arial Narrow', sans-serif;
    --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --wrap: 1120px;
    --gutter: 20px;
    --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.5 var(--body); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul, ol, dl, dd, table, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; }
a { color: var(--royal); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--maroon); }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 1px; }
b, strong { font-weight: 700; }
.sr, caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 10; padding: 8px 12px; background: var(--paper-up); color: var(--ink); font-weight: 600; }
.skip:focus { top: 8px; }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; }
.muted { color: var(--ink-2); }
.fine { margin-top: 10px; font-size: 12.5px; color: var(--ink-2); }
.dot { color: var(--ink-2); opacity: .7; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ---------- header ---------- */
.site-head { background: var(--royal); color: var(--paper); border-bottom: 3px solid var(--maroon); }
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; min-height: 58px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--paper); text-decoration: none; padding: 8px 0; }
.brand:hover { color: var(--paper); }
.patch { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--powder); border: 2px solid var(--paper); box-shadow: 0 0 0 2px var(--maroon); }
.brand-name { font: 800 24px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; }
.brand-name i { font-style: normal; color: var(--red); }
.site-head .brand-name i { color: #ff5f86; }
.site-nav ul { display: flex; gap: 4px; }
.site-nav a { display: block; padding: 10px 12px; color: var(--paper); font-weight: 600; font-size: 14px; text-decoration: none; border-bottom: 3px solid transparent; }
.site-nav a:hover { border-bottom-color: color-mix(in oklch, var(--powder) 60%, transparent); }
.site-nav a[aria-current] { border-bottom-color: var(--powder); }

/* ---------- scoreboard band ---------- */
.band {
    padding: 28px 0 40px;
    background: var(--powder) repeating-linear-gradient(90deg, transparent 0 15px, rgb(245 240 225 / .32) 15px 16px);
    border-bottom: 3px solid var(--maroon);
}
h1 { font: 900 2.5rem/1 var(--display); letter-spacing: .01em; text-transform: uppercase; text-wrap: balance; }
.band-sub { margin-top: 8px; font-weight: 500; font-size: 1rem; max-width: 70ch; }
.band-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 24px; }
.band-cards > div { display: grid; }
.band-cards > div:empty { display: none; }

.card { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 14px; background: var(--paper-up); border: 2px solid var(--maroon); box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--maroon); border-radius: 2px; min-width: 0; }
.card-top { display: flex; justify-content: space-between; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--maroon); }
.status { font-size: 13px; font-weight: 500; }
.headline { font: 800 1.75rem/1.05 var(--display); letter-spacing: .01em; text-transform: uppercase; text-wrap: balance; }
.versus { display: flex; align-items: center; gap: 14px; }
.card-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 16px; flex-wrap: wrap; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--rule); font-size: 12.5px; color: var(--ink-2); }
.card-foot a { font-weight: 600; white-space: nowrap; }

.chip { display: inline-block; padding: 1px 7px; border: 1.5px solid currentColor; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; border-radius: 2px; vertical-align: 1px; }
.chip-w { background: var(--royal); border-color: var(--royal); color: var(--paper-up); }
.chip-l { color: var(--maroon); }
.live { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-decoration: none; border-radius: 2px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: blink 1.4s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }

.linescore { width: 100%; border-collapse: collapse; font-size: 14px; text-align: center; }
.linescore th, .linescore td { padding: 6px 3px; min-width: 22px; }
.linescore thead th { font-size: 11px; font-weight: 600; color: var(--ink-2); border-bottom: 2px solid var(--ink); }
.linescore tbody tr + tr > * { border-top: 1px solid var(--rule); }
.linescore tbody th { display: flex; align-items: center; gap: 8px; padding-right: 12px; font-weight: 700; white-space: nowrap; text-align: left; }
.linescore td { color: var(--ink-2); }
.linescore .us td { color: var(--ink); }
.linescore .tot { font-weight: 700; color: var(--ink); }
.linescore .tot.r { font: 800 20px/1 var(--display); }
.linescore thead .tot:first-of-type, .linescore td.tot.r { border-left: 2px solid var(--ink); }
.decisions, .hero-line { font-size: 13.5px; }
.decisions b { font-size: 11px; letter-spacing: .06em; color: var(--maroon); }
.hero-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.facts { display: grid; gap: 8px; font-size: 14px; }
.facts > div { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: baseline; }
.facts dt { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.prob { display: block; }
.prob b { display: inline-block; min-width: 2.6em; font-size: 12px; }
.ondeck { width: 100%; border-collapse: collapse; font-size: 14px; }
.ondeck th, .ondeck td { padding: 9px 0; border-top: 1px solid var(--rule); text-align: left; vertical-align: baseline; }
.ondeck th { font-weight: 600; padding-right: 12px; }
.ondeck .num { text-align: right; white-space: nowrap; color: var(--ink-2); }
.ondeck .num b { font: 800 20px/1 var(--display); color: var(--ink); }

/* ---------- page furniture ---------- */
.block { padding-block: 36px; }
.cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 56px; }
.cols > .block { min-width: 0; }
.h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding-bottom: 7px; border-bottom: 2px solid var(--ink); box-shadow: 0 3px 0 var(--paper), 0 5px 0 var(--powder); font: 800 1.5rem/1.1 var(--display); letter-spacing: .02em; text-transform: uppercase; }
.tint .h { box-shadow: 0 3px 0 var(--powder-pale), 0 5px 0 var(--powder); }
.h-gap { margin-top: 36px; }
.count { font: 600 12px/1 var(--body); letter-spacing: .06em; color: var(--ink-2); white-space: nowrap; }
.more { margin-top: 14px; font-weight: 600; font-size: 14px; }
.more a::after { content: ' \2192'; }
.tint { background: var(--powder-pale); border-block: 1px solid color-mix(in oklch, var(--powder) 55%, var(--paper)); }
.page-head { padding-block: 32px 4px; }
.page-head h1 { font-size: 2.25rem; }
.lede { margin-top: 10px; max-width: 72ch; font-size: 1.0313rem; }
.note { font-size: 14px; margin-top: 12px; max-width: 72ch; }
.lede .note { font-size: inherit; margin: 0; }
.about p { max-width: 68ch; line-height: 1.6; }
.about p + p { margin-top: 12px; }

.logo { display: inline-block; flex: none; vertical-align: middle; }
.logo-blank { border-radius: 50%; background: var(--paper-dim); }
.mug { flex: none; border-radius: 50%; object-fit: cover; object-position: 50% 12%; background: var(--paper-dim); aspect-ratio: 1; }
.plink { color: inherit; text-decoration-color: color-mix(in oklch, var(--ink) 30%, transparent); }
.plink:hover { color: var(--royal); text-decoration-color: currentColor; }

/* ---------- tables ---------- */
.data { width: 100%; border-collapse: collapse; font-size: 14px; }
.data th, .data td { padding: 8px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--rule); }
.data thead th { padding-block: 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); border-bottom: 2px solid var(--ink); vertical-align: bottom; }
.data th:first-child, .data td:first-child { text-align: left; padding-left: 4px; }
.data tbody th { font-weight: 600; }
.data tbody tr:hover { background: color-mix(in oklch, var(--powder-pale) 55%, transparent); }
.data tr.us { background: var(--powder-pale); }
.data tr.us > * { font-weight: 700; }
.data tr.cut > * { border-bottom: 2px dashed var(--maroon); }
.data sup { margin-left: 3px; font-size: 10px; font-weight: 700; color: var(--maroon); }
.data .pos { color: var(--ink-2); text-align: left; }
.standings tbody th { display: flex; align-items: center; gap: 8px; }
.t-abbr { display: none; }
.roster tbody th { display: flex; align-items: center; gap: 10px; }
.roster .numcol { width: 44px; text-align: right; padding-right: 10px; font-weight: 700; color: var(--ink-2); }
.roster td, .roster thead th { text-align: left; }
.stats tbody th { position: sticky; left: 0; background: var(--paper); }
.stats tbody tr:hover th { background: color-mix(in oklch, var(--powder-pale) 55%, var(--paper)); }
.stats thead button { all: unset; cursor: pointer; }
.stats thead button:hover { color: var(--ink); text-decoration: underline; }
.stats thead button:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.stats th[aria-sort] { color: var(--ink); }
.stats th[aria-sort='descending'] button::after { content: ' \25BE'; }
.stats th[aria-sort='ascending'] button::after { content: ' \25B4'; }
.results td, .results thead th, .splits td:first-child { text-align: left; }

.glist { width: 100%; border-collapse: collapse; font-size: 14px; }
.glist td { padding: 9px 6px 9px 0; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.glist tr:first-child td { border-top: 1px solid var(--rule); }
.glist .gdate { width: 1%; padding-right: 16px; color: var(--ink-2); }
.glist .num { text-align: right; font-weight: 600; }
.glist .gx { width: 1%; padding-left: 16px; text-align: right; font-size: 12.5px; }
.va { display: inline-block; min-width: 1.5em; font-size: 12px; color: var(--ink-2); }
.opp-name { font-weight: 600; }
.res { color: var(--ink); text-decoration: none; font-weight: 600; white-space: nowrap; }
.res:hover { text-decoration: underline; }
.res.w b, .res.w { color: var(--royal); }
.res.l b, .res.l { color: var(--maroon); }

/* ---------- leaders ---------- */
.leaders h3, .lg-cat h3 { margin-bottom: 4px; font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--maroon); }
.leaders li { display: grid; grid-template-columns: 44px 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.l-stat { font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--ink-2); }
.l-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.l-val { font: 800 1.5rem/1 var(--display); }
.lg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 28px 48px; }
.lg-cat li { display: grid; grid-template-columns: 16px 18px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--rule); font-size: 14px; }
.lg-cat li.us { background: var(--powder-pale); }
.lg-cat .rk { font-size: 12px; color: var(--ink-2); }
.lg-cat .l-val { font: 700 14px/1 var(--body); }

.news li { padding: 10px 0; border-bottom: 1px solid color-mix(in oklch, var(--powder) 45%, transparent); }
.news a { color: var(--ink); font-weight: 600; text-decoration: none; }
.news a:hover { color: var(--royal); text-decoration: underline; }
.news .muted { font-size: 12.5px; white-space: nowrap; margin-left: 4px; }

/* ---------- schedule ---------- */
.key { display: flex; align-items: center; gap: 8px; }
.swatch { flex: none; width: 14px; height: 14px; background: var(--powder-pale); border: 1px solid var(--powder); }
.month-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.month-nav a { padding: 5px 12px; border: 1.5px solid var(--ink); color: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; border-radius: 2px; }
.month-nav a:hover { background: var(--ink); color: var(--paper); }
.month { margin-top: 36px; scroll-margin-top: 16px; }
.month:last-child { margin-bottom: 44px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; background: var(--paper-dim); border: 1px solid var(--rule); }
.cal-head { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(7, 1fr); background: var(--powder); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; text-align: center; }
.cal-head span { padding: 6px 0; }
.day { min-height: 96px; padding: 6px 8px 8px; background: var(--paper-up); box-shadow: 0 0 0 1px var(--rule); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.day.at-home { background: var(--powder-pale); }
.day.today { outline: 2px solid var(--red); outline-offset: -2px; }
.dnum { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.day.today .dnum { color: var(--red); }
.dow { display: none; }
.cg { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: 13px; min-width: 0; }
.cg-opp { display: flex; align-items: center; gap: 5px; font-weight: 700; }
.cg-opp .va { min-width: 0; font-weight: 500; }
.cg-name { display: none; }
.cg-time { font-weight: 500; }
.cg-extra { font-size: 11px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cg-promo { display: none; }
.past summary { cursor: pointer; list-style: none; }
.past summary::-webkit-details-marker { display: none; }
.past summary .h::after { content: 'Show'; font: 600 12px/1 var(--body); letter-spacing: .06em; color: var(--royal); margin-left: auto; }
.past[open] summary .h::after { content: 'Hide'; }
.past summary .h { justify-content: flex-start; }

/* ---------- compare ---------- */
.compare-wrap { max-width: 620px; margin-inline: auto; }
.compare-form { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.compare-form select { width: 100%; padding: 9px 10px; font: 600 14px var(--body); color: var(--ink); background: var(--paper-up); border: 1.5px solid var(--ink); border-radius: 2px; }
.vs { font: 800 18px var(--display); text-transform: uppercase; color: var(--ink-2); }
.compare { width: 100%; margin-top: 18px; border-collapse: collapse; font-size: 15px; }
.compare thead th { padding-bottom: 12px; font-weight: 700; width: 40%; }
.compare thead .mug { margin: 0 auto 6px; }
.compare tbody > tr > * { padding: 8px 6px; border-top: 1px solid color-mix(in oklch, var(--powder) 45%, transparent); text-align: center; }
.compare tbody th { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--ink-2); }
.compare .best { font-weight: 700; color: var(--royal); }
.compare .best::after { content: ' \25C2'; font-size: 11px; }

/* ---------- popup ---------- */
dialog { width: min(580px, 100vw - 24px); max-height: calc(100vh - 32px); padding: 20px 22px 16px; background: var(--paper-up); color: var(--ink); border: 2px solid var(--maroon); box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--maroon), 0 18px 48px rgb(10 42 77 / .35); border-radius: 2px; }
dialog::backdrop { background: rgb(4 46 90 / .55); }
dialog[open] { animation: pop .22s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }
#pop-body { display: flex; flex-direction: column; gap: 12px; }
.pop-close { position: absolute; top: 14px; right: 14px; padding: 4px 10px; font: 600 12px var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); background: none; border: 1.5px solid var(--ink); border-radius: 2px; cursor: pointer; }
.pop-close:hover { background: var(--ink); color: var(--paper); }
.pop-wait { padding: 28px 0; }
#pop-body > :first-child { padding-right: 84px; }
.p-head { display: flex; align-items: center; gap: 16px; }
.statline { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 12px 0 4px; border-top: 2px solid var(--ink); text-align: center; }
.statline dt { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--ink-2); }
.statline dd { font: 800 1.5rem/1.2 var(--display); }

/* ---------- footer ---------- */
.site-foot { margin-top: 28px; background: var(--royal); color: var(--paper); font-size: 14px; }
.tint + .site-foot, main > .tint:last-child { margin-top: 0; }
main > .tint:last-child { margin-bottom: -28px; }
.site-foot::before { content: ''; display: block; height: 6px; background: repeating-linear-gradient(90deg, var(--powder) 0 16px, var(--maroon) 16px 32px); }
.foot-row { display: grid; grid-template-columns: 1.2fr 1fr 2fr; gap: 24px 48px; padding-block: 32px 36px; }
.site-foot a { color: var(--paper); }
.site-foot nav li + li { margin-top: 6px; }
.site-foot nav a { text-decoration: none; }
.site-foot nav a:hover { text-decoration: underline; }
.site-foot .fine { margin: 0; color: color-mix(in oklch, var(--paper) 82%, var(--royal)); }
.site-foot .fine p + p, .site-foot p + p { margin-top: 8px; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
    .band-cards, .cols { grid-template-columns: minmax(0, 1fr); }
    .foot-row { grid-template-columns: 1fr 1fr; }
    .foot-row .fine { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
    :root { --gutter: 16px; }
    h1 { font-size: 1.9rem; }
    .page-head h1 { font-size: 1.9rem; }
    .head-row { min-height: 0; }
    .brand { padding: 8px 0 2px; }
    .site-nav { width: 100%; overflow-x: auto; scrollbar-width: none; }
    .site-nav ul { justify-content: space-between; gap: 0; margin-inline: -8px; }
    .site-nav::-webkit-scrollbar { display: none; }
    .site-nav a { padding: 8px 8px; }
    .band { padding: 20px 0 30px; }
    .band-cards { gap: 22px; margin-top: 18px; }
    .card { padding: 14px 14px 12px; }
    .headline { font-size: 1.5rem; }
    .linescore { font-size: 13px; }
    .linescore th, .linescore td { padding: 6px 1px; min-width: 19px; }
    .linescore tbody th { padding-right: 6px; gap: 5px; }
    .block { padding-block: 28px; }
    .hide-sm { display: none; }
    .t-full { display: none; }
    .t-abbr { display: inline; }
    .data th, .data td { padding-inline: 6px; }
    .statline { grid-template-columns: repeat(3, 1fr); row-gap: 10px; }
    .compare-form { grid-template-columns: 1fr; text-align: center; }

    /* the calendar becomes a list of game days */
    .cal { display: block; background: none; border: 0; border-top: 2px solid var(--ink); }
    .cal-head, .day { display: none; }
    .day.has { box-shadow: none; display: grid; grid-template-columns: 74px minmax(0, 1fr); align-items: center; gap: 4px 8px; min-height: 0; padding: 10px 8px; border-bottom: 1px solid var(--rule); }
    .day.has .cg { grid-column: 2; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 2px 10px; font-size: 14px; }
    .dow { display: inline; }
    .dnum { font-size: 13px; }
    .cg-abbr { display: none; }
    .cg-name { display: inline; }
    .cg > .res, .cg > .cg-time, .cg > .live, .cg > .muted { margin-left: auto; }
    .cg-extra { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .live-dot, dialog[open] { animation: none; }
}
@media print {
    .site-head, .site-foot, .month-nav, .more { display: none; }
    body { background: #fff; }
}
