:root {
  color-scheme: dark;
  --ink: #050505;
  --ink-soft: #0d0c0a;
  --panel: #14120f;
  --panel-raised: #1d1914;
  --cream: #fff8ea;
  --muted: #c7bcaa;
  --faint: #8d8375;
  --gold: #d9b642;
  --gold-bright: #f8dc75;
  --red: #c83b32;
  --red-dark: #7c211d;
  --green: #2f8f50;
  --green-dark: #155b31;
  --line: rgba(217, 182, 66, 0.28);
  --soft-line: rgba(255, 248, 234, 0.11);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  --content: 1480px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--ink); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 5% 4%, rgba(200, 59, 50, 0.22), transparent 28rem),
    radial-gradient(circle at 94% 16%, rgba(47, 143, 80, 0.16), transparent 30rem),
    linear-gradient(180deg, #050505 0%, #0b0a08 52%, #050505 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

a { color: inherit; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button, a, input, select { touch-action: manipulation; }
[hidden] { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -90px;
  left: 16px;
  z-index: 1000;
  padding: 11px 17px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--gold-bright);
  font-weight: 900;
  text-decoration: none;
}
.skip-link:focus { top: 16px; }
:focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 3px; }

.stats-header {
  position: sticky;
  top: 0;
  z-index: 80;
  min-height: 76px;
  padding: 9px clamp(14px, 3vw, 44px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 5, 5, 0.91);
  backdrop-filter: blur(18px);
}
.stats-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.stats-brand img { width: 56px; height: 56px; object-fit: contain; }
.stats-brand span { display: grid; line-height: 1; }
.stats-brand strong { font-size: 0.96rem; letter-spacing: 0.12em; text-transform: uppercase; }
.stats-brand small { margin-top: 7px; color: var(--gold-bright); font-size: 0.72rem; font-weight: 850; letter-spacing: 0.09em; text-transform: uppercase; }
.stats-header nav { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.stats-header nav a {
  padding: 9px 14px;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-decoration: none;
}
.stats-header nav a:hover { color: var(--cream); border-color: var(--gold); }
.stats-header nav a[aria-current="page"] {
  color: var(--ink);
  border-color: var(--gold);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
}

main { position: relative; z-index: 1; }
.stats-hero {
  width: 100%;
  border-bottom: 1px solid var(--line);
  background: #030303;
}
.stats-hero > img { width: 100%; height: auto; display: block; }
.eyebrow {
  margin: 0;
  color: var(--gold-bright);
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.stats-workspace {
  width: calc(100% - clamp(8px, 1vw, 18px));
  margin: clamp(20px, 4vw, 52px) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(24, 21, 17, 0.98), rgba(7, 7, 6, 0.98));
  box-shadow: var(--shadow);
}
.workspace-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
}
.workspace-heading { padding: clamp(24px, 4vw, 44px); }
.workspace-heading h2 {
  margin: 6px 0 0;
  font-size: clamp(2rem, 4.5vw, 4.8rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}
.workspace-heading > p { max-width: 450px; margin: 0; color: var(--muted); line-height: 1.55; }

.tool-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--soft-line);
  border-bottom: 1px solid var(--soft-line);
  background: rgba(0, 0, 0, 0.28);
}
.tool-tabs button {
  min-width: 0;
  min-height: 94px;
  padding: 18px clamp(18px, 3vw, 34px);
  display: flex;
  align-items: center;
  border: 0;
  color: var(--muted);
  background: transparent;
  text-align: left;
}
.tool-tabs button + button { border-left: 1px solid var(--soft-line); }
.tool-tabs button[aria-selected="true"] { color: var(--cream); background: linear-gradient(110deg, rgba(200, 59, 50, 0.22), rgba(47, 143, 80, 0.11)); box-shadow: inset 0 -4px 0 var(--gold); }
.tool-tabs strong { font-size: clamp(1.3rem, 2.4vw, 1.7rem); line-height: 1; text-transform: uppercase; }

.tool-panel { min-width: 0; }
.leader-controls {
  padding: 20px;
  display: grid;
  grid-template-columns: auto auto minmax(115px, 0.42fr) minmax(210px, 0.9fr) auto minmax(96px, 0.34fr) auto;
  gap: 12px;
  align-items: end;
  border-bottom: 1px solid var(--soft-line);
  background: rgba(0, 0, 0, 0.24);
}
.filter-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.filter-group legend, .select-field > span, .team-search-form > label {
  display: block;
  margin: 0 0 7px;
  color: var(--gold-bright);
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--soft-line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
}
.segmented-control button {
  min-height: 44px;
  padding: 8px 13px;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
  white-space: nowrap;
}
.segmented-control button.active { color: var(--cream); background: linear-gradient(135deg, var(--red), var(--red-dark)); box-shadow: inset 0 0 0 1px rgba(217, 182, 66, 0.42); }
.select-field { min-width: 0; }
.select-field select {
  width: 100%;
  min-height: 54px;
  padding: 0 38px 0 13px;
  border: 1px solid var(--soft-line);
  border-radius: 14px;
  color: var(--cream);
  background: #0c0b09;
  font-weight: 820;
}
.share-button {
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--cream);
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  font-weight: 900;
  white-space: nowrap;
}
.share-button:hover { filter: brightness(1.1); }

.leader-summary {
  padding: 24px clamp(18px, 3vw, 36px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--soft-line);
  background: linear-gradient(90deg, rgba(200, 59, 50, 0.14), transparent 42%, rgba(47, 143, 80, 0.1));
}
.leader-summary > div { display: grid; gap: 4px; }
.leader-summary span { color: var(--muted); font-size: 0.76rem; font-weight: 850; letter-spacing: 0.09em; text-transform: uppercase; }
.leader-summary strong { font-size: clamp(1.6rem, 3vw, 2.7rem); line-height: 1; letter-spacing: -0.035em; text-transform: uppercase; }
.result-count { color: var(--gold-bright) !important; text-align: right; }

.status-region { margin: 22px; }
.status-card, .empty-state {
  padding: clamp(24px, 4vw, 46px);
  border: 1px solid rgba(217, 182, 66, 0.24);
  border-radius: 20px;
  text-align: center;
  background: radial-gradient(circle at top, rgba(217, 182, 66, 0.11), transparent 58%), rgba(0, 0, 0, 0.31);
}
.status-card strong, .empty-state strong { display: block; font-size: clamp(1.25rem, 3vw, 2rem); text-transform: uppercase; }
.status-card p, .empty-state p { max-width: 680px; margin: 8px auto 0; color: var(--muted); line-height: 1.58; }
.status-card.error { border-color: rgba(200, 59, 50, 0.64); }
.status-card .retry-button { margin-top: 18px; padding: 9px 16px; border: 1px solid var(--gold); border-radius: 999px; color: var(--cream); background: transparent; font-weight: 900; }

.leader-podium {
  padding: 4px 22px 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}
.podium-card {
  min-width: 0;
  min-height: 198px;
  position: relative;
  overflow: hidden;
  padding: 20px;
  border: 1px solid rgba(217, 182, 66, 0.22);
  border-radius: 20px;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.28));
}
.podium-card::after { content: attr(data-rank); position: absolute; right: -9px; bottom: -32px; color: rgba(255, 255, 255, 0.035); font-size: 8.5rem; font-weight: 1000; line-height: 1; }
.podium-rank { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); background: var(--gold); font-weight: 1000; }
.podium-card[data-rank="2"] .podium-rank { background: #d1d1d1; }
.podium-card[data-rank="3"] .podium-rank { background: #b97a47; }
.podium-card h3 { position: relative; z-index: 1; margin: 17px 0 4px; font-size: 1.25rem; letter-spacing: -0.02em; text-transform: uppercase; }
.podium-card p { position: relative; z-index: 1; margin: 0; color: var(--muted); font-size: 0.85rem; font-weight: 750; }
.podium-value { position: relative; z-index: 1; margin-top: 17px; display: flex; align-items: end; gap: 8px; }
.podium-value strong { color: var(--gold-bright); font-size: 2rem; line-height: 0.9; }
.podium-value span { color: var(--faint); font-size: 0.68rem; font-weight: 850; text-transform: uppercase; }
.podium-action, .row-action {
  position: relative;
  z-index: 2;
  border: 1px solid var(--gold);
  border-radius: 999px;
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  font-size: 0.73rem;
  font-weight: 950;
  white-space: nowrap;
}
.podium-action { margin-top: 18px; padding: 8px 12px; }
.row-action { padding: 8px 11px; }
.podium-action:hover, .row-action:hover { filter: brightness(1.08); }

.leader-results { padding: 0 22px 25px; overflow-x: auto; }
.stats-table { width: 100%; min-width: 850px; border-collapse: separate; border-spacing: 0 8px; }
.stats-table th { padding: 0 13px 7px; color: var(--gold-bright); font-size: 0.67rem; letter-spacing: 0.11em; text-align: left; text-transform: uppercase; }
.stats-table th.number, .stats-table td.number { text-align: right; }
.stats-table td { padding: 14px 13px; border-top: 1px solid var(--soft-line); border-bottom: 1px solid var(--soft-line); background: rgba(255, 255, 255, 0.042); }
.stats-table td:first-child { width: 74px; border-left: 1px solid var(--soft-line); border-radius: 13px 0 0 13px; }
.stats-table td:last-child { border-right: 1px solid var(--soft-line); border-radius: 0 13px 13px 0; }
.stats-table .rank-chip { min-width: 38px; height: 38px; padding: 0 8px; display: inline-grid; place-items: center; border: 1px solid rgba(217, 182, 66, 0.4); border-radius: 999px; color: var(--gold-bright); font-weight: 1000; }
.stats-table .player-cell strong { display: block; text-transform: uppercase; }
.stats-table .player-cell small { display: block; margin-top: 3px; color: var(--faint); }
.stats-table .team-cell { color: var(--muted); font-weight: 750; }
.stats-table .stat-value { color: var(--gold-bright); font-size: 1.15rem; font-weight: 1000; }
.stats-table td.is-ranking { background: linear-gradient(90deg, rgba(217, 182, 66, 0.1), rgba(255, 255, 255, 0.048)); }
.stats-table .action-cell { width: 124px; }
.method-note { margin: 0; padding: 17px 22px; border-top: 1px solid var(--soft-line); color: var(--faint); background: rgba(0, 0, 0, 0.24); font-size: 0.79rem; line-height: 1.55; }

.team-search-layout {
  padding: clamp(24px, 4vw, 46px);
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(360px, 1.2fr);
  align-items: end;
  gap: clamp(28px, 5vw, 70px);
  border-bottom: 1px solid var(--soft-line);
  background: linear-gradient(120deg, rgba(47, 143, 80, 0.12), transparent 44%, rgba(200, 59, 50, 0.09));
}
.team-search-copy h3 { margin: 8px 0 12px; font-size: clamp(1.8rem, 3.6vw, 3.5rem); line-height: 0.98; letter-spacing: -0.045em; text-transform: uppercase; }
.team-search-copy > p:last-child { max-width: 610px; margin: 0; color: var(--muted); line-height: 1.58; }
.team-search-form { position: relative; }
.team-search-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.team-query-shell { position: relative; min-width: 0; }
.team-search-control input {
  width: 100%;
  min-height: 58px;
  padding: 0 62px 0 17px;
  border: 1px solid rgba(217, 182, 66, 0.38);
  border-right: 0;
  border-radius: 14px 0 0 14px;
  color: var(--cream);
  background: #080807;
  font-weight: 750;
}
.team-search-control input::-webkit-search-cancel-button { margin-right: 30px; }
.team-search-control input::placeholder { color: #776f63; }
.team-picker-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  width: 46px;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--soft-line);
  color: var(--gold-bright);
  background: rgba(217, 182, 66, 0.04);
  font-size: 1.2rem;
}
.team-picker-toggle span { display: inline-block; transition: transform 150ms ease; }
.team-picker-toggle[aria-expanded="true"] span { transform: rotate(180deg); }
.team-picker-toggle:hover { background: rgba(217, 182, 66, 0.13); }
.team-picker-toggle:focus-visible { outline: 2px solid var(--gold-bright); outline-offset: -3px; }
.team-search-control > button[type="submit"] { min-height: 58px; padding: 0 21px; border: 1px solid var(--gold); border-radius: 0 14px 14px 0; color: var(--ink); background: linear-gradient(180deg, var(--gold-bright), var(--gold)); font-weight: 950; }
.team-suggestions {
  position: absolute;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  z-index: 20;
  max-height: 322px;
  overflow-y: auto;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #11100e;
  box-shadow: var(--shadow);
}
.team-suggestion {
  width: 100%;
  padding: 11px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  border-radius: 10px;
  color: var(--cream);
  background: transparent;
  text-align: left;
}
.team-suggestion:hover, .team-suggestion.active, .team-suggestion:focus-visible { background: rgba(217, 182, 66, 0.13); outline: none; }
.team-suggestion strong { display: block; }
.team-suggestion small { color: var(--faint); }
.team-suggestion > span:last-child { color: var(--gold-bright); font-size: 0.7rem; font-weight: 900; letter-spacing: 0.09em; text-transform: uppercase; }
.team-status { margin-block: 26px; }
.empty-state.compact { display: flex; align-items: center; justify-content: center; gap: 18px; text-align: left; }
.empty-state.compact strong { font-size: 1.2rem; }
.empty-state.compact p { margin-top: 4px; }
.state-mark { width: 50px; height: 50px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold-bright); font-size: 1.35rem; font-weight: 1000; }

.team-profile { border-top: 1px solid var(--soft-line); }
.team-profile-header {
  padding: 24px clamp(18px, 3vw, 36px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  background: linear-gradient(90deg, rgba(47, 143, 80, 0.12), transparent 48%, rgba(200, 59, 50, 0.1));
}
.team-profile-header span { color: var(--muted); font-size: 0.74rem; font-weight: 850; letter-spacing: 0.09em; text-transform: uppercase; }
.team-profile-header h3 { margin: 4px 0 0; font-size: clamp(1.8rem, 4vw, 3.5rem); line-height: 1; letter-spacing: -0.045em; text-transform: uppercase; }
.team-profile-header button { padding: 10px 15px; border: 1px solid var(--gold); border-radius: 999px; color: var(--gold-bright); background: transparent; font-size: 0.78rem; font-weight: 900; white-space: nowrap; }
.team-profile-header button:hover { color: var(--ink); background: var(--gold-bright); }
.category-tabs { padding: 13px 18px; display: flex; gap: 7px; overflow-x: auto; border-top: 1px solid var(--soft-line); border-bottom: 1px solid var(--soft-line); scrollbar-width: thin; }
.category-tabs button { flex: 0 0 auto; padding: 9px 14px; border: 1px solid var(--soft-line); border-radius: 999px; color: var(--muted); background: rgba(0, 0, 0, 0.28); font-size: 0.78rem; font-weight: 900; }
.category-tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--gold); background: var(--gold-bright); }
.team-table-region { min-width: 0; padding: 14px clamp(8px, 1.4vw, 22px) 26px; overflow-x: auto; }
.team-season-table { width: 100%; min-width: 620px; border-collapse: collapse; table-layout: fixed; }
.team-season-table .team-stat-label-column { width: 46%; }
.team-season-table thead th {
  padding: 10px 12px;
  border-bottom: 2px solid rgba(217, 182, 66, 0.72);
  color: var(--gold-bright);
  background: rgba(217, 182, 66, 0.1);
  font-size: 0.69rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-align: right;
  text-transform: uppercase;
}
.team-season-table thead th:first-child { text-align: left; }
.team-season-table .team-stat-section th {
  padding: 9px 10px;
  border-top: 9px solid var(--ink);
  border-bottom: 1px solid rgba(217, 182, 66, 0.26);
  color: var(--cream);
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.71rem;
  font-style: italic;
  font-weight: 950;
  letter-spacing: 0.07em;
  text-align: left;
  text-transform: uppercase;
}
.team-season-table .team-stat-row th,
.team-season-table .team-stat-row td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--soft-line);
  color: var(--muted);
  font-size: 0.78rem;
}
.team-season-table .team-stat-row th { font-weight: 700; text-align: left; }
.team-season-table .team-stat-row td { color: var(--cream); font-variant-numeric: tabular-nums; font-weight: 850; text-align: right; }
.team-season-table .team-stat-row:hover th,
.team-season-table .team-stat-row:hover td { background: rgba(217, 182, 66, 0.055); }

.player-career-shell { padding: clamp(16px, 2vw, 24px); background: linear-gradient(120deg, rgba(200, 59, 50, 0.055), transparent 42%, rgba(47, 143, 80, 0.045)); }
.player-career-intro h3 { margin: 4px 0 6px; font-size: clamp(1.75rem, 3vw, 2.35rem); line-height: 1; letter-spacing: -0.035em; }
.player-career-intro > p:last-child { margin: 0; color: var(--muted); line-height: 1.5; }
.player-career-search { margin-top: 16px; }
.player-career-search > input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(217, 182, 66, 0.68);
  border-radius: 13px;
  color: var(--cream);
  background: #11100f;
  font-weight: 750;
}
.player-career-search > input::placeholder { color: #857b6d; }
.player-inline-status { min-height: 27px; margin: 9px 0 15px; color: var(--faint); font-size: 0.78rem; line-height: 1.45; }
.player-inline-status .status-card { min-height: 0; padding: 0; border: 0; background: transparent; box-shadow: none; }
.player-inline-status .status-card strong { color: var(--cream); font-size: 0.82rem; }
.player-inline-status .status-card p { display: inline; margin: 0 0 0 5px; color: var(--faint); }
.player-inline-status .status-card.error strong { color: #ff9a92; }
.player-profile { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: rgba(0, 0, 0, 0.32); }
.player-profile-header {
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  background: linear-gradient(90deg, rgba(217, 182, 66, 0.08), transparent 55%, rgba(47, 143, 80, 0.07));
}
.player-profile-header > div { min-width: 0; }
.player-profile-header span:not(.career-badge) { color: var(--muted); font-size: 0.74rem; font-weight: 850; letter-spacing: 0.09em; text-transform: uppercase; }
.player-profile-header h3 { margin: 0 0 4px; font-size: clamp(1.2rem, 2.5vw, 1.55rem); line-height: 1; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.career-badge { flex: 0 0 auto; padding: 9px 13px; border-radius: 999px; color: var(--ink); background: var(--gold-bright); font-size: 0.69rem; font-weight: 1000; letter-spacing: 0.08em; text-transform: uppercase; }
.player-table-region { min-width: 0; padding: 0 9px 12px; overflow-x: auto; }
.player-career-table { width: 100%; min-width: 690px; border-collapse: collapse; }
.player-career-table th { padding: 9px 10px; color: var(--faint); font-size: 0.61rem; letter-spacing: 0.08em; text-align: right; text-transform: uppercase; }
.player-career-table th:first-child, .player-career-table th:nth-child(2) { text-align: left; }
.player-career-table td { padding: 10px; border-top: 1px solid var(--soft-line); text-align: right; white-space: nowrap; }
.player-career-table td:first-child { text-align: left; font-weight: 800; }
.player-career-table td:nth-child(2) { min-width: 180px; text-align: left; }
.player-career-table .career-total td { border-color: rgba(217, 182, 66, 0.36); background: rgba(217, 182, 66, 0.09); font-weight: 1000; }

.stats-footer {
  padding: 28px clamp(16px, 3vw, 44px);
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--soft-line);
  color: var(--faint);
  background: #050505;
  font-size: 0.8rem;
}
.stats-footer > div { display: grid; gap: 5px; }
.stats-footer strong { color: var(--cream); text-transform: uppercase; }
.stats-footer nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 16px; }
.stats-footer a { text-decoration: none; }
.stats-footer a:hover { color: var(--gold-bright); }
.noscript-message { margin: 0; padding: 14px; color: var(--ink); background: var(--gold-bright); text-align: center; font-weight: 900; }

@media (max-width: 1240px) {
  .leader-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metric-field { grid-column: span 2; }
  .share-button { width: 100%; }
}

@media (max-width: 820px) {
  .stats-header { position: relative; flex-wrap: wrap; gap: 7px 14px; padding: 9px 12px 10px; }
  .stats-brand img { width: 48px; height: 48px; }
  .stats-header nav { width: 100%; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .stats-header nav::-webkit-scrollbar { display: none; }
  .stats-header nav a { min-height: 42px; flex: 0 0 auto; display: inline-flex; align-items: center; padding: 8px 11px; }
  .stats-hero > img { height: clamp(96px, 23vw, 136px); object-fit: cover; object-position: center; }
  .stats-workspace { width: calc(100% - 8px); margin: 14px auto 30px; border-radius: 20px; }
  .workspace-heading { align-items: flex-start; flex-direction: column; gap: 12px; }
  .workspace-heading > p { max-width: 620px; }
  .tool-tabs button { min-height: 76px; }
  .leader-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 16px; }
  .metric-field { grid-column: 1 / -1; }
  .leader-podium {
    grid-template-columns: repeat(3, minmax(250px, 72vw));
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .podium-card { min-height: 184px; scroll-snap-align: start; }
  .leader-results { padding-inline: 16px; }
  .team-search-layout { grid-template-columns: 1fr; gap: 24px; padding: 26px 18px; }
  .team-suggestions { max-height: min(46vh, 322px); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .category-tabs, .team-table-region, .player-table-region, .leader-results {
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }
  .category-tabs button { min-height: 44px; scroll-snap-align: start; }
}

@media (max-width: 560px) {
  .stats-header { padding-inline: 10px; }
  .stats-brand { gap: 9px; }
  .stats-brand img { width: 44px; height: 44px; }
  .stats-brand strong { font-size: 0.86rem; }
  .stats-brand small { font-size: 0.65rem; }
  .stats-header nav { gap: 5px; }
  .stats-header nav a { min-height: 40px; padding: 7px 10px; font-size: 0.76rem; }
  .stats-hero > img { height: clamp(92px, 27vw, 116px); object-position: 48% center; }
  .stats-workspace { width: calc(100% - 4px); margin-block: 10px 24px; border-radius: 16px; }
  .workspace-heading { padding: 21px 16px; }
  .workspace-heading h2 { font-size: clamp(2rem, 11vw, 2.7rem); line-height: 0.94; }
  .workspace-heading > p { font-size: 0.88rem; line-height: 1.48; }
  .tool-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tool-tabs button + button { border-top: 0; border-left: 1px solid var(--soft-line); }
  .tool-tabs button { min-height: 62px; justify-content: center; padding: 9px 5px; text-align: center; }
  .tool-tabs strong { font-size: clamp(0.78rem, 3.8vw, 1rem); line-height: 1.08; }
  .leader-controls { grid-template-columns: 1fr; gap: 10px; padding: 14px 12px; }
  .metric-field { grid-column: auto; }
  .segmented-control button { min-height: 46px; }
  .select-field select, .share-button { min-height: 50px; }
  .leader-summary { align-items: flex-start; flex-direction: column; padding-inline: 16px; }
  .result-count { text-align: left; }
  .status-region { margin: 16px; }
  .status-card, .empty-state { padding: 26px 18px; }
  .method-note { padding-inline: 16px; }
  .leader-podium { grid-template-columns: repeat(3, minmax(240px, 84vw)); gap: 10px; padding: 2px 12px 20px; }
  .podium-card { min-height: 176px; padding: 17px; }
  .leader-results { padding: 0 12px 20px; overflow: visible; }
  .stats-table { min-width: 0; display: block; border-spacing: 0; }
  .stats-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .stats-table tbody { display: grid; gap: 11px; }
  .stats-table tr {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px 10px;
    padding: 15px;
    border: 1px solid var(--soft-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.042);
  }
  .stats-table td,
  .stats-table td:first-child,
  .stats-table td:last-child {
    width: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    text-align: left;
  }
  .stats-table td:first-child { position: absolute; top: 13px; right: 13px; }
  .stats-table td:nth-child(2) { grid-column: 1 / -1; padding-right: 52px; }
  .stats-table td:nth-child(3) { grid-column: 1 / -1; }
  .stats-table td:nth-child(4),
  .stats-table td:nth-child(5),
  .stats-table td:nth-child(6) { display: grid; gap: 4px; }
  .stats-table td:nth-child(4)::before,
  .stats-table td:nth-child(5)::before,
  .stats-table td:nth-child(6)::before {
    content: attr(data-label);
    color: var(--faint);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .stats-table .player-cell strong { font-size: 1.02rem; }
  .stats-table .team-cell { font-size: 0.82rem; }
  .stats-table .stat-value { font-size: 1.08rem; }
  .stats-table .action-cell { width: auto; grid-column: 1 / -1; margin-top: 2px; }
  .row-action { width: 100%; min-height: 44px; }
  .team-search-control { grid-template-columns: 1fr; gap: 8px; }
  .team-search-layout { gap: 20px; padding: 22px 14px; }
  .team-search-copy h3 { font-size: clamp(1.75rem, 9.5vw, 2.45rem); }
  .team-search-copy > p:last-child { font-size: 0.9rem; }
  .team-search-control input { min-height: 52px; border-right: 1px solid rgba(217, 182, 66, 0.38); border-radius: 13px; font-size: 1rem; }
  .team-search-control > button[type="submit"] { min-height: 50px; border-radius: 13px; }
  .team-search-form:not(.player-career-search) .team-suggestions { position: static; max-height: min(50vh, 360px); margin-top: 7px; }
  .player-career-search .team-suggestions { position: static; max-height: min(50vh, 360px); margin-top: 7px; }
  .team-search-form:not(.player-career-search) .team-suggestions::before,
  .player-career-search .team-suggestions::before {
    content: attr(data-result-label);
    position: sticky;
    top: 0;
    z-index: 2;
    display: block;
    padding: 8px 10px;
    border-bottom: 1px solid var(--soft-line);
    color: var(--faint);
    background: #11100e;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.07em;
    text-transform: uppercase;
  }
  .team-profile-header { align-items: flex-start; flex-direction: column; }
  .team-profile-header h3 { font-size: clamp(1.7rem, 9vw, 2.45rem); overflow-wrap: anywhere; }
  .team-table-region { padding: 8px 8px 18px; overflow-x: visible; }
  .team-season-table { min-width: 0; }
  .team-season-table .team-stat-label-column { width: 44%; }
  .team-season-table thead th { padding: 9px 6px; font-size: 0.61rem; letter-spacing: 0.04em; overflow-wrap: anywhere; }
  .team-season-table .team-stat-section th { padding: 9px 7px; }
  .team-season-table .team-stat-row th,
  .team-season-table .team-stat-row td { padding: 9px 6px; font-size: 0.72rem; overflow-wrap: anywhere; }
  .player-career-shell { padding: 17px 10px; }
  .player-career-intro h3 { font-size: 1.8rem; }
  .player-career-intro > p:last-child { font-size: 0.9rem; }
  .player-career-search > input { min-height: 52px; font-size: 1rem; }
  .player-inline-status { margin-bottom: 12px; }
  .player-profile-header { align-items: flex-start; flex-direction: column; }
  .player-profile-header { gap: 11px; padding: 14px 12px; }
  .player-profile-header span:not(.career-badge) { display: block; line-height: 1.45; overflow-wrap: anywhere; }
  .career-badge { padding: 8px 11px; }
  .category-tabs { padding-inline: 10px; scroll-snap-type: inline proximity; }
  .player-table-region { padding: 0 0 10px; scrollbar-width: thin; }
  .player-career-table { min-width: 690px; }
  .player-career-table th, .player-career-table td { padding-inline: 8px; }
  .player-career-table th:first-child,
  .player-career-table td:first-child {
    position: sticky;
    left: 0;
    z-index: 3;
    width: 68px;
    min-width: 68px;
    max-width: 68px;
    background: #090806;
  }
  .player-career-table th:nth-child(2),
  .player-career-table td:nth-child(2) {
    position: sticky;
    left: 68px;
    z-index: 2;
    width: 146px;
    min-width: 146px;
    max-width: 146px;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #090806;
  }
  .player-career-table .career-total td:first-child,
  .player-career-table .career-total td:nth-child(2) { background: #211d0d; }
  .empty-state.compact { align-items: flex-start; flex-direction: column; gap: 12px; }
  .stats-footer { align-items: flex-start; flex-direction: column; }
  .stats-footer nav { justify-content: flex-start; }
}

@media (max-width: 380px) {
  .stats-brand img { width: 40px; height: 40px; }
  .stats-brand strong { font-size: 0.8rem; }
  .stats-header nav a { padding-inline: 8px; }
  .tool-tabs strong { font-size: 0.78rem; }
  .leader-podium { grid-template-columns: repeat(3, minmax(226px, 86vw)); }
  .stats-table tr { padding: 13px; }
  .team-season-table .team-stat-label-column { width: 42%; }
  .team-season-table .team-stat-row th,
  .team-season-table .team-stat-row td { padding-inline: 5px; font-size: 0.69rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
