:root { color-scheme: light; --ink: #142c3f; --muted: #586a76; --teal: #00796c; --pale: #e7f2ee; --line: #dce3e5; --paper: #f6f7f4; --orange: #b2671e; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
a { color: var(--teal); text-underline-offset: .2em; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button, .button { border: 1px solid var(--line); border-radius: 5px; padding: .55rem .9rem; background: white; color: var(--ink); text-decoration: none; }
button:hover, .button:hover { border-color: var(--teal); background: #f0f8f5; }
button:disabled { opacity: .4; cursor: default; }
:focus-visible { outline: 3px solid #5cae9e; outline-offset: 3px; }
.primary { background: var(--ink); color: white; border-color: var(--ink); }
.primary:hover { background: #244c64; color: white; }
header { border-bottom: 1px solid var(--line); background: white; }
.nav { max-width: 1280px; padding: 19px 32px; margin: auto; display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.brand { text-decoration: none; color: var(--ink); font-weight: 750; letter-spacing: -.4px; white-space: nowrap; }
nav { display: flex; gap: 26px; }
nav a { color: var(--muted); font-size: 14px; text-decoration: none; padding: 4px 0; }
nav a[aria-current='page'] { color: var(--teal); border-bottom: 2px solid var(--teal); font-weight: 650; }
main { max-width: 1280px; margin: auto; padding: 40px 32px 64px; }
h1, h2, h3 { line-height: 1.18; letter-spacing: -.025em; }
h1 { font-size: clamp(28px, 3vw, 36px); margin: 0 0 16px; font-weight: 720; }
h2 { font-size: 27px; margin: 44px 0 16px; }
h3 { font-size: 19px; margin: 28px 0 10px; }
p { margin: 0 0 18px; }
.intro { max-width: 740px; font-size: 18px; color: var(--muted); line-height: 1.6; }
body[data-page='rankings'] .intro { font-size: 16px; max-width: none; margin-bottom: 24px; }
.filters { display: grid; grid-template-columns: 1.05fr 1fr 1fr 1.6fr; gap: 16px; padding: 24px; background: white; border: 1px solid var(--line); border-radius: 8px 8px 0 0; }
label { display: block; color: var(--muted); font-size: 12px; font-weight: 650; }
input:not([type='range']):not([type='checkbox']), select { display: block; width: 100%; margin-top: 6px; min-height: 40px; padding: 8px 10px; color: var(--ink); background: white; border: 1px solid #becbd1; border-radius: 4px; font-size: 14px; }
.filters input, .filters select, .ranking-tools input, .ranking-tools select { height: 40px; }
.filters select, .ranking-tools select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%23586a76' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 12px; }
.filters select:focus, .ranking-tools select:focus, #minimum:focus { outline: none; }
.filters select:focus-visible, .ranking-tools select:focus-visible, #minimum:focus-visible { outline: 2px solid var(--muted); outline-offset: 2px; }
#search:focus { border-color: var(--teal); outline: 2px solid #5cae9e; outline-offset: 2px; }
.ranking-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; padding: 16px 24px; background: #fcfdfb; border: 1px solid var(--line); border-top: 0; }
.ranking-tools label { min-width: 140px; }
.ranking-tools .exposure-control { min-width: 100px; max-width: 110px; white-space: nowrap; }
.ranking-tools .download { margin-left: auto; font-size: 13px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-top: 0; background: white; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: 14px; font-variant-numeric: tabular-nums; }
th { font-size: 11px; letter-spacing: .4px; text-transform: uppercase; text-align: right; background: #eef2f2; color: var(--muted); padding: 13px 12px; border-bottom: 1px solid var(--line); }
th button { padding: 0; background: transparent; border: 0; font: inherit; border-radius: 0; }
th[aria-sort] button { color: var(--teal); }
th[aria-sort='descending'] button::after { content: '↓'; }
th[aria-sort='ascending'] button::after { content: '↑'; }
th:first-child, td:first-child { text-align: center; }
th:nth-child(2), td:nth-child(2), th:nth-child(3), td:nth-child(3) { text-align: left; }
td { padding: 12px; border-bottom: 1px solid #edf0f0; text-align: right; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f6faf8; }
td.sorted { background: #f2f8f5; font-weight: 700; color: #0d584f; }
#rankings { table-layout: fixed; min-width: 1100px; }
#rankings .numeric-column { width: calc(73% / 7); }
#rankings .player-column { width: 20%; }
#rankings .team-column { width: 7%; }
#rankings th, #rankings td { padding: 12px 8px; }
#rankings th { white-space: nowrap; text-transform: none; letter-spacing: 0; font-size: 12px; line-height: 1.4; }
#rankings th button { position: relative; padding-right: 12px; text-align: inherit; max-width: 100%; }
#rankings th button::after { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
#rankings .team { white-space: normal; overflow-wrap: anywhere; }
.player-link { color: var(--ink); font-weight: 650; border: 0; padding: 0; background: transparent; text-align: left; }
.player-link:hover { color: var(--teal); background: transparent; text-decoration: underline; }
.team { font-size: 11px; letter-spacing: .5px; color: var(--muted); }
.table-bottom { display: flex; justify-content: flex-end; align-items: center; margin: 16px 0 24px; color: var(--muted); font-size: 13px; }
.pager { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.pager button { padding: 3px 10px; }
.notes { color: var(--muted); font-size: 13px; max-width: 940px; }
.notes p { margin-bottom: 8px; }
footer { border-top: 1px solid var(--line); padding: 24px 32px; color: var(--muted); font-size: 12px; }
.footer-inner { max-width: 1216px; margin: auto; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; }
.reading { max-width: 940px; }
.reading .intro { max-width: 800px; }
.reading p, .reading li { line-height: 1.75; }
.reading li { margin: 7px 0; }
.reading figure { margin: 26px 0 38px; background: white; border: 1px solid var(--line); border-radius: 6px; padding: 20px; }
.reading figure img { display: block; width: 100%; height: auto; }
figcaption { color: var(--muted); font-size: 13px; margin-top: 15px; }
.equation { padding: 18px; border-left: 2px solid var(--teal); background: white; font: 18px/1.8 Georgia, serif; text-align: center; overflow-x: auto; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 28px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 24px 0; }
.stat-row strong { font-size: 32px; display: block; letter-spacing: -1px; line-height: 1.4; }
.stat-row span { display: block; font-size: 13px; color: var(--muted); }
.paper-links { display: flex; flex-wrap: wrap; gap: 12px; margin: 25px 0; }
.compact th, .compact td { white-space: normal; text-transform: none; letter-spacing: 0; text-align: left; font-size: 13px; }
.compact th:first-child, .compact td:first-child { width: auto; }
details { border-top: 1px solid var(--line); padding: 18px 0; }
summary { cursor: pointer; font-weight: 650; }
details > p, details > div { margin-top: 14px; }
.loading, .error { padding: 36px 20px; text-align: center; color: var(--muted); }
.error { color: #9d3d32; }
[hidden] { display: none !important; }
.ranking-tools .exposure-control[hidden] { display: block !important; visibility: hidden; }
dialog { width: min(1180px, calc(100% - 36px)); max-width: none; max-height: calc(100dvh - 40px); border: 0; padding: 0; border-radius: 10px; color: var(--ink); box-shadow: 0 20px 80px #142c3f55; }
dialog::backdrop { background: #0a1b29b8; }
.dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 18px; padding: 22px 26px 16px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 0 0 5px; font-size: 26px; }
.dialog-head p { font-size: 13px; color: var(--muted); margin: 0; }
.close { font-size: 22px; line-height: 1; padding: 7px 11px; }
.explorer { display: grid; grid-template-columns: 300px 1fr; min-height: 480px; }
.goal-list { max-height: 650px; overflow: auto; border-right: 1px solid var(--line); padding: 10px; }
.goal-item { display: block; width: 100%; text-align: left; border: 0; padding: 12px; font-size: 13px; margin-bottom: 4px; }
.goal-item[aria-pressed='true'] { background: var(--pale); box-shadow: inset 3px 0 var(--teal); }
.goal-item strong { display: block; font-size: 14px; margin-bottom: 4px; }
.goal-item span { display: block; color: var(--muted); }
.badge { display: inline-block !important; border-radius: 3px; font-size: 10px; padding: 1px 5px; background: #e3efea; color: #136657 !important; margin-top: 5px; font-weight: 650; }
.badge.broad { background: #fcf0da; color: #92551c !important; }
.replay { padding: 18px 24px 24px; min-width: 0; }
.replay h3 { font-size: 17px; margin: 0 0 2px; }
.replay-subtitle { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.canvas-frame { background: #f8faf9; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
canvas { display: block; width: 100%; aspect-ratio: 1.55; }
.controls { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.controls button { min-width: 64px; padding: 5px 8px; font-size: 13px; }
.controls input[type='range'] { flex: 1; min-width: 40px; accent-color: var(--teal); }
.controls select { width: 72px; min-height: 32px; margin: 0; padding: 4px; font-size: 12px; }
.replay-options { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin-top: 12px; }
.replay-options label { font-size: 12px; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.replay-time { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 11px; color: var(--muted); margin: 12px 0 9px; }
.legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; background: var(--teal); }
.legend .selected { background: var(--orange); }
.legend .defender { background: #85959f; }
.legend .puck { background: #101b23; }
.replay-caption { font-size: 11px; color: var(--muted); line-height: 1.6; margin-bottom: 10px; }
.replay-links { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12px; }
.example-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0; }
.example-buttons button { text-align: left; font-size: 14px; }
.skip { position: absolute; left: 15px; top: -100px; background: white; padding: 8px; z-index: 20; }
.skip:focus { top: 10px; }
@media (max-width: 800px) {
  .nav { padding: 16px 20px; flex-wrap: wrap; gap: 10px; }
  nav { gap: 22px; }
  main { padding: 30px 20px 45px; }
  .filters { grid-template-columns: 1fr 1fr; padding: 18px; gap: 14px; }
  .ranking-tools { padding: 15px 18px; gap: 12px; }
  .ranking-tools label { min-width: 130px; flex: 1; }
  .ranking-tools .download { margin-left: 0; }
  .explorer { grid-template-columns: 1fr; }
  .goal-list { max-height: 190px; border-right: 0; border-bottom: 1px solid var(--line); display: flex; gap: 5px; overflow-x: auto; }
  .goal-item { min-width: 220px; max-width: 260px; }
  .replay { padding: 16px; }
  .dialog-head { padding: 18px; }
  dialog { width: calc(100% - 16px); max-height: calc(100dvh - 20px); }
  .stat-row { gap: 15px; }
  .stat-row strong { font-size: 26px; }
}
@media (max-width: 480px) {
  h1 { font-size: 28px; }
  .intro { font-size: 16px; }
  .nav { gap: 12px; }
  nav { width: 100%; }
  .filters { gap: 12px; padding: 14px; }
  .filters label:last-child { grid-column: 1 / -1; }
  .ranking-tools .metric-control { flex-basis: 100%; }
  th, td { padding: 12px 10px; }
  #rankings th:nth-child(2), #rankings td:nth-child(2) { position: sticky; left: 0; background: white; z-index: 1; }
  #rankings th:nth-child(2) { background: #eef2f2; }
  #rankings td:nth-child(2).sorted { background: #f2f8f5; }
  .stat-row { grid-template-columns: 1fr; gap: 14px; }
  .stat-row strong { display: inline; margin-right: 12px; }
  .stat-row span { display: inline; }
  .reading figure { padding: 8px; }
  canvas { aspect-ratio: 1.12; }
  .controls { gap: 6px; }
}
