:root {
  --bg: #090909;
  --bg-soft: #111111;
  --panel: rgba(18, 18, 18, 0.93);
  --panel-2: rgba(24, 24, 24, 0.96);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 214, 10, 0.28);
  --text: #f6f4ef;
  --muted: #a4a29c;
  --muted-2: #797770;
  --accent: #ffd60a;
  --accent-2: #ffbf00;
  --accent-soft: rgba(255, 214, 10, 0.12);
  --accent-glow: rgba(255, 214, 10, 0.22);
  --success: #a1ffac;
  --danger: #ff7676;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(255, 214, 10, 0.17), transparent 18%),
    radial-gradient(circle at left 16% top 8%, rgba(255, 214, 10, 0.08), transparent 22%),
    linear-gradient(180deg, #080808 0%, #0d0d0d 44%, #121212 100%);
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.26), transparent 92%);
  opacity: 0.35;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px 18px 48px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand-logo {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: cover;
  box-shadow: 0 0 18px rgba(255, 214, 10, 0.16);
  flex: 0 0 auto;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: 0.88rem;
}

.nav a {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease, transform 140ms ease;
}

.nav a:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.page {
  display: grid;
  gap: 18px;
}

.site-footer {
  margin-top: 18px;
  padding: 14px 16px;
}

.footer-accordion {
  display: grid;
  gap: 8px;
}

.footer-item {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}

.footer-item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 16px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.footer-item summary::-webkit-details-marker {
  display: none;
}

.footer-item summary::after {
  content: "+";
  color: var(--accent);
  font-size: 1rem;
  font-weight: 700;
}

.footer-item[open] summary {
  border-bottom: 1px solid var(--line);
  background: rgba(255, 214, 10, 0.04);
}

.footer-item[open] summary::after {
  content: "−";
}

.footer-item-body {
  padding: 12px 16px 14px;
}

.footer-item-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.88rem;
}

.footer-item-body p + p {
  margin-top: 10px;
}

.footer-item-body a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-note {
  font-size: 0.78rem;
  color: var(--muted-2) !important;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none !important;
}

.footer-social-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  flex-shrink: 0;
}

.footer-legal {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 0.82rem;
}

.cookie-banner {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(18, 18, 18, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.42);
}

.cookie-banner[hidden] {
  display: none;
}

.cookie-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.cookie-copy strong {
  font-size: 0.88rem;
}

.cookie-copy span {
  color: var(--muted);
  line-height: 1.35;
  font-size: 0.8rem;
}

.cookie-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.cookie-button {
  min-height: 38px;
  padding: 0 12px;
  font-size: 0.86rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(420px, 0.94fr);
  gap: 18px;
  padding: 22px;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(255, 214, 10, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.03), transparent 32%),
    var(--panel);
}

.hero::after {
  content: "";
  position: absolute;
  right: -110px;
  top: -100px;
  width: 340px;
  height: 340px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,214,10,0.22) 0%, rgba(255,214,10,0.07) 40%, transparent 72%);
  pointer-events: none;
}

.hero-copy,
.hero-side {
  position: relative;
  z-index: 1;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  padding: 8px 12px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: rgba(255, 214, 10, 0.08);
  border: 1px solid rgba(255, 214, 10, 0.18);
}

h1,
h2 {
  margin: 0;
  font-family: "Arial Narrow", "Avenir Next Condensed", "Helvetica Neue", sans-serif;
  text-transform: uppercase;
  letter-spacing: -0.05em;
}

h1 {
  max-width: 820px;
  font-size: clamp(2.1rem, 4vw, 3.6rem);
  line-height: 0.95;
}

h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 0.96;
}

.hero-sub,
.section-heading p,
.range-copy,
.chart-note {
  color: var(--muted);
  line-height: 1.6;
}

.hero-sub {
  max-width: 840px;
  font-size: 0.98rem;
  margin: 12px 0 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.hero-update-note {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  font-weight: 600;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.button.primary {
  color: #080808;
  background: var(--accent);
  border-color: transparent;
  box-shadow: 0 14px 36px rgba(255, 214, 10, 0.2);
}

.meta-pill,
.metric-pill,
.status-chip,
.identity-chip,
.quick-range {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
}

.meta-pill {
  color: var(--muted);
}

.hero-side {
  display: grid;
  gap: 12px;
}

.hero-stats {
  margin-top: 14px;
}

.hero-explainer {
  margin-top: 12px;
}

.hero-explainer-accordion {
  margin-top: 12px;
}

.hero-explainer-accordion summary {
  display: none;
}

.inset {
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255,214,10,0.08), transparent 26%),
    linear-gradient(145deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01)),
    #111111;
}

.top15-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.toggle-group {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
}

.toggle-button {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.toggle-button:hover {
  color: var(--text);
}

.toggle-button.active {
  background: var(--accent);
  color: #080808;
  font-weight: 800;
}

.top15-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.top15-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
}

.top15-title {
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.top15-list {
  display: grid;
  gap: 8px;
}

.top15-row {
  display: grid;
  grid-template-columns: 34px 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}

.top15-rank {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.top15-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: visible;
  text-overflow: initial;
  line-height: 1.2;
}

.top15-score {
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.trend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  font-size: 0.8rem;
  font-weight: 800;
}

.trend.up {
  color: var(--success);
}

.trend.down {
  color: #ff7f7f;
}

.trend.flat {
  color: var(--muted);
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.stat-card {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02)),
    var(--panel);
  box-shadow: var(--shadow);
}

.stat-card .label {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 1.78rem;
  line-height: 1;
}

.explainer-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.explainer-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
}

.explainer-card-wide {
  grid-column: 1 / -1;
}

.explainer-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.48;
  font-size: 0.9rem;
}

.content-grid,
.history-block {
  display: grid;
  gap: 16px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
}

.section-heading p {
  max-width: 720px;
  margin: 0;
}

.controls-panel {
  overflow: hidden;
}

.rankings-layout {
  margin-top: 6px;
}

.country-section-heading {
  margin-top: 22px;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.controls-grid-history {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.controls-grid-country {
  grid-template-columns: minmax(0, 1fr);
}

.field span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.toggle-group-wide {
  width: 100%;
  justify-content: stretch;
}

.toggle-group-wide .toggle-button {
  flex: 1 1 0;
}

.fixed-note {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  width: 100%;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding: 0 14px;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.field input:focus,
.field select:focus {
  border-color: rgba(255,214,10,0.45);
  box-shadow: 0 0 0 3px rgba(255,214,10,0.12);
  background: rgba(255,255,255,0.06);
}

.rankings-layout,
.history-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(340px, 0.8fr);
  gap: 16px;
}

.rankings-main {
  display: grid;
  gap: 12px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
}

.panel-title {
  font-size: 1.04rem;
  font-weight: 700;
  line-height: 1.4;
}

.metric-pill {
  color: var(--accent);
  border-color: rgba(255,214,10,0.18);
  background: rgba(255,214,10,0.1);
  font-weight: 700;
}

.table-wrap {
  overflow: auto;
  height: clamp(760px, 78vh, 1020px);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: left;
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #121212;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tbody tr {
  cursor: pointer;
  transition: background 120ms ease;
}

tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

tbody tr.selected {
  background: linear-gradient(90deg, rgba(255,214,10,0.15), rgba(255,214,10,0.03));
  box-shadow: inset 3px 0 0 var(--accent);
}

tbody td {
  padding-top: 18px;
  padding-bottom: 18px;
}

.rank-pill {
  display: inline-flex;
  min-width: 44px;
  justify-content: center;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  font-weight: 700;
}

.rank-pill-geo {
  color: var(--accent);
  border-color: rgba(255, 214, 10, 0.22);
  background: rgba(255, 214, 10, 0.08);
}

.rank-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.athlete-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.flag {
  display: inline-block;
  margin-right: 8px;
  vertical-align: baseline;
}

.elite15-badge {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 auto;
}

.favorite-button,
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease, opacity 140ms ease;
}

.favorite-button {
  font-size: 1.2rem;
  line-height: 1;
}

.profile-action-button {
  width: 34px;
  height: 34px;
}

.favorite-button.profile-action-button {
  font-size: 0.95rem;
}

.share-button {
  color: var(--muted);
}

.action-icon {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.favorite-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(255,214,10,0.35);
}

.favorite-button.active {
  color: var(--accent);
  background: rgba(255,214,10,0.1);
  border-color: rgba(255,214,10,0.3);
  box-shadow: 0 0 18px rgba(255,214,10,0.14);
}

.toggle-button.disabled,
.favorite-button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.slug {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
  word-break: break-word;
}

.score {
  color: var(--accent);
  font-weight: 800;
}

.table-footer-copy {
  color: var(--muted);
  font-size: 0.92rem;
}

.rankings-meta {
  display: grid;
  justify-items: center;
  gap: 12px;
}

.rankings-meta .table-footer-copy {
  justify-self: start;
  padding-left: 4px;
}

.athlete-panel {
  height: calc(clamp(760px, 78vh, 1020px) + 69px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.table-panel {
  height: calc(clamp(760px, 78vh, 1020px) + 69px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.athlete-detail {
  padding: 20px;
  overflow: auto;
  overflow-x: hidden;
  flex: 1 1 auto;
}

.country-layout {
  margin-top: 10px;
  grid-template-columns: minmax(0, 1.45fr) minmax(460px, 1.05fr);
}

.country-table-panel,
.country-panel {
  height: calc(clamp(560px, 64vh, 760px) + 69px);
}

.country-table-wrap {
  height: clamp(560px, 64vh, 760px);
}

.country-top {
  margin-bottom: 14px;
}

.country-average-grid {
  margin-top: 14px;
}

.country-leader-grid {
  margin-top: 14px;
}

.country-leader-card {
  padding-bottom: 12px;
}

.country-leader-list {
  display: grid;
  gap: 8px;
}

.country-leader-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 72px;
  align-items: center;
  gap: 8px;
  min-height: 38px;
}

.country-leader-rank {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.country-leader-name {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 0.82rem;
  min-width: 0;
  min-height: 32px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.country-leader-score {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  text-align: right;
}

.country-leader-empty {
  color: var(--muted);
  font-size: 0.92rem;
}

.empty-state {
  color: var(--muted);
  line-height: 1.6;
}

.athlete-top {
  margin-bottom: 0;
}

.athlete-top-main {
  display: grid;
  gap: 8px;
}

.athlete-headline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.athlete-headline-stacked {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.athlete-profile-headline-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 14px;
}

.athlete-profile-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: -6px;
  flex: 0 0 auto;
}

.auth-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
}

.auth-modal-shell[hidden] {
  display: none !important;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.66);
  backdrop-filter: blur(10px);
}

.auth-modal {
  position: relative;
  width: min(460px, calc(100vw - 32px));
  overflow: hidden;
}

.share-modal {
  width: min(520px, calc(100vw - 24px));
}

.auth-modal-body {
  padding: 18px;
  display: grid;
  gap: 14px;
}

.auth-mode-switch {
  justify-self: start;
}

.auth-helper {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-submit {
  margin-top: 4px;
}

.auth-message {
  min-height: 24px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.auth-message[data-kind="error"] {
  color: #ffb0b0;
  background: rgba(160, 35, 35, 0.2);
  border-color: rgba(255, 120, 120, 0.3);
}

.auth-message[data-kind="success"] {
  color: var(--success);
  background: rgba(33, 88, 57, 0.18);
  border-color: rgba(114, 204, 149, 0.26);
}

.share-modal-body {
  gap: 12px;
}

.share-preview-wrap {
  border-radius: 18px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top left, rgba(255,214,10,0.08), transparent 18%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015)),
    #111111;
  padding: 10px;
}

.share-preview-image {
  display: block;
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
  border-radius: 14px;
  background: #0d0d0d;
}

.share-helper {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.share-actions .button {
  min-width: 132px;
}

.athlete-top h3 {
  margin: 0;
  display: block;
  font-size: 1.55rem;
  line-height: 1.05;
  text-transform: uppercase;
  font-family: "Arial Narrow", "Avenir Next Condensed", "Helvetica Neue", sans-serif;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  min-width: 0;
  flex: 1 1 auto;
}

.athlete-share-capture {
  display: grid;
  gap: 12px;
}

.athlete-title-inline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  column-gap: 10px;
  max-width: 100%;
}

.athlete-title-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.athlete-title-name {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.02;
}

.athlete-share-capture.export-render {
  box-sizing: border-box;
  padding: 20px 34px 24px 22px;
  border-radius: 28px;
  background: #101010;
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.38);
  overflow: visible;
}

.athlete-share-capture.export-render .athlete-profile-actions {
  display: none;
}

.athlete-share-capture.export-render .detail-card,
.athlete-share-capture.export-render .profile-trend-card,
.athlete-share-capture.export-render .result-row {
  background: #1b1a15;
  border-color: rgba(255, 214, 10, 0.16);
  box-shadow: none;
}

.athlete-share-capture.export-render .profile-trend-svg {
  background: #101010;
}

.athlete-score-inline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.athlete-score-stack {
  display: grid;
  gap: 2px;
}

.athlete-summary-band {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.athlete-score-stack-featured {
  align-self: center;
  transform: translateY(-6px);
}

.athlete-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  min-width: 300px;
  padding-top: 2px;
}

.athlete-mini-stat {
  display: grid;
  gap: 4px;
}

.athlete-mini-stat span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.athlete-mini-stat strong {
  color: var(--text);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.05;
  white-space: nowrap;
}

.athlete-score-label {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.athlete-score-inline strong {
  color: var(--accent);
  font-size: 2rem;
  line-height: 1;
}

.athlete-rank-inline {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  margin-left: 4px;
  white-space: nowrap;
}

.athlete-rank-inline-secondary {
  margin-left: 2px;
}

.athlete-submeta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
  margin-top: -2px;
}

.athlete-submeta-dot {
  color: var(--muted-2);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 0;
}

.detail-card-wide {
  grid-column: 1 / -1;
}

.detail-card-compact {
  padding: 11px 14px;
}

.detail-card-compact strong {
  font-size: 0.95rem;
}

.detail-card {
  padding: 15px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 214, 10, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 214, 10, 0.08), rgba(255, 214, 10, 0.02)),
    rgba(255,255,255,0.03);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.detail-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.detail-card-header span {
  margin-bottom: 0;
}

.detail-card-meta {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-card span {
  display: block;
  color: var(--accent);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 9px;
  font-weight: 800;
}

.detail-card strong {
  line-height: 1.45;
  font-size: 1rem;
  word-break: break-word;
}

.detail-card-categories strong {
  font-size: 0.98rem;
}

.profile-trend-card {
  margin-top: 0;
  padding: 16px 16px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 214, 10, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 214, 10, 0.07), rgba(255, 214, 10, 0.015)),
    rgba(255,255,255,0.03);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.profile-trend-head {
  display: flex;
  align-items: start;
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}

.profile-trend-wrap {
  position: relative;
}

.profile-trend-svg {
  width: 100%;
  height: 220px;
  display: block;
  border-radius: 16px;
  background:
    radial-gradient(circle at top left, rgba(255,214,10,0.10), transparent 18%),
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.015)),
    #101010;
  border: 1px solid rgba(255,255,255,0.08);
}

.profile-trend-guide {
  stroke: rgba(255, 214, 10, 0.42);
  stroke-width: 1.5;
  stroke-dasharray: 4 5;
}

.profile-trend-guide-dot {
  fill: #ffd60a;
  stroke: rgba(9, 9, 9, 0.92);
  stroke-width: 2;
  filter: drop-shadow(0 0 10px rgba(255, 214, 10, 0.34));
}

.profile-trend-tooltip {
  position: absolute;
  left: 0;
  top: 0;
  min-width: 108px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 214, 10, 0.16);
  background: rgba(12, 12, 12, 0.94);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-100%);
  transition: opacity 140ms ease;
}

.profile-trend-tooltip.visible {
  opacity: 1;
}

.profile-trend-tooltip-date {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-trend-tooltip-score {
  margin-top: 4px;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 800;
}

.profile-trend-tooltip-rank {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 700;
}

.profile-trend-axis-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 10px;
  z-index: 2;
  pointer-events: none;
}

.profile-trend-axis-labels span {
  color: rgba(255, 255, 255, 0.52);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
}

.trend-empty {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
  padding: 10px 2px 2px;
}

.results-block {
  margin-top: 18px;
}

.results-title {
  margin: 0 0 10px;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
}

.result-list {
  display: grid;
  gap: 10px;
}

.result-row {
  padding: 14px 15px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.02)),
    rgba(255,255,255,0.03);
}

.result-row-highlighted {
  border-color: rgba(255, 214, 10, 0.26);
  background:
    linear-gradient(135deg, rgba(255, 214, 10, 0.12), rgba(255, 214, 10, 0.04)),
    linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.02)),
    rgba(255,255,255,0.03);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 12px 28px rgba(255, 214, 10, 0.08);
}

.result-row-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.result-row-left {
  display: grid;
  gap: 4px;
}

.result-row-left strong {
  line-height: 1.35;
}

.result-meta-inline {
  color: var(--muted);
  font-size: 0.86rem;
}

.result-row-right {
  display: grid;
  justify-items: end;
  gap: 6px;
  flex-shrink: 0;
}

.result-delta {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.result-delta.positive {
  color: var(--success);
}

.result-delta.negative {
  color: var(--danger);
}

.result-delta.neutral {
  color: var(--muted);
}

.result-rank {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.result-meta {
  margin-top: 8px;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
}

.quick-range-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 0 16px 16px;
  flex-wrap: wrap;
}

.quick-ranges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.quick-range {
  color: var(--muted);
  cursor: pointer;
}

.quick-range.active,
.quick-range:hover {
  color: var(--accent);
  border-color: var(--line-strong);
  background: var(--accent-soft);
}

.chart-wrap {
  position: relative;
  padding: 14px 16px 18px;
}

#historyChart {
  width: 100%;
  height: 650px;
  display: block;
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(255,214,10,0.08), transparent 16%),
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)),
    #0f0f0f;
  border: 1px solid rgba(255,255,255,0.08);
}

.chart-tooltip {
  position: absolute;
  min-width: 240px;
  max-width: 300px;
  pointer-events: none;
  background: rgba(14, 14, 14, 0.98);
  color: var(--text);
  border-radius: 18px;
  padding: 14px 15px;
  box-shadow: 0 22px 44px rgba(0,0,0,0.44);
  transform: translate(16px, -50%);
  opacity: 0;
  transition: opacity 120ms ease;
  border: 1px solid rgba(255,214,10,0.18);
}

.chart-tooltip.visible {
  opacity: 1;
}

.tooltip-title {
  font-weight: 800;
  font-size: 1rem;
  margin-bottom: 4px;
}

.tooltip-date {
  color: var(--muted);
  font-size: 0.84rem;
  margin-bottom: 10px;
}

.tooltip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 10px;
  font-size: 0.88rem;
}

.tooltip-grid strong {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.history-side {
  display: grid;
  gap: 16px;
}

.summary-grid {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
}

.legend-wrap {
  max-height: 60vh;
  overflow: auto;
}

.legend-table {
  width: 100%;
  border-collapse: collapse;
}

.legend-table th,
.legend-table td {
  padding: 11px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  vertical-align: top;
  text-align: left;
}

.legend-table th {
  position: sticky;
  top: 0;
  background: #121212;
  z-index: 2;
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.legend-table tbody tr {
  transition: background 120ms ease;
}

.legend-table tbody tr:hover {
  background: rgba(255,255,255,0.03);
}

.legend-table tbody tr.active {
  background: linear-gradient(90deg, rgba(255,214,10,0.14), rgba(255,214,10,0.03));
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  margin-top: 4px;
  box-shadow: 0 0 0 2px rgba(12,12,12,0.9);
}

.legend-score {
  color: var(--accent);
  font-weight: 800;
}

.loading,
.error {
  padding: 18px;
  color: var(--muted);
}

.error {
  color: var(--danger);
}

@media (max-width: 1180px) {
  .hero,
  .rankings-layout,
  .history-layout {
    grid-template-columns: 1fr;
  }

  .controls-grid,
  .controls-grid-history {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top15-grid {
    grid-template-columns: 1fr;
  }

  .explainer-grid {
    grid-template-columns: 1fr;
  }

  #historyChart {
    height: 560px;
  }
}

@media (max-width: 760px) {
  html {
    font-size: 14px;
  }

  html,
  body {
    overflow-x: hidden;
  }

  .shell {
    padding: 18px 14px 34px;
  }

  .brand {
    gap: 10px;
    font-size: 0.9rem;
  }

  .brand-logo {
    width: 21px;
    height: 21px;
    border-radius: 5px;
  }

  .nav a,
  .auth-chip {
    font-size: 0.82rem;
  }

  .button,
  .toggle-button,
  input,
  select {
    font-size: 0.9rem;
  }

  .section-heading h2,
  .hero h1 {
    letter-spacing: -0.03em;
  }

  .section-heading p,
  .hero-sub,
  .field span,
  .empty-state,
  .table-footer-copy {
    font-size: 0.88rem;
  }

  .panel-title {
    font-size: 1.32rem;
  }

  .topbar,
  .section-heading,
  .quick-range-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .controls-grid,
  .controls-grid-history,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 18px;
    gap: 14px;
  }

  .hero-side {
    display: none;
  }

  .hero-actions {
    align-items: flex-start;
  }

  .hero-update-note {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 0.82rem;
    white-space: normal;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card {
    min-height: 124px;
    padding: 14px;
  }

  .stat-card span {
    font-size: 0.8rem;
  }

  .stat-card strong {
    font-size: 1.42rem;
  }

  .hero-explainer-accordion {
    margin-top: 12px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    overflow: hidden;
  }

  .hero-explainer-accordion[open] {
    background: rgba(255, 255, 255, 0.04);
  }

  .hero-explainer-accordion summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    padding: 0 16px;
    cursor: pointer;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
    list-style: none;
  }

  .hero-explainer-accordion summary::-webkit-details-marker {
    display: none;
  }

  .hero-explainer-accordion summary::after {
    content: "+";
    color: var(--accent);
    font-size: 1.1rem;
    font-weight: 800;
  }

  .hero-explainer-accordion[open] summary {
    border-bottom: 1px solid var(--line);
  }

  .hero-explainer-accordion[open] summary::after {
    content: "−";
  }

  .hero-explainer {
    margin-top: 0;
    padding: 12px;
    grid-template-columns: 1fr;
  }

  .rankings-layout,
  .country-layout {
    grid-template-columns: 1fr;
  }

  .table-panel,
  .athlete-panel,
  .country-table-panel,
  .country-panel {
    height: auto;
  }

  .table-wrap,
  .country-table-wrap {
    height: auto;
    overflow-x: hidden;
    overflow-y: auto;
    max-height: 76vh;
  }

  .table-panel table,
  .country-table-panel table {
    min-width: 0;
    table-layout: fixed;
  }

  .table-panel th,
  .table-panel td,
  .country-table-panel th,
  .country-table-panel td {
    padding: 12px 10px;
  }

  .table-panel th,
  .country-table-panel th {
    font-size: 0.78rem;
  }

  .table-panel th:nth-child(4),
  .table-panel th:nth-child(5),
  .table-panel td:nth-child(4),
  .table-panel td:nth-child(5),
  .country-table-panel th:nth-child(4),
  .country-table-panel th:nth-child(5),
  .country-table-panel td:nth-child(4),
  .country-table-panel td:nth-child(5) {
    display: none;
  }

  .table-panel th:nth-child(1),
  .table-panel td:nth-child(1) {
    width: 112px;
  }

  .table-panel th:nth-child(3),
  .table-panel td:nth-child(3) {
    width: 90px;
    text-align: right;
  }

  .country-table-panel th:nth-child(1),
  .country-table-panel td:nth-child(1) {
    width: 86px;
  }

  .country-table-panel th:nth-child(3),
  .country-table-panel td:nth-child(3) {
    width: 104px;
    text-align: right;
  }

  .rank-cell {
    gap: 5px;
    flex-wrap: wrap;
  }

  .rank-pill {
    min-width: 38px;
    padding: 6px 8px;
    font-size: 0.8rem;
  }

  .rank-pill-geo {
    font-size: 0.78rem;
  }

  .athlete-name {
    gap: 6px;
    font-size: 0.88rem;
    min-width: 0;
  }

  .athlete-name span:last-child,
  .country-leader-name,
  .top15-name {
    min-width: 0;
  }

  .elite15-badge {
    width: 15px;
    height: 15px;
  }

  .score {
    font-size: 0.9rem;
  }

  .athlete-detail {
    padding: 16px;
  }

  .athlete-top-main,
  .athlete-headline-stacked,
  .athlete-profile-headline-row,
  .athlete-summary-band,
  .athlete-metrics-grid,
  .country-top,
  .country-leader-card,
  .result-row {
    min-width: 0;
  }

  .athlete-profile-headline-row {
    gap: 10px;
  }

  .athlete-profile-actions {
    margin-top: 0;
  }

  .athlete-summary-band {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 10px;
  }

  .athlete-score-stack-featured {
    transform: none;
  }

  .athlete-score-inline {
    gap: 8px;
    white-space: normal;
    align-items: flex-end;
  }

  .athlete-score-inline strong {
    font-size: 1.72rem;
  }

  .athlete-metrics-grid {
    min-width: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
  }

  .athlete-metrics-grid > .athlete-mini-stat:nth-child(even) {
    padding-left: 8px;
  }

  .athlete-mini-stat span,
  .athlete-mini-stat strong {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .athlete-mini-stat strong {
    font-size: 0.88rem;
  }

  .athlete-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .athlete-detail-grid .detail-card-wide {
    grid-column: 1 / -1;
  }

  .athlete-submeta {
    gap: 6px;
    font-size: 0.78rem;
  }

  .athlete-submeta-dot {
    display: none;
  }

  .profile-trend-head {
    align-items: start;
    gap: 10px;
  }

  .profile-trend-latest {
    font-size: 1.05rem;
  }

  .profile-trend-svg {
    height: 190px;
  }

  .country-average-grid,
  .country-leader-grid {
    grid-template-columns: 1fr;
  }

  .country-leader-row {
    grid-template-columns: 30px minmax(0, 1fr) 64px;
  }

  .country-leader-name {
    font-size: 0.74rem;
  }

  .country-leader-score {
    font-size: 0.7rem;
  }

  .footer-legal,
  .cookie-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-banner {
    left: 14px;
    right: 14px;
    max-width: none;
  }

  .cookie-copy strong {
    font-size: 0.84rem;
  }

  .cookie-copy span {
    font-size: 0.76rem;
  }

  .share-actions {
    flex-direction: column;
  }

  .share-actions .button {
    width: 100%;
  }

  .athlete-top {
    flex-direction: column;
  }

  .athlete-score-card {
    width: 100%;
    text-align: left;
  }

  h1 {
    font-size: clamp(2.4rem, 13vw, 4rem);
  }

  #historyChart {
    height: 480px;
  }
}
