:root {
  --paper: #f4f6f3;
  --surface: #ffffff;
  --ink: #15201d;
  --muted: #62706b;
  --line: #d7ded9;
  --green: #087b63;
  --green-dark: #075a49;
  --red: #c53b45;
  --yellow: #dfa525;
  --blue: #245fbd;
  --charcoal: #202724;
  --shadow: 0 12px 34px rgba(27, 44, 38, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  letter-spacing: 0;
}
button, input, select { font: inherit; letter-spacing: 0; }
a { color: inherit; }
img { max-width: 100%; }

.portal-shell {
  width: min(calc(100% - 32px), 1240px);
  margin: 0 auto;
}

.portal-header {
  position: sticky;
  z-index: 30;
  top: 0;
  border-bottom: 1px solid rgba(215, 222, 217, .85);
  background: rgba(244, 246, 243, .96);
  backdrop-filter: blur(12px);
}

.portal-header-inner {
  min-height: 66px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: 0 0 auto;
}

.portal-brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.portal-brand strong {
  font-size: 1.04rem;
  line-height: 1;
}

.portal-brand span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
}

.portal-nav {
  display: flex;
  align-items: center;
  gap: 5px;
}

.portal-nav a {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--muted);
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
}

.portal-nav a:hover,
.portal-nav a[aria-current="page"] {
  background: var(--surface);
  color: var(--ink);
}

.header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.header-search-shell {
  position: relative;
}
.header-search-popover {
  position: absolute;
  z-index: 45;
  top: calc(100% + 10px);
  right: 0;
  width: min(420px, calc(100vw - 32px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 0 22px 55px rgba(13, 27, 22, .22);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-7px) scale(.985);
  transform-origin: top right;
  visibility: hidden;
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}
.header-search-shell[data-open="true"] .header-search-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  visibility: visible;
  transition-delay: 0s;
}
.header-search-shell[data-open="true"] .header-search-button {
  border-color: var(--green);
  color: var(--green-dark);
}
.header-search-popover .global-search {
  width: 100%;
  max-width: none;
  margin: 0;
}
.header-search-popover .global-search input {
  height: 44px;
  border-color: var(--line);
}
.header-search-popover .global-search > svg {
  top: 13px;
}
.header-search-popover .search-results {
  top: calc(100% + 12px);
  left: -10px;
  right: -10px;
}

.language-select {
  min-height: 34px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 28px 0 9px;
  font-size: .8rem;
}
.language-select:focus {
  border: 1px solid var(--green);
  background: var(--surface);
  outline: 2px solid rgba(8, 123, 99, .15);
}

.header-search-button,
.icon-button {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
  font-size: inherit;
  cursor: pointer;
}

.header-search-button:hover,
.icon-button:hover {
  border-color: var(--ink);
  background: var(--surface);
  color: var(--ink);
  box-shadow: none;
}
.header-search-button svg,
.icon-button svg { width: 18px; height: 18px; }

.portal-main { min-height: calc(100vh - 150px); }

.portal-masthead {
  position: relative;
  z-index: 2;
  overflow: visible;
  border-bottom: 1px solid var(--line);
  background: var(--charcoal);
  color: #fff;
}

.masthead-grid {
  min-height: 450px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr);
  gap: 54px;
  align-items: center;
  padding: 58px 0 46px;
}

.masthead-kicker,
.section-kicker {
  margin: 0 0 12px;
  color: #8dd9c8;
  font-size: .74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.portal-masthead h1 {
  max-width: 790px;
  margin: 0;
  color: #fff;
  font-size: clamp(2.4rem, 5vw, 5.3rem);
  line-height: .96;
  letter-spacing: 0;
}

.masthead-copy {
  max-width: 690px;
  margin: 22px 0 0;
  color: #c9d2ce;
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.65;
}

.season-switcher {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.season-switcher label {
  color: #aebbb6;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.season-switcher select {
  width: 152px;
  flex: 0 0 152px;
  min-height: 38px;
  border: 1px solid #53615c;
  border-radius: 6px;
  background: #2a3330;
  color: white;
  padding: 0 34px 0 12px;
}
.masthead-lab-link {
  margin-left: 8px;
  color: #8dd9c8;
  font-size: .76rem;
  font-weight: 850;
  text-decoration: none;
}
.masthead-lab-link:hover { text-decoration: underline; }

.masthead-scoreboard {
  border-top: 4px solid var(--yellow);
  background: #f9fbf9;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.scoreboard-title {
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: .72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.scoreboard-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: baseline;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}
.scoreboard-row:last-child { border-bottom: 0; }
.scoreboard-row span { color: var(--muted); font-size: .86rem; font-weight: 750; }
.scoreboard-row strong { font-size: 2rem; line-height: 1; }

.global-search {
  position: relative;
  margin-top: 26px;
  max-width: 680px;
}
.global-search input {
  width: 100%;
  height: 52px;
  border: 1px solid #596660;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 52px 0 17px;
  outline: none;
}
.global-search input:focus { border-color: #8dd9c8; box-shadow: 0 0 0 3px rgba(141, 217, 200, .2); }
.global-search > svg {
  position: absolute;
  top: 17px;
  right: 17px;
  width: 19px;
  height: 19px;
  color: var(--muted);
  pointer-events: none;
}

.search-results {
  position: absolute;
  z-index: 40;
  top: calc(100% + 7px);
  left: 0;
  right: 0;
  max-height: min(460px, 70vh);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 20px 45px rgba(13, 27, 22, .18);
  color: var(--ink);
}
.search-results[hidden] { display: none; }
.search-group-title {
  padding: 10px 14px 6px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
}
.search-result {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 14px;
  text-decoration: none;
}
.search-result:hover { background: #eef3f0; }
.search-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #dce5e0;
  color: var(--green-dark);
  font-size: .72rem;
  font-weight: 900;
}
.search-avatar img { width: 100%; height: 100%; object-fit: cover; }
.search-result strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.search-result small { color: var(--muted); font-size: .7rem; }

.content-section { padding: 58px 0; }
.content-section + .content-section { border-top: 1px solid var(--line); }
.section-dark { background: var(--charcoal); color: white; }
.section-yellow { background: #f0c95e; color: #211d13; }

.section-heading {
  display: flex;
  gap: 22px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 26px;
}
.section-heading h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3.3vw, 3rem);
  line-height: 1.04;
}
.section-heading p {
  max-width: 530px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}
.section-dark .section-heading p { color: #b8c4bf; }
.section-heading-aside { max-width: 530px; }
.section-heading-aside p { margin: 0; }
.section-heading-aside .text-link { margin-top: 10px; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green-dark);
  font-size: .86rem;
  font-weight: 850;
  text-decoration: none;
}
.text-link:hover { text-decoration: underline; }
.section-dark .text-link { color: #8dd9c8; }

.latest-list { border-top: 1px solid var(--line); }
.home-latest-stage {
  position: relative;
  min-height: 352px;
}
.home-latest-loading {
  place-items: start center;
  padding-top: 92px;
}
.tournament-row {
  display: grid;
  grid-template-columns: 100px minmax(220px, 1.2fr) minmax(280px, 1fr) 34px;
  gap: 20px;
  align-items: center;
  min-height: 88px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: background .16s ease, padding .16s ease;
}
.tournament-row:hover { background: rgba(255, 255, 255, .58); padding: 0 10px; }
.tournament-date { color: var(--muted); font-size: .75rem; font-weight: 800; text-transform: uppercase; }
.tournament-name { min-width: 0; }
.tournament-name strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tournament-name small { display: block; margin-top: 5px; color: var(--muted); }
.winner-list { display: flex; flex-wrap: wrap; gap: 5px 14px; }
.winner { min-width: 0; font-size: .82rem; }
.winner b { color: var(--green-dark); }
.winner span { color: var(--muted); font-size: .72rem; }
.row-arrow { color: var(--muted); font-size: 1.2rem; }

.kind-badge,
.category-badge {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font-size: .65rem;
  font-weight: 900;
  text-transform: uppercase;
}
.kind-major { border-color: #be8f20; color: #73520b; background: #fff5d5; }
.kind-grand_prix { border-color: #2a8f79; color: #075a49; background: #e6f7f2; }
.kind-international_open { border-color: #6990ce; color: #254b88; background: #eaf1fb; }
.kind-satellite { border-color: #b86a72; color: #82323a; background: #fcecef; }

.palmares-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  gap: 36px;
  max-width: 100%;
}
.palmares-grid > * { min-width: 0; }
.palmares-grid .data-table-wrap {
  width: 100%;
  max-width: 100%;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.profile-extreme-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}
.profile-extreme-result {
  min-width: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.profile-extreme-result:last-child { border-bottom: 0; }
.profile-extreme-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.profile-extreme-heading strong {
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}
.profile-extreme-result p {
  margin: 7px 0 3px;
  color: var(--ink);
  font-size: .84rem;
  font-weight: 750;
}
.profile-extreme-result p span {
  color: var(--muted);
  font-weight: 500;
}
.profile-extreme-result p .profile-opponent-name {
  color: var(--ink);
  font-weight: 750;
}
.profile-player-link,
.profile-unexpected-result p a {
  text-decoration: none;
}
.profile-player-link:hover,
.profile-player-link:focus-visible,
.profile-unexpected-result p a:hover,
.profile-unexpected-result p a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.profile-extreme-result small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-extreme-result small a { color: inherit; }

.profile-unexpected-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--line);
}
.profile-unexpected-result {
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.profile-unexpected-index {
  color: var(--muted);
  font-size: .58rem;
  font-weight: 900;
}
.profile-unexpected-result p {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  margin: 0;
  font-size: .76rem;
  font-weight: 750;
}
.profile-unexpected-result p a {
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-unexpected-result p a:last-child { text-align: right; }
.profile-unexpected-result p strong {
  color: var(--green-dark);
  font-variant-numeric: tabular-nums;
}
.profile-unexpected-tournament {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  color: var(--muted);
  font-size: .66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-unexpected-result > em {
  color: var(--green-dark);
  font-size: .86rem;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}
.profile-unexpected-result > em small { color: var(--muted); font-size: .55rem; }
.profile-unexpected-result > em i {
  display: block;
  max-width: 78px;
  margin-top: 2px;
  color: var(--muted);
  font-size: .51rem;
  font-style: normal;
  font-weight: 600;
  line-height: 1.25;
}

.data-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  border-top: 3px solid var(--ink);
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  font-size: .83rem;
}
.data-table th,
.data-table td {
  padding: 11px 9px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}
.data-table th {
  color: var(--muted);
  font-size: .65rem;
  font-weight: 900;
  text-transform: uppercase;
}
.data-table th:first-child,
.data-table td:first-child,
.data-table th:nth-child(2),
.data-table td:nth-child(2) { text-align: left; }
.data-table tbody tr:hover { background: rgba(255,255,255,.6); }
.rank-number { width: 28px; color: var(--muted); font-weight: 900; }
.athlete-link { font-weight: 800; text-decoration: none; }
.athlete-link:hover { color: var(--green-dark); text-decoration: underline; }
.title-total { color: var(--green-dark); font-size: 1rem; font-weight: 950; }

.category-tabs {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.category-tabs button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  padding: 0 10px;
  cursor: pointer;
  font-size: .72rem;
  font-weight: 850;
}
.category-tabs button[aria-selected="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 1px;
  border: 1px solid #3c4743;
  background: #3c4743;
}
.insight {
  min-height: 235px;
  padding: 25px;
  background: var(--charcoal);
}
.insight-index {
  color: #8dd9c8;
  font-size: .68rem;
  font-weight: 900;
}
.insight h3 { margin: 30px 0 8px; color: white; font-size: 1rem; }
.insight h3 a { color: inherit; text-decoration-color: #66736e; text-underline-offset: 3px; }
.insight h3 a:hover { color: #8dd9c8; text-decoration-color: #8dd9c8; }
.insight-value { display: block; color: white; font-size: clamp(2.1rem, 4vw, 4rem); line-height: 1; }
.insight-value small {
  color: #aebbb5;
  font-size: .22em;
  font-weight: 750;
  text-transform: lowercase;
}
.insight-name {
  display: inline-block;
  margin-top: 15px;
  color: #8dd9c8;
  font-weight: 850;
  text-decoration: none;
}
.insight p { margin: 8px 0 0; color: #9fada7; font-size: .76rem; line-height: 1.5; }
.insight-more {
  display: inline-block;
  margin-top: 22px;
  color: #8dd9c8;
  font-size: .68rem;
  font-weight: 850;
  text-decoration: none;
}
.insight-more:hover { text-decoration: underline; }

.ranking-trend {
  margin-top: 34px;
  border: 1px solid #46524d;
  background:
    linear-gradient(135deg, rgba(103,213,189,.07), transparent 34%),
    #252d2a;
  padding: 28px;
}
.ranking-trend-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
}
.ranking-trend-heading h3 { margin: 3px 0 7px; color: white; font-size: clamp(1.35rem, 2.5vw, 2.15rem); }
.ranking-trend-heading p { max-width: 660px; margin: 0; color: #aebbb5; }
.ranking-trend-category {
  display: grid;
  flex: 0 0 190px;
  gap: 6px;
  color: #9facA7;
  font-size: .62rem;
  font-weight: 850;
  text-transform: uppercase;
}
.ranking-trend-category select {
  min-height: 38px;
  border: 1px solid #56625d;
  border-radius: 4px;
  background: #1e2522;
  color: white;
  padding: 0 34px 0 11px;
  font: inherit;
  font-size: .76rem;
  text-transform: none;
}
.ranking-trend-stage { min-height: 300px; }
.ranking-trend-scroll {
  overflow-x: auto;
  border-top: 1px solid #3d4843;
  border-bottom: 1px solid #3d4843;
}
.ranking-trend-chart { display: block; width: 100%; min-width: 880px; height: auto; }
.ranking-trend-gridline line { stroke: #46514c; stroke-width: 1; stroke-dasharray: 2 6; }
.ranking-trend-gridline text {
  fill: #8f9c96;
  font-size: 11px;
  font-weight: 850;
  text-anchor: end;
}
.ranking-trend-month {
  fill: #8f9c96;
  font-size: 10px;
  font-weight: 750;
  text-anchor: middle;
}
.ranking-trend-series path {
  fill: none;
  stroke: var(--series-color);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1800;
  stroke-dashoffset: 1800;
  opacity: .9;
  animation: ranking-trend-draw 1.25s cubic-bezier(.22,.75,.25,1) forwards;
  animation-delay: var(--series-delay);
}
.ranking-trend-series circle {
  fill: #252d2a;
  stroke: var(--series-color);
  stroke-width: 2;
  opacity: 0;
  animation: ranking-trend-point .25s ease forwards;
  animation-delay: calc(var(--series-delay) + .75s);
}
.ranking-trend-series a { text-decoration: none; }
.ranking-trend-end-label {
  fill: var(--series-color);
  font-size: 10px;
  font-weight: 850;
}
.ranking-trend-legend {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 1px;
  margin-top: 14px;
  background: #3d4843;
}
.ranking-trend-legend-item {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  background: #202724;
  color: #e3e9e6;
  padding: 7px 10px;
  font-size: .68rem;
  text-decoration: none;
}
.ranking-trend-legend-item:hover { background: #29332f; }
.ranking-trend-legend-item i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--series-color);
}
.ranking-trend-legend-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-trend-legend-item b { color: #92a099; font-size: .62rem; }
.ranking-trend-note { margin: 13px 0 0; color: #899690; font-size: .66rem; }
.ranking-trend-loading,
.ranking-trend-empty {
  display: flex;
  min-height: 300px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #aebbb5;
  font-size: .76rem;
}
.ranking-trend-loading span {
  width: 18px;
  height: 18px;
  border: 2px solid #56625d;
  border-top-color: #67d5bd;
  border-radius: 50%;
  animation: portal-spin .75s linear infinite;
}
@keyframes ranking-trend-draw { to { stroke-dashoffset: 0; } }
@keyframes ranking-trend-point { to { opacity: 1; } }

@media (max-width: 760px) {
  .ranking-trend { padding: 20px 14px; }
  .ranking-trend-heading { display: grid; align-items: stretch; }
  .ranking-trend-category { width: min(100%, 240px); }
  .ranking-trend-legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .ranking-trend-series path { stroke-dashoffset: 0; animation: none; }
  .ranking-trend-series circle { opacity: 1; animation: none; }
}

.archive-hero,
.profile-hero {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.archive-hero-inner { padding: 52px 0 38px; }
.archive-hero h1,
.profile-hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 1;
}
.archive-hero p { max-width: 700px; color: var(--muted); line-height: 1.55; }

.filter-bar {
  display: grid;
  grid-template-columns: minmax(210px, 1.25fr) repeat(4, minmax(140px, .75fr));
  gap: 12px;
  align-items: end;
  margin-top: 28px;
}
.field { display: grid; gap: 6px; }
.field span {
  color: var(--muted);
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
}
.field input,
.field select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
}
.field input:focus,
.field select:focus { border-color: var(--green); outline: 2px solid rgba(8,123,99,.15); }

.archive-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.archive-results-stage {
  position: relative;
  min-height: 150px;
}

.archive-loading {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  place-items: start center;
  padding-top: 46px;
  background: rgba(244,246,243,.88);
  backdrop-filter: blur(1px);
}

.archive-loading[hidden] {
  display: none;
}

.archive-loading > div {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 13px 17px;
  border: 1px solid #46514c;
  border-radius: 7px;
  background: var(--charcoal);
  color: white;
  box-shadow: 0 14px 32px rgba(12,24,19,.2);
  font-size: .76rem;
}
.archive-card {
  --archive-accent: #718079;
  min-height: 196px;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid var(--line);
  border-top: 4px solid var(--archive-accent);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.archive-card-major { --archive-accent: #be8f20; }
.archive-card-grand_prix { --archive-accent: #2a8f79; }
.archive-card-international_open { --archive-accent: #6990ce; }
.archive-card-satellite { --archive-accent: #b86a72; }
.archive-card:hover {
  transform: translateY(-3px);
  border-color: var(--archive-accent);
  box-shadow: var(--shadow);
}
.archive-card-body {
  flex: 1;
  position: relative;
  padding: 15px 42px 16px 16px;
}
.archive-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 25px;
}
.archive-card-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.archive-card-type {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 7px;
  border: 1px solid #cfd8d2;
  border-radius: 4px;
  background: #f3f6f4;
  color: #43524c;
  font-size: .65rem;
  font-weight: 850;
  text-transform: uppercase;
}
.archive-card-season {
  color: var(--muted);
  font-size: .7rem;
  font-weight: 850;
  white-space: nowrap;
}
.archive-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-top: 13px;
}
.archive-card-title-row > div {
  min-width: 0;
}
.archive-card-body h2 {
  margin: 6px 0 0;
  color: var(--ink);
  font-size: 1.08rem;
  line-height: 1.25;
}
.archive-card-meta {
  display: block;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 650;
}
.archive-card-thumbnail {
  width: 82px;
  height: 54px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #f7f9f7;
  object-position: center;
}
.archive-card .winner-list { margin-top: 14px; }
.archive-card-open {
  position: absolute;
  right: 16px;
  bottom: 14px;
  color: var(--archive-accent);
  font-size: 1.18rem;
  font-weight: 900;
  transition: transform .16s ease;
}
.archive-card:hover .archive-card-open {
  transform: translateX(3px);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}
.pagination button {
  min-width: 92px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.pagination button:disabled { opacity: .4; cursor: default; }
.pagination span { color: var(--muted); font-size: .8rem; }

.profile-hero-inner {
  min-height: 320px;
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 35px;
  align-items: center;
  padding: 42px 0;
}
.profile-photo {
  width: 180px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #dfe7e2;
  color: var(--green-dark);
  font-size: 3.5rem;
  font-weight: 950;
}
.profile-photo.team { border-radius: 8px; }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; }
.profile-meta { display: flex; gap: 8px 18px; flex-wrap: wrap; margin-top: 18px; color: var(--muted); font-size: .82rem; }
.profile-meta b { color: var(--ink); }

.profile-stat-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-bottom: 1px solid var(--line);
  background: var(--charcoal);
  color: white;
}
.profile-stat {
  min-height: 104px;
  padding: 20px;
  border-right: 1px solid #3c4743;
}
.profile-stat:last-child { border-right: 0; }
.profile-stat span { display: block; color: #9fada7; font-size: .65rem; font-weight: 900; text-transform: uppercase; }
.profile-stat strong { display: block; margin-top: 10px; font-size: 1.8rem; line-height: 1; }

.profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr);
  gap: 34px;
}
.profile-grid > *,
.profile-block {
  min-width: 0;
  max-width: 100%;
}
.profile-block + .profile-block { margin-top: 40px; }
.profile-block h2 { margin: 0 0 16px; font-size: 1.35rem; }
.profile-block-intro { margin: -8px 0 16px; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.profile-table-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}
.profile-table-heading h2 { margin: 0; }
.profile-table-filter { width: min(270px, 45%); }
.profile-table-filter input { min-width: 0; }
.opponent-record-player-link { text-decoration: none; }
.opponent-record-player-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.opponent-record-row { cursor: pointer; transition: background .15s ease; }
.opponent-record-row:hover,
.opponent-record-row:focus-visible {
  background: #edf4f1;
  outline: 2px solid transparent;
}
.profile-rank-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  align-items: stretch;
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}
.profile-rank-summary + .profile-block { margin-top: 40px; }
.profile-rank-summary > i { width: 1px; background: var(--line); }
.profile-rank-summary > a {
  display: flex;
  min-width: 0;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 13px;
  color: var(--ink);
  text-decoration: none;
}
.profile-rank-summary > a:hover { background: #edf4f1; }
.profile-rank-summary span {
  color: var(--muted);
  font-size: .64rem;
  font-weight: 850;
  text-transform: uppercase;
}
.profile-rank-summary strong {
  color: var(--green-dark);
  font-size: 1.18rem;
  white-space: nowrap;
}
.profile-rank-summary strong small {
  color: var(--muted);
  font-size: .55em;
  font-weight: 750;
}
.profile-rank-loading {
  grid-column: 1 / -1;
  min-height: 62px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: .7rem;
}

.chart-frame {
  min-height: 260px;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}
.bar-chart { height: 220px; display: flex; gap: 8px; align-items: end; }
.bar-group { min-width: 28px; flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: end; }
.bar-stack { height: 170px; display: flex; align-items: end; justify-content: center; gap: 2px; }
.bar { width: 24%; min-width: 4px; border-radius: 2px 2px 0 0; transition: height .5s ease; }
.bar-win { background: var(--green); }
.bar-draw { background: var(--yellow); }
.bar-loss { background: var(--red); }
.bar-label { margin-top: 8px; overflow: hidden; color: var(--muted); font-size: .6rem; text-align: center; text-overflow: ellipsis; }
.chart-legend { display: flex; gap: 16px; margin-top: 12px; color: var(--muted); font-size: .7rem; }
.chart-legend i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 2px; }

.honour-list { border-top: 1px solid var(--line); }
.honour-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.honour-row time { color: var(--muted); font-size: .7rem; }
.honour-row a { font-size: .84rem; font-weight: 800; text-decoration: none; }
.honour-row a:hover { color: var(--green-dark); text-decoration: underline; }
.recent-match-result {
  border: 0;
  border-radius: 4px;
  background: transparent;
  padding: 3px 5px;
  font: inherit;
  font-weight: 950;
  cursor: pointer;
}
.recent-match-result:hover,
.recent-match-result:focus-visible {
  background: #edf4f1;
  outline: 2px solid transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.portal-team-acta {
  width: min(920px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  border: 0;
  border-radius: 8px;
  padding: 0;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .3);
}
.portal-team-acta::backdrop { background: rgba(15, 23, 42, .55); }
.portal-team-acta-shell {
  display: grid;
  gap: 16px;
  max-height: calc(100vh - 2rem);
  box-sizing: border-box;
  padding: 20px;
  overflow: hidden;
}
.portal-team-acta-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.portal-team-acta-heading h2 { margin: 0; font-size: 1.25rem; }
.portal-team-acta-code { color: var(--muted); font-size: .72rem; }
.portal-team-acta-tournament {
  display: inline-block;
  margin-top: 3px;
  color: var(--green-dark);
  font-size: .8rem;
  font-weight: 800;
  text-decoration: none;
}
.portal-team-acta-tournament:hover,
.portal-team-acta-tournament:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.portal-team-acta-close {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
  font-size: 1.5rem;
  cursor: pointer;
}
.portal-team-acta-content { min-height: 80px; overflow: auto; }
.portal-team-acta-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}
.portal-team-acta-summary > :first-child { text-align: right; }
.portal-team-acta-summary .winner-name,
.portal-team-acta-table .winner-name { color: var(--green-dark); font-weight: 900; }
.portal-team-acta-score { text-align: center; }
.portal-team-acta-score strong { display: block; font-size: 1.7rem; }
.portal-team-acta-score small { color: var(--muted); white-space: nowrap; }
.portal-team-acta-table-wrap { overflow: auto; }
.portal-team-acta-table { width: 100%; min-width: 680px; border-collapse: collapse; }
.portal-team-acta-table th,
.portal-team-acta-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
}
.portal-team-acta-table th { background: var(--surface); color: var(--muted); }
.portal-team-acta-table th:first-child,
.portal-team-acta-table td:first-child,
.portal-team-acta-table th:nth-child(3),
.portal-team-acta-table td:nth-child(3) { text-align: center; }
.portal-team-acta-period {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
}
.portal-team-acta-second-row td { background: var(--surface); }
.rivalry-score-link {
  min-width: 58px;
  color: var(--green-dark);
  font-size: .9rem !important;
  font-weight: 950 !important;
  text-align: right;
  text-decoration: underline;
  text-decoration-color: rgba(7,90,73,.35);
  text-underline-offset: 3px;
}
.rivalry-score-link:hover { text-decoration-color: currentColor !important; }

.head-to-head-hero {
  border-bottom: 1px solid #39433f;
  background: var(--charcoal);
  color: white;
}
.head-to-head-hero-inner {
  min-height: 350px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
  padding: 46px 0;
}
.head-to-head-player {
  min-width: 0;
  display: flex;
  gap: 20px;
  align-items: center;
  color: white;
  text-decoration: none;
}
.head-to-head-player.is-opponent {
  justify-content: flex-end;
  text-align: right;
}
.head-to-head-player > span:not(.head-to-head-photo) { min-width: 0; }
.head-to-head-player small,
.head-to-head-player em {
  display: block;
  color: #9fada7;
  font-size: .7rem;
  font-style: normal;
}
.head-to-head-player strong {
  display: block;
  margin: 5px 0;
  overflow-wrap: anywhere;
  font-size: clamp(1.2rem, 2.6vw, 2.3rem);
  line-height: 1.06;
}
.head-to-head-player:hover strong { color: #8dd9c8; }
.head-to-head-photo {
  width: 118px;
  aspect-ratio: 1;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid #53605a;
  border-radius: 50%;
  background: #dfe7e2;
  color: var(--green-dark);
  font-size: 2.2rem;
  font-weight: 950;
}
.head-to-head-photo img { width: 100%; height: 100%; object-fit: cover; }
.head-to-head-score { text-align: center; }
.head-to-head-score > span {
  display: block;
  color: #8dd9c8;
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
}
.head-to-head-score strong {
  display: block;
  margin: 12px 0 10px;
  color: var(--yellow);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  line-height: .9;
  white-space: nowrap;
}
.head-to-head-score small { color: #9fada7; font-size: .68rem; line-height: 1.5; }
.head-to-head-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(270px, .55fr);
  gap: 40px;
}
.head-to-head-grid > * { min-width: 0; }
.head-to-head-table th:last-child,
.head-to-head-table td:last-child { text-align: right; }
.table-subline {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: .66rem;
  white-space: normal;
}
.head-to-head-result { font-size: .95rem; }
.season-duel-list { border-top: 3px solid var(--ink); }
.season-duel-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.season-duel-row span small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: .65rem;
}
.season-duel-row b { color: var(--green-dark); font-size: .9rem; }
.season-duel-row > i {
  grid-column: 1 / -1;
  height: 3px;
  overflow: hidden;
  background: #dfe7e2;
}
.season-duel-row > i span { display: block; height: 100%; background: var(--green); }

.form-sequence { display: flex; gap: 5px; }
.form-result {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: white;
  font-size: .65rem;
  font-weight: 950;
}
.outcome-win { color: var(--green-dark) !important; }
.outcome-draw { color: #8a6500 !important; }
.outcome-loss { color: var(--red) !important; }
.form-result.outcome-win { background: var(--green); color: white !important; }
.form-result.outcome-draw { background: var(--yellow); color: #362600 !important; }
.form-result.outcome-loss { background: var(--red); color: white !important; }

.empty-state {
  padding: 42px 18px;
  border: 1px dashed #b8c2bd;
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.skeleton {
  min-height: 18px;
  border-radius: 4px;
  background: #e2e8e4;
  animation: skeleton-pulse 1.2s ease-in-out infinite alternate;
}
@keyframes skeleton-pulse { to { opacity: .45; } }

.reveal {
  opacity: 1;
  transform: none;
}
.reveal.is-visible { animation: reveal-enter .45s ease both; }
@keyframes reveal-enter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.data-lab-hero { border-bottom: 1px solid #39433f; background: var(--charcoal); color: white; }
.data-lab-hero-grid {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  gap: 70px;
  align-items: start;
  padding: 52px 0 54px;
}
.data-lab-hero h1 {
  max-width: 780px;
  margin: 0;
  color: white;
  font-size: clamp(2.6rem, 5.5vw, 5.6rem);
  line-height: .96;
}
.lab-index { border-top: 3px solid var(--yellow); }
.lab-index a {
  min-height: 58px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid #46514c;
  color: #dce3e0;
  text-decoration: none;
}
.lab-index a:hover { color: #8dd9c8; }
.lab-index span { color: #85928d; font-size: .68rem; font-weight: 900; }
.lab-index strong { font-size: .9rem; }
.lab-control-band { border-bottom: 1px solid var(--line); background: #e9eeeb; }
.portal-data-loading {
  position: fixed;
  z-index: 60;
  inset: 66px 0 0;
  display: grid;
  place-items: center;
  background: rgba(244,246,243,.78);
  backdrop-filter: blur(2px);
}
.portal-data-loading > div {
  min-width: 235px;
  display: flex;
  gap: 12px;
  align-items: center;
  border: 1px solid #46514c;
  border-radius: 7px;
  background: var(--charcoal);
  color: white;
  box-shadow: 0 16px 40px rgba(12,24,19,.24);
  padding: 15px 18px;
  font-size: .78rem;
}
.portal-data-loading[hidden] { display: none; }
.portal-data-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid #67756f;
  border-top-color: #8dd9c8;
  border-radius: 50%;
  animation: portal-data-spin .75s linear infinite;
}
@keyframes portal-data-spin { to { transform: rotate(360deg); } }
.lab-controls {
  min-height: 68px;
  display: flex;
  gap: 30px;
  align-items: center;
  justify-content: space-between;
}
.lab-controls label { display: flex; gap: 11px; align-items: center; font-size: .75rem; font-weight: 900; text-transform: uppercase; }
.lab-controls select { min-height: 36px; border: 1px solid #aebbb5; border-radius: 5px; background: white; padding: 0 30px 0 10px; }
.lab-controls p { max-width: 760px; margin: 0; color: var(--muted); font-size: .74rem; line-height: 1.45; text-align: right; }
.lab-dark-kicker { color: #614400; }
.timeline-toolbar,
.segmented-control {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #e9eeeb;
}
.timeline-toolbar { margin-bottom: 22px; }
.timeline-toolbar button,
.segmented-control button {
  min-height: 32px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font-size: .74rem;
  font-weight: 850;
  cursor: pointer;
}
.timeline-toolbar button[aria-pressed="true"],
.segmented-control button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(20,35,29,.12); }
.history-chart {
  height: 300px;
  display: flex;
  gap: clamp(6px, 1.2vw, 15px);
  align-items: stretch;
  overflow-x: auto;
  padding: 8px 2px 4px;
}
.history-column {
  min-width: 42px;
  flex: 1 0 42px;
  display: grid;
  grid-template-rows: 25px minmax(0, 1fr) 32px;
  gap: 6px;
  text-align: center;
}
.history-column > strong { color: var(--muted); font-size: .67rem; }
.history-column > div { position: relative; border-bottom: 1px solid #aeb8b3; }
.history-column i {
  position: absolute;
  right: 14%;
  bottom: 0;
  left: 14%;
  min-height: 2px;
  background: var(--green);
  transition: height .45s ease;
}
.history-column > span { color: var(--ink); font-size: .7rem; font-weight: 900; }
.history-column > span small { color: var(--muted); font-size: .62rem; }
.leaderboard-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 38px; }
.metric-tabs { display: flex; flex-direction: column; align-items: stretch; border-top: 3px solid #614400; }
.metric-tabs button {
  min-height: 48px;
  border: 0;
  border-bottom: 1px solid rgba(97,68,0,.25);
  background: transparent;
  color: #614400;
  padding: 0 6px;
  text-align: left;
  font-size: .79rem;
  font-weight: 850;
  cursor: pointer;
}
.metric-tabs button[aria-selected="true"] { color: var(--ink); padding-left: 17px; box-shadow: inset 4px 0 var(--ink); }
.ranked-story-list { border-top: 3px solid currentColor; }
.ranked-story-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(170px, .72fr) minmax(100px, 1fr) 82px;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid rgba(21,32,29,.22);
  text-decoration: none;
}
.ranked-story-row:hover .story-person strong { text-decoration: underline; }
.story-rank { color: var(--muted); font-size: .66rem; font-weight: 950; }
.story-person { min-width: 0; }
.story-person strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; }
.story-person small { display: block; margin-top: 3px; color: #745d22; font-size: .65rem; }
.story-bar { height: 5px; overflow: hidden; background: rgba(97,68,0,.16); }
.story-bar i { display: block; height: 100%; background: var(--green-dark); }
.story-value { text-align: right; font-size: 1.15rem; }
.record-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; background: #46514c; border: 1px solid #46514c; }
.record-feature { min-height: 290px; display: flex; flex-direction: column; background: var(--charcoal); padding: 28px; }
.record-feature > span { color: #8dd9c8; font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.record-feature > strong { margin-top: 26px; color: white; font-size: clamp(3.2rem,7vw,6.5rem); line-height: .8; }
.record-feature > small { margin-top: 10px; color: #9fada7; font-size: .72rem; }
.record-score { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: 15px; align-items: baseline; margin-top: 26px; }
.record-score a { overflow: hidden; color: white; font-size: .88rem; font-weight: 800; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.record-score a:last-child { text-align: right; }
.record-score a:hover { color: #8dd9c8; }
.record-score b { color: var(--yellow); font-size: 1.35rem; }
.record-tournament { margin-top: auto; padding-top: 18px; color: #9fada7; font-size: .68rem; text-decoration: none; }
.record-tournament:hover { color: #8dd9c8; }
.subsection-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 52px 0 16px; }
.subsection-heading h3 { margin: 0; color: white; font-size: 1.35rem; }
.subsection-heading p { max-width: 620px; margin: 0; color: #9fada7; font-size: .76rem; line-height: 1.5; }
.rivalry-list { border-top: 1px solid #53605a; }
.rivalry-row { min-height: 70px; display: grid; grid-template-columns: 34px minmax(0,1fr) 88px minmax(0,1fr); gap: 15px; align-items: center; border-bottom: 1px solid #46514c; }
.rivalry-player { min-width: 0; display: flex; gap: 14px; align-items: baseline; }
.rivalry-player.left { justify-content: flex-end; }
.rivalry-player a { overflow: hidden; color: white; font-size: .83rem; font-weight: 800; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.rivalry-player a:hover { color: #8dd9c8; }
.rivalry-player strong { color: var(--yellow); font-size: 1.2rem; }
.rivalry-centre { text-align: center; }
.rivalry-centre b { display: block; color: white; font-size: 1rem; }
.rivalry-centre span,.rivalry-centre small { display: block; color: #88958f; font-size: .6rem; }
.rivalry-meetings-link {
  display: block;
  padding: 4px 2px;
  border-radius: 5px;
  text-decoration: none;
}
.rivalry-meetings-link:hover,
.rivalry-meetings-link:focus-visible {
  background: rgba(141,217,200,.1);
  outline: 1px solid rgba(141,217,200,.42);
}
.rivalry-meetings-link:hover b,
.rivalry-meetings-link:focus-visible b { color: #8dd9c8; }
.world-grid { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(250px,.9fr) minmax(230px,.7fr); gap: 42px; }
.world-grid .profile-block + .profile-block { margin-top: 0; }
.world-grid .profile-block { align-self: start; }
.world-grid h3 { margin: 0 0 15px; font-size: 1.05rem; }
.ranked-story-list.compact .ranked-story-row { grid-template-columns: 28px minmax(130px,1fr) 76px 34px; gap: 9px; min-height: 48px; }
.place-bars,.format-wheel { border-top: 3px solid var(--ink); }
.place-row { min-height: 47px; display: grid; grid-template-columns: minmax(90px,1fr) minmax(60px,.7fr) 25px; gap: 8px; align-items: center; border-bottom: 1px solid var(--line); font-size: .75rem; }
.place-row > span { overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.place-row,.format-row { color: inherit; text-decoration: none; }
.place-row:hover,.format-row:hover { background: rgba(8,123,99,.055); }
.place-row > i,.format-row > i { height: 4px; overflow: hidden; background: #dce4df; }
.place-row > i b,.format-row > i b { display: block; height: 100%; background: var(--green); }
.place-row > strong { text-align: right; }
.place-row > small { grid-column: 1 / -1; margin-top: -12px; color: var(--muted); font-size: .6rem; }
.format-row { min-height: 52px; display: grid; grid-template-columns: minmax(0,1fr) 30px; gap: 4px 10px; align-items: end; border-bottom: 1px solid var(--line); font-size: .75rem; }
.format-row span { font-weight: 800; }
.format-row strong { text-align: right; }
.format-row i { grid-column: 1 / -1; align-self: start; }
.lab-team-section { background: #dfe9e4; }
.team-rank-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; background: #bdcac4; border: 1px solid #bdcac4; }
.team-rank-card { min-height: 112px; display: grid; grid-template-columns: 30px minmax(0,1fr) auto; gap: 14px; align-items: center; background: #f7faf8; padding: 18px; text-decoration: none; }
.team-rank-card:hover { background: white; }
.team-rank-card h3 { margin: 0; font-size: .92rem; }
.team-rank-card p { margin: 6px 0 0; color: var(--muted); font-size: .68rem; }
.team-rank-card > strong { color: var(--green-dark); font-size: 1.8rem; }
.team-rank-card > strong small { font-size: .7rem; }
.team-rank-card > span:last-child { grid-column: 2 / -1; color: var(--muted); font-size: .65rem; }
.honours-controls { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.lab-palmares-grid { grid-template-columns: minmax(0,1.3fr) minmax(320px,.7fr); }

.lab-generation-section { background: #e4ede9; }
.generation-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: 22px;
}
.generation-panel {
  min-width: 0;
  border-top: 4px solid var(--green-dark);
  background: rgba(255,255,255,.65);
  padding: 22px;
}
.lab-panel-heading {
  min-height: 70px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 22px;
  border-bottom: 1px solid #bdcac4;
  padding-bottom: 16px;
}
.lab-panel-heading p {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: .69rem;
  line-height: 1.45;
}
.lab-panel-heading > div > p {
  margin-bottom: 5px;
  color: var(--green-dark);
  font-size: .61rem;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.lab-panel-heading h3 { margin: 0; font-size: 1.08rem; }
.generation-total {
  max-width: 145px;
  color: var(--green-dark);
  font-size: .73rem;
  line-height: 1.3;
  text-align: right;
}
.youth-event-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 30px minmax(145px, 1fr) minmax(90px, .9fr) 32px;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #ced9d4;
  color: inherit;
  text-decoration: none;
}
.youth-event-row:hover strong { text-decoration: underline; }
.youth-event-row > span:nth-child(2) { min-width: 0; }
.youth-event-row > span > strong {
  display: block;
  overflow: hidden;
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.youth-event-row small { display: block; margin-top: 3px; color: var(--muted); font-size: .61rem; }
.youth-event-row > b { text-align: right; font-size: .95rem; }
.youth-stack { height: 7px; display: flex; overflow: hidden; background: #d6dfdb; }
.youth-segment { display: block; min-width: 2px; height: 100%; }
.youth-s12 { background: #d85b4b; }
.youth-s16 { background: #e0a629; }
.youth-s20 { background: #087b63; }
.pathway-row {
  min-height: 69px;
  display: grid;
  grid-template-columns: minmax(115px, .6fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid #ced9d4;
  color: inherit;
  text-decoration: none;
}
.pathway-row > strong {
  overflow: hidden;
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pathway-row:hover > strong { text-decoration: underline; }
.pathway-track { display: flex; min-width: 0; align-items: center; justify-content: flex-end; }
.pathway-track > i { width: 13px; height: 1px; flex: 0 1 13px; background: #92a49c; }
.pathway-track > b {
  min-width: 45px;
  border: 1px solid #9eafa7;
  border-radius: 4px;
  background: white;
  padding: 6px 5px;
  color: var(--ink);
  font-size: .65rem;
  text-align: center;
}
.pathway-track > b:last-child { border-color: var(--green-dark); background: var(--green-dark); color: white; }
.pathway-track small { display: block; margin-top: 2px; color: #708078; font-size: .49rem; font-weight: 650; }
.pathway-track > b:last-child small { color: #c9ddd6; }
.generation-duel {
  min-height: 176px;
  display: grid;
  grid-template-columns: 155px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin-top: 22px;
  border-left: 5px solid #d85b4b;
  background: var(--charcoal);
  color: white;
  padding: 20px 24px;
}
.generation-duel-copy p { margin: 0 0 8px; color: #8dd9c8; font-size: .65rem; font-weight: 900; text-transform: uppercase; }
.generation-duel-copy > strong { font-size: 1.65rem; }
.generation-duel-copy small { display: block; margin-top: 4px; color: #9fada7; font-size: .58rem; font-weight: 650; }
.generation-duel-results { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.generation-duel-match { min-width: 0; padding: 3px 18px; border-left: 1px solid #46514c; }
.generation-duel-match:first-child { border-left: 0; padding-left: 0; }
.generation-duel-match:last-child { padding-right: 0; }
.generation-duel-score {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  gap: 13px;
  align-items: center;
}
.generation-duel-score a { overflow: hidden; color: white; font-size: .82rem; font-weight: 850; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.generation-duel-score a:last-child { text-align: right; }
.generation-duel-score a:hover { color: #8dd9c8; }
.generation-duel-score small { display: block; margin-bottom: 4px; color: #99a8a2; font-size: .57rem; font-weight: 650; }
.generation-duel-score b { color: var(--yellow); font-size: 1.3rem; }
.generation-tournament-link {
  display: block;
  overflow: hidden;
  margin-top: 12px;
  color: #a9b6b0;
  font-size: .58rem;
  line-height: 1.4;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.generation-tournament-link:hover { color: #8dd9c8; }
.generation-balance { grid-column: 2; display: flex; gap: 18px; color: #9fada7; font-size: .62rem; }
.generation-balance b { color: white; }
.lab-surprise-section { border-top: 6px solid #d85b4b; }
.surprise-layout {
  display: grid;
  grid-template-columns: minmax(270px, .78fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 1px;
  background: #46514c;
  border: 1px solid #46514c;
}
.surprise-feature,
.surprise-ranking { min-width: 0; background: var(--charcoal); padding: 24px; }
.surprise-feature { min-height: 360px; }
.surprise-feature > span { color: #f39a8e; font-size: .66rem; font-weight: 950; text-transform: uppercase; }
.unexpected-result-list { margin-top: 13px; border-top: 1px solid #46514c; }
.unexpected-result-row {
  min-height: 61px;
  display: grid;
  grid-template-columns: 23px minmax(0, 1fr) 51px;
  gap: 9px;
  align-items: center;
  border-bottom: 1px solid #46514c;
}
.unexpected-result-row > strong { color: #7f8d87; font-size: .57rem; }
.unexpected-result-row > div { min-width: 0; }
.unexpected-result-row > div > span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 6px;
  align-items: baseline;
}
.unexpected-result-row a {
  overflow: hidden;
  color: white;
  font-size: .66rem;
  font-weight: 800;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.unexpected-result-row a:hover { color: #8dd9c8; }
.unexpected-result-row > div > span a:last-child { text-align: right; }
.unexpected-result-row > div > span b { color: var(--yellow); font-size: .75rem; }
.unexpected-result-row > div > a {
  display: block;
  margin-top: 4px;
  color: #8f9d97;
  font-size: .53rem;
}
.unexpected-result-row > em {
  color: #f39a8e;
  font-size: .85rem;
  font-style: normal;
  font-weight: 900;
  text-align: right;
}
.unexpected-result-row > em small { color: #7f8d87; font-size: .48rem; }
.unexpected-result-row > em i { display: block; margin-top: 2px; color: #b7c2bd; font-size: .5rem; font-style: normal; font-weight: 650; }
.surprise-ranking .lab-panel-heading { border-color: #46514c; }
.surprise-ranking .lab-panel-heading h3 { color: white; }
.surprise-ranking .lab-panel-heading > div > p { color: #f39a8e; }
.surprise-ranking .lab-panel-heading > p { color: #97a59f; }
.surprise-list-row {
  min-height: 58px;
  display: grid;
  grid-template-columns: 25px minmax(0,1fr) auto 39px;
  gap: 9px;
  align-items: center;
  border-bottom: 1px solid #46514c;
  color: white;
  text-decoration: none;
}
.surprise-list-row:hover > strong a { color: #8dd9c8; }
.surprise-list-row > span { color: #7f8d87; font-size: .59rem; font-weight: 900; }
.surprise-list-row > strong { overflow: hidden; font-size: .75rem; text-overflow: ellipsis; white-space: nowrap; }
.surprise-list-row > strong a { color: white; text-decoration: none; }
.surprise-list-row > small { color: #8f9d97; font-size: .56rem; }
.surprise-list-row > button {
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: #a8b5af;
  padding: 4px 0;
  font: inherit;
  font-size: .56rem;
  cursor: pointer;
}
.surprise-list-row > button:hover,
.surprise-list-row > button:focus-visible { border-color: #8dd9c8; color: #8dd9c8; outline: 0; }
.surprise-list-row > b { color: var(--yellow); font-size: .82rem; text-align: right; }
.surprise-method { max-width: 850px; margin: 22px 0 0 auto; color: #8f9d97; font-size: .65rem; line-height: 1.5; text-align: right; }
.section-heading .surprise-index-link {
  color: #bce9de;
  font-weight: 800;
  text-decoration-color: rgba(188,233,222,.55);
  text-underline-offset: 3px;
}
.section-heading .surprise-index-link:hover { color: white; text-decoration-color: white; }
.surprise-dialog {
  width: min(880px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 38px));
  overflow: hidden;
  border: 1px solid #65736d;
  border-radius: 7px;
  background: var(--charcoal);
  color: white;
  padding: 0;
  box-shadow: 0 24px 70px rgba(4,12,9,.42);
}
.surprise-dialog::backdrop { background: rgba(8,18,14,.7); backdrop-filter: blur(2px); }
.surprise-dialog-shell { display: grid; grid-template-rows: auto minmax(0, 1fr); max-height: min(760px, calc(100vh - 38px)); }
.surprise-dialog header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid #46514c;
  padding: 22px 24px 18px;
}
.surprise-dialog header p { margin: 0 0 5px; color: #f39a8e; font-size: .62rem; font-weight: 900; text-transform: uppercase; }
.surprise-dialog h2 { margin: 0; color: white; font-size: 1.35rem; }
.surprise-dialog header button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid #5b6963;
  border-radius: 5px;
  background: transparent;
  color: white;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.surprise-dialog header button:hover { border-color: #8dd9c8; color: #8dd9c8; }
.surprise-dialog-list { min-height: 0; overflow-y: auto; padding: 0 24px 18px; }
.surprise-dialog-row {
  min-height: 76px;
  display: grid;
  grid-template-columns: 84px minmax(230px, .9fr) minmax(190px, 1fr) 58px;
  gap: 15px;
  align-items: center;
  border-bottom: 1px solid #46514c;
}
.surprise-dialog-row time { color: #93a19b; font-size: .62rem; }
.surprise-dialog-score {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  gap: 7px;
  align-items: baseline;
}
.surprise-dialog-score a { overflow: hidden; color: white; font-size: .72rem; font-weight: 800; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.surprise-dialog-score a:last-child { text-align: right; }
.surprise-dialog-score a:hover { color: #8dd9c8; }
.surprise-dialog-score b { color: var(--yellow); font-size: .9rem; }
.surprise-dialog-context { min-width: 0; }
.surprise-dialog-context > a,
.surprise-dialog-context > span { display: block; overflow: hidden; color: #b6c1bc; font-size: .65rem; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.surprise-dialog-context > a:hover { color: #8dd9c8; }
.surprise-dialog-context small { display: block; margin-top: 4px; color: #7f8d87; font-size: .55rem; }
.surprise-dialog-row > strong { color: #f39a8e; font-size: 1rem; text-align: right; }
.surprise-dialog-row > strong small { color: #7f8d87; font-size: .48rem; }

.portal-footer {
  border-top: 1px solid #39433f;
  background: var(--charcoal);
  color: #abb7b2;
}
.footer-inner {
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  font-size: .76rem;
}
.footer-inner strong { color: white; }
.footer-inner a { color: #8dd9c8; }
.footer-nav { display: flex; gap: 16px; align-items: center; }
.footer-nav a { font-weight: 800; text-decoration: none; }
.footer-nav a:hover { text-decoration: underline; }

.rating-hero {
  border-bottom: 1px solid #39433f;
  background: var(--charcoal);
  color: white;
}
.official-ranking-hero .rating-hero-inner { min-height: 310px; }
.official-ranking-mark {
  align-self: center;
  border-left: 1px solid #57635e;
  padding: 28px 0 28px 42px;
}
.official-ranking-mark span,
.official-ranking-mark small { display: block; color: #96a49e; font-size: .65rem; font-weight: 850; text-transform: uppercase; }
.official-ranking-mark strong { display: block; margin: 7px 0; color: var(--yellow); font-size: clamp(2.5rem, 6vw, 5rem); line-height: 1; }

.official-ranking-rating-link {
  display: inline-flex;
  align-items: center;
  margin-top: 14px;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(141, 217, 200, .45);
  color: #8dd9c8;
  font-size: .78rem;
  font-weight: 850;
  text-decoration: none;
  transition: border-color .16s ease, color .16s ease;
}
.official-ranking-rating-link:hover,
.official-ranking-rating-link:focus-visible {
  border-color: var(--yellow);
  color: #fff;
}
.official-ranking-controls {
  display: grid;
  grid-template-columns: auto minmax(150px,.5fr) minmax(150px,.5fr) minmax(240px,1fr);
  gap: 18px;
  align-items: end;
  padding-block: 20px;
}
.entity-switch {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px;
  background: white;
}
.entity-switch button {
  min-height: 36px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  padding: 0 16px;
  font: inherit;
  font-size: .75rem;
  font-weight: 850;
  cursor: pointer;
}
.entity-switch button[aria-pressed="true"] { background: var(--ink); color: white; }
.official-ranking-table .ranking-code { display: block; margin-top: 3px; color: var(--muted); font-size: .58rem; }

@media (max-width: 860px) {
  .official-ranking-controls { grid-template-columns: 1fr 1fr; }
  .official-ranking-controls .rating-search-field { grid-column: 1 / -1; }
  .official-ranking-mark { border-left: 0; border-top: 1px solid #57635e; padding: 22px 0 0; }
}

@media (max-width: 560px) {
  .official-ranking-controls { grid-template-columns: 1fr; }
  .official-ranking-controls .rating-search-field { grid-column: auto; }
  .entity-switch { width: 100%; }
  .entity-switch button { flex: 1; }
}
.rating-hero-inner {
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(330px, .7fr);
  gap: 70px;
  align-items: center;
  padding: 58px 0;
}
.rating-hero h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.6rem, 5.4vw, 5.6rem);
  line-height: .96;
}
.rating-hero-inner > div > p:last-of-type {
  max-width: 680px;
  margin: 22px 0 0;
  color: #bdc8c3;
  font-size: 1rem;
  line-height: 1.65;
}
.rating-formula {
  border-top: 4px solid var(--yellow);
  border-bottom: 1px solid #53605a;
  padding: 22px 0 20px;
}
.rating-formula > span {
  display: block;
  color: #8dd9c8;
  font-size: .66rem;
  font-weight: 900;
  text-transform: uppercase;
}
.rating-formula strong {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 20px;
  color: white;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: clamp(.84rem, 1.5vw, 1.12rem);
  font-weight: 700;
}
.rating-formula small {
  display: block;
  margin-top: 17px;
  color: #8f9d97;
  font-size: .68rem;
  line-height: 1.5;
}
.rating-control-band { border-bottom: 1px solid var(--line); background: #e7ede9; }
.rating-controls {
  display: grid;
  grid-template-columns: minmax(180px, .65fr) minmax(180px, .65fr) minmax(250px, 1.2fr);
  gap: 14px;
  padding: 18px 0;
}
.rating-summary-band { border-bottom: 1px solid var(--line); background: var(--surface); }
.rating-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rating-summary > span {
  min-height: 82px;
  display: flex;
  align-items: baseline;
  gap: 9px;
  border-right: 1px solid var(--line);
  padding: 21px 24px;
  color: var(--muted);
  font-size: .7rem;
  font-weight: 800;
}
.rating-summary > span:first-child { border-left: 1px solid var(--line); }
.rating-summary strong { color: var(--ink); font-size: 1.7rem; line-height: 1; }
.rating-heading { align-items: end; }
.rating-table-stage { position: relative; min-height: 260px; }
.rating-table th:first-child,
.rating-table td:first-child { width: 52px; text-align: center; }
.rating-table th:nth-child(2),
.rating-table td:nth-child(2) { min-width: 220px; text-align: left; }
.fistf-rating-rank {
  color: var(--green-dark);
  font-size: .78rem;
  font-weight: 900;
  white-space: nowrap;
}
.rating-player { color: var(--ink); font-size: .88rem; font-weight: 850; text-decoration: none; }
.rating-player:hover { color: var(--green-dark); text-decoration: underline; }
.rating-value { display: block; color: var(--ink); font-size: 1rem; font-weight: 950; }
.rating-meter {
  width: 76px;
  height: 3px;
  display: block;
  overflow: hidden;
  margin: 4px 0 0 auto;
  background: #dce3df;
}
.rating-meter span { height: 100%; display: block; background: var(--green); }
.rating-change { font-weight: 900; }
.rating-change.is-up { color: var(--green-dark); }
.rating-change.is-down { color: var(--red); }
.rating-change.is-flat { color: var(--muted); }
.rating-confidence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #d6b26a;
  border-radius: 4px;
  background: #fff6df;
  color: #74530b;
  padding: 4px 7px;
  font-size: .58rem;
  font-weight: 900;
  text-transform: uppercase;
}
.rating-confidence.is-reliable {
  border-color: #8dc3b5;
  background: #e8f5f1;
  color: var(--green-dark);
}
.rating-confidence small { color: inherit; font-size: .54rem; opacity: .72; }
.rating-method {
  max-width: 900px;
  margin: 18px 0 0 auto;
  color: var(--muted);
  font-size: .67rem;
  line-height: 1.55;
  text-align: right;
}
.rating-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 16px 0 0;
}
.rating-pagination[hidden] { display: none; }
.rating-pagination button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.rating-pagination button:hover:not(:disabled) { border-color: var(--ink); }
.rating-pagination button:disabled { cursor: default; opacity: .38; }
.rating-pagination span { color: var(--muted); font-size: .68rem; font-weight: 800; }

@media (max-width: 900px) {
  .portal-nav { display: none; }
  .masthead-grid,
  .profile-grid { grid-template-columns: 1fr; }
  .palmares-grid { grid-template-columns: minmax(0, 1fr); }
  .masthead-grid { gap: 34px; }
  .masthead-scoreboard { display: grid; grid-template-columns: repeat(3, 1fr); }
  .scoreboard-title { grid-column: 1 / -1; }
  .scoreboard-row { display: block; }
  .scoreboard-row strong { display: block; margin-top: 8px; }
  .insight-grid { grid-template-columns: 1fr; }
  .insight { min-height: 190px; }
  .data-lab-hero-grid { grid-template-columns: 1fr; gap: 34px; min-height: 0; }
  .lab-index { display: grid; grid-template-columns: repeat(3,1fr); }
  .lab-index a { padding-right: 12px; }
  .world-grid { grid-template-columns: 1fr 1fr; }
  .world-grid .profile-block:first-child { grid-column: 1 / -1; }
  .lab-palmares-grid { grid-template-columns: 1fr; }
  .generation-grid { grid-template-columns: 1fr; }
  .surprise-layout { grid-template-columns: 1fr 1fr; }
  .surprise-feature { grid-column: 1 / -1; min-height: 300px; }
  .profile-stat-strip { grid-template-columns: repeat(3, 1fr); }
  .head-to-head-hero-inner { grid-template-columns: minmax(0, 1fr) 120px minmax(0, 1fr); gap: 18px; }
  .head-to-head-photo { width: 82px; }
  .head-to-head-grid { grid-template-columns: 1fr; }
  .rating-hero-inner { grid-template-columns: 1fr; gap: 34px; }
  .profile-stat:nth-child(3) { border-right: 0; }
  .profile-stat:nth-child(n+4) { border-top: 1px solid #3c4743; }
}

@media (max-width: 680px) {
  .portal-shell { width: min(calc(100% - 22px), 1240px); }
  .portal-header-inner { min-height: 58px; }
  .portal-brand img { width: 31px; height: 31px; }
  .portal-brand strong { font-size: .92rem; }
  .portal-brand span { display: none; }
  .language-select { width: 58px; padding-right: 20px; }
  .header-search-popover {
    position: fixed;
    top: 64px;
    right: 11px;
    left: 11px;
    width: auto;
    transform-origin: top center;
  }
  .masthead-grid { min-height: 0; padding: 42px 0 34px; }
  .portal-masthead h1 { font-size: clamp(2.25rem, 14vw, 4.1rem); }
  .masthead-grid { gap: 24px; padding-top: 34px; padding-bottom: 28px; }
  .masthead-scoreboard { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scoreboard-title { grid-column: 1 / -1; padding: 11px 12px; }
  .scoreboard-row {
    display: block;
    min-width: 0;
    padding: 12px 8px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    text-align: center;
  }
  .scoreboard-row:last-child { border-right: 0; }
  .scoreboard-row span { display: block; overflow: hidden; font-size: .68rem; text-overflow: ellipsis; }
  .scoreboard-row strong { display: block; margin-top: 8px; font-size: 1.45rem; }
  .section-heading { display: block; }
  .section-heading p,
  .section-heading .text-link { margin-top: 12px; }
  .profile-table-heading { display: grid; align-items: stretch; }
  .profile-table-filter { width: 100%; }
  .data-lab-hero-grid { padding: 34px 0 32px; }
  .data-lab-hero h1 { font-size: clamp(2.3rem,13vw,4.2rem); }
  .lab-index { grid-template-columns: 1fr 1fr; }
  .lab-index a { min-height: 48px; }
  .lab-controls { display: block; padding: 15px 0; }
  .lab-controls p { margin-top: 10px; text-align: left; }
  .leaderboard-layout { grid-template-columns: 1fr; gap: 18px; }
  .metric-tabs { flex-direction: row; overflow-x: auto; border-top: 0; border-bottom: 1px solid rgba(97,68,0,.25); }
  .metric-tabs button { min-width: max-content; padding: 0 10px; border-bottom: 0; }
  .metric-tabs button[aria-selected="true"] { padding-left: 10px; box-shadow: inset 0 -4px var(--ink); }
  .ranked-story-row { grid-template-columns: 28px minmax(130px,1fr) 62px; gap: 9px; }
  .ranked-story-row .story-bar { display: none; }
  .record-grid { grid-template-columns: 1fr; }
  .record-feature { min-height: 255px; padding: 22px; }
  .subsection-heading { display: block; }
  .subsection-heading p { margin-top: 8px; }
  .rivalry-row { grid-template-columns: 22px minmax(0,1fr) 54px minmax(0,1fr); gap: 7px; }
  .rivalry-player { display: grid; gap: 2px; }
  .rivalry-player.left { justify-content: stretch; text-align: right; }
  .rivalry-player.left strong { order: 2; }
  .world-grid { grid-template-columns: 1fr; }
  .world-grid .profile-block:first-child { grid-column: auto; }
  .team-rank-grid { grid-template-columns: 1fr; }
  .honours-controls { display: block; }
  .honours-controls .category-tabs { margin-top: 14px; }
  .generation-panel { padding: 17px; }
  .lab-panel-heading { display: block; }
  .lab-panel-heading > p { margin-top: 9px; }
  .generation-total { display: block; max-width: none; margin-top: 8px; text-align: left; }
  .youth-event-row { grid-template-columns: 23px minmax(120px, 1fr) 56px 25px; gap: 8px; }
  .pathway-row { grid-template-columns: 1fr; gap: 8px; padding: 11px 0; }
  .pathway-track { justify-content: flex-start; overflow-x: auto; padding-bottom: 2px; }
  .generation-duel { grid-template-columns: 1fr; gap: 16px; }
  .generation-duel-results { grid-template-columns: 1fr; }
  .generation-duel-match { padding: 14px 0; border-top: 1px solid #46514c; border-left: 0; }
  .generation-duel-match:first-child { border-top: 0; }
  .generation-balance { grid-column: auto; flex-wrap: wrap; }
  .surprise-layout { grid-template-columns: 1fr; }
  .surprise-feature { grid-column: auto; min-height: 285px; }
  .surprise-ranking { padding: 20px; }
  .surprise-method { text-align: left; }
  .surprise-dialog header { padding: 18px; }
  .surprise-dialog-list { padding: 0 18px 16px; }
  .surprise-dialog-row { grid-template-columns: 1fr 48px; gap: 8px 12px; padding: 13px 0; }
  .surprise-dialog-row time { grid-column: 1; }
  .surprise-dialog-score { grid-column: 1; }
  .surprise-dialog-context { grid-column: 1; }
  .surprise-dialog-row > strong { grid-column: 2; grid-row: 1 / span 3; }
  .tournament-row {
    grid-template-columns: 72px minmax(0, 1fr) 24px;
    gap: 11px;
    padding: 14px 0;
  }
  .tournament-row:hover { padding: 14px 5px; }
  .tournament-row .winner-list { grid-column: 2 / -1; }
  .archive-grid { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr; }
  .profile-hero-inner { grid-template-columns: 90px minmax(0, 1fr); gap: 18px; min-height: 230px; }
  .profile-photo { width: 90px; font-size: 2rem; }
  .profile-hero h1 { font-size: clamp(1.8rem, 9vw, 3rem); }
  .profile-stat-strip { grid-template-columns: repeat(2, 1fr); }
  .profile-stat:nth-child(odd) { border-right: 1px solid #3c4743; }
  .profile-stat:nth-child(even) { border-right: 0; }
  .profile-stat:nth-child(n+3) { border-top: 1px solid #3c4743; }
  .head-to-head-hero-inner {
    min-height: 330px;
    grid-template-columns: minmax(0, 1fr) 82px minmax(0, 1fr);
    gap: 10px;
    padding: 35px 0;
  }
  .head-to-head-player { display: grid; gap: 10px; justify-items: start; }
  .head-to-head-player.is-opponent { justify-items: end; }
  .head-to-head-player.is-opponent .head-to-head-photo { order: -1; }
  .head-to-head-photo { width: 68px; font-size: 1.2rem; }
  .head-to-head-player strong { font-size: .95rem; }
  .head-to-head-player small,
  .head-to-head-player em { font-size: .58rem; }
  .head-to-head-score strong { font-size: 2rem; }
  .head-to-head-score small { display: none; }
  .rating-hero-inner { min-height: 0; padding: 42px 0 36px; }
  .rating-hero h1 { font-size: clamp(2.2rem, 12vw, 4rem); }
  .rating-controls { grid-template-columns: 1fr; }
  .rating-summary > span { min-height: 68px; display: grid; gap: 4px; padding: 16px 10px; }
  .rating-summary strong { font-size: 1.35rem; }
  .rating-method { text-align: left; }
  .footer-inner { min-height: 140px; display: block; padding: 30px 0; }
  .footer-inner > * + * { margin-top: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
}
