:root {
  font: 16px/1.45 system-ui, sans-serif;
  color: #202936;
  background: #f2f4f7;
  color-scheme: light;
  --red: #9d2235;
  --text: #202936;
  --muted: #566477;
  --line: #dce1e7;
  --surface: #fff;
  --tint: #f5f6f8;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: var(--text); }
button, input, select, summary { min-height: 44px; }
button, input, select { border: 1px solid #8994a3; border-radius: 6px; background: var(--surface); padding: 8px 10px; }
button, summary { cursor: pointer; }
button:hover { border-color: var(--red); }
button:active { background: #f2e6e9; }
button:disabled { cursor: wait; opacity: .65; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
button.active { background: var(--red); border-color: var(--red); color: #fff; }
a { color: var(--red); }
header { background: var(--red); color: #fff; padding: 12px max(16px, calc((100% - 1248px)/2)); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { min-width: 0; }
h1 { font-size: clamp(22px, 2.5vw, 28px); line-height: 1.15; margin: 2px 0 4px; }
header p { margin: 0; font-size: 13px; }
.eyebrow { font-size: 11px; letter-spacing: 1px; }
header button { flex-shrink: 0; font-size: 14px; }
main { max-width: 1280px; margin: auto; padding: 16px; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.toolbar label { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.toolbar > button, .toolbar > input, .toolbar > select { font-size: 14px; }
#season { width: 114px; }
#date { width: 150px; }
.statusbar { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 12px; margin: 4px 0 12px; font-size: 13px; color: var(--muted); }
#importDetails { flex: 1 1 300px; }
#importDetails summary { display: flex; align-items: center; gap: 6px; width: fit-content; padding: 6px 0; text-decoration: underline; text-underline-offset: 3px; }
#importDetails summary::before { content: '+'; font-weight: 700; }
#importDetails[open] summary::before { content: '\2212'; }
#coverage { max-width: 80ch; margin: 0 0 12px; }
#updated { white-space: nowrap; }
.muted { color: var(--muted); font-size: 13px; }
#error, #manageError, #profileError { color: #871b2c; margin: 12px 0; }
#error:empty, #manageError:empty, #profileError:empty { display: none; }
.error-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.error-actions:has(button:not([hidden])) { margin-bottom: 12px; }
#cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; align-items: start; }
article, #manager, #profile { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; min-width: 0; }
article { font-variant-numeric: tabular-nums; }
#manager, #profile { margin: 16px 0; }
.identity { display: flex; align-items: center; gap: 8px; min-width: 0; }
.identity > div { flex: 1; min-width: 0; }
h2 { font-size: 19px; margin: 0; line-height: 1.3; }
h3 { font-size: 16px; margin: 20px 0 8px; }
.name { border: 0; padding: 0; background: transparent; color: var(--red); font-size: 19px; font-weight: 700; text-align: left; line-height: 1.25; }
.headshot { width: 52px; height: 56px; object-fit: contain; }
.logo { width: 32px; height: 32px; object-fit: contain; }
.game { border-block: 1px solid var(--line); padding: 8px 0; margin: 8px 0; font-size: 13px; }
.score { font-size: 22px; font-weight: 700; }
.live, .win { color: #087747; font-weight: 700; }
.loss { color: var(--red); font-weight: 700; }
.hero { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; gap: 8px; margin: 12px 0; }
.hero strong { display: block; font-size: 28px; line-height: 1.25; }
.hero span, .details span { font-size: 12px; color: var(--muted); }
.details { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; padding-bottom: 8px; }
.details b { display: block; font-size: 14px; }
.previous { display: flex; align-items: baseline; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 4px 0 10px; font-size: 13px; }
.previous strong { font-size: 14px; white-space: nowrap; }
.season { background: var(--tint); border-radius: 4px; padding: 10px 12px; }
.season-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 8px; font-size: 14px; }
.season .hero { margin: 8px 0; }
.season .hero strong { font-size: 26px; }
.shooting { display: flex; flex-wrap: wrap; gap: 3px 12px; font-size: 13px; }
.milestones { margin: 4px 0 8px; font-size: 13px; color: var(--muted); }
.profile-link { width: 100%; font-size: 14px; }
.next { margin-top: 12px; font-size: 13px; }
.next b { font-size: 14px; }
.countdown { color: var(--red); font-weight: 700; margin-top: 2px; }
.remove { margin-top: 12px; color: #871b2c; font-size: 13px; }
.loading, .empty { padding: 20px; margin: 0; }
.empty p { margin: 0 0 12px; }
#watchNotice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; margin: 12px 0; background: #fff; border-left: 4px solid var(--red); }
#login { display: flex; align-items: end; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
#login label, #manageControls > label { display: flex; flex-direction: column; gap: 4px; }
#login input, #search { width: min(100%, 320px); }
#manageControls { margin-top: 12px; }
#results > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 8px 0; }
#results button { flex-shrink: 0; }
.profile-header { justify-content: space-between; align-items: start; gap: 8px; }
.profile-context { margin: 4px 0 12px; }
.tablewrap { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: 4px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
caption { text-align: left; padding: 8px; font-weight: 700; }
th, td { padding: 8px; border-bottom: 1px solid var(--line); text-align: right; }
th { font-weight: 700; }
thead th { background: var(--tint); }
th:first-child, td:first-child { text-align: left; }
.logwrap { max-height: 560px; }
.logwrap thead th { position: sticky; top: 0; z-index: 2; }
.logwrap th:first-child, .logwrap td:first-child { position: sticky; left: 0; background: #fff; z-index: 1; border-right: 1px solid var(--line); }
.logwrap thead th:first-child { background: var(--tint); z-index: 3; }
.averages-table { table-layout: fixed; white-space: normal; }
.averages-table th, .averages-table td { padding: 7px 6px; }
.averages-table thead th small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.averages-table th:first-child { width: 20%; }
.highs { padding: 8px 0; margin: 0 0 12px; font-size: 13px; }
#chartCaption { margin: 8px 0 0; }
#chart { display: flex; gap: 4px; overflow-x: auto; padding: 8px 3px; margin-top: 4px; scrollbar-gutter: stable; }
.chartcol { flex: 1 0 44px; min-width: 44px; padding: 4px 0; border: 1px solid transparent; background: transparent; border-radius: 4px; font-variant-numeric: tabular-nums; }
.chartcol:hover, .chartcol[aria-pressed=true] { background: #f2e6e9; border-color: var(--red); }
.chartvalue, .chartlabel { display: block; font-size: 12px; text-align: center; }
.chartvalue { font-weight: 700; padding-bottom: 4px; }
.chartlabel { padding-top: 4px; color: var(--muted); }
.chartplot { display: block; position: relative; height: 168px; width: 100%; }
.chartbar { position: absolute; left: 10%; width: 80%; display: block; background: var(--red); border-radius: 2px; }
.chartzero { position: absolute; left: 0; right: 0; height: 1px; background: #687585; }
.chart-axis { font-size: 12px; color: var(--muted); margin: 0; }
#chartDetail { min-height: 2.9em; margin: 8px 0 0; }
footer { font-size: 12px; color: var(--muted); margin: 20px 0 8px; max-width: 100ch; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
@media (max-width: 600px) {
  header { padding: 10px 12px; gap: 10px; align-items: center; }
  header p { display: none; }
  header button { max-width: 128px; padding: 8px; line-height: 1.2; }
  .eyebrow { font-size: 10px; letter-spacing: .5px; }
  main { padding: 12px; }
  .toolbar { gap: 4px; }
  .toolbar label { font-size: 13px; gap: 4px; }
  .toolbar button { font-size: 14px; padding-inline: 6px; }
  .toolbar select { font-size: 14px; padding-inline: 8px; }
  #season { width: 90px; font-size: 14px; padding-inline: 4px; }
  #type { max-width: 137px; }
  #date { width: 144px; font-size: 16px; padding-inline: 4px; }
  #cards { gap: 12px; }
  article, #manager, #profile { padding: 12px; }
  .statusbar { align-items: center; margin-bottom: 8px; gap: 0 8px; }
  #importDetails { flex: 1 1 auto; }
  #updated { font-size: 12px; }
  .profile-header h2 { flex: 1 1 180px; }
  input[type=password], input[type=search] { font-size: 16px; max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Equal-height cards keep identity and actions visible; details scroll independently. */
#cards article { height: 640px; display: flex; flex-direction: column; overflow: hidden; }
#cards article > .identity { flex: 0 0 auto; padding-bottom: 4px; }
.card-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-gutter: stable; padding: 0 4px 8px 0; }
.card-actions { flex: 0 0 auto; padding-top: 10px; border-top: 1px solid var(--line); }
.card-actions .remove { margin-top: 6px; width: 100%; }
.card-scroll:focus-visible { outline-offset: -3px; }
.availability { font-size: 13px; padding: 8px; margin: 4px 0 8px; border-left: 3px solid var(--red); background: #faf1f3; }
.availability .muted { display: block; margin-top: 3px; font-size: 12px; }
.no-appearances { font-size: 13px; margin: 8px 0; color: var(--muted); }
.view-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; font-size: 13px; }
.view-controls > span { margin-right: 4px; }
.view-controls button { min-width: 68px; font-size: 14px; }
.comparison-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.comparison-toolbar label { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.comparison-wrap { max-height: 70vh; background: #fff; }
.comparison-table { min-width: 1600px; }
.comparison-table caption { white-space: normal; }
.comparison-table thead th { position: sticky; top: 0; z-index: 2; padding: 0; }
.comparison-table thead button { border: 0; border-radius: 0; min-width: 54px; width: 100%; background: transparent; font-weight: 700; padding: 8px; text-align: right; }
.comparison-table thead th[aria-sort] { background: #f2e6e9; color: var(--red); }
.comparison-table th:first-child, .comparison-table td:first-child { position: sticky; left: 0; z-index: 1; background: #fff; border-right: 1px solid var(--line); }
.comparison-table thead th:first-child { z-index: 3; background: var(--tint); }
.comparison-table thead th:first-child button { text-align: left; }
.comparison-table tbody tr:hover td, .comparison-table tbody tr:hover th { background: #f8f9fb; }
.comparison-table .row-name { color: var(--red); font-weight: 700; border: 0; background: transparent; text-align: left; padding: 4px 0; }
.row-status { white-space: normal; min-width: 220px; max-width: 280px; text-align: left; }
.jersey { color: var(--muted); font-size: .8em; font-weight: 400; white-space: nowrap; }
.comparison-table td.stat-leader, .comparison-table tbody tr:hover td.stat-leader { background: #f2e6e9; color: #871b2c; }
.stat-leader strong { text-decoration: underline; text-underline-offset: 3px; }
#leaderLegend { font-size: 13px; color: var(--muted); }
@media (max-width: 767px) { .view-controls { display: none; } #cards article { height: 640px; } }
@media (max-height: 700px) { #cards article { height: 580px; } }

/* Compact comparison controls and restrained category markers. */
button, input, select, summary { min-height: 34px; }
button, input, select { padding: 5px 9px; }
.comparison-table td, .comparison-table thead button { text-align: center; }
.comparison-table td:first-child, .comparison-table thead th:first-child button, .comparison-table .row-status { text-align: left; }
.comparison-table td.stat-leader, .comparison-table tbody tr:hover td.stat-leader { background: transparent; color: inherit; }
.stat-leader strong { display: inline-block; min-width: 28px; padding: 2px 4px; border: 1px solid #ddc96a; border-radius: 2px; background: #fff5c4; color: #302d20; text-decoration: none; font-weight: 600; }
@media (pointer: coarse) { button, input, select, summary { min-height: 40px; } }

/* Larger card-header portraits and team marks. */
#cards .identity > .headshot { width: 76px; height: 80px; flex: 0 0 76px; }
#cards .identity > .logo { width: 46px; height: 46px; flex: 0 0 46px; }

/* Approved tracker identity. */
.brand { display: flex; align-items: center; gap: 14px; }
.tracker-logo { width: 76px; height: 76px; object-fit: contain; flex: 0 0 auto; }
.brand-copy { min-width: 0; }
@media(max-width:600px) {
  .brand { gap: 8px; }
  .tracker-logo { width: 48px; height: 48px; }
  .brand .eyebrow { display: none; }
}

/* Player portrait fades through the shoulders, clear of the statistics. */
#cards article > .identity { position: relative; isolation: isolate; min-height: 124px; align-items: flex-start; padding-top: 14px; padding-bottom: 12px; }
#cards .identity > div { position: relative; z-index: 1; flex: 0 1 54%; padding-top: 4px; }
#cards .identity > .card-portrait {
  position: absolute; z-index: 0; pointer-events: none;
  top: -8px; right: 22px; width: 54%; height: 150px;
  object-fit: cover; object-position: center top; opacity: .70;
  -webkit-mask-image: none;
  mask-image: none;
}
#cards .identity > .logo { position: relative; z-index: 2; margin-left: auto; margin-top: 10px; }
#cards .identity .name { font-size: 18px; }

/* Keep portrait shoulders inside the header, above the game divider. */
#cards article > .identity { overflow: hidden; }

.card-group-heading { grid-column: 1 / -1; margin: 4px 0 0; padding-bottom: 6px; border-bottom: 1px solid var(--line); font-size: 17px; }

/* Quiet game-day tint and a steady live-game halo. */
#cards article.game-scheduled { background: #f5faf6; border-color: #cdded1; }
#cards article.game-live { border-color: #d6b94d; box-shadow: 0 0 0 2px #f4d66c66, 0 0 14px #edca4d40; }
@media (forced-colors: active) { #cards article.game-live { outline: 2px solid Highlight; } }

/* Large team watermark behind the player, clipped inside the header. */
#cards .identity > .logo {
  position: absolute; z-index: 0; top: 0; right: -2px;
  width: 42%; height: 124px; max-width: 150px;
  margin: 0; opacity: .30; object-fit: contain;
  pointer-events: none;
}
#cards .identity > .card-portrait { z-index: 1; }
#cards .identity > div { z-index: 2; }
/* Solid foreground portraits prevent the watermark showing through faces. */
#cards .identity > .card-portrait {
  opacity: 1; top: auto; bottom: 0; height: 142px;
  right: 30px; z-index: 1;
}
#cards .identity > .logo {
  top: auto; bottom: 0; right: -14px;
  width: 43%; max-width: 160px; height: 142px;
  object-position: right bottom; opacity: .20; z-index: 0;
}
.logwrap tfoot th, .logwrap tfoot td { position: sticky; bottom: 0; z-index: 2; background: #eef1f5; border-top: 2px solid #8994a3; font-weight: 700; }
.logwrap tfoot th:first-child { left: 0; z-index: 4; background: #eef1f5; }

/* Pin the two summary rows together with a fixed-height percentage row. */
.logwrap tfoot tr:last-child > * { height: 36px; box-sizing: border-box; padding-block: 6px; line-height: 22px; bottom: 0; white-space: nowrap; }
.logwrap tfoot tr:first-child > * { bottom: 36px; }

/* Keep wide data inside its own scroll region; use quiet desktop scrollbars. */
main, #profile, #comparison { min-width: 0; max-width: 100%; }
main { width: 100%; }
.tablewrap { width: 100%; min-width: 0; }
@media (min-width: 1024px) {
  .comparison-wrap { max-height: none; }
  .comparison-table { min-width: 1250px; }
  .comparison-table th, .comparison-table td { padding-inline: 6px; }
  .comparison-table thead button { min-width: 44px; padding-inline: 5px; }
}
@media (hover: hover) and (pointer: fine) {
  .tablewrap, .card-scroll, #chart { scrollbar-width: thin; scrollbar-color: #b8c0cb transparent; }
  .tablewrap::-webkit-scrollbar, .card-scroll::-webkit-scrollbar, #chart::-webkit-scrollbar { width: 6px; height: 6px; }
  .tablewrap::-webkit-scrollbar-track, .card-scroll::-webkit-scrollbar-track, #chart::-webkit-scrollbar-track { background: transparent; }
  .tablewrap::-webkit-scrollbar-thumb, .card-scroll::-webkit-scrollbar-thumb, #chart::-webkit-scrollbar-thumb { background: #b8c0cb; border-radius: 6px; }
  .tablewrap::-webkit-scrollbar-button, .card-scroll::-webkit-scrollbar-button, #chart::-webkit-scrollbar-button { display: none; }
}
/* Aligned page gutters and deliberately grouped tracker navigation. */
main { width: 100%; max-width: 1800px; margin-inline: auto; padding: 20px 32px; }
header { padding-inline: max(32px, calc((100% - 1736px)/2)); }
.toolbar { display: flex; align-items: end; justify-content: space-between; gap: 16px 24px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.date-controls { display: flex; align-items: center; gap: 6px; min-width: 0; }
.season-controls { display: flex; align-items: end; gap: 10px; }
.season-controls label { display: flex; flex-direction: column; align-items: stretch; gap: 4px; font-size: 12px; color: var(--muted); }
.toolbar button, .toolbar input, .toolbar select { height: 36px; min-height: 36px; font-size: 14px; border-radius: 5px; }
.toolbar #date { width: 150px; min-width: 0; }
.toolbar #season { width: 118px; }
.toolbar #type { width: 160px; max-width: none; }
.statusbar { margin: 8px 0 12px; align-items: center; }
.statusbar summary { min-height: 28px; font-size: 12px; }
#updated { font-size: 12px; }
.view-controls { gap: 0; margin: 0 0 16px; }
.view-controls > span { margin-right: 10px; font-size: 12px; color: var(--muted); }
.view-controls button { min-height: 32px; padding: 4px 14px; border-radius: 0; }
.view-controls button:first-of-type { border-radius: 5px 0 0 5px; }
.view-controls button:last-of-type { border-radius: 0 5px 5px 0; margin-left: -1px; }
@media(max-width: 767px) {
  main { padding: 14px 12px; }
  header { padding-inline: 12px; }
  .toolbar { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; }
  .date-controls { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
  .toolbar #date { width: 100%; max-width: 100%; }
  .toolbar button, .toolbar input, .toolbar select { min-height: 40px; height: 40px; }
  .season-controls { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.35fr); gap: 8px; }
  .toolbar #season, .toolbar #type { width: 100%; max-width: 100%; }
  .statusbar { flex-wrap: wrap; gap: 4px 12px; }
  .view-controls { display: none; }
}

/* WebKit date inputs otherwise retain an intrinsic width larger than their grid cell. */
@media (max-width: 767px) {
  .date-controls { align-items: stretch; }
  .date-controls > * { min-width: 0; max-width: 100%; width: 100%; margin: 0; box-sizing: border-box; }
  .toolbar #date {
    -webkit-appearance: none; appearance: none;
    display: block; width: 100%; min-width: 0; max-width: 100%;
    height: 40px; min-height: 40px; padding: 6px 8px;
    font-size: 16px; line-height: normal; background: #fff;
  }
  .toolbar #date::-webkit-date-and-time-value { min-width: 0; text-align: left; margin: 0; }
  .toolbar #date::-webkit-datetime-edit { display: inline-flex; padding: 0; max-width: 100%; }
  .season-controls > label { min-width: 0; }
  .season-controls select { min-width: 0; box-sizing: border-box; }
}
/* Active game sections can show complete cards without nested scrolling. */
#cards article.game-live,
#cards article.game-scheduled { height: auto; min-height: 0; align-self: stretch; }
#cards article.game-live .card-scroll,
#cards article.game-scheduled .card-scroll {
  flex: 1 0 auto; overflow: visible; scrollbar-gutter: auto;
}
/* Clear live-game emphasis and aligned box-score rows. */
#cards article.game-live { border: 3px solid var(--red); box-shadow: none; }
.game-stat-rows { margin: 4px 0 14px; font-size: 13px; font-variant-numeric: tabular-nums; }
.game-stat-row { display: grid; grid-template-columns: minmax(0,1fr) 54px 72px; align-items: baseline; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.game-stat-row > span { color: var(--muted); }
.game-stat-row > strong, .game-stat-row > small { text-align: right; white-space: nowrap; }
.game-stat-row > strong { font-size: 14px; }
.game-stat-row > small { font-size: 12px; color: var(--muted); }

/* Centered scoreboards, team-colored names and explicit result badges. */
#cards .game { text-align: center; }
#cards .game .score { margin: 4px 0; }
.team-caption { font-size: 13px; }
.team-text { font-weight: 600; }
#cards .game .win, #cards .game .loss { display: inline-block; border-radius: 3px; padding: 1px 6px; font-size: 11px; font-weight: 800; letter-spacing: .03em; }
#cards .game .win { color: #146238; background: #e2f3e8; }
#cards .game .loss { color: #a51f32; background: #fbe6e9; }
.team-text.team-ATL { color: #a71930; }
.team-text.team-BOS { color: #007a33; }
.team-text.team-BKN { color: #202020; }
.team-text.team-CHA { color: #00788c; }
.team-text.team-CHI { color: #ce1141; }
.team-text.team-CLE { color: #860038; }
.team-text.team-DAL { color: #00538c; }
.team-text.team-DEN { color: #0e2240; }
.team-text.team-DET { color: #c8102e; }
.team-text.team-GS { color: #1d428a; }
.team-text.team-GSW { color: #1d428a; }
.team-text.team-HOU { color: #ce1141; }
.team-text.team-IND { color: #002d62; }
.team-text.team-LAC { color: #c8102e; }
.team-text.team-LAL { color: #552583; }
.team-text.team-MEM { color: #334b70; }
.team-text.team-MIA { color: #98002e; }
.team-text.team-MIL { color: #00471b; }
.team-text.team-MIN { color: #0c2340; }
.team-text.team-NO { color: #0c2340; }
.team-text.team-NOP { color: #0c2340; }
.team-text.team-NY { color: #006bb6; }
.team-text.team-NYK { color: #006bb6; }
.team-text.team-OKC { color: #0070ad; }
.team-text.team-ORL { color: #005aaa; }
.team-text.team-PHI { color: #006bb6; }
.team-text.team-PHX { color: #5f259f; }
.team-text.team-POR { color: #e03a3e; }
.team-text.team-SAC { color: #5a2d81; }
.team-text.team-SA { color: #333333; }
.team-text.team-SAS { color: #333333; }
.team-text.team-TOR { color: #ce1141; }
.team-text.team-UTAH { color: #002b5c; }
.team-text.team-UTA { color: #002b5c; }
.team-text.team-WSH { color: #002b5c; }
.team-text.team-WAS { color: #002b5c; }

#cards .score .result-win { color: #087747; }
#cards .score .result-loss { color: #b42338; }

@media(max-width:767px) { .season-controls { grid-template-columns: minmax(0,1fr); } }

/* View toggle sits beside the season filter. */
.season-controls .view-controls { margin: 0; align-self: end; }
.season-controls .view-controls button { height: 36px; min-height: 36px; }

#cards .game .live { display: flex; align-items: center; justify-content: center; gap: 9px; margin: 3px 0 6px; }
.live-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; background: var(--red); color: white; border-radius: 4px; font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: white; animation: live-pulse 1.8s ease-in-out infinite; }
.live-clock { color: var(--text); font-size: 14px; font-weight: 700; }
@keyframes live-pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }
@media(prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

#cards .game .score { font-size: 26px; line-height: 1.25; }

/* Player profile: identity first, then form, trends and game history. */
#profile { border-top: 4px solid var(--red); scroll-margin-top: 12px; }
#profile .profile-header { border-bottom: 0; padding-bottom: 4px; }
#profileTitle { font-size: clamp(22px,3vw,30px); }
.player-profile-intro { display: grid; grid-template-columns: 160px minmax(0,1fr); gap: 24px; align-items: center; padding: 12px 0 18px; border-bottom: 1px solid var(--line); }
.profile-portrait { width: 160px; height: 150px; object-fit: contain; }
.profile-team { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.profile-team-logo { width: 40px; height: 40px; object-fit: contain; }
.bio-facts { display: flex; flex-wrap: wrap; gap: 12px 28px; margin: 14px 0 0; }
.bio-facts dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.bio-facts dd { margin: 3px 0 0; font-size: 14px; font-weight: 600; }
.profile-bio-note { font-size: 11px; margin: 12px 0 0; }
.profile-section-title, #gameLogTitle { margin-top: 26px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font-size: 18px; }
#profile .averages-table thead th { background: #edf0f4; }
#profile .averages-table tbody tr:nth-child(even) { background: #f8f9fb; }
#profile .logwrap tbody tr:nth-child(even) { background: #f8f9fb; }
@media(max-width:600px) {
 .player-profile-intro { grid-template-columns: 100px minmax(0,1fr); gap: 12px; align-items: start; }
 .profile-portrait { width: 100px; height: 110px; }
 .profile-team { font-size: 14px; gap: 6px; }
 .profile-team-logo { width: 30px; height: 30px; }
 .bio-facts { gap: 10px 16px; }
}

/* Match the profile portrait to the card-header portrait height. */
.player-profile-intro { grid-template-columns: 200px minmax(0,1fr); }
.profile-portrait { width: 200px; height: 142px; object-fit: cover; object-position: center top; }
@media(max-width:600px) {
  .player-profile-intro { grid-template-columns: 150px minmax(0,1fr); }
  .profile-portrait { width: 150px; height: 142px; object-fit: cover; object-position: center top; }
}
/* Consistent previous-game layout regardless of stat-string length. */
#cards .previous { display: grid; grid-template-columns: minmax(0,1fr); gap: 5px; align-items: start; justify-content: normal; }
#cards .previous > strong { display: block; white-space: normal; line-height: 1.4; }
/* Explicit feedback connects chart selection to the game detail below it. */
#chartDetail { margin-top: 12px; padding: 12px 14px; border: 1px dashed var(--line); border-radius: 5px; font-size: 13px; }
#chartDetail.has-selection { background: #f6edef; border: 1px solid #e2c6cc; border-left: 4px solid var(--red); color: var(--text); font-size: 16px; font-weight: 700; }
#chartDetail.has-selection::before { content: 'SELECTED GAME'; display: block; margin-bottom: 4px; color: var(--red); font-size: 10px; letter-spacing: .08em; font-weight: 800; }
#chart .chartcol[aria-pressed=true] { background: #f0dce1; border: 2px solid var(--red); }
#chart .chartcol[aria-pressed=true] .chartlabel { color: var(--red); font-weight: 800; }

#profile .logwrap tbody tr.selected-game-row > * { background: #f6e6eb; color: var(--text); }
#profile .logwrap tbody tr.selected-game-row > th:first-child { box-shadow: inset 4px 0 var(--red); color: var(--red); font-weight: 800; }

.logwrap tfoot tr:only-child > * { bottom: 0; }

.log-result { display: inline-block; min-width: 18px; text-align: center; font-weight: 800; }
.log-result.result-w { color: #087747; }
.log-result.result-l { color: #b42338; }
.log-final-score { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Continuous status-ordered grid. Empty tracks retain normal card widths. */
#cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; align-items: start; }
#cards article { min-width: 0; }
#cards .card-status-label { flex: 0 0 auto; margin: -4px 0 6px; padding: 0 0 7px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 700; }
#cards .game-live .card-status-label { color: var(--red); }
@media (max-width: 767px) { #cards { gap: 12px; } }

/* Status bands remain recognizable by their text as well as color. */
#cards article[data-status-group] { --status-ink: #4b596b; --status-fill: #edf0f4; --status-edge: #8b98a8; border-top: 4px solid var(--status-edge); }
#cards article[data-status-group="0"] { --status-ink: #9d2235; --status-fill: #fbe8ec; --status-edge: #9d2235; }
#cards article[data-status-group="1"] { --status-ink: #205484; --status-fill: #e9f2fb; --status-edge: #3c78aa; }
#cards article[data-status-group="2"] { --status-ink: #146238; --status-fill: #e8f4ed; --status-edge: #39835a; }
#cards article[data-status-group="4"] { --status-ink: #77500d; --status-fill: #fff3d9; --status-edge: #b98020; }
#cards article[data-status-group] .card-status-label { margin: 0 0 8px; padding: 7px 10px; border: 0; border-left: 4px solid var(--status-edge); border-radius: 3px; background: var(--status-fill); color: var(--status-ink); font-size: 12px; font-weight: 750; letter-spacing: .025em; }
@media (forced-colors: active) { #cards article[data-status-group] .card-status-label { border: 1px solid CanvasText; } }

/* Explicit box-score starter status, confined to the Minutes row. */
.game-stat-row .starter-badge { display: inline-block; padding: 2px 6px; border: 1px solid #ddbdc4; border-radius: 3px; background: #f8edf0; color: #842135; font-size: 11px; font-weight: 700; line-height: 1.4; white-space: nowrap; }

/* Starter marker in the date cell; no extra table column. */
#profile .history-starter { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 5px; vertical-align: middle; border: 1px solid currentColor; border-radius: 2px; color: var(--red); background: #f8edf0; font-size: 11px; line-height: 1; font-weight: 750; }

.game-log-legend { margin: 8px 0 12px; font-size: 12px; }
