/* The site's one stylesheet: control-room's plainness (its tokens, headings on the paper over white sheets, half-pixel
   rules) in one face, Inter. */
:root {
  --paper: #FAF9F5; --raised: #FFFFFF; --sunk: #F5F4ED; --rule: #DDDCD6; --rule-strong: #BDBCB6;
  --ink: #141413; --ink-2: #3D3D3A; --ink-muted: #5E5D59; --accent: #C6613F; --link: #A9502F; --hover: rgba(115, 114, 108, 0.10);
  --font: Inter, -apple-system, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.45 var(--font); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
a { color: var(--link); font-weight: 500; text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header: the site's name, the two pages as buttons, and the Player search beside them. */
header.site { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 0.5px solid var(--rule-strong); }
header.site .in { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 32px; min-height: 60px; }
header.site .brand { font-size: 30px; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; margin-right: auto; }
header.site .brand a { color: var(--ink); font-weight: inherit; }
header.site .brand a:hover { text-decoration: none; }
header.site nav { display: flex; gap: 8px; }
header.site nav a { padding: 8px 16px; border: 0.5px solid var(--rule-strong); border-radius: 8px; background: var(--raised); color: var(--ink); font-weight: 600; }
header.site nav a:hover { background: var(--sunk); text-decoration: none; }
header.site nav a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
header.site .search { width: 300px; }
.search { position: relative; }
.search input { width: 100%; padding: 8px 12px; border: 0.5px solid var(--rule-strong); border-radius: 8px; background: var(--raised); color: var(--ink); font: inherit; outline: none; }
.search input:focus { border-color: var(--ink-muted); }
.search ul { margin: 6px 0 0; padding: 4px 0; list-style: none; background: var(--raised); border: 0.5px solid var(--rule-strong); border-radius: 8px; color: var(--ink-muted); font-size: 14px; }
.search ul:empty { display: none; }
.search li { padding: 6px 12px; }
.search li a { font-size: 16px; }
.search li:hover { background: var(--hover); }
/* The site search opens over the page; the compare search's list stays in the pane, every result in view. */
header .search ul { position: absolute; z-index: 30; top: 100%; left: 0; right: 0; max-height: 70vh; overflow-y: auto; box-shadow: 0 8px 24px rgba(20, 20, 19, 0.10); }

main { padding: 24px 32px 48px; }
/* The footer: how to reach the owner, and the sister site. */
footer.site span { white-space: nowrap; }
footer.site { border-top: 0.5px solid var(--rule-strong); padding: 16px 32px 32px; font-size: 14px; color: var(--ink-muted); }
main > h1, .card-head h1 { font-size: 26px; line-height: 1.15; font-weight: 650; letter-spacing: -0.015em; margin-bottom: 16px; }
.card-head { margin-bottom: 20px; }
.card-head h1 { margin-bottom: 4px; }
.card-head h1 .standing { margin-left: 0.5em; font-weight: 500; color: var(--ink-muted); white-space: nowrap; }
#usernames { color: var(--ink-muted); }

/* Headings sit on the paper; what they head sits in a white sheet. */
.panel { margin-bottom: 32px; }
.panel h2 { font-size: 20px; line-height: 1.3; font-weight: 650; margin-bottom: 10px; }
/* A plot's sheet is a wrapper: Plotly sizes itself from its own box, so that box carries no padding or border. */
.scroll, .plot { background: var(--raised); border: 0.5px solid var(--rule-strong); border-radius: 12px; }
.scroll { overflow-x: auto; }
.plot { padding: 12px 8px 4px; }
.note, #compare-missing { margin-top: 8px; font-size: 14px; color: var(--ink-muted); }

.formats { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 20px; }
.formats button, .formats a { padding: 7px 14px; border: 0; border-radius: 8px; background: none; color: var(--ink-muted); font: inherit; font-weight: 500; cursor: pointer; }
.formats button:hover, .formats a:hover { color: var(--ink); background: var(--hover); text-decoration: none; }
.formats button[aria-pressed="true"], .formats a[aria-current="true"] { color: var(--ink); background: var(--hover); box-shadow: inset 0 0 0 0.5px var(--rule-strong); }

/* Every table: centred, one header style, one cell style. */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: center; vertical-align: middle; }
th { padding: 8px 6px; font-size: 14px; font-weight: 600; color: var(--ink); border-bottom: 0.5px solid var(--rule-strong); }
td { padding: 7px 6px; color: var(--ink-2); border-bottom: 0.5px solid var(--rule); }
td .whole, th .whole { white-space: nowrap; }
td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
tbody tr:last-child > td { border-bottom: 0; }
/* Every row tints under the pointer, so it reads straight across; a card row's open rounds keep their own shade. */
:where(tbody tr:not(.rounds)):hover > td { background: var(--hover); }
tr.global td { color: var(--ink); font-weight: 650; }
table.sortable th { cursor: pointer; user-select: none; white-space: nowrap; }
table.sortable th:hover { background: var(--hover); }
table.sortable th[aria-sort="ascending"]::after { content: " ↑"; }
table.sortable th[aria-sort="descending"]::after { content: " ↓"; }

/* Player card: rows that open their rounds. */
tr.rc { cursor: pointer; }
/* A chevron sized to the text, pointing right, turning down once the row is open. */
tr.rc td:first-child::before { content: ""; display: inline-block; width: 0.42em; height: 0.42em; margin: 0 0.6em 0.12em 0;
  border-right: 2px solid var(--ink-muted); border-bottom: 2px solid var(--ink-muted); transform: rotate(-45deg); transition: transform 150ms; }
tr.rc:hover td:first-child::before { border-color: var(--ink); }
tr.rc.open td:first-child::before { transform: rotate(45deg); margin-bottom: 0.25em; }
tr.rc.open > td { background: var(--sunk); border-bottom-color: transparent; }
tr.rounds > td { background: var(--sunk); padding: 0 16px 14px; }
tr.rounds table { background: var(--raised); border-radius: 8px; }

/* Compare Players beside the card: a narrow column until a Player is compared, then half the page. Under 1440px
   half the page is too narrow for the card's tables, so a comparison goes under the card instead. */
.card-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 32px; align-items: start; }
@media (min-width: 1100px) {
  .card-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .compare-pane { padding-left: 32px; border-left: 0.5px solid var(--rule); }
  .card-layout:has(#compared:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
  .card-layout:has(#compared:not([hidden])) .compare-pane { padding-left: 0; border-left: 0; }
}
@media (min-width: 1440px) {
  .card-layout:has(#compared:not([hidden])) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .card-layout:has(#compared:not([hidden])) .compare-pane { padding-left: 32px; border-left: 0.5px solid var(--rule); }
}
.picker { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.compare-search { width: min(320px, 100%); }
.chip { display: inline-flex; align-items: center; padding: 6px 4px 6px 12px; border-radius: 8px; background: var(--hover); color: var(--ink); font-weight: 500; }
.chip a { padding: 0 6px; color: var(--ink-muted); }
#compared { margin-top: 16px; }
/* The specific Matches, boxed apart from the overall comparison above them. */
.matches { margin-top: 20px; padding: 4px 16px 16px; background: var(--sunk); border: 0.5px solid var(--rule); border-radius: 12px; }
.matches h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; margin: 14px 0 8px; font-size: 17px; font-weight: 650; }
.matches .record-pill { margin-left: 6px; padding: 2px 8px; border-radius: 6px; background: var(--raised); border: 0.5px solid var(--rule-strong); font-size: 15px; }

/* Overview: two columns, 7 to 5, stacked under 1100px. The two tables in a row share their row heights, so each row
   reads straight across, and their cells don't wrap. */
.two { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 0 32px; align-items: start; }
@media (max-width: 1100px) { .two { grid-template-columns: minmax(0, 1fr); } }
.paired th { height: 56px; }
.paired td { height: 38px; white-space: nowrap; }
/* Field Size as its number with a bar to scale; the field by Experience as a full-width stacked bar. */
td.bar { width: 26%; }
.size { display: flex; align-items: center; gap: 8px; }
.size span { min-width: 2.2em; text-align: right; font-variant-numeric: tabular-nums; }
.size i { display: block; height: 14px; background: #C9C7BE; border: 0.5px solid var(--ink); border-radius: 2px; }
.stack { display: flex; height: 14px; border-radius: 2px; overflow: hidden; }
.stack i { display: block; height: 100%; border-right: 1px solid #fff; }
.stack i:last-child { border-right: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 10px; font-size: 14px; color: var(--ink-2); }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; border-radius: 2px; background: var(--swatch); }

/* The pointer label: whatever carries a data-tip names itself under the pointer straight away. */
.tip { position: fixed; z-index: 40; pointer-events: none; padding: 6px 10px; background: var(--raised); border: 0.5px solid var(--rule-strong);
  border-radius: 6px; color: var(--ink); font-size: 14px; white-space: nowrap; box-shadow: 0 4px 12px rgba(20, 20, 19, 0.10); }

@media (max-width: 820px) {
  header.site .in { padding: 10px 16px; }
  header.site .brand { width: 100%; font-size: 24px; }
  header.site .search { flex: 1 1 200px; width: auto; }
  main { padding: 16px 16px 48px; }
  footer.site { padding: 16px 16px 32px; }
  /* On a phone the Rating plot keeps a readable width and scrolls inside its sheet, as a wide table does. */
  .rating-plot { overflow-x: auto; }
  #against-field { min-width: 600px; }
}
