:root {
  color-scheme: light;
  --green-950: #082d24;
  --green-900: #0d3b2f;
  --green-800: #145443;
  --green-700: #1f6a55;
  --green-100: #dfece6;
  --ivory: #f4efe4;
  --paper: #fffdf7;
  --paper-muted: #f8f4ea;
  --brass: #a87828;
  --brass-light: #e5c77e;
  --ink: #17211d;
  --muted: #66716c;
  --line: #d8d4c8;
  --danger: #a43c32;
  --positive: #1d7454;
  --negative: #a43c32;
  --shadow: 0 12px 34px rgb(20 48 38 / 9%);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--ivory); line-height: 1.55; }
a { color: var(--green-800); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--brass-light); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

.site-header {
  position: sticky; top: 0; z-index: 50; min-height: 72px; padding: 0 clamp(18px, 4vw, 64px);
  display: grid; grid-template-columns: 1fr minmax(160px, 240px) auto; align-items: center; gap: 20px;
  color: white; background: rgb(8 45 36 / 96%); border-bottom: 1px solid rgb(255 255 255 / 12%); backdrop-filter: blur(12px);
}
.site-header > *, .hero > *, .ranking-layout > * { min-width: 0; }
.header-brand-group { display: flex; align-items: center; gap: 48px; }
.brand { display: inline-flex; align-items: center; gap: 12px; color: white; text-decoration: none; width: max-content; }
.brand-mark { flex: 0 0 auto; width: 38px; height: 38px; background: url("snooker-rating-logo-badge.svg?v=__SITE_VERSION__") center / contain no-repeat; }
.brand strong, .brand small { display: block; }
.brand strong { font-family: Georgia, "Microsoft YaHei", serif; font-size: 18px; letter-spacing: .03em; }
.brand small { margin-top: -2px; color: #b8d0c6; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.site-header nav { position: absolute; left: 50%; display: flex; height: 72px; transform: translateX(-50%); }
.site-header nav a { display: grid; place-items: center; padding: 0 18px; color: #dce9e3; text-decoration: none; border-bottom: 3px solid transparent; }
.site-header nav a:hover, .site-header nav a.is-current { color: white; border-bottom-color: var(--brass-light); }
.player-search { position: relative; grid-column: 2; justify-self: end; width: min(100%, 290px); }
.player-search input, .table-tools input, .history-controls input, .match-filters input, .match-filters select, .year-navigation select {
  width: 100%; min-height: 40px; padding: 8px 12px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 7px;
}
.player-search input { color: white; background: rgb(255 255 255 / 9%); border-color: rgb(255 255 255 / 20%); }
.player-search input::placeholder { color: #bdd0c7; }
.language-switcher { display: flex; grid-column: 3; justify-self: end; border: 1px solid rgb(255 255 255 / 24%); border-radius: 6px; overflow: hidden; }
.wechat-follow { position: relative; flex: 0 0 auto; }
.wechat-follow summary { display: block; padding: 10px 0; cursor: pointer; list-style: none; }
.wechat-follow summary::-webkit-details-marker { display: none; }
.wechat-follow summary:focus-visible { outline: 3px solid var(--brass-light); outline-offset: 2px; }
.wechat-follow summary img { display: block; width: 210px; height: auto; }
.wechat-follow-card { position: absolute; left: 0; top: 100%; width: min(560px, calc(100vw - 32px)); padding: 14px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.wechat-follow-card a, .wechat-follow-card img { display: block; width: 100%; }
.language-switcher button { min-width: 60px; min-height: 34px; padding: 5px 9px; color: #dce9e3; background: transparent; border: 0; border-right: 1px solid rgb(255 255 255 / 20%); font-size: 12px; }
.language-switcher button:last-child { border-right: 0; }
.language-switcher button:hover, .language-switcher button.is-active { color: var(--green-950); background: var(--brass-light); }
.search-results { position: absolute; top: calc(100% + 8px); right: 0; width: min(360px, 90vw); padding: 7px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.search-results a { display: flex; justify-content: space-between; gap: 20px; padding: 9px 10px; color: var(--ink); text-decoration: none; border-radius: 6px; }
.search-results a:hover { background: var(--green-100); }
.search-results strong, .search-results small { display: block; }
.search-results small { color: var(--muted); white-space: nowrap; }

main { width: min(1680px, 100%); margin: 0 auto; padding: clamp(24px, 4vw, 64px); }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 40px; margin-bottom: 34px; padding: 18px 0 30px; border-bottom: 1px solid #c9c4b7; }
.compact-hero { padding-top: 6px; }
.hero h1 { max-width: 900px; margin: 0; color: var(--green-950); font-family: Georgia, "Microsoft YaHei", serif; font-size: clamp(34px, 5vw, 66px); font-weight: 600; line-height: 1.06; letter-spacing: -.025em; }
.hero h1, .hero p { overflow-wrap: anywhere; }
.compact-hero h1 { font-size: clamp(32px, 4vw, 54px); }
.hero p:not(.eyebrow) { max-width: 760px; margin: 15px 0 0; color: var(--muted); font-size: 17px; }
.eyebrow { margin: 0 0 7px; color: var(--brass); font-size: 11px; font-weight: 800; letter-spacing: .17em; text-transform: uppercase; }
.run-facts { display: grid; grid-template-columns: auto auto; min-width: 310px; margin: 0; font-size: 13px; }
.run-facts dt, .run-facts dd { margin: 0; padding: 7px 10px; border-bottom: 1px solid #d1ccbf; }
.run-facts dt { color: var(--muted); }
.run-facts dd { min-width: 0; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; font-weight: 650; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 22px 15px; border-bottom: 1px solid var(--line); }
.panel-heading h2, .unavailable-history h2 { margin: 0; color: var(--green-950); font-family: Georgia, "Microsoft YaHei", serif; font-size: 25px; }
.result-count { color: var(--muted); font-size: 13px; white-space: nowrap; }
.message { padding: 14px 18px; margin-bottom: 24px; border-radius: 8px; }
.error-message { color: #70251e; background: #f9e2dd; border: 1px solid #e4aca4; }
.breadcrumbs { display: flex; gap: 9px; margin: -10px 0 18px; color: var(--muted); font-size: 13px; }

.ranking-layout { display: grid; grid-template-columns: minmax(560px, .92fr) minmax(560px, 1.08fr); gap: 24px; align-items: start; }
.stacked-ranking-layout { display: flex; flex-direction: column; align-items: stretch; }
.stacked-ranking-layout .chart-panel { order: -1; position: static; width: 100%; }
.chart-panel { position: sticky; top: 96px; overflow: hidden; }
.chart-heading { align-items: flex-start; }
.table-tools, .selection-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 20px; background: var(--paper-muted); border-bottom: 1px solid var(--line); }
.table-tools label { flex: 1; }
.quiet-button, .pagination button, .range-switcher button {
  min-height: 34px; padding: 6px 11px; color: var(--green-800); background: transparent; border: 1px solid #b8c5bf; border-radius: 6px; text-decoration: none;
}
.quiet-button:hover, .pagination button:hover:not(:disabled), .range-switcher button:hover, .range-switcher button.is-active { color: white; background: var(--green-800); border-color: var(--green-800); }
[aria-disabled="true"] { opacity: .42; pointer-events: none; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th { position: sticky; top: 0; z-index: 2; color: #425049; background: #eee9dc; text-align: left; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
th, td { padding: 10px 11px; border-bottom: 1px solid #e4e0d5; white-space: nowrap; }
th button { padding: 0; color: inherit; background: transparent; border: 0; font: inherit; text-transform: inherit; }
tbody tr:hover { background: #f1f6f2; }
.numeric { text-align: right; }
.compare-column { width: 52px; text-align: center; }
.compare-column input { width: 17px; height: 17px; accent-color: var(--green-700); }
.rank-cell { color: var(--muted); font-weight: 700; }
.rating-cell { color: var(--green-900); font-size: 14px; font-weight: 800; }
.stacked-ranking-layout .ranking-table { min-width: 900px; table-layout: fixed; }
.stacked-ranking-layout .ranking-col-compare { width: 3%; }
.stacked-ranking-layout .ranking-col-rank { width: 8%; }
.stacked-ranking-layout .ranking-col-player { width: 27%; }
.stacked-ranking-layout .ranking-col-nationality { width: 22%; }
.stacked-ranking-layout .ranking-col-rating { width: 16%; }
.stacked-ranking-layout .ranking-col-last-played { width: 11%; }
.stacked-ranking-layout .ranking-col-matches { width: 13%; }
.stacked-ranking-layout .ranking-table :is(th, td):nth-child(5) { padding-left: 80px; text-align: left; }
.uncertainty-cell { color: var(--muted); }
.player-link { color: var(--ink); font-weight: 700; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 58px; padding: 10px; }
.pagination button:disabled { cursor: default; opacity: .35; }
.range-switcher { display: flex; }
.range-switcher button { border-radius: 0; border-right-width: 0; font-size: 12px; }
.range-switcher button:first-child { border-radius: 6px 0 0 6px; }
.range-switcher button:last-child { border-radius: 0 6px 6px 0; border-right-width: 1px; }
.selection-actions { color: var(--muted); font-size: 13px; }
.selection-actions .quiet-button:first-of-type { margin-left: auto; }
.selected-players { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 7px 12px; min-height: 50px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.player-chip { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; padding: 4px 7px; color: var(--green-900); background: transparent; border: 0; border-radius: 5px; font-size: 12px; }
.player-chip:hover, .player-chip:focus-visible { background: var(--green-100); }
.player-chip-swatch { width: 16px; height: 3px; border-radius: 1px; }
.player-chip-remove { color: var(--muted); font-size: 15px; line-height: 1; }
.rating-chart { position: relative; min-height: 470px; padding: 8px 8px 0; background: #fffef9; }
.player-chart { min-height: 510px; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-grid line { stroke: #e3e0d7; stroke-width: 1; }
.chart-grid text { fill: #707b75; font-size: 11px; }
.rating-line { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; pointer-events: none; }
.rating-band { opacity: 0; stroke: none; pointer-events: none; }
.chart-series.is-focused .rating-band, .chart-series.is-single .rating-band { opacity: .12; }
.chart-series.is-muted { opacity: .1; }
.chart-series.is-focused .rating-line { stroke-width: 3; }
.rating-hit { fill: none; stroke: transparent; stroke-width: 18; vector-effect: non-scaling-stroke; pointer-events: stroke; cursor: crosshair; }
.chart-tooltip { position: absolute; z-index: 4; width: 220px; padding: 9px 11px; color: white; background: rgb(8 45 36 / 95%); border-radius: 7px; pointer-events: none; box-shadow: 0 7px 20px rgb(0 0 0 / 20%); }
.chart-tooltip strong, .chart-tooltip span, .chart-tooltip small { display: block; }
.chart-tooltip small { color: #bed1c8; }
.chart-empty { min-height: 430px; display: grid; place-items: center; color: var(--muted); }
.chart-note { margin: 0; padding: 10px 20px 16px; color: var(--muted); font-size: 12px; }

.history-controls { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; padding: 14px 18px; }
.history-controls label { font-weight: 700; }
.history-controls input { max-width: 420px; }
.history-controls .result-count { margin-left: auto; }
.history-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px; }
.history-card { overflow: hidden; }
.history-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; padding: 17px 19px; color: white; background: var(--green-900); }
.history-year-link { color: white; font-family: Georgia, serif; font-size: 23px; font-weight: 700; }
.history-card header span { color: #bdd1c8; font-size: 11px; }
.history-card ol { margin: 0; padding: 9px 18px 10px; list-style: none; counter-reset: ranking; }
.history-card li { display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: center; min-height: 34px; border-bottom: 1px solid #e7e2d7; }
.history-card li:last-child { border-bottom: 0; }
.history-card li a { color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-card li strong { color: var(--green-800); font-variant-numeric: tabular-nums; }
.history-rank { color: var(--brass); font-family: Georgia, serif; font-weight: 700; }
.card-action { display: block; padding: 12px 18px; text-align: right; background: var(--paper-muted); font-weight: 700; text-decoration: none; }
.unavailable-history { margin-top: 28px; padding: 24px; }
.unavailable-history li { margin: 5px 0; }
.year-navigation { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin: -10px 0 24px; padding: 12px 16px; }
.year-navigation label { display: flex; align-items: center; gap: 9px; }

.player-profile { align-items: center; }
.source-link { display: inline-block; margin-top: 14px; font-weight: 700; }
.player-facts { display: grid; grid-template-columns: repeat(2, minmax(140px, 1fr)); gap: 1px; min-width: min(520px, 100%); margin: 0; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.player-facts dt, .player-facts dd { margin: 0; padding: 10px 14px; background: var(--paper); }
.player-facts dt { color: var(--muted); font-size: 12px; }
.player-facts dd { text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }
.player-chart-panel, .match-panel { margin-top: 24px; overflow: hidden; }
.match-filters { display: grid; grid-template-columns: minmax(260px, 1fr) 160px 160px; gap: 14px; padding: 15px 20px; background: var(--paper-muted); border-bottom: 1px solid var(--line); }
.match-filters label span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; }
.match-table td strong, .match-table td small { display: block; }
.match-table td small { color: var(--muted); }
.match-result { font-weight: 850; }
.result-win, .positive { color: var(--positive); }
.result-loss, .negative { color: var(--negative); }
.score-cell { font-size: 14px; font-weight: 800; }

.h2h-selector-panel { overflow: visible; }
.h2h-selector-form {
  display: grid; grid-template-columns: minmax(240px, 1fr) auto minmax(240px, 1fr) auto; align-items: end; gap: 18px; padding: 22px;
}
.h2h-picker-field > label, .best-of-controls label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 12px; font-weight: 700; }
.h2h-player-picker { position: relative; }
.h2h-player-picker > input, .best-of-controls input { width: 100%; min-height: 42px; padding: 8px 11px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 7px; }
.h2h-picker-results { position: absolute; top: calc(100% + 6px); z-index: 30; width: 100%; max-height: 370px; padding: 6px; overflow-y: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); }
.h2h-picker-results button { display: block; width: 100%; padding: 9px 10px; color: var(--ink); background: transparent; border: 0; border-radius: 6px; text-align: left; }
.h2h-picker-results button:hover, .h2h-picker-results button.is-active { background: var(--green-100); }
.h2h-picker-results strong, .h2h-picker-results small { display: block; }
.h2h-picker-results small { margin-top: 2px; color: var(--muted); }
.h2h-picker-results p { margin: 0; padding: 12px 10px; color: var(--muted); text-align: center; }
.versus { align-self: center; padding-top: 20px; color: var(--brass); font-family: Georgia, serif; font-size: 20px; font-weight: 800; }
.primary-button { min-height: 42px; padding: 8px 18px; color: white; background: var(--green-800); border: 1px solid var(--green-800); border-radius: 7px; font-weight: 750; }
.primary-button:hover { background: var(--green-900); }
.inline-error { color: var(--danger); }
.h2h-selector-panel > .inline-error { margin: -8px 22px 18px; }
.upcoming-widget { border-top: 1px solid var(--line); background: var(--paper-muted); }
.upcoming-widget-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; padding: 20px 22px 0; }
.upcoming-widget-heading h3 { margin: 2px 0 0; color: var(--green-950); font-family: Georgia, "Microsoft YaHei", serif; font-size: 22px; }
.upcoming-introduction { margin: 7px 22px 16px; color: var(--muted); font-size: 13px; }
.upcoming-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-height: 520px; padding: 0 22px; overflow-y: auto; }
.upcoming-card { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; }
.upcoming-card > a, .upcoming-card > .upcoming-card-body { display: grid; gap: 7px; height: 100%; padding: 13px 15px; color: var(--ink); text-decoration: none; }
.upcoming-card > a:hover, .upcoming-card > a:focus-visible { background: var(--green-100); border-radius: inherit; }
.upcoming-card.is-disabled { background: var(--paper-muted); }
.upcoming-card.is-disabled .upcoming-card-body { cursor: default; }
.upcoming-card time, .upcoming-card small { color: var(--muted); font-size: 11px; }
.upcoming-matchup { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; font-size: 14px; }
.upcoming-matchup span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upcoming-matchup span:first-child { text-align: right; }
.upcoming-matchup b { color: var(--brass); font-family: Georgia, serif; font-size: 12px; }
.upcoming-source { margin: 14px 22px 0; padding: 12px 0 18px; color: var(--muted); border-top: 1px solid var(--line); font-size: 11px; }
.upcoming-source a { font-weight: 700; }
.h2h-player-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.h2h-player-cards article { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 5px 12px; padding: 14px 20px; background: var(--paper-muted); }
.h2h-player-cards h3 { margin: 0; font-size: 17px; }
.h2h-player-cards h3 a { color: var(--ink); text-decoration: none; }
.h2h-player-cards strong { color: var(--green-900); font-size: 19px; font-variant-numeric: tabular-nums; }
.h2h-player-cards small { grid-column: 2 / -1; color: var(--muted); }
.h2h-player-swatch { grid-row: 1 / 3; width: 5px; height: 38px; border-radius: 3px; }
.h2h-data-panel { margin-top: 24px; overflow: hidden; }
.h2h-ring-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding: 24px; }
.h2h-ring-card { display: grid; grid-template-columns: 1fr; align-items: center; gap: 14px; padding: 22px; background: var(--paper-muted); border: 1px solid var(--line); border-radius: 11px; }
.h2h-ring-card h3 { margin: 0; color: var(--green-950); font-family: Georgia, "Microsoft YaHei", serif; font-size: 21px; text-align: center; }
.h2h-ring { position: relative; display: grid; place-items: center; justify-self: center; width: 190px; height: 190px; border-radius: 50%; }
.h2h-ring-center { display: grid; place-items: center; align-content: center; width: 126px; height: 126px; background: var(--paper); border-radius: 50%; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 5%); }
.h2h-ring-center strong { color: var(--green-950); font-family: Georgia, serif; font-size: 35px; line-height: 1; }
.h2h-ring-center small { margin-top: 7px; color: var(--muted); }
.ring-legend { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, auto) minmax(0, 1fr); gap: 0 12px; min-width: 0; margin: 0; padding: 0; list-style: none; }
.ring-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr); align-items: center; gap: 5px 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.ring-legend li strong { grid-column: 1 / -1; }
.ring-legend-left { grid-column: 1; }
.ring-legend li.ring-legend-right { grid-column: 3; grid-template-columns: minmax(0, 1fr) 12px; text-align: right; }
.ring-legend-right .ring-legend-swatch { grid-row: 1; grid-column: 2; }
.ring-legend-right > span:nth-child(2) { grid-row: 1; grid-column: 1; }
.ring-legend li.ring-legend-draw { grid-row: 1; grid-column: 2; grid-template-columns: 12px auto; justify-content: center; min-width: 60px; text-align: center; }
.ring-legend-swatch { width: 10px; height: 10px; border-radius: 50%; }
.ring-legend li > span:nth-child(2) { min-width: 0; white-space: normal; word-break: normal; overflow-wrap: normal; }
.ring-legend strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.probability-feature { padding: 22px; }
.probability-feature > section { max-width: 980px; margin: 0 auto; }
.frame-probability-feature { background: linear-gradient(135deg, #eef6f1, #fbf7e9); border-bottom: 1px solid var(--line); }
.bo-probability-feature { border-bottom: 1px solid var(--line); }
.probability-feature h3 { margin: 0 0 12px; color: var(--green-950); font-family: Georgia, "Microsoft YaHei", serif; font-size: 22px; text-align: center; }
.frame-probability-feature h3 { font-size: 26px; }
.probability-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.probability-sides.has-draw { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.probability-sides article { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
.probability-sides article:last-child { flex-direction: row-reverse; text-align: right; }
.probability-sides .probability-draw { display: block; min-width: 100px; text-align: center; }
.probability-sides span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.probability-sides strong { font-size: clamp(28px, 4vw, 44px); font-variant-numeric: tabular-nums; line-height: 1; }
.frame-probability-feature .probability-sides strong { font-size: clamp(34px, 5vw, 54px); }
.probability-track { display: flex; height: 13px; margin-top: 14px; overflow: hidden; background: var(--line); border-radius: 999px; }
.probability-track span { display: block; min-width: 2px; }
.best-of-controls { display: grid; grid-template-columns: minmax(280px, 480px) auto 1fr; align-items: end; gap: 10px 14px; padding: 15px 20px; background: var(--paper-muted); border-bottom: 1px solid var(--line); }
.best-of-controls small { grid-column: 1; color: var(--muted); }
.best-of-controls .inline-error { grid-column: 1 / -1; }
.score-probability-grid { padding: 20px; background: var(--paper-muted); border-top: 1px solid var(--line); }
.score-probability-card { overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; }
.score-probability-card h3 { margin: 0; padding: 12px 14px; color: white; background: var(--green-900); font-family: Georgia, serif; }
.score-table-scroll { max-height: 340px; }
.score-table { min-width: 300px; }
.h2h-score-cell { text-align: center; }
.score-matchup-cell { min-width: 420px; }
.score-matchup-heading { text-align: center; }
.score-matchup { display: grid; grid-template-columns: minmax(0, 1fr) 3ch 1ch 3ch minmax(0, 1fr); align-items: baseline; column-gap: .45em; width: 100%; font-weight: 400; }
.score-matchup-player { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; }
.score-matchup-player-left { text-align: right; }
.score-matchup-player-right { text-align: left; }
.score-matchup-value { font-weight: 750; font-variant-numeric: tabular-nums; }
.score-matchup-value-left { text-align: right; }
.score-matchup-value-right { text-align: left; }
.score-matchup-separator { color: var(--muted); text-align: center; font-weight: 400; }
.empty-state { padding: 32px 20px; color: var(--muted); text-align: center; }

.site-footer { padding: 26px clamp(18px, 4vw, 64px) 40px; color: #b9cbc3; background: var(--green-950); font-size: 12px; text-align: center; }
.site-footer p { margin: 0; }
.site-footer .copyright { margin-top: 12px; color: #7f9c90; }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; }
.site-footer nav span { color: #7f9c90; }
.site-footer a { color: #e7d28a; text-decoration: none; }
.site-footer a:hover, .site-footer a:focus-visible { color: #fff2bd; text-decoration: underline; }
.mobile-chart-return { display: none; }

@media (max-width: 1480px) {
  .site-header { grid-template-columns: 1fr minmax(160px, 240px) auto; }
  .player-search { grid-column: 2; }
  .language-switcher { grid-column: 3; }
  .site-header nav { position: static; order: 3; grid-column: 1 / -1; height: 42px; justify-content: center; transform: none; }
  .site-header nav a { height: 42px; }
}

@media (max-width: 1180px) {
  .ranking-layout { grid-template-columns: 1fr; }
  .chart-panel { position: static; grid-row: 1; }
  .mobile-chart-return { position: fixed; right: 16px; bottom: 16px; z-index: 45; display: block; padding: 10px 15px; color: white; background: var(--green-800); border-radius: 999px; box-shadow: var(--shadow); text-decoration: none; }
}

@media (max-width: 900px) {
  .site-header { position: relative; grid-template-columns: minmax(0, 1fr) auto; min-height: auto; padding: 13px 16px 0; gap: 11px; }
  .brand strong { font-size: 16px; }
  .brand-mark { width: 34px; height: 34px; }
  .language-switcher button { min-width: 52px; padding-inline: 7px; }
  .player-search { grid-row: 2; grid-column: 1 / -1; justify-self: stretch; width: 100%; max-width: none; }
  .language-switcher { grid-row: 1; grid-column: 2; }
  .header-brand-group { flex-wrap: wrap; gap: 8px; }
  .wechat-follow { position: static; }
  .wechat-follow summary { padding: 0; }
  .wechat-follow summary img { width: 180px; }
  .wechat-follow-card { top: auto; left: 16px; margin-top: 0; }
  .site-header nav { grid-row: 3; grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  main { padding: 24px 14px 42px; }
  .hero { display: block; margin-bottom: 22px; }
  .hero h1 { font-size: 37px; }
  .run-facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 24px; min-width: 0; }
  .panel { border-radius: 9px; }
  .panel-heading, .chart-heading { align-items: flex-start; padding: 16px; }
  .chart-heading { flex-direction: column; }
  .range-switcher { width: 100%; }
  .range-switcher button { flex: 1; }
  .table-tools { align-items: stretch; flex-direction: column; }
  .selection-actions { flex-wrap: wrap; }
  .selection-actions .quiet-button:first-of-type { margin-left: 0; }
  .rating-chart { min-height: 360px; overflow-x: auto; }
  .chart-svg { width: 760px; max-width: none; }
  .history-controls { align-items: stretch; flex-direction: column; }
  .history-controls input { max-width: none; }
  .history-controls .result-count { margin-left: 0; }
  .history-grid { grid-template-columns: 1fr; }
  .history-card header { align-items: flex-start; flex-direction: column; gap: 2px; }
  .year-navigation { flex-wrap: wrap; }
  .year-navigation label { order: -1; width: 100%; justify-content: center; }
  .player-profile { display: block; }
  .player-facts { margin-top: 24px; grid-template-columns: 1fr 1fr; min-width: 0; }
  .match-filters { grid-template-columns: 1fr; }
  .h2h-selector-form { grid-template-columns: 1fr; }
  .upcoming-list { grid-template-columns: 1fr; max-height: 620px; padding: 0 14px; }
  .upcoming-widget-heading { padding-inline: 14px; }
  .upcoming-introduction, .upcoming-source { margin-inline: 14px; }
  .versus { justify-self: center; padding: 0; }
  .h2h-player-cards { grid-template-columns: 1fr; }
  .h2h-ring-grid { grid-template-columns: 1fr; padding: 14px; }
  .h2h-ring-card { padding: 16px; }
  .h2h-ring { width: 150px; height: 150px; }
  .h2h-ring-center { width: 98px; height: 98px; }
  .h2h-ring-center strong { font-size: 28px; }
  .best-of-controls { grid-template-columns: 1fr; align-items: stretch; }
  .best-of-controls small, .best-of-controls .inline-error { grid-column: 1; }
  .score-probability-grid { grid-template-columns: 1fr; padding: 14px; }
  th, td { padding: 9px; }
}

@media (max-width: 460px) {
  .probability-sides { gap: 14px; }
  .probability-sides.has-draw { gap: 8px; }
  .probability-sides .probability-draw { min-width: 70px; }
  .probability-sides article, .probability-sides article:last-child { display: block; }
  .probability-sides strong, .probability-sides span { display: block; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
.nationality-label { display: inline-flex; align-items: center; gap: 6px; }
.nationality-flag { flex: 0 0 auto; width: 20px; height: 15px; object-fit: contain; outline: 1px solid #c9c7c0; }
.player-profile p.player-name-en { margin: 6px 0 18px; font-size: 1.25rem; font-weight: 500; color: var(--green-950); }
