.player-record-link { border: 0; padding: 6px 3px; background: transparent; color: var(--ui-accent); font: inherit; font-weight: 700; cursor: pointer; }
.player-record-link:hover { text-decoration: underline; }
.player-record-link:focus-visible, .player-stat-button:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
body:not(.start-mode) .leaderboard-table-scroll .league-average-row > * { background: #e6f1ef; }
.player-record-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.player-record-toolbar > span { font-size: 13px; color: var(--ui-muted); }
.player-record-identity { display: flex; align-items: center; gap: 16px; }
.player-record-identity .team-logo-avatar { flex: 0 0 48px; width: 48px; height: 48px; font-size: 23px; }
body:not(.start-mode) #player-record-name { font-size: 26px; overflow-wrap: anywhere; margin: 0; }
.player-record-identity p { font-size: 13px; color: var(--ui-muted); margin: 6px 0; }
.player-record-identity > div { min-width: 0; }
.player-record-identity p { line-height: 1.8; overflow-wrap: anywhere; }
.player-record-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); position: sticky; top: 0; z-index: 10; margin-top: 24px; border-bottom: 1px solid var(--ui-line); background: var(--ui-canvas); }
.player-record-tabs [role="tab"] { min-width: 0; min-height: 48px; padding: 12px 8px; border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: transparent; color: var(--ui-muted); font: inherit; font-size: 14px; font-weight: 700; }
.player-record-tabs [role="tab"][aria-selected="true"] { color: var(--ui-accent); border-bottom-color: var(--ui-accent); background: var(--ui-selected); }
.player-record-tab-panel { min-width: 0; scroll-margin-top: 64px; }
.player-record-tab-panel[hidden] { display: none !important; }
#records-player-view .player-record-section { scroll-margin-top: 64px; }
.player-ability-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px 32px; margin: 0; }
.player-ability-stat { min-width: 0; padding: 16px 0; border-bottom: 1px solid var(--ui-line); }
.player-ability-stat dt { font-size: 13px; color: var(--ui-muted); }
.player-ability-stat dd { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin: 8px 0; min-height: 36px; }
.player-ability-stat strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.player-ability-stat small { font-size: 11px; }
.player-ability-stat .ability-rank { display: inline-grid; place-items: center; width: 28px; height: 28px; padding: 0; }
.player-ability-meter { height: 6px; background: var(--ui-line); }
.player-ability-meter > span { display: block; height: 100%; background: var(--ability-color); }
.player-ability-unrecorded { font-size: 11px; color: var(--ui-muted); }
.player-trajectory { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.player-trajectory strong { font-size: 20px; }
.player-position-aptitudes { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 16px; margin: 0; }
.player-position-aptitudes > div { padding: 12px 0; border-bottom: 1px solid var(--ui-line); text-align: center; }
.player-position-aptitudes dt { font-size: 12px; color: var(--ui-muted); }
.player-position-aptitudes dd { margin: 8px 0 0; font-size: 16px; font-weight: 700; color: var(--ui-muted); }
.player-position-aptitudes .aptitude-A { color: #a13050; }
.player-position-aptitudes .aptitude-B { color: #99662c; }
.player-position-aptitudes .aptitude-C { color: #327d98; }
.player-public-abilities { display: flex; flex-wrap: wrap; gap: 8px; }
.player-public-abilities .special-ability-tag { margin: 0; }
.player-pitch-compass { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); grid-template-rows: minmax(88px,auto) minmax(100px,auto) minmax(110px,auto); gap: 16px 24px; }
.player-pitch-origin { grid-row: 2; grid-column: 2; display: grid; place-content: center; justify-items: center; gap: 8px; font-size: 12px; color: var(--ui-muted); }
.player-pitch-origin svg { width: 32px; height: 32px; color: var(--ui-accent); }
.player-pitch-direction { min-width: 0; border-bottom: 1px solid var(--ui-line); }
body:not(.start-mode) .player-pitch-direction h4 { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; font-size: 12px; color: var(--ui-muted); }
.player-pitch-direction h4 svg { width: 16px; height: 16px; flex: 0 0 16px; }
.player-pitch-direction ul, .player-pitch-other { list-style: none; padding: 0; margin: 0; }
.player-pitch-direction li, .player-pitch-other li { display: grid; grid-template-columns: minmax(0,1fr) 20px; gap: 4px 6px; padding: 6px 0 12px; font-size: 13px; }
.player-pitch-direction li > span:first-child { overflow-wrap: anywhere; }
.player-pitch-direction li > strong { text-align: right; font-variant-numeric: tabular-nums; }
.player-pitch-level { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 3px; height: 5px; }
.player-pitch-level i { background: var(--ui-line); }
.player-pitch-level i.filled { background: var(--ui-accent); }
.player-pitch-empty { color: var(--ui-muted); }
.player-ability-modes { display: flex; gap: 6px; }
.player-ability-modes button { min-height: 44px; border: 0; border-bottom: 2px solid transparent; padding: 8px 12px; color: var(--ui-muted); background: transparent; font: inherit; font-size: 13px; }
.player-ability-modes button[aria-pressed="true"] { color: var(--ui-accent); border-bottom-color: var(--ui-accent); }
.player-record-section { padding: 28px 0; border-bottom: 1px solid var(--ui-line); min-width: 0; }
.player-record-section h3 { margin: 0 0 16px; }
.player-record-section-heading { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: baseline; }
.player-record-section-heading h3 > span { font-size: 12px; font-weight: 400; margin-left: 10px; color: var(--ui-muted); }
.player-section-controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; min-width: 0; }
.player-record-section label { display: flex; align-items: center; gap: 8px; font-size: 12px; min-width: 0; }
.player-record-section select { min-height: 36px; max-width: 100%; padding: 6px 8px; border: 1px solid var(--ui-line); background: #fff; color: var(--ui-ink); border-radius: 4px; font: inherit; }
.player-guide-link { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; border: 0; background: transparent; color: var(--ui-accent); font: inherit; font-size: 12px; cursor: pointer; }
.player-guide-link svg { width: 16px; height: 16px; }
.player-metric-guide { border: 0; background: transparent; padding: 0; color: inherit; font: inherit; cursor: pointer; }
.player-metric-guide:hover { text-decoration: underline; color: var(--ui-accent); }
.player-metric-guide:focus-visible, .player-guide-link:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 3px; }
.player-annual-scroll { width: 100%; overflow: auto; max-height: 360px; border-top: 1px solid var(--ui-line); border-bottom: 1px solid var(--ui-line); }
.player-annual-scroll:focus-visible { outline: 2px solid var(--ui-accent); }
body:not(.start-mode) table.player-annual-table { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; table-layout: auto; }
.player-annual-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
body:not(.start-mode) table.player-annual-table :is(th,td) { text-align: right; min-width: 70px; height: 40px; padding: 9px 12px; }
body:not(.start-mode) table.player-annual-table tbody th { position: sticky; left: 0; z-index: 1; min-width: 100px; text-align: left; background: #fff; border-right: 1px solid var(--ui-line); }
body:not(.start-mode) table.player-annual-table thead th { position: sticky; top: 0; z-index: 2; }
body:not(.start-mode) table.player-annual-table thead th[data-fixed-year] { left: 0; z-index: 3; min-width: 100px; text-align: left; }
body:not(.start-mode) table.player-annual-table:has(.player-table-groups) thead tr:last-child th { top: 36px; }
body:not(.start-mode) table.player-annual-table .player-table-groups th { height: 36px; text-align: left; color: #243f3b; background: #dce9e6; }
body:not(.start-mode) table.player-annual-table .player-column-divider { border-left: 2px solid #151c1b; }
body:not(.start-mode) table.player-annual-table .player-three-year-total > * { background: #e6f1ef; font-weight: 700; }
.player-annual-table th small { display: block; font-size: 10px; font-weight: 400; color: var(--ui-muted); }
body:not(.start-mode) table.player-annual-table .player-missing-record { text-align: left; color: var(--ui-muted); }
.percentile-chart .percentile-year { display: inline-flex; font: inherit; }
.percentile-year select { border: 0; border-radius: 0; border-bottom: 1px dotted #469aa6; background: transparent; padding: 0 2px 0 0; font: inherit; font-weight: 700; color: inherit; cursor: pointer; }
#player-fielding-exposure h4 { font-size: 13px; }
.player-percentile-guide { margin: 6px 0 24px; font-size: 12px; color: var(--ui-muted); line-height: 1.8; }
.player-percentile-guide summary, .player-history-details summary { cursor: pointer; color: var(--ui-accent); }
.player-percentile-guide p { margin: 10px 0; }
.percentile-chart { --chart-line: #469aa6; --label-width: 190px; --actual-width: 78px; --chart-gap: 22px; max-width: 900px; margin: 0 auto; padding: 20px 28px 30px; border: 1px solid var(--chart-line); background: #fff; color: #202a2c; }
body:not(.start-mode) #player-percentile-title { width: fit-content; max-width: 100%; margin: 0 auto 20px; font-size: 24px; line-height: 1.4; letter-spacing: 0; }
#player-percentile-title::after { content: ''; display: block; width: 58px; margin-top: 6px; border-bottom: 4px dotted var(--chart-line); }
body:not(.start-mode) .percentile-chart .percentile-group { display: flex; align-items: center; gap: 10px; min-height: 46px; margin: 24px 0 12px; border-bottom: 3px solid var(--chart-line); font-size: 21px; color: #111; }
.percentile-chart .percentile-group:first-child { margin-top: 0; }
.percentile-group svg { width: 32px; height: 32px; flex-shrink: 0; stroke-width: 2.5; }
.percentile-group-info { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; margin-left: auto; font-size: 11px; line-height: 1.4; font-weight: 400; color: #52676b; }
.percentile-exposure { font-size: 13px; color: #314b51; font-weight: 700; font-variant-numeric: tabular-nums; }
.percentile-row, .percentile-scale { display: grid; grid-template-columns: var(--label-width) minmax(0,1fr) var(--actual-width); column-gap: var(--chart-gap); align-items: center; }
.percentile-scale { height: 36px; }
.percentile-scale > div { grid-column: 2; position: relative; height: 100%; font-family: 'Arial Narrow',Arial,sans-serif; font-size: 14px; }
.percentile-scale span { position: absolute; left: 0; transform: translateX(-50%); color: #416eaa; }
.percentile-scale span:nth-child(2) { left: 50%; color: #6e979d; }
.percentile-scale span:last-child { left: 100%; color: #c42c36; }
.percentile-scale span::after { content: ''; display: block; width: 0; height: 0; margin: 3px auto 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-bottom: 7px solid currentColor; }
.percentile-row { min-height: 38px; }
.percentile-label, .percentile-actual { height: 100%; min-width: 0; padding: 5px 0; border: 0; border-bottom: 1px dashed var(--chart-line); border-radius: 0; background: transparent; color: #425e66; text-align: right; font: inherit; font-size: 16px; cursor: pointer; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.percentile-label { line-height: 1.25; }
.percentile-label sup { font-size: 10px; }
.percentile-actual { white-space: nowrap; }
.percentile-label:hover, .percentile-actual:hover { color: #111; }
.percentile-label:focus-visible, .percentile-actual:focus-visible { outline: 2px solid var(--ui-accent); outline-offset: 2px; }
.percentile-row:has(+ .percentile-group) > button, .percentile-row:last-child > button { border-bottom-color: transparent; }
.percentile-track { height: 32px; position: relative; background: linear-gradient(#c9dfe1,#c9dfe1) center / 100% 8px no-repeat; }
.percentile-track::after { content: ''; position: absolute; inset: -3px 0; border-left: 1px solid #bdd7d780; border-right: 1px solid #bdd7d780; background: linear-gradient(#bdd7d780,#bdd7d780) center / 2px 100% no-repeat; pointer-events: none; }
.percentile-fill { position: absolute; left: 0; height: 100%; background: var(--rank-color); }
.percentile-marker { position: absolute; z-index: 1; top: -1px; display: grid; place-items: center; height: 34px; width: 34px; box-sizing: border-box; border: 2px solid #fff; border-radius: 50%; background: var(--rank-color); transform: translateX(-50%); color: #fff; font: 700 16px/1 Arial,sans-serif; text-shadow: 0 1px 2px #243e4c99; }
.percentile-unavailable { display: grid; place-items: center; height: 100%; position: relative; z-index: 1; color: #52676b; }
#player-percentile-samples > div, .player-supplementary > div { padding: 8px 0; border-bottom: 1px solid var(--ui-line); }
#player-percentile-samples dt, .player-supplementary dt { font-weight: 700; }
#player-percentile-samples dd, .player-supplementary dd { margin: 4px 0 0; overflow-wrap: anywhere; }
.player-supplementary { font-size: 12px; line-height: 1.7; }
.contact-distribution { display: flex; width: 100%; height: 24px; overflow: hidden; margin: 20px 0 8px; }
.contact-ground { --contact-color: #087e75; }
.contact-fly { --contact-color: #597ead; }
.contact-line { --contact-color: #b88528; }
.contact-distribution > span { background: var(--contact-color); }
.contact-legend { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px; }
.contact-legend > div { border-bottom: 3px solid var(--contact-color); }
.player-record-section h4 { margin: 20px 0 8px; }
.player-record-empty { color: var(--ui-muted); font-size: 13px; padding: 20px 0; line-height: 1.8; }
.player-trend-scroll { width: 100%; overflow-x: auto; margin: 16px 0; }
.player-trend-chart { display: block; width: 100%; height: 260px; background: #fff; }
.trend-grid { stroke: #dbe5e2; stroke-width: 1; }
.trend-label { fill: #586d67; font: 11px Arial,sans-serif; }
.trend-line { fill: none; stroke: #087e75; stroke-width: 2.5; stroke-linejoin: round; }
.trend-point { fill: #087e75; stroke: #fff; stroke-width: 2; cursor: pointer; }
.trend-point.selected { fill: #bd4653; }
.trend-point:focus-visible { outline: 2px solid #bd4653; }
.player-trend-point-info { display: flex; flex-wrap: wrap; gap: 8px 18px; min-height: 40px; padding: 10px 0; border-block: 1px solid var(--ui-line); font-size: 12px; }
.player-history-details { margin-top: 16px; font-size: 12px; }
.player-history-details .table-responsive { max-height: 300px; margin-top: 12px; }
@media(max-width:700px) {
    .player-record-tabs [role="tab"] { font-size: 13px; }
    .player-ability-grid { gap: 12px 16px; }
    .player-ability-stat dd { gap: 6px; }
    .player-position-aptitudes { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px 16px; }
    .player-pitch-compass { gap: 12px 10px; }
    .player-pitch-direction li { font-size: 12px; }
    body:not(.start-mode) .player-pitch-direction h4 { font-size: 11px; gap: 3px; }
    .percentile-chart { --label-width: 106px; --actual-width: 53px; --chart-gap: 17px; padding: 16px 10px 20px; }
    body:not(.start-mode) #player-percentile-title { font-size: 19px; }
    body:not(.start-mode) .percentile-chart .percentile-group { font-size: 18px; }
    .percentile-group-info { font-size: 10px; }
    .percentile-exposure { font-size: 11px; }
    .percentile-label, .percentile-actual { font-size: 12px; }
    .percentile-scale > div { font-size: 9px; }
    .percentile-marker { width: 28px; height: 28px; font-size: 12px; }
    .percentile-track { height: 26px; }
    .percentile-row { min-height: 33px; }
    .contact-legend { gap: 16px; }
    .player-record-section-heading h3 > span { display: block; margin: 4px 0 0; }
}
@media(max-width:400px) {
    .percentile-chart { --label-width: 72px; --actual-width: 46px; --chart-gap: 15px; padding-inline: 8px; }
    .percentile-label, .percentile-actual { font-size: 11px; }
    .percentile-scale > div { font-size: 8px; }
}
